FairRoot/PandaRoot
Functions
jul10/run_ana_tpccombi.C File Reference

Go to the source code of this file.

Functions

void run_ana_tpccombi (TString fname="pid_tpccombi.root", int nevts=0)
 

Function Documentation

void run_ana_tpccombi ( TString  fname = "pid_tpccombi.root",
int  nevts = 0 
)

For fast sim, replace by if(true){

For fast sim, replace by if(true){

Definition at line 2 of file jul10/run_ana_tpccombi.C.

References ctime, Double_t, i, Mass, out, p1, p2, printf(), rtime, and timer.

3 {
4  TStopwatch timer;
5  timer.Start();
6 
7  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
8 
9  TFile *out = TFile::Open("invmass_histo.root","RECREATE");
10 
11  //TCanvas *c1=new TCanvas("c1","c1",600,600);
12 
13  // the PndEventReader takes care about file/event handling
14  PndEventReader evr(fname);
15 
16  // to attach more files: evr.Add(fname2);evr.Add(fname3); ...
17 
18  TH1F *invmass=new TH1F("invmass","invariant mass",100,2.5,3.5);
19 
20  // the candidates lists we need
21  TCandList p1;
22  TCandList p2;
23  TCandList jpsi;
24 
25  TLorentzVector ini(0,0,6.23164,7.24015);
26 
27  if (nevts==0) nevts=evr.GetEntries();
28  // cout << "nevts " << nevts << "\n";
29  int i=0,j=0, k=0, l=0;
30 
31  // *************
32  // this is the loop through the events ... as simple as this...
33  // ****************
34  while (evr.GetEvent() && i++<nevts)
35  {
36 
37  if (!((i+1)%1000)) cout << i << "\n";
38 
39  evr.FillList(p1,"All");
40  evr.FillList(p2,"All");
41 // evr.FillList(p1,"Charged");
42 // evr.FillList(p2,"Charged");
43 
44  // cout << p1.GetLength() << " e+ candidates found" << "\n";
45  // cout << p2.GetLength() << " e- candidates found" << "\n";
46 
47  for (j=0;j<p1.GetLength();++j) {
49  if ((p1[j].GetMicroCandidate().GetEmcRawEnergy()/p1[j].GetMicroCandidate().GetMomentum().Mag())>0.0) {
50  p1[j].SetMass(TRho::Instance()->GetPDG()->GetParticle(11)->Mass());
51  } else {
52  p1.Remove(p1[j]);
53  j--;
54  }
55  }
56  for (j=0;j<p2.GetLength();++j) {
58  if ((p2[j].GetMicroCandidate().GetEmcRawEnergy()/p2[j].GetMicroCandidate().GetMomentum().Mag())>0.0) {
59  p2[j].SetMass(TRho::Instance()->GetPDG()->GetParticle(11)->Mass());
60  } else {
61  p2.Remove(p2[j]);
62  j--;
63  }
64 
65  }
66 
67  jpsi.Combine(p1,p2);
68 
69  // cout << jpsi.GetLength() << " J/Psi candidates found" << "\n";
70  for (l=0;l<jpsi.GetLength();++l) {
71  invmass->Fill(jpsi[l].M());
72  }
73 
74  }
75 
76  //c1->cd();
77 
78  invmass->Draw();
79 
80  out->cd();
81  invmass->Write();
82  out->Save();
83 
84  timer.Stop();
85  Double_t rtime = timer.RealTime();
86  Double_t ctime = timer.CpuTime();
87  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
88 
89 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Int_t i
Definition: run_full.C:25
Double_t
TStopwatch timer
Definition: hit_dirc.C:51
TFile * out
Definition: reco_muo.C:20
Double_t ctime
Definition: hit_dirc.C:114
TPad * p2
Definition: hist-t7.C:117
TPad * p1
Definition: hist-t7.C:116
Double_t rtime
Definition: hit_dirc.C:113