FairRoot/PandaRoot
Functions | Variables
anaMvdSim.C File Reference

Go to the source code of this file.

Functions

gROOT LoadMacro ("../Tools.C")
 
 LoadPandaStyle ()
 
timer Start ()
 
t SetBranchAddress ("MVDPoint",&hit_array)
 
t SetBranchAddress ("MCTrack",&mc_array)
 
 for (Int_t j=0;j< nEvents &&j< t->GetEntriesFast();j++)
 
can1 Divide (2, 2)
 
can1 cd (1)
 
 DrawNice2DHisto (hisxy)
 
can1 cd (2)
 
 DrawNice2DHisto (hisrz)
 
can1 cd (3)
 
gPad SetLogy ()
 
hisde DrawCopy ("")
 
can1 cd (4)
 
can1 Print ("outAnaMvdSim.ps")
 
timer Stop ()
 

Variables

TStopwatch timer
 
PndFileNameCreator namecreator ("../data/Lars/MvdDtsSim.root")
 
std::string inFile = namecreator.GetSimFileName(false)
 
TFile * f = new TFile(inFile.c_str())
 
TTree * t =(TTree *) f->Get("pndsim")
 
TClonesArray * hit_array =new TClonesArray("PndSdsMCPoint")
 
TClonesArray * mc_array =new TClonesArray("PndMCTrack")
 
TH2D * hisxy = new TH2D("hisxy","MVD MC Points, xy view",100,-5.,5.,100,-5.,5.)
 
TH2D * hisrz = new TH2D("hisrz","MVD MC Points, rz view",100,-5.,5.,100,-5.,5.)
 
TH1D * hisde = new TH1D("hisde","MVD MC Points, Energyloss",100,0.,0.002)
 
int nEvents = 1000
 
bool verbose = false
 
TVector3 vecs
 
TVector3 veco
 
TCanvas * can1 = new TCanvas("can1","MCHit view in MVD",0,0,800,800)
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 Divide ( ,
 
)
hisde DrawCopy ( ""  )
DrawNice2DHisto ( hisxy  )
DrawNice2DHisto ( hisrz  )
for ( )

Definition at line 35 of file anaMvdSim.C.

References hit(), i, and mcpdg.

36  {
37  t->GetEntry(j);
38  if(verbose) cout<<"Event No "<<j<<endl;
39  for (Int_t i=0; i<hit_array->GetEntriesFast(); i++)
40  {
41  if(verbose) cout<<"Point No "<<i<<endl;
43  int mcpdg = -1;
44 
45  //PndMCTrack *mctruth = (PndMCTrack*)mc_array->At(hit->GetTrackID());
46  //mcpdg = mctruth->GetPdgCode();
47  //cout<<"mcpdg="<<mcpdg<<endl;
48 
49  vecs.SetXYZ(hit->GetX(), hit->GetY(), hit->GetZ());
50  Int_t layer = Int_t(10.*vecs->Mag());
51  if(verbose) cout<<vecs.x()<<"\t"<<vecs.y()<<"\t"<<vecs.z()<<endl;
52 
53  hisxy->Fill(vecs.x(),vecs.y());
54  hisrz->Fill(vecs.z(),((vecs.y()>0.)?1.:-1.)*vecs.Perp());
55  hisde->Fill(hit->GetEnergyLoss());
56  }//end for i (points in event)
57  }// end for j (events)
Int_t i
Definition: run_full.C:25
bool verbose
Definition: anaMvdSim.C:31
TH1D * hisde
Definition: anaMvdSim.C:27
TTree * t
Definition: anaMvdSim.C:18
TH2D * hisrz
Definition: anaMvdSim.C:26
TVector3 vecs
Definition: anaMvdSim.C:33
int mcpdg
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
TClonesArray * hit_array
Definition: anaMvdSim.C:19
TH2D * hisxy
Definition: anaMvdSim.C:25
gROOT LoadMacro ( "../Tools.C"  )
LoadPandaStyle ( )
can1 Print ( "outAnaMvdSim.ps"  )
t SetBranchAddress ( "MVDPoint"  ,
hit_array 
)
t SetBranchAddress ( "MCTrack"  ,
mc_array 
)
gPad SetLogy ( )
timer Start ( )
timer Stop ( )

Variable Documentation

TCanvas* can1 = new TCanvas("can1","MCHit view in MVD",0,0,800,800)

Definition at line 59 of file anaMvdSim.C.

Double_t ctime = timer.CpuTime()

Definition at line 77 of file anaMvdSim.C.

TFile* f = new TFile(inFile.c_str())

Definition at line 17 of file anaMvdSim.C.

TH1D* hisde = new TH1D("hisde","MVD MC Points, Energyloss",100,0.,0.002)

Definition at line 27 of file anaMvdSim.C.

TH2D* hisrz = new TH2D("hisrz","MVD MC Points, rz view",100,-5.,5.,100,-5.,5.)

Definition at line 26 of file anaMvdSim.C.

TH2D* hisxy = new TH2D("hisxy","MVD MC Points, xy view",100,-5.,5.,100,-5.,5.)

Definition at line 25 of file anaMvdSim.C.

TClonesArray* hit_array =new TClonesArray("PndSdsMCPoint")

Definition at line 19 of file anaMvdSim.C.

std::string inFile = namecreator.GetSimFileName(false)

Definition at line 15 of file anaMvdSim.C.

TClonesArray* mc_array =new TClonesArray("PndMCTrack")

Definition at line 22 of file anaMvdSim.C.

PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
int nEvents = 1000

Definition at line 30 of file anaMvdSim.C.

Double_t rtime = timer.RealTime()

Definition at line 76 of file anaMvdSim.C.

TTree* t =(TTree *) f->Get("pndsim")

Definition at line 18 of file anaMvdSim.C.

TStopwatch timer

Definition at line 10 of file anaMvdSim.C.

TVector3 veco

Definition at line 33 of file anaMvdSim.C.

Referenced by ana_MCOpt(), ana_MCpid(), and anaRadLength().

TVector3 vecs

Definition at line 33 of file anaMvdSim.C.

bool verbose = false

Definition at line 31 of file anaMvdSim.C.