26         TLorentzVector lv=c->
P4();
 
   28         cout <<c->
PdgCode()<<
" ("<<lv.X()<<
"/"<<lv.Y()<<
"/"<<lv.Z()<<
"/"<<lv.E()<<
")"<<endl;
 
   42                         TLorentzVector dl = l[
i]->P4() - l[j]->P4();
 
   44                         bool chkmc = (l[
i]->GetMcTruth()==l[j]->GetMcTruth());
 
   45                         bool chktrk = (
fabs(dl.X())<d) && (
fabs(dl.Y())<d) && (
fabs(dl.Z())<d) && (
fabs(dl.E())<d);
 
   48                         if (chktrk && chkmc) n_both++;
 
   59   TString  parAsciiFile   = 
"all.par";
 
   60   TString  input          = 
"psi2s_Jpsi2pi_Jpsi_mumu.dec"; 
 
   62   TString  friend1        = 
"reco_single";
 
   79         int i=0,j=0, k=0, l=0;
 
   80         gStyle->SetOptFit(1011);
 
   85         TFile *
out = TFile::Open(prefix+
"_output_ana.root",
"RECREATE");
 
   88         TH1F *hmomtrk    = 
new TH1F(
"hmomtrk",
"track momentum (all)",200,0,5);
 
   89         TH1F *hthttrk    = 
new TH1F(
"hthttrk",
"track theta (all)",200,0,3.1415);
 
   91         TH1F *hjpsim_all = 
new TH1F(
"hjpsim_all",
"J/#psi mass (all)",200,0,4.5);
 
   92         TH1F *hpsim_all  = 
new TH1F(
"hpsim_all",
"#psi(2S) mass (all)",200,0,5);
 
   94         TH1F *hjpsim_lpid = 
new TH1F(
"hjpsim_lpid",
"J/#psi mass (loose pid)",200,0,4.5);
 
   95         TH1F *hpsim_lpid  = 
new TH1F(
"hpsim_lpid",
"#psi(2S) mass (loose pid)",200,0,5);
 
   97         TH1F *hjpsim_tpid = 
new TH1F(
"hjpsim_tpid",
"J/#psi mass (tight pid)",200,0,4.5);
 
   98         TH1F *hpsim_tpid  = 
new TH1F(
"hpsim_tpid",
"#psi(2S) mass (tight pid)",200,0,5);
 
  100         TH1F *hjpsim_trpid = 
new TH1F(
"hjpsim_trpid",
"J/#psi mass (true pid)",200,0,4.5);
 
  101         TH1F *hpsim_trpid  = 
new TH1F(
"hpsim_trpid",
"#psi(2S) mass (true pid)",200,0,5);
 
  104         TH1F *hjpsim_ftm = 
new TH1F(
"hjpsim_ftm",
"J/#psi mass (full truth match)",200,0,4.5);
 
  105         TH1F *hpsim_ftm  = 
new TH1F(
"hpsim_ftm",
"#psi(2S) mass (full truth match)",200,0,5);
 
  107         TH1F *hjpsim_nm = 
new TH1F(
"hjpsim_nm",
"J/#psi mass (no truth match)",200,0,4.5);
 
  108         TH1F *hpsim_nm  = 
new TH1F(
"hpsim_nm",
"#psi(2S) mass (no truth match)",200,0,5);
 
  110         TH1F *hjpsim_diff = 
new TH1F(
"hjpsim_diff",
"J/#psi mass diff to truth",100,-2,2);
 
  111         TH1F *hpsim_diff  = 
new TH1F(
"hpsim_diff",
"#psi(2S) mass diff to truth",100,-2,2);
 
  114         TH1F *hjpsim_vf   = 
new TH1F(
"hjpsim_vf",
"J/#psi mass (vertex fit)",200,0,4.5);
 
  115         TH1F *hjpsim_4cf  = 
new TH1F(
"hjpsim_4cf",
"J/#psi mass (4C fit)",200,0,4.5);
 
  116         TH1F *hjpsim_mcf  = 
new TH1F(
"hjpsim_mcf",
"J/#psi mass (mass constraint fit)",200,0,4.5);
 
  118         TH1F *hjpsi_chi2_vf  = 
