11 int i=0,j=0, k=0, l=0;
12 gStyle->SetOptFit(1011);
15 TString OutFile=
"out_dummy.root";
18 TString inPidFile = prefix+
"_pid.root";
19 TString inParFile = prefix+
"_par.root";
22 TString pidParFile =
TString(gSystem->Getenv(
"VMCWORKDIR"))+
"/macro/params/all.par";
25 FairLogger::GetLogger()->SetLogToFile(kFALSE);
26 FairRunAna*
fRun =
new FairRunAna();
27 FairRuntimeDb*
rtdb = fRun->GetRuntimeDb();
28 fRun->SetSource(
new FairFileSource(inPidFile));
29 fRun->SetUseFairLinks(kTRUE);
32 FairParRootFileIo* parIO =
new FairParRootFileIo();
33 parIO->open(inParFile);
34 FairParAsciiFileIo* parIOPid =
new FairParAsciiFileIo();
35 parIOPid->open(pidParFile.Data(),
"in");
37 rtdb->setFirstInput(parIO);
38 rtdb->setSecondInput(parIOPid);
39 rtdb->setOutput(parIO);
41 fRun->SetOutputFile(OutFile);
45 TFile *
out = TFile::Open(prefix+
"_ana_comb.root",
"RECREATE");
48 TH1F *hjpsim_all =
new TH1F(
"hjpsim_all",
"J/#psi mass (all)",200,0,4.5);
49 TH1F *hpsim_all =
new TH1F(
"hpsim_all",
"#psi(2S) mass (all)",200,0,5);
51 TH1F *hjpsim_pcut =
new TH1F(
"hjpsim_pcut",
"J/#psi mass (comb. by hand with p cut)",200,0,4.5);
52 TH1F *hpsim_pcut =
new TH1F(
"hpsim_pcut",
"#psi(2S) mass (comb. by hand with p cut))",200,0,5);
61 if (nevts==0) nevts= theAnalysis->
GetEntries();
72 while (theAnalysis->
GetEvent() && i++<nevts)
74 if ((i%100)==0) cout<<
"evt " << i << endl;
77 theAnalysis->
FillList(muplus,
"MuonAllPlus");
78 theAnalysis->
FillList(muminus,
"MuonAllMinus");
79 theAnalysis->
FillList(piplus,
"PionAllPlus");
80 theAnalysis->
FillList(piminus,
"PionAllMinus");
82 std::cout <<
"MuPlus:" << std::endl;
83 for (
int k = 0; k < muplus.
GetLength(); k++){
84 std::cout << k <<
" : ";
85 ((FairMultiLinkedData_Interface*)muplus[k])->Print();
86 std::cout << std::endl;
89 std::cout <<
"MuMinus:" << std::endl;
90 for (
int k = 0; k < muminus.
GetLength(); k++){
91 std::cout << k <<
" : ";
92 ((FairMultiLinkedData_Interface*)muminus[k])->Print();
93 std::cout << std::endl;
100 for (j=0;j<jpsi.
GetLength();++j) hjpsim_all->Fill( jpsi[j]->M() );
102 std::cout <<
"JPsi:" << std::endl;
103 for (
int k = 0; k < jpsi.
GetLength(); k++){
104 std::cout << k <<
" : ";
105 ((FairMultiLinkedData_Interface*)jpsi[k])->Print();
106 std::cout << std::endl;
116 psi2s.
Combine(jpsi, piplus, piminus);
117 for (j=0;j<psi2s.
GetLength();++j) hpsim_all->Fill( psi2s[j]->M() );
128 if (muplus[j]->
P()<0.3)
continue;
132 if (muminus[k]->
P()<0.3)
continue;
139 for (j=0;j<jpsi.
GetLength();++j) hjpsim_pcut->Fill( jpsi[j]->M() );
156 if ( piplus[k]->
P()<0.2 || piplus[k]->Overlaps(jpsi[j]) )
continue;
161 if ( piminus[l]->
P()<0.2 || piminus[l]->Overlaps(jpsi[j]) )
continue;
169 for (j=0;j<psi2s.
GetLength();++j) hpsim_pcut->Fill( psi2s[j]->M() );
181 hjpsim_pcut->Write();
void Append(const RhoCandidate *c)
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
void Combine(RhoCandList &l1, RhoCandList &l2)
void Select(RhoParticleSelectorBase *pidmgr)
Int_t GetEvent(Int_t n=-1)