FairRoot/PandaRoot
Functions | Variables
run_ana_llbar_evtgen.C File Reference

Go to the source code of this file.

Functions

gROOT LoadMacro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
 rootlogon ()
 
gROOT LoadMacro ("../Tools.C")
 
 LoadPandaStyle ()
 
timer Start ()
 
picture ReplaceAll (".root",".ps")
 
t AddFriend ("pndsim", digiFile.c_str())
 
t AddFriend ("pndsim", recoFile.c_str())
 
t SetBranchAddress ("MVDPoint",&mc_array)
 
t SetBranchAddress ("MVDPixelDigis",&digiPixel_array)
 
t SetBranchAddress ("MVDStripDigis",&digiStrip_array)
 
hisStripChargeBot SetLineColor (kRed)
 
 for (Int_t j=0;j< nEvents &&j< t->GetEntriesFast();j++)
 

Variables

bool verbose = false
 
TStopwatch timer
 
std::string inFile = "llbar_sim_evtgen.root"
 
std::string digiFile = "llbar_digi_evtgen.root"
 
std::string recoFile = "llbar_reco_evtgen.root"
 
TString picture = "digi_complete.root"
 
TFile * f = new TFile(inFile.c_str())
 
TTree * t =(TTree *) f->Get("pndsim")
 
TClonesArray * mc_array =new TClonesArray("PndSdsMCPoint")
 
TClonesArray * digiPixel_array =new TClonesArray("PndSdsDigiPixel")
 
TClonesArray * digiStrip_array =new TClonesArray("PndSdsDigiStrip")
 
TH1I * hNumberTrackPointsLambda = new TH1I("hNumberTrackPointsLambda","", 10, -0.5, 9.5)
 
TH1I * hNumberTrackPointsLambdaBar = new TH1I("hNumberTrackPointsLambdaBar","", 10, -0.5, 9.5)
 
TH1F * fHChgMC = new TH1F("hchgmc",";#DeltaC/e^{-} MC;",150,0.,1e4)
 
TH1F * fHChgFake = new TH1F("hchgfake",";#DeltaC/e^{-} fake;",150,0.,1e4)
 
TH1F * fHChgMCPix = new TH1F("hchgmcPix",";#DeltaC/e^{-} MC;",150,0.,1e4)
 
TH1F * fHChgFakePix = new TH1F("hchgfakePix",";#DeltaC/e^{-} fake;",150,0.,1e4)
 
TVector3 vecmc
 
TVector3 mommc
 
Double_t tmpx
 
Double_t tmpy
 
Double_t tmpz
 
TVector2 locals
 
TVector2 localmc
 
TVector2 localdiff
 
int col
 
int row
 
int fe
 
double x
 
double y
 

Function Documentation

t AddFriend ( "pndsim"  ,
digiFile.  c_str() 
)
t AddFriend ( "pndsim"  ,
recoFile.  c_str() 
)
for ( )

Definition at line 127 of file run_ana_llbar_evtgen.C.

References a, b, can1, ctime, Double_t, PndSdsDigi::GetFE(), PndSdsDigiPixel::GetPixelColumn(), PndSdsDigiPixel::GetPixelRow(), i, mypad, point, res, and rtime.

