| Home » PANDA » PandaRoot » Fast Simulations » [FIXED] first try with fast simulation problem (error and break and aborting execution) Goto Forum:
	| 
		
			| Re: first try with fast simulation problem [message #16280 is a reply to message #16278] | Wed, 09 April 2014 17:26   |  
			| 
				
				
					|  Alexandros Messages: 51
 Registered: January 2014
 Location: KVI
 | continuous participant | From: *kvi-cart.rug.nl 
 |  |  
	| Ok the simulation works now.. The file I get from my analysis("psi4160.root") with the ntuples is empty...
   I checked with the TBrowser and the tuples are there but empty..
 This is what I do:
 
 // some variables
 int i=0,j=0, k=0, l=0;
 
 // the output file examined
 TString InFile="psi4160_fast.root";
 TString OutFile="psi4160_out.root";
 
 // initialization
 FairLogger::GetLogger()->SetLogToFile(kFALSE);
 FairRunAna* fRun = new FairRunAna();
 fRun->SetWriteRunInfoFile(kFALSE);
 
 fRun->SetInputFile(InFile);
 fRun->SetOutputFile(OutFile);
 fRun->Init();
 
 RhoCalculationTools::ForceConstantBz(20.0);
 
 // create an output file for all histograms
 TFile *out = TFile::Open("psi4160.root","RECREATE");
 
 // create ntuples for psi(4160), D0 and anti-D0
 RhoTuple *npsi4160 = new RhoTuple("npsi4160","npsi4160 Analysis");
 RhoTuple *nd0 = new RhoTuple("nd0","nD0 Analysis");
 RhoTuple *nantid0 = new RhoTuple("nantid0","nanti-D0 Analysis");
 
 // *** Now the analysis stuff *** //
 
 // the data reader object
 PndAnalysis* theAnalysis = new PndAnalysis();
 if(nevts==0) nevts= theAnalysis->GetEntries();
 
 // RhoCandLists for the analysis
 RhoCandList psi4160, d0, antid0, kplus, kminus, piplus, piminus, all;
 
 // Mass selector for the psi4160, do/anti-d0, K+/K-, pi+/pi- cands
 
 double m0_d0 = TDatabasePDG::Instance()->GetParticle("D0")->Mass();   // Get nominal PDG mass of the D0/anti-D0
 RhoMassParticleSelector *d0MassSel=new RhoMassParticleSelector("d0",m0_d0,1.0);
 
 
 // Pid Selection Algorithms
 TString pidSelection = "PidChargedProbability";
 
 // the lorentz vector of the initial psi(4160)
 TLorentzVector ini(0, 0, 6.833, 8.000);
 
 // *** the event loop *** //
 
 while (theAnalysis->GetEvent() && i++<nevts)
 {
 
 cout<< " evt " << i << endl;
 
 // Select with no Loose PID info; type and mass are set
 theAnalysis->FillList(all,  "All", pidSelection);
 PndEventShape evsh(all, ini, 0.05, 0.1);
 theAnalysis->FillList(kplus,  "KaonLoosePlus", pidSelection);
 theAnalysis->FillList(kminus, "KaonLooseMinus", pidSelection);
 theAnalysis->FillList(piplus,  "PionLoosePlus", pidSelection);
 theAnalysis->FillList(piminus, "PionLooseMinus", pidSelection);
 /// first I have the same stuff as following for D0 and antiD0 and then comes the next part
 
 // *** combinatorics for psi4160 -> d0 anti-d0 *** //
 psi4160.Combine(d0, antid0);
 psi4160.SetType(60443);
 
 for (j=0;j<psi4160.GetLength();++j)
 {
 // get daughters
 RhoCandidate *dd0 =  psi4160[j]->Daughter(0);
 RhoCandidate *dantid0 = psi4160[j]->Daughter(1);
 
 PndPidCandidate *dd0_rec = (PndPidCandidate*)dd0->GetRecoCandidate();
 PndPidCandidate *dantid0_rec = (PndPidCandidate*)dantid0->GetRecoCandidate();
 
 // get truth information
 bool mct = theAnalysis->McTruthMatch(psi4160[j]);
 RhoCandidate *true_psi4160 = psi4160[j]->GetMcTruth();
 
 // do 4C fit
 PndKinFitter fitter(psi4160[j]);	// instantiate the kin fitter in psi(2S)
 fitter.Add4MomConstraint(ini);	// set 4 constraint
 fitter.Fit();		            // do fit
 RhoCandidate *fit4c_psi4160 = psi4160[j]->GetFit();	// get fitted psi4160
 
 double chi2_4c = fitter.GetChi2();	// get chi2 of fit
 double prob_4c = fitter.GetProb();	// access probability of fit
 
 // general event info
 npsi4160->Column("ev", (Float_t) i, -999.9f);
 npsi4160->Column("cand", (Float_t) j, -999.9f);
 
 // basic psi4160 info
 npsi4160->Column("psi4160m", (Float_t) psi4160[j]->M(), -999.9f);
 npsi4160->Column("psi4160p", (Float_t) psi4160[j]->P(), -999.9f);
 npsi4160->Column("psi4160pt", (Float_t) psi4160[j]->P3().Pt(), -999.9f);
 npsi4160->Column("psi4160tht", (Float_t) psi4160[j]->P3().Theta()*57.30, -999.9f);
 npsi4160->Column("psi41604c", (Float_t) fit4c_psi4160->M(), -999.9f);
 
 
 So if I try to draw psi4160m for example it gives nothing..
 There is a problem with the tuple filling and writing I guess...
 
 When you have time again I would appreciate your help...
 |  
	|  |  | 
 
 Current Time: Fri Oct 31 13:32:06 CET 2025 
 Total time taken to generate the page: 0.00487 seconds |