- // No additional information exists
- // Read in the normal AliAODTracks
-
- // const AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
- AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
-
-
-
- if (aodtrack->IsPrimaryCandidate()) tracksPrim++;
-
- if (!aodtrack->TestFilterBit(fFilterBit)) {
- delete trackCopy;
- continue;
- }
-
- //counting particles to set multiplicity
- double impact[2];
- double covimpact[3];
- if (aodtrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),10000,impact,covimpact)) {
- if(impact[0]<0.2 && TMath::Abs(impact[1]+fV1[2])<2.0)
- //if (aodtrack->IsPrimaryCandidate()) //? instead of kinks?
- if (aodtrack->Chi2perNDF() < 4.0)
- if (aodtrack->Pt() > 0.15 && aodtrack->Pt() < 20)
- if (aodtrack->GetTPCNcls() > 70)
- if (aodtrack->Eta() < 0.8)
- tNormMult++;
- }
-
- CopyAODtoFemtoTrack(aodtrack, trackCopy);
-
- // copying PID information from the correspondent track
- // const AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
-
-
- AliAODTrack *aodtrackpid;
- if(fFilterBit == (1 << (7))) //for TPC Only tracks we have to copy PID information from corresponding global tracks
- aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
- else
- aodtrackpid = fEvent->GetTrack(i);
- //CopyPIDtoFemtoTrack(aodtrackpid, trackCopy);
-
- if (mcP) {
- // Fill the hidden information with the simulated data
- // Int_t pLabel = aodtrack->GetLabel();
- AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
-
- AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
- double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
- if (!tPart) {
- fpx = fV1[0];
- fpy = fV1[1];
- fpz = fV1[2];
- tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
- tInfo->SetPDGPid(0);
- tInfo->SetTrueMomentum(0.0, 0.0, 0.0);
- tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0);
- tInfo->SetMass(0);
- }
- else {
- // Check the mother information
-
- // Using the new way of storing the freeze-out information
- // Final state particle is stored twice on the stack
- // one copy (mother) is stored with original freeze-out information
- // and is not tracked
- // the other one (daughter) is stored with primary vertex position
- // and is tracked
-
- // Freeze-out coordinates
- fpx = tPart->Xv() - fV1[0];
- fpy = tPart->Yv() - fV1[1];
- fpz = tPart->Zv() - fV1[2];
- // fpt = tPart->T();
-
- tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
-
- fpx *= 1e13;
- fpy *= 1e13;
- fpz *= 1e13;
- // fpt *= 1e13;
-
- // cout << "Looking for mother ids " << endl;
- if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
- // cout << "Got mother id" << endl;
- AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
- // Check if this is the same particle stored twice on the stack
- if (mother) {
- if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
- // It is the same particle
- // Read in the original freeze-out information
- // and convert it from to [fm]
-
- // EPOS style
- // fpx = mother->Xv()*1e13*0.197327;
- // fpy = mother->Yv()*1e13*0.197327;
- // fpz = mother->Zv()*1e13*0.197327;
- // fpt = mother->T() *1e13*0.197327*0.5;
-
-
- // Therminator style
- fpx = mother->Xv()*1e13;
- fpy = mother->Yv()*1e13;
- fpz = mother->Zv()*1e13;
- // fpt = mother->T() *1e13*3e10;
-
- }
- }
+ // No additional information exists
+ // Read in the normal AliAODTracks
+
+ // const AliAODTrack *aodtrack=dynamic_cast<AliAODTrack*>(fEvent->GetTrack(i));
+ AliAODTrack *aodtrack=dynamic_cast<AliAODTrack*>(fEvent->GetTrack(i));
+ assert(aodtrack&&"Not a standard AOD"); // getting the AODtrack directly
+
+
+
+ if (aodtrack->IsPrimaryCandidate()) tracksPrim++;
+
+ if (fFilterBit && !aodtrack->TestFilterBit(fFilterBit)) {
+ //delete trackCopy;
+ continue;
+ }
+
+ if (fFilterMask && !aodtrack->TestFilterBit(fFilterMask)) {
+ //delete trackCopy;
+ continue;
+ }
+
+ // cout << "Muon? " << aodtrack->IsMuonTrack() << endl;
+ // cout << "Type? " << aodtrack->GetType() << endl;
+
+ // if (aodtrack->IsMuonTrack()) {
+ // cout << "muon" << endl;
+ // delete trackCopy;
+ // continue;
+ // }
+
+ //counting particles to set multiplicity
+ if(fEstEventMult==kGlobalCount){
+ AliAODTrack* trk_clone = (AliAODTrack*)aodtrack->Clone("trk_clone"); //no DCA cut for global count
+ //if (aodtrack->IsPrimaryCandidate()) //? instead of kinks?
+ if (aodtrack->Chi2perNDF() < 4.0)
+ if (aodtrack->Pt() > 0.15 && aodtrack->Pt() < 20)
+ if (aodtrack->GetTPCNcls() > 70)
+ if (aodtrack->Eta() < 0.8)
+ tNormMult++;
+ delete trk_clone;
+ }
+
+ trackCopy = CopyAODtoFemtoTrack(aodtrack);
+
+ // copying PID information from the correspondent track
+ // const AliAODTrack *aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
+
+
+ AliAODTrack *aodtrackpid;
+ if((fFilterBit == (1 << (7))) || fFilterMask == 128) {//for TPC Only tracks we have to copy PID information from corresponding global tracks
+ aodtrackpid = dynamic_cast<AliAODTrack*>(fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]));
+ }
+ else {
+ aodtrackpid = dynamic_cast<AliAODTrack*>(fEvent->GetTrack(i));
+ }
+ assert(aodtrackpid&&"Not a standard AOD");
+
+ CopyPIDtoFemtoTrack(aodtrackpid, trackCopy);
+
+ if (mcP) {
+ // Fill the hidden information with the simulated data
+ // Int_t pLabel = aodtrack->GetLabel();
+ // AliAODMCParticle *tPart = GetParticleWithLabel(mcP, (TMath::Abs(aodtrack->GetLabel())));
+ AliAODMCParticle *tPart;
+ if(aodtrack->GetLabel() > -1 ) {
+ tPart = (AliAODMCParticle*)mcP->At(aodtrack->GetLabel());
+ }
+ else {
+ tPart = NULL;
+ }
+ AliFemtoModelGlobalHiddenInfo *tInfo = new AliFemtoModelGlobalHiddenInfo();
+ double fpx=0.0, fpy=0.0, fpz=0.0, fpt=0.0;
+ if (!tPart) {
+ fpx = fV1[0];
+ fpy = fV1[1];
+ fpz = fV1[2];
+ tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
+ tInfo->SetPDGPid(0);
+ tInfo->SetTrueMomentum(0.0, 0.0, 0.0);
+ tInfo->SetEmissionPoint(0.0, 0.0, 0.0, 0.0);
+ tInfo->SetMass(0);
+ }
+ else {
+ // Check the mother information
+
+ // Using the new way of storing the freeze-out information
+ // Final state particle is stored twice on the stack
+ // one copy (mother) is stored with original freeze-out information
+ // and is not tracked
+ // the other one (daughter) is stored with primary vertex position
+ // and is tracked
+
+ // Freeze-out coordinates
+ fpx = tPart->Xv() - fV1[0];
+ fpy = tPart->Yv() - fV1[1];
+ fpz = tPart->Zv() - fV1[2];
+ // fpt = tPart->T();
+
+ tInfo->SetGlobalEmissionPoint(fpx, fpy, fpz);
+
+
+ fpx *= 1e13;
+ fpy *= 1e13;
+ fpz *= 1e13;
+ // fpt *= 1e13;
+
+ // cout << "Looking for mother ids " << endl;
+
+ //if (motherids[TMath::Abs(aodtrack->GetLabel())]>0) {
+ if(tPart->GetMother() > -1) { //MC particle has a mother
+ // cout << "Got mother id" << endl;
+ // AliAODMCParticle *mother = GetParticleWithLabel(mcP, motherids[TMath::Abs(aodtrack->GetLabel())]);
+ AliAODMCParticle *mother = (AliAODMCParticle*)mcP->At(tPart->GetMother());
+ // Check if this is the same particle stored twice on the stack
+ if (mother) {
+ if ((mother->GetPdgCode() == tPart->GetPdgCode() || (mother->Px() == tPart->Px()))) {
+ // It is the same particle
+ // Read in the original freeze-out information
+ // and convert it from to [fm]
+
+ // EPOS style
+ // fpx = mother->Xv()*1e13*0.197327;
+ // fpy = mother->Yv()*1e13*0.197327;
+ // fpz = mother->Zv()*1e13*0.197327;
+ // fpt = mother->T() *1e13*0.197327*0.5;
+
+
+ // Therminator style
+ fpx = mother->Xv()*1e13;
+ fpy = mother->Yv()*1e13;
+ fpz = mother->Zv()*1e13;
+ // fpt = mother->T() *1e13*3e10;
+
+ }
+ else { //particle's mother exists and the information about it can be added to hiddeninfo:
+ tInfo->SetMotherPdgCode(mother->GetPdgCode());