128  {
129  t->GetEntry(j);
130  if(verbose) cout<<"Event No "<<j<<endl;
131 
132  // ----- MC Points -----
133  for (Int_t i=0; i<mc_array->GetEntriesFast(); i++)
134  {
135  if(verbose) cout<<"Point No "<<i<<endl;
137  // vecmc.SetXYZ(point->GetX(),point->GetY(),point->GetZ());
138  // mommc.SetXYZ(point->GetPx(),point->GetPy(),point->GetPz());
139  // hisxy->Fill(vecmc.x(),vecmc.y());
140  // if(vecmc.y() > 0.) hisrz->Fill(vecmc.z(),vecmc.Perp());
141  // else hisrz->Fill(vecmc.z(),-1.*vecmc.Perp());
142  // hisde->Fill(point->GetEnergyLoss());
143  // hismom->Fill(mommc.Mag());
144  }
145 
146  // ----- PIXEL DIGIS -----
147  for (Int_t i=0; i<digiPixel_array->GetEntriesFast(); i++)
148  {
149  PndSdsDigiPixel *pixeldigi = (PndSdsDigiPixel*) digiPixel_array->At(i);
150 // PndSdsDigiPixel *pixelreco = (PndSdsDigiPixel*) recoPixel_array->At(i);
151  fe = pixeldigi->GetFE();
152  col = pixeldigi->GetPixelColumn();
153  row = pixeldigi->GetPixelRow();
154  // hisPixelCol->Fill(col);
155 // hisPixelRow->Fill(row);
156 // hisPixelFE->Fill(fe);
157  // hisPixelCharge->Fill(pixeldigi->GetCharge());
158  // pixelcalc.CalcSensorColRow(col,row,fe);
159  // hisCol->Fill(col);
160  // hisRow->Fill(row);
161  // hisDiffTimeWalk->Fill(pixelreco->GetTimeWalk(),pixeldigi->GetTimeWalk());
162 
163  // printf("reco TimeWalk %d - digi TimeWalk %d \n",pixelreco->GetTimeWalk(),pixeldigi->GetTimeWalk());
164  // fHChgDiff->Fill(pixeldigi->GetCharge());
165  // if( pixeldigi->GetIndex() == -1 ) fH//
166  // R. Kliemt
167  // ----- STRIP DIGIS -----
168  // for (Int_t i=0; i<digiStrip_array->GetEntriesFast(); i++)
169  // {
170  // PndSdsDigiStrip *stripdigi = digiStrip_array->At(i);
171  // fe = stripdigi->GetFE();
172  // col = stripdigi->GetChannel();
173  // int strip = fe * nrFeChannels + col;
174  // hisStripStrip->Fill(strip);
175  // hisStripCharge->Fill(stripdigi->GetCharge());
176  // if (strip <= nrStrips)
177  // {
178  // hisStripTop->Fill(fe,col);
179  // hisStripChargeTop->Fill(stripdigi->GetCharge());
180  // } else {
181  // hisStripBot->Fill(fe,col);
182  // hisStripChargeBot->Fill(stripdigi->GetCharge());
183  // }
184  // fHChgDiff->Fill(stripdigi->GetCharge());
185  // if( stripdigi->GetIndex() == -1 ) fHChgFake->Fill(stripdigi->GetCharge());
186  // else fHChgMC->Fill(stripdigi->GetCharge());
187  // }ChgFakePix->Fill(pixeldigi->GetCharge());
188  // else fHChgMCPix->Fill(pixeldigi->GetCharge());
189 // }
190 
191  // ----- STRIP DIGIS -----
192  for (Int_t i=0; i<digiStrip_array->GetEntriesFast(); i++)
193  {
194  PndSdsDigiStrip *stripdigi = digiStrip_array->At(i);
195 // fe = stripdigi->GetFE();
196 // col = stripdigi->GetChannel();
197 // int strip = fe * nrFeChannels + col;
198 // hisStripStrip->Fill(strip);
199 // hisStripCharge->Fill(stripdigi->GetCharge());
200 // if (strip <= nrStrips)
201 // {
202 // hisStripTop->Fill(fe,col);
203 // hisStripChargeTop->Fill(stripdigi->GetCharge());
204 // } else {
205 // hisStripBot->Fill(fe,col);
206 // hisStripChargeBot->Fill(stripdigi->GetCharge());
207 // }
208 // fHChgDiff->Fill(stripdigi->GetCharge());
209 // if( stripdigi->GetIndex() == -1 ) fHChgFake->Fill(stripdigi->GetCharge());
210 // else fHChgMC->Fill(stripdigi->GetCharge());
211  }
212 
213  }// end for j (events)
214  gROOT->SetStyle("Plain");
215 
216 // gStyle->SetTextFont(22);
217 // gStyle->SetLabelFont(22,"x");
218 // gStyle->SetLabelFont(22,"y");
219 // gStyle->SetLabelFont(22,"z");
220 
221 Int_t a = 2, b = 2, res=475;
222 TCanvas* can1 = new TCanvas("MvdTestPlot","MCHit view in MVD",0,0,a*res,b*res);
223 can1->Divide(a,b);
224 TPad* mypad=0;
225 
226 //can1->cd(1);
227 //mypad=gPad;
228 //mypad.Divide(2,2);
229 //mypad->cd(1);DrawNice2DHisto(hisxy);
230 //mypad->cd(2);DrawNice2DHisto(hisrz);
231 //mypad->cd(3);gPad->SetLogy();hisde->DrawCopy();
232 //mypad->cd(4);hismom->DrawCopy();
233 
234 can1->cd(2);
235 //hisDiffTimeWalk->DrawCopy();
236 //DrawNice2DHisto(hisDiffTimeWalk);
237 //gPad->SetLogy();
239 //fHChgMC->SetLineColor(kRed);
240 //fHChgMC->DrawCopy("same");
241 //fHChgFake->SetLineColor(kBlue);
242 //fHChgFake->DrawCopy("same");
243 //fHChgMCPix->SetLineColor(6);
244 //fHChgMCPix->DrawCopy("same");
245 //fHChgFakePix->SetLineColor(30);
246 //fHChgFakePix->DrawCopy("same");
247 
248 
249 //can1->cd(3);
250 //mypad=gPad;
251 //mypad.Divide(2,2);
252 //mypad->cd(1);DrawNice2DHisto(hisStripTop);
253 //mypad->cd(2);DrawNice2DHisto(hisStripBot);
254 //mypad->cd(3);hisStripStrip->DrawCopy();
255 //mypad->cd(4);gPad->SetLogy();
256 //hisStripCharge->DrawCopy();
257 //hisStripChargeTop->DrawCopy("sames");
258 //hisStripChargeBot->DrawCopy("sames");
259 //can1->Update();mypad=(TPad*)gPad; BetterStatBox(mypad);
260 
261 //can1->cd(4);
262 //mypad=gPad;
263 //mypad.Divide(2,3);
264 //mypad->cd(1);hisPixelCol->DrawCopy();
265 //mypad->cd(2);hisPixelRow->DrawCopy();
266 //mypad->cd(3);hisCol->DrawCopy();
267 //mypad->cd(4);hisRow->DrawCopy();
268 //mypad->cd(5);hisPixelFE->DrawCopy();
269 //mypad->cd(6);gPad->SetLogy();hisPixelCharge->DrawCopy();
270 
271 // can1->Update();
272 can1->Print(picture.Data());
273 
274 
275  // ----- Finish -------------------------------------------------------
276  timer.Stop();
277  Double_t rtime = timer.RealTime();
278  Double_t ctime = timer.CpuTime();
279  cout << endl << endl;
280  cout << "Macro finished succesfully." << endl;
281  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
282  cout << endl;
283  // ------------------------------------------------------------------------
284 
285 }
Int_t GetPixelRow() const
Int_t res
Definition: anadigi.C:166
Int_t i
Definition: run_full.C:25
TTree * b
TStopwatch timer
Int_t GetPixelColumn() const
Class for digitised strip hits.
TClonesArray * mc_array
Int_t GetFE() const
Definition: PndSdsDigi.h:57
TClonesArray * digiStrip_array
Int_t a
Definition: anaLmdDigi.C:126
bool verbose
Double_t
TClonesArray * point
Definition: anaLmdDigi.C:29
TPad * mypad
TTree * t
Double_t ctime
Definition: hit_dirc.C:114
Data class to store the digi output of a pixel module.
TCanvas * can1
Double_t rtime
Definition: hit_dirc.C:113
TClonesArray * digiPixel_array
TString picture
gROOT LoadMacro ( "$VMCWORKDIR/gconfig/rootlogon.C )
gROOT LoadMacro ( "../Tools.C"  )
LoadPandaStyle ( )
picture ReplaceAll ( ".root"  ,
".ps"   
)
rootlogon ( )

Definition at line 1 of file outdated/mpiTools/macros/emc/rootlogon.C.

2 {
3  gSystem->AddIncludePath("-I$VMCWORKDIR/emc");
4  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcDigi");
5  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcMC");
6  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcTools");
7  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcReco");
8  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcData");
9  gSystem->AddIncludePath("-I$VMCWORKDIR/pnddata");
10  gSystem->AddIncludePath("-I$VMCWORKDIR/base");
11  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
12  basiclibs();
13 
14  gSystem->Load("libDpmEvtGen.so");
15  gSystem->Load("libGeoBase");
16  gSystem->Load("libParBase");
17  gSystem->Load("libBase");
18  gSystem->Load("libTrkBase");
19  gSystem->Load("libPndData");
20  gSystem->Load("libField");
21  gSystem->Load("libPassive");
22  gSystem->Load("libGen");
23  gSystem->Load("libPGen");
24  gSystem->Load("libEmc");
25 
26  delete gRandom;
27  gRandom=new TRandom3(0);
28 }
basiclibs()
t SetBranchAddress ( "MVDPoint"  ,
mc_array 
)
t SetBranchAddress ( "MVDPixelDigis"  ,
digiPixel_array 
)
t SetBranchAddress ( "MVDStripDigis"  ,
digiStrip_array 
)
hisStripChargeBot SetLineColor ( kRed  )
timer Start ( )

Variable Documentation

int col

Definition at line 117 of file run_ana_llbar_evtgen.C.

std::string digiFile = "llbar_digi_evtgen.root"

Definition at line 25 of file run_ana_llbar_evtgen.C.

TClonesArray* digiPixel_array =new TClonesArray("PndSdsDigiPixel")

Definition at line 39 of file run_ana_llbar_evtgen.C.

TClonesArray* digiStrip_array =new TClonesArray("PndSdsDigiStrip")

Definition at line 42 of file run_ana_llbar_evtgen.C.

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

Definition at line 31 of file run_ana_llbar_evtgen.C.

int fe

Definition at line 117 of file run_ana_llbar_evtgen.C.

TH1F* fHChgFake = new TH1F("hchgfake",";#DeltaC/e^{-} fake;",150,0.,1e4)

Definition at line 106 of file run_ana_llbar_evtgen.C.

TH1F* fHChgFakePix = new TH1F("hchgfakePix",";#DeltaC/e^{-} fake;",150,0.,1e4)

Definition at line 108 of file run_ana_llbar_evtgen.C.

TH1F* fHChgMC = new TH1F("hchgmc",";#DeltaC/e^{-} MC;",150,0.,1e4)

Definition at line 105 of file run_ana_llbar_evtgen.C.

TH1F* fHChgMCPix = new TH1F("hchgmcPix",";#DeltaC/e^{-} MC;",150,0.,1e4)

Definition at line 107 of file run_ana_llbar_evtgen.C.

TH1I* hNumberTrackPointsLambda = new TH1I("hNumberTrackPointsLambda","", 10, -0.5, 9.5)

Definition at line 56 of file run_ana_llbar_evtgen.C.

TH1I* hNumberTrackPointsLambdaBar = new TH1I("hNumberTrackPointsLambdaBar","", 10, -0.5, 9.5)

Definition at line 57 of file run_ana_llbar_evtgen.C.

std::string inFile = "llbar_sim_evtgen.root"

Definition at line 24 of file run_ana_llbar_evtgen.C.

TVector2 localdiff

Definition at line 116 of file run_ana_llbar_evtgen.C.

TVector2 localmc

Definition at line 116 of file run_ana_llbar_evtgen.C.

TVector2 locals

Definition at line 116 of file run_ana_llbar_evtgen.C.

TClonesArray* mc_array =new TClonesArray("PndSdsMCPoint")

Definition at line 36 of file run_ana_llbar_evtgen.C.

TVector3 mommc

Definition at line 114 of file run_ana_llbar_evtgen.C.

TString picture = "digi_complete.root"

Definition at line 27 of file run_ana_llbar_evtgen.C.

std::string recoFile = "llbar_reco_evtgen.root"
int row

Definition at line 117 of file run_ana_llbar_evtgen.C.

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

Definition at line 32 of file run_ana_llbar_evtgen.C.

TStopwatch timer

Definition at line 13 of file run_ana_llbar_evtgen.C.

Double_t tmpx

Definition at line 115 of file run_ana_llbar_evtgen.C.

Double_t tmpy

Definition at line 115 of file run_ana_llbar_evtgen.C.

Double_t tmpz

Definition at line 115 of file run_ana_llbar_evtgen.C.

TVector3 vecmc

Definition at line 114 of file run_ana_llbar_evtgen.C.

bool verbose = false

Definition at line 4 of file run_ana_llbar_evtgen.C.

double x

Definition at line 118 of file run_ana_llbar_evtgen.C.

double y

Definition at line 118 of file run_ana_llbar_evtgen.C.