7 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
8 gROOT->LoadMacro(
"../Tools.C");
20 std::string
parfile =
"../data/Lars/MvdDtsParams.root";
22 picture.ReplaceAll(
".root",
".ps");
24 TFile*
f =
new TFile(inFile.c_str());
25 TTree *
t=(TTree *) f->Get(
"pndsim") ;
26 t->AddFriend(
"pndsim",digiFile.c_str());
28 TClonesArray*
mc_array=
new TClonesArray(
"PndSdsMCPoint");
29 t->SetBranchAddress(
"MVDPoint",&mc_array);
32 t->SetBranchAddress(
"MVDPixelDigis",&digiPixel_array);
35 t->SetBranchAddress(
"MVDStripDigis",&digiStrip_array);
37 TGeoManager *
geoMan = (TGeoManager*) gDirectory->Get(
"FAIRGeom");
41 TH2D*
hisxy =
new TH2D(
"hisxy",
"",400,-15.,15.,400,-15.,15.);
42 hisxy->SetTitle(
"MVD MC Point, xy view;x / cm;y / cm");
44 TH2D*
hisrz =
new TH2D(
"hisrz",
"",400,-20.,20.,400,-15.,25.);
45 hisrz->SetTitle(
"MVD MC Point, rz view;z / cm;r/ cm");
47 TH1D*
hisde =
new TH1D(
"hisde",
"MVD MC Points, Energyloss",100,0.,0.002);
49 TH1D*
hismom =
new TH1D(
"hismom",
"MVD MC Points, momentum",100,0.,1.5);
53 TH1I*
hisPixelCol =
new TH1I(
"hispixelcol",
"Pixel column channel number on FE",n,low,low+n);
55 TH1I*
hisPixelRow =
new TH1I(
"hispixelrow",
"Pixel row channel number on FE",n,low,low+n);
57 TH1I*
hisPixelFE =
new TH1I(
"hispixelfe",
"Pixel FE number",n,low,low+n);
59 TH1I*
hisCol =
new TH1I(
"hiscol",
"column number",1001,0,1000);
61 TH1I*
hisRow =
new TH1I(
"hisrow",
"row number",1001,0,1000);
63 TH1D*
hisPixelCharge =
new TH1D(
"hispixelcharge",
"Pixel Charge content",100,0.,1e5);
65 TH2I*
hisStripTop =
new TH2I(
"hisstriptop",
"Strip Top channel&fe numbers",20,0,20,130,0,130);
67 TH2I*
hisStripBot =
new TH2I(
"hisstripbot",
"Strip Bot channel&fe numbers",20,0,20,130,0,130);
69 TH1I*
hisStripStrip =
new TH1I(
"hisstripstrip",
"Strip numbers",15*128,0,15*128);
71 TH1D*
hisStripCharge =
new TH1D(
"hisstripcharge",
"Strip Charge content",100,0.,1e5);
74 hisStripChargeTop->SetLineColor(kBlue);
77 hisStripChargeBot->SetLineColor(kRed);
87 TFile*
parDB =
new TFile(parfile.c_str());
88 PndMvdStripDigiPar*
par = (PndMvdStripDigiPar*)gROOT->FindObject(
"MVDStripDigiParRect");
94 for (Int_t j=0; j<nEvents && j<t->GetEntriesFast(); j++)
97 if(verbose) cout<<
"Event No "<<j<<endl;
100 for (Int_t
i=0;
i<mc_array->GetEntriesFast();
i++)
102 if(verbose) cout<<
"Point No "<<
i<<endl;
104 vecmc.SetXYZ(point->GetX(),point->GetY(),point->GetZ());
105 mommc.SetXYZ(point->GetPx(),point->GetPy(),point->GetPz());
106 hisxy->Fill(vecmc.x(),vecmc.y());
107 if(vecmc.y() > 0.) hisrz->Fill(vecmc.z(),vecmc.Perp());
108 else hisrz->Fill(vecmc.z(),-1.*vecmc.Perp());
109 hisde->Fill(point->GetEnergyLoss());
110 hismom->Fill(mommc.Mag());
114 for (Int_t
i=0;
i<digiPixel_array->GetEntriesFast();
i++)
117 fe = pixeldigi->
GetFE();
120 hisPixelCol->Fill(col);
121 hisPixelRow->Fill(row);
122 hisPixelFE->Fill(fe);
123 hisPixelCharge->Fill(pixeldigi->
GetCharge());
130 for (Int_t
i=0;
i<digiStrip_array->GetEntriesFast();
i++)
133 fe = stripdigi->
GetFE();
136 hisStripStrip->Fill(strip);
137 hisStripCharge->Fill(stripdigi->
GetCharge());
138 if (strip <= nrStrips)
140 hisStripTop->Fill(fe,col);
141 hisStripChargeTop->Fill(stripdigi->
GetCharge());
143 hisStripBot->Fill(fe,col);
144 hisStripChargeBot->Fill(stripdigi->
GetCharge());
152 TCanvas*
can1 =
new TCanvas(
"MvdTestPlot",
"MCHit view in MVD",0,0,a*400,
b*400);
161 mypad->cd(3);gPad->SetLogy();hisde->DrawCopy();
162 mypad->cd(4);hismom->DrawCopy();
167 mypad->cd(1);hisPixelCol->DrawCopy();
168 mypad->cd(2);hisPixelRow->DrawCopy();
169 mypad->cd(3);hisCol->DrawCopy();
170 mypad->cd(4);hisRow->DrawCopy();
171 mypad->cd(5);hisPixelFE->DrawCopy();
172 mypad->cd(6);hisPixelCharge->DrawCopy();
180 mypad->cd(3);hisStripStrip->DrawCopy();
181 mypad->cd(4);hisStripCharge->DrawCopy();
182 hisStripChargeTop->DrawCopy(
"sames");
183 hisStripChargeBot->DrawCopy(
"sames");
202 cout << endl << endl;
203 cout <<
"Macro finished succesfully." << endl;
204 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
Int_t GetPixelRow() 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)
A simple class which adds the corresponding file extensions to a given base class.
PndMvdCalcFePixel pixelcalc(76, 84, 10)
PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
TClonesArray * digiPixel_array
TClonesArray * digiStrip_array
Data class to store the digi output of a pixel module.