new TH1F(
"hjpsi_chi2_vf", 
"J/#psi: #chi^{2} vertex fit",100,0,10);
 
  119         TH1F *hpsi_chi2_4c   = 
new TH1F(
"hpsi_chi2_4c",  
"#psi(2S): #chi^{2} 4C fit",100,0,250);
 
  120         TH1F *hjpsi_chi2_mf  = 
new TH1F(
"hjpsi_chi2_mf", 
"J/#psi: #chi^{2} mass fit",100,0,10);
 
  122         TH1F *hjpsi_prob_vf  = 
new TH1F(
"hjpsi_prob_vf", 
"J/#psi: Prob vertex fit",100,0,1);
 
  123         TH1F *hpsi_prob_4c   = 
new TH1F(
"hpsi_prob_4c",  
"#psi(2S): Prob 4C fit",100,0,1);
 
  124         TH1F *hjpsi_prob_mf  = 
new TH1F(
"hjpsi_prob_mf", 
"J/#psi: Prob mass fit",100,0,1);
 
  126         TH2F *
hvpos = 
new TH2F(
"hvpos",
"(x,y) projection of fitted decay vertex",100,-2,2,100,-2,2);
 
  135         if (nevts==0) nevts= theAnalysis->
GetEntries();
 
  141         double m0_jpsi = TDatabasePDG::Instance()->GetParticle(
"J/psi")->Mass();   
 
  145         TLorentzVector ini(0, 0, 6.231552, 7.240065);
 
  151         int cntdbltrk=0, cntdblmc=0, cntdblboth=0, cnttrk=0, cnt_dbl_jpsi=0, cnt_dbl_psip=0;
 
  153         while (theAnalysis->
GetEvent() && i++<nevts)
 
  155                 if ((i%100)==0) cout<<
"evt " << i << endl;
 
  158                 theAnalysis->
FillList(chrg,    
"Charged");
 
  159                 theAnalysis->
FillList(muplus,  
"MuonAllPlus");
 
  160                 theAnalysis->
FillList(muminus, 
"MuonAllMinus");
 
  161                 theAnalysis->
FillList(piplus,  
"PionAllPlus");
 
  162                 theAnalysis->
FillList(piminus, 
"PionAllMinus");
 
  167                         hmomtrk->Fill(muplus[j]->
P());
 
  168                         hthttrk->Fill(muplus[j]->P4().Theta());
 
  172                         hmomtrk->Fill(muminus[j]->
P());
 
  173                         hthttrk->Fill(muminus[j]->P4().Theta());
 
  197                         hjpsim_all->Fill( jpsi[j]->M() );
 
  202                                 hjpsim_ftm->Fill( jpsi[j]->M() );
 
  203                                 hjpsim_diff->Fill( jpsi[j]->GetMcTruth()->M() - jpsi[j]->M() );
 
  206                                 hjpsim_nm->Fill( jpsi[j]->M() );
 
  209                 if (nm>1) cnt_dbl_jpsi++;
 
  218                         double chi2_vtx = vtxfitter.
GetChi2();  
 
  219                         double prob_vtx = vtxfitter.
GetProb();  
 
  220                         hjpsi_chi2_vf->Fill(chi2_vtx);
 
  221                         hjpsi_prob_vf->Fill(prob_vtx);                  
 
  223                         if ( prob_vtx > 0.01 )                          
 
  226                                 TVector3 jVtx=jfit->
Pos();              
 
  228                                 hjpsim_vf->Fill(jfit->
M());            
 
  229                                 hvpos->Fill(jVtx.X(),jVtx.Y());
 
  237                 psi2s.
Combine(jpsi, piplus, piminus);
 
  248                         hpsim_all->Fill( psi2s[j]->M() );
 
  253                                 hpsim_ftm->Fill( psi2s[j]->M() );
 
  254                                 hpsim_diff->Fill( psi2s[j]->GetMcTruth()->M() - psi2s[j]->M() );
 
  257                                 hpsim_nm->Fill( psi2s[j]->M() );
 
  259                 if (nm>1) cnt_dbl_psip++;
 
  271                         double chi2_4c = fitter.
GetChi2();      
 
  272                         double prob_4c = fitter.
GetProb();      
 
  273                         hpsi_chi2_4c->Fill(chi2_4c);
 
  274                         hpsi_prob_4c->Fill(prob_4c);                    
 
  276                         if ( prob_4c > 0.01 )                   
 
  280                                 hjpsim_4cf->Fill(jfit->
M());
 
  294                         double chi2_m = mfitter.
GetChi2();      
 
  295                         double prob_m = mfitter.
GetProb();      
 
  296                         hjpsi_chi2_mf->Fill(chi2_m);
 
  297                         hjpsi_prob_mf->Fill(prob_m);                    
 
  302                                 hjpsim_mcf->Fill(jfit->
M());
 
  320                 for (j=0;j<jpsi.
GetLength();++j) hjpsim_trpid->Fill( jpsi[j]->M() );
 
  323                 psi2s.
Combine(jpsi, piplus, piminus);
 
  324                 for (j=0;j<psi2s.
GetLength();++j) hpsim_trpid->Fill( psi2s[j]->M() );
 
  332                 theAnalysis->
FillList(muplus,  
"MuonLoosePlus",  
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
 
  333                 theAnalysis->
FillList(muminus, 
"MuonLooseMinus", 
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
 
  334                 theAnalysis->
FillList(piplus,  
"PionLoosePlus",  
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
 
  335                 theAnalysis->
FillList(piminus, 
"PionLooseMinus", 
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
 
  338                 for (j=0;j<jpsi.
GetLength();++j) hjpsim_lpid->Fill( jpsi[j]->M() );
 
  341                 psi2s.
Combine(jpsi, piplus, piminus);
 
  342                 for (j=0;j<psi2s.
GetLength();++j) hpsim_lpid->Fill( psi2s[j]->M() );
 
  350                 theAnalysis->
FillList(muplus,  
"MuonTightPlus",  
"PidAlgoMdtHardCuts");
 
  351                 theAnalysis->
FillList(muminus, 
"MuonTightMinus", 
"PidAlgoMdtHardCuts");
 
  352                 theAnalysis->
FillList(piplus,  
"PionLoosePlus",  
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
 
  353                 theAnalysis->
FillList(piminus, 
"PionLooseMinus", 
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
 
  356                 for (j=0;j<jpsi.
GetLength();++j) hjpsim_tpid->Fill( jpsi[j]->M() );
 
  359                 psi2s.
Combine(jpsi, piplus, piminus);
 
  360                 for (j=0;j<psi2s.
GetLength();++j) hpsim_tpid->Fill( psi2s[j]->M() );
 
  372         hjpsim_lpid->Write();
 
  374         hjpsim_tpid->Write();
 
  376         hjpsim_trpid->Write();
 
  377         hpsim_trpid->Write();
 
  385         hjpsim_diff->Write();
 
  391         hjpsi_chi2_vf->Write();
 
  392         hpsi_chi2_4c->Write();
 
  393         hjpsi_chi2_mf->Write();
 
  395         hjpsi_prob_vf->Write();
 
  396         hpsi_prob_4c->Write();
 
  397         hjpsi_prob_mf->Write();
 
int SelectTruePid(PndAnalysis *ana, RhoCandList &l)
void AddMassConstraint(double mass)
Class for the master reconstruction chain. 
Bool_t Setup(TString outprefix="")
Initial setup. 
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
void Add4MomConstraint(TLorentzVector lv)
void AddFriend(TString par)
Setter of friend root files. 
FairParRootFileIo * output
void SetInput(TString par)
Input of the macro. 
void Combine(RhoCandList &l1, RhoCandList &l2)
PndAnalysis(TString tname1="", TString tname2="", TString algnamec="PidAlgoIdealCharged", TString algnamen="PidAlgoIdealNeutral")
void Select(RhoParticleSelectorBase *pidmgr)
TLorentzVector P4() const 
void SetType(const TParticlePDG *pdt, int start=0)
friend F32vec4 fabs(const F32vec4 &a)
Int_t Remove(RhoCandidate *)
void countDoubles(RhoCandList &l, int &n1, int &n2, int &n3)
void Finish()
Final diagnostics. 
void printCand(RhoCandidate *c)
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
Int_t GetEvent(Int_t n=-1)
void SetOutput(TString par)
Tag of the output file of the macro. 
void SetParamAsciiFile(TString par)
Setter of the parameter ascii file. 
int ana_complete(int nevts=0, TString prefix="evtcomplete")