1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // Time Projection Chamber //
20 // Comparison macro for ESD //
22 // marian.ivanov@cern.ch //
32 gSystem->Load("libPWGPP.so");
34 AliRecInfoMaker *t2 = new AliRecInfoMaker("genTracks.root","cmpESDTracks.root","galice.root",0,0);
38 TFile f("cmpESDTracks.root");
39 TTree * tree = (TTree*)f.Get("ESDcmpTracks");
47 //some cuts definition
48 TCut cprim("cprim","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)<0.01&&abs(MC.fVDist[2])<0.01")
49 //TCut cprim("cprim","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)<0.5&&abs(MC.fVDist[2])<0.5")
50 //TCut citsin("citsin","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)<3.9");
51 TCut citsin("citsin","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)<5");
52 TCut csec("csec","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)>0.5");
55 TCut crec("crec","fReconstructed==1");
56 TCut cteta1("cteta1","abs(MC.fParticle.Theta()/3.1415-0.5)<0.25");
57 TCut cteta05("cteta05","abs(MC.fParticle.Theta()/3.1415-0.5)<0.1");
59 TCut cpos1("cpos1","abs(MC.fParticle.fVz/sqrt(MC.fParticle.fVx*MC.fParticle.fVx+MC.fParticle.fVy*MC.fParticle.fVy))<1");
60 TCut csens("csens","abs(sqrt(fVDist[0]**2+fVDist[1]**2)-170)<50");
61 TCut cmuon("cmuon","abs(MC.fParticle.fPdgCode==-13)");
62 TCut cchi2("cchi2","fESDtrack.fITSchi2MIP[0]<7.&&fESDtrack.fITSchi2MIP[1]<5.&&fESDtrack.fITSchi2MIP[2]<7.&&fESDtrack.fITSchi2MIP[3]<7.5&&fESDtrack.fITSchi2MIP[4]<6.")
67 comp.T()->SetAlias("radius","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)");
68 comp.T()->SetAlias("direction","MC.fParticle.fVx*MC.fParticle.fPx+MC.fParticle.fVy*MC.fParticle.fPy");
69 comp.T()->SetAlias("decaydir","MC.fTRdecay.fX*MC.fTRdecay.fPx+MC.fTRdecay.fY*MC.fTRdecay.fPy");
70 comp.T()->SetAlias("theta","MC.fTrackRef.Theta()");
71 comp.T()->SetAlias("primdca","sqrt(RC.fITStrack.fD[0]**2+RC.fITStrack.fD[1]**2)");
72 comp.T()->SetAlias("trdchi2","fTRDtrack.fChi2/fTRDtrack.fN");
73 comp.T()->SetAlias("trdchi2","fTRDtrack.fChi2/fTRDtrack.fN");
76 TH1F his("his","his",100,0,20);
77 TH1F hpools("hpools","hpools",100,-7,7);
78 TH1F hfake("hfake","hfake",1000,0,150);
79 TProfile profp0("profp0","profp0",20,-0.4,0.9)
81 comp.DrawXY("fTPCinP0[3]","fTPCDelta[4]/fTPCinP1[3]","fReconstructed==1"+cprim,"1",4,0.2,1.5,-0.06,0.06)
85 comp.DrawXY("fITSinP0[3]","fITSDelta[4]/fITSinP1[3]","fReconstructed==1&&fITSOn"+cprim,"1",4,0.2,1.5,-0.06,0.06)
88 comp.Eff("fTPCinP0[3]","fRowsWithDigits>120"+cteta1+cpos1+cprim,"fTPCOn",20,0.2,1.5)
91 comp.Eff("fTPCinP0[3]","fRowsWithDigits>120"+cteta1+cpos1+cprim,"fTPCOn&&fITSOn&&fESDtrack.fITSFakeRatio<0.1",10,0.2,1.5)
93 comp.Eff("fTPCinP0[3]","fRowsWithDigits>120"+cteta1+cpos1+cprim,"fTPCOn&&fITSOn&&fESDtrack.fITSFakeRatio>0.1",10,0.2,1.5)
96 comp.T()->Draw("fESDtrack.fITSsignal/fESDtrack.fTPCsignal","fITSOn&&fTPCOn&&fESDtrack.fITSFakeRatio==0")
98 TH1F his("his","his",100,0,20);
99 TH1F hpools("hpools","hpools",100,-7,7);
101 TH2F * hdedx0 = new TH2F("dEdx0","dEdx0",100, 0,2,200,0,550); hdedx0->SetMarkerColor(1);
102 TH2F * hdedx1 = new TH2F("dEdx1","dEdx1",100, 0,2,200,0,550); hdedx1->SetMarkerColor(4);
103 TH2F * hdedx2 = new TH2F("dEdx2","dEdx2",100, 0,2,200,0,550); hdedx2->SetMarkerColor(3);
104 TH2F * hdedx3 = new TH2F("dEdx3","dEdx3",100, 0,2,200,0,550); hdedx3->SetMarkerColor(2);
106 comp.T()->Draw("fESDtrack.fITSsignal:MC.fParticle.P()>>dEdx0","fITSOn&&abs(fPdg)==211&&fITStrack.fN==6"+cprim)
107 comp.T()->Draw("fESDtrack.fITSsignal:MC.fParticle.P()>>dEdx1","fITSOn&&abs(fPdg)==2212&&fITStrack.fN==6"+cprim)
108 comp.T()->Draw("fESDtrack.fITSsignal:MC.fParticle.P()>>dEdx2","fITSOn&&abs(fPdg)==321&&fITStrack.fN==6"+cprim)
109 comp.T()->Draw("fESDtrack.fITSsignal:MC.fParticle.P()>>dEdx3","fITSOn&&abs(fPdg)==11&&fITStrack.fN==6"+cprim)
112 comp.T()->Draw("fESDtrack.fTRDsignal:MC.fParticle.P()>>dEdx0","fTRDOn&&abs(fPdg)==211&&fTRDtrack.fN>40&&fStatus[2]>1")
113 comp.T()->Draw("fESDtrack.fTRDsignal:MC.fParticle.P()>>dEdx1","fTRDOn&&abs(fPdg)==2212&&fTRDtrack.fN>40&&fStatus[2]>1")
114 comp.T()->Draw("fESDtrack.fTRDsignal:MC.fParticle.P()>>dEdx2","fTRDOn&&abs(fPdg)==321&&fTRDtrack.fN>40&&fStatus[2]>1")
115 comp.T()->Draw("fESDtrack.fTRDsignal:MC.fParticle.P()>>dEdx3","fTRDOn&&abs(fPdg)==11&&fTRDtrack.fN>40&&fStatus[2]>1")
117 comp.T()->Draw("fESDtrack.fTPCsignal:fTPCinP0[4]>>dEdx0","fTPCOn&&abs(fPdg)==211&&fESDtrack.fTPCncls>180&&fESDtrack.fTPCsignal>10"+cteta1);
118 comp.T()->Draw("fESDtrack.fTPCsignal:fTPCinP0[4]>>dEdx1","fTPCOn&&abs(fPdg)==2212&&fESDtrack.fTPCncls>180&&fESDtrack.fTPCsignal>10"+cteta1);
119 comp.T()->Draw("fESDtrack.fTPCsignal:fTPCinP0[4]>>dEdx2","fTPCOn&&abs(fPdg)==321&&fESDtrack.fTPCncls>180&&fESDtrack.fTPCsignal>10"+cteta1);
120 comp.T()->Draw("fESDtrack.fTPCsignal:fTPCinP0[4]>>dEdx3","fTPCOn&&abs(fPdg)==11&&fESDtrack.fTPCncls>180&&fESDtrack.fTPCsignal>10"+cteta1);
122 hdedx3->SetXTitle("P(GeV/c)");
123 hdedx3->SetYTitle("dEdx(unit)");
124 hdedx3->Draw(); hdedx1->Draw("same"); hdedx2->Draw("same"); hdedx0->Draw("same");
126 comp.DrawXY("fITSinP0[3]","fITSPools[4]","fReconstructed==1&&fPdg==-211&&fITSOn"+cprim,"1",4,0.2,1.0,-8,8)
128 TProfile prof("prof","prof",10,0.5,5);
142 #include "TStopwatch.h"
143 #include "TVector3.h"
144 #include "TGeoManager.h"
145 //#include "Getline.h"
150 #include "AliESDtrack.h"
151 #include "AliTPCParam.h"
153 #include "AliTrackReference.h"
154 #include "AliTPCParamSR.h"
155 #include "AliTracker.h"
156 #include "AliESDEvent.h"
158 #include "AliESDfriend.h"
159 #include "AliESDtrack.h"
160 #include "AliTPCseed.h"
161 #include "AliITStrackMI.h"
162 #include "AliESDVertex.h"
163 #include "AliExternalTrackParam.h"
164 #include "AliESDkink.h"
165 #include "AliESDv0.h"
168 #include "AliTreeDraw.h"
169 #include "AliMCInfo.h"
170 #include "AliGenKinkInfo.h"
171 #include "AliGenV0Info.h"
174 #include "AliESDRecInfo.h"
175 #include "AliESDRecV0Info.h"
176 #include "AliESDRecKinkInfo.h"
177 #include "AliRecInfoMaker.h"
181 ClassImp(AliRecInfoMaker)
186 AliTPCParam * AliRecInfoMaker::GetTPCParam(){
190 AliTPCParamSR * par = new AliTPCParamSR;
197 void AliRecInfoMaker::MakeAliases(TTree * tree)
200 // aliases definition
202 tree->SetAlias("radius","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)");
203 tree->SetAlias("direction","MC.fParticle.fVx*MC.fParticle.fPx+MC.fParticle.fVy*MC.fParticle.fPy");
204 tree->SetAlias("decaydir","MC.fTRdecay.fX*MC.fTRdecay.fPx+MC.fTRdecay.fY*MC.fTRdecay.fPy");
205 tree->SetAlias("theta","MC.fTrackRef.Theta()");
206 tree->SetAlias("primdca","sqrt(RC.fITStrack.fD[0]**2+RC.fITStrack.fD[1]**2)");
207 tree->SetAlias("trdchi2","fTRDtrack.fChi2/fTRDtrack.fN");
208 tree->SetAlias("trdchi2","fTRDtrack.fChi2/fTRDtrack.fN");
210 tree->SetAlias("trddedx","(RC.fESDtrack.fTRDsignals[0]+RC.fESDtrack.fTRDsignals[1]+RC.fESDtrack.fTRDsignals[2]+RC.fESDtrack.fTRDsignals[3]+RC.fESDtrack.fTRDsignals[4]+RC.fESDtrack.fTRDsignals[5])/6.");
212 tree->SetAlias("dtofmc2","fESDtrack.fTrackTime[2]-(10^12*MC.fTOFReferences[0].fTime)");
213 tree->SetAlias("dtofrc2","(fESDtrack.fTrackTime[2]-fESDtrack.fTOFsignal)");
215 tree->SetAlias("psum","fESDtrack.fTOFr[4]+fESDtrack.fTOFr[3]+fESDtrack.fTOFr[2]+fESDtrack.fTOFr[1]+fESDtrack.fTOFr[0]");
216 tree->SetAlias("P0","fESDtrack.fTOFr[0]/psum");
217 tree->SetAlias("P1","fESDtrack.fTOFr[1]/psum");
218 tree->SetAlias("P2","fESDtrack.fTOFr[2]/psum");
219 tree->SetAlias("P3","fESDtrack.fTOFr[3]/psum");
220 tree->SetAlias("P4","fESDtrack.fTOFr[4]/psum");
221 tree->SetAlias("MaxP","max(max(max(P0,P1),max(P2,P3)),P4)");
225 ////////////////////////////////////////////////////////////////////////
226 AliRecInfoMaker::AliRecInfoMaker(const char* fnGenTracks,
228 const char* fnGalice,
229 Int_t nEvents, Int_t firstEvent):
231 fEventNr(0), //! current event number
232 fNEvents(0), //! number of events to process
233 fFirstEventNr(0), //! first event to process
234 fFileCmp(0), //! output file with cmp tracks
235 fTreeCmp(0), //! output tree with cmp tracks
236 fTreeCmpKinks(0), //! output tree with cmp Kinks
237 fTreeCmpV0(0), //! output tree with cmp V0
239 fFileGenTracks(0), //! input files with generated tracks
240 fTreeGenTracks(0), //! tree with generated tracks
241 fTreeGenKinks(0), // tree with gen kinks
242 fTreeGenV0(0), // tree with gen V0
244 fLoader(0), //! pointer to the run loader
246 fIndexRecTracks(0), //! index of particle label in the TreeT_ESD
247 fFakeRecTracks(0), //! number of fake tracks
248 fMultiRecTracks(0), //! number of multiple reconstructions
250 fIndexRecKinks(0), //! index of particle label in treeesd
251 fMultiRecKinks(0), //! number of multiple reconstructions
252 fSignedKinks(0), //! indicator that kink was not fake
254 fIndexRecV0(0), //! index of particle label in treeesd
255 fMultiRecV0(0), //! number of multiple reconstructions
256 fSignedV0(0), //! indicator that kink was not fake
258 fRecArray(0), // container with rec infos
260 fESDfriend(0), //!event friend
262 fParamTPC(0), //! AliTPCParam
263 fNParticles(0), //! number of particles in the input tree genTracks
264 fDebug(0), //! debug flag
265 fNextTreeGenEntryToRead(0), //! last entry already read from genTracks tree
266 fNextKinkToRead(0), //! last entry already read from genKinks tree
267 fNextV0ToRead(0), //! last entry already read from genV0 tree
269 fMCInfo(0), //! MC information writen per particle
270 fGenKinkInfo(0), //! MC information writen per Kink
271 fGenV0Info(0), //! MC information writen per Kink
272 fRecInfo(0), //! Rec. information writen per particle
273 fFriend(0), //! friend track
274 fRecKinkInfo(0), //! reconstructed kink info
275 fRecV0Info(0) //! reconstructed kink info
277 // AliRecInfoMaker - connencts the MC information with reconstructed information
278 // fnGenTracks - file with MC to be created before using AliGenInfoMaker
279 // fnCmp - file name to be created
280 // fnGalice - file with Loaders - usualy galice.root
282 // nEvent - number of event s to be analyzed
283 // AliRecInfoMaker *t2 = new AliRecInfoMaker("genTracks.root","cmpESDTracks.root","galice.root",0,0);
288 // fFnGenTracks = fnGenTracks;
291 memset(fFnGenTracks,0,sizeof(fFnGenTracks));
292 memset(fFnCmp,0,sizeof(fFnCmp));
294 snprintf(fFnGenTracks,1000,"%s",fnGenTracks);
295 snprintf(fFnCmp,1000,"%s",fnCmp);
297 fFirstEventNr = firstEvent;
298 fEventNr = firstEvent;
301 fLoader = AliRunLoader::Open(fnGalice);
303 //delete AliRunLoader::Instance();
307 if (fLoader->LoadgAlice()){
308 cerr<<"Error occured while l"<<endl;
310 Int_t nall = fLoader->GetNumberOfEvents();
318 cerr<<"no events available"<<endl;
322 if (firstEvent+nEvents>nall) {
323 fEventNr = nall-firstEvent;
324 cerr<<"restricted number of events availaible"<<endl;
326 TGeoManager::Import("geometry.root");
330 ////////////////////////////////////////////////////////////////////////
331 AliRecInfoMaker::AliRecInfoMaker(const AliRecInfoMaker& /*info*/):
333 fEventNr(0), //! current event number
334 fNEvents(0), //! number of events to process
335 fFirstEventNr(0), //! first event to process
336 fFileCmp(0), //! output file with cmp tracks
337 fTreeCmp(0), //! output tree with cmp tracks
338 fTreeCmpKinks(0), //! output tree with cmp Kinks
339 fTreeCmpV0(0), //! output tree with cmp V0
341 fFileGenTracks(0), //! input files with generated tracks
342 fTreeGenTracks(0), //! tree with generated tracks
343 fTreeGenKinks(0), // tree with gen kinks
344 fTreeGenV0(0), // tree with gen V0
346 fLoader(0), //! pointer to the run loader
348 fIndexRecTracks(0), //! index of particle label in the TreeT_ESD
349 fFakeRecTracks(0), //! number of fake tracks
350 fMultiRecTracks(0), //! number of multiple reconstructions
352 fIndexRecKinks(0), //! index of particle label in treeesd
353 fMultiRecKinks(0), //! number of multiple reconstructions
354 fSignedKinks(0), //! indicator that kink was not fake
356 fIndexRecV0(0), //! index of particle label in treeesd
357 fMultiRecV0(0), //! number of multiple reconstructions
358 fSignedV0(0), //! indicator that kink was not fake
360 fRecArray(0), // container with rec infos
362 fESDfriend(0), //!event friend
364 fParamTPC(0), //! AliTPCParam
365 fNParticles(0), //! number of particles in the input tree genTracks
366 fDebug(0), //! debug flag
367 fNextTreeGenEntryToRead(0), //! last entry already read from genTracks tree
368 fNextKinkToRead(0), //! last entry already read from genKinks tree
369 fNextV0ToRead(0), //! last entry already read from genV0 tree
371 fMCInfo(0), //! MC information writen per particle
372 fGenKinkInfo(0), //! MC information writen per Kink
373 fGenV0Info(0), //! MC information writen per Kink
374 fRecInfo(0), //! Rec. information writen per particle
375 fFriend(0), //! friend track
376 fRecKinkInfo(0), //! reconstructed kink info
377 fRecV0Info(0) //! reconstructed kink info
380 // Dummy copu constructor
382 memset(fFnGenTracks,0,sizeof(fFnGenTracks));
383 memset(fFnCmp,0,sizeof(fFnCmp));
389 ////////////////////////////////////////////////////////////////////////
390 AliRecInfoMaker::~AliRecInfoMaker()
400 //////////////////////////////////////////////////////////////
401 Int_t AliRecInfoMaker::SetIO()
404 // SetIO - Create the input trees
407 if (!fTreeCmp) return 1;
408 fParamTPC = GetTPCParam();
410 if (!ConnectGenTree()) {
411 cerr<<"Cannot connect tree with generated tracks"<<endl;
417 //////////////////////////////////////////////////////////////
419 Int_t AliRecInfoMaker::SetIO(Int_t eventNr)
425 TFile f("AliESDs.root");
428 TTree* tree = (TTree*) f.Get("esdTree");
429 tree->SetBranchStatus("*",1);
430 fEvent = new AliESDEvent;
432 if (tree->GetBranch("ESD")){
433 // tree->SetBranchAddress("ESD", &fEvent);
434 // tree->SetBranchAddress("ESDfriend.",&fESDfriend);
435 // tree->GetEntry(eventNr);
436 // fEvent->SetESDfriend(fESDfriend);
438 fEvent->ReadFromTree(tree);
439 fESDfriend = (AliESDfriend*)fEvent->FindListObject("AliESDfriend");
440 tree->GetEntry(eventNr);
441 fEvent->SetESDfriend(fESDfriend);
446 if (!fEvent) return 1;
453 ////////////////////////////////////////////////////////////////////////
454 void AliRecInfoMaker::Reset()
464 // fFnCmp = "cmpTracks.root";
472 ////////////////////////////////////////////////////////////////////////
473 Int_t AliRecInfoMaker::Exec(Int_t nEvents, Int_t firstEventNr)
476 // Exec comparison for subrange of events
479 fFirstEventNr = firstEventNr;
483 ////////////////////////////////////////////////////////////////////////
484 Int_t AliRecInfoMaker::Exec()
495 fNextTreeGenEntryToRead = 0;
498 cerr<<"fFirstEventNr, fNEvents: "<<fFirstEventNr<<" "<<fNEvents<<endl;
499 for (Int_t eventNr = fFirstEventNr; eventNr < fFirstEventNr+fNEvents;
503 fNParticles = gAlice->GetEvent(fEventNr);
505 fIndexRecTracks = new Short_t[fNParticles*20]; //write at maximum 4 tracks corresponding to particle
506 fIndexRecKinks = new Short_t[fNParticles*20]; //write at maximum 20 tracks corresponding to particle
507 fIndexRecV0 = new Short_t[fNParticles*20]; //write at maximum 20 tracks corresponding to particle
509 fFakeRecTracks = new Short_t[fNParticles];
510 fMultiRecTracks = new Short_t[fNParticles];
511 fMultiRecKinks = new Short_t[fNParticles];
512 fMultiRecV0 = new Short_t[fNParticles];
514 for (Int_t i = 0; i<fNParticles; i++) {
515 for (Int_t j=0;j<20;j++){
516 fIndexRecTracks[20*i+j] = -1;
517 fIndexRecKinks[20*i+j] = -1;
518 fIndexRecV0[20*i+j] = -1;
520 fFakeRecTracks[i] = 0;
521 fMultiRecTracks[i] = 0;
522 fMultiRecKinks[i] = 0;
526 cout<<"Start to process event "<<fEventNr<<endl;
527 cout<<"\tfNParticles = "<<fNParticles<<endl;
528 if (fDebug>2) cout<<"\tStart loop over TreeT"<<endl;
529 if (TreeTLoop()>0) return 1;
531 if (fDebug>2) cout<<"\tStart loop over tree genTracks"<<endl;
532 if (TreeGenLoop(eventNr)>0) return 1;
533 //BuildKinkInfo0(eventNr);
534 BuildV0Info(eventNr); // no V0 info for a moment
537 if (fDebug>2) cout<<"\tEnd loop over tree genTracks"<<endl;
539 delete [] fIndexRecTracks;
540 delete [] fIndexRecKinks;
541 delete [] fIndexRecV0;
542 delete [] fFakeRecTracks;
543 delete [] fMultiRecTracks;
544 delete [] fMultiRecKinks;
545 delete [] fMultiRecV0;
550 cerr<<"Exec finished"<<endl;
556 ////////////////////////////////////////////////////////////////////////
557 Bool_t AliRecInfoMaker::ConnectGenTree()
560 // connect all branches from the genTracksTree
561 // use the same variables as for the new cmp tree, it may work
563 fFileGenTracks = TFile::Open(fFnGenTracks,"READ");
564 if (!fFileGenTracks) {
565 cerr<<"Error in ConnectGenTree: cannot open file "<<fFnGenTracks<<endl;
568 fTreeGenTracks = (TTree*)fFileGenTracks->Get("genTracksTree");
569 if (!fTreeGenTracks) {
570 cerr<<"Error in ConnectGenTree: cannot find genTracksTree in the file "
571 <<fFnGenTracks<<endl;
575 fMCInfo = new AliMCInfo;
576 fTreeGenTracks->SetBranchAddress("MC",&fMCInfo);
579 fTreeGenKinks = (TTree*)fFileGenTracks->Get("genKinksTree");
580 if (!fTreeGenKinks) {
581 cerr<<"Error in ConnectGenTree: cannot find genTracksTree in the file "
582 <<fFnGenTracks<<endl;
586 fGenKinkInfo = new AliGenKinkInfo;
587 fTreeGenKinks->SetBranchAddress("MC",&fGenKinkInfo);
590 fTreeGenV0 = (TTree*)fFileGenTracks->Get("genV0Tree");
592 cerr<<"Error in ConnectGenTree: cannot find genTracksTree in the file "
593 <<fFnGenTracks<<endl;
597 fGenV0Info = new AliGenV0Info;
598 fTreeGenV0->SetBranchAddress("MC",&fGenV0Info);
602 cout<<"Number of gen. tracks with TR: "<<fTreeGenTracks->GetEntries()<<endl;
608 ////////////////////////////////////////////////////////////////////////
609 void AliRecInfoMaker::CreateTreeCmp()
612 // Create file and tree with comparison information
614 fFileCmp = TFile::Open(fFnCmp,"RECREATE");
616 cerr<<"Error in CreateTreeCmp: cannot open file "<<fFnCmp<<endl;
621 fTreeCmp = new TTree("ESDcmpTracks","ESDcmpTracks");
622 fMCInfo = new AliMCInfo;
623 fRecInfo = new AliESDRecInfo;
624 AliESDtrack * esdTrack = new AliESDtrack;
625 // AliITStrackMI * itsTrack = new AliITStrackMI;
626 fTreeCmp->Branch("MC","AliMCInfo",&fMCInfo,256000);
627 fTreeCmp->Branch("RC","AliESDRecInfo",&fRecInfo,256000);
628 // fTreeCmp->Branch("ITS","AliITStrackMI",&itsTrack);
632 fTreeCmpKinks = new TTree("ESDcmpKinks","ESDcmpKinks");
633 fGenKinkInfo = new AliGenKinkInfo;
634 fRecKinkInfo = new AliESDRecKinkInfo;
635 fTreeCmpKinks->Branch("MC.","AliGenKinkInfo",&fGenKinkInfo,256000);
636 fTreeCmpKinks->Branch("RC.","AliESDRecKinkInfo",&fRecKinkInfo,256000);
639 fTreeCmpV0 = new TTree("ESDcmpV0","ESDcmpV0");
640 fGenV0Info = new AliGenV0Info;
641 fRecV0Info = new AliESDRecV0Info;
642 fTreeCmpV0->Branch("MC.","AliGenV0Info", &fGenV0Info,256000);
643 fTreeCmpV0->Branch("RC.","AliESDRecV0Info",&fRecV0Info,256000);
645 fTreeCmp->AutoSave();
646 fTreeCmpKinks->AutoSave();
647 fTreeCmpV0->AutoSave();
650 ////////////////////////////////////////////////////////////////////////
651 void AliRecInfoMaker::CloseOutputFile()
658 cerr<<"File "<<fFnCmp<<" not found as an open file."<<endl;
669 ////////////////////////////////////////////////////////////////////////
671 TVector3 AliRecInfoMaker::TR2Local(AliTrackReference *trackRef,
672 AliTPCParam *paramTPC) {
675 // Transform position to the local coord frame
678 Float_t x[3] = { trackRef->X(),trackRef->Y(),trackRef->Z()};
680 paramTPC->Transform0to1(x,index);
681 paramTPC->Transform1to2Ideal(x,index);
684 ////////////////////////////////////////////////////////////////////////
686 Int_t AliRecInfoMaker::TreeTLoop()
689 // loop over all ESD reconstructed tracks and store info in memory
691 // + loop over all reconstructed kinks
695 Int_t nEntries = (Int_t)fEvent->GetNumberOfTracks();
696 Int_t nKinks = (Int_t) fEvent->GetNumberOfKinks();
697 Int_t nV0MIs = (Int_t) fEvent->GetNumberOfV0s();
698 fSignedKinks = new Short_t[nKinks];
699 fSignedV0 = new Short_t[nV0MIs];
701 // load kinks to the memory
702 for (Int_t i=0; i<nKinks;i++){
703 // AliESDkink * kink =
708 for (Int_t i=0; i<nV0MIs;i++){
710 (AliV0*)fEvent->GetV0(i);
716 AliESDtrack * track=0;
717 for (Int_t iEntry=0; iEntry<nEntries;iEntry++){
718 track = (AliESDtrack*)fEvent->GetTrack(iEntry);
720 Int_t label = track->GetLabel();
721 Int_t absLabel = abs(label);
722 if (absLabel < fNParticles) {
723 // fIndexRecTracks[absLabel] = iEntry;
724 if (label < 0) fFakeRecTracks[absLabel]++;
725 if (fMultiRecTracks[absLabel]>0){
726 if (fMultiRecTracks[absLabel]<20)
727 fIndexRecTracks[absLabel*20+fMultiRecTracks[absLabel]] = iEntry;
730 fIndexRecTracks[absLabel*20] = iEntry;
731 fMultiRecTracks[absLabel]++;
734 // sort reconstructed kinks
737 for (Int_t iEntry=0; iEntry<nKinks;iEntry++){
738 kink = (AliESDkink*)fEvent->GetKink(iEntry);
741 Int_t label0 = TMath::Abs(kink->GetLabel(0));
742 Int_t label1 = TMath::Abs(kink->GetLabel(1));
743 Int_t absLabel = TMath::Min(label0,label1);
744 if (absLabel < fNParticles) {
745 if (fMultiRecKinks[absLabel]>0){
746 if (fMultiRecKinks[absLabel]<20)
747 fIndexRecKinks[absLabel*20+fMultiRecKinks[absLabel]] = iEntry;
750 fIndexRecKinks[absLabel*20] = iEntry;
751 fMultiRecKinks[absLabel]++;
754 // --sort reconstructed V0
757 for (Int_t iEntry=0; iEntry<nV0MIs;iEntry++){
758 v0MI = (AliV0*)fEvent->GetV0(iEntry);
763 //Int_t label0 = TMath::Abs(v0MI->GetLabel(0));
764 //Int_t label1 = TMath::Abs(v0MI->GetLabel(1));
765 AliESDtrack * trackn = fEvent->GetTrack((v0MI->GetNindex()));
766 AliESDtrack * trackp = fEvent->GetTrack((v0MI->GetPindex()));
767 Int_t labels[2]={-1,-1};
768 labels[0] = (trackn==0) ? -1 : TMath::Abs(trackn->GetLabel());
769 labels[1] = (trackp==0) ? -1 : TMath::Abs(trackp->GetLabel());
771 for (Int_t i=0;i<2;i++){
772 Int_t absLabel = TMath::Abs(labels[i]);
773 if (absLabel < fNParticles) {
774 if (fMultiRecV0[absLabel]>0){
775 if (fMultiRecV0[absLabel]<20)
776 fIndexRecV0[absLabel*20+fMultiRecV0[absLabel]] = iEntry;
779 fIndexRecV0[absLabel*20] = iEntry;
780 fMultiRecV0[absLabel]++;
786 printf("Time spended in TreeTLoop\n");
789 if (fDebug > 2) cerr<<"end of TreeTLoop"<<endl;
793 ////////////////////////////////////////////////////////////////////////
794 Int_t AliRecInfoMaker::TreeGenLoop(Int_t eventNr)
797 // loop over all entries for a given event, find corresponding
798 // rec. track and store in the fTreeCmp
802 Int_t entry = fNextTreeGenEntryToRead;
803 Double_t nParticlesTR = fTreeGenTracks->GetEntriesFast();
804 cerr<<"fNParticles, nParticlesTR, fNextTreeGenEntryToRead: "<<fNParticles<<" "
805 <<nParticlesTR<<" "<<fNextTreeGenEntryToRead<<endl;
806 TBranch * branch = fTreeCmp->GetBranch("RC");
807 // TBranch * branchF = fTreeCmp->GetBranch("F");
809 branch->SetAddress(&fRecInfo); // set all pointers
810 fRecArray = new TObjArray(fNParticles);
811 AliESDtrack dummytrack; //
812 AliESDfriendTrack dummytrackF; //
814 while (entry < nParticlesTR) {
815 fTreeGenTracks->GetEntry(entry);
817 if (eventNr < fMCInfo->fEventNr) continue;
818 if (eventNr > fMCInfo->fEventNr) continue;
819 if (fMCInfo->GetCharge()==0) continue;
821 fNextTreeGenEntryToRead = entry-1;
822 if (fDebug > 2 && fMCInfo->fLabel < 10) {
823 cerr<<"Fill track with a label "<<fMCInfo->fLabel<<endl;
825 // if (fMCInfo->fNTPCRef<1) continue; // not TPCref
828 AliESDtrack * track=0;
829 fRecInfo->fReconstructed =0;
830 TVector3 local = TR2Local(&(fMCInfo->fTrackRef),fParamTPC);
831 local.GetXYZ(fRecInfo->fTRLocalCoord);
833 if (fIndexRecTracks[fMCInfo->fLabel*20] >= 0) {
834 track= (AliESDtrack*)fEvent->GetTrack(fIndexRecTracks[fMCInfo->fLabel*20]);
838 // find nearest track if multifound
839 //Int_t sign = Int_t(track->GetSign()*fMCInfo->fCharge);
842 if ((track->GetStatus()&AliESDtrack::kITSrefit)>0) status++;
843 if ((track->GetStatus()&AliESDtrack::kTPCrefit)>0) status++;
844 if ((track->GetStatus()&AliESDtrack::kTRDrefit)>0) status++;
847 if (fIndexRecTracks[fMCInfo->fLabel*20+1]>0){
850 track->GetInnerPxPyPz(p);
851 Float_t maxp = p[0]*p[0]+p[1]*p[1]+p[2]*p[2];
853 for (Int_t i=1;i<20;i++){
854 if (fIndexRecTracks[fMCInfo->fLabel*20+i]>=0){
855 AliESDtrack * track2 = (AliESDtrack*)fEvent->GetTrack(fIndexRecTracks[fMCInfo->fLabel*20+i]);
856 if (!track2) continue;
857 //Int_t sign2 = track->GetSign()*fMCInfo->fCharge; //
858 //if (sign2<0) continue;
859 track2->GetInnerPxPyPz(p);
860 Float_t mom = p[0]*p[0]+p[1]*p[1]+p[2]*p[2];
871 if ((track2->GetStatus()&AliESDtrack::kITSrefit)>0) status2++;
872 if ((track2->GetStatus()&AliESDtrack::kTPCrefit)>0) status2++;
873 if ((track2->GetStatus()&AliESDtrack::kTRDrefit)>0) status2++;
874 if (status2<status) continue;
876 if (mom<maxp) continue;
884 fRecInfo->SetESDtrack(track);
888 fRecInfo->SetESDtrack(track);
890 fRecInfo->SetESDtrack(&dummytrack);
895 fRecInfo->fReconstructed = 1;
896 fRecInfo->fFake = fFakeRecTracks[fMCInfo->fLabel];
897 fRecInfo->fMultiple = fMultiRecTracks[fMCInfo->fLabel];
899 fRecInfo->Update(fMCInfo,fParamTPC,kTRUE);
902 fRecInfo->SetESDtrack(&dummytrack);
903 fRecInfo->Update(fMCInfo,fParamTPC,kFALSE);
905 fRecArray->AddAt(new AliESDRecInfo(*fRecInfo),fMCInfo->fLabel);
908 fTreeCmp->AutoSave();
909 printf("Time spended in TreeGenLoop\n");
911 if (fDebug > 2) cerr<<"end of TreeGenLoop"<<endl;
918 ////////////////////////////////////////////////////////////////////////
919 ////////////////////////////////////////////////////////////////////////
920 ////////////////////////////////////////////////////////////////////////
921 Int_t AliRecInfoMaker::BuildKinkInfo0(Int_t eventNr)
924 // loop over all entries for a given event, find corresponding
925 // rec. track and store in the fTreeCmp
929 Int_t entry = fNextKinkToRead;
930 Double_t nParticlesTR = fTreeGenKinks->GetEntriesFast();
931 cerr<<"fNParticles, nParticlesTR, fNextKinkToRead: "<<fNParticles<<" "
932 <<nParticlesTR<<" "<<fNextKinkToRead<<endl;
934 TBranch * branch = fTreeCmpKinks->GetBranch("RC.");
935 branch->SetAddress(&fRecKinkInfo); // set all pointers
938 while (entry < nParticlesTR) {
939 fTreeGenKinks->GetEntry(entry);
941 if (eventNr < fGenKinkInfo->GetMinus().fEventNr) continue;
942 if (eventNr > fGenKinkInfo->GetMinus().fEventNr) continue;;
944 fNextKinkToRead = entry-1;
947 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(fGenKinkInfo->GetMinus().fLabel);
948 if(!fRecInfo1) continue;
949 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(fGenKinkInfo->GetPlus().fLabel);
950 if(!fRecInfo2) continue;
951 fRecKinkInfo->fT1 = (*fRecInfo1);
952 fRecKinkInfo->fT2 = (*fRecInfo2);
953 fRecKinkInfo->fStatus =0;
954 if (fRecInfo1 && fRecInfo1->fTPCOn) fRecKinkInfo->fStatus+=1;
955 if (fRecInfo2 && fRecInfo2->fTPCOn) fRecKinkInfo->fStatus+=2;
956 if (fRecKinkInfo->fStatus==3&&fRecInfo1->fSign!=fRecInfo2->fSign) fRecKinkInfo->fStatus*=-1;
958 if (fRecKinkInfo->fStatus==3){
959 fRecKinkInfo->Update();
961 Int_t label = TMath::Min(fGenKinkInfo->GetMinus().fLabel,fGenKinkInfo->GetPlus().fLabel);
962 Int_t label2 = TMath::Max(fGenKinkInfo->GetMinus().fLabel,fGenKinkInfo->GetPlus().fLabel);
965 fRecKinkInfo->fRecStatus =0;
966 fRecKinkInfo->fMultiple = fMultiRecKinks[label];
967 fRecKinkInfo->fKinkMultiple=0;
969 if (fMultiRecKinks[label]>0){
971 // for (Int_t j=0;j<TMath::Min(fMultiRecKinks[label],100);j++){
972 for (Int_t j=TMath::Min(fMultiRecKinks[label],Short_t(20))-1;j>=0;j--){
973 Int_t index = fIndexRecKinks[label*20+j];
974 //AliESDkink *kink2 = (AliESDkink*)fKinks->At(index);
975 AliESDkink *kink2 = (AliESDkink*)fEvent->GetKink(index);
976 if (TMath::Abs(kink2->GetLabel(0))==label &&TMath::Abs(kink2->GetLabel(1))==label2) {
977 fRecKinkInfo->fKinkMultiple++;
978 fSignedKinks[index]=1;
981 // if (kink->fTRDOn) c0++;
982 //if (kink->fITSOn) c0++;
983 if (kink->GetStatus(2)>0) c0++;
984 if (kink->GetStatus(0)>0) c0++;
987 // if (kink2->fTRDOn) c2++;
988 //if (kink2->fITSOn) c2++;
989 if (kink2->GetStatus(2)>0) c2++;
990 if (kink2->GetStatus(0)>0) c2++;
995 if (TMath::Abs(kink2->GetLabel(1))==label &&TMath::Abs(kink2->GetLabel(0))==label2) {
996 fRecKinkInfo->fKinkMultiple++;
997 fSignedKinks[index]=1;
1000 //if (kink->fTRDOn) c0++;
1001 //if (kink->fITSOn) c0++;
1002 if (kink->GetStatus(2)>0) c0++;
1003 if (kink->GetStatus(0)>0) c0++;
1007 // if (kink2->fTRDOn) c2++;
1008 //if (kink2->fITSOn) c2++;
1009 if (kink2->GetStatus(2)>0) c2++;
1010 if (kink2->GetStatus(0)>0) c2++;
1012 if (c2<c0) continue;
1018 fRecKinkInfo->fKink = *kink;
1019 fRecKinkInfo->fRecStatus=1;
1021 fTreeCmpKinks->Fill();
1023 // Int_t nkinks = fKinks->GetEntriesFast();
1024 Int_t nkinks = fEvent->GetNumberOfKinks();
1025 for (Int_t i=0;i<nkinks;i++){
1026 if (fSignedKinks[i]==0){
1027 // AliESDkink *kink = (AliESDkink*)fKinks->At(i);
1028 AliESDkink *kink = (AliESDkink*)fEvent->GetKink(i);
1029 if (!kink) continue;
1031 fRecKinkInfo->fKink = *kink;
1032 fRecKinkInfo->fRecStatus =-2;
1034 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(kink->GetLabel(0)));
1035 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(kink->GetLabel(1)));
1036 if (fRecInfo1 && fRecInfo2){
1037 fRecKinkInfo->fT1 = (*fRecInfo1);
1038 fRecKinkInfo->fT2 = (*fRecInfo2);
1039 fRecKinkInfo->fRecStatus =-1;
1041 fTreeCmpKinks->Fill();
1046 fTreeCmpKinks->AutoSave();
1047 printf("Time spended in BuilKinkInfo Loop\n");
1049 if (fDebug > 2) cerr<<"end of BuildKinkInfo Loop"<<endl;
1055 ////////////////////////////////////////////////////////////////////////
1056 ////////////////////////////////////////////////////////////////////////
1057 ////////////////////////////////////////////////////////////////////////
1061 Int_t AliRecInfoMaker::BuildV0Info(Int_t eventNr)
1064 // loop over all entries for a given event, find corresponding
1065 // rec. track and store in the fTreeCmp
1067 static TDatabasePDG pdgtable;
1071 Int_t entry = fNextV0ToRead;
1072 Double_t nParticlesTR = fTreeGenV0->GetEntriesFast();
1073 cerr<<"fNParticles, nParticlesTR, fNextV0ToRead: "<<fNParticles<<" "
1074 <<nParticlesTR<<" "<<fNextV0ToRead<<endl;
1076 TBranch * branch = fTreeCmpV0->GetBranch("RC.");
1077 branch->SetAddress(&fRecV0Info); // set all pointers
1078 const AliESDVertex * esdvertex = fEvent->GetVertex();
1079 Float_t vertex[3]= {esdvertex->GetXv(), esdvertex->GetYv(),esdvertex->GetZv()};
1082 while (entry < nParticlesTR) {
1083 fTreeGenV0->GetEntry(entry);
1085 fRecV0Info->Reset(); //reset all variables
1086 if (eventNr < fGenV0Info->GetMinus().fEventNr) continue;
1087 if (eventNr > fGenV0Info->GetMinus().fEventNr) continue;;
1089 fNextV0ToRead = entry-1;
1092 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(fGenV0Info->GetMinus().fLabel);
1093 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(fGenV0Info->GetPlus().fLabel);
1094 if (fGenV0Info->GetMinus().fCharge*fGenV0Info->GetPlus().fCharge>0) continue; // interactions
1095 if (!fRecInfo1 || !fRecInfo2) continue;
1096 fRecV0Info->fT1 = (*fRecInfo1);
1097 fRecV0Info->fT2 = (*fRecInfo2);
1098 fRecV0Info->fV0Status =0;
1099 if (fRecInfo1 && fRecInfo1->fStatus[1]>0) fRecV0Info->fV0Status+=1;
1100 if (fRecInfo2 && fRecInfo2->fStatus[1]>0) fRecV0Info->fV0Status+=2;
1102 if (fRecV0Info->fV0Status==3&&fRecInfo1->fSign==fRecInfo2->fSign) fRecV0Info->fV0Status*=-1;
1105 if (abs(fRecV0Info->fV0Status)==3){
1106 fRecV0Info->Update(vertex);
1110 Double_t x,alpha, param[5],cov[15];
1111 if ( fRecV0Info->fT1.GetESDtrack()->GetInnerParam() && fRecV0Info->fT2.GetESDtrack()->GetInnerParam()){
1112 fRecV0Info->fT1.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
1113 fRecV0Info->fT1.GetESDtrack()->GetInnerExternalCovariance(cov);
1114 AliExternalTrackParam paramP(x,alpha,param,cov);
1116 fRecV0Info->fT2.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
1117 fRecV0Info->fT2.GetESDtrack()->GetInnerExternalCovariance(cov);
1118 AliExternalTrackParam paramM(x,alpha,param,cov);
1120 fRecV0Info->fV0tpc->SetParamN(paramM);
1121 fRecV0Info->fV0tpc->SetParamP(paramP);
1122 Double_t pid1[5],pid2[5];
1123 fRecV0Info->fT1.GetESDtrack()->GetESDpid(pid1);
1124 fRecV0Info->fT1.GetESDtrack()->GetESDpid(pid2);
1126 //fRecV0Info->fV0tpc.UpdatePID(pid1,pid2);
1127 fRecV0Info->fV0tpc->Update(vertex);
1131 fRecV0Info->fT1.GetESDtrack()->GetExternalParameters(x,param);
1132 fRecV0Info->fT1.GetESDtrack()->GetExternalCovariance(cov);
1133 alpha = fRecV0Info->fT1.GetESDtrack()->GetAlpha();
1134 new (¶mP) AliExternalTrackParam(x,alpha,param,cov);
1136 fRecV0Info->fT2.GetESDtrack()->GetExternalParameters(x,param);
1137 fRecV0Info->fT2.GetESDtrack()->GetExternalCovariance(cov);
1138 alpha = fRecV0Info->fT2.GetESDtrack()->GetAlpha();
1139 new (¶mM) AliExternalTrackParam(x,alpha,param,cov);
1141 fRecV0Info->fV0its->SetParamN(paramM);
1142 fRecV0Info->fV0its->SetParamP(paramP);
1143 // fRecV0Info->fV0its.UpdatePID(pid1,pid2);
1144 fRecV0Info->fV0its->Update(vertex);
1150 if (TMath::Abs(fGenV0Info->GetMinus().fPdg)==11 &&TMath::Abs(fGenV0Info->GetPlus().fPdg)==11){
1151 if (fRecV0Info->fDist2>10){
1152 fRecV0Info->Update(vertex);
1154 if (fRecV0Info->fDist2>10){
1155 fRecV0Info->Update(vertex);
1160 // take the V0 from reconstruction
1162 Int_t label = TMath::Min(fGenV0Info->GetMinus().fLabel,fGenV0Info->GetPlus().fLabel);
1163 Int_t label2 = TMath::Max(fGenV0Info->GetMinus().fLabel,fGenV0Info->GetPlus().fLabel);
1166 fRecV0Info->fRecStatus =0;
1167 fRecV0Info->fMultiple = fMultiRecV0[label];
1168 fRecV0Info->fV0MultipleOn=0;
1169 fRecV0Info->fV0MultipleOff=0;
1171 if (fMultiRecV0[label]>0 || fMultiRecV0[label2]>0){
1173 // for (Int_t j=0;j<TMath::Min(fMultiRecV0s[label],100);j++){
1174 for (Int_t j=TMath::Min(fMultiRecV0[label],Short_t(20))-1;j>=0;j--){
1175 Int_t index = fIndexRecV0[label*20+j];
1176 if (index<0) continue;
1177 AliV0 *v0MI2 = (AliV0*)fEvent->GetV0(index);
1179 AliESDtrack * trackn = fEvent->GetTrack((v0MI2->GetNindex()));
1180 AliESDtrack * trackp = fEvent->GetTrack((v0MI2->GetPindex()));
1181 Int_t vlabeln = (trackn==0) ? -1 : trackn->GetLabel();
1182 Int_t vlabelp = (trackp==0) ? -1 : trackp->GetLabel();
1183 fRecV0Info->fLab[0]=TMath::Abs(vlabelp);
1184 fRecV0Info->fLab[1]=TMath::Abs(vlabeln);
1186 if (TMath::Abs(vlabeln)==label &&TMath::Abs(vlabelp)==label2) {
1187 if (v0MI2->GetOnFlyStatus()) {
1189 fRecV0Info->fV0MultipleOn++;
1192 fRecV0Info->fV0MultipleOff++;
1196 if (TMath::Abs(vlabelp)==label &&TMath::Abs(vlabeln)==label2) {
1197 if (v0MI2->GetOnFlyStatus()){
1199 fRecV0Info->fV0MultipleOn++;
1202 fRecV0Info->fV0MultipleOff++;
1209 new (fRecV0Info->fV0rec) AliV0(*v0MI);
1210 fRecV0Info->fRecStatus=1;
1213 new (fRecV0Info->fV0recOff) AliV0(*v0MIOff);
1214 fRecV0Info->fRecStatus=1;
1216 Int_t mpdg = fGenV0Info->GetMother().GetPdgCode();
1217 Float_t mass = ( pdgtable.GetParticle(mpdg)==0) ? 0 :pdgtable.GetParticle(mpdg)->Mass();
1218 fRecV0Info->UpdateKF(*esdvertex,
1219 fGenV0Info->GetPlus().GetPdg(),
1220 fGenV0Info->GetMinus().GetPdg(),
1227 Int_t nV0MIs = fEvent->GetNumberOfV0s();
1228 for (Int_t i=0;i<nV0MIs;i++){
1229 if (fSignedV0[i]==0){
1230 AliV0 *v0MI = (AliV0*)fEvent->GetV0(i);
1231 if (!v0MI) continue;
1232 fRecV0Info->Reset(); //reset all variables
1234 new (fRecV0Info->fV0rec) AliV0(*v0MI);
1235 fRecV0Info->fV0Status =-10;
1236 fRecV0Info->fRecStatus =-2;
1238 AliESDtrack * trackn = fEvent->GetTrack((v0MI->GetNindex()));
1239 AliESDtrack * trackp = fEvent->GetTrack((v0MI->GetPindex()));
1240 Int_t vlabeln = (trackn==0) ? -1 : trackn->GetLabel();
1241 Int_t vlabelp = (trackp==0) ? -1 : trackp->GetLabel();
1242 fRecV0Info->fLab[0]=TMath::Abs(vlabelp);
1243 fRecV0Info->fLab[1]=TMath::Abs(vlabeln);
1244 if (TMath::Abs(fRecV0Info->fLab[0] - fRecV0Info->fLab[1])<2) continue;
1245 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(vlabeln));
1246 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(vlabelp));
1247 if (fRecInfo1 && fRecInfo2){
1248 fRecV0Info->fT1 = (*fRecInfo1);
1249 fRecV0Info->fT2 = (*fRecInfo2);
1250 fRecV0Info->fRecStatus =-1;
1252 fRecV0Info->Update(vertex);
1253 fRecV0Info->UpdateKF(*esdvertex,211,211,0.49767);
1260 fTreeCmpV0->AutoSave();
1261 printf("Time spended in BuilV0Info Loop\n");
1263 if (fDebug > 2) cerr<<"end of BuildV0Info Loop"<<endl;
1266 ////////////////////////////////////////////////////////////////////////
1267 ////////////////////////////////////////////////////////////////////////