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;
42 //____________________________
43 //constructor with 0 parameters , look at default settings
44 AliFemtoEventReaderAOD::AliFemtoEventReaderAOD():
52 // fPWG2AODTracks(0x0),
56 fEstEventMult(kCentrality),
66 // default constructor
67 fAllTrue.ResetAllBits(kTRUE);
68 fAllFalse.ResetAllBits(kFALSE);
73 AliFemtoEventReaderAOD::AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aReader) :
74 AliFemtoEventReader(),
82 // fPWG2AODTracks(0x0),
86 fEstEventMult(kCentrality),
97 fReadMC = aReader.fReadMC;
98 fReadV0 = aReader.fReadV0;
99 fInputFile = aReader.fInputFile;
100 fFileName = aReader.fFileName;
101 fNumberofEvent = aReader.fNumberofEvent;
102 fCurEvent = aReader.fCurEvent;
103 fEvent = new AliAODEvent();
104 fAodFile = new TFile(aReader.fAodFile->GetName());
105 fAllTrue.ResetAllBits(kTRUE);
106 fAllFalse.ResetAllBits(kFALSE);
107 fFilterBit = aReader.fFilterBit;
108 // fPWG2AODTracks = aReader.fPWG2AODTracks;
109 fAODpidUtil = aReader.fAODpidUtil;
110 fAODheader = aReader.fAODheader;
111 fCentRange[0] = aReader.fCentRange[0];
112 fCentRange[1] = aReader.fCentRange[1];
113 fEstEventMult = aReader.fEstEventMult;
114 fUsePreCent = aReader.fUsePreCent;
118 AliFemtoEventReaderAOD::~AliFemtoEventReaderAOD()
124 // if (fPWG2AODTracks) {
125 // fPWG2AODTracks->Delete();
126 // delete fPWG2AODTracks;
131 AliFemtoEventReaderAOD& AliFemtoEventReaderAOD::operator=(const AliFemtoEventReaderAOD& aReader)
133 // assignment operator
134 if (this == &aReader)
137 fInputFile = aReader.fInputFile;
138 fFileName = aReader.fFileName;
139 fNumberofEvent = aReader.fNumberofEvent;
140 fCurEvent = aReader.fCurEvent;
141 if (fTree) delete fTree;
142 if (fEvent) delete fEvent;
143 fEvent = new AliAODEvent();
144 if (fAodFile) delete fAodFile;
145 fAodFile = new TFile(aReader.fAodFile->GetName());
146 fAllTrue.ResetAllBits(kTRUE);
147 fAllFalse.ResetAllBits(kFALSE);
148 fFilterBit = aReader.fFilterBit;
149 fFilterMask = aReader.fFilterMask;
150 // fPWG2AODTracks = aReader.fPWG2AODTracks;
151 fAODpidUtil = aReader.fAODpidUtil;
152 fAODheader = aReader.fAODheader;
153 fCentRange[0] = aReader.fCentRange[0];
154 fCentRange[1] = aReader.fCentRange[1];
155 fUsePreCent = aReader.fUsePreCent;
156 fEstEventMult = aReader.fEstEventMult;
161 AliFemtoString AliFemtoEventReaderAOD::Report()
163 // create reader report
164 AliFemtoString temp = "\n This is the AliFemtoEventReaderAOD\n";
169 void AliFemtoEventReaderAOD::SetInputFile(const char* inputFile)
171 //setting the name of file where names of AOD file are written
172 //it takes only this files which have good trees
174 fInputFile=string(inputFile);
175 ifstream infile(inputFile);
177 fTree = new TChain("aodTree");
179 if(infile.good()==true)
181 //checking if all give files have good tree inside
182 while (infile.eof()==false)
184 infile.getline(buffer,256);
185 TFile *aodFile=TFile::Open(buffer,"READ");
188 TTree* tree = (TTree*) aodFile->Get("aodTree");
191 // cout<<"putting file "<<string(buffer)<<" into analysis"<<endl;
192 fTree->AddFile(buffer);
202 AliFemtoEvent* AliFemtoEventReaderAOD::ReturnHbtEvent()
204 // read in a next hbt event from the chain
205 // convert it to AliFemtoEvent and return
206 // for further analysis
207 AliFemtoEvent *hbtEvent = 0;
208 // cout<<"reader"<<endl;
209 if (fCurEvent==fNumberofEvent)//open next file
211 if(fNumberofEvent==0)
213 fEvent=new AliAODEvent();
214 fEvent->ReadFromTree(fTree);
216 // Check for the existence of the additional information
217 // fPWG2AODTracks = (TClonesArray *) fEvent->GetList()->FindObject("pwg2aodtracks");
219 // if (fPWG2AODTracks) {
220 // cout << "Found additional PWG2 specific information in the AOD!" << endl;
221 // cout << "Reading only tracks with the additional information" << endl;
224 fNumberofEvent=fTree->GetEntries();
225 // cout<<"Number of Entries in file "<<fNumberofEvent<<endl;
228 else //no more data to read
230 // cout<<"no more files "<<hbtEvent<<endl;
236 // cout<<"starting to read event "<<fCurEvent<<endl;
237 fTree->GetEvent(fCurEvent);//getting next event
238 // cout << "Read event " << fEvent << " from file " << fTree << endl;
240 hbtEvent = new AliFemtoEvent;
242 CopyAODtoFemtoEvent(hbtEvent);
249 void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
252 // A function that reads in the AOD event
253 // and transfers the neccessary information into
254 // the internal AliFemtoEvent
256 // setting global event characteristics
257 tEvent->SetRunNumber(fEvent->GetRunNumber());
258 tEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok
259 tEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy());
260 tEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy());
261 tEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy());
262 tEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy());
263 tEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy(0));
264 tEvent->SetZDCParticipants(0);
265 tEvent->SetTriggerMask(fEvent->GetTriggerMask());
266 tEvent->SetTriggerCluster(fEvent->GetTriggerCluster());
268 // Attempt to access MC header
272 mcH = (AliAODMCHeader *) fEvent->FindListObject(AliAODMCHeader::StdBranchName());
274 cout << "AOD MC information requested, but no header found!" << endl;
277 mcP = (TClonesArray *) fEvent->FindListObject(AliAODMCParticle::StdBranchName());
279 cout << "AOD MC information requested, but no particle array found!" << endl;
283 tEvent->SetReactionPlaneAngle(fEvent->GetHeader()->GetQTheta(0)/2.0);
287 motherids = new Int_t[((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel()];
288 for (int ip=0; ip<mcP->GetEntries(); ip++) motherids[ip] = 0;
290 // Read in mother ids
291 AliAODMCParticle *motherpart;
292 for (int ip=0; ip<mcP->GetEntries(); ip++) {
293 motherpart = (AliAODMCParticle *) mcP->At(ip);
294 if (motherpart->GetDaughter(0) > 0)
295 motherids[motherpart->GetDaughter(0)] = ip;
296 if (motherpart->GetDaughter(1) > 0)
297 motherids[motherpart->GetDaughter(1)] = ip;
301 // Primary Vertex position
303 fEvent->GetPrimaryVertex()->GetPosition(fV1);
305 AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]);
306 tEvent->SetPrimVertPos(vertex);
308 //starting to reading tracks
309 int nofTracks=0; //number of reconstructed tracks in event
311 // Check to see whether the additional info exists
312 // if (fPWG2AODTracks)
313 // nofTracks=fPWG2AODTracks->GetEntries();
315 nofTracks=fEvent->GetNumberOfTracks();
317 AliEventplane *ep = fEvent->GetEventplane();
321 tEvent->SetReactionPlaneAngle(ep->GetEventplane("V0",fEvent,2));
323 tEvent->SetReactionPlaneAngle(ep->GetEventplane("Q"));
326 AliCentrality *cent = fEvent->GetCentrality();
328 if (!fEstEventMult && cent && fUsePreCent) {
329 if ((cent->GetCentralityPercentile("V0M")*10 < fCentRange[0]) ||
330 (cent->GetCentralityPercentile("V0M")*10 > fCentRange[1]))
332 // cout << "Centrality " << cent->GetCentralityPercentile("V0M") << " outside of preselection range " << fCentRange[0] << " - " << fCentRange[1] << endl;
338 int realnofTracks=0; // number of track which we use in a analysis
342 for (int il=0; il<20000; il++) labels[il] = -1;
344 // looking for global tracks and saving their numbers to copy from them PID information to TPC-only tracks in the main loop over tracks
345 for (int i=0;i<nofTracks;i++) {
346 const AliAODTrack *aodtrack=fEvent->GetTrack(i);
347 if (!aodtrack->TestFilterBit(fFilterBit)) {
348 if(aodtrack->GetID() < 0) continue;
349 labels[aodtrack->GetID()] = i;
354 for (int i=0;i<nofTracks;i++)
356 AliFemtoTrack* trackCopy = new AliFemtoTrack();
358 // if (fPWG2AODTracks) {
359 // // Read tracks from the additional pwg2 specific AOD part
361 // // Note that in that case all the AOD tracks without the
362 // // additional information will be ignored !
363 // AliPWG2AODTrack *pwg2aodtrack = (AliPWG2AODTrack *) fPWG2AODTracks->At(i);
365 // // Getting the AOD track through the ref of the additional info
366 // AliAODTrack *aodtrack = pwg2aodtrack->GetRefAODTrack();
367 // if (!aodtrack->TestFilterBit(fFilterBit)) {
373 // if (aodtrack->IsOn(AliESDtrack::kTPCrefit))
374 // if (aodtrack->Chi2perNDF() < 6.0)
375 // if (aodtrack->Eta() < 0.9)
379 // CopyAODtoFemtoTrack(aodtrack, trackCopy, pwg2aodtrack);
382 // // Fill the hidden information with the simulated data
383 // // Int_t pLabel = aodtrack->GetLabel();
384 // AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
386 // // Check the mother information
388 // // Using the new way of storing the freeze-out information
389 // // Final state particle is stored twice on the stack
390 // // one copy (mother) is stored with original freeze-out information
391 // // and is not tracked
392 // // the other one (daughter) is stored with primary vertex position
395 // // Freeze-out coordinates
396 // double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
397 // fpx = tPart->Xv() - fV1[0];
398 // fpy = tPart->Yv() - fV1[1];
399 // fpz = tPart->Zv() - fV1[2];
402 // AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
403 // tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
410 // // cout << "Looking for mother ids " << endl;
411 // if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
412 // // cout << "Got mother id" << endl;
413 // AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
414 // // Check if this is the same particle stored twice on the stack
415 // if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
416 // // It is the same particle
417 // // Read in the original freeze-out information
418 // // and convert it from to [fm]
421 // // fpx = mother->Xv()*1e13*0.197327;
422 // // fpy = mother->Yv()*1e13*0.197327;
423 // // fpz = mother->Zv()*1e13*0.197327;
424 // // fpt = mother->T() *1e13*0.197327*0.5;
427 // // Therminator style
428 // fpx = mother->Xv()*1e13;
429 // fpy = mother->Yv()*1e13;
430 // fpz = mother->Zv()*1e13;
431 // fpt = mother->T() *1e13*3e10;
436 // // if (fRotateToEventPlane) {
437 // // double tPhi = TMath::ATan2(fpy, fpx);
438 // // double tRad = TMath::Hypot(fpx, fpy);
440 // // fpx = tRad*TMath::Cos(tPhi - tReactionPlane);
441 // // fpy = tRad*TMath::Sin(tPhi - tReactionPlane);
444 // tInfo->SetPDGPid(tPart->GetPdgCode());
446 // // if (fRotateToEventPlane) {
447 // // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px());
448 // // double tRad = TMath::Hypot(tPart->Px(), tPart->Py());
450 // // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane),
451 // // tRad*TMath::Sin(tPhi - tReactionPlane),
455 // tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz());
456 // Double_t mass2 = (tPart->E() *tPart->E() -
457 // tPart->Px()*tPart->Px() -
458 // tPart->Py()*tPart->Py() -
459 // tPart->Pz()*tPart->Pz());
461 // tInfo->SetMass(TMath::Sqrt(mass2));
463 // tInfo->SetMass(0.0);
465 // tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt);
466 // trackCopy->SetHiddenInfo(tInfo);
471 // aodtrack->PxPyPz(pxyz);//reading noconstarined momentum
472 // const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
473 // // Check the sanity of the tracks - reject zero momentum tracks
474 // if (ktP.Mag() == 0) {
480 // No additional information exists
481 // Read in the normal AliAODTracks
483 // const AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
484 AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
488 if (aodtrack->IsPrimaryCandidate()) tracksPrim++;
490 if (fFilterBit && !aodtrack->TestFilterBit(fFilterBit)) {
495 if (fFilterMask && !aodtrack->TestFilterBit(fFilterMask)) {
500 //counting particles to set multiplicity
503 if (aodtrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
504 if(impact[0]<0.2 && TMath::Abs(impact[1]+fV1[2])<2.0)
505 //if (aodtrack->IsPrimaryCandidate()) //? instead of kinks?
506 if (aodtrack->Chi2perNDF() < 4.0)
507 if (aodtrack->Pt() > 0.15 && aodtrack->Pt() < 20)
508 if (aodtrack->GetTPCNcls() > 70)
509 if (aodtrack->Eta() < 0.8)
513 CopyAODtoFemtoTrack(aodtrack, trackCopy);
515 // copying PID information from the correspondent track
516 // const AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
519 AliAODTrack *aodtrackpid;
520 if((fFilterBit == (1 << (7))) || fFilterMask==128) //for TPC Only tracks we have to copy PID information from corresponding global tracks
521 aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
523 aodtrackpid = fEvent->GetTrack(i);
524 CopyPIDtoFemtoTrack(aodtrackpid, trackCopy);
527 // Fill the hidden information with the simulated data
528 // Int_t pLabel = aodtrack->GetLabel();
529 AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
531 AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
532 double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
537 tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
539 tInfo->SetTrueMomentum(0.0, 0.0, 0.0);
540 tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0);
544 // Check the mother information
546 // Using the new way of storing the freeze-out information
547 // Final state particle is stored twice on the stack
548 // one copy (mother) is stored with original freeze-out information
549 // and is not tracked
550 // the other one (daughter) is stored with primary vertex position
553 // Freeze-out coordinates
554 fpx = tPart->Xv() - fV1[0];
555 fpy = tPart->Yv() - fV1[1];
556 fpz = tPart->Zv() - fV1[2];
559 tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
566 // cout << "Looking for mother ids " << endl;
567 if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
568 // cout << "Got mother id" << endl;
569 AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
570 // Check if this is the same particle stored twice on the stack
572 if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
573 // It is the same particle
574 // Read in the original freeze-out information
575 // and convert it from to [fm]
578 // fpx = mother->Xv()*1e13*0.197327;
579 // fpy = mother->Yv()*1e13*0.197327;
580 // fpz = mother->Zv()*1e13*0.197327;
581 // fpt = mother->T() *1e13*0.197327*0.5;
585 fpx = mother->Xv()*1e13;
586 fpy = mother->Yv()*1e13;
587 fpz = mother->Zv()*1e13;
588 // fpt = mother->T() *1e13*3e10;
594 // if (fRotateToEventPlane) {
595 // double tPhi = TMath::ATan2(fpy, fpx);
596 // double tRad = TMath::Hypot(fpx, fpy);
598 // fpx = tRad*TMath::Cos(tPhi - tReactionPlane);
599 // fpy = tRad*TMath::Sin(tPhi - tReactionPlane);
602 tInfo->SetPDGPid(tPart->GetPdgCode());
604 // if (fRotateToEventPlane) {
605 // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px());
606 // double tRad = TMath::Hypot(tPart->Px(), tPart->Py());
608 // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane),
609 // tRad*TMath::Sin(tPhi - tReactionPlane),
613 tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz());
614 Double_t mass2 = (tPart->E() *tPart->E() -
615 tPart->Px()*tPart->Px() -
616 tPart->Py()*tPart->Py() -
617 tPart->Pz()*tPart->Pz());
619 tInfo->SetMass(TMath::Sqrt(mass2));
623 tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt);
625 trackCopy->SetHiddenInfo(tInfo);
630 //AliExternalTrackParam *param = new AliExternalTrackParam(*aodtrack->GetInnerParam());
631 trackCopy->SetInnerMomentum(aodtrack->GetTPCmomentum());
633 aodtrack->PxPyPz(pxyz);//reading noconstarined momentum
634 const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
635 // Check the sanity of the tracks - reject zero momentum tracks
636 if (ktP.Mag() == 0) {
643 tEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis
644 realnofTracks++;//real number of tracks
647 tEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event
648 tEvent->SetNormalizedMult(tracksPrim);
650 if (fEstEventMult==kCentrality) {
651 // AliCentrality *cent = fEvent->GetCentrality();
652 //cout<<"AliFemtoEventReaderAOD:"<<lrint(10*cent->GetCentralityPercentile("V0M"))<<endl;
653 if (cent) tEvent->SetNormalizedMult(lrint(10*cent->GetCentralityPercentile("V0M")));
654 // if (cent) tEvent->SetNormalizedMult((int) cent->GetCentralityPercentile("V0M"));
657 tEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M"));
658 // tEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD"));
659 tEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1"));
660 // tEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK"));
663 else if(fEstEventMult==kGlobalCount){
664 tEvent->SetNormalizedMult(tNormMult); //particles counted in the loop, trying to reproduce GetReferenceMultiplicity. If better (default) method appears it should be changed
666 else if(fEstEventMult==kReference)
668 tEvent->SetNormalizedMult(fAODheader->GetRefMultiplicity());
670 else if(fEstEventMult==kTPCOnlyRef)
672 tEvent->SetNormalizedMult(fAODheader->GetTPConlyRefMultiplicity());
674 else if(fEstEventMult == kVZERO)
677 for (Int_t i=0; i<64; i++)
678 multV0 += fEvent->GetVZEROData()->GetMultiplicity(i);
679 tEvent->SetNormalizedMult(multV0);
682 if (mcP) delete [] motherids;
684 // cout<<"end of reading nt "<<nofTracks<<" real number "<<realnofTracks<<endl;
689 for (Int_t i = 0; i < fEvent->GetNumberOfV0s(); i++) {
690 AliAODv0* aodv0 = fEvent->GetV0(i);
691 if (!aodv0) continue;
692 if(aodv0->GetNDaughters()>2) continue;
693 if(aodv0->GetNProngs()>2) continue;
694 if(aodv0->GetCharge()!=0) continue;
695 if(aodv0->ChargeProng(0)==aodv0->ChargeProng(1)) continue;
696 if(aodv0->CosPointingAngle(fV1)<0.998) continue;
697 AliFemtoV0* trackCopyV0 = new AliFemtoV0();
699 CopyAODtoFemtoV0(aodv0, trackCopyV0);
700 tEvent->V0Collection()->push_back(trackCopyV0);
701 //cout<<"Pushback v0 to v0collection"<<endl;
707 void AliFemtoEventReaderAOD::CopyAODtoFemtoTrack(AliAODTrack *tAodTrack,
708 AliFemtoTrack *tFemtoTrack
709 // AliPWG2AODTrack *tPWG2AODTrack
712 // Copy the track information from the AOD into the internal AliFemtoTrack
713 // If it exists, use the additional information from the PWG2 AOD
715 // Primary Vertex position
717 fEvent->GetPrimaryVertex()->GetPosition(fV1);
718 // fEvent->GetPrimaryVertex()->GetXYZ(fV1);
720 tFemtoTrack->SetCharge(tAodTrack->Charge());
723 tAodTrack->PxPyPz(pxyz);//reading noconstrained momentum
724 AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]);
725 tFemtoTrack->SetP(v);//setting momentum
726 tFemtoTrack->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1]));
727 const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]);
728 //setting track helix
729 const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
730 AliFmPhysicalHelixD helix(ktP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(tFemtoTrack->Charge()));
731 tFemtoTrack->SetHelix(helix);
734 tFemtoTrack->SetTrackId(tAodTrack->GetID());
735 tFemtoTrack->SetFlags(tAodTrack->GetFlags());
736 tFemtoTrack->SetLabel(tAodTrack->GetLabel());
738 // Track quality information
740 tAodTrack->GetCovMatrix(covmat);
742 // ! DCA information is done in CopyPIDtoFemtoTrack()
745 // double covimpact[3];
747 // if (!tAodTrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
748 // //cout << "sth went wrong with dca propagation" << endl;
749 // tFemtoTrack->SetImpactD(-1000.0);
750 // tFemtoTrack->SetImpactZ(-1000.0);
754 // tFemtoTrack->SetImpactD(impact[0]);
755 // tFemtoTrack->SetImpactZ(impact[1]+fV1[2]);
758 // if (TMath::Abs(tAodTrack->Xv()) > 0.00000000001)
759 // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv())*(tAodTrack->Xv()/TMath::Abs(tAodTrack->Xv())));
761 // tFemtoTrack->SetImpactD(0.0);
762 // tFemtoTrack->SetImpactD(tAodTrack->DCA());
764 // tFemtoTrack->SetImpactZ(tAodTrack->ZAtDCA());
767 // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1]));
768 // tFemtoTrack->SetImpactZ(tAodTrack->Zv() - fV1[2]);
772 // << "dca" << TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1])
773 // << "xv - fv10 = "<< tAodTrack->Xv() - fV1[0]
774 // << tAodTrack->Yv() - fV1[1]
775 // << "xv = " << tAodTrack->Xv() << endl
776 // << "fv1[0] = " << fV1[0] << endl
777 // << "yv = " << tAodTrack->Yv() << endl
778 // << "fv1[1] = " << fV1[1] << endl
779 // << "zv = " << tAodTrack->Zv() << endl
780 // << "fv1[2] = " << fV1[2] << endl
781 // << "impact[0] = " << impact[0] << endl
782 // << "impact[1] = " << impact[1] << endl
785 tFemtoTrack->SetCdd(covmat[0]);
786 tFemtoTrack->SetCdz(covmat[1]);
787 tFemtoTrack->SetCzz(covmat[2]);
788 tFemtoTrack->SetITSchi2(tAodTrack->Chi2perNDF());
789 tFemtoTrack->SetITSncls(tAodTrack->GetITSNcls());
790 tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());
791 tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());
792 tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());
793 tFemtoTrack->SetTPCsignalN(1);
794 tFemtoTrack->SetTPCsignalS(1);
795 tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
797 // if (tPWG2AODTrack) {
798 // // Copy the PWG2 specific information if it exists
799 // tFemtoTrack->SetTPCClusterMap(tPWG2AODTrack->GetTPCClusterMap());
800 // tFemtoTrack->SetTPCSharedMap(tPWG2AODTrack->GetTPCSharedMap());
802 // double xtpc[3] = {0,0,0};
803 // tPWG2AODTrack->GetTPCNominalEntrancePoint(xtpc);
804 // tFemtoTrack->SetNominalTPCEntrancePoint(xtpc);
805 // tPWG2AODTrack->GetTPCNominalExitPoint(xtpc);
806 // tFemtoTrack->SetNominalTPCExitPoint(xtpc);
809 // If not use dummy values
810 tFemtoTrack->SetTPCClusterMap(tAodTrack->GetTPCClusterMap());
811 tFemtoTrack->SetTPCSharedMap(tAodTrack->GetTPCSharedMap());
814 float globalPositionsAtRadii[9][3];
815 float bfield = 5*fMagFieldSign;
816 GetGlobalPositionAtGlobalRadiiThroughTPC(tAodTrack,bfield,globalPositionsAtRadii);
817 double tpcEntrance[3]={globalPositionsAtRadii[0][0],globalPositionsAtRadii[0][1],globalPositionsAtRadii[0][2]};
818 double **tpcPositions;
819 tpcPositions = new double*[9];
821 tpcPositions[i] = new double[3];
822 double tpcExit[3]={globalPositionsAtRadii[8][0],globalPositionsAtRadii[8][1],globalPositionsAtRadii[8][2]};
825 tpcPositions[i][0] = globalPositionsAtRadii[i][0];
826 tpcPositions[i][1] = globalPositionsAtRadii[i][1];
827 tpcPositions[i][2] = globalPositionsAtRadii[i][2];
829 tFemtoTrack->SetNominalTPCEntrancePoint(tpcEntrance);
830 tFemtoTrack->SetNominalTPCPoints(tpcPositions);
831 tFemtoTrack->SetNominalTPCExitPoint(tpcExit);
835 // // cout << "Track has " << TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv()) << " " << tAodTrack->Zv() << " " << tAodTrack->GetTPCNcls() << endl;
839 for (int ik=0; ik<3; ik++) {
842 tFemtoTrack->SetKinkIndexes(indexes);
845 for (int ii=0; ii<6; ii++){
846 tFemtoTrack->SetITSHitOnLayer(ii,tAodTrack->HasPointOnITSLayer(ii));
852 void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFemtoV0)
854 tFemtoV0->SetdecayLengthV0(tAODv0->DecayLength(fV1));
855 tFemtoV0->SetdecayVertexV0X(tAODv0->DecayVertexV0X());
856 tFemtoV0->SetdecayVertexV0Y(tAODv0->DecayVertexV0Y());
857 tFemtoV0->SetdecayVertexV0Z(tAODv0->DecayVertexV0Z());
858 AliFemtoThreeVector decayvertex(tAODv0->DecayVertexV0X(),tAODv0->DecayVertexV0Y(),tAODv0->DecayVertexV0Z());
859 tFemtoV0->SetdecayVertexV0(decayvertex);
860 tFemtoV0->SetdcaV0Daughters(tAODv0->DcaV0Daughters());
861 tFemtoV0->SetdcaV0ToPrimVertex(tAODv0->DcaV0ToPrimVertex());
862 tFemtoV0->SetdcaPosToPrimVertex(tAODv0->DcaPosToPrimVertex());
863 tFemtoV0->SetdcaNegToPrimVertex(tAODv0->DcaNegToPrimVertex());
864 tFemtoV0->SetmomPosX(tAODv0->MomPosX());
865 tFemtoV0->SetmomPosY(tAODv0->MomPosY());
866 tFemtoV0->SetmomPosZ(tAODv0->MomPosZ());
867 AliFemtoThreeVector mompos(tAODv0->MomPosX(),tAODv0->MomPosY(),tAODv0->MomPosZ());
868 tFemtoV0->SetmomPos(mompos);
869 tFemtoV0->SetmomNegX(tAODv0->MomNegX());
870 tFemtoV0->SetmomNegY(tAODv0->MomNegY());
871 tFemtoV0->SetmomNegZ(tAODv0->MomNegZ());
872 AliFemtoThreeVector momneg(tAODv0->MomNegX(),tAODv0->MomNegY(),tAODv0->MomNegZ());
873 tFemtoV0->SetmomNeg(momneg);
875 //jest cos takiego w AliFemtoV0.h czego nie ma w AliAODv0.h
876 //void SettpcHitsPos(const int& i);
877 //void SettpcHitsNeg(const int& i);
879 //void SetTrackTopologyMapPos(unsigned int word, const unsigned long& m);
880 //void SetTrackTopologyMapNeg(unsigned int word, const unsigned long& m);
882 tFemtoV0->SetmomV0X(tAODv0->MomV0X());
883 tFemtoV0->SetmomV0Y(tAODv0->MomV0Y());
884 tFemtoV0->SetmomV0Z(tAODv0->MomV0Z());
885 AliFemtoThreeVector momv0(tAODv0->MomV0X(),tAODv0->MomV0Y(),tAODv0->MomV0Z());
886 tFemtoV0->SetmomV0(momv0);
887 tFemtoV0->SetalphaV0(tAODv0->AlphaV0());
888 tFemtoV0->SetptArmV0(tAODv0->PtArmV0());
889 tFemtoV0->SeteLambda(tAODv0->ELambda());
890 tFemtoV0->SeteK0Short(tAODv0->EK0Short());
891 tFemtoV0->SetePosProton(tAODv0->EPosProton());
892 tFemtoV0->SeteNegProton(tAODv0->ENegProton());
893 tFemtoV0->SetmassLambda(tAODv0->MassLambda());
894 tFemtoV0->SetmassAntiLambda(tAODv0->MassAntiLambda());
895 tFemtoV0->SetmassK0Short(tAODv0->MassK0Short());
896 tFemtoV0->SetrapLambda(tAODv0->RapLambda());
897 tFemtoV0->SetrapK0Short(tAODv0->RapK0Short());
899 //void SetcTauLambda( float x);
900 //void SetcTauK0Short( float x);
902 //tFemtoV0->SetptV0(::sqrt(tAODv0->Pt2V0())); //!
903 tFemtoV0->SetptV0(tAODv0->Pt());
904 tFemtoV0->SetptotV0(::sqrt(tAODv0->Ptot2V0()));
905 //tFemtoV0->SetptPos(::sqrt(tAODv0->MomPosX()*tAODv0->MomPosX()+tAODv0->MomPosY()*tAODv0->MomPosY()));
906 //tFemtoV0->SetptotPos(::sqrt(tAODv0->Ptot2Pos()));
907 //tFemtoV0->SetptNeg(::sqrt(tAODv0->MomNegX()*tAODv0->MomNegX()+tAODv0->MomNegY()*tAODv0->MomNegY()));
908 //tFemtoV0->SetptotNeg(::sqrt(tAODv0->Ptot2Neg()));
910 tFemtoV0->SetidNeg(tAODv0->GetNegID());
911 //cout<<"tAODv0->GetNegID(): "<<tAODv0->GetNegID()<<endl;
912 //cout<<"tFemtoV0->IdNeg(): "<<tFemtoV0->IdNeg()<<endl;
913 tFemtoV0->SetidPos(tAODv0->GetPosID());
915 tFemtoV0->SetEtaV0(tAODv0->Eta());
916 tFemtoV0->SetPhiV0(tAODv0->Phi());
917 tFemtoV0->SetCosPointingAngle(tAODv0->CosPointingAngle(fV1));
918 //tFemtoV0->SetYV0(tAODv0->Y());
920 //void SetdedxNeg(float x);
921 //void SeterrdedxNeg(float x);//Gael 04Fev2002
922 //void SetlendedxNeg(float x);//Gael 04Fev2002
923 //void SetdedxPos(float x);
924 //void SeterrdedxPos(float x);//Gael 04Fev2002
925 //void SetlendedxPos(float x);//Gael 04Fev2002
927 //tFemtoV0->SetEtaPos(tAODv0->PseudoRapPos());
928 //tFemtoV0->SetEtaNeg(tAODv0->PseudoRapNeg());
930 AliAODTrack *trackpos = (AliAODTrack*)tAODv0->GetDaughter(0);
931 AliAODTrack *trackneg = (AliAODTrack*)tAODv0->GetDaughter(1);
933 if(trackpos && trackneg)
935 tFemtoV0->SetEtaPos(trackpos->Eta());
936 tFemtoV0->SetEtaNeg(trackneg->Eta());
937 tFemtoV0->SetptotPos(tAODv0->PProng(0));
938 tFemtoV0->SetptotNeg(tAODv0->PProng(1));
939 tFemtoV0->SetptPos(trackpos->Pt());
940 tFemtoV0->SetptNeg(trackneg->Pt());
942 //tFemtoV0->SetEtaPos(trackpos->Eta()); //tAODv0->PseudoRapPos()
943 //tFemtoV0->SetEtaNeg(trackneg->Eta()); //tAODv0->PseudoRapNeg()
944 tFemtoV0->SetTPCNclsPos(trackpos->GetTPCNcls());
945 tFemtoV0->SetTPCNclsNeg(trackneg->GetTPCNcls());
946 tFemtoV0->SetTPCclustersPos(trackpos->GetTPCClusterMap());
947 tFemtoV0->SetTPCclustersNeg(trackneg->GetTPCClusterMap());
948 tFemtoV0->SetTPCsharingPos(trackpos->GetTPCSharedMap());
949 tFemtoV0->SetTPCsharingNeg(trackneg->GetTPCSharedMap());
950 tFemtoV0->SetNdofPos(trackpos->Chi2perNDF());
951 tFemtoV0->SetNdofNeg(trackneg->Chi2perNDF());
952 tFemtoV0->SetStatusPos(trackpos->GetStatus());
953 tFemtoV0->SetStatusNeg(trackneg->GetStatus());
955 tFemtoV0->SetPosNSigmaTPCK(fAODpidUtil->NumberOfSigmasTPC(trackpos,AliPID::kKaon));
956 tFemtoV0->SetNegNSigmaTPCK(fAODpidUtil->NumberOfSigmasTPC(trackneg,AliPID::kKaon));
957 tFemtoV0->SetPosNSigmaTPCP(fAODpidUtil->NumberOfSigmasTPC(trackpos,AliPID::kProton));
958 tFemtoV0->SetNegNSigmaTPCP(fAODpidUtil->NumberOfSigmasTPC(trackneg,AliPID::kProton));
959 tFemtoV0->SetPosNSigmaTPCPi(fAODpidUtil->NumberOfSigmasTPC(trackpos,AliPID::kPion));
960 tFemtoV0->SetNegNSigmaTPCPi(fAODpidUtil->NumberOfSigmasTPC(trackneg,AliPID::kPion));
963 float bfield = 5*fMagFieldSign;
964 float globalPositionsAtRadiiPos[9][3];
965 GetGlobalPositionAtGlobalRadiiThroughTPC(trackpos,bfield,globalPositionsAtRadiiPos);
966 double tpcEntrancePos[3]={globalPositionsAtRadiiPos[0][0],globalPositionsAtRadiiPos[0][1],globalPositionsAtRadiiPos[0][2]};
967 double tpcExitPos[3]={globalPositionsAtRadiiPos[8][0],globalPositionsAtRadiiPos[8][1],globalPositionsAtRadiiPos[8][2]};
969 float globalPositionsAtRadiiNeg[9][3];
970 GetGlobalPositionAtGlobalRadiiThroughTPC(trackneg,bfield,globalPositionsAtRadiiNeg);
971 double tpcEntranceNeg[3]={globalPositionsAtRadiiNeg[0][0],globalPositionsAtRadiiNeg[0][1],globalPositionsAtRadiiNeg[0][2]};
972 double tpcExitNeg[3]={globalPositionsAtRadiiNeg[8][0],globalPositionsAtRadiiNeg[8][1],globalPositionsAtRadiiNeg[8][2]};
974 AliFemtoThreeVector tmpVec;
975 tmpVec.SetX(tpcEntrancePos[0]); tmpVec.SetX(tpcEntrancePos[1]); tmpVec.SetX(tpcEntrancePos[2]);
976 tFemtoV0->SetNominalTpcEntrancePointPos(tmpVec);
978 tmpVec.SetX(tpcExitPos[0]); tmpVec.SetX(tpcExitPos[1]); tmpVec.SetX(tpcExitPos[2]);
979 tFemtoV0->SetNominalTpcExitPointPos(tmpVec);
981 tmpVec.SetX(tpcEntranceNeg[0]); tmpVec.SetX(tpcEntranceNeg[1]); tmpVec.SetX(tpcEntranceNeg[2]);
982 tFemtoV0->SetNominalTpcEntrancePointNeg(tmpVec);
984 tmpVec.SetX(tpcExitNeg[0]); tmpVec.SetX(tpcExitNeg[1]); tmpVec.SetX(tpcExitNeg[2]);
985 tFemtoV0->SetNominalTpcExitPointNeg(tmpVec);
987 AliFemtoThreeVector vecTpcPos[9];
988 AliFemtoThreeVector vecTpcNeg[9];
991 vecTpcPos[i].SetX(globalPositionsAtRadiiPos[i][0]); vecTpcPos[i].SetY(globalPositionsAtRadiiPos[i][1]); vecTpcPos[i].SetZ(globalPositionsAtRadiiPos[i][2]);
992 vecTpcNeg[i].SetX(globalPositionsAtRadiiNeg[i][0]); vecTpcNeg[i].SetY(globalPositionsAtRadiiNeg[i][1]); vecTpcNeg[i].SetZ(globalPositionsAtRadiiNeg[i][2]);
994 tFemtoV0->SetNominalTpcPointPos(vecTpcPos);
995 tFemtoV0->SetNominalTpcPointNeg(vecTpcNeg);
997 tFemtoV0->SetTPCMomentumPos(trackpos->GetTPCmomentum());
998 tFemtoV0->SetTPCMomentumNeg(trackneg->GetTPCmomentum());
1000 tFemtoV0->SetdedxPos(trackpos->GetTPCsignal());
1001 tFemtoV0->SetdedxNeg(trackneg->GetTPCsignal());
1003 if((tFemtoV0->StatusPos()&AliESDtrack::kTOFpid)==0 || (tFemtoV0->StatusPos()&AliESDtrack::kTIME)==0 || (tFemtoV0->StatusPos()&AliESDtrack::kTOFout)==0 )
1005 if((tFemtoV0->StatusNeg()&AliESDtrack::kTOFpid)==0 || (tFemtoV0->StatusNeg()&AliESDtrack::kTIME)==0 || (tFemtoV0->StatusNeg()&AliESDtrack::kTOFout)==0 )
1007 tFemtoV0->SetPosNSigmaTOFK(-1000);
1008 tFemtoV0->SetNegNSigmaTOFK(-1000);
1009 tFemtoV0->SetPosNSigmaTOFP(-1000);
1010 tFemtoV0->SetNegNSigmaTOFP(-1000);
1011 tFemtoV0->SetPosNSigmaTOFPi(-1000);
1012 tFemtoV0->SetNegNSigmaTOFPi(-1000);
1014 tFemtoV0->SetTOFProtonTimePos(-1000);
1015 tFemtoV0->SetTOFPionTimePos(-1000);
1016 tFemtoV0->SetTOFKaonTimePos(-1000);
1017 tFemtoV0->SetTOFProtonTimeNeg(-1000);
1018 tFemtoV0->SetTOFPionTimeNeg(-1000);
1019 tFemtoV0->SetTOFKaonTimeNeg(-1000);
1024 tFemtoV0->SetPosNSigmaTOFK(fAODpidUtil->NumberOfSigmasTOF(trackpos,AliPID::kKaon));
1025 tFemtoV0->SetNegNSigmaTOFK(fAODpidUtil->NumberOfSigmasTOF(trackneg,AliPID::kKaon));
1026 tFemtoV0->SetPosNSigmaTOFP(fAODpidUtil->NumberOfSigmasTOF(trackpos,AliPID::kProton));
1027 tFemtoV0->SetNegNSigmaTOFP(fAODpidUtil->NumberOfSigmasTOF(trackneg,AliPID::kProton));
1028 tFemtoV0->SetPosNSigmaTOFPi(fAODpidUtil->NumberOfSigmasTOF(trackpos,AliPID::kPion));
1029 tFemtoV0->SetNegNSigmaTOFPi(fAODpidUtil->NumberOfSigmasTOF(trackneg,AliPID::kPion));
1031 double TOFSignalPos = trackpos->GetTOFsignal();
1032 double TOFSignalNeg = trackneg->GetTOFsignal();
1035 trackpos->GetIntegratedTimes(pidPos);
1036 trackneg->GetIntegratedTimes(pidNeg);
1038 tFemtoV0->SetTOFPionTimePos(TOFSignalPos-pidPos[2]);
1039 tFemtoV0->SetTOFKaonTimePos(TOFSignalPos-pidPos[3]);
1040 tFemtoV0->SetTOFProtonTimePos(TOFSignalPos-pidPos[4]);
1041 tFemtoV0->SetTOFPionTimeNeg(TOFSignalNeg-pidNeg[2]);
1042 tFemtoV0->SetTOFKaonTimeNeg(TOFSignalNeg-pidNeg[3]);
1043 tFemtoV0->SetTOFProtonTimeNeg(TOFSignalNeg-pidNeg[4]);
1048 tFemtoV0->SetStatusPos(999);
1049 tFemtoV0->SetStatusNeg(999);
1051 tFemtoV0->SetOnFlyStatusV0(tAODv0->GetOnFlyStatus());
1054 void AliFemtoEventReaderAOD::SetFilterBit(UInt_t ibit)
1056 fFilterBit = (1 << (ibit));
1060 void AliFemtoEventReaderAOD::SetFilterMask(int ibit)
1065 void AliFemtoEventReaderAOD::SetReadMC(unsigned char a)
1071 void AliFemtoEventReaderAOD::SetReadV0(unsigned char a)
1076 void AliFemtoEventReaderAOD::SetUseMultiplicity(EstEventMult aType)
1078 fEstEventMult = aType;
1081 AliAODMCParticle* AliFemtoEventReaderAOD::GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel)
1083 if (aLabel < 0) return 0;
1084 AliAODMCParticle *aodP;
1086 if (aLabel > mcP->GetEntries())
1087 posstack = mcP->GetEntries();
1091 aodP = (AliAODMCParticle *) mcP->At(posstack);
1092 if (aodP->GetLabel() > posstack) {
1094 aodP = (AliAODMCParticle *) mcP->At(posstack);
1095 if (aodP->GetLabel() == aLabel) return aodP;
1098 while (posstack > 0);
1102 aodP = (AliAODMCParticle *) mcP->At(posstack);
1103 if (aodP->GetLabel() == aLabel) return aodP;
1106 while (posstack < mcP->GetEntries());
1112 void AliFemtoEventReaderAOD::CopyPIDtoFemtoTrack(AliAODTrack *tAodTrack,
1113 AliFemtoTrack *tFemtoTrack)
1116 // copying DCA information (taking it from global tracks gives better resolution than from TPC-only)
1119 double covimpact[3];
1121 if (!tAodTrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
1122 //cout << "sth went wrong with dca propagation" << endl;
1123 tFemtoTrack->SetImpactD(-1000.0);
1124 tFemtoTrack->SetImpactZ(-1000.0);
1128 tFemtoTrack->SetImpactD(impact[0]);
1129 tFemtoTrack->SetImpactZ(impact[1]);
1133 tAodTrack->GetPID(aodpid);
1134 tFemtoTrack->SetPidProbElectron(aodpid[0]);
1135 tFemtoTrack->SetPidProbMuon(aodpid[1]);
1136 tFemtoTrack->SetPidProbPion(aodpid[2]);
1137 tFemtoTrack->SetPidProbKaon(aodpid[3]);
1138 tFemtoTrack->SetPidProbProton(aodpid[4]);
1140 aodpid[0] = -100000.0;
1141 aodpid[1] = -100000.0;
1142 aodpid[2] = -100000.0;
1143 aodpid[3] = -100000.0;
1144 aodpid[4] = -100000.0;
1148 //what is that code? for what do we need it? nsigma values are not enough?
1149 if (tAodTrack->GetStatus() & AliESDtrack::kTOFpid) { //AliESDtrack::kTOFpid=0x8000
1150 tTOF = tAodTrack->GetTOFsignal();
1151 tAodTrack->GetIntegratedTimes(aodpid);
1153 tTOF -= fAODpidUtil->GetTOFResponse().GetStartTime(tAodTrack->P());
1156 tFemtoTrack->SetTofExpectedTimes(tTOF-aodpid[2], tTOF-aodpid[3], tTOF-aodpid[4]);
1158 ////// TPC ////////////////////////////////////////////
1160 float nsigmaTPCK=-1000.;
1161 float nsigmaTPCPi=-1000.;
1162 float nsigmaTPCP=-1000.;
1164 // cout<<"in reader fESDpid"<<fESDpid<<endl;
1166 if (tAodTrack->IsOn(AliESDtrack::kTPCpid)){ //AliESDtrack::kTPCpid=0x0080
1167 nsigmaTPCK = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kKaon);
1168 nsigmaTPCPi = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kPion);
1169 nsigmaTPCP = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kProton);
1172 tFemtoTrack->SetNSigmaTPCPi(nsigmaTPCPi);
1173 tFemtoTrack->SetNSigmaTPCK(nsigmaTPCK);
1174 tFemtoTrack->SetNSigmaTPCP(nsigmaTPCP);
1176 tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());
1177 tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());
1178 tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());
1180 tFemtoTrack->SetTPCsignalN(1);
1181 tFemtoTrack->SetTPCsignalS(1);
1182 tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
1184 ///////TOF//////////////////////
1187 float nsigmaTOFPi=-1000.;
1188 float nsigmaTOFK=-1000.;
1189 float nsigmaTOFP=-1000.;
1191 if ((tAodTrack->GetStatus() & AliESDtrack::kTOFpid) && //AliESDtrack::kTOFpid=0x8000
1192 (tAodTrack->GetStatus() & AliESDtrack::kTOFout) && //AliESDtrack::kTOFout=0x2000
1193 (tAodTrack->GetStatus() & AliESDtrack::kTIME) ) //AliESDtrack::kTIME=0x80000000
1195 if(tAodTrack->IsOn(AliESDtrack::kTOFpid)) //AliESDtrack::kTOFpid=0x8000
1198 nsigmaTOFPi = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kPion);
1199 nsigmaTOFK = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kKaon);
1200 nsigmaTOFP = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kProton);
1202 Double_t len=200;// esdtrack->GetIntegratedLength(); !!!!!
1203 Double_t tof=tAodTrack->GetTOFsignal();
1204 if(tof > 0.) vp=len/tof/0.03;
1207 tFemtoTrack->SetVTOF(vp);
1208 tFemtoTrack->SetNSigmaTOFPi(nsigmaTOFPi);
1209 tFemtoTrack->SetNSigmaTOFK(nsigmaTOFK);
1210 tFemtoTrack->SetNSigmaTOFP(nsigmaTOFP);
1213 //////////////////////////////////////
1217 void AliFemtoEventReaderAOD::SetCentralityPreSelection(double min, double max)
1219 fCentRange[0] = min; fCentRange[1] = max;
1221 fEstEventMult = kCentrality;
1224 void AliFemtoEventReaderAOD::SetNoCentrality(bool anocent)
1226 if(anocent==false) {fEstEventMult=kCentrality;}
1227 else {fEstEventMult=kReference; fUsePreCent = 0; }
1230 void AliFemtoEventReaderAOD::SetAODpidUtil(AliAODpidUtil *aAODpidUtil)
1232 fAODpidUtil = aAODpidUtil;
1233 // printf("fAODpidUtil: %x\n",fAODpidUtil);
1236 void AliFemtoEventReaderAOD::SetAODheader(AliAODHeader *aAODheader)
1238 fAODheader = aAODheader;
1242 void AliFemtoEventReaderAOD::SetMagneticFieldSign(int s)
1252 void AliFemtoEventReaderAOD::SetEPVZERO(Bool_t iepvz)
1257 void AliFemtoEventReaderAOD::GetGlobalPositionAtGlobalRadiiThroughTPC(AliAODTrack *track, Float_t bfield, Float_t globalPositionsAtRadii[9][3])
1259 // Gets the global position of the track at nine different radii in the TPC
1260 // track is the track you want to propagate
1261 // bfield is the magnetic field of your event
1262 // globalPositionsAtRadii is the array of global positions in the radii and xyz
1264 // Initialize the array to something indicating there was no propagation
1265 for(Int_t i=0;i<9;i++){
1266 for(Int_t j=0;j<3;j++){
1267 globalPositionsAtRadii[i][j]=-9999.;
1271 // Make a copy of the track to not change parameters of the track
1272 AliExternalTrackParam etp; etp.CopyFromVTrack(track);
1273 //printf("\nAfter CopyFromVTrack\n");
1276 // The global position of the the track
1277 Double_t xyz[3]={-9999.,-9999.,-9999.};
1279 // Counter for which radius we want
1281 // The radii at which we get the global positions
1282 // IROC (OROC) from 84.1 cm to 132.1 cm (134.6 cm to 246.6 cm)
1283 Float_t Rwanted[9]={85.,105.,125.,145.,165.,185.,205.,225.,245.};
1284 // The global radius we are at
1285 Float_t globalRadius=0;
1287 // Propagation is done in local x of the track
1288 for (Float_t x = etp.GetX();x<247.;x+=1.){ // GetX returns local coordinates
1289 // Starts at the tracks fX and goes outwards. x = 245 is the outer radial limit
1290 // of the TPC when the track is straight, i.e. has inifinite pt and doesn't get bent.
1291 // If the track's momentum is smaller than infinite, it will develop a y-component, which
1292 // adds to the global radius
1294 // Stop if the propagation was not succesful. This can happen for low pt tracks
1295 // that don't reach outer radii
1296 if(!etp.PropagateTo(x,bfield))break;
1297 etp.GetXYZ(xyz); // GetXYZ returns global coordinates
1298 globalRadius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]); //Idea to speed up: compare squared radii
1300 // Roughly reached the radius we want
1301 if(globalRadius > Rwanted[iR]){
1303 // Bigger loop has bad precision, we're nearly one centimeter too far, go back in small steps.
1304 while (globalRadius>Rwanted[iR]){
1306 // printf("propagating to x %5.2f\n",x);
1307 if(!etp.PropagateTo(x,bfield))break;
1308 etp.GetXYZ(xyz); // GetXYZ returns global coordinates
1309 globalRadius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]); //Idea to speed up: compare squared radii
1311 //printf("At Radius:%05.2f (local x %5.2f). Setting position to x %4.1f y %4.1f z %4.1f\n",globalRadius,x,xyz[0],xyz[1],xyz[2]);
1312 globalPositionsAtRadii[iR][0]=xyz[0];
1313 globalPositionsAtRadii[iR][1]=xyz[1];
1314 globalPositionsAtRadii[iR][2]=xyz[2];
1315 // Indicate we want the next radius