Definition at line 3 of file ana_MCpid.C.
References can1, ctime, dE, dEdX, detname, Double_t, dx, f, PndHypPoint::GetPxin(), PndHypPoint::GetPyin(), PndHypPoint::GetPzin(), PndHypPoint::GetXout(), PndHypPoint::GetYout(), PndHypPoint::GetZout(), hisde, hisdedx, hismom, hisrz, hisxy, hit, hit_array, i, layer, mc_array, mcpdg, nEvents, p, rtime, t, timer, TString, vecBack, vecFront, veco, vecP, vecs, and verbose.
8 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
10 gSystem->Load(
"libHypGe");
16 gStyle->SetPalette(1);
18 TFile*
f =
new TFile(
"sim_pidC.root");
19 TTree *
t=(TTree *) f->Get(
"pndsim") ;
20 TClonesArray*
hit_array=
new TClonesArray(
"PndHypPoint");
21 t->SetBranchAddress(
"HypPoint",&hit_array);
23 TClonesArray*
mc_array=
new TClonesArray(
"PndMCTrack");
24 t->SetBranchAddress(
"MCTrack",&mc_array);
29 TH2D*
hisxy =
new TH2D(
"hisxy",
"HYP MC Points, xy view",200,-5.,5.,200,-5.,5.);
30 TH2D*
hisrz =
new TH2D(
"hisrz",
"HYP MC Points, rz view",200,-80.,-70.,200,0,5.);
31 TH1D*
hisde =
new TH1D(
"hisde",
"HYP MC Points, Energyloss",200,0.,0.002);
34 TH2D*
hisdedx =
new TH2D(
"hisdedx",
"",200,0.,0.4,200,0.,1.0);
35 hisdedx->SetTitle(
"HYP MC Points, dE/dx(P);p/GeV / cm;dE/dx / (GeV/cm)");
39 TH1D*
hismom =
new TH1D(
"hismom",
"HYP MC Points, momentum",100,0.,1.5);
51 for (Int_t j=0; j<t->GetEntriesFast(); j++)
55 for (Int_t
i=0;
i<hit_array->GetEntriesFast();
i++)
57 if(verbose) cout<<
"Point No "<<
i<<endl;
65 vecs.SetXYZ(hit->GetX(), hit->GetY(), hit->GetZ());
69 dE=hit->GetEnergyLoss();
71 Int_t
layer = Int_t(10.*vecs->Mag());
72 if(verbose) cout<<vecs.x()<<
"\t"<<vecs.y()<<
"\t"<<vecs.z()<<endl;
74 hisxy->Fill(vecs.x(),vecs.y());
75 hisrz->Fill(vecs.z(),vecs.Perp());
82 hisdedx->Fill(p,dEdX);
89 TCanvas*
can1 =
new TCanvas(
"can1",
"MCHit view in HYP",0,0,800,800);
104 can1->Print(
"output.jpg");
113 cout << endl << endl;
114 cout <<
"Macro finished succesfully." << endl;
117 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;