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));
 
   31         FairParRootFileIo* parIO = 
new FairParRootFileIo();
 
   32         parIO->open(inParFile);
 
   33         FairParAsciiFileIo* parIOPid = 
new FairParAsciiFileIo();
 
   34         parIOPid->open(pidParFile.Data(),
"in");
 
   36         rtdb->setFirstInput(parIO);
 
   37         rtdb->setSecondInput(parIOPid);
 
   38         rtdb->setOutput(parIO);  
 
   40         fRun->SetOutputFile(OutFile);
 
   44         TFile *
out = TFile::Open(prefix+
"_ana_fit.root",
"RECREATE");
 
   47         TH1F *hjpsim_all = 
new TH1F(
"hjpsim_all",
"J/#psi mass",200,0,4.5);
 
   48         TH1F *hpsim_all  = 
new TH1F(
"hpsim_all",
"#psi(2S) mass",200,0,5);
 
   50         TH1F *hjpsim_vf   = 
new TH1F(
"hjpsim_vf", 
"J/#psi mass (vertex fit)",200,0,4.5);
 
   51         TH1F *hjpsim_4cf  = 
new TH1F(
"hjpsim_4cf",
"J/#psi mass (4C fit)",200,0,4.5);
 
   52         TH1F *hjpsim_mcf  = 
new TH1F(
"hjpsim_mcf",
"J/#psi mass (mass constraint fit)",200,0,4.5);
 
   54         TH1F *hjpsi_chi2_vf  = 
new TH1F(
"hjpsi_chi2_vf", 
"J/#psi: #chi^{2} vertex fit",100,0,10);
 
   55         TH1F *hpsi_chi2_4c   = 
new TH1F(
"hpsi_chi2_4c",  
"#psi(2S): #chi^{2} 4C fit",100,0,250);
 
   56         TH1F *hjpsi_chi2_mf  = 
new TH1F(
"hjpsi_chi2_mf", 
"J/#psi: #chi^{2} mass fit",100,0,10);
 
   58         TH1F *hjpsi_prob_vf  = 
new TH1F(
"hjpsi_prob_vf", 
"J/#psi: Prob vertex fit",100,0,1);
 
   59         TH1F *hpsi_prob_4c   = 
new TH1F(
"hpsi_prob_4c",  
"#psi(2S): Prob 4C fit",100,0,1);
 
   60         TH1F *hjpsi_prob_mf  = 
new TH1F(
"hjpsi_prob_mf", 
"J/#psi: Prob mass fit",100,0,1);
 
   62         TH2F *
hvpos = 
new TH2F(
"hvpos",
"(x,y) projection of fitted decay vertex",100,-2,2,100,-2,2);
 
   71         if (nevts==0) nevts= theAnalysis->
GetEntries();
 
   77         double m0_jpsi = TDatabasePDG::Instance()->GetParticle(
"J/psi")->Mass();   
 
   81         TLorentzVector ini(0, 0, 6.231552, 7.240065);
 
   86         while (theAnalysis->
GetEvent() && i++<nevts)
 
   88                 if ((i%100)==0) cout<<
"evt " << i << endl;
 
   91                 theAnalysis->
FillList(muplus,  
"MuonAllPlus");
 
   92                 theAnalysis->
FillList(muminus, 
"MuonAllMinus");
 
   93                 theAnalysis->
FillList(piplus,  
"PionAllPlus");
 
   94                 theAnalysis->
FillList(piminus, 
"PionAllMinus");
 
  104                         hjpsim_all->Fill(jpsi[j]->M());         
 
  109                         double chi2_vtx = vtxfitter.
GetChi2();  
 
  110                         double prob_vtx = vtxfitter.
GetProb();  
 
  111                         hjpsi_chi2_vf->Fill(chi2_vtx);
 
  112                         hjpsi_prob_vf->Fill(prob_vtx);                  
 
  114                         if ( prob_vtx > 0.01 )                          
 
  117                                 TVector3 jVtx=jfit->
Pos();              
 
  119                                 hjpsim_vf->Fill(jfit->
M());            
 
  120                                 hvpos->Fill(jVtx.X(),jVtx.Y());
 
  128                 psi2s.
Combine(jpsi, piplus, piminus);
 
  135                         hpsim_all->Fill(psi2s[j]->M());         
 
  141                         double chi2_4c = fitter.
GetChi2();      
 
  142                         double prob_4c = fitter.
GetProb();      
 
  143                         hpsi_chi2_4c->Fill(chi2_4c);
 
  144                         hpsi_prob_4c->Fill(prob_4c);                    
 
  146                         if ( prob_4c > 0.01 )                   
 
  150                                 hjpsim_4cf->Fill(jfit->
M());
 
  163                         double chi2_m = mfitter.
GetChi2();      
 
  164                         double prob_m = mfitter.
GetProb();      
 
  165                         hjpsi_chi2_mf->Fill(chi2_m);
 
  166                         hjpsi_prob_mf->Fill(prob_m);                    
 
  171                                 hjpsim_mcf->Fill(jfit->
M());
 
  187         hjpsi_chi2_vf->Write();
 
  188         hpsi_chi2_4c->Write();
 
  189         hjpsi_chi2_mf->Write();
 
  191         hjpsi_prob_vf->Write();
 
  192         hpsi_prob_4c->Write();
 
  193         hjpsi_prob_mf->Write();
 
void AddMassConstraint(double mass)
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
void Add4MomConstraint(TLorentzVector lv)
void Combine(RhoCandList &l1, RhoCandList &l2)
PndAnalysis(TString tname1="", TString tname2="", TString algnamec="PidAlgoIdealCharged", TString algnamen="PidAlgoIdealNeutral")
void Select(RhoParticleSelectorBase *pidmgr)
void tut_ana_fit(int nevts=0, TString prefix="signal")
Int_t GetEvent(Int_t n=-1)