9 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
10 gROOT->LoadMacro(
"Tools.C");
18 std::string
inFile =
"/private/huagen/simdata/Lmd_DPM_elastic_6.2_1.9mrad_5M_1.root";
19 std::string
digiFile =
"/private/huagen/simdata/Lmd_Digi_DPM_elastic_6.2_1.9mrad_5M_1.root";
20 std::string
parfile =
"/private/huagen/simdata/LmdParams.root";
22 TFile*
Digis =
new TFile(digiFile.c_str(),
"READ");
23 TTree*
tree=(TTree *) Digis->Get(
"pndsim") ;
25 TFile*
MCPoint =
new TFile(inFile.c_str(),
"READ");
26 TTree*
tree2 = (TTree*)MCPoint->Get(
"pndsim");
29 TClonesArray*
point=
new TClonesArray(
"PndSdsMCPoint");
30 tree2->SetBranchAddress(
"LMDPoint",&point);
33 tree->SetBranchAddress(
"LMDStripDigis",&digiStrip_array);
38 TH2D*
hisxy =
new TH2D(
"hisxy",
"",100,-10.,10.,100,-10.,10.);
39 hisxy->SetTitle(
"LMD MC Points, X vs Y view;X (cm);X (cm)");
41 TH2D*
hisrz =
new TH2D(
"hisrz",
"",100,1070.,1150.,100,1070.,1150.);
42 hisrz->SetTitle(
"LMD MC Point, rz view;z / cm;r/ cm");
44 TH1D*
hisde =
new TH1D(
"hisde",
"LMD MC Points, Energyloss",1000,0.,1000);
45 hisde->SetTitle(
"Lmd MC Energy Loss; X / keV ; Y / count");
48 TH2I*
hisStripTop =
new TH2I(
"StripFront",
"Strip Front channel & front end numbers",20,0,40,130,0,130);
49 hisStripTop->SetTitle(
"FE numbers vs Channels counts; X / FE; Y / channel");
50 TH2I*
hisStripBot =
new TH2I(
"StripBack",
"Strip Back channel & front end numbers",20,0,40,130,0,130);
51 hisStripBot->SetTitle(
"FE numbers vs Channels counts; X / FE; Y / channel");
53 TH1I*
hisStripStrip =
new TH1I(
"hisstripstrip",
"Strip numbers",2330,-10,4650);
54 hisStripStrip->SetTitle(
"Strips on Front/Back side; X / channels; Y / count");
56 TH1D*
hisStripCharge =
new TH1D(
"StripChargeTotal",
"Strip Charge content",1000,0.,2.5e5);
58 TH1D*
hisStripChargeTop =
new TH1D(
"StripChargeFront",
"Strip Charge content",1000,0.,2.5e5);
59 hisStripChargeTop->SetLineColor(kBlue);
61 hisStripChargeBot->SetLineColor(kRed);
70 TFile*
parDB =
new TFile(parfile.c_str());
77 if(verbose) cout<<
"the nrFeChannels and Strips are :"<< nrFeChannels<<
","<<nrStrips<<endl;
79 for (Int_t j=0; j<nEvents&&j<tree->GetEntriesFast(); j++)
81 if(verbose) std::cout<<
"the number of "<< j <<
"event is been processed"<<std::endl;
84 if(verbose) cout<<
"Event No "<<j<<endl;
87 for (Int_t
i=0;
i<point->GetEntriesFast();
i++)
89 if(verbose) cout<<
"Point No "<<
i<<endl;
95 de = Mypoint->GetEnergyLoss()*1000000;
98 if(verbose) cout<<
"the energy loss is "<<
de<<endl;
102 for (Int_t
i=0;
i<digiStrip_array->GetEntriesFast();
i++)
105 fe = stripdigi->
GetFE();
109 int strip = fe * nrFeChannels +
col;
110 hisStripStrip->Fill(strip);
111 hisStripCharge->Fill(stripdigi->
GetCharge());
114 if (strip <= nrStrips)
116 hisStripTop->Fill(fe,col);
117 hisStripChargeTop->Fill(stripdigi->
GetCharge());
119 hisStripBot->Fill(fe,col);
120 hisStripChargeBot->Fill(stripdigi->
GetCharge());
128 TCanvas*
can1 =
new TCanvas(
"Lmd MC point & Digis Plot",
"MCHit view in LMD",0,0,2*400,2*400);
148 can1->cd(5);hisStripStrip->DrawCopy();
150 hisStripCharge->DrawCopy();
151 hisStripChargeTop->DrawCopy(
"sames");
152 hisStripChargeBot->DrawCopy(
"sames");
182 cout << endl << endl;
183 cout <<
"Macro finished succesfully." << endl;
184 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
Class for digitised strip hits.
Double_t GetCharge() const
Digitization Parameter Class for MVD-Strip part.
TVector3 GetPosition() const
TClonesArray * digiStrip_array