FairRoot/PandaRoot
Functions | Variables
analysis_point_hit_fwendcap.C File Reference

Go to the source code of this file.

Functions

gROOT Macro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
tsim SetBranchAddress ("MCTrack",&mctrack_array)
 
tsim SetBranchAddress ("EmcPoint",&point_array)
 
tsim SetBranchAddress ("EmcHit",&hit_array)
 
 if (nhits!=0)
 
HISThit_ene Fill (sum_hit_ene)
 

Variables

TFile * fsim = new TFile("../../emc_complete_1GeVphoton_FwEndCap.root")
 
TTree * tsim =(TTree *) fsim->Get("pndsim")
 
TClonesArray * mctrack_array =new TClonesArray("PndMCTrack")
 
TClonesArray * point_array =new TClonesArray("PndEmcPoint")
 
TClonesArray * hit_array =new TClonesArray("PndEmcHit")
 
Double_t theta_mc =photon_momentum.Theta()*(180./TMath::Pi())
 
Double_t phi_mc =photon_momentum.Phi()*(180./TMath::Pi())
 
Double_t ene_mc
 
Double_t point_ene
 
Double_t point_theta
 
Double_t point_phi
 
Double_t x_p
 
Double_t y_p
 
Double_t z_p
 
Double_t module_p
 
Double_t hit_ene
 
Double_t hit_theta
 
Double_t hit_phi
 
Double_t hit_id
 
Double_t hit_x
 
Double_t hit_y
 
Int_t id_p
 
Int_t crystal_pid
 
Int_t row_pid
 
TVector3 photon_momentum =mctrack->GetMomentum()
 
TLorentzVector p4mom
 
TH2F * hypad_xpad_p = new TH2F("ypad_xpad","crystal row vs col number (derived from POINT)",74,-37,37,74,-37,37)
 
TH2F * hx_y_p = new TH2F("x_y_p","x vs y (derived from POINT)",1000,-100,100,1000,-100,100)
 
TH1F * hid_p = new TH1F("id_p","id (derived from POINT)",140000000,300000000,340000000)
 
TH1F * hx_p = new TH1F("x_p","X (derived from POINT)",200,-100,100)
 
TH1F * hy_p = new TH1F("y_p","Y (derived from POINT)",200,-100,100)
 
TH1F * hz_p = new TH1F("z_p","Z (derived from POINT)",100,200,300)
 
TH1F * hmodule_p = new TH1F("module_p","Module (derived from POINT)",5,0.5,5.5)
 
TH2F * hxpad_x_p = new TH2F("xpad_x_p","x vs xpad (derived from POINT)",2*37.5,-37.5,37.5,211,-105,105)
 
TH2F * hypad_y_p = new TH2F("ypad_y_p","y vs ypad (derived from POINT)",2*37.5,-37.5,37.5,211,-105,105)
 
TH1F * hene_mc = new TH1F("hene_mc","MC energy (GeV)",100,0.0,1.05)
 
TH1F * hene_p = new TH1F("hene_p","DATA energy (GeV)",1000,0.0,0.1)
 
TH1F * hpoi_ene = new TH1F("hpoi_ene","SUM of Point energies (GeV)",100,0.0,1.05)
 
TH1F * hpoi_ene11_12 = new TH1F("hpoi_ene11_12","crystal [11,12] dep. energy (GeV)",100,0.0001,0.2)
 
TH1F * hpoi_ene12_12 = new TH1F("hpoi_ene12_12","crystal [12,12] dep. energy (GeV)",100,0.0001,0.2)
 
TH1F * hpoi_ene13_12 = new TH1F("hpoi_ene13_12","crystal [13,12] dep. energy (GeV)",100,0.0001,0.2)
 
TH1F * hpoi_ene14_12 = new TH1F("hpoi_ene14_12","crystal [14,12] dep. energy (GeV)",100,0.0001,0.2)
 
TH1F * h10 = new TH1F("h10","POINT Theta (MC)",180,0.,180.)
 
TH1F * h20 = new TH1F("h20","POINT Phi (MC)",360,0.,360.)
 
TH1F * h10d = new TH1F("h10d","POINT Theta (data)",180,0.,180.)
 
TH1F * h20d = new TH1F("h20d","POINT Phi (data)",360,0.,360.)
 
TH1F * h1 = new TH1F("h1","POINT Theta difference",100,-2.,2.)
 
TH1F * h2 = new TH1F("h2","POINT Phi difference",100,-2.,2.)
 
Int_t ncounts = tsim->GetEntriesFast()
 
