4 gROOT->LoadMacro(
"$VMCWORKDIR/macro/mvd/Tools.C");
5 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
8 TFile*
fsim =
new TFile(
"data/fixed/sim_emc_g3_m3_1000eve_fixed.root");
10 TTree *
tsim=(TTree *) fsim->Get(
"pndsim") ;
12 tsim->SetBranchAddress(
"MCTrack",&mctrack_array);
16 tsim->SetBranchAddress(
"EmcPoint",&point_array);
36 TH2F *
hrow_crystal_p =
new TH2F(
"row_crystal",
"row vs crystal (POINT)",72,-36,36,72,-36,36);
37 TH2F *
hx_y_p =
new TH2F(
"x_y_p",
"x vs y (POINT)",200,-100,100,200,-100,100);
38 TH1F *
hid_p =
new TH1F(
"id_p",
"id (POINT)",140000000,300000000,340000000);
39 TH1F *
hx_p =
new TH1F(
"x_p",
"X (POINT)",100,-100,100);
40 TH1F *
hy_p =
new TH1F(
"y_p",
"Y (POINT)",100,-100,100);
41 TH1F *
hz_p =
new TH1F(
"z_p",
"Z (POINT)",100,200,300);
42 TH1F *
hmodule_p =
new TH1F(
"module_p",
"Module (POINT)",5,1,6);
44 TH2F *
hcp_z_p =
new TH2F(
"cp_z_p",
"Copy vs.Z pos (POINT)",4,1,5,80,200,240);
45 TH1F *
hz_cp1_p =
new TH1F(
"z_cp1_p",
"z (POINT)",300,1,300);
46 TH1F *
hz_cp2_p =
new TH1F(
"z_cp2_p",
"z (POINT)",300,1,300);
47 TH1F *
hz_cp3_p =
new TH1F(
"z_cp3_p",
"z (POINT)",300,1,300);
48 TH1F *
hz_cp4_p =
new TH1F(
"z_cp4_p",
"z (POINT)",300,1,300);
50 TH2F *
hxpad_x_p =
new TH2F(
"xpad_x_p",
"x vs xpad (POINT)",200,-100,100,200,-100,100);
51 TH2F *
hypad_y_p =
new TH2F(
"ypad_y_p",
"y vs ypad (POINT)",200,-100,100,200,-100,100);
53 TH2F *
hxpad_x_cp1_p =
new TH2F(
"xpad_x_cp1_p",
"x vs xpad _cp1_ (POINT)",200,-100,100,200,-100,100);
54 TH2F *
hxpad_x_cp2_p =
new TH2F(
"xpad_x_cp2_p",
"x vs xpad _cp2_ (POINT)",200,-100,100,200,-100,100);
55 TH2F *
hxpad_x_cp3_p =
new TH2F(
"xpad_x_cp3_p",
"x vs xpad _cp3_ (POINT)",200,-100,100,200,-100,100);
56 TH2F *
hxpad_x_cp4_p =
new TH2F(
"xpad_x_cp4_p",
"x vs xpad _cp4_ (POINT)",200,-100,100,200,-100,100);
58 TH2F *
hypad_y_cp1_p =
new TH2F(
"ypad_y_cp1_p",
"y vs ypad _cp1_ (POINT)",200,-100,100,200,-100,100);
59 TH2F *
hypad_y_cp2_p =
new TH2F(
"ypad_y_cp2_p",
"y vs ypad _cp2_ (POINT)",200,-100,100,200,-100,100);
60 TH2F *
hypad_y_cp3_p =
new TH2F(
"ypad_y_cp3_p",
"y vs ypad _cp3_ (POINT)",200,-100,100,200,-100,100);
61 TH2F *
hypad_y_cp4_p =
new TH2F(
"ypad_y_cp4_p",
"y vs ypad _cp4_ (POINT)",200,-100,100,200,-100,100);
64 TH1F *
hene_mc=
new TH1F(
"hene_mc",
"MC energy (GeV)",100,0.0,1.05);
66 TH1F *
hene_p=
new TH1F(
"hene_p",
"DATA energy (GeV)",1000,0.0,0.1);
68 TH1F *
hpoi_ene=
new TH1F(
"hpoi_ene",
"SUM of Points energy (GeV)",100,0.0,1.05);
69 TH1F *
hhit_ene=
new TH1F(
"hhit_ene",
"SUM of Hits energy (GeV)",100,0.0,1.05);
72 TH1F *
h10=
new TH1F(
"h10",
"POINT Theta (MC)",180,0.,180.);
73 TH1F *
h20=
new TH1F(
"h20",
"POINT Phi (MC)",360,-180.,180.);
74 TH1F *
h10d=
new TH1F(
"h10d",
"POINT Theta (data)",180,0.,180.);
75 TH1F *
h20d=
new TH1F(
"h20d",
"POINT Phi (data)",360,-180.,180.);
77 TH1F *
h1=
new TH1F(
"h1",
"POINT Theta difference",100,-5.,5.);
78 TH1F *
h2=
new TH1F(
"h2",
"POINT Phi difference",100,-5.,5.);
80 TH1F *
h1a=
new TH1F(
"h1a",
"POINT Theta difference -changed id ",100,-5.,5.);
81 TH1F *
h2a=
new TH1F(
"h2a",
"POINT Phi difference - changed id",100,-5.,5.);
83 TH1F *
h3=
new TH1F(
"h3",
"HIT Theta difference",100,-5.,5.);
84 TH1F *
h4=
new TH1F(
"h4",
"HIT Phi difference",100,-5.,5.);
86 TH1F *
h3a=
new TH1F(
"h3a",
"HIT Theta difference -changed id",100,-5.,5.);
87 TH1F *
h4a=
new TH1F(
"h4a",
"HIT Phi difference -changed id",100,-5.,5.);
90 cout <<
"POINTs for new FwEndCap == " << tsim->GetEntriesFast()<< endl;
92 Int_t
ncounts = tsim->GetEntriesFast();
93 cout <<
"No of events == " << ncounts<< endl;
94 for(
int j = 0; j <
ncounts; j++){
96 Float_t sum_point_ene=0;
101 theta_mc=photon_momentum.Theta()*(180./
TMath::Pi());
102 phi_mc=photon_momentum.Phi()*(180./
TMath::Pi());
105 Int_t
npoints = point_array->GetEntries();
106 cout <<
"POINT array == " << npoints<< endl;
116 point_ene=point->GetEnergyLoss();
117 hene_p->Fill(point_ene);
121 TVector3 point_pos(point->GetX(),point->GetY(),point->GetZ());
122 point_theta=point_pos.Theta()*(180./
TMath::Pi());
123 point_phi=point_pos.Phi()*(180./
TMath::Pi());
129 h10d->Fill(point_theta);
130 h20d->Fill(point_phi);
132 h1->Fill(point_theta-theta_mc);
133 h2->Fill(point_phi-phi_mc);
144 if (copy_p==1) hz_cp1_p->Fill(z_p);
145 if (copy_p==2) hz_cp2_p->Fill(z_p);
146 if (copy_p==3) hz_cp3_p->Fill(z_p);
147 if (copy_p==4) hz_cp4_p->Fill(z_p);
169 id_p = point->GetDetectorID();
171 crystal_pid = (id_p%10000);
172 row_pid = ((id_p/1000000)%100);
174 hmodule_p->Fill(module_p);
175 hcp_z_p->Fill(copy_p,z_p);
176 hrow_crystal_p->Fill(crystal_pid,row_pid);
179 hx_y_p->Fill(x_p,y_p);
183 hpoi_ene->Fill(sum_point_ene);
186 TCanvas*
c1 =
new TCanvas(
"c1",
"", 100, 100, 800, 800);
189 gStyle->SetPalette(1);
192 hrow_crystal_p->Draw(
"colz");
193 hrow_crystal_p->GetXaxis()->SetTitle(
"crystal number");
194 hrow_crystal_p->GetYaxis()->SetTitle(
"row number");
197 hx_y_p->Draw(
"colz");
198 hx_y_p->GetXaxis()->SetTitle(
"X position");
199 hx_y_p->GetYaxis()->SetTitle(
"Y position");
202 TLegend *
copies =
new TLegend(0.60,0.50,0.85,0.85);
203 copies->SetTextSize(0.05);
204 copies->SetFillColor(0);
205 copies->SetBorderSize(0);
206 copies->AddEntry(hz_p,
"All copies",
"l");
207 copies->AddEntry(hz_cp1_p,
"copy_1",
"l");
208 copies->AddEntry(hz_cp2_p,
"copy_2",
"l");
209 copies->AddEntry(hz_cp3_p,
"copy_3",
"l");
210 copies->AddEntry(hz_cp4_p,
"copy_4",
"l");
214 hz_cp1_p->SetLineColor(2);
215 hz_cp1_p->Draw(
"same");
217 hz_cp2_p->SetLineColor(3);
218 hz_cp2_p->Draw(
"same");
220 hz_cp3_p->SetLineColor(4);
221 hz_cp3_p->Draw(
"same");
223 hz_cp4_p->SetLineColor(6);
224 hz_cp4_p->Draw(
"same");
226 hz_p->GetXaxis()->SetTitle(
"Z position");
227 hz_p->GetYaxis()->SetTitle(
"Counts");
235 h10->SetLineColor(4);
237 h10d->SetLineColor(1);
239 h10->GetXaxis()->SetTitle(
"#theta (deg)");
242 h20->SetLineColor(4);
244 h20d->SetLineColor(1);
246 h20->GetXaxis()->SetTitle(
"#phi (deg)");
249 hxpad_x_p->Draw(
"colz");
250 hxpad_x_p->GetXaxis()->SetTitle(
"EmcPoint::GetXPad()");
251 hxpad_x_p->GetYaxis()->SetTitle(
"EmcPoint::GetX()");
256 h1->GetXaxis()->SetTitle(
"#theta_{POINT}-#theta_{MC}");
257 h1->GetYaxis()->SetTitle(
"Counts");
261 h2->GetXaxis()->SetTitle(
"#phi_{POINT}-#phi_{MC}");
262 h2->GetYaxis()->SetTitle(
"Counts");
265 hypad_y_p->Draw(
"colz");
266 hypad_y_p->GetXaxis()->SetTitle(
"EmcPoint::GetYPad()");
267 hypad_y_p->GetYaxis()->SetTitle(
"EmcPoint::GetY()");
269 TCanvas*
c2 =
new TCanvas(
"c2",
"", 100, 100, 800, 800);
272 gStyle->SetPalette(1);
275 hpoi_ene->SetLineColor(1);
277 hpoi_ene->GetXaxis()->SetTitle(
"Energy (GeV)");
280 hcp_z_p->Draw(
"colz");
283 hx_p->SetLineColor(1);
285 hx_p->GetXaxis()->SetTitle(
"X position (cm)");
288 hy_p->SetLineColor(1);
290 hy_p->GetXaxis()->SetTitle(
"Y position (cm)");
294 TCanvas*
c3a =
new TCanvas(
"c3a",
"", 100, 100, 800, 800);
297 gStyle->SetPalette(1);
300 hxpad_x_cp1_p->Draw(
"colz");
301 hxpad_x_cp1_p->GetXaxis()->SetTitle(
"EmcPoint::GetXPad() copy =1");
302 hxpad_x_cp1_p->GetYaxis()->SetTitle(
"EmcPoint::GetX()");
305 hxpad_x_cp2_p->Draw(
"colz");
306 hxpad_x_cp2_p->GetXaxis()->SetTitle(
"EmcPoint::GetXPad() copy =2");
307 hxpad_x_cp2_p->GetYaxis()->SetTitle(
"EmcPoint::GetX()");
310 hxpad_x_cp3_p->Draw(
"colz");
311 hxpad_x_cp3_p->GetXaxis()->SetTitle(
"EmcPoint::GetXPad() copy =3");
312 hxpad_x_cp3_p->GetYaxis()->SetTitle(
"EmcPoint::GetX()");
315 hxpad_x_cp4_p->Draw(
"colz");
316 hxpad_x_cp4_p->GetXaxis()->SetTitle(
"EmcPoint::GetXPad() copy =4");
317 hxpad_x_cp4_p->GetYaxis()->SetTitle(
"EmcPoint::GetX()");
319 TCanvas*
c3b =
new TCanvas(
"c3b",
"", 100, 100, 800, 800);
322 gStyle->SetPalette(1);
325 hypad_y_cp1_p->Draw(
"colz");
326 hypad_y_cp1_p->GetXaxis()->SetTitle(
"EmcPoint::GetYPad() copy =1");
327 hypad_y_cp1_p->GetYaxis()->SetTitle(
"EmcPoint::GetY()");
330 hypad_y_cp2_p->Draw(
"colz");
331 hypad_y_cp2_p->GetXaxis()->SetTitle(
"EmcPoint::GetYPad() copy =2");
332 hypad_y_cp2_p->GetYaxis()->SetTitle(
"EmcPoint::GetY()");
335 hypad_y_cp3_p->Draw(
"colz");
336 hypad_y_cp3_p->GetXaxis()->SetTitle(
"EmcPoint::GetYPad() copy =3");
337 hypad_y_cp3_p->GetYaxis()->SetTitle(
"EmcPoint::GetY()");
340 hypad_y_cp4_p->Draw(
"colz");
341 hypad_y_cp4_p->GetXaxis()->SetTitle(
"EmcPoint::GetYPad() copy =4");
342 hypad_y_cp4_p->GetYaxis()->SetTitle(
"EmcPoint::GetY()");
represents a mc hit in an emc crystal
TClonesArray * point_array
Short_t GetModule() const
TVector3 GetMomentum() const
TClonesArray * mctrack_array
Short_t GetCrystal() const
static PndEmcMapper * Instance()