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"
185 ClassImp(AliRecInfoMaker)
190 AliTPCParam * AliRecInfoMaker::GetTPCParam(){
194 AliTPCParamSR * par = new AliTPCParamSR;
201 void AliRecInfoMaker::MakeAliases(TTree * tree)
204 // aliases definition
206 tree->SetAlias("radius","TMath::Sqrt(MC.fVDist[0]**2+MC.fVDist[1]**2)");
207 tree->SetAlias("direction","MC.fParticle.fVx*MC.fParticle.fPx+MC.fParticle.fVy*MC.fParticle.fPy");
208 tree->SetAlias("decaydir","MC.fTRdecay.fX*MC.fTRdecay.fPx+MC.fTRdecay.fY*MC.fTRdecay.fPy");
209 tree->SetAlias("theta","MC.fTrackRef.Theta()");
210 tree->SetAlias("primdca","sqrt(RC.fITStrack.fD[0]**2+RC.fITStrack.fD[1]**2)");
211 tree->SetAlias("trdchi2","fTRDtrack.fChi2/fTRDtrack.fN");
212 tree->SetAlias("trdchi2","fTRDtrack.fChi2/fTRDtrack.fN");
214 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.");
216 tree->SetAlias("dtofmc2","fESDtrack.fTrackTime[2]-(10^12*MC.fTOFReferences[0].fTime)");
217 tree->SetAlias("dtofrc2","(fESDtrack.fTrackTime[2]-fESDtrack.fTOFsignal)");
219 tree->SetAlias("psum","fESDtrack.fTOFr[4]+fESDtrack.fTOFr[3]+fESDtrack.fTOFr[2]+fESDtrack.fTOFr[1]+fESDtrack.fTOFr[0]");
220 tree->SetAlias("P0","fESDtrack.fTOFr[0]/psum");
221 tree->SetAlias("P1","fESDtrack.fTOFr[1]/psum");
222 tree->SetAlias("P2","fESDtrack.fTOFr[2]/psum");
223 tree->SetAlias("P3","fESDtrack.fTOFr[3]/psum");
224 tree->SetAlias("P4","fESDtrack.fTOFr[4]/psum");
225 tree->SetAlias("MaxP","max(max(max(P0,P1),max(P2,P3)),P4)");
229 ////////////////////////////////////////////////////////////////////////
230 AliRecInfoMaker::AliRecInfoMaker(const char* fnGenTracks,
232 const char* fnGalice,
233 Int_t nEvents, Int_t firstEvent):
235 fEventNr(0), //! current event number
236 fNEvents(0), //! number of events to process
237 fFirstEventNr(0), //! first event to process
238 fFileCmp(0), //! output file with cmp tracks
239 fTreeCmp(0), //! output tree with cmp tracks
240 fTreeCmpKinks(0), //! output tree with cmp Kinks
241 fTreeCmpV0(0), //! output tree with cmp V0
243 fFileGenTracks(0), //! input files with generated tracks
244 fTreeGenTracks(0), //! tree with generated tracks
245 fTreeGenKinks(0), // tree with gen kinks
246 fTreeGenV0(0), // tree with gen V0
248 fLoader(0), //! pointer to the run loader
250 fIndexRecTracks(0), //! index of particle label in the TreeT_ESD
251 fFakeRecTracks(0), //! number of fake tracks
252 fMultiRecTracks(0), //! number of multiple reconstructions
254 fIndexRecKinks(0), //! index of particle label in treeesd
255 fMultiRecKinks(0), //! number of multiple reconstructions
256 fSignedKinks(0), //! indicator that kink was not fake
258 fIndexRecV0(0), //! index of particle label in treeesd
259 fMultiRecV0(0), //! number of multiple reconstructions
260 fSignedV0(0), //! indicator that kink was not fake
262 fRecArray(0), // container with rec infos
264 fESDfriend(0), //!event friend
266 fParamTPC(0), //! AliTPCParam
267 fNParticles(0), //! number of particles in the input tree genTracks
268 fDebug(0), //! debug flag
269 fNextTreeGenEntryToRead(0), //! last entry already read from genTracks tree
270 fNextKinkToRead(0), //! last entry already read from genKinks tree
271 fNextV0ToRead(0), //! last entry already read from genV0 tree
273 fMCInfo(0), //! MC information writen per particle
274 fGenKinkInfo(0), //! MC information writen per Kink
275 fGenV0Info(0), //! MC information writen per Kink
276 fRecInfo(0), //! Rec. information writen per particle
277 fFriend(0), //! friend track
278 fRecKinkInfo(0), //! reconstructed kink info
279 fRecV0Info(0) //! reconstructed kink info
281 // AliRecInfoMaker - connencts the MC information with reconstructed information
282 // fnGenTracks - file with MC to be created before using AliGenInfoMaker
283 // fnCmp - file name to be created
284 // fnGalice - file with Loaders - usualy galice.root
286 // nEvent - number of event s to be analyzed
287 // AliRecInfoMaker *t2 = new AliRecInfoMaker("genTracks.root","cmpESDTracks.root","galice.root",0,0);
292 // fFnGenTracks = fnGenTracks;
295 memset(fFnGenTracks,0,sizeof(fFnGenTracks));
296 memset(fFnCmp,0,sizeof(fFnCmp));
298 snprintf(fFnGenTracks,1000,"%s",fnGenTracks);
299 snprintf(fFnCmp,1000,"%s",fnCmp);
301 fFirstEventNr = firstEvent;
302 fEventNr = firstEvent;
305 fLoader = AliRunLoader::Open(fnGalice);
307 //delete AliRunLoader::Instance();
311 if (fLoader->LoadgAlice()){
312 cerr<<"Error occured while l"<<endl;
314 Int_t nall = fLoader->GetNumberOfEvents();
322 cerr<<"no events available"<<endl;
326 if (firstEvent+nEvents>nall) {
327 fEventNr = nall-firstEvent;
328 cerr<<"restricted number of events availaible"<<endl;
330 TGeoManager::Import("geometry.root");
334 ////////////////////////////////////////////////////////////////////////
335 AliRecInfoMaker::AliRecInfoMaker(const AliRecInfoMaker& /*info*/):
337 fEventNr(0), //! current event number
338 fNEvents(0), //! number of events to process
339 fFirstEventNr(0), //! first event to process
340 fFileCmp(0), //! output file with cmp tracks
341 fTreeCmp(0), //! output tree with cmp tracks
342 fTreeCmpKinks(0), //! output tree with cmp Kinks
343 fTreeCmpV0(0), //! output tree with cmp V0
345 fFileGenTracks(0), //! input files with generated tracks
346 fTreeGenTracks(0), //! tree with generated tracks
347 fTreeGenKinks(0), // tree with gen kinks
348 fTreeGenV0(0), // tree with gen V0
350 fLoader(0), //! pointer to the run loader
352 fIndexRecTracks(0), //! index of particle label in the TreeT_ESD
353 fFakeRecTracks(0), //! number of fake tracks
354 fMultiRecTracks(0), //! number of multiple reconstructions
356 fIndexRecKinks(0), //! index of particle label in treeesd
357 fMultiRecKinks(0), //! number of multiple reconstructions
358 fSignedKinks(0), //! indicator that kink was not fake
360 fIndexRecV0(0), //! index of particle label in treeesd
361 fMultiRecV0(0), //! number of multiple reconstructions
362 fSignedV0(0), //! indicator that kink was not fake
364 fRecArray(0), // container with rec infos
366 fESDfriend(0), //!event friend
368 fParamTPC(0), //! AliTPCParam
369 fNParticles(0), //! number of particles in the input tree genTracks
370 fDebug(0), //! debug flag
371 fNextTreeGenEntryToRead(0), //! last entry already read from genTracks tree
372 fNextKinkToRead(0), //! last entry already read from genKinks tree
373 fNextV0ToRead(0), //! last entry already read from genV0 tree
375 fMCInfo(0), //! MC information writen per particle
376 fGenKinkInfo(0), //! MC information writen per Kink
377 fGenV0Info(0), //! MC information writen per Kink
378 fRecInfo(0), //! Rec. information writen per particle
379 fFriend(0), //! friend track
380 fRecKinkInfo(0), //! reconstructed kink info
381 fRecV0Info(0) //! reconstructed kink info
384 // Dummy copu constructor
386 memset(fFnGenTracks,0,sizeof(fFnGenTracks));
387 memset(fFnCmp,0,sizeof(fFnCmp));
393 ////////////////////////////////////////////////////////////////////////
394 AliRecInfoMaker::~AliRecInfoMaker()
404 //////////////////////////////////////////////////////////////
405 Int_t AliRecInfoMaker::SetIO()
408 // SetIO - Create the input trees
411 if (!fTreeCmp) return 1;
412 fParamTPC = GetTPCParam();
414 if (!ConnectGenTree()) {
415 cerr<<"Cannot connect tree with generated tracks"<<endl;
421 //////////////////////////////////////////////////////////////
423 Int_t AliRecInfoMaker::SetIO(Int_t eventNr)
429 TFile f("AliESDs.root");
432 TTree* tree = (TTree*) f.Get("esdTree");
433 tree->SetBranchStatus("*",1);
434 fEvent = new AliESDEvent;
436 if (tree->GetBranch("ESD")){
437 // tree->SetBranchAddress("ESD", &fEvent);
438 // tree->SetBranchAddress("ESDfriend.",&fESDfriend);
439 // tree->GetEntry(eventNr);
440 // fEvent->SetESDfriend(fESDfriend);
442 fEvent->ReadFromTree(tree);
443 fESDfriend = (AliESDfriend*)fEvent->FindListObject("AliESDfriend");
444 tree->GetEntry(eventNr);
445 fEvent->SetESDfriend(fESDfriend);
450 if (!fEvent) return 1;
457 ////////////////////////////////////////////////////////////////////////
458 void AliRecInfoMaker::Reset()
468 // fFnCmp = "cmpTracks.root";
476 ////////////////////////////////////////////////////////////////////////
477 Int_t AliRecInfoMaker::Exec(Int_t nEvents, Int_t firstEventNr)
480 // Exec comparison for subrange of events
483 fFirstEventNr = firstEventNr;
487 ////////////////////////////////////////////////////////////////////////
488 Int_t AliRecInfoMaker::Exec()
499 fNextTreeGenEntryToRead = 0;
502 cerr<<"fFirstEventNr, fNEvents: "<<fFirstEventNr<<" "<<fNEvents<<endl;
503 for (Int_t eventNr = fFirstEventNr; eventNr < fFirstEventNr+fNEvents;
507 fNParticles = gAlice->GetEvent(fEventNr);
509 fIndexRecTracks = new Short_t[fNParticles*20]; //write at maximum 4 tracks corresponding to particle
510 fIndexRecKinks = new Short_t[fNParticles*20]; //write at maximum 20 tracks corresponding to particle
511 fIndexRecV0 = new Short_t[fNParticles*20]; //write at maximum 20 tracks corresponding to particle
513 fFakeRecTracks = new Short_t[fNParticles];
514 fMultiRecTracks = new Short_t[fNParticles];
515 fMultiRecKinks = new Short_t[fNParticles];
516 fMultiRecV0 = new Short_t[fNParticles];
518 for (Int_t i = 0; i<fNParticles; i++) {
519 for (Int_t j=0;j<20;j++){
520 fIndexRecTracks[20*i+j] = -1;
521 fIndexRecKinks[20*i+j] = -1;
522 fIndexRecV0[20*i+j] = -1;
524 fFakeRecTracks[i] = 0;
525 fMultiRecTracks[i] = 0;
526 fMultiRecKinks[i] = 0;
530 cout<<"Start to process event "<<fEventNr<<endl;
531 cout<<"\tfNParticles = "<<fNParticles<<endl;
532 if (fDebug>2) cout<<"\tStart loop over TreeT"<<endl;
533 if (TreeTLoop()>0) return 1;
535 if (fDebug>2) cout<<"\tStart loop over tree genTracks"<<endl;
536 if (TreeGenLoop(eventNr)>0) return 1;
537 //BuildKinkInfo0(eventNr);
538 BuildV0Info(eventNr); // no V0 info for a moment
541 if (fDebug>2) cout<<"\tEnd loop over tree genTracks"<<endl;
543 delete [] fIndexRecTracks;
544 delete [] fIndexRecKinks;
545 delete [] fIndexRecV0;
546 delete [] fFakeRecTracks;
547 delete [] fMultiRecTracks;
548 delete [] fMultiRecKinks;
549 delete [] fMultiRecV0;
554 cerr<<"Exec finished"<<endl;
560 ////////////////////////////////////////////////////////////////////////
561 Bool_t AliRecInfoMaker::ConnectGenTree()
564 // connect all branches from the genTracksTree
565 // use the same variables as for the new cmp tree, it may work
567 fFileGenTracks = TFile::Open(fFnGenTracks,"READ");
568 if (!fFileGenTracks) {
569 cerr<<"Error in ConnectGenTree: cannot open file "<<fFnGenTracks<<endl;
572 fTreeGenTracks = (TTree*)fFileGenTracks->Get("genTracksTree");
573 if (!fTreeGenTracks) {
574 cerr<<"Error in ConnectGenTree: cannot find genTracksTree in the file "
575 <<fFnGenTracks<<endl;
579 fMCInfo = new AliMCInfo;
580 fTreeGenTracks->SetBranchAddress("MC",&fMCInfo);
583 fTreeGenKinks = (TTree*)fFileGenTracks->Get("genKinksTree");
584 if (!fTreeGenKinks) {
585 cerr<<"Error in ConnectGenTree: cannot find genTracksTree in the file "
586 <<fFnGenTracks<<endl;
590 fGenKinkInfo = new AliGenKinkInfo;
591 fTreeGenKinks->SetBranchAddress("MC",&fGenKinkInfo);
594 fTreeGenV0 = (TTree*)fFileGenTracks->Get("genV0Tree");
596 cerr<<"Error in ConnectGenTree: cannot find genTracksTree in the file "
597 <<fFnGenTracks<<endl;
601 fGenV0Info = new AliGenV0Info;
602 fTreeGenV0->SetBranchAddress("MC",&fGenV0Info);
606 cout<<"Number of gen. tracks with TR: "<<fTreeGenTracks->GetEntries()<<endl;
612 ////////////////////////////////////////////////////////////////////////
613 void AliRecInfoMaker::CreateTreeCmp()
616 // Create file and tree with comparison information
618 fFileCmp = TFile::Open(fFnCmp,"RECREATE");
620 cerr<<"Error in CreateTreeCmp: cannot open file "<<fFnCmp<<endl;
625 fTreeCmp = new TTree("ESDcmpTracks","ESDcmpTracks");
626 fMCInfo = new AliMCInfo;
627 fRecInfo = new AliESDRecInfo;
628 AliESDtrack * esdTrack = new AliESDtrack;
629 // AliITStrackMI * itsTrack = new AliITStrackMI;
630 fTreeCmp->Branch("MC","AliMCInfo",&fMCInfo,256000);
631 fTreeCmp->Branch("RC","AliESDRecInfo",&fRecInfo,256000);
632 // fTreeCmp->Branch("ITS","AliITStrackMI",&itsTrack);
636 fTreeCmpKinks = new TTree("ESDcmpKinks","ESDcmpKinks");
637 fGenKinkInfo = new AliGenKinkInfo;
638 fRecKinkInfo = new AliESDRecKinkInfo;
639 fTreeCmpKinks->Branch("MC.","AliGenKinkInfo",&fGenKinkInfo,256000);
640 fTreeCmpKinks->Branch("RC.","AliESDRecKinkInfo",&fRecKinkInfo,256000);
643 fTreeCmpV0 = new TTree("ESDcmpV0","ESDcmpV0");
644 fGenV0Info = new AliGenV0Info;
645 fRecV0Info = new AliESDRecV0Info;
646 fTreeCmpV0->Branch("MC.","AliGenV0Info", &fGenV0Info,256000);
647 fTreeCmpV0->Branch("RC.","AliESDRecV0Info",&fRecV0Info,256000);
649 fTreeCmp->AutoSave();
650 fTreeCmpKinks->AutoSave();
651 fTreeCmpV0->AutoSave();
654 ////////////////////////////////////////////////////////////////////////
655 void AliRecInfoMaker::CloseOutputFile()
662 cerr<<"File "<<fFnCmp<<" not found as an open file."<<endl;
673 ////////////////////////////////////////////////////////////////////////
675 TVector3 AliRecInfoMaker::TR2Local(AliTrackReference *trackRef,
676 AliTPCParam *paramTPC) {
679 // Transform position to the local coord frame
682 Float_t x[3] = { trackRef->X(),trackRef->Y(),trackRef->Z()};
684 paramTPC->Transform0to1(x,index);
685 paramTPC->Transform1to2Ideal(x,index);
688 ////////////////////////////////////////////////////////////////////////
690 Int_t AliRecInfoMaker::TreeTLoop()
693 // loop over all ESD reconstructed tracks and store info in memory
695 // + loop over all reconstructed kinks
699 Int_t nEntries = (Int_t)fEvent->GetNumberOfTracks();
700 Int_t nKinks = (Int_t) fEvent->GetNumberOfKinks();
701 Int_t nV0MIs = (Int_t) fEvent->GetNumberOfV0s();
702 fSignedKinks = new Short_t[nKinks];
703 fSignedV0 = new Short_t[nV0MIs];
705 // load kinks to the memory
706 for (Int_t i=0; i<nKinks;i++){
707 // AliESDkink * kink =
712 for (Int_t i=0; i<nV0MIs;i++){
714 (AliV0*)fEvent->GetV0(i);
720 AliESDtrack * track=0;
721 for (Int_t iEntry=0; iEntry<nEntries;iEntry++){
722 track = (AliESDtrack*)fEvent->GetTrack(iEntry);
724 Int_t label = track->GetLabel();
725 Int_t absLabel = abs(label);
726 if (absLabel < fNParticles) {
727 // fIndexRecTracks[absLabel] = iEntry;
728 if (label < 0) fFakeRecTracks[absLabel]++;
729 if (fMultiRecTracks[absLabel]>0){
730 if (fMultiRecTracks[absLabel]<20)
731 fIndexRecTracks[absLabel*20+fMultiRecTracks[absLabel]] = iEntry;
734 fIndexRecTracks[absLabel*20] = iEntry;
735 fMultiRecTracks[absLabel]++;
738 // sort reconstructed kinks
741 for (Int_t iEntry=0; iEntry<nKinks;iEntry++){
742 kink = (AliESDkink*)fEvent->GetKink(iEntry);
745 Int_t label0 = TMath::Abs(kink->GetLabel(0));
746 Int_t label1 = TMath::Abs(kink->GetLabel(1));
747 Int_t absLabel = TMath::Min(label0,label1);
748 if (absLabel < fNParticles) {
749 if (fMultiRecKinks[absLabel]>0){
750 if (fMultiRecKinks[absLabel]<20)
751 fIndexRecKinks[absLabel*20+fMultiRecKinks[absLabel]] = iEntry;
754 fIndexRecKinks[absLabel*20] = iEntry;
755 fMultiRecKinks[absLabel]++;
758 // --sort reconstructed V0
761 for (Int_t iEntry=0; iEntry<nV0MIs;iEntry++){
762 v0MI = (AliV0*)fEvent->GetV0(iEntry);
767 //Int_t label0 = TMath::Abs(v0MI->GetLabel(0));
768 //Int_t label1 = TMath::Abs(v0MI->GetLabel(1));
769 AliESDtrack * trackn = fEvent->GetTrack((v0MI->GetNindex()));
770 AliESDtrack * trackp = fEvent->GetTrack((v0MI->GetPindex()));
771 Int_t labels[2]={-1,-1};
772 labels[0] = (trackn==0) ? -1 : TMath::Abs(trackn->GetLabel());
773 labels[1] = (trackp==0) ? -1 : TMath::Abs(trackp->GetLabel());
775 for (Int_t i=0;i<2;i++){
776 Int_t absLabel = TMath::Abs(labels[i]);
777 if (absLabel < fNParticles) {
778 if (fMultiRecV0[absLabel]>0){
779 if (fMultiRecV0[absLabel]<20)
780 fIndexRecV0[absLabel*20+fMultiRecV0[absLabel]] = iEntry;
783 fIndexRecV0[absLabel*20] = iEntry;
784 fMultiRecV0[absLabel]++;
790 printf("Time spended in TreeTLoop\n");
793 if (fDebug > 2) cerr<<"end of TreeTLoop"<<endl;
797 ////////////////////////////////////////////////////////////////////////
798 Int_t AliRecInfoMaker::TreeGenLoop(Int_t eventNr)
801 // loop over all entries for a given event, find corresponding
802 // rec. track and store in the fTreeCmp
806 Int_t entry = fNextTreeGenEntryToRead;
807 Double_t nParticlesTR = fTreeGenTracks->GetEntriesFast();
808 cerr<<"fNParticles, nParticlesTR, fNextTreeGenEntryToRead: "<<fNParticles<<" "
809 <<nParticlesTR<<" "<<fNextTreeGenEntryToRead<<endl;
810 TBranch * branch = fTreeCmp->GetBranch("RC");
811 // TBranch * branchF = fTreeCmp->GetBranch("F");
813 branch->SetAddress(&fRecInfo); // set all pointers
814 fRecArray = new TObjArray(fNParticles);
815 AliESDtrack dummytrack; //
816 AliESDfriendTrack dummytrackF; //
818 while (entry < nParticlesTR) {
819 fTreeGenTracks->GetEntry(entry);
821 if (eventNr < fMCInfo->fEventNr) continue;
822 if (eventNr > fMCInfo->fEventNr) continue;
823 if (fMCInfo->GetCharge()==0) continue;
825 fNextTreeGenEntryToRead = entry-1;
826 if (fDebug > 2 && fMCInfo->fLabel < 10) {
827 cerr<<"Fill track with a label "<<fMCInfo->fLabel<<endl;
829 // if (fMCInfo->fNTPCRef<1) continue; // not TPCref
832 AliESDtrack * track=0;
833 fRecInfo->fReconstructed =0;
834 TVector3 local = TR2Local(&(fMCInfo->fTrackRef),fParamTPC);
835 local.GetXYZ(fRecInfo->fTRLocalCoord);
837 if (fIndexRecTracks[fMCInfo->fLabel*20] >= 0) {
838 track= (AliESDtrack*)fEvent->GetTrack(fIndexRecTracks[fMCInfo->fLabel*20]);
842 // find nearest track if multifound
843 //Int_t sign = Int_t(track->GetSign()*fMCInfo->fCharge);
846 if ((track->GetStatus()&AliESDtrack::kITSrefit)>0) status++;
847 if ((track->GetStatus()&AliESDtrack::kTPCrefit)>0) status++;
848 if ((track->GetStatus()&AliESDtrack::kTRDrefit)>0) status++;
851 if (fIndexRecTracks[fMCInfo->fLabel*20+1]>0){
854 track->GetInnerPxPyPz(p);
855 Float_t maxp = p[0]*p[0]+p[1]*p[1]+p[2]*p[2];
857 for (Int_t i=1;i<20;i++){
858 if (fIndexRecTracks[fMCInfo->fLabel*20+i]>=0){
859 AliESDtrack * track2 = (AliESDtrack*)fEvent->GetTrack(fIndexRecTracks[fMCInfo->fLabel*20+i]);
860 if (!track2) continue;
861 //Int_t sign2 = track->GetSign()*fMCInfo->fCharge; //
862 //if (sign2<0) continue;
863 track2->GetInnerPxPyPz(p);
864 Float_t mom = p[0]*p[0]+p[1]*p[1]+p[2]*p[2];
875 if ((track2->GetStatus()&AliESDtrack::kITSrefit)>0) status2++;
876 if ((track2->GetStatus()&AliESDtrack::kTPCrefit)>0) status2++;
877 if ((track2->GetStatus()&AliESDtrack::kTRDrefit)>0) status2++;
878 if (status2<status) continue;
880 if (mom<maxp) continue;
888 fRecInfo->SetESDtrack(track);
892 fRecInfo->SetESDtrack(track);
894 fRecInfo->SetESDtrack(&dummytrack);
899 fRecInfo->fReconstructed = 1;
900 fRecInfo->fFake = fFakeRecTracks[fMCInfo->fLabel];
901 fRecInfo->fMultiple = fMultiRecTracks[fMCInfo->fLabel];
903 fRecInfo->Update(fMCInfo,fParamTPC,kTRUE);
906 fRecInfo->SetESDtrack(&dummytrack);
907 fRecInfo->Update(fMCInfo,fParamTPC,kFALSE);
909 fRecArray->AddAt(new AliESDRecInfo(*fRecInfo),fMCInfo->fLabel);
912 fTreeCmp->AutoSave();
913 printf("Time spended in TreeGenLoop\n");
915 if (fDebug > 2) cerr<<"end of TreeGenLoop"<<endl;
922 ////////////////////////////////////////////////////////////////////////
923 ////////////////////////////////////////////////////////////////////////
924 ////////////////////////////////////////////////////////////////////////
925 Int_t AliRecInfoMaker::BuildKinkInfo0(Int_t eventNr)
928 // loop over all entries for a given event, find corresponding
929 // rec. track and store in the fTreeCmp
933 Int_t entry = fNextKinkToRead;
934 Double_t nParticlesTR = fTreeGenKinks->GetEntriesFast();
935 cerr<<"fNParticles, nParticlesTR, fNextKinkToRead: "<<fNParticles<<" "
936 <<nParticlesTR<<" "<<fNextKinkToRead<<endl;
938 TBranch * branch = fTreeCmpKinks->GetBranch("RC.");
939 branch->SetAddress(&fRecKinkInfo); // set all pointers
942 while (entry < nParticlesTR) {
943 fTreeGenKinks->GetEntry(entry);
945 if (eventNr < fGenKinkInfo->GetMinus().fEventNr) continue;
946 if (eventNr > fGenKinkInfo->GetMinus().fEventNr) continue;;
948 fNextKinkToRead = entry-1;
951 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(fGenKinkInfo->GetMinus().fLabel);
952 if(!fRecInfo1) continue;
953 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(fGenKinkInfo->GetPlus().fLabel);
954 if(!fRecInfo2) continue;
955 fRecKinkInfo->fT1 = (*fRecInfo1);
956 fRecKinkInfo->fT2 = (*fRecInfo2);
957 fRecKinkInfo->fStatus =0;
958 if (fRecInfo1 && fRecInfo1->fTPCOn) fRecKinkInfo->fStatus+=1;
959 if (fRecInfo2 && fRecInfo2->fTPCOn) fRecKinkInfo->fStatus+=2;
960 if (fRecKinkInfo->fStatus==3&&fRecInfo1->fSign!=fRecInfo2->fSign) fRecKinkInfo->fStatus*=-1;
962 if (fRecKinkInfo->fStatus==3){
963 fRecKinkInfo->Update();
965 Int_t label = TMath::Min(fGenKinkInfo->GetMinus().fLabel,fGenKinkInfo->GetPlus().fLabel);
966 Int_t label2 = TMath::Max(fGenKinkInfo->GetMinus().fLabel,fGenKinkInfo->GetPlus().fLabel);
969 fRecKinkInfo->fRecStatus =0;
970 fRecKinkInfo->fMultiple = fMultiRecKinks[label];
971 fRecKinkInfo->fKinkMultiple=0;
973 if (fMultiRecKinks[label]>0){
975 // for (Int_t j=0;j<TMath::Min(fMultiRecKinks[label],100);j++){
976 for (Int_t j=TMath::Min(fMultiRecKinks[label],Short_t(20))-1;j>=0;j--){
977 Int_t index = fIndexRecKinks[label*20+j];
978 //AliESDkink *kink2 = (AliESDkink*)fKinks->At(index);
979 AliESDkink *kink2 = (AliESDkink*)fEvent->GetKink(index);
980 if (TMath::Abs(kink2->GetLabel(0))==label &&TMath::Abs(kink2->GetLabel(1))==label2) {
981 fRecKinkInfo->fKinkMultiple++;
982 fSignedKinks[index]=1;
985 // if (kink->fTRDOn) c0++;
986 //if (kink->fITSOn) c0++;
987 if (kink->GetStatus(2)>0) c0++;
988 if (kink->GetStatus(0)>0) c0++;
991 // if (kink2->fTRDOn) c2++;
992 //if (kink2->fITSOn) c2++;
993 if (kink2->GetStatus(2)>0) c2++;
994 if (kink2->GetStatus(0)>0) c2++;
999 if (TMath::Abs(kink2->GetLabel(1))==label &&TMath::Abs(kink2->GetLabel(0))==label2) {
1000 fRecKinkInfo->fKinkMultiple++;
1001 fSignedKinks[index]=1;
1004 //if (kink->fTRDOn) c0++;
1005 //if (kink->fITSOn) c0++;
1006 if (kink->GetStatus(2)>0) c0++;
1007 if (kink->GetStatus(0)>0) c0++;
1011 // if (kink2->fTRDOn) c2++;
1012 //if (kink2->fITSOn) c2++;
1013 if (kink2->GetStatus(2)>0) c2++;
1014 if (kink2->GetStatus(0)>0) c2++;
1016 if (c2<c0) continue;
1022 fRecKinkInfo->fKink = *kink;
1023 fRecKinkInfo->fRecStatus=1;
1025 fTreeCmpKinks->Fill();
1027 // Int_t nkinks = fKinks->GetEntriesFast();
1028 Int_t nkinks = fEvent->GetNumberOfKinks();
1029 for (Int_t i=0;i<nkinks;i++){
1030 if (fSignedKinks[i]==0){
1031 // AliESDkink *kink = (AliESDkink*)fKinks->At(i);
1032 AliESDkink *kink = (AliESDkink*)fEvent->GetKink(i);
1033 if (!kink) continue;
1035 fRecKinkInfo->fKink = *kink;
1036 fRecKinkInfo->fRecStatus =-2;
1038 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(kink->GetLabel(0)));
1039 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(kink->GetLabel(1)));
1040 if (fRecInfo1 && fRecInfo2){
1041 fRecKinkInfo->fT1 = (*fRecInfo1);
1042 fRecKinkInfo->fT2 = (*fRecInfo2);
1043 fRecKinkInfo->fRecStatus =-1;
1045 fTreeCmpKinks->Fill();
1050 fTreeCmpKinks->AutoSave();
1051 printf("Time spended in BuilKinkInfo Loop\n");
1053 if (fDebug > 2) cerr<<"end of BuildKinkInfo Loop"<<endl;
1059 ////////////////////////////////////////////////////////////////////////
1060 ////////////////////////////////////////////////////////////////////////
1061 ////////////////////////////////////////////////////////////////////////
1065 Int_t AliRecInfoMaker::BuildV0Info(Int_t eventNr)
1068 // loop over all entries for a given event, find corresponding
1069 // rec. track and store in the fTreeCmp
1071 static TDatabasePDG pdgtable;
1075 Int_t entry = fNextV0ToRead;
1076 Double_t nParticlesTR = fTreeGenV0->GetEntriesFast();
1077 cerr<<"fNParticles, nParticlesTR, fNextV0ToRead: "<<fNParticles<<" "
1078 <<nParticlesTR<<" "<<fNextV0ToRead<<endl;
1080 TBranch * branch = fTreeCmpV0->GetBranch("RC.");
1081 branch->SetAddress(&fRecV0Info); // set all pointers
1082 const AliESDVertex * esdvertex = fEvent->GetVertex();
1083 Float_t vertex[3]= {esdvertex->GetXv(), esdvertex->GetYv(),esdvertex->GetZv()};
1086 while (entry < nParticlesTR) {
1087 fTreeGenV0->GetEntry(entry);
1089 fRecV0Info->Reset(); //reset all variables
1090 if (eventNr < fGenV0Info->GetMinus().fEventNr) continue;
1091 if (eventNr > fGenV0Info->GetMinus().fEventNr) continue;;
1093 fNextV0ToRead = entry-1;
1096 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(fGenV0Info->GetMinus().fLabel);
1097 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(fGenV0Info->GetPlus().fLabel);
1098 if (fGenV0Info->GetMinus().fCharge*fGenV0Info->GetPlus().fCharge>0) continue; // interactions
1099 if (!fRecInfo1 || !fRecInfo2) continue;
1100 fRecV0Info->fT1 = (*fRecInfo1);
1101 fRecV0Info->fT2 = (*fRecInfo2);
1102 fRecV0Info->fV0Status =0;
1103 if (fRecInfo1 && fRecInfo1->fStatus[1]>0) fRecV0Info->fV0Status+=1;
1104 if (fRecInfo2 && fRecInfo2->fStatus[1]>0) fRecV0Info->fV0Status+=2;
1106 if (fRecV0Info->fV0Status==3&&fRecInfo1->fSign==fRecInfo2->fSign) fRecV0Info->fV0Status*=-1;
1109 if (abs(fRecV0Info->fV0Status)==3){
1110 fRecV0Info->Update(vertex);
1114 Double_t x,alpha, param[5],cov[15];
1115 if ( fRecV0Info->fT1.GetESDtrack()->GetInnerParam() && fRecV0Info->fT2.GetESDtrack()->GetInnerParam()){
1116 fRecV0Info->fT1.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
1117 fRecV0Info->fT1.GetESDtrack()->GetInnerExternalCovariance(cov);
1118 AliExternalTrackParam paramP(x,alpha,param,cov);
1120 fRecV0Info->fT2.GetESDtrack()->GetInnerExternalParameters(alpha,x,param);
1121 fRecV0Info->fT2.GetESDtrack()->GetInnerExternalCovariance(cov);
1122 AliExternalTrackParam paramM(x,alpha,param,cov);
1124 fRecV0Info->fV0tpc->SetParamN(paramM);
1125 fRecV0Info->fV0tpc->SetParamP(paramP);
1126 Double_t pid1[5],pid2[5];
1127 fRecV0Info->fT1.GetESDtrack()->GetESDpid(pid1);
1128 fRecV0Info->fT1.GetESDtrack()->GetESDpid(pid2);
1130 //fRecV0Info->fV0tpc.UpdatePID(pid1,pid2);
1131 fRecV0Info->fV0tpc->Update(vertex);
1135 fRecV0Info->fT1.GetESDtrack()->GetExternalParameters(x,param);
1136 fRecV0Info->fT1.GetESDtrack()->GetExternalCovariance(cov);
1137 alpha = fRecV0Info->fT1.GetESDtrack()->GetAlpha();
1138 new (¶mP) AliExternalTrackParam(x,alpha,param,cov);
1140 fRecV0Info->fT2.GetESDtrack()->GetExternalParameters(x,param);
1141 fRecV0Info->fT2.GetESDtrack()->GetExternalCovariance(cov);
1142 alpha = fRecV0Info->fT2.GetESDtrack()->GetAlpha();
1143 new (¶mM) AliExternalTrackParam(x,alpha,param,cov);
1145 fRecV0Info->fV0its->SetParamN(paramM);
1146 fRecV0Info->fV0its->SetParamP(paramP);
1147 // fRecV0Info->fV0its.UpdatePID(pid1,pid2);
1148 fRecV0Info->fV0its->Update(vertex);
1154 if (TMath::Abs(fGenV0Info->GetMinus().fPdg)==11 &&TMath::Abs(fGenV0Info->GetPlus().fPdg)==11){
1155 if (fRecV0Info->fDist2>10){
1156 fRecV0Info->Update(vertex);
1158 if (fRecV0Info->fDist2>10){
1159 fRecV0Info->Update(vertex);
1164 // take the V0 from reconstruction
1166 Int_t label = TMath::Min(fGenV0Info->GetMinus().fLabel,fGenV0Info->GetPlus().fLabel);
1167 Int_t label2 = TMath::Max(fGenV0Info->GetMinus().fLabel,fGenV0Info->GetPlus().fLabel);
1170 fRecV0Info->fRecStatus =0;
1171 fRecV0Info->fMultiple = fMultiRecV0[label];
1172 fRecV0Info->fV0MultipleOn=0;
1173 fRecV0Info->fV0MultipleOff=0;
1175 if (fMultiRecV0[label]>0 || fMultiRecV0[label2]>0){
1177 // for (Int_t j=0;j<TMath::Min(fMultiRecV0s[label],100);j++){
1178 for (Int_t j=TMath::Min(fMultiRecV0[label],Short_t(20))-1;j>=0;j--){
1179 Int_t index = fIndexRecV0[label*20+j];
1180 if (index<0) continue;
1181 AliV0 *v0MI2 = (AliV0*)fEvent->GetV0(index);
1183 AliESDtrack * trackn = fEvent->GetTrack((v0MI2->GetNindex()));
1184 AliESDtrack * trackp = fEvent->GetTrack((v0MI2->GetPindex()));
1185 Int_t vlabeln = (trackn==0) ? -1 : trackn->GetLabel();
1186 Int_t vlabelp = (trackp==0) ? -1 : trackp->GetLabel();
1187 fRecV0Info->fLab[0]=TMath::Abs(vlabelp);
1188 fRecV0Info->fLab[1]=TMath::Abs(vlabeln);
1190 if (TMath::Abs(vlabeln)==label &&TMath::Abs(vlabelp)==label2) {
1191 if (v0MI2->GetOnFlyStatus()) {
1193 fRecV0Info->fV0MultipleOn++;
1196 fRecV0Info->fV0MultipleOff++;
1200 if (TMath::Abs(vlabelp)==label &&TMath::Abs(vlabeln)==label2) {
1201 if (v0MI2->GetOnFlyStatus()){
1203 fRecV0Info->fV0MultipleOn++;
1206 fRecV0Info->fV0MultipleOff++;
1213 new (fRecV0Info->fV0rec) AliV0(*v0MI);
1214 fRecV0Info->fRecStatus=1;
1217 new (fRecV0Info->fV0recOff) AliV0(*v0MIOff);
1218 fRecV0Info->fRecStatus=1;
1220 Int_t mpdg = fGenV0Info->GetMother().GetPdgCode();
1221 Float_t mass = ( pdgtable.GetParticle(mpdg)==0) ? 0 :pdgtable.GetParticle(mpdg)->Mass();
1222 fRecV0Info->UpdateKF(*esdvertex,
1223 fGenV0Info->GetPlus().GetPdg(),
1224 fGenV0Info->GetMinus().GetPdg(),
1231 Int_t nV0MIs = fEvent->GetNumberOfV0s();
1232 for (Int_t i=0;i<nV0MIs;i++){
1233 if (fSignedV0[i]==0){
1234 AliV0 *v0MI = (AliV0*)fEvent->GetV0(i);
1235 if (!v0MI) continue;
1236 fRecV0Info->Reset(); //reset all variables
1238 new (fRecV0Info->fV0rec) AliV0(*v0MI);
1239 fRecV0Info->fV0Status =-10;
1240 fRecV0Info->fRecStatus =-2;
1242 AliESDtrack * trackn = fEvent->GetTrack((v0MI->GetNindex()));
1243 AliESDtrack * trackp = fEvent->GetTrack((v0MI->GetPindex()));
1244 Int_t vlabeln = (trackn==0) ? -1 : trackn->GetLabel();
1245 Int_t vlabelp = (trackp==0) ? -1 : trackp->GetLabel();
1246 fRecV0Info->fLab[0]=TMath::Abs(vlabelp);
1247 fRecV0Info->fLab[1]=TMath::Abs(vlabeln);
1248 if (TMath::Abs(fRecV0Info->fLab[0] - fRecV0Info->fLab[1])<2) continue;
1249 AliESDRecInfo* fRecInfo1 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(vlabeln));
1250 AliESDRecInfo* fRecInfo2 = (AliESDRecInfo*)fRecArray->At(TMath::Abs(vlabelp));
1251 if (fRecInfo1 && fRecInfo2){
1252 fRecV0Info->fT1 = (*fRecInfo1);
1253 fRecV0Info->fT2 = (*fRecInfo2);
1254 fRecV0Info->fRecStatus =-1;
1256 fRecV0Info->Update(vertex);
1257 fRecV0Info->UpdateKF(*esdvertex,211,211,0.49767);
1264 fTreeCmpV0->AutoSave();
1265 printf("Time spended in BuilV0Info Loop\n");
1267 if (fDebug > 2) cerr<<"end of BuildV0Info Loop"<<endl;
1270 ////////////////////////////////////////////////////////////////////////
1271 ////////////////////////////////////////////////////////////////////////