cout<< "Number of events = "
<< ncounts<< endl;Int_t
module_h, id_h, crystal_hid,
row_hid;TH1F *HISTene_h=new
TH1F("HISTene_h","energy (hit)",
1000, 0.0001, 1.01);TH1F
*HISThit_ene=new TH1F("HISThit_ene","FwEndCap
energy (hit)",
1000, 0.0, 1.05);TH1F *HISTz_h=new
TH1F("HISTz_h","z (hit)",
100, 200, 300);TH2F
*HISTrow_x_h=new TH2F("HISTrow_x_h","row
vs x (hit)",
200,-100, 100, 2 *38.5,-38.5, 38.5);TH2F
*HISTrow_crystal_h=new TH2F("HISTrow_crystal_h","row
vs column (hit)",
2 *38.5,-38.5, 38.5, 2 *38.5,-38.5, 38.5);TH2F
*HISTy_x_h=new TH2F("HISTy_x_h","y
vs x (hit)",
211,-105, 105, 211,-105, 105);TH1F
*HISTtheta_h=new TH1F("HISTtheta_h","theta
(hit)", 180, 0, 180);TH2I
*HISTxpad_x_h=new TH2I("HISTxpad_x_h","",
10500,-105, 105, 100 *38.5,-38.5, 38.5);TH2I
*HISTypad_y_h=new TH2I("HISTypad_y_h","",
10500,-105, 105, 100 *38.5,-38.5, 38.5);TH1F
*HISTOhit_ene11_12=new TH1F("HISTOhit_ene11_12","crystal
[11,12] dep. energy (GeV)",
100, 0.0001, 1.01);TH1F
*HISTOhit_ene12_12=new TH1F("HISTOhit_ene12_12","crystal
[12,12] dep. energy (GeV)",
100, 0.0001, 1.01);TH1F
*HISTOhit_ene13_12=new TH1F("HISTOhit_ene13_12","crystal
[13,12] dep. energy (GeV)",
100, 0.0001, 1.01);TH1F
*HISTOhit_ene14_12=new TH1F("HISTOhit_ene14_12","crystal
[14,12] dep. energy (GeV)",
100, 0.0001, 1.01);Int_t
totalhits=0;Int_t
efficiencyCounter=0;Int_t
atLeastOneHitPerEventCounter=0;for(int
j=0;j< ncounts;j++){Int_t
efficiencyFlag=0;Int_t
atLeastOneHitPerEventFlag=0;Double_t
sum_hit_ene=0;tsim-> 
GetEntry (j)
 
PndMCTrackmctrack =(PndMCTrack *) mctrack_array->At(0)
 
Int_t nhits = hit_array->GetEntries()
 
 totalhits =nhits
 

Function Documentation

HISThit_ene Fill ( sum_hit_ene  )
if ( nhits!  = 0)

Definition at line 258 of file analysis_point_hit_fwendcap.C.

References PndEmcHit::GetEnergy(), PndEmcHit::GetModule(), PndEmcHit::GetXPad(), PndEmcHit::GetYPad(), hit(), hit_ene, i, and Pi.

262  {
263  PndEmcHit *hit=(PndEmcHit*)hit_array->At(i); // get the i-th hit (detector) of the event
264  module_h = hit->GetModule();
265 
266  if (module_h==3){
267  //hene_mc->Fill(p4mom.E());
268  hit_ene=hit->GetEnergy();
269  HISTene_h->Fill(hit_ene);
270  if (hit_ene >= 0.010) // 10 MeV threshold used (here only) to calculate the efficiency of the FwEndCap geometry
271  efficiencyFlag = 1;
272 
273 
274  //filling some histograms for a few crystals
275  if (hit->GetXPad()==11 && hit->GetYPad()==12)
276  HISTOhit_ene11_12->Fill(hit_ene);
277  else if (hit->GetXPad()==12 && hit->GetYPad()==12)
278  HISTOhit_ene12_12->Fill(hit_ene);
279  else if (hit->GetXPad()==13 && hit->GetYPad()==12)
280  HISTOhit_ene13_12->Fill(hit_ene);
281  else if (hit->GetXPad()==14 && hit->GetYPad()==12)
282  HISTOhit_ene14_12->Fill(hit_ene);
283 
284  sum_hit_ene+=hit_ene;
285 
286  TVector3 hit_pos(hit->GetX(),hit->GetY(),hit->GetZ()); // position of the center of the hit crystal
287  hit_theta=hit_pos.Theta()*(180./TMath::Pi());
288  hit_phi=hit_pos.Phi()*(180./TMath::Pi());
289 
290  h10->Fill(theta_mc);
291  h20->Fill(phi_mc);
292  h10d->Fill(hit_theta);
293  h20d->Fill(hit_phi);
294  h1->Fill(hit_theta-theta_mc);
295  h2->Fill(hit_phi-phi_mc);
296 
297  HISTz_h->Fill(hit->GetZ());
298  if (hit->GetXPad() >= 1)
299  HISTxpad_x_h->Fill(hit->GetX(),hit->GetXPad()-1);
300  else
301  HISTxpad_x_h->Fill(hit->GetX(),hit->GetXPad());
302 
303  if (hit->GetYPad() >= 1)
304  HISTypad_y_h->Fill(hit->GetY(),hit->GetYPad()-1);
305  else
306  HISTypad_y_h->Fill(hit->GetY(),hit->GetYPad());
307 
308  if (hit->GetYPad() >= 1)
309  HISTrow_x_h->Fill(hit->GetX(),hit->GetYPad()-1);
310  else
311  HISTrow_x_h->Fill(hit->GetX(),hit->GetYPad());
312 
313  id_h = hit->GetDetectorID();
314  crystal_hid = -(id_h%10000 -36); //crystal column number (the same as GetXPad())
315  row_hid = (id_h/1000000)%100 - 37; //crystal row number (the same as GetYPad())
316 
317  if (hit->GetXPad() <= -1 && hit->GetYPad() <= -1)
318  HISTrow_crystal_h->Fill(hit->GetXPad(),hit->GetYPad());
319  else if (hit->GetXPad() <= -1 && hit->GetYPad() >= 1)
320  HISTrow_crystal_h->Fill(hit->GetXPad(),hit->GetYPad()-1);
321  else if (hit->GetXPad() >= 1 && hit->GetYPad() <= -1)
322  HISTrow_crystal_h->Fill(hit->GetXPad()-1,hit->GetYPad());
323  else //if (hit->GetXPad() >= 1 && hit->GetYPad() >= 1)
324  HISTrow_crystal_h->Fill(hit->GetXPad()-1,hit->GetYPad()-1);
325 
326  HISTy_x_h->Fill(hit->GetX(),hit->GetY());
327  }
328  }
Short_t GetXPad() const
Definition: PndEmcHit.cxx:87
Int_t i
Definition: run_full.C:25
TClonesArray * hit_array
Double_t hit_ene
Double_t crystal_hid
Double_t module_h
Short_t GetYPad() const
Definition: PndEmcHit.cxx:120
virtual Double_t GetEnergy() const
Definition: PndEmcHit.h:54
Double_t hit_phi
Double_t row_hid
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:26
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
Double_t phi_mc
Double_t hit_theta
Double_t Pi
Short_t GetModule() const
Definition: PndEmcHit.h:58
Double_t theta_mc
gROOT Macro ( "$VMCWORKDIR/gconfig/rootlogon.C )
tsim SetBranchAddress ( "MCTrack"  ,
mctrack_array 
)
tsim SetBranchAddress ( "EmcPoint"  ,
point_array 
)
tsim SetBranchAddress ( "EmcHit"  ,
hit_array 
)

Variable Documentation

Int_t crystal_pid

Definition at line 23 of file analysis_point_hit_fwendcap.C.

Double_t ene_mc

Definition at line 19 of file analysis_point_hit_fwendcap.C.

TFile* fsim = new TFile("../../emc_complete_1GeVphoton_FwEndCap.root")

Definition at line 5 of file analysis_point_hit_fwendcap.C.

treereco GetEntry ( )

Definition at line 248 of file analysis_point_hit_fwendcap.C.

TH1F* h1 = new TH1F("h1","POINT Theta difference",100,-2.,2.)

Definition at line 56 of file analysis_point_hit_fwendcap.C.

TH1F* h10 = new TH1F("h10","POINT Theta (MC)",180,0.,180.)

Definition at line 51 of file analysis_point_hit_fwendcap.C.

TH1F* h10d = new TH1F("h10d","POINT Theta (data)",180,0.,180.)

Definition at line 53 of file analysis_point_hit_fwendcap.C.

TH1F* h2 = new TH1F("h2","POINT Phi difference",100,-2.,2.)

Definition at line 57 of file analysis_point_hit_fwendcap.C.

TH1F* h20 = new TH1F("h20","POINT Phi (MC)",360,0.,360.)

Definition at line 52 of file analysis_point_hit_fwendcap.C.

TH1F* h20d = new TH1F("h20d","POINT Phi (data)",360,0.,360.)

Definition at line 54 of file analysis_point_hit_fwendcap.C.

TH1F* hene_mc = new TH1F("hene_mc","MC energy (GeV)",100,0.0,1.05)

Definition at line 40 of file analysis_point_hit_fwendcap.C.

TH1F* hene_p = new TH1F("hene_p","DATA energy (GeV)",1000,0.0,0.1)

Definition at line 41 of file analysis_point_hit_fwendcap.C.

TH1F* hid_p = new TH1F("id_p","id (derived from POINT)",140000000,300000000,340000000)

Definition at line 30 of file analysis_point_hit_fwendcap.C.

TClonesArray* hit_array =new TClonesArray("PndEmcHit")

Definition at line 16 of file analysis_point_hit_fwendcap.C.

Double_t hit_ene

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Referenced by if().

Double_t hit_id

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t hit_phi

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t hit_theta

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t hit_x

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t hit_y

Definition at line 20 of file analysis_point_hit_fwendcap.C.

TH1F* hmodule_p = new TH1F("module_p","Module (derived from POINT)",5,0.5,5.5)

Definition at line 34 of file analysis_point_hit_fwendcap.C.

TH1F* hpoi_ene = new TH1F("hpoi_ene","SUM of Point energies (GeV)",100,0.0,1.05)

Definition at line 43 of file analysis_point_hit_fwendcap.C.

TH1F* hpoi_ene11_12 = new TH1F("hpoi_ene11_12","crystal [11,12] dep. energy (GeV)",100,0.0001,0.2)

Definition at line 44 of file analysis_point_hit_fwendcap.C.

TH1F* hpoi_ene12_12 = new TH1F("hpoi_ene12_12","crystal [12,12] dep. energy (GeV)",100,0.0001,0.2)

Definition at line 45 of file analysis_point_hit_fwendcap.C.

TH1F* hpoi_ene13_12 = new TH1F("hpoi_ene13_12","crystal [13,12] dep. energy (GeV)",100,0.0001,0.2)

Definition at line 46 of file analysis_point_hit_fwendcap.C.

TH1F* hpoi_ene14_12 = new TH1F("hpoi_ene14_12","crystal [14,12] dep. energy (GeV)",100,0.0001,0.2)

Definition at line 47 of file analysis_point_hit_fwendcap.C.

TH1F* hx_p = new TH1F("x_p","X (derived from POINT)",200,-100,100)

Definition at line 31 of file analysis_point_hit_fwendcap.C.

TH2F* hx_y_p = new TH2F("x_y_p","x vs y (derived from POINT)",1000,-100,100,1000,-100,100)

Definition at line 29 of file analysis_point_hit_fwendcap.C.

TH2F* hxpad_x_p = new TH2F("xpad_x_p","x vs xpad (derived from POINT)",2*37.5,-37.5,37.5,211,-105,105)

Definition at line 36 of file analysis_point_hit_fwendcap.C.

TH1F* hy_p = new TH1F("y_p","Y (derived from POINT)",200,-100,100)

Definition at line 32 of file analysis_point_hit_fwendcap.C.

TH2F* hypad_xpad_p = new TH2F("ypad_xpad","crystal row vs col number (derived from POINT)",74,-37,37,74,-37,37)

Definition at line 28 of file analysis_point_hit_fwendcap.C.

TH2F* hypad_y_p = new TH2F("ypad_y_p","y vs ypad (derived from POINT)",2*37.5,-37.5,37.5,211,-105,105)

Definition at line 37 of file analysis_point_hit_fwendcap.C.

TH1F* hz_p = new TH1F("z_p","Z (derived from POINT)",100,200,300)

Definition at line 33 of file analysis_point_hit_fwendcap.C.

Int_t id_p

Definition at line 23 of file analysis_point_hit_fwendcap.C.

TClonesArray* mctrack_array =new TClonesArray("PndMCTrack")

Definition at line 8 of file analysis_point_hit_fwendcap.C.

Double_t module_p

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Int_t ncounts = tsim->GetEntriesFast()

Definition at line 59 of file analysis_point_hit_fwendcap.C.

Int_t nhits = hit_array->GetEntries()
TLorentzVector p4mom

Definition at line 26 of file analysis_point_hit_fwendcap.C.

phi_mc =photon_momentum.Phi()*(180./TMath::Pi())

Definition at line 19 of file analysis_point_hit_fwendcap.C.

photon_momentum =mctrack->GetMomentum()

Definition at line 25 of file analysis_point_hit_fwendcap.C.

TClonesArray* point_array =new TClonesArray("PndEmcPoint")

Definition at line 12 of file analysis_point_hit_fwendcap.C.

Double_t point_ene

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t point_phi

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t point_theta

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Int_t row_pid

Definition at line 23 of file analysis_point_hit_fwendcap.C.

theta_mc =photon_momentum.Theta()*(180./TMath::Pi())

Definition at line 19 of file analysis_point_hit_fwendcap.C.

totalhits =nhits

Definition at line 257 of file analysis_point_hit_fwendcap.C.

TTree* tsim =(TTree *) fsim->Get("pndsim")

Definition at line 7 of file analysis_point_hit_fwendcap.C.

Double_t x_p

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t y_p

Definition at line 20 of file analysis_point_hit_fwendcap.C.

Double_t z_p

Definition at line 20 of file analysis_point_hit_fwendcap.C.