FairRoot/PandaRoot
Functions | Variables
anaLmdReco.C File Reference

Go to the source code of this file.

Functions

gROOT Macro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
timer Start ()
 
t SetBranchAddress ("LMDHitsStrip",&hit_array)
 
T SetBranchAddress ("LMDPoint",&mc_array)
 
h2 SetFillColor (kRed)
 
hisxy SetTitle ("LMD Reconstructed points, xy view;x / cm;y / cm")
 
hisrz SetTitle ("LMD Reconstructed points, rz view;z / cm;r/ cm")
 
mchisxy SetTitle ("LMD MC points, xy view;x / cm;y / cm")
 
mchisrz SetTitle ("LMD MC points, rz view;z / cm;r/ cm")
 
hisDiffXY SetTitle ("MC - RECO Hit coordinates xy view;#Deltax / cm;#Deltay / cm")
 
hisDiffRZ SetTitle ("MC - RECO Hit coordinates rz view;#Deltaz / cm;#Deltar / cm")
 
hisDiffX SetTitle ("MC - RECO Hit coordinate x;x / cm;")
 
hisDiffY SetTitle ("MC - RECO Hit coordinate y;y / cm;")
 
hisDiffZ SetTitle ("MC - RECO Hit coordinate z;z / cm;")
 
 for (Int_t j=0;j< t->GetEntriesFast();j++)
 
can1 Divide (3, 3)
 
gStyle SetOptFit ()
 
total SetLineColor (kRed)
 
total SetLineWidth (1)
 
can1 cd (1)
 
hisxy DrawCopy ()
 
can1 cd (2)
 
can1 cd (4)
 
can1 cd (5)
 
can1 cd (7)
 
hisDiffX DrawCopy ("")
 
can1 cd (8)
 
can1 cd (9)
 
can2 Divide (1, 2)
 
hisDiffY Fit (g1,"R")
 
hisDiffY Fit (g2,"R+")
 
total SetParameters (par)
 
hisDiffY Fit ("gaus")
 
timer Stop ()
 

Variables

TStopwatch timer
 
TFile * f = new TFile("/private/huagen/simdata/Lmd_Reco_DPM_elastic_6.2_1.9mrad_5M_2.root")
 
TTree * t =(TTree *) f->Get("pndsim")
 
TClonesArray * hit_array =new TClonesArray("PndSdsHit")
 
TFile * F = new TFile("/private/huagen/simdata/Lmd_DPM_elastic_6.2_1.9mrad_5M_2.root")
 
TTree * T =(TTree *) F->Get("pndsim")
 
TClonesArray * mc_array =new TClonesArray("PndSdsMCPoint")
 
TH3F * h2 = new TH3F("c2","Reconstructed Points", 200, -10, 10, 100, -10, 10, 100, 1070,1150)
 
TH3F * h3 = new TH3F("c3","MC Points", 200, -10, 10, 100, -10, 10, 100, 1070,1150)
 
TH2D * hisxy = new TH2D("hisxy","",200,-10.,10.,200,-10.,10.)
 
TH2D * hisrz = new TH2D("hisrz","",800,1070.,1150.,100,-10.,10.)
 
TH2D * mchisxy = new TH2D("mchisxy","",200,-10.,10.,200,-10.,10.)
 
TH2D * mchisrz = new TH2D("mchisrz","",800,1070.,1150.,100,-10.,10.)
 
TH2D * hisDiffXY = new TH2D("hisdiffxy","",100,-0.05,0.05,100,-0.05,0.05)
 
TH2D * hisDiffRZ = new TH2D("hisdiffrz","",100,-0.1.,0.1.,100,-0.05,0.05)
 
TH1F * hisDiffX = new TH1F("hisdiffx","",400,-0.02.,0.02.)
 
TH1F * hisDiffY = new TH1F("hisdiffy","",400,-0.02.,0.02)
 
TH1F * hisDiffZ = new TH1F("hisdiffz","",400,-0.02,0.02)
 
TH1D * RecoCharge = new TH1D("RecoCharge","",200,0.,1000)
 
TH1D * DigiCharge = new TH1D("DigiCharge","",200,0.,1000)
 
TH1D * MCCharge = new TH1D("MCCharge","",200,0.,1000)
 
TVector3 vecs
 
TVector3 vecmc
 
TVector3 vecdiif
 
double mcX =0
 
double mcY =0
 
double mcZ =0
 
double reX =0
 
double reY =0
 
double reZ =0
 
double diffX =0
 
double diffY =0
 
double diffZ =0
 
TVector3 RecoPosition
 
TVector3 MCposition
 
TVector3 vecdiff
 
TCanvas * can1 = new TCanvas("LmdTestPlot","MCHit view in LMD",0,0,800,800)
 
Double_t par [6]
 
TF1 * g1 = new TF1("g1","gaus",-0.004,0.003)
 
TF1 * g2 = new TF1("g2","gaus",-0.006,0.006)
 
TF1 * total = new TF1("total","gaus(0)+gaus(3)",-0.03,0.03)
 
 can2 = new TCanvas("can2","xy-difference",0,0,600,900)
 
TCanvas * can4 = new TCanvas("MC_Digi_Reco_Charge","Charge",0,0,600,900)
 
TCanvas * can5 = new TCanvas("MC_Reco_hits","Hits",0,0,600,900)
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 Divide ( ,
 
)
can2 Divide ( ,
 
)
hisxy DrawCopy ( )
hismom DrawCopy ( ""  )
hisDiffZ Fit ( g1  ,
"R"   
)
hisDiffZ Fit ( g2  ,
"R+"   
)
h10 Fit ( "gaus"  )
for ( Int_t  j = 0; j<t->GetEntriesFast(); j++)

Definition at line 79 of file anaLmdReco.C.

References PndSdsHit::GetEloss(), PndSdsMCPoint::GetPosition(), PndSdsHit::GetPosition(), PndSdsMCPoint::GetPositionOut(), PndSdsMCPoint::GetSensorID(), PndSdsHit::GetSensorID(), hit(), i, mcpdg, mcY, mcZ, point, and RecoPosition.

80  {
81  t->GetEntry(j);
82  T->GetEntry(j);
83  // Tdigi->GetEntry(j);
84  // if(verbose)
85  if(j%1000==0)
86  cout<<"**************Event No************ "<<j<<endl;
87  // cout<<"The Digis of this event is "<<digi_array->GetEntriesFast()<<endl;
88  for (Int_t i=0; i<hit_array->GetEntriesFast(); i++)
89  {
90  // cout<<"Point No "<<i<<endl;
91 
92  if(hit_array->GetEntriesFast()!= mc_array->GetEntriesFast())continue;
95  Int_t ID_hit = hit.GetSensorID();
96  Int_t ID_mc = point.GetSensorID();
97  if(hit_array->GetEntriesFast()!= mc_array->GetEntriesFast())continue;
98 /*
99  for(Int_t k=0;k<mc_array->GetEntriesFast();k++){
100  PndSdsMCPoint *mcpoint=(PndSdsMCPoint*)mc_array->At(k);
101  if (ID_hit == ID_mc)
102  { point=mcpoint;
103  cout<<"*********correspongding det name in MC is "<<ID_mc<<endl;
104  }
105  }
106 */
107  int mcpdg = -1;
108  mcX = (point->GetPosition().X()+point->GetPositionOut().X())/2;
109  mcY = (point->GetPosition().Y()+point->GetPositionOut().Y())/2;
110  mcZ = (point->GetPosition().Z()+point->GetPositionOut().Z())/2;
111 
112 // mcX = point->GetPosition().X();//+point->GetPositionOut().X())/2;
113 // mcY = point->GetPosition().Y();//+point->GetPositionOut().Y())/2;
114 // mcZ = point->GetPosition().Z();//+point->GetPositionOut().Z())/2;
115  RecoPosition = hit->GetPosition();
116  MCposition.SetXYZ(mcX,mcY,mcZ);
117 // MCposition = point->GetPosition();
119 
120  // Int_t layer = Int_t(10.*RecoPosition->Mag());
121  RecoCharge->Fill(hit->GetEloss()*1000000);
122  MCCharge->Fill(point->GetEnergyLoss()*1000000);
123 
124  // Int_t count=0;
125  // for(Int_t i=0;i<digi_array->GetEntriesFast();i++){
126  // PndSdsDigiStrip *digis = (PndSdsDigiStrip*)digi_array->At(i);
127  // Int_t FE=digis->GetFE();
128  // cout<<"the FE is:"<<FE<<endl;
129  // if(FE>10)count++;
130  // cout<<"the number of digis on backside is: "<<count<<endl;}
131  // if(count==2){
132 
133  h2->Fill(RecoPosition.x(),RecoPosition.y(),RecoPosition.z());
134  h3->Fill(MCposition.x(),MCposition.y(),MCposition.z());
135 
136  hisxy->Fill(RecoPosition.x(),RecoPosition.y());
137  mchisxy->Fill(mcX,mcY);
138  int vz=1; if(RecoPosition.y()<0) vz=-1;
139  hisrz->Fill(RecoPosition.z(),vz*RecoPosition.Perp());
140  mchisrz->Fill(MCposition.z(),vz*MCposition.Perp());
141  // cout<<RecoPosition.Perp()<<endl;
142  hisDiffXY->Fill(vecdiff.x(),vecdiff.y());
143  hisDiffRZ->Fill(vecdiff.z(),vecdiff.Perp());
144  hisDiffX->Fill(vecdiff.x());
145  hisDiffY->Fill(vecdiff.y());
146  hisDiffZ->Fill(vecdiff.z());
147 
148  // }//end for i (points in event)
149  // } loop with digi
150  } //loop digis == 3
151  }// end for j (events)
TVector3 MCposition
Definition: anaLmdReco.C:77
double mcY
Definition: anaLmdReco.C:74
TH2D * hisDiffXY
Definition: anaLmdReco.C:57
Int_t i
Definition: run_full.C:25
TVector3 GetPosition() const
Definition: PndSdsHit.h:93
TH1F * hisDiffX
Definition: anaLmdReco.C:62
TH3F * h2
Definition: anaLmdReco.C:41
TH2D * mchisrz
Definition: anaLmdReco.C:54
double mcZ
Definition: anaLmdReco.C:74
TVector3 GetPositionOut() const
Definition: PndSdsMCPoint.h:91
Double_t GetEloss() const
Definition: PndSdsHit.h:97
TH1F * hisDiffZ
Definition: anaLmdReco.C:66
Int_t GetSensorID() const
Definition: PndSdsMCPoint.h:89
double mcX
Definition: anaLmdReco.C:74
TH3F * h3
Definition: anaLmdReco.C:43
TH2D * hisDiffRZ
Definition: anaLmdReco.C:59
TTree * T
Definition: anaLmdReco.C:32
TClonesArray * point
Definition: anaLmdDigi.C:29
TVector3 RecoPosition
Definition: anaLmdReco.C:77
TH2D * hisrz
Definition: anaLmdReco.C:48
TClonesArray * mc_array
Definition: anaLmdReco.C:33
int mcpdg
TTree * t
Definition: anaLmdReco.C:26
TVector3 GetPosition() const
Definition: PndSdsMCPoint.h:90
TH2D * hisxy
Definition: anaLmdReco.C:46
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
TH1D * RecoCharge
Definition: anaLmdReco.C:69
TClonesArray * hit_array
Definition: anaLmdReco.C:27
TH1F * hisDiffY
Definition: anaLmdReco.C:64
Int_t GetSensorID() const
Definition: PndSdsHit.h:90
TH1D * MCCharge
Definition: anaLmdReco.C:71
TH2D * mchisxy
Definition: anaLmdReco.C:52
TVector3 vecdiff
Definition: anaLmdReco.C:77
gROOT Macro ( "$VMCWORKDIR/gconfig/rootlogon.C )
t SetBranchAddress ( "LMDHitsStrip"  ,
hit_array 
)
T SetBranchAddress ( "LMDPoint"  ,
mc_array 
)
h3 SetFillColor ( kRed  )
total SetLineColor ( kRed  )
total SetLineWidth ( )
gStyle SetOptFit ( )
total SetParameters ( par  )
hisxy SetTitle ( "LMD Reconstructed  points,
xy view;x/cm;y/cm  
)
hisrz SetTitle ( "LMD Reconstructed  points,
rz view;z/cm;r/cm  
)
mchisxy SetTitle ( "LMD MC  points,
xy view;x/cm;y/cm  
)
mchisrz SetTitle ( "LMD MC  points,
rz view;z/cm;r/cm  
)
hisDiffXY SetTitle ( "MC - RECO Hit coordinates xy view;#Deltax / cm;#Deltay / cm )
hisDiffRZ SetTitle ( "MC - RECO Hit coordinates rz view;#Deltaz / cm;#Deltar / cm )
hisDiffX SetTitle ( "MC - RECO Hit coordinate x;x / cm;"  )
hisDiffY SetTitle ( "MC - RECO Hit coordinate y;y / cm;"  )
hisDiffZ SetTitle ( "MC - RECO Hit coordinate z;z / cm;"  )
timer Start ( )
timer Stop ( )

Variable Documentation

TCanvas* can1 = new TCanvas("LmdTestPlot","MCHit view in LMD",0,0,800,800)

Definition at line 153 of file anaLmdReco.C.

can2 = new TCanvas("can2","xy-difference",0,0,600,900)

Definition at line 188 of file anaLmdReco.C.

TCanvas* can4 = new TCanvas("MC_Digi_Reco_Charge","Charge",0,0,600,900)

Definition at line 203 of file anaLmdReco.C.

Referenced by gem_material_ana1(), materialana(), and TrackHits().

TCanvas* can5 = new TCanvas("MC_Reco_hits","Hits",0,0,600,900)

Definition at line 211 of file anaLmdReco.C.

Referenced by anaclust(), gem_material_ana1(), and TrackHits().

Double_t ctime = timer.CpuTime()

Definition at line 222 of file anaLmdReco.C.

double diffX =0

Definition at line 76 of file anaLmdReco.C.

Referenced by PndLmdSigCleanTask::CheckXY(), and PndLmdTrksFilterTask::Exec().

double diffY =0

Definition at line 76 of file anaLmdReco.C.

Referenced by PndLmdSigCleanTask::CheckXY(), and PndLmdTrksFilterTask::Exec().

double diffZ =0

Definition at line 76 of file anaLmdReco.C.

TH1D* DigiCharge = new TH1D("DigiCharge","",200,0.,1000)

Definition at line 70 of file anaLmdReco.C.

TFile* f = new TFile("/private/huagen/simdata/Lmd_Reco_DPM_elastic_6.2_1.9mrad_5M_2.root")

Definition at line 24 of file anaLmdReco.C.

TFile* F = new TFile("/private/huagen/simdata/Lmd_DPM_elastic_6.2_1.9mrad_5M_2.root")

Definition at line 31 of file anaLmdReco.C.

Referenced by anaGemSmearing().

TF1* g1 = new TF1("g1","gaus",-0.004,0.003)
TF1* g2 = new TF1("g2","gaus",-0.006,0.006)
TH3F* h2 = new TH3F("c2","Reconstructed Points", 200, -10, 10, 100, -10, 10, 100, 1070,1150)

Definition at line 41 of file anaLmdReco.C.

TH3F* h3 = new TH3F("c3","MC Points", 200, -10, 10, 100, -10, 10, 100, 1070,1150)

Definition at line 43 of file anaLmdReco.C.

TH2D* hisDiffRZ = new TH2D("hisdiffrz","",100,-0.1.,0.1.,100,-0.05,0.05)

Definition at line 59 of file anaLmdReco.C.

Referenced by anaclust(), and anaGemSmearing().

TH1F* hisDiffX = new TH1F("hisdiffx","",400,-0.02.,0.02.)

Definition at line 62 of file anaLmdReco.C.

Referenced by anaclust(), and anaGemSmearing().

TH2D* hisDiffXY = new TH2D("hisdiffxy","",100,-0.05,0.05,100,-0.05,0.05)

Definition at line 57 of file anaLmdReco.C.

Referenced by anaclust(), and anaGemSmearing().

TH1F* hisDiffY = new TH1F("hisdiffy","",400,-0.02.,0.02)

Definition at line 64 of file anaLmdReco.C.

Referenced by anaclust(), and anaGemSmearing().

TH1F* hisDiffZ = new TH1F("hisdiffz","",400,-0.02,0.02)

Definition at line 66 of file anaLmdReco.C.

Referenced by anaclust(), and anaGemSmearing().

TH2D* hisrz = new TH2D("hisrz","",800,1070.,1150.,100,-10.,10.)

Definition at line 48 of file anaLmdReco.C.

TH2D* hisxy = new TH2D("hisxy","",200,-10.,10.,200,-10.,10.)

Definition at line 46 of file anaLmdReco.C.

TClonesArray* hit_array =new TClonesArray("PndSdsHit")

Definition at line 27 of file anaLmdReco.C.

TClonesArray* mc_array =new TClonesArray("PndSdsMCPoint")

Definition at line 33 of file anaLmdReco.C.

TH1D* MCCharge = new TH1D("MCCharge","",200,0.,1000)

Definition at line 71 of file anaLmdReco.C.

TH2D* mchisrz = new TH2D("mchisrz","",800,1070.,1150.,100,-10.,10.)

Definition at line 54 of file anaLmdReco.C.

TH2D* mchisxy = new TH2D("mchisxy","",200,-10.,10.,200,-10.,10.)

Definition at line 52 of file anaLmdReco.C.

TVector3 MCposition

Definition at line 77 of file anaLmdReco.C.

Referenced by PndTrkTracking2::Exec().

double mcX =0

Definition at line 74 of file anaLmdReco.C.

double mcY =0

Definition at line 74 of file anaLmdReco.C.

Referenced by for().

double mcZ =0

Definition at line 74 of file anaLmdReco.C.

Referenced by for().

g2 GetParameters&[3] par

Definition at line 156 of file anaLmdReco.C.

TH1D* RecoCharge = new TH1D("RecoCharge","",200,0.,1000)

Definition at line 69 of file anaLmdReco.C.

TVector3 RecoPosition

Definition at line 77 of file anaLmdReco.C.

Referenced by for().

double reX =0

Definition at line 75 of file anaLmdReco.C.

double reY =0

Definition at line 75 of file anaLmdReco.C.

double reZ =0

Definition at line 75 of file anaLmdReco.C.

Double_t rtime = timer.RealTime()

Definition at line 221 of file anaLmdReco.C.

TTree* t =(TTree *) f->Get("pndsim")

Definition at line 26 of file anaLmdReco.C.

TTree* T =(TTree *) F->Get("pndsim")

Definition at line 32 of file anaLmdReco.C.

Referenced by TTracksCatCounters< int >::AddCounter(), TTracksCatCounters< int >::AddCounters(), PndCAInternal::Allocator< T, alignment >::Alloc(), PndFTSInternal::Allocator< T, alignment >::Alloc(), PndCAInternal::Allocator< T, 0 >::Alloc(), PndFTSInternal::Allocator< T, 0 >::Alloc(), nsL1::SimdAlloc< T >::allocate(), anaGemSmearing(), Vec< T >::at(), BinaryStoreRead(), BinaryStoreWrite(), RhoKalmanVtxFitter::Calculate(), PndFTSCAParameters::CALocalToGlobal(), nsL1::SimdAlloc< T >::construct(), PndFTSInternal::AlignedData< typename PndFTSInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Size, alignment >::ConstructAlignedData(), PndCAInternal::AlignedData< typename PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Size, alignment >::ConstructAlignedData(), nsL1::SimdAlloc< T >::deallocate(), RhoLorentzVectorErr::DetermineChisq(), GFMaterialEffects::energyLossBrems(), PndCAParameters::GlobalToCALocal(), PndFTSCAParameters::GlobalToCALocal(), Photospp::PhotosRandom::initialize(), nsL1::SimdAlloc< T >::max_size(), FTSCAElementsOnStation< T >::operator+(), Vec< T >::operator[](), PndCAFixedArray< T, Size, alignment >::PndCAFixedArray(), PndFTSFixedArray< T, Size, alignment >::PndFTSFixedArray(), PndSttTrackFinderReal::PndSttTrkFindCircles(), RhoLorentzVectorErr::PrintOn(), CAMath::Recip(), PndFTSArray< PndFTSInternal::TypeForAlignmentHelper< PndFTSCAGBHit, alignment >::Type, Dim >::ReinterpretCast(), PndCAArray< PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Dim >::ReinterpretCast(), CAMath::RSqrt(), sign(), TTracksCatCounters< int >::TTracksCatCounters(), PndFTSInternal::AlignedData< typename PndFTSInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Size, alignment >::~AlignedData(), and PndCAInternal::AlignedData< typename PndCAInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Size, alignment >::~AlignedData().

TStopwatch timer

Definition at line 21 of file anaLmdReco.C.

TF1* total = new TF1("total","gaus(0)+gaus(3)",-0.03,0.03)

Definition at line 160 of file anaLmdReco.C.

TVector3 vecdiff

Definition at line 77 of file anaLmdReco.C.

Referenced by anaclust(), anaGemSmearing(), PndAnalysis::Propagator(), and QAmacro_mvd_ana().

TVector3 vecdiif

Definition at line 73 of file anaLmdReco.C.

Referenced by anaGemSmearing().

TVector3 vecmc

Definition at line 73 of file anaLmdReco.C.

TVector3 vecs

Definition at line 73 of file anaLmdReco.C.