void ana_dsdsj(TString fname="dsds_10k.evt.root",int num=0) { TStopwatch timer; timer.Start(); gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C"); basiclibs(); // **** the library is needed in order to use the TCandidate and TCandList etc gSystem->Load("libRho"); TCanvas *c1=new TCanvas("c1","c1",900,600); c1->Divide(3,2); // **** access the datastructure holding the particle lists // TFile* f = new TFile(fname.Data()); TTree *t=f->Get("cbmsim") ; // **** for every event, a TCLonesArray with the candidates is stored in cbmsim // TClonesArray *fCands=new TClonesArray("TCandidate"); t->SetBranchAddress("PndCandidates",&fCands); TCandidate *tc; // **** create and setup some histos for QA plots // TH1F *phimass = new TH1F("phimass","phi cands",100,0.95,1.1); TH1F *pi0mass = new TH1F("pi0mass","pi0 cands",100,0.135-0.03,0.135+0.03); TH1F *dsmass = new TH1F("dsmass","Ds cands",100,1.968-0.03,1.968+0.03); TH1F *ds0mass = new TH1F("ds0mass","Ds0 cands",100,2.317-0.05,2.317+0.05); TH1F *ppmass = new TH1F("ppmass","pbarp cands",100,4.306-0.1,4.306+0.1); TH1F *nmult=new TH1F("nmult","# neutrals",15,0,15); phimass->SetMinimum(0); pi0mass->SetMinimum(0); dsmass->SetMinimum(0); ds0mass->SetMinimum(0); ppmass->SetMinimum(0); if (num==0) num= t->GetEntriesFast(); cout <<"\n####### Processing "<SetCriterion("tight"); TPidSimplePionSelector *piSel = new TPidSimplePionSelector(); piSel->SetCriterion("loose"); int i2; // **** loop over all _events_ // for (Int_t j=0; j< num;j++){ t->GetEntry(j); TFactory::Instance()->Reset(); allCands.Cleanup(); // **** loop over all Candidates and add them to the list allCands // for (Int_t i1=0; i1GetEntriesFast(); i1++){ tc = (TCandidate *)fCands->At(i1); allCands.Add(*tc); } // **** select all the basic list // chargedCands.Select(allCands, chargedSel); neutralCands.Select(allCands, neutralSel); nmult->Fill(neutralCands.GetLength()); plusCands.Select(chargedCands ,plusSel); minusCands.Select(chargedCands ,minusSel); // **** pid selection // kpCands.Select(plusCands ,kSel); kmCands.Select(minusCands ,kSel); piCands.Select(chargedCands ,piSel); // **** now start combining all composits; inbetween plot masses // before using the mass selectors // phiCands.Combine(kpCands,kmCands); TCandListIterator iterPhi(phiCands); while (tc=iterPhi.Next()) phimass->Fill(tc->M()); phiCands.Select(phiMSel); dsCands.Combine(phiCands,piCands); TCandListIterator iterDs(dsCands); while (tc=iterDs.Next()) dsmass->Fill(tc->M()); dsCands.Select(dsMSel); pi0Cands.Combine(neutralCands,neutralCands); TCandListIterator iterPi0(pi0Cands); while (tc=iterPi0.Next()) pi0mass->Fill(tc->M()); pi0Cands.Select(pi0MSel); ds0Cands.Combine(dsCands,pi0Cands); TCandListIterator iterDs0(ds0Cands); while (tc=iterDs0.Next()) ds0mass->Fill(tc->M()); ppCands.Combine(ds0Cands,dsCands); //cout << ds0Cands.GetLength()<<" "<Fill(tc->M()); printRecursive(tc); } int nch=chargedCands.GetLength(); int nn=neutralCands.GetLength(); int nphi=phiCands.GetLength(); int nds=dsCands.GetLength(); int nds0=ds0Cands.GetLength(); int npp=ppCands.GetLength(); if (npp) cout <<"pp :"<0 && nds0>0 &&dsCands[0].GetCharge()!=ds0Cands[0].GetCharge()) cout <<"****"<cd(1); phimass->Draw(); c1->cd(2); pi0mass->Draw(); c1->cd(3); dsmass->Draw(); c1->cd(4); ds0mass->Draw(); c1->cd(5); ppmass->Draw(); c1->cd(6); nmult->Draw(); timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime); } /*void printRecursive(TCandidate *tc, Int_t level=0) { int i=0; int nd=tc->NDaughters(); if (nd==0) return; cout <Uid()<<"("< "; for (i=0;iDaughter(i)->Uid()<<" "; cout <Daughter(i),level+1); if (level==0) cout <