void propagate(TLorentzVector &l, TVector3 &p, float charge, TH2F* hpro=0) { double x0=p.X()/100; double y0=p.Y()/100; double z0=p.Z()/100; double px0=l.Px(); double py0=l.Py(); double pz0=l.Pz(); double B=2; double pt=sqrt(px0*px0+py0*py0); double lambda=pz0/pt; double s_t=z0/lambda; double a=-0.2998*B*charge/3; double rho=a/pt; //cout <Fill(xt,yt); } } //cout <<"lam="<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",600,600); // **** 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 *fChrgCands=new TClonesArray("TCandidate"); //TClonesArray *fNeutCands=new TClonesArray("TCandidate"); //TClonesArray *fMcCands=new TClonesArray("TCandidate"); t->SetBranchAddress("PndChargedCandidates",&fChrgCands); //t->SetBranchAddress("PndNeutralCandidates",&fNeutCands); //t->SetBranchAddress("PndMcTracks",&fMcCands); TCandidate *tc; // **** create and setup some histos for QA plots // TH1F *ppimass = new TH1F("ppimass","p pi cands",100,1.115-0.2,1.115+0.2); ppimass->SetMinimum(0); if (num==0) num= t->GetEntriesFast(); cout <<"\n####### Processing "<SetCriterion("veryLoose"); TPidSimpleProtonSelector *pSel = new TPidSimpleProtonSelector(); pSel->SetCriterion("veryLoose"); int i1,i2; // **** loop over all _events_ // for (Int_t j=0; j< num;j++) { if ((j%100)==0) cout <<"evt "<GetEntry(j); TFactory::Instance()->Reset(); chargedCands.Cleanup(); // **** loop over all Candidates and add them to the list allCands // for (i1=0; i1GetEntriesFast(); i1++){ tc = (TCandidate *)fChrgCands->At(i1); TLorentzVector l=tc->P4(); TVector3 p=tc->Pos(); propagate(l,p,tc->GetCharge()); tc->SetP4(l); tc->SetPos(p); chargedCands.Add(*tc); } plusCands.Select(chargedCands, plusSel); minusCands.Select(chargedCands, minusSel); pplusCands.Select(plusCands,pSel); pminusCands.Select(minusCands,pSel); piplusCands.Select(plusCands,piSel); piminusCands.Select(minusCands,piSel); cout <<"chrg:"<Fill(tc->M()); } // **** plot all that stuff // c1->cd(1); ppimass->Draw(); timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime); } /*void printTree(TCandidate *tc, int 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 <