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():
51 // fPWG2AODTracks(0x0),
55 fEstEventMult(kCentrality),
65 // default constructor
66 fAllTrue.ResetAllBits(kTRUE);
67 fAllFalse.ResetAllBits(kFALSE);
72 AliFemtoEventReaderAOD::AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aReader) :
73 AliFemtoEventReader(),
80 // fPWG2AODTracks(0x0),
84 fEstEventMult(kCentrality),
95 fReadMC = aReader.fReadMC;
96 fReadV0 = aReader.fReadV0;
97 fInputFile = aReader.fInputFile;
98 fFileName = aReader.fFileName;
99 fNumberofEvent = aReader.fNumberofEvent;
100 fCurEvent = aReader.fCurEvent;
101 fEvent = new AliAODEvent();
102 fAodFile = new TFile(aReader.fAodFile->GetName());
103 fAllTrue.ResetAllBits(kTRUE);
104 fAllFalse.ResetAllBits(kFALSE);
105 fFilterBit = aReader.fFilterBit;
106 // fPWG2AODTracks = aReader.fPWG2AODTracks;
107 fAODpidUtil = aReader.fAODpidUtil;
108 fAODheader = aReader.fAODheader;
109 fCentRange[0] = aReader.fCentRange[0];
110 fCentRange[1] = aReader.fCentRange[1];
111 fEstEventMult = aReader.fEstEventMult;
112 fUsePreCent = aReader.fUsePreCent;
116 AliFemtoEventReaderAOD::~AliFemtoEventReaderAOD()
122 // if (fPWG2AODTracks) {
123 // fPWG2AODTracks->Delete();
124 // delete fPWG2AODTracks;
129 AliFemtoEventReaderAOD& AliFemtoEventReaderAOD::operator=(const AliFemtoEventReaderAOD& aReader)
131 // assignment operator
132 if (this == &aReader)
135 fInputFile = aReader.fInputFile;
136 fFileName = aReader.fFileName;
137 fNumberofEvent = aReader.fNumberofEvent;
138 fCurEvent = aReader.fCurEvent;
139 if (fTree) delete fTree;
140 if (fEvent) delete fEvent;
141 fEvent = new AliAODEvent();
142 if (fAodFile) delete fAodFile;
143 fAodFile = new TFile(aReader.fAodFile->GetName());
144 fAllTrue.ResetAllBits(kTRUE);
145 fAllFalse.ResetAllBits(kFALSE);
146 fFilterBit = aReader.fFilterBit;
147 // fPWG2AODTracks = aReader.fPWG2AODTracks;
148 fAODpidUtil = aReader.fAODpidUtil;
149 fAODheader = aReader.fAODheader;
150 fCentRange[0] = aReader.fCentRange[0];
151 fCentRange[1] = aReader.fCentRange[1];
152 fUsePreCent = aReader.fUsePreCent;
153 fEstEventMult = aReader.fEstEventMult;
158 AliFemtoString AliFemtoEventReaderAOD::Report()
160 // create reader report
161 AliFemtoString temp = "\n This is the AliFemtoEventReaderAOD\n";
166 void AliFemtoEventReaderAOD::SetInputFile(const char* inputFile)
168 //setting the name of file where names of AOD file are written
169 //it takes only this files which have good trees
171 fInputFile=string(inputFile);
172 ifstream infile(inputFile);
174 fTree = new TChain("aodTree");
176 if(infile.good()==true)
178 //checking if all give files have good tree inside
179 while (infile.eof()==false)
181 infile.getline(buffer,256);
182 TFile *aodFile=TFile::Open(buffer,"READ");
185 TTree* tree = (TTree*) aodFile->Get("aodTree");
188 // cout<<"putting file "<<string(buffer)<<" into analysis"<<endl;
189 fTree->AddFile(buffer);
199 AliFemtoEvent* AliFemtoEventReaderAOD::ReturnHbtEvent()
201 // read in a next hbt event from the chain
202 // convert it to AliFemtoEvent and return
203 // for further analysis
204 AliFemtoEvent *hbtEvent = 0;
205 // cout<<"reader"<<endl;
206 if (fCurEvent==fNumberofEvent)//open next file
208 if(fNumberofEvent==0)
210 fEvent=new AliAODEvent();
211 fEvent->ReadFromTree(fTree);
213 // Check for the existence of the additional information
214 // fPWG2AODTracks = (TClonesArray *) fEvent->GetList()->FindObject("pwg2aodtracks");
216 // if (fPWG2AODTracks) {
217 // cout << "Found additional PWG2 specific information in the AOD!" << endl;
218 // cout << "Reading only tracks with the additional information" << endl;
221 fNumberofEvent=fTree->GetEntries();
222 // cout<<"Number of Entries in file "<<fNumberofEvent<<endl;
225 else //no more data to read
227 // cout<<"no more files "<<hbtEvent<<endl;
233 // cout<<"starting to read event "<<fCurEvent<<endl;
234 fTree->GetEvent(fCurEvent);//getting next event
235 // cout << "Read event " << fEvent << " from file " << fTree << endl;
237 hbtEvent = new AliFemtoEvent;
239 CopyAODtoFemtoEvent(hbtEvent);
246 void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
249 // A function that reads in the AOD event
250 // and transfers the neccessary information into
251 // the internal AliFemtoEvent
253 // setting global event characteristics
254 tEvent->SetRunNumber(fEvent->GetRunNumber());
255 tEvent->SetMagneticField(fEvent->GetMagneticField()*kilogauss);//to check if here is ok
256 tEvent->SetZDCN1Energy(fEvent->GetZDCN1Energy());
257 tEvent->SetZDCP1Energy(fEvent->GetZDCP1Energy());
258 tEvent->SetZDCN2Energy(fEvent->GetZDCN2Energy());
259 tEvent->SetZDCP2Energy(fEvent->GetZDCP2Energy());
260 tEvent->SetZDCEMEnergy(fEvent->GetZDCEMEnergy(0));
261 tEvent->SetZDCParticipants(0);
262 tEvent->SetTriggerMask(fEvent->GetTriggerMask());
263 tEvent->SetTriggerCluster(fEvent->GetTriggerCluster());
265 // Attempt to access MC header
269 mcH = (AliAODMCHeader *) fEvent->FindListObject(AliAODMCHeader::StdBranchName());
271 cout << "AOD MC information requested, but no header found!" << endl;
274 mcP = (TClonesArray *) fEvent->FindListObject(AliAODMCParticle::StdBranchName());
276 cout << "AOD MC information requested, but no particle array found!" << endl;
280 tEvent->SetReactionPlaneAngle(fEvent->GetHeader()->GetQTheta(0)/2.0);
284 motherids = new Int_t[((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel()];
285 for (int ip=0; ip<mcP->GetEntries(); ip++) motherids[ip] = 0;
287 // Read in mother ids
288 AliAODMCParticle *motherpart;
289 for (int ip=0; ip<mcP->GetEntries(); ip++) {
290 motherpart = (AliAODMCParticle *) mcP->At(ip);
291 if (motherpart->GetDaughter(0) > 0)
292 motherids[motherpart->GetDaughter(0)] = ip;
293 if (motherpart->GetDaughter(1) > 0)
294 motherids[motherpart->GetDaughter(1)] = ip;
298 // Primary Vertex position
300 fEvent->GetPrimaryVertex()->GetPosition(fV1);
302 AliFmThreeVectorF vertex(fV1[0],fV1[1],fV1[2]);
303 tEvent->SetPrimVertPos(vertex);
305 //starting to reading tracks
306 int nofTracks=0; //number of reconstructed tracks in event
308 // Check to see whether the additional info exists
309 // if (fPWG2AODTracks)
310 // nofTracks=fPWG2AODTracks->GetEntries();
312 nofTracks=fEvent->GetNumberOfTracks();
314 AliEventplane *ep = fEvent->GetEventplane();
318 tEvent->SetReactionPlaneAngle(ep->GetEventplane("V0",fEvent,2));
320 tEvent->SetReactionPlaneAngle(ep->GetEventplane("Q"));
323 AliCentrality *cent = fEvent->GetCentrality();
325 if (!fEstEventMult && cent && fUsePreCent) {
326 if ((cent->GetCentralityPercentile("V0M")*10 < fCentRange[0]) ||
327 (cent->GetCentralityPercentile("V0M")*10 > fCentRange[1]))
329 // cout << "Centrality " << cent->GetCentralityPercentile("V0M") << " outside of preselection range " << fCentRange[0] << " - " << fCentRange[1] << endl;
335 int realnofTracks=0; // number of track which we use in a analysis
339 for (int il=0; il<20000; il++) labels[il] = -1;
341 // looking for global tracks and saving their numbers to copy from them PID information to TPC-only tracks in the main loop over tracks
342 for (int i=0;i<nofTracks;i++) {
343 const AliAODTrack *aodtrack=fEvent->GetTrack(i);
344 if (!aodtrack->TestFilterBit(fFilterBit)) {
345 if(aodtrack->GetID() < 0) continue;
346 labels[aodtrack->GetID()] = i;
351 for (int i=0;i<nofTracks;i++)
353 AliFemtoTrack* trackCopy = new AliFemtoTrack();
355 // if (fPWG2AODTracks) {
356 // // Read tracks from the additional pwg2 specific AOD part
358 // // Note that in that case all the AOD tracks without the
359 // // additional information will be ignored !
360 // AliPWG2AODTrack *pwg2aodtrack = (AliPWG2AODTrack *) fPWG2AODTracks->At(i);
362 // // Getting the AOD track through the ref of the additional info
363 // AliAODTrack *aodtrack = pwg2aodtrack->GetRefAODTrack();
364 // if (!aodtrack->TestFilterBit(fFilterBit)) {
370 // if (aodtrack->IsOn(AliESDtrack::kTPCrefit))
371 // if (aodtrack->Chi2perNDF() < 6.0)
372 // if (aodtrack->Eta() < 0.9)
376 // CopyAODtoFemtoTrack(aodtrack, trackCopy, pwg2aodtrack);
379 // // Fill the hidden information with the simulated data
380 // // Int_t pLabel = aodtrack->GetLabel();
381 // AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
383 // // Check the mother information
385 // // Using the new way of storing the freeze-out information
386 // // Final state particle is stored twice on the stack
387 // // one copy (mother) is stored with original freeze-out information
388 // // and is not tracked
389 // // the other one (daughter) is stored with primary vertex position
392 // // Freeze-out coordinates
393 // double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
394 // fpx = tPart->Xv() - fV1[0];
395 // fpy = tPart->Yv() - fV1[1];
396 // fpz = tPart->Zv() - fV1[2];
399 // AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
400 // tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
407 // // cout << "Looking for mother ids " << endl;
408 // if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
409 // // cout << "Got mother id" << endl;
410 // AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
411 // // Check if this is the same particle stored twice on the stack
412 // if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
413 // // It is the same particle
414 // // Read in the original freeze-out information
415 // // and convert it from to [fm]
418 // // fpx = mother->Xv()*1e13*0.197327;
419 // // fpy = mother->Yv()*1e13*0.197327;
420 // // fpz = mother->Zv()*1e13*0.197327;
421 // // fpt = mother->T() *1e13*0.197327*0.5;
424 // // Therminator style
425 // fpx = mother->Xv()*1e13;
426 // fpy = mother->Yv()*1e13;
427 // fpz = mother->Zv()*1e13;
428 // fpt = mother->T() *1e13*3e10;
433 // // if (fRotateToEventPlane) {
434 // // double tPhi = TMath::ATan2(fpy, fpx);
435 // // double tRad = TMath::Hypot(fpx, fpy);
437 // // fpx = tRad*TMath::Cos(tPhi - tReactionPlane);
438 // // fpy = tRad*TMath::Sin(tPhi - tReactionPlane);
441 // tInfo->SetPDGPid(tPart->GetPdgCode());
443 // // if (fRotateToEventPlane) {
444 // // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px());
445 // // double tRad = TMath::Hypot(tPart->Px(), tPart->Py());
447 // // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane),
448 // // tRad*TMath::Sin(tPhi - tReactionPlane),
452 // tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz());
453 // Double_t mass2 = (tPart->E() *tPart->E() -
454 // tPart->Px()*tPart->Px() -
455 // tPart->Py()*tPart->Py() -
456 // tPart->Pz()*tPart->Pz());
458 // tInfo->SetMass(TMath::Sqrt(mass2));
460 // tInfo->SetMass(0.0);
462 // tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt);
463 // trackCopy->SetHiddenInfo(tInfo);
468 // aodtrack->PxPyPz(pxyz);//reading noconstarined momentum
469 // const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
470 // // Check the sanity of the tracks - reject zero momentum tracks
471 // if (ktP.Mag() == 0) {
477 // No additional information exists
478 // Read in the normal AliAODTracks
480 // const AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
481 AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
485 if (aodtrack->IsPrimaryCandidate()) tracksPrim++;
487 if (!aodtrack->TestFilterBit(fFilterBit)) {
492 //counting particles to set multiplicity
495 if (aodtrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
496 if(impact[0]<0.2 && TMath::Abs(impact[1]+fV1[2])<2.0)
497 //if (aodtrack->IsPrimaryCandidate()) //? instead of kinks?
498 if (aodtrack->Chi2perNDF() < 4.0)
499 if (aodtrack->Pt() > 0.15 && aodtrack->Pt() < 20)
500 if (aodtrack->GetTPCNcls() > 70)
501 if (aodtrack->Eta() < 0.8)
505 CopyAODtoFemtoTrack(aodtrack, trackCopy);
507 // copying PID information from the correspondent track
508 // const AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
511 AliAODTrack *aodtrackpid;
512 if(fFilterBit == (1 << (7))) //for TPC Only tracks we have to copy PID information from corresponding global tracks
513 aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
515 aodtrackpid = fEvent->GetTrack(i);
516 CopyPIDtoFemtoTrack(aodtrackpid, trackCopy);
519 // Fill the hidden information with the simulated data
520 // Int_t pLabel = aodtrack->GetLabel();
521 AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
523 AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
524 double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
529 tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
531 tInfo->SetTrueMomentum(0.0, 0.0, 0.0);
532 tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0);
536 // Check the mother information
538 // Using the new way of storing the freeze-out information
539 // Final state particle is stored twice on the stack
540 // one copy (mother) is stored with original freeze-out information
541 // and is not tracked
542 // the other one (daughter) is stored with primary vertex position
545 // Freeze-out coordinates
546 fpx = tPart->Xv() - fV1[0];
547 fpy = tPart->Yv() - fV1[1];
548 fpz = tPart->Zv() - fV1[2];
551 tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
558 // cout << "Looking for mother ids " << endl;
559 if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
560 // cout << "Got mother id" << endl;
561 AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
562 // Check if this is the same particle stored twice on the stack
564 if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
565 // It is the same particle
566 // Read in the original freeze-out information
567 // and convert it from to [fm]
570 // fpx = mother->Xv()*1e13*0.197327;
571 // fpy = mother->Yv()*1e13*0.197327;
572 // fpz = mother->Zv()*1e13*0.197327;
573 // fpt = mother->T() *1e13*0.197327*0.5;
577 fpx = mother->Xv()*1e13;
578 fpy = mother->Yv()*1e13;
579 fpz = mother->Zv()*1e13;
580 // fpt = mother->T() *1e13*3e10;
586 // if (fRotateToEventPlane) {
587 // double tPhi = TMath::ATan2(fpy, fpx);
588 // double tRad = TMath::Hypot(fpx, fpy);
590 // fpx = tRad*TMath::Cos(tPhi - tReactionPlane);
591 // fpy = tRad*TMath::Sin(tPhi - tReactionPlane);
594 tInfo->SetPDGPid(tPart->GetPdgCode());
596 // if (fRotateToEventPlane) {
597 // double tPhi = TMath::ATan2(tPart->Py(), tPart->Px());
598 // double tRad = TMath::Hypot(tPart->Px(), tPart->Py());
600 // tInfo->SetTrueMomentum(tRad*TMath::Cos(tPhi - tReactionPlane),
601 // tRad*TMath::Sin(tPhi - tReactionPlane),
605 tInfo->SetTrueMomentum(tPart->Px(), tPart->Py(), tPart->Pz());
606 Double_t mass2 = (tPart->E() *tPart->E() -
607 tPart->Px()*tPart->Px() -
608 tPart->Py()*tPart->Py() -
609 tPart->Pz()*tPart->Pz());
611 tInfo->SetMass(TMath::Sqrt(mass2));
615 tInfo->SetEmissionPoint(fpx, fpy, fpz, fpt);
617 trackCopy->SetHiddenInfo(tInfo);
622 //AliExternalTrackParam *param = new AliExternalTrackParam(*aodtrack->GetInnerParam());
623 trackCopy->SetInnerMomentum(aodtrack->GetTPCmomentum());
625 aodtrack->PxPyPz(pxyz);//reading noconstarined momentum
626 const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
627 // Check the sanity of the tracks - reject zero momentum tracks
628 if (ktP.Mag() == 0) {
635 tEvent->TrackCollection()->push_back(trackCopy);//adding track to analysis
636 realnofTracks++;//real number of tracks
639 tEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event
640 tEvent->SetNormalizedMult(tracksPrim);
642 if (fEstEventMult==kCentrality) {
643 // AliCentrality *cent = fEvent->GetCentrality();
644 //cout<<"AliFemtoEventReaderAOD:"<<lrint(10*cent->GetCentralityPercentile("V0M"))<<endl;
645 if (cent) tEvent->SetNormalizedMult(lrint(10*cent->GetCentralityPercentile("V0M")));
646 // if (cent) tEvent->SetNormalizedMult((int) cent->GetCentralityPercentile("V0M"));
649 tEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M"));
650 // tEvent->SetCentralityFMD(cent->GetCentralityPercentile("FMD"));
651 tEvent->SetCentralitySPD1(cent->GetCentralityPercentile("CL1"));
652 // tEvent->SetCentralityTrk(cent->GetCentralityPercentile("TRK"));
655 else if(fEstEventMult==kGlobalCount){
656 tEvent->SetNormalizedMult(tNormMult); //particles counted in the loop, trying to reproduce GetReferenceMultiplicity. If better (default) method appears it should be changed
658 else if(fEstEventMult==kReference)
660 tEvent->SetNormalizedMult(fAODheader->GetRefMultiplicity());
662 else if(fEstEventMult==kTPCOnlyRef)
664 tEvent->SetNormalizedMult(fAODheader->GetTPConlyRefMultiplicity());
666 else if(fEstEventMult == kVZERO)
669 for (Int_t i=0; i<64; i++)
670 multV0 += fEvent->GetVZEROData()->GetMultiplicity(i);
671 tEvent->SetNormalizedMult(multV0);
674 if (mcP) delete [] motherids;
676 // cout<<"end of reading nt "<<nofTracks<<" real number "<<realnofTracks<<endl;
681 for (Int_t i = 0; i < fEvent->GetNumberOfV0s(); i++) {
682 AliAODv0* aodv0 = fEvent->GetV0(i);
683 if (!aodv0) continue;
684 if(aodv0->GetNDaughters()>2) continue;
685 if(aodv0->GetNProngs()>2) continue;
686 if(aodv0->GetCharge()!=0) continue;
687 if(aodv0->ChargeProng(0)==aodv0->ChargeProng(1)) continue;
688 if(aodv0->CosPointingAngle(fV1)<0.998) continue;
689 AliFemtoV0* trackCopyV0 = new AliFemtoV0();
691 CopyAODtoFemtoV0(aodv0, trackCopyV0);
692 tEvent->V0Collection()->push_back(trackCopyV0);
693 //cout<<"Pushback v0 to v0collection"<<endl;
699 void AliFemtoEventReaderAOD::CopyAODtoFemtoTrack(AliAODTrack *tAodTrack,
700 AliFemtoTrack *tFemtoTrack
701 // AliPWG2AODTrack *tPWG2AODTrack
704 // Copy the track information from the AOD into the internal AliFemtoTrack
705 // If it exists, use the additional information from the PWG2 AOD
707 // Primary Vertex position
709 fEvent->GetPrimaryVertex()->GetPosition(fV1);
710 // fEvent->GetPrimaryVertex()->GetXYZ(fV1);
712 tFemtoTrack->SetCharge(tAodTrack->Charge());
715 tAodTrack->PxPyPz(pxyz);//reading noconstrained momentum
716 AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]);
717 tFemtoTrack->SetP(v);//setting momentum
718 tFemtoTrack->SetPt(sqrt(pxyz[0]*pxyz[0]+pxyz[1]*pxyz[1]));
719 const AliFmThreeVectorD kOrigin(fV1[0],fV1[1],fV1[2]);
720 //setting track helix
721 const AliFmThreeVectorD ktP(pxyz[0],pxyz[1],pxyz[2]);
722 AliFmPhysicalHelixD helix(ktP,kOrigin,(double)(fEvent->GetMagneticField())*kilogauss,(double)(tFemtoTrack->Charge()));
723 tFemtoTrack->SetHelix(helix);
726 tFemtoTrack->SetTrackId(tAodTrack->GetID());
727 tFemtoTrack->SetFlags(tAodTrack->GetFlags());
728 tFemtoTrack->SetLabel(tAodTrack->GetLabel());
730 // Track quality information
732 tAodTrack->GetCovMatrix(covmat);
734 // ! DCA information is done in CopyPIDtoFemtoTrack()
737 // double covimpact[3];
739 // if (!tAodTrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
740 // //cout << "sth went wrong with dca propagation" << endl;
741 // tFemtoTrack->SetImpactD(-1000.0);
742 // tFemtoTrack->SetImpactZ(-1000.0);
746 // tFemtoTrack->SetImpactD(impact[0]);
747 // tFemtoTrack->SetImpactZ(impact[1]+fV1[2]);
750 // if (TMath::Abs(tAodTrack->Xv()) > 0.00000000001)
751 // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv())*(tAodTrack->Xv()/TMath::Abs(tAodTrack->Xv())));
753 // tFemtoTrack->SetImpactD(0.0);
754 // tFemtoTrack->SetImpactD(tAodTrack->DCA());
756 // tFemtoTrack->SetImpactZ(tAodTrack->ZAtDCA());
759 // tFemtoTrack->SetImpactD(TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1]));
760 // tFemtoTrack->SetImpactZ(tAodTrack->Zv() - fV1[2]);
764 // << "dca" << TMath::Hypot(tAodTrack->Xv() - fV1[0], tAodTrack->Yv() - fV1[1])
765 // << "xv - fv10 = "<< tAodTrack->Xv() - fV1[0]
766 // << tAodTrack->Yv() - fV1[1]
767 // << "xv = " << tAodTrack->Xv() << endl
768 // << "fv1[0] = " << fV1[0] << endl
769 // << "yv = " << tAodTrack->Yv() << endl
770 // << "fv1[1] = " << fV1[1] << endl
771 // << "zv = " << tAodTrack->Zv() << endl
772 // << "fv1[2] = " << fV1[2] << endl
773 // << "impact[0] = " << impact[0] << endl
774 // << "impact[1] = " << impact[1] << endl
777 tFemtoTrack->SetCdd(covmat[0]);
778 tFemtoTrack->SetCdz(covmat[1]);
779 tFemtoTrack->SetCzz(covmat[2]);
780 tFemtoTrack->SetITSchi2(tAodTrack->Chi2perNDF());
781 tFemtoTrack->SetITSncls(tAodTrack->GetITSNcls());
782 tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());
783 tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());
784 tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());
785 tFemtoTrack->SetTPCsignalN(1);
786 tFemtoTrack->SetTPCsignalS(1);
787 tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
789 // if (tPWG2AODTrack) {
790 // // Copy the PWG2 specific information if it exists
791 // tFemtoTrack->SetTPCClusterMap(tPWG2AODTrack->GetTPCClusterMap());
792 // tFemtoTrack->SetTPCSharedMap(tPWG2AODTrack->GetTPCSharedMap());
794 // double xtpc[3] = {0,0,0};
795 // tPWG2AODTrack->GetTPCNominalEntrancePoint(xtpc);
796 // tFemtoTrack->SetNominalTPCEntrancePoint(xtpc);
797 // tPWG2AODTrack->GetTPCNominalExitPoint(xtpc);
798 // tFemtoTrack->SetNominalTPCExitPoint(xtpc);
801 // If not use dummy values
802 tFemtoTrack->SetTPCClusterMap(tAodTrack->GetTPCClusterMap());
803 tFemtoTrack->SetTPCSharedMap(tAodTrack->GetTPCSharedMap());
806 float globalPositionsAtRadii[9][3];
807 float bfield = 5*fMagFieldSign;
808 GetGlobalPositionAtGlobalRadiiThroughTPC(tAodTrack,bfield,globalPositionsAtRadii);
809 double tpcEntrance[3]={globalPositionsAtRadii[0][0],globalPositionsAtRadii[0][1],globalPositionsAtRadii[0][2]};
810 double **tpcPositions;
811 tpcPositions = new double*[9];
813 tpcPositions[i] = new double[3];
814 double tpcExit[3]={globalPositionsAtRadii[8][0],globalPositionsAtRadii[8][1],globalPositionsAtRadii[8][2]};
817 tpcPositions[i][0] = globalPositionsAtRadii[i][0];
818 tpcPositions[i][1] = globalPositionsAtRadii[i][1];
819 tpcPositions[i][2] = globalPositionsAtRadii[i][2];
821 tFemtoTrack->SetNominalTPCEntrancePoint(tpcEntrance);
822 tFemtoTrack->SetNominalTPCPoints(tpcPositions);
823 tFemtoTrack->SetNominalTPCExitPoint(tpcExit);
827 // // cout << "Track has " << TMath::Hypot(tAodTrack->Xv(), tAodTrack->Yv()) << " " << tAodTrack->Zv() << " " << tAodTrack->GetTPCNcls() << endl;
831 for (int ik=0; ik<3; ik++) {
834 tFemtoTrack->SetKinkIndexes(indexes);
837 for (int ii=0; ii<6; ii++){
838 tFemtoTrack->SetITSHitOnLayer(ii,tAodTrack->HasPointOnITSLayer(ii));
844 void AliFemtoEventReaderAOD::CopyAODtoFemtoV0(AliAODv0 *tAODv0, AliFemtoV0 *tFemtoV0)
846 tFemtoV0->SetdecayLengthV0(tAODv0->DecayLength(fV1));
847 tFemtoV0->SetdecayVertexV0X(tAODv0->DecayVertexV0X());
848 tFemtoV0->SetdecayVertexV0Y(tAODv0->DecayVertexV0Y());
849 tFemtoV0->SetdecayVertexV0Z(tAODv0->DecayVertexV0Z());
850 AliFemtoThreeVector decayvertex(tAODv0->DecayVertexV0X(),tAODv0->DecayVertexV0Y(),tAODv0->DecayVertexV0Z());
851 tFemtoV0->SetdecayVertexV0(decayvertex);
852 tFemtoV0->SetdcaV0Daughters(tAODv0->DcaV0Daughters());
853 tFemtoV0->SetdcaV0ToPrimVertex(tAODv0->DcaV0ToPrimVertex());
854 tFemtoV0->SetdcaPosToPrimVertex(tAODv0->DcaPosToPrimVertex());
855 tFemtoV0->SetdcaNegToPrimVertex(tAODv0->DcaNegToPrimVertex());
856 tFemtoV0->SetmomPosX(tAODv0->MomPosX());
857 tFemtoV0->SetmomPosY(tAODv0->MomPosY());
858 tFemtoV0->SetmomPosZ(tAODv0->MomPosZ());
859 AliFemtoThreeVector mompos(tAODv0->MomPosX(),tAODv0->MomPosY(),tAODv0->MomPosZ());
860 tFemtoV0->SetmomPos(mompos);
861 tFemtoV0->SetmomNegX(tAODv0->MomNegX());
862 tFemtoV0->SetmomNegY(tAODv0->MomNegY());
863 tFemtoV0->SetmomNegZ(tAODv0->MomNegZ());
864 AliFemtoThreeVector momneg(tAODv0->MomNegX(),tAODv0->MomNegY(),tAODv0->MomNegZ());
865 tFemtoV0->SetmomNeg(momneg);
867 //jest cos takiego w AliFemtoV0.h czego nie ma w AliAODv0.h
868 //void SettpcHitsPos(const int& i);
869 //void SettpcHitsNeg(const int& i);
871 //void SetTrackTopologyMapPos(unsigned int word, const unsigned long& m);
872 //void SetTrackTopologyMapNeg(unsigned int word, const unsigned long& m);
874 tFemtoV0->SetmomV0X(tAODv0->MomV0X());
875 tFemtoV0->SetmomV0Y(tAODv0->MomV0Y());
876 tFemtoV0->SetmomV0Z(tAODv0->MomV0Z());
877 AliFemtoThreeVector momv0(tAODv0->MomV0X(),tAODv0->MomV0Y(),tAODv0->MomV0Z());
878 tFemtoV0->SetmomV0(momv0);
879 tFemtoV0->SetalphaV0(tAODv0->AlphaV0());
880 tFemtoV0->SetptArmV0(tAODv0->PtArmV0());
881 tFemtoV0->SeteLambda(tAODv0->ELambda());
882 tFemtoV0->SeteK0Short(tAODv0->EK0Short());
883 tFemtoV0->SetePosProton(tAODv0->EPosProton());
884 tFemtoV0->SeteNegProton(tAODv0->ENegProton());
885 tFemtoV0->SetmassLambda(tAODv0->MassLambda());
886 tFemtoV0->SetmassAntiLambda(tAODv0->MassAntiLambda());
887 tFemtoV0->SetmassK0Short(tAODv0->MassK0Short());
888 tFemtoV0->SetrapLambda(tAODv0->RapLambda());
889 tFemtoV0->SetrapK0Short(tAODv0->RapK0Short());
891 //void SetcTauLambda( float x);
892 //void SetcTauK0Short( float x);
894 //tFemtoV0->SetptV0(::sqrt(tAODv0->Pt2V0())); //!
895 tFemtoV0->SetptV0(tAODv0->Pt());
896 tFemtoV0->SetptotV0(::sqrt(tAODv0->Ptot2V0()));
897 //tFemtoV0->SetptPos(::sqrt(tAODv0->MomPosX()*tAODv0->MomPosX()+tAODv0->MomPosY()*tAODv0->MomPosY()));
898 //tFemtoV0->SetptotPos(::sqrt(tAODv0->Ptot2Pos()));
899 //tFemtoV0->SetptNeg(::sqrt(tAODv0->MomNegX()*tAODv0->MomNegX()+tAODv0->MomNegY()*tAODv0->MomNegY()));
900 //tFemtoV0->SetptotNeg(::sqrt(tAODv0->Ptot2Neg()));
902 tFemtoV0->SetidNeg(tAODv0->GetNegID());
903 //cout<<"tAODv0->GetNegID(): "<<tAODv0->GetNegID()<<endl;
904 //cout<<"tFemtoV0->IdNeg(): "<<tFemtoV0->IdNeg()<<endl;
905 tFemtoV0->SetidPos(tAODv0->GetPosID());
907 tFemtoV0->SetEtaV0(tAODv0->Eta());
908 tFemtoV0->SetPhiV0(tAODv0->Phi());
909 tFemtoV0->SetCosPointingAngle(tAODv0->CosPointingAngle(fV1));
910 //tFemtoV0->SetYV0(tAODv0->Y());
912 //void SetdedxNeg(float x);
913 //void SeterrdedxNeg(float x);//Gael 04Fev2002
914 //void SetlendedxNeg(float x);//Gael 04Fev2002
915 //void SetdedxPos(float x);
916 //void SeterrdedxPos(float x);//Gael 04Fev2002
917 //void SetlendedxPos(float x);//Gael 04Fev2002
919 //tFemtoV0->SetEtaPos(tAODv0->PseudoRapPos());
920 //tFemtoV0->SetEtaNeg(tAODv0->PseudoRapNeg());
922 AliAODTrack *trackpos = (AliAODTrack*)tAODv0->GetDaughter(0);
923 AliAODTrack *trackneg = (AliAODTrack*)tAODv0->GetDaughter(1);
925 if(trackpos && trackneg)
927 tFemtoV0->SetEtaPos(trackpos->Eta());
928 tFemtoV0->SetEtaNeg(trackneg->Eta());
929 tFemtoV0->SetptotPos(tAODv0->PProng(0));
930 tFemtoV0->SetptotNeg(tAODv0->PProng(1));
931 tFemtoV0->SetptPos(trackpos->Pt());
932 tFemtoV0->SetptNeg(trackneg->Pt());
934 //tFemtoV0->SetEtaPos(trackpos->Eta()); //tAODv0->PseudoRapPos()
935 //tFemtoV0->SetEtaNeg(trackneg->Eta()); //tAODv0->PseudoRapNeg()
936 tFemtoV0->SetTPCNclsPos(trackpos->GetTPCNcls());
937 tFemtoV0->SetTPCNclsNeg(trackneg->GetTPCNcls());
938 tFemtoV0->SetTPCclustersPos(trackpos->GetTPCClusterMap());
939 tFemtoV0->SetTPCclustersNeg(trackneg->GetTPCClusterMap());
940 tFemtoV0->SetTPCsharingPos(trackpos->GetTPCSharedMap());
941 tFemtoV0->SetTPCsharingNeg(trackneg->GetTPCSharedMap());
942 tFemtoV0->SetNdofPos(trackpos->Chi2perNDF());
943 tFemtoV0->SetNdofNeg(trackneg->Chi2perNDF());
944 tFemtoV0->SetStatusPos(trackpos->GetStatus());
945 tFemtoV0->SetStatusNeg(trackneg->GetStatus());
947 tFemtoV0->SetPosNSigmaTPCK(fAODpidUtil->NumberOfSigmasTPC(trackpos,AliPID::kKaon));
948 tFemtoV0->SetNegNSigmaTPCK(fAODpidUtil->NumberOfSigmasTPC(trackneg,AliPID::kKaon));
949 tFemtoV0->SetPosNSigmaTPCP(fAODpidUtil->NumberOfSigmasTPC(trackpos,AliPID::kProton));
950 tFemtoV0->SetNegNSigmaTPCP(fAODpidUtil->NumberOfSigmasTPC(trackneg,AliPID::kProton));
951 tFemtoV0->SetPosNSigmaTPCPi(fAODpidUtil->NumberOfSigmasTPC(trackpos,AliPID::kPion));
952 tFemtoV0->SetNegNSigmaTPCPi(fAODpidUtil->NumberOfSigmasTPC(trackneg,AliPID::kPion));
955 float bfield = 5*fMagFieldSign;
956 float globalPositionsAtRadiiPos[9][3];
957 GetGlobalPositionAtGlobalRadiiThroughTPC(trackpos,bfield,globalPositionsAtRadiiPos);
958 double tpcEntrancePos[3]={globalPositionsAtRadiiPos[0][0],globalPositionsAtRadiiPos[0][1],globalPositionsAtRadiiPos[0][2]};
959 double tpcExitPos[3]={globalPositionsAtRadiiPos[8][0],globalPositionsAtRadiiPos[8][1],globalPositionsAtRadiiPos[8][2]};
961 float globalPositionsAtRadiiNeg[9][3];
962 GetGlobalPositionAtGlobalRadiiThroughTPC(trackneg,bfield,globalPositionsAtRadiiNeg);
963 double tpcEntranceNeg[3]={globalPositionsAtRadiiNeg[0][0],globalPositionsAtRadiiNeg[0][1],globalPositionsAtRadiiNeg[0][2]};
964 double tpcExitNeg[3]={globalPositionsAtRadiiNeg[8][0],globalPositionsAtRadiiNeg[8][1],globalPositionsAtRadiiNeg[8][2]};
966 AliFemtoThreeVector tmpVec;
967 tmpVec.SetX(tpcEntrancePos[0]); tmpVec.SetX(tpcEntrancePos[1]); tmpVec.SetX(tpcEntrancePos[2]);
968 tFemtoV0->SetNominalTpcEntrancePointPos(tmpVec);
970 tmpVec.SetX(tpcExitPos[0]); tmpVec.SetX(tpcExitPos[1]); tmpVec.SetX(tpcExitPos[2]);
971 tFemtoV0->SetNominalTpcExitPointPos(tmpVec);
973 tmpVec.SetX(tpcEntranceNeg[0]); tmpVec.SetX(tpcEntranceNeg[1]); tmpVec.SetX(tpcEntranceNeg[2]);
974 tFemtoV0->SetNominalTpcEntrancePointNeg(tmpVec);
976 tmpVec.SetX(tpcExitNeg[0]); tmpVec.SetX(tpcExitNeg[1]); tmpVec.SetX(tpcExitNeg[2]);
977 tFemtoV0->SetNominalTpcExitPointNeg(tmpVec);
979 AliFemtoThreeVector vecTpcPos[9];
980 AliFemtoThreeVector vecTpcNeg[9];
983 vecTpcPos[i].SetX(globalPositionsAtRadiiPos[i][0]); vecTpcPos[i].SetY(globalPositionsAtRadiiPos[i][1]); vecTpcPos[i].SetZ(globalPositionsAtRadiiPos[i][2]);
984 vecTpcNeg[i].SetX(globalPositionsAtRadiiNeg[i][0]); vecTpcNeg[i].SetY(globalPositionsAtRadiiNeg[i][1]); vecTpcNeg[i].SetZ(globalPositionsAtRadiiNeg[i][2]);
986 tFemtoV0->SetNominalTpcPointPos(vecTpcPos);
987 tFemtoV0->SetNominalTpcPointNeg(vecTpcNeg);
989 tFemtoV0->SetTPCMomentumPos(trackpos->GetTPCmomentum());
990 tFemtoV0->SetTPCMomentumNeg(trackneg->GetTPCmomentum());
992 tFemtoV0->SetdedxPos(trackpos->GetTPCsignal());
993 tFemtoV0->SetdedxNeg(trackneg->GetTPCsignal());
995 if((tFemtoV0->StatusPos()&AliESDtrack::kTOFpid)==0 || (tFemtoV0->StatusPos()&AliESDtrack::kTIME)==0 || (tFemtoV0->StatusPos()&AliESDtrack::kTOFout)==0 )
997 if((tFemtoV0->StatusNeg()&AliESDtrack::kTOFpid)==0 || (tFemtoV0->StatusNeg()&AliESDtrack::kTIME)==0 || (tFemtoV0->StatusNeg()&AliESDtrack::kTOFout)==0 )
999 tFemtoV0->SetPosNSigmaTOFK(-1000);
1000 tFemtoV0->SetNegNSigmaTOFK(-1000);
1001 tFemtoV0->SetPosNSigmaTOFP(-1000);
1002 tFemtoV0->SetNegNSigmaTOFP(-1000);
1003 tFemtoV0->SetPosNSigmaTOFPi(-1000);
1004 tFemtoV0->SetNegNSigmaTOFPi(-1000);
1006 tFemtoV0->SetTOFProtonTimePos(-1000);
1007 tFemtoV0->SetTOFPionTimePos(-1000);
1008 tFemtoV0->SetTOFKaonTimePos(-1000);
1009 tFemtoV0->SetTOFProtonTimeNeg(-1000);
1010 tFemtoV0->SetTOFPionTimeNeg(-1000);
1011 tFemtoV0->SetTOFKaonTimeNeg(-1000);
1016 tFemtoV0->SetPosNSigmaTOFK(fAODpidUtil->NumberOfSigmasTOF(trackpos,AliPID::kKaon));
1017 tFemtoV0->SetNegNSigmaTOFK(fAODpidUtil->NumberOfSigmasTOF(trackneg,AliPID::kKaon));
1018 tFemtoV0->SetPosNSigmaTOFP(fAODpidUtil->NumberOfSigmasTOF(trackpos,AliPID::kProton));
1019 tFemtoV0->SetNegNSigmaTOFP(fAODpidUtil->NumberOfSigmasTOF(trackneg,AliPID::kProton));
1020 tFemtoV0->SetPosNSigmaTOFPi(fAODpidUtil->NumberOfSigmasTOF(trackpos,AliPID::kPion));
1021 tFemtoV0->SetNegNSigmaTOFPi(fAODpidUtil->NumberOfSigmasTOF(trackneg,AliPID::kPion));
1023 double TOFSignalPos = trackpos->GetTOFsignal();
1024 double TOFSignalNeg = trackneg->GetTOFsignal();
1027 trackpos->GetIntegratedTimes(pidPos);
1028 trackneg->GetIntegratedTimes(pidNeg);
1030 tFemtoV0->SetTOFPionTimePos(TOFSignalPos-pidPos[2]);
1031 tFemtoV0->SetTOFKaonTimePos(TOFSignalPos-pidPos[3]);
1032 tFemtoV0->SetTOFProtonTimePos(TOFSignalPos-pidPos[4]);
1033 tFemtoV0->SetTOFPionTimeNeg(TOFSignalNeg-pidNeg[2]);
1034 tFemtoV0->SetTOFKaonTimeNeg(TOFSignalNeg-pidNeg[3]);
1035 tFemtoV0->SetTOFProtonTimeNeg(TOFSignalNeg-pidNeg[4]);
1040 tFemtoV0->SetStatusPos(999);
1041 tFemtoV0->SetStatusNeg(999);
1043 tFemtoV0->SetOnFlyStatusV0(tAODv0->GetOnFlyStatus());
1046 void AliFemtoEventReaderAOD::SetFilterBit(UInt_t ibit)
1048 fFilterBit = (1 << (ibit));
1051 void AliFemtoEventReaderAOD::SetReadMC(unsigned char a)
1057 void AliFemtoEventReaderAOD::SetReadV0(unsigned char a)
1062 void AliFemtoEventReaderAOD::SetUseMultiplicity(EstEventMult aType)
1064 fEstEventMult = aType;
1067 AliAODMCParticle* AliFemtoEventReaderAOD::GetParticleWithLabel(TClonesArray *mcP, Int_t aLabel)
1069 if (aLabel < 0) return 0;
1070 AliAODMCParticle *aodP;
1072 if (aLabel > mcP->GetEntries())
1073 posstack = mcP->GetEntries();
1077 aodP = (AliAODMCParticle *) mcP->At(posstack);
1078 if (aodP->GetLabel() > posstack) {
1080 aodP = (AliAODMCParticle *) mcP->At(posstack);
1081 if (aodP->GetLabel() == aLabel) return aodP;
1084 while (posstack > 0);
1088 aodP = (AliAODMCParticle *) mcP->At(posstack);
1089 if (aodP->GetLabel() == aLabel) return aodP;
1092 while (posstack < mcP->GetEntries());
1098 void AliFemtoEventReaderAOD::CopyPIDtoFemtoTrack(AliAODTrack *tAodTrack,
1099 AliFemtoTrack *tFemtoTrack)
1102 // copying DCA information (taking it from global tracks gives better resolution than from TPC-only)
1105 double covimpact[3];
1107 if (!tAodTrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
1108 //cout << "sth went wrong with dca propagation" << endl;
1109 tFemtoTrack->SetImpactD(-1000.0);
1110 tFemtoTrack->SetImpactZ(-1000.0);
1114 tFemtoTrack->SetImpactD(impact[0]);
1115 tFemtoTrack->SetImpactZ(impact[1]);
1119 tAodTrack->GetPID(aodpid);
1120 tFemtoTrack->SetPidProbElectron(aodpid[0]);
1121 tFemtoTrack->SetPidProbMuon(aodpid[1]);
1122 tFemtoTrack->SetPidProbPion(aodpid[2]);
1123 tFemtoTrack->SetPidProbKaon(aodpid[3]);
1124 tFemtoTrack->SetPidProbProton(aodpid[4]);
1126 aodpid[0] = -100000.0;
1127 aodpid[1] = -100000.0;
1128 aodpid[2] = -100000.0;
1129 aodpid[3] = -100000.0;
1130 aodpid[4] = -100000.0;
1134 //what is that code? for what do we need it? nsigma values are not enough?
1135 if (tAodTrack->GetStatus() & AliESDtrack::kTOFpid) { //AliESDtrack::kTOFpid=0x8000
1136 tTOF = tAodTrack->GetTOFsignal();
1137 tAodTrack->GetIntegratedTimes(aodpid);
1139 tTOF -= fAODpidUtil->GetTOFResponse().GetStartTime(tAodTrack->P());
1142 tFemtoTrack->SetTofExpectedTimes(tTOF-aodpid[2], tTOF-aodpid[3], tTOF-aodpid[4]);
1144 ////// TPC ////////////////////////////////////////////
1146 float nsigmaTPCK=-1000.;
1147 float nsigmaTPCPi=-1000.;
1148 float nsigmaTPCP=-1000.;
1150 // cout<<"in reader fESDpid"<<fESDpid<<endl;
1152 if (tAodTrack->IsOn(AliESDtrack::kTPCpid)){ //AliESDtrack::kTPCpid=0x0080
1153 nsigmaTPCK = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kKaon);
1154 nsigmaTPCPi = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kPion);
1155 nsigmaTPCP = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kProton);
1158 tFemtoTrack->SetNSigmaTPCPi(nsigmaTPCPi);
1159 tFemtoTrack->SetNSigmaTPCK(nsigmaTPCK);
1160 tFemtoTrack->SetNSigmaTPCP(nsigmaTPCP);
1162 tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());
1163 tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());
1164 tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());
1166 tFemtoTrack->SetTPCsignalN(1);
1167 tFemtoTrack->SetTPCsignalS(1);
1168 tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
1170 ///////TOF//////////////////////
1173 float nsigmaTOFPi=-1000.;
1174 float nsigmaTOFK=-1000.;
1175 float nsigmaTOFP=-1000.;
1177 if ((tAodTrack->GetStatus() & AliESDtrack::kTOFpid) && //AliESDtrack::kTOFpid=0x8000
1178 (tAodTrack->GetStatus() & AliESDtrack::kTOFout) && //AliESDtrack::kTOFout=0x2000
1179 (tAodTrack->GetStatus() & AliESDtrack::kTIME) ) //AliESDtrack::kTIME=0x80000000
1181 if(tAodTrack->IsOn(AliESDtrack::kTOFpid)) //AliESDtrack::kTOFpid=0x8000
1184 nsigmaTOFPi = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kPion);
1185 nsigmaTOFK = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kKaon);
1186 nsigmaTOFP = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kProton);
1188 Double_t len=200;// esdtrack->GetIntegratedLength(); !!!!!
1189 Double_t tof=tAodTrack->GetTOFsignal();
1190 if(tof > 0.) vp=len/tof/0.03;
1193 tFemtoTrack->SetVTOF(vp);
1194 tFemtoTrack->SetNSigmaTOFPi(nsigmaTOFPi);
1195 tFemtoTrack->SetNSigmaTOFK(nsigmaTOFK);
1196 tFemtoTrack->SetNSigmaTOFP(nsigmaTOFP);
1199 //////////////////////////////////////
1203 void AliFemtoEventReaderAOD::SetCentralityPreSelection(double min, double max)
1205 fCentRange[0] = min; fCentRange[1] = max;
1207 fEstEventMult = kCentrality;
1210 void AliFemtoEventReaderAOD::SetNoCentrality(bool anocent)
1212 if(anocent==false) {fEstEventMult=kCentrality;}
1213 else {fEstEventMult=kReference; fUsePreCent = 0; }
1216 void AliFemtoEventReaderAOD::SetAODpidUtil(AliAODpidUtil *aAODpidUtil)
1218 fAODpidUtil = aAODpidUtil;
1219 // printf("fAODpidUtil: %x\n",fAODpidUtil);
1222 void AliFemtoEventReaderAOD::SetAODheader(AliAODHeader *aAODheader)
1224 fAODheader = aAODheader;
1228 void AliFemtoEventReaderAOD::SetMagneticFieldSign(int s)
1238 void AliFemtoEventReaderAOD::SetEPVZERO(Bool_t iepvz)
1243 void AliFemtoEventReaderAOD::GetGlobalPositionAtGlobalRadiiThroughTPC(AliAODTrack *track, Float_t bfield, Float_t globalPositionsAtRadii[9][3])
1245 // Gets the global position of the track at nine different radii in the TPC
1246 // track is the track you want to propagate
1247 // bfield is the magnetic field of your event
1248 // globalPositionsAtRadii is the array of global positions in the radii and xyz
1250 // Initialize the array to something indicating there was no propagation
1251 for(Int_t i=0;i<9;i++){
1252 for(Int_t j=0;j<3;j++){
1253 globalPositionsAtRadii[i][j]=-9999.;
1257 // Make a copy of the track to not change parameters of the track
1258 AliExternalTrackParam etp; etp.CopyFromVTrack(track);
1259 //printf("\nAfter CopyFromVTrack\n");
1262 // The global position of the the track
1263 Double_t xyz[3]={-9999.,-9999.,-9999.};
1265 // Counter for which radius we want
1267 // The radii at which we get the global positions
1268 // IROC (OROC) from 84.1 cm to 132.1 cm (134.6 cm to 246.6 cm)
1269 Float_t Rwanted[9]={85.,105.,125.,145.,165.,185.,205.,225.,245.};
1270 // The global radius we are at
1271 Float_t globalRadius=0;
1273 // Propagation is done in local x of the track
1274 for (Float_t x = etp.GetX();x<247.;x+=1.){ // GetX returns local coordinates
1275 // Starts at the tracks fX and goes outwards. x = 245 is the outer radial limit
1276 // of the TPC when the track is straight, i.e. has inifinite pt and doesn't get bent.
1277 // If the track's momentum is smaller than infinite, it will develop a y-component, which
1278 // adds to the global radius
1280 // Stop if the propagation was not succesful. This can happen for low pt tracks
1281 // that don't reach outer radii
1282 if(!etp.PropagateTo(x,bfield))break;
1283 etp.GetXYZ(xyz); // GetXYZ returns global coordinates
1284 globalRadius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]); //Idea to speed up: compare squared radii
1286 // Roughly reached the radius we want
1287 if(globalRadius > Rwanted[iR]){
1289 // Bigger loop has bad precision, we're nearly one centimeter too far, go back in small steps.
1290 while (globalRadius>Rwanted[iR]){
1292 // printf("propagating to x %5.2f\n",x);
1293 if(!etp.PropagateTo(x,bfield))break;
1294 etp.GetXYZ(xyz); // GetXYZ returns global coordinates
1295 globalRadius = TMath::Sqrt(xyz[0]*xyz[0]+xyz[1]*xyz[1]); //Idea to speed up: compare squared radii
1297 //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]);
1298 globalPositionsAtRadii[iR][0]=xyz[0];
1299 globalPositionsAtRadii[iR][1]=xyz[1];
1300 globalPositionsAtRadii[iR][2]=xyz[2];
1301 // Indicate we want the next radius