#include "DStruct.h"

ClassImp(DStruct)

 DStruct::DStruct()
{
Clear();
}

 DStruct::~DStruct()
{
}

 void DStruct::Clear()
{
  Int_t i=0;
for(i=0;i<MAXPOINT;i++) 
  {
  Xtrack[i]=0; Ytrack[i]=0; Ytrack[i]=0; Charge[i]=0; Time[i]=0; Efield[i]=0;
  }

Ylenght=0; Xlenght=0; TTime=0; Steps=0; DStrip=0; TCharge=0;

}

 void DStruct::Info()
{
printf("\nParticle Cahrge= %d\n",PCharge);
printf("Number of Steps= %d\n",Steps);
printf("Drift Strip    = %d\n",DStrip);
printf("Pathlenght Y   = %f\n",Xlenght);
printf("Pathlenght X   = %f\n",Ylenght);
printf("Total Time     = %f\n",TTime*1e9);
printf("Total Charge   = %f\n",TCharge);
}

 void DStruct::Draw(Char_t *option)
{
  Char_t *name="Vector Plot";
  Float_t *x,*y;
  if(! strcmp(option,"xy") || ! strcmp(option,"yx")) {x=Xtrack; y=Ytrack;}
  if(! strcmp(option,"xt") || ! strcmp(option,"tx")) {x=Time; y=Xtrack;}
  if(! strcmp(option,"xc") || ! strcmp(option,"cx")) {x=Xtrack; y=Charge;}
  if(! strcmp(option,"yt") || ! strcmp(option,"ty")) {x=Time; y=Ytrack;}
  if(! strcmp(option,"yc") || ! strcmp(option,"cy")) {x=Ytrack; y=Charge;}
  if(! strcmp(option,"tc") || ! strcmp(option,"ct")) {x=Time; y=Charge;}
  
   TGraph *gr = new TGraph(Steps-1,&x[3],&y[3]);
  gr->SetTitle(name);
  gr->Draw("AL"); gr->GetHistogram()->Draw(); gr->Draw("AL*");
  
}

 void DStruct::GetCH(TH1F *histo,Int_t Update,Float_t Mult)
{
Int_t i;
TH1F *his=new TH1F("ch","Charge Histogram",histo->GetNbinsX(),histo->GetXaxis()->GetXmin(),histo->GetXaxis()->GetXmax());
Double_t *ch=new Double_t[Steps+1];
Axis_t *ti=new Axis_t[Steps+1]; // Changed when migrating from 2.23 to 2.25 or higher
 for(i=1;i<Steps+1;i++) {ch[i]=Charge[i]; ti[i]=Time[i];} // Changed when migrating from 2.23 to 2.25
his->FillN(Steps,&ti[1],&ch[1]); // Changed when migrating from 2.23 to 2.25
if(Update) {his->Scale(Mult); histo->Add(his); } else his->Copy(*histo);
delete his;
delete [] ti; // Changed when migrating from 2.23 to 2.25
delete [] ch;  // Changed when migrating from 2.23 to 2.25
}

//  void DStruct::GetGraph(TGraph *gr,Int_t What)
//  {
//  Int_t i;
//  gr=new TGraph(Steps,Xtrack,Ytrack);
//  gr->SetLineColor(1);
//  }





ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.