1 ////////////////////////////////////////////////////////////////////////////////
3 // AliFemtoEventReaderAOD - the reader class for the Alice AOD //
4 // Reads in AOD information and converts it into internal AliFemtoEvent //
5 // Authors: Marek Chojnacki mchojnacki@knf.pw.edu.pl //
6 // Adam Kisiel kisiel@mps.ohio-state.edu //
8 ////////////////////////////////////////////////////////////////////////////////
10 #include "AliFemtoEventReaderAOD.h"
14 #include "AliAODEvent.h"
15 #include "AliAODTrack.h"
16 #include "AliAODVertex.h"
17 #include "AliAODMCHeader.h"
18 #include "AliESDtrack.h"
20 #include "AliFmPhysicalHelixD.h"
21 #include "AliFmThreeVectorF.h"
23 #include "SystemOfUnits.h"
25 #include "AliFemtoEvent.h"
26 #include "AliFemtoModelHiddenInfo.h"
27 #include "AliFemtoModelGlobalHiddenInfo.h"
30 #include "AliAODpidUtil.h"
32 ClassImp(AliFemtoEventReaderAOD)
34 #if !(ST_NO_NAMESPACES)
35 using namespace units;
39 //____________________________
40 //constructor with 0 parameters , look at default settings
41 AliFemtoEventReaderAOD::AliFemtoEventReaderAOD():
48 // fPWG2AODTracks(0x0),
57 // default constructor
58 fAllTrue.ResetAllBits(kTRUE);
59 fAllFalse.ResetAllBits(kFALSE);
64 AliFemtoEventReaderAOD::AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aReader) :
65 AliFemtoEventReader(),
72 // fPWG2AODTracks(0x0),
82 fInputFile = aReader.fInputFile;
83 fFileName = aReader.fFileName;
84 fNumberofEvent = aReader.fNumberofEvent;
85 fCurEvent = aReader.fCurEvent;
86 fEvent = new AliAODEvent();
87 fAodFile = new TFile(aReader.fAodFile->GetName());
88 fAllTrue.ResetAllBits(kTRUE);
89 fAllFalse.ResetAllBits(kFALSE);
90 fFilterBit = aReader.fFilterBit;
91 // fPWG2AODTracks = aReader.fPWG2AODTracks;
92 fAODpidUtil = aReader.fAODpidUtil;
93 fCentRange[0] = aReader.fCentRange[0];
94 fCentRange[1] = aReader.fCentRange[1];
98 AliFemtoEventReaderAOD::~AliFemtoEventReaderAOD()
104 // if (fPWG2AODTracks) {
105 // fPWG2AODTracks->Delete();
106 // delete fPWG2AODTracks;
111 AliFemtoEventReaderAOD& AliFemtoEventReaderAOD::operator=(const AliFemtoEventReaderAOD& aReader)
113 // assignment operator
114 if (this == &aReader)
117 fInputFile = aReader.fInputFile;
118 fFileName = aReader.fFileName;
119 fNumberofEvent = aReader.fNumberofEvent;
120 fCurEvent = aReader.fCurEvent;
121 if (fTree) delete fTree;
122 if (fEvent) delete fEvent;
123 fEvent = new AliAODEvent();
124 if (fAodFile) delete fAodFile;
125 fAodFile = new TFile(aReader.fAodFile->GetName());
126 fAllTrue.ResetAllBits(kTRUE);
127 fAllFalse.ResetAllBits(kFALSE);
128 fFilterBit = aReader.fFilterBit;
129 // fPWG2AODTracks = aReader.fPWG2AODTracks;
130 fAODpidUtil = aReader.fAODpidUtil;
131 fCentRange[0] = aReader.fCentRange[0];
132 fCentRange[1] = aReader.fCentRange[1];
137 AliFemtoString AliFemtoEventReaderAOD::Report()
139 // create reader report
140 AliFemtoString temp = "\n This is the AliFemtoEventReaderAOD\n";
145 void AliFemtoEventReaderAOD::SetInputFile(const char* inputFile)
147 //setting the name of file where names of AOD file are written
148 //it takes only this files which have good trees
150 fInputFile=string(inputFile);
151 ifstream infile(inputFile);
153 fTree = new TChain("aodTree");
155 if(infile.good()==true)
157 //checking if all give files have good tree inside
158 while (infile.eof()==false)
160 infile.getline(buffer,256);
161 TFile *aodFile=TFile::Open(buffer,"READ");
164 TTree* tree = (TTree*) aodFile->Get("aodTree");
167 // cout<<"putting file "<<string(buffer)<<" into analysis"<<endl;
168 fTree->AddFile(buffer);
178 AliFemtoEvent* AliFemtoEventReaderAOD::ReturnHbtEvent()
180 // read in a next hbt event from the chain
181 // convert it to AliFemtoEvent and return
182 // for further analysis
183 AliFemtoEvent *hbtEvent = 0;
184 cout<<"reader"<<endl;
185 if (fCurEvent==fNumberofEvent)//open next file
187 if(fNumberofEvent==0)
189 fEvent=new AliAODEvent();
190 fEvent->ReadFromTree(fTree);
192 // Check for the existence of the additional information
193 // fPWG2AODTracks = (TClonesArray *) fEvent->GetList()->FindObject("pwg2aodtracks");
195 // if (fPWG2AODTracks) {
196 // cout << "Found additional PWG2 specific information in the AOD!" << endl;
197 // cout << "Reading only tracks with the additional information" << endl;
200 fNumberofEvent=fTree->GetEntries();
201 // cout<<"Number of Entries in file "<<fNumberofEvent<<endl;
204 else //no more data to read
206 cout<<"no more files "<<hbtEvent<<endl;
212 cout<<"starting to read event "<<fCurEvent<<endl;
213 fTree->GetEvent(fCurEvent);//getting next event
214 // cout << "Read event " << fEvent << " from file " << fTree << endl;
216 hbtEvent = new AliFemtoEvent;
218 CopyAODtoFemtoEvent(hbtEvent);
225 void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
228 // A function that reads in the AOD event
229 // and transfers the neccessary information into
230 // the internal AliFemtoEvent
232 // setting global event characteristics
233 tEvent->SetRunNumber(fEvent->GetRunNumber());
234 tEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok
235 tEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy());
236 tEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy());
237 tEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy());
238 tEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy());
239 tEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy(0));
240 tEvent->SetZDCParticipants(0);
241 tEvent->SetTriggerMask(fEvent->GetTriggerMask());
242 tEvent->SetTriggerCluster(fEvent->GetTriggerCluster());
244 // Attempt to access MC header
248 mcH = (AliAODMCHeader *) fEvent->FindListObject(AliAODMCHeader::StdBranchName());
250 cout << "AOD MC information requested, but no header found!" << endl;
253 mcP = (TClonesArray *) fEvent->FindListObject(AliAODMCParticle::StdBranchName());
255 cout << "AOD MC information requested, but no particle array found!" << endl;
259 tEvent->SetReactionPlaneAngle(fEvent->GetHeader()->GetQTheta(0)/2.0);
263 motherids = new Int_t[((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel()];
264 for (int ip=0; ip<mcP->GetEntries(); ip++) motherids[ip] = 0;
266 // Read in mother ids
267 AliAODMCParticle *motherpart;
268 for (int ip=0; ip<mcP->GetEntries(); ip++) {
269 motherpart = (AliAODMCParticle *) mcP->At(ip);
270 if (motherpart->GetDaughter(0) > 0)
271 motherids[motherpart->GetDaughter(0)] = ip;
272 if (motherpart->GetDaughter(1) > 0)
273 motherids[motherpart->GetDaughter(1)] = ip;
277 // Primary Vertex position
279 fEvent->GetPrimaryVertex()->GetPosition(fV1);
281 AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]);
282 tEvent->SetPrimVertPos(vertex);
284 //starting to reading tracks
285 int nofTracks=0; //number of reconstructed tracks in event
287 // Check to see whether the additional info exists
288 // if (fPWG2AODTracks)
289 // nofTracks=fPWG2AODTracks->GetEntries();
291 nofTracks=fEvent->GetNumberOfTracks();
292 cout<<"nofTracks: "<<nofTracks<<endl;
294 AliCentrality *cent = fEvent->GetCentrality();
296 if (cent && fUsePreCent) {
297 if ((cent->GetCentralityPercentile("V0M")*10 < fCentRange[0]) ||
298 (cent->GetCentralityPercentile("V0M")*10 > fCentRange[1]))
300 cout << "Centrality " << cent->GetCentralityPercentile("V0M") << " outside of preselection range " << fCentRange[0] << " - " << fCentRange[1] << endl;
306 int realnofTracks=0; // number of track which we use in a analysis
310 for (int il=0; il<20000; il++) labels[il] = -1;
312 // looking for global tracks and saving their numbers to copy from them PID information to TPC-only tracks in the main loop over tracks
313 for (int i=0;i<nofTracks;i++) {
314 const AliAODTrack *aodtrack=fEvent->GetTrack(i);
315 if (!aodtrack->TestFilterBit(fFilterBit)) {
316 labels[aodtrack->GetID()] = i;
320 // int tNormMult = 0;
321 for (int i=0;i<nofTracks;i++)
323 AliFemtoTrack* trackCopy = new AliFemtoTrack();
325 // if (fPWG2AODTracks) {
326 // // Read tracks from the additional pwg2 specific AOD part
328 // // Note that in that case all the AOD tracks without the
329 // // additional information will be ignored !
330 // AliPWG2AODTrack *pwg2aodtrack = (AliPWG2AODTrack *) fPWG2AODTracks->At(i);
332 // // Getting the AOD track through the ref of the additional info
333 // AliAODTrack *aodtrack = pwg2aodtrack->GetRefAODTrack();
334 // if (!aodtrack->TestFilterBit(fFilterBit)) {
340 // if (aodtrack->IsOn(AliESDtrack::kTPCrefit))
341 // if (aodtrack->Chi2perNDF() < 6.0)
342 // if (aodtrack->Eta() < 0.9)
346 // CopyAODtoFemtoTrack(aodtrack, trackCopy, pwg2aodtrack);
349 // // Fill the hidden information with the simulated data
350 // // Int_t pLabel = aodtrack->GetLabel();
351 // AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
353 // // Check the mother information
355 // // Using the new way of storing the freeze-out information
356 // // Final state particle is stored twice on the stack
357 // // one copy (mother) is stored with original freeze-out information
358 // // and is not tracked
359 // // the other one (daughter) is stored with primary vertex position
362 // // Freeze-out coordinates
363 // double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
364 // fpx = tPart->Xv() - fV1[0];
365 // fpy = tPart->Yv() - fV1[1];
366 // fpz = tPart->Zv() - fV1[2];
369 // AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
370 // tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
377 // // cout << "Looking for mother ids " << endl;
378 // if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
379 // // cout << "Got mother id" << endl;
380 // AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
381 // // Check if this is the same particle stored twice on the stack
382 // if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
383 // // It is the same particle
384 // // Read in the original freeze-out information
385 // // and convert it from to [fm]
388 // // fpx = mother->Xv()*1e13*0.197327;
389 // // fpy = mother->Yv()*1e13*0.197327;
390 // // fpz = mother->Zv()*1e13*0.197327;
391 // // fpt = mother->T() *1e13*0.197327*0.5;
394 // // Therminator style
395 // fpx = mother->Xv()*1e13;
396 // fpy = mother->Yv()*1e13;
397 // fpz = mother->Zv()*1e13;
398 // fpt = mother->T() *1e13*3e10;
403 // // if (fRotateToEventPlane) {
404 // // double tPhi = TMath::ATan2(fpy, fpx);
405 // // double tRad = TMath::Hypot(fpx, fpy);
407 // // fpx = tRad*TMath::Cos(tPhi - tReactionPlane);
408 // // fpy = tRad*TMath::Sin(tPhi - tReactionPlane);
411 // tInfo->SetPDGPid(tPart->GetPdgCode());
413 // // if (fRotateToEventPlane) {
414 // // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px());
415 // // double tRad = TMath::Hypot(tPart->Px(), tPart->Py());
417 // // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane),
418 // // tRad*TMath::Sin(tPhi - tReactionPlane),
422 // tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz());
423 // Double_t mass2 = (tPart->E() *tPart->E() -
424 // tPart->Px()*tPart->Px() -
425 // tPart->Py()*tPart->Py() -
426 // tPart->Pz()*tPart->Pz());
428 // tInfo->SetMass(TMath::Sqrt(mass2));
430 // tInfo->SetMass(0.0);
432 // tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt);
433 // trackCopy->SetHiddenInfo(tInfo);
438 // aodtrack->PxPyPz(pxyz);//reading noconstarined momentum
439 // const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
440 // // Check the sanity of the tracks - reject zero momentum tracks
441 // if (ktP.Mag() == 0) {
447 // No additional information exists
448 // Read in the normal AliAODTracks
450 // const AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
451 AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
453 if (aodtrack->IsPrimaryCandidate()) tracksPrim++;
455 if (!aodtrack->TestFilterBit(fFilterBit)) {
460 CopyAODtoFemtoTrack(aodtrack, trackCopy);
462 // copying PID information from the correspondent track
463 // const AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
464 AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
465 CopyPIDtoFemtoTrack(aodtrackpid, trackCopy);
468 // Fill the hidden information with the simulated data
469 // Int_t pLabel = aodtrack->GetLabel();
470 AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
472 AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
473 double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
478 tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
480 tInfo->SetTrueMomentum(0.0, 0.0, 0.0);
481 tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0);
485 // Check the mother information
487 // Using the new way of storing the freeze-out information
488 // Final state particle is stored twice on the stack
489 // one copy (mother) is stored with original freeze-out information
490 // and is not tracked
491 // the other one (daughter) is stored with primary vertex position
494 // Freeze-out coordinates
495 fpx = tPart->Xv() - fV1[0];
496 fpy = tPart->Yv() - fV1[1];
497 fpz = tPart->Zv() - fV1[2];
500 tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
507 // cout << "Looking for mother ids " << endl;
508 if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
509 // cout << "Got mother id" << endl;
510 AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
511 // Check if this is the same particle stored twice on the stack
513 if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
514 // It is the same particle
515 // Read in the original freeze-out information
516 // and convert it from to [fm]
519 // fpx = mother->Xv()*1e13*0.197327;
520 // fpy = mother->Yv()*1e13*0.197327;
521 // fpz = mother->Zv()*1e13*0.197327;
522 // fpt = mother->T() *1e13*0.197327*0.5;
526 fpx = mother->Xv()*1e13;
527 fpy = mother->Yv()*1e13;
528 fpz = mother->Zv()*1e13;
529 // fpt = mother->T() *1e13*3e10;
535 // if (fRotateToEventPlane) {
536 // double tPhi = TMath::ATan2(fpy, fpx);
537 // double tRad = TMath::Hypot(fpx, fpy);
539 // fpx = tRad*TMath::Cos(tPhi - tReactionPlane);
540 // fpy = tRad*TMath::Sin(tPhi - tReactionPlane);
543 tInfo->SetPDGPid(tPart->GetPdgCode());
545 // if (fRotateToEventPlane) {
546 // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px());
547 // double tRad = TMath::Hypot(tPart->Px(), tPart->Py());
549 // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane),
550 // tRad*TMath::Sin(tPhi - tReactionPlane),
554 tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz());
555 Double_t mass2 = (tPart->E() *tPart->E() -
556 tPart->Px()*tPart->Px() -
557 tPart->Py()*tPart->Py() -
558 tPart->Pz()*tPart->Pz());
560 tInfo->SetMass(TMath::Sqrt(mass2));
564 tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt);
566 trackCopy->SetHiddenInfo(tInfo);
570 aodtrack->PxPyPz(pxyz);//reading noconstarined momentum
571 const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
572 // Check the sanity of the tracks - reject zero momentum tracks
573 if (ktP.Mag() == 0) {
580 tEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis
581 realnofTracks++;//real number of tracks
584 tEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event
585 tEvent->SetNormalizedMult(tracksPrim);
587 // AliCentrality *cent = fEvent->GetCentrality();
588 if (cent) tEvent->SetNormalizedMult(lrint(10*cent->GetCentralityPercentile("V0M")));
589 // if (cent) tEvent->SetNormalizedMult((int) cent->GetCentralityPercentile("V0M"));
592 tEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M"));
593 // tEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD"));
594 tEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1"));
595 // tEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK"));
599 if (mcP) delete [] motherids;
601 cout<<"end of reading nt "<<nofTracks<<" real number "<<realnofTracks<<endl;
604 void AliFemtoEventReaderAOD::CopyAODtoFemtoTrack(AliAODTrack *tAodTrack,
605 AliFemtoTrack *tFemtoTrack
606 // AliPWG2AODTrack *tPWG2AODTrack
609 // Copy the track information from the AOD into the internal AliFemtoTrack
610 // If it exists, use the additional information from the PWG2 AOD
612 // Primary Vertex position
614 fEvent->GetPrimaryVertex()->GetPosition(fV1);
615 // fEvent->GetPrimaryVertex()->GetXYZ(fV1);
617 tFemtoTrack->SetCharge(tAodTrack->Charge());
620 tAodTrack->PxPyPz(pxyz);//reading noconstrained momentum
621 AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]);
622 tFemtoTrack->SetP(v);//setting momentum
623 tFemtoTrack->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1]));
624 const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]);
625 //setting track helix
626 const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
627 AliFmPhysicalHelixD helix(ktP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(tFemtoTrack->Charge()));
628 tFemtoTrack->SetHelix(helix);
631 tFemtoTrack->SetTrackId(tAodTrack->GetID());
632 tFemtoTrack->SetFlags(tAodTrack->GetFlags());
633 tFemtoTrack->SetLabel(tAodTrack->GetLabel());
635 // Track quality information
637 tAodTrack->GetCovMatrix(covmat);
642 if (!tAodTrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
643 //cout << "sth went wrong with dca propagation" << endl;
644 tFemtoTrack->SetImpactD(-1000.0);
645 tFemtoTrack->SetImpactZ(-1000.0);
649 tFemtoTrack->SetImpactD(impact[0]);
650 tFemtoTrack->SetImpactZ(impact[1]);
653 // if (TMath::Abs(tAodTrack->Xv()) > 0.00000000001)
654 // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv())*(tAodTrack->Xv()/TMath::Abs(tAodTrack->Xv())));
656 // tFemtoTrack->SetImpactD(0.0);
657 // tFemtoTrack->SetImpactD(tAodTrack->DCA());
659 // tFemtoTrack->SetImpactZ(tAodTrack->ZAtDCA());
662 // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1]));
663 // tFemtoTrack->SetImpactZ(tAodTrack->Zv() - fV1[2]);
667 // << "dca" << TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1])
668 // << "xv - fv10 = "<< tAodTrack->Xv() - fV1[0]
669 // << tAodTrack->Yv() - fV1[1]
670 // << "xv = " << tAodTrack->Xv() << endl
671 // << "fv1[0] = " << fV1[0] << endl
672 // << "yv = " << tAodTrack->Yv() << endl
673 // << "fv1[1] = " << fV1[1] << endl
674 // << "zv = " << tAodTrack->Zv() << endl
675 // << "fv1[2] = " << fV1[2] << endl
676 // << "impact[0] = " << impact[0] << endl
677 // << "impact[1] = " << impact[1] << endl
680 tFemtoTrack->SetCdd(covmat[0]);
681 tFemtoTrack->SetCdz(covmat[1]);
682 tFemtoTrack->SetCzz(covmat[2]);
683 tFemtoTrack->SetITSchi2(tAodTrack->Chi2perNDF());
684 tFemtoTrack->SetITSncls(tAodTrack->GetITSNcls());
685 tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());
686 tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());
687 tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());
688 tFemtoTrack->SetTPCsignalN(1);
689 tFemtoTrack->SetTPCsignalS(1);
690 tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
692 // if (tPWG2AODTrack) {
693 // // Copy the PWG2 specific information if it exists
694 // tFemtoTrack->SetTPCClusterMap(tPWG2AODTrack->GetTPCClusterMap());
695 // tFemtoTrack->SetTPCSharedMap(tPWG2AODTrack->GetTPCSharedMap());
697 // double xtpc[3] = {0,0,0};
698 // tPWG2AODTrack->GetTPCNominalEntrancePoint(xtpc);
699 // tFemtoTrack->SetNominalTPCEntrancePoint(xtpc);
700 // tPWG2AODTrack->GetTPCNominalExitPoint(xtpc);
701 // tFemtoTrack->SetNominalTPCExitPoint(xtpc);
704 // If not use dummy values
705 tFemtoTrack->SetTPCClusterMap(tAodTrack->GetTPCClusterMap());
706 tFemtoTrack->SetTPCSharedMap(tAodTrack->GetTPCSharedMap());
708 double xtpc[3] = {0,0,0};
709 tFemtoTrack->SetNominalTPCEntrancePoint(xtpc);
710 tFemtoTrack->SetNominalTPCExitPoint(xtpc);
713 // // cout << "Track has " << TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv()) << " " << tAodTrack->Zv() << " " << tAodTrack->GetTPCNcls() << endl;
717 for (int ik=0; ik<3; ik++) {
720 tFemtoTrack->SetKinkIndexes(indexes);
723 void AliFemtoEventReaderAOD::SetFilterBit(UInt_t ibit)
725 fFilterBit = (1 << (ibit));
728 void AliFemtoEventReaderAOD::SetReadMC(unsigned char a)
733 AliAODMCParticle* AliFemtoEventReaderAOD::GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel)
735 if (aLabel < 0) return 0;
736 AliAODMCParticle *aodP;
738 if (aLabel > mcP->GetEntries())
739 posstack = mcP->GetEntries();
743 aodP = (AliAODMCParticle *) mcP->At(posstack);
744 if (aodP->GetLabel() > posstack) {
746 aodP = (AliAODMCParticle *) mcP->At(posstack);
747 if (aodP->GetLabel() == aLabel) return aodP;
750 while (posstack > 0);
754 aodP = (AliAODMCParticle *) mcP->At(posstack);
755 if (aodP->GetLabel() == aLabel) return aodP;
758 while (posstack < mcP->GetEntries());
764 void AliFemtoEventReaderAOD::CopyPIDtoFemtoTrack(AliAODTrack *tAodTrack,
765 AliFemtoTrack *tFemtoTrack)
768 tAodTrack->GetPID(aodpid);
769 tFemtoTrack->SetPidProbElectron(aodpid[0]);
770 tFemtoTrack->SetPidProbMuon(aodpid[1]);
771 tFemtoTrack->SetPidProbPion(aodpid[2]);
772 tFemtoTrack->SetPidProbKaon(aodpid[3]);
773 tFemtoTrack->SetPidProbProton(aodpid[4]);
775 aodpid[0] = -100000.0;
776 aodpid[1] = -100000.0;
777 aodpid[2] = -100000.0;
778 aodpid[3] = -100000.0;
779 aodpid[4] = -100000.0;
783 if (tAodTrack->GetStatus() & AliESDtrack::kTOFpid) { //AliESDtrack::kTOFpid=0x8000
784 tTOF = tAodTrack->GetTOFsignal();
785 tAodTrack->GetIntegratedTimes(aodpid);
788 tFemtoTrack->SetTofExpectedTimes(tTOF-aodpid[2], tTOF-aodpid[3], tTOF-aodpid[4]);
790 ////// TPC ////////////////////////////////////////////
792 float nsigmaTPCK=-1000.;
793 float nsigmaTPCPi=-1000.;
794 float nsigmaTPCP=-1000.;
796 // cout<<"in reader fESDpid"<<fESDpid<<endl;
798 if (tAodTrack->IsOn(AliESDtrack::kTPCpid)){ //AliESDtrack::kTPCpid=0x0080
799 nsigmaTPCK = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kKaon);
800 nsigmaTPCPi = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kPion);
801 nsigmaTPCP = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kProton);
804 tFemtoTrack->SetNSigmaTPCPi(nsigmaTPCPi);
805 tFemtoTrack->SetNSigmaTPCK(nsigmaTPCK);
806 tFemtoTrack->SetNSigmaTPCP(nsigmaTPCP);
808 tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());
809 tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());
810 tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());
812 tFemtoTrack->SetTPCsignalN(1);
813 tFemtoTrack->SetTPCsignalS(1);
814 tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
816 ///////TOF//////////////////////
819 float nsigmaTOFPi=-1000.;
820 float nsigmaTOFK=-1000.;
821 float nsigmaTOFP=-1000.;
823 if ((tAodTrack->GetStatus() & AliESDtrack::kTOFpid) && //AliESDtrack::kTOFpid=0x8000
824 (tAodTrack->GetStatus() & AliESDtrack::kTOFout) && //AliESDtrack::kTOFout=0x2000
825 (tAodTrack->GetStatus() & AliESDtrack::kTIME) && //AliESDtrack::kTIME=0x80000000
826 !(tAodTrack->GetStatus() & AliESDtrack::kTOFmismatch)) //AliESDtrack::kTOFmismatch=0x100000
828 if(tAodTrack->IsOn(AliESDtrack::kTOFpid)) //AliESDtrack::kTOFpid=0x8000
831 nsigmaTOFPi = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kPion);
832 nsigmaTOFK = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kKaon);
833 nsigmaTOFP = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kProton);
835 Double_t len=200;// esdtrack->GetIntegratedLength(); !!!!!
836 Double_t tof=tAodTrack->GetTOFsignal();
837 if(tof > 0.) vp=len/tof/0.03;
840 tFemtoTrack->SetVTOF(vp);
841 tFemtoTrack->SetNSigmaTOFPi(nsigmaTOFPi);
842 tFemtoTrack->SetNSigmaTOFK(nsigmaTOFK);
843 tFemtoTrack->SetNSigmaTOFP(nsigmaTOFP);
846 //////////////////////////////////////
850 void AliFemtoEventReaderAOD::SetCentralityPreSelection(double min, double max)
852 fCentRange[0] = min; fCentRange[1] = max;
857 void AliFemtoEventReaderAOD::SetAODpidUtil(AliAODpidUtil *aAODpidUtil)
859 fAODpidUtil = aAODpidUtil;
860 // printf("fAODpidUtil: %x\n",fAODpidUtil);