FairRoot/PandaRoot
Functions | Variables
anaLmdCluster.C File Reference

Go to the source code of this file.

Functions

timer Start ()
 
tree1 SetBranchAddress ("LMDPoint",&mc_array)
 
tree1 SetBranchAddress ("MCTrack",&mc_track)
 
tree2 SetBranchAddress ("LMDHitsStrip",&hit_array)
 
 for (int i=0;i< nEvents &&i< tree1->GetEntriesFast();i++)
 
total SetLineColor (kRed)
 
total SetLineWidth (1)
 
can1 Divide (2, 2)
 
can1 cd (1)
 
mcTheta DrawCopy ()
 
can1 cd (2)
 
can1 cd (3)
 
gStyle SetOptFit ()
 
dTheta0 Fit ("total","R")
 
can2 cd (4)
 
timer Stop ()
 

Variables

TStopwatch timer
 
int nEvents = 1e7
 
bool verbose = false
 
double pi = TMath::Pi()
 
TFile * mcf = new TFile("/private/huagen/simdata/Lmd_MC_BD_DPM_elastic_6.2_1.9mrad_5M_1.root")
 
TTree * tree1 = (TTree*)mcf->Get("pndsim")
 
TClonesArray * mc_array = new TClonesArray("PndSdsMCPoint")
 
TClonesArray * mc_track = new TClonesArray("PndMCTrack")
 
TFile * rcf = new TFile("/private/huagen/simdata/Lmd_Reco_BD_DPM_elastic_6.2_1.9mrad_5M_1.root")
 
TTree * tree2 = (TTree*)rcf->Get("pndsim")
 
TClonesArray * hit_array = new TClonesArray("PndSdsHit")
 
TH1F * mcTheta = new TH1F("MCHit theta","Theta fitted by MCHits",300, 0.001, 0.01)
 
TH1F * rcTheta = new TH1F("Reco theta","Theta determined by RecoHits",300, 0.001, 0.01)
 
TH1F * refTheta = new TH1F("MCTrue theta","The track theta set in Generator",300, 0.001, 0.01)
 
TH1F * dTheta = new TH1F("FirstMCHit-MCTrue","delta theta between FirstMCHit and MCTrue",300,-0.003,0.003)
 
TH1F * dTheta0 = new TH1F("RecoHit-MCTrue","delta theta between RecoHit and MCTrue theta",300, -0.003,0.003)
 
TH1F * dTheta2 = new TH1F("MCHit-MCTrue","",300, -0.003,0.003)
 
TH1F * dTheta3 = new TH1F("RecoHit-MCHit","delta theta between RecoHit and MCHit",300, -0.003,0.003)
 
TF1 * trackFit = new TF1("trackFit","pol1",-40,40)
 
TVector3 vecmc
 
TVector3 vecrc
 
double mcX =0
 
double mcY =0
 
double mcZ =0
 
double rcX =0
 
double rcY =0
 
double rcZ =0
 
double trackthe
 
double mctheta
 
double rctheta
 
double mcfirstthe
 
double rcfirstthe
 
double dthe0
 
double dthe1
 
double dthe2
 
double dthe3
 
double dtheta
 
double mc_x [4]
 
double mc_y [4]
 
double mc_z [4]
 
double r_mc [4]
 
double rc_x [4]
 
double rc_y [4]
 
double rc_z [4]
 
double r_rc [4]
 
double r_mc_err [4]
 
double r_rc_err [4]
 
double z_mc_err [4]
 
double z_rc_err [4]
 
Double_t par [3]
 
TF1 * total = new TF1("total","gaus",-0.06,0.06)
 
TCanvas * can1 = new TCanvas("Theta","MC,RC,Track theta",0,0,800, 800)
 
TPad * mypad = 0
 
TCanvas * can2 = new TCanvas("Delta theat","MC,RC,Track",0,0,800, 800)
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

can1 cd ( )
can1 cd ( )
can1 cd ( )
can2 cd ( )
can1 Divide ( ,
 
)
hisTrackP DrawCopy ( )

