FairRoot/PandaRoot
Functions | Variables
anaMvdPid.C File Reference

Go to the source code of this file.

Functions

gROOT Macro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
timer Start ()
 
tree SetBranchAddress ("PndMvdPidCand",&pointlist)
 
 for (int j=0;j< nEvents &&j< tree->GetEntriesFast();j++)
 
h1 Draw ()
 
timer Stop ()
 

Variables

TStopwatch timer
 
TFile * inFile = new TFile("MvdPidIdeal.root","READ")
 
TTree * tree = (TTree *)inFile->Get("pndsim")
 
TClonesArray * pointlist =new TClonesArray("PndMvdPidCand")
 
TH2F * h1 =new TH2F("h1", "likelihood count", 100, 0.0, 2.5, 100, 0.0, 1.0)
 
TH2F * h2 =new TH2F("h2", "energy loss", 100, 0.0, 2.5, 100, 0.0, 0.05)
 
TH2F * h3 =new TH2F("h3", "ideal likelihood count", 100, 0.0, 2.5, 100, 0.0, 1.0)
 
Int_t nEvents = 10000
 
TCanvas * c =new TCanvas("c2")
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

h1 Draw ( )

Definition at line 64 of file NHitsPerEvent.C.

64  {
65 
66  std::cout << "mvdHitArray: " << mvdHitArray->GetEntries() << " projectedHitArray " << mvdProjectedArray->GetEntries() << std::endl;
67 
68 // gHitPoints->Clear();
71  //if (gHitPoints->GetN() != x.size()) gHitPoints->Expand(x.size());
72 
73  std::cout << "NHits: " << gHitPoints->GetN() << std::endl;
74  gHitPoints->Draw("apl");
75  gProjections->Draw("pl");
76 }
void ExtractData(TClonesArray *array, TGraph *g)
Definition: NHitsPerEvent.C:78
TGraph * gHitPoints
Definition: NHitsPerEvent.C:15
TClonesArray * mvdHitArray
Definition: NHitsPerEvent.C:12
TClonesArray * mvdProjectedArray
Definition: NHitsPerEvent.C:13
TGraph * gProjections
Definition: NHitsPerEvent.C:16
for ( )

Definition at line 31 of file anaMvdPid.C.

References PndMvdAdvancedPidAlgo::CalcLikelihood(), dE, dx, PndMvdPidCand::GetLikelihood(), PndMvdPidCand::GetMvdHitdE(), PndMvdPidCand::GetMvdHitdx(), PndMvdPidCand::GetMvdHitMomentum(), PndMvdPidCand::GetMvdHits(), and i.

31  {
32  tree->GetEntry(j);
33  for(int i=0;i<pointlist->GetEntriesFast();i++) {
35  PndMvdPidCand* idealcand=new PndMvdPidCand();
36 
37 
38  double dE=0;
39  double dx=0;
40  double momentum=0;
41 
42  for (int k=0;k<cand->GetMvdHits(); k++) {
43  dE+=cand->GetMvdHitdE(k);
44  dx+=cand->GetMvdHitdx(k);
45  momentum+=cand->GetMvdHitMomentum(k);
46  }
47 
48  if (dx>0)
49  momentum/=cand->GetMvdHits();
50 
51  PndMvdAdvancedPidAlgo::CalcLikelihood(PndMvdAdvancedPidAlgo::proton, momentum, idealcand);
52  h2->Fill(momentum, dE/dx);
53  h1->Fill(momentum, cand->GetLikelihood(2212));
54  h3->Fill(momentum, idealcand->GetLikelihood(2212));
55  }
56  }
TClonesArray * pointlist
Definition: anaMvdPid.C:19
Int_t i
Definition: run_full.C:25
static void CalcLikelihood(PndMvdPidCand *cand)
TTree * tree
Definition: plot_dirc.C:12
double GetMvdHitdx(int mvdhit) const
double GetLikelihood(int lundId)
double GetMvdHitMomentum(int mvdhit) const
Double_t dE
Definition: anasim.C:58
TH1F * h3
double dx
double GetMvdHitdE(int mvdhit) const
int GetMvdHits() const
gROOT Macro ( "$VMCWORKDIR/gconfig/rootlogon.C )
tree SetBranchAddress ( "PndMvdPidCand"  ,
pointlist 
)
timer Start ( )
timer Stop ( )

Variable Documentation

c =new TCanvas("c2")

Definition at line 57 of file anaMvdPid.C.

Double_t ctime = timer.CpuTime()

Definition at line 67 of file anaMvdPid.C.

TH2F* h1 =new TH2F("h1", "likelihood count", 100, 0.0, 2.5, 100, 0.0, 1.0)

Definition at line 23 of file anaMvdPid.C.

TH2F* h2 =new TH2F("h2", "energy loss", 100, 0.0, 2.5, 100, 0.0, 0.05)

Definition at line 24 of file anaMvdPid.C.

TH2F* h3 =new TH2F("h3", "ideal likelihood count", 100, 0.0, 2.5, 100, 0.0, 1.0)

Definition at line 25 of file anaMvdPid.C.

TFile* inFile = new TFile("MvdPidIdeal.root","READ")

Definition at line 17 of file anaMvdPid.C.

Int_t nEvents = 10000

Definition at line 29 of file anaMvdPid.C.

TClonesArray* pointlist =new TClonesArray("PndMvdPidCand")

Definition at line 19 of file anaMvdPid.C.

Double_t rtime = timer.RealTime()

Definition at line 66 of file anaMvdPid.C.

TStopwatch timer

Definition at line 13 of file anaMvdPid.C.

TTree* tree = (TTree *)inFile->Get("pndsim")

Definition at line 18 of file anaMvdPid.C.