7 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/rootlogon.C");
9 gROOT->LoadMacro(
"../Tools.C");
21 std::string
parfile =
"../data/mvddpm6GeV_digipar.root";
23 picture.ReplaceAll(
".root",
".ps");
25 TFile*
f =
new TFile(inFile.c_str());
26 TTree *
t=(TTree *) f->Get(
"pndsim") ;
27 t->AddFriend(
"pndsim",digiFile.c_str());
29 TClonesArray*
mc_array=
new TClonesArray(
"PndSdsMCPoint");
30 t->SetBranchAddress(
"MVDPoint",&mc_array);
33 t->SetBranchAddress(
"MVDPixelDigis",&digiPixel_array);
36 t->SetBranchAddress(
"MVDStripDigis",&digiStrip_array);
38 TGeoManager *
geoMan = (TGeoManager*) gDirectory->Get(
"FAIRGeom");
42 TH2D*
hisxy =
new TH2D(
"hisxy",
"",400,-15.,15.,400,-15.,15.);
43 hisxy->SetTitle(
"MVD MC Point, xy view;x / cm;y / cm");
45 TH2D*
hisrz =
new TH2D(
"hisrz",
"",400,-20.,20.,400,-15.,25.);
46 hisrz->SetTitle(
"MVD MC Point, rz view;z / cm;r/ cm");
48 TH1D*
hisde =
new TH1D(
"hisde",
"MVD MC Points, Energyloss",100,0.,0.002);
50 TH1D*
hismom =
new TH1D(
"hismom",
"MVD MC Points, momentum",100,0.,1.5);
54 TH1I*
hisPixelCol =
new TH1I(
"hispixelcol",
"Pixel column channel number on FE",n,low,low+n);
56 TH1I*
hisPixelRow =
new TH1I(
"hispixelrow",
"Pixel row channel number on FE",n,low,low+n);
58 TH1I*
hisPixelFE =
new TH1I(
"hispixelfe",
"Pixel FE number",n,low,low+n);
60 TH1I*
hisCol =
new TH1I(
"hiscol",
"column number",1200,0,1200);
62 TH1I*
hisRow =
new TH1I(
"hisrow",
"row number",1200,0,1200);
64 TH1D*
hisPixelCharge =
new TH1D(
"hispixelcharge",
"Pixel Charge content",100,0.,1e5);
66 TH2I*
hisStripTop =
new TH2I(
"hisstriptop",
"Strip Top channel&fe numbers",20,0,20,130,0,130);
68 TH2I*
hisStripBot =
new TH2I(
"hisstripbot",
"Strip Bot channel&fe numbers",20,0,20,130,0,130);
70 TH1I*
hisStripStrip =
new TH1I(
"hisstripstrip",
"Strip numbers",15*128,0,15*128);
72 TH1D*
hisStripCharge =
new TH1D(
"hisstripcharge",
"Strip Charge content",100,0.,1e5);
75 hisStripChargeTop->SetLineColor(kBlue);
79 TH1F*
fHChgDiff =
new TH1F(
"hchgdiff",
"#color[2]{StripMC}, #color[6]{PixelMC},\
80 #color[4]{StripNoise}, #color[30]{PixelNoise}, #color[1]{All};C/e^{-};",150,0.,1e4);
81 TH1F*
fHChgMC =
new TH1F(
"hchgmc",
";#DeltaC/e^{-} MC;",150,0.,1e4);
82 TH1F*
fHChgFake =
new TH1F(
"hchgfake",
";#DeltaC/e^{-} fake;",150,0.,1e4);
83 TH1F*
fHChgMCPix =
new TH1F(
"hchgmcPix",
";#DeltaC/e^{-} MC;",150,0.,1e4);
84 TH1F*
fHChgFakePix =
new TH1F(
"hchgfakePix",
";#DeltaC/e^{-} fake;",150,0.,1e4);
86 hisStripChargeBot->SetLineColor(kRed);
96 TFile*
parDB =
new TFile(parfile.c_str());
97 PndMvdStripDigiPar*
par = (PndMvdStripDigiPar*)gROOT->FindObject(
"MVDStripDigiParRect");
98 PndMvdCalcFePixel
pixelcalc(100, 100, 10);
103 for (Int_t j=0; j<nEvents && j<t->GetEntriesFast(); j++)
106 if(verbose) cout<<
"Event No "<<j<<endl;
109 for (Int_t
i=0;
i<mc_array->GetEntriesFast();
i++)
111 if(verbose) cout<<
"Point No "<<
i<<endl;
113 vecmc.SetXYZ(point->GetX(),point->GetY(),point->GetZ());
114 mommc.SetXYZ(point->GetPx(),point->GetPy(),point->GetPz());
115 hisxy->Fill(vecmc.x(),vecmc.y());
116 if(vecmc.y() > 0.) hisrz->Fill(vecmc.z(),vecmc.Perp());
117 else hisrz->Fill(vecmc.z(),-1.*vecmc.Perp());
118 hisde->Fill(point->GetEnergyLoss());
119 hismom->Fill(mommc.Mag());
123 for (Int_t
i=0;
i<digiPixel_array->GetEntriesFast();
i++)
126 fe = pixeldigi->
GetFE();
129 hisPixelCol->Fill(col);
130 hisPixelRow->Fill(row);
131 hisPixelFE->Fill(fe);
132 hisPixelCharge->Fill(pixeldigi->
GetCharge());
138 else fHChgMCPix->Fill(pixeldigi->
GetCharge());
142 for (Int_t
i=0;
i<digiStrip_array->GetEntriesFast();
i++)
145 fe = stripdigi->
GetFE();
147 int strip = fe * nrFeChannels +
col;
148 hisStripStrip->Fill(strip);
149 hisStripCharge->Fill(stripdigi->
GetCharge());
150 if (strip <= nrStrips)
152 hisStripTop->Fill(fe,col);
153 hisStripChargeTop->Fill(stripdigi->
GetCharge());
155 hisStripBot->Fill(fe,col);
156 hisStripChargeBot->Fill(stripdigi->
GetCharge());
160 else fHChgMC->Fill(stripdigi->
GetCharge());
167 TCanvas*
can1 =
new TCanvas(
"MvdTestPlot",
"MCHit view in MVD",0,0,a*
res,
b*res);
176 mypad->cd(3);gPad->SetLogy();hisde->DrawCopy();
177 mypad->cd(4);hismom->DrawCopy();
181 fHChgDiff->DrawCopy();
182 fHChgMC->SetLineColor(kRed);
183 fHChgMC->DrawCopy(
"same");
184 fHChgFake->SetLineColor(kBlue);
185 fHChgFake->DrawCopy(
"same");
186 fHChgMCPix->SetLineColor(6);
187 fHChgMCPix->DrawCopy(
"same");
188 fHChgFakePix->SetLineColor(30);
189 fHChgFakePix->DrawCopy(
"same");
197 mypad->cd(3);hisStripStrip->DrawCopy();
198 mypad->cd(4);gPad->SetLogy();
199 hisStripCharge->DrawCopy();
200 hisStripChargeTop->DrawCopy(
"sames");
201 hisStripChargeBot->DrawCopy(
"sames");
207 mypad->cd(1);hisPixelCol->DrawCopy();
208 mypad->cd(2);hisPixelRow->DrawCopy();
209 mypad->cd(3);hisCol->DrawCopy();
210 mypad->cd(4);hisRow->DrawCopy();
211 mypad->cd(5);hisPixelFE->DrawCopy();
212 mypad->cd(6);gPad->SetLogy();hisPixelCharge->DrawCopy();
215 can1->Print(picture.Data());
222 cout << endl << endl;
223 cout <<
"Macro finished succesfully." << endl;
224 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
Int_t GetPixelRow() const
Int_t GetIndex(int i=0) const
Int_t GetPixelColumn() const
Class for digitised strip hits.
std::string GetDigiFileName(std::string addon="", bool cut=false)
Double_t GetCharge() const
std::string GetSimFileName(std::string addon="", bool cut=false)
TClonesArray * digiStrip_array
A simple class which adds the corresponding file extensions to a given base class.
PndFileNameCreator namecreator("../data/mvddpm6GeV.root")
PndMvdCalcFePixel pixelcalc(100, 100, 10)
Data class to store the digi output of a pixel module.
TClonesArray * digiPixel_array