Go to the source code of this file.
Definition at line 8 of file ReadHCal.C.
References c1, c2, directory, Double_t, f, fGeoH, PndMCTrack::GetMotherID(), PndGeoHandling::GetPath(), PndMCTrack::GetPdgCode(), PndMCTrack::GetStartVertex(), mc_array, name, par, point, r, t, track, TString, y, and Z.
12 const Int_t numStages = 15;
19 bool ScintBool[numStages];
20 bool AbsBool[numStages];
22 cout <<
"Initialize names" << endl;
24 for (Int_t w = 0 ; w < numStages ; w++)
26 ScintName[w] = Form(
"TestHCalScintillator%d_",w+1);
27 AbsName[w] = Form(
"TestHCalAbsorber%d_",w+1);
28 cout << ScintName[w] <<
"\t" << AbsName[w] << endl;
35 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
40 TString HitsFile =
"HCalMC.root";
41 TString ParFile =
"HCalMC_Params.root";
43 TFile *
f =
new TFile(HitsFile);
45 TFile *
par =
new TFile(ParFile);
46 par->Get(
"FairBaseParSet");
48 TH1F *steps =
new TH1F(
"Stages",
"Stages",numStages*2,0.5,2*numStages+0.5);
50 TH1F *elossTot =
new TH1F(
"eloss",
"eloss",1000,0.,1.1*MomInit);
52 TCanvas *
c1 =
new TCanvas();
53 TCanvas *
c2 =
new TCanvas();
57 TTree *
t=(TTree *) f->Get(
"pndsim") ;
59 TClonesArray*
mc_array=
new TClonesArray(
"PndSdsMCPoint");
60 t->SetBranchAddress(
"MVDPoint",&mc_array);
62 TClonesArray* tr_array=
new TClonesArray(
"PndMCTrack");
63 t->SetBranchAddress(
"MCTrack",&tr_array);
65 cout <<
"Events: " << t->GetEntries() << endl;
72 for (Int_t j = 0 ; j < t->GetEntries() ; j++)
76 for (Int_t o = 0 ; o < numStages ; o++)
85 if (j%10000 == 0) cout <<
"Ev. " << j << endl;
87 for (Int_t
y = 0 ;
y < mc_array->GetEntries() ;
y++)
94 eLoss += point->GetEnergyLoss();
102 for (Int_t
r = 0;
r < numStages ;
r++)
105 if (name.Contains(ScintName[
r]))
108 steps->Fill(2*(r+1)-1);
110 if (name.Contains(AbsName[r]))
113 steps->Fill(2*(r+1));
121 elossTot->Fill(eLoss);
127 steps->GetXaxis()->SetTitle(
"# of stages");
128 steps->GetYaxis()->SetTitle(
"# of protons");
133 elossTot->GetXaxis()->SetTitle(
"Energy loss / event [GeV]");
TString GetPath(Int_t shortID)
for a given shortID the path is returned
Class to access the naming information of the MVD.
TVector3 GetStartVertex() const
Int_t GetMotherID() const