Referenced by gem_material_ana1(), and materialana().

dTheta Fit ( "total"  ,
"R"   
)
for ( )

Definition at line 60 of file anaLmdCluster.C.

References PndMCTrack::GetMomentum(), PndMCTrack::GetMotherID(), PndSdsMCPoint::GetPosition(), PndSdsHit::GetPosition(), PndSdsMCPoint::GetPositionOut(), hit(), i, mctheta, mctrack, mcY, mcZ, point, CAMath::Sqrt(), track, and trackthe.

61  {
62  tree2->GetEntry(i);
63  tree1->GetEntry(i);
64  cout<<"the Event No is "<<i<<endl;
65 
66  if(hit_array->GetEntriesFast()==4)
67  {
68  for (int j=0; j<hit_array->GetEntriesFast();j++)
69  {// cout<<"the point no "<<j<<" of Event "<<i<<endl;
70  if(hit_array->GetEntriesFast()!=mc_array->GetEntriesFast()) continue;
71  PndSdsHit *hit = (PndSdsHit*)hit_array->At(j);
73 
74  mcX = (point->GetPosition().X()+point->GetPositionOut().X())/2;
75  mcY = (point->GetPosition().Y()+point->GetPositionOut().Y())/2;
76  mcZ = (point->GetPosition().Z()+point->GetPositionOut().Z())/2;
77 
78 // mcX = point->GetPosition().X();//+point->GetPositionOut().X())/2;
79 // mcY = point->GetPosition().Y();//+point->GetPositionOut().Y())/2;
80 // mcZ = point->GetPosition().Z();//+point->GetPositionOut().Z())/2;
81  cout<<"the mcX, mcY, mcZ are "<<mcX<<","<<mcY<<","<<mcZ<<endl;
82  vecmc.SetXYZ(mcX,mcY,mcZ);
83  vecrc = hit->GetPosition();
84  cout<<"the rcX, rcY, rcZ are "<<vecrc.x()<<","<<vecrc.Y()<<","<<vecrc.Z()<<endl;
85  Int_t iTrack = point->GetTrackID();
86  // cout<<"The iTrack (point->GetTrackID() is :"<<iTrack<<endl;
87  //if (iTrack>=0)
88  // {
89  PndMCTrack *track = (PndMCTrack*)mc_track->At(iTrack);
90  // }
91  if(track->GetMotherID()== -1) trackthe = track->GetMomentum().Theta();
92  cout<<"the track theta is "<<trackthe<<endl;
93  // }
94  mc_x[j]=vecmc.X();
95  mc_y[j]=vecmc.Y();
96  mc_z[j]=vecmc.Z()-1110;
97  r_mc[j]=TMath::Sqrt(mc_x[j]*mc_x[j]+mc_y[j]*mc_y[j]);
98  std::cout<<"the r_mc[j] is "<<r_mc[j]<<std::endl;
99  std::cout<<"the mc_z[j] is "<<mc_z[j]<<std::endl;
100  r_mc_err[j]=0;
101  z_mc_err[j]=0;
102 
103  rc_x[j]=vecrc.X();
104  rc_y[j]=vecrc.Y();
105  rc_z[j]=vecrc.Z()-1110;
106  r_rc[j]=TMath::Sqrt(rc_x[j]*rc_x[j]+rc_y[j]*rc_y[j]);
107  std::cout<<"the r_rc[j] is "<<r_rc[j]<<std::endl;
108  std::cout<<"the rc_z[j] is "<<rc_z[j]<<std::endl;
109  r_rc_err[j]=0;
110  z_rc_err[j]=0;
111  double tempmc = TMath::Sqrt(mc_x[0]*mc_x[0]+mc_y[0]*mc_y[0]);
112  mcfirstthe = TMath::ATan(tempmc/(mc_z[0]+1110));
113  cout<<"the first hit theta is "<<mcfirstthe<<endl;
114 
115  }//loop all events containing for 4 hits
116 
117  TGraphErrors *mctrack = new TGraphErrors(4,mc_z,r_mc,z_mc_err,r_mc_err);
118  mctrack->Fit("trackFit","ONF");
119  mctheta=TMath::ATan(trackFit->GetParameter(1));
120  cout<<"the mc fit theta is "<<mctheta<<endl;
121 
122  TGraphErrors *rctrack = new TGraphErrors(4,rc_z,r_rc,z_rc_err,r_rc_err);
123  rctrack->Fit("trackFit","ONF");
124  rctheta=TMath::ATan(trackFit->GetParameter(1));
125  cout<<"the rc fit theta is "<<rctheta<<endl;
126 
131 
132  //fill the histograms
133  rcTheta->Fill(rctheta);
134  mcTheta->Fill(mctheta);
135  refTheta->Fill(trackthe);
136 
137  dTheta0->Fill(dthe0);
138  dTheta2->Fill(dthe2);
139  dTheta3->Fill(dthe3);
140  dTheta->Fill(dtheta);
141  //fill the plots
142  }
143 }
PndMCTrack * mctrack
double mc_x[4]
Definition: anaLmdCluster.C:55
TH1F * dTheta2
Definition: anaLmdCluster.C:46
double r_mc_err[4]
Definition: anaLmdCluster.C:57
double rc_z[4]
Definition: anaLmdCluster.C:56
TH1F * dTheta3
Definition: anaLmdCluster.C:47
Int_t i
Definition: run_full.C:25
TVector3 GetPosition() const
Definition: PndSdsHit.h:93
TH1F * rcTheta
Definition: anaLmdCluster.C:39
PndRiemannTrack track
Definition: RiemannTest.C:33
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
double mcY
Definition: anaLmdCluster.C:53
TH1F * dTheta0
Definition: anaLmdCluster.C:44
double z_mc_err[4]
Definition: anaLmdCluster.C:57
TTree * tree1
Definition: anaLmdCluster.C:24
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
TClonesArray * mc_array
Definition: anaLmdCluster.C:25
TVector3 GetPositionOut() const
Definition: PndSdsMCPoint.h:91
TH1F * refTheta
Definition: anaLmdCluster.C:41
double mcX
Definition: anaLmdCluster.C:53
TH1F * dTheta
Definition: anaLmdCluster.C:43
double rc_x[4]
Definition: anaLmdCluster.C:56
double mc_z[4]
Definition: anaLmdCluster.C:55
double trackthe
Definition: anaLmdCluster.C:54
double r_rc_err[4]
Definition: anaLmdCluster.C:57
TF1 * trackFit
Definition: anaLmdCluster.C:49
double z_rc_err[4]
Definition: anaLmdCluster.C:57
double rctheta
Definition: anaLmdCluster.C:54
double mc_y[4]
Definition: anaLmdCluster.C:55
TClonesArray * point
Definition: anaLmdDigi.C:29
double dtheta
Definition: anaLmdCluster.C:54
double dthe3
Definition: anaLmdCluster.C:54
double dthe0
Definition: anaLmdCluster.C:54
TH1F * mcTheta
Definition: anaLmdCluster.C:38
TVector3 vecmc
Definition: anaLmdCluster.C:52
double dthe2
Definition: anaLmdCluster.C:54
TClonesArray * hit_array
Definition: anaLmdCluster.C:34
TVector3 GetPosition() const
Definition: PndSdsMCPoint.h:90
double mctheta
Definition: anaLmdCluster.C:54
double r_mc[4]
Definition: anaLmdCluster.C:55
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 mcZ
Definition: anaLmdCluster.C:53
TClonesArray * mc_track
Definition: anaLmdCluster.C:28
double rc_y[4]
Definition: anaLmdCluster.C:56
TTree * tree2
Definition: anaLmdCluster.C:33
double mcfirstthe
Definition: anaLmdCluster.C:54
Int_t GetMotherID() const
Definition: PndMCTrack.h:74
double r_rc[4]
Definition: anaLmdCluster.C:56
TVector3 vecrc
Definition: anaLmdCluster.C:52
tree1 SetBranchAddress ( "LMDPoint"  ,
mc_array 
)
tree1 SetBranchAddress ( "MCTrack"  ,
mc_track 
)
tree2 SetBranchAddress ( "LMDHitsStrip"  ,
hit_array 
)
hMcSttPhi SetLineColor ( kRed  )
g2 SetLineWidth ( )
gStyle SetOptFit ( )
timer Start ( )
timer Stop ( )

Variable Documentation

TCanvas* can1 = new TCanvas("Theta","MC,RC,Track theta",0,0,800, 800)
TCanvas* can2 = new TCanvas("Delta theat","MC,RC,Track",0,0,800, 800)
Double_t ctime = timer.CpuTime()

Definition at line 171 of file anaLmdCluster.C.

double dthe0

Definition at line 54 of file anaLmdCluster.C.

double dthe1

Definition at line 54 of file anaLmdCluster.C.

double dthe2

Definition at line 54 of file anaLmdCluster.C.

double dthe3

Definition at line 54 of file anaLmdCluster.C.

TH1F* dTheta = new TH1F("FirstMCHit-MCTrue","delta theta between FirstMCHit and MCTrue",300,-0.003,0.003)

Definition at line 43 of file anaLmdCluster.C.

Referenced by PndEmcStructure::Print().

double dtheta
TH1F* dTheta0 = new TH1F("RecoHit-MCTrue","delta theta between RecoHit and MCTrue theta",300, -0.003,0.003)

Definition at line 44 of file anaLmdCluster.C.

TH1F* dTheta2 = new TH1F("MCHit-MCTrue","",300, -0.003,0.003)

Definition at line 46 of file anaLmdCluster.C.

TH1F* dTheta3 = new TH1F("RecoHit-MCHit","delta theta between RecoHit and MCHit",300, -0.003,0.003)

Definition at line 47 of file anaLmdCluster.C.

TClonesArray* hit_array = new TClonesArray("PndSdsHit")

Definition at line 34 of file anaLmdCluster.C.

TClonesArray* mc_array = new TClonesArray("PndSdsMCPoint")
TClonesArray* mc_track = new TClonesArray("PndMCTrack")

Definition at line 28 of file anaLmdCluster.C.

double mc_x[4]

Definition at line 55 of file anaLmdCluster.C.

double mc_y[4]

Definition at line 55 of file anaLmdCluster.C.

double mc_z[4]

Definition at line 55 of file anaLmdCluster.C.

TFile* mcf = new TFile("/private/huagen/simdata/Lmd_MC_BD_DPM_elastic_6.2_1.9mrad_5M_1.root")

Definition at line 22 of file anaLmdCluster.C.

double mcfirstthe

Definition at line 54 of file anaLmdCluster.C.

TH1F* mcTheta = new TH1F("MCHit theta","Theta fitted by MCHits",300, 0.001, 0.01)

Definition at line 38 of file anaLmdCluster.C.

double mctheta

Definition at line 54 of file anaLmdCluster.C.

Referenced by for(), and runOnlineDisplayMCCheckFaster3().

double mcX =0

Definition at line 53 of file anaLmdCluster.C.

double mcY =0

Definition at line 53 of file anaLmdCluster.C.

Referenced by for().

double mcZ =0
TPad* mypad = 0

Definition at line 153 of file anaLmdCluster.C.

Referenced by anaclust(), for(), and materialana().

int nEvents = 1e7

Definition at line 17 of file anaLmdCluster.C.

Double_t par[3]

Definition at line 146 of file anaLmdCluster.C.

Referenced by PndMdtTrkProducer::AlgorithmWithLheGenTrack(), anaGemSmearing(), anaRadLength(), ClassImp(), PndMagnet::ConstructASCIIGeometry(), PndSdsDetector::ConstructASCIIGeometry(), PndPidCorrelator::ConstructChargedCandidate(), PndTarget::ConstructGeometry(), PndRich::ConstructGeometry(), CbmPlane::ConstructGeometry(), PndFts2::ConstructGeometry(), PndFts::ConstructGeometry(), PndStt::ConstructGeometry(), PndPidCorrelator::ConstructNeutralCandidate(), createdirc(), createdirc_prism(), createdircPix(), createRootGeometry_DIRC(), createRootGeometry_DIRC_fsEVdroplens_MCPs(), createRootGeometry_DIRC_sepEV_MCPs(), createRootGeometry_DIRC_updated_06_2013(), PndMvdQATask::DoubleGaussFit(), PndKFParticleFinder::Exec(), GeaneTrackRep::extrapolate(), GeaneTrackRep::extrapolateToLine(), GeaneTrackRep::extrapolateToPoint(), PndSttMapCreator::FillSttTubeParametersGeoType1(), PndSttMapCreator::FillSttTubeParametersType2(), PndGemMagneticFieldVsTrackParameters::Finish(), PndRecoDafFit::Fit(), PndRecoDafFit2::Fit(), PndRecoKalmanFit2::Fit(), PndRecoKalmanFit::Fit(), GaussFitPlot(), GeaneTrackRep::GeaneTrackRep(), gem_material_ana1(), KFParticle::GetDecayLength(), KFParticleSIMD::GetDecayLength(), KFParticle::GetDecayLengthXY(), KFParticleSIMD::GetDecayLengthXY(), KFParticle::GetErrDecayLength(), KFParticleSIMD::GetErrDecayLength(), KFParticle::GetErrDecayLengthXY(), KFParticleSIMD::GetErrDecayLengthXY(), KFParticle::GetErrEta(), KFParticleSIMD::GetErrEta(), KFParticle::GetErrLifeTime(), KFParticleSIMD::GetErrLifeTime(), KFParticle::GetErrMass(), KFParticleSIMD::GetErrMass(), KFParticle::GetErrMomentum(), KFParticleSIMD::GetErrMomentum(), KFParticle::GetErrP(), KFParticleSIMD::GetErrP(), KFParticle::GetErrPhi(), KFParticleSIMD::GetErrPhi(), KFParticle::GetErrPt(), KFParticleSIMD::GetErrPt(), KFParticle::GetErrR(), KFParticleSIMD::GetErrR(), KFParticle::GetEta(), KFParticleSIMD::GetEta(), PndGeoHandling::GetGeoManager(), KFParticle::GetLifeTime(), KFParticleSIMD::GetLifeTime(), KFParticle::GetMass(), KFParticleSIMD::GetMass(), PndPidCorrelator::GetMdtInfo(), KFParticle::GetMomentum(), KFParticleSIMD::GetMomentum(), PndPidCorrelator::GetMvdInfo(), KFParticle::GetP(), KFParticleSIMD::GetP(), KFParticle::GetPhi(), KFParticleSIMD::GetPhi(), GeaneTrackRep::getPocaOnLine(), KFParticle::GetPt(), KFParticleSIMD::GetPt(), KFParticle::GetR(), KFParticleSIMD::GetR(), getRange(), PndMasterRunSim::GetRange(), PndPidCorrelator::GetTrackInfo(), PndEmcErrorMatrix::Init(), PndLmdStripClusterTask::Init(), PndLmdLinFitTask::Init(), PndLmdKalmanTask::Init(), PndRich::Initialize(), CbmPlane::Initialize(), PndEmc::Initialize(), LineFitPlot(), PndFastSim::MergeNeutralClusters(), PndFsmAbsDet::PndFsmAbsDet(), PndDrcRecoLookupMapS::ProcessPhotonHit(), PndDrcRecoLookupMap::ProcessPhotonHit(), PullFitPlot(), PndSttSingleStraw::PutPolya(), PndFtsSingleStraw::PutPolya(), QAmacro_mvd_ana(), ReadHCal(), PndSttMvdGemTracking::Retrack(), PndMQMvdChargeWeightedPixelMapping::SetDigiPar(), PndMasterRunAna::SetEventCounterRate(), PndMasterRunSim::SetEventCounterRate(), PndEmc::SetGeometryVersion(), PndMasterRunAna::SetInput(), PndMasterRunSim::SetInput(), PndMasterRunSim::SetInputDir(), PndMasterRunSim::SetNumberOfEvents(), PndMasterRunAna::SetOptions(), PndMasterRunSim::SetOptions(), PndMasterRunAna::SetOutput(), PndMasterRunAna::SetParamAsciiFile(), PndMasterRunSim::SetParamAsciiFile(), PndPythia8Direct::SetParameters(), PndMasterRunAna::SetParamRootFile(), PndMasterRunSim::SetParamRootFile(), TGo4EventElement::SetParent(), PndFieldCreator::SetParm(), PndGeoHandling::SetSensorNamePar(), PndMasterRunSim::SetTargetMode(), PndMQMvdChargeWeightedPixelMapping::SetTotPar(), PndFTSCATrackParamVector::TransportToX0WithMaterial(), PndCATrackParam::TransportToXWithMaterial(), and PndCATrackParamVector::TransportToXWithMaterial().

double pi = TMath::Pi()

Definition at line 19 of file anaLmdCluster.C.

double r_mc[4]

Definition at line 55 of file anaLmdCluster.C.

double r_mc_err[4]

Definition at line 57 of file anaLmdCluster.C.

double r_rc[4]

Definition at line 56 of file anaLmdCluster.C.

double r_rc_err[4]

Definition at line 57 of file anaLmdCluster.C.

double rc_x[4]

Definition at line 56 of file anaLmdCluster.C.

double rc_y[4]

Definition at line 56 of file anaLmdCluster.C.

double rc_z[4]

Definition at line 56 of file anaLmdCluster.C.

TFile* rcf = new TFile("/private/huagen/simdata/Lmd_Reco_BD_DPM_elastic_6.2_1.9mrad_5M_1.root")

Definition at line 31 of file anaLmdCluster.C.

double rcfirstthe

Definition at line 54 of file anaLmdCluster.C.

TH1F* rcTheta = new TH1F("Reco theta","Theta determined by RecoHits",300, 0.001, 0.01)

Definition at line 39 of file anaLmdCluster.C.

double rctheta

Definition at line 54 of file anaLmdCluster.C.

double rcX =0

Definition at line 53 of file anaLmdCluster.C.

double rcY =0

Definition at line 53 of file anaLmdCluster.C.

double rcZ =0

Definition at line 53 of file anaLmdCluster.C.

TH1F* refTheta = new TH1F("MCTrue theta","The track theta set in Generator",300, 0.001, 0.01)

Definition at line 41 of file anaLmdCluster.C.

Double_t rtime = timer.RealTime()

Definition at line 170 of file anaLmdCluster.C.

TStopwatch timer
Initial value:
{
gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C")

Definition at line 7 of file anaLmdCluster.C.

TF1* total = new TF1("total","gaus",-0.06,0.06)
TF1* trackFit = new TF1("trackFit","pol1",-40,40)

Definition at line 49 of file anaLmdCluster.C.

double trackthe

Definition at line 54 of file anaLmdCluster.C.

Referenced by for().

TTree* tree1 = (TTree*)mcf->Get("pndsim")

Definition at line 24 of file anaLmdCluster.C.

TTree* tree2 = (TTree*)rcf->Get("pndsim")

Definition at line 33 of file anaLmdCluster.C.

Referenced by analysis().

TVector3 vecmc

Definition at line 52 of file anaLmdCluster.C.

Referenced by anaclust(), anaGemSmearing(), and QAmacro_mvd_ana().

TVector3 vecrc

Definition at line 52 of file anaLmdCluster.C.

bool verbose = false

Definition at line 18 of file anaLmdCluster.C.

double z_mc_err[4]

Definition at line 57 of file anaLmdCluster.C.

double z_rc_err[4]

Definition at line 57 of file anaLmdCluster.C.