fTOFNSigma(0),
fTPCNSigma(0),
fTPCTOFNSigma(0),
- fTPCvsTOFNSigma(0)
+ fTPCvsTOFNSigma(0),
+ fParticleOrigin(0),
+ fParticleId(0)
{
// Default constructor
fTPCdEdx = new TH2D("TPCdEdx", "TPC dEdx vs. momentum", 100, 0.0, 5.0, 250, 0.0, 500.0);
fTPCNSigma = new TH2D("TPCNSigma","TPC NSigma vs. momentum", 100, 0.0, 5.0, 100, -5.0, 5.0);
fTPCTOFNSigma = new TH2D("TPCTOFNSigma","TPC & TOF NSigma vs. momentum", 100, 0.0, 5.0, 100, 0.0, 10.0);
fTPCvsTOFNSigma = new TH2D("TPCvsTOFNSigma","TPC vs TOF Nsigma",100, -5.0, 5.0, 100, -5.0, 5.0);
+ fParticleOrigin = new TH1D("POrigin", "Mothers PDG Codes", 6000, 0.0, 6000.0);
+ fParticleId = new TH1D("PId", "Particle PDG Codes", 6000, 0.0, 6000.0);
}
fTOFNSigma(0),
fTPCNSigma(0),
fTPCTOFNSigma(0),
- fTPCvsTOFNSigma(0)
+ fTPCvsTOFNSigma(0),
+ fParticleOrigin(0),
+ fParticleId(0)
{
// Normal constructor
char name[200];
snprintf(name, 200, "TPCvsTOFNSigma%s", aName);
fTPCvsTOFNSigma = new TH2D(name,"TPC vs TOF Nsigma",100, -5.0, 5.0, 100, -5.0, 5.0);
+
+ snprintf(name, 200, "POrigin%s", aName);
+ fParticleOrigin = new TH1D(name, "Mothers PDG Codes", 6000, 0.0, 6000.0);
+
+ snprintf(name, 200, "PId%s", aName);
+ fParticleId = new TH1D(name, "Particle PDG Codes", 6000, 0.0, 6000.0);
}
AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const AliFemtoCutMonitorParticlePID &aCut):
fTOFNSigma(0),
fTPCNSigma(0),
fTPCTOFNSigma(0),
- fTPCvsTOFNSigma(0)
+ fTPCvsTOFNSigma(0),
+ fParticleOrigin(0),
+ fParticleId(0)
{
// copy constructor
if (fTPCTOFNSigma) delete fTPCTOFNSigma;
fTPCTOFNSigma= new TH2D(*aCut.fTPCTOFNSigma);
+
+ if (fParticleOrigin) delete fParticleOrigin;
+ fParticleOrigin= new TH1D(*aCut.fParticleOrigin);
+
+ if (fParticleId) delete fParticleId;
+ fParticleId= new TH1D(*aCut.fParticleId);
}
AliFemtoCutMonitorParticlePID::~AliFemtoCutMonitorParticlePID()
delete fTPCNSigma;
delete fTPCTOFNSigma;
delete fTPCvsTOFNSigma;
+ delete fParticleOrigin;
+ delete fParticleId;
}
if(fTPCvsTOFNSigma) delete fTPCvsTOFNSigma;
fTPCvsTOFNSigma = new TH2D(*aCut.fTPCvsTOFNSigma);
+ if (fParticleOrigin) delete fParticleOrigin;
+ fParticleOrigin= new TH1D(*aCut.fParticleOrigin);
+
+ if (fParticleId) delete fParticleId;
+ fParticleId= new TH1D(*aCut.fParticleId);
+
return *this;
}
fTPCdEdx->Fill(tMom, tdEdx);
fTOFTime->Fill(tMom, tTOF);
+ AliFemtoModelHiddenInfo *tInfo = (AliFemtoModelHiddenInfo*)aTrack->GetHiddenInfo();
+ if(tInfo!=NULL) {
+ Int_t partID = TMath::Abs(tInfo->GetPDGPid());
+ Int_t motherID = TMath::Abs(tInfo->GetMotherPdgCode());
+
+ fParticleId->Fill(partID);
+ fParticleOrigin->Fill(motherID);
+ }
// float vp= aTrack->VTOF();
// if (vp > 0.) {
// fTOFTime->Fill(tMom, tTOF);
fTPCNSigma->Write();
fTPCTOFNSigma->Write();
fTPCvsTOFNSigma->Write();
+ fParticleId->Write();
+ fParticleOrigin->Write();
}
TList *AliFemtoCutMonitorParticlePID::GetOutputList()
tOutputList->Add(fTPCNSigma);
tOutputList->Add(fTPCTOFNSigma);
tOutputList->Add(fTPCvsTOFNSigma);
+ tOutputList->Add(fParticleId);
+ tOutputList->Add(fParticleOrigin);
return tOutputList;
}
TH2D *fTPCNSigma; // TPC NSigma values vs mom
TH2D *fTPCTOFNSigma; // TPC^2+ TOF^2 NSigma values vs mom
TH2D *fTPCvsTOFNSigma; // TPC vs TOF
-
+ TH1D *fParticleOrigin; //particle origin from MC
+ TH1D *fParticleId; //true particle identification from MC
};
fnsigmaPosL(0),
fnsigmaNegL(0),
fnsigmaPosAL(0),
- fnsigmaNegAL(0)
+ fnsigmaNegAL(0),
+ fParticleOrigin(0),
+ fParticleId(0)
{
// Default constructor
fLambdaMass = new TH1F("LambdaMass", "Mass Assuming Lambda Hypothesis", 10000, 0, 5);
fnsigmaPosAL = new TH1D("fnsigmaPosAL","Number of sigmas of positive AntiLambda daughters",200,-8,8);
fnsigmaNegAL = new TH1D("fnsigmaNegAL","Number of sigmas of negative AntiLambda daughters",200,-8,8);
+ fParticleOrigin = new TH1D("POrigin", "Mothers PDG Codes", 6000, 0.0, 6000.0);
+ fParticleId = new TH1D("PId", "Particle PDG Codes", 6000, 0.0, 6000.0);
+
fLambdaMass->Sumw2();
fAntiLambdaMass->Sumw2();
fK0ShortMass->Sumw2();
fnsigmaPosL(0),
fnsigmaNegL(0),
fnsigmaPosAL(0),
- fnsigmaNegAL(0)
+ fnsigmaNegAL(0),
+ fParticleOrigin(0),
+ fParticleId(0)
{
// Normal constructor
char name[200];
snprintf(name, 200, " fnsigmaNegAL%s", aName);
fnsigmaNegAL = new TH1D(name,"Number of sigmas of negative AntiLambda daughters",200,-10,10);
+ snprintf(name, 200, "POrigin%s", aName);
+ fParticleOrigin = new TH1D(name, "Mothers PDG Codes", 6000, 0.0, 6000.0);
+
+ snprintf(name, 200, "PId%s", aName);
+ fParticleId = new TH1D(name, "Particle PDG Codes", 6000, 0.0, 6000.0);
+
fLambdaMass->Sumw2();
fAntiLambdaMass->Sumw2();
fK0ShortMass->Sumw2();
fnsigmaPosL(0),
fnsigmaNegL(0),
fnsigmaPosAL(0),
- fnsigmaNegAL(0)
+ fnsigmaNegAL(0),
+ fParticleOrigin(0),
+ fParticleId(0)
{
// copy constructor
if (fLambdaMass) delete fLambdaMass;
if(fnsigmaNegAL) delete fnsigmaNegAL;
fnsigmaNegAL = new TH1D(*aCut.fnsigmaNegAL);
+ if (fParticleOrigin) delete fParticleOrigin;
+ fParticleOrigin= new TH1D(*aCut.fParticleOrigin);
+ if (fParticleId) delete fParticleId;
+ fParticleId= new TH1D(*aCut.fParticleId);
+
fLambdaMass->Sumw2();
fAntiLambdaMass->Sumw2();
fK0ShortMass->Sumw2();
delete fnsigmaNegL;
delete fnsigmaPosAL;
delete fnsigmaNegAL;
+
+ delete fParticleOrigin;
+ delete fParticleId;
}
AliFemtoCutMonitorV0& AliFemtoCutMonitorV0::operator=(const AliFemtoCutMonitorV0& aCut)
if(fnsigmaNegAL) delete fnsigmaNegAL;
fnsigmaNegAL = new TH1D(*aCut.fnsigmaNegAL);
+ if (fParticleOrigin) delete fParticleOrigin;
+ fParticleOrigin= new TH1D(*aCut.fParticleOrigin);
+ if (fParticleId) delete fParticleId;
+ fParticleId= new TH1D(*aCut.fParticleId);
+
fLambdaMass->Sumw2();
fAntiLambdaMass->Sumw2();
fK0ShortMass->Sumw2();
fnsigmaNegL->Fill(aV0->NegNSigmaTPCPi());
fnsigmaNegAL->Fill(aV0->NegNSigmaTPCP());
fnsigmaPosAL->Fill(aV0->PosNSigmaTPCPi());
+
+ AliFemtoModelHiddenInfo *tInfo = (AliFemtoModelHiddenInfo*)aV0->GetHiddenInfo();
+ if(tInfo!=NULL) {
+ Int_t partID = TMath::Abs(tInfo->GetPDGPid());
+ Int_t motherID = TMath::Abs(tInfo->GetMotherPdgCode());
+
+ fParticleId->Fill(partID);
+ fParticleOrigin->Fill(motherID);
+ }
}
void AliFemtoCutMonitorV0::Write()
fnsigmaNegL->Write();
fnsigmaPosAL->Write();
fnsigmaNegAL->Write();
+
+ fParticleId->Write();
+ fParticleOrigin->Write();
}
TList *AliFemtoCutMonitorV0::GetOutputList()
tOutputList->Add(fnsigmaPosAL);
tOutputList->Add(fnsigmaNegAL);
+ tOutputList->Add(fParticleId);
+ tOutputList->Add(fParticleOrigin);
+
return tOutputList;
}
TH1D *fnsigmaNegL;
TH1D *fnsigmaPosAL;
TH1D *fnsigmaNegAL;
+
+ TH1D *fParticleOrigin; //particle origin from MC
+ TH1D *fParticleId; //true particle identification from MC
};
#endif
#include "AliAODpidUtil.h"
#include "AliAnalysisUtils.h"
+#include "AliGenHijingEventHeader.h"
ClassImp(AliFemtoEventReaderAOD)
// and transfers the neccessary information into
// the internal AliFemtoEvent
+ Int_t numberOfLastHijingLabel=0;
+
AliFemtoEvent *tEvent = new AliFemtoEvent();
// setting global event characteristics
if (!mcH) {
cout << "AOD MC information requested, but no header found!" << endl;
}
+ else {
+ TIter next(mcH->GetCocktailHeaders());
+ // Loop over the cocktail headers
+ while (const TObject *obj=next()){
+ // Check whether it's a Hijing header
+ // const AliGenHijingEventHeader* hijingHeader = dynamic_cast<const AliGenHijingEventHeader*>(obj);
+ // if(hijingHeader) {
+ // numberOfLastHijingLabel=hijingHeader->NProduced()-1;
+ // } // End of found the hijing header
+ }
+ }
mcP = (TClonesArray *) fEvent->FindListObject(AliAODMCParticle::StdBranchName());
if (!mcP) {
}
tEvent->SetReactionPlaneAngle(fEvent->GetHeader()->GetQTheta(0)/2.0);
-
- Int_t *motherids=0;
- if (mcP) {
- const int motherTabSize = ((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel();
- motherids = new int[motherTabSize+1];
- for (int ip=0; ip<motherTabSize+1; ip++) motherids[ip] = 0;
-
- // Read in mother ids
- AliAODMCParticle *motherpart;
- for (int ip=0; ip<mcP->GetEntries(); ip++) {
- motherpart = (AliAODMCParticle *) mcP->At(ip);
- if (motherpart->GetDaughter(0) > 0)
- motherids[motherpart->GetDaughter(0)] = ip;
- if (motherpart->GetDaughter(1) > 0)
- motherids[motherpart->GetDaughter(1)] = ip;
- }
- }
+ // Int_t *motherids=0;
+ // if (mcP) {
+ // const int motherTabSize = ((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel();
+ // motherids = new int[motherTabSize+1];
+ // for (int ip=0; ip<motherTabSize+1; ip++) motherids[ip] = 0;
+
+ // // Read in mother ids
+ // AliAODMCParticle *motherpart;
+ // for (int ip=0; ip<mcP->GetEntries(); ip++) {
+ // motherpart = (AliAODMCParticle *) mcP->At(ip);
+ // if (motherpart->GetDaughter(0) > 0)
+ // motherids[motherpart->GetDaughter(0)] = ip;
+ // if (motherpart->GetDaughter(1) > 0)
+ // motherids[motherpart->GetDaughter(1)] = ip;
+ // }
+ // }
//AliAnalysisUtils
if(fisPileUp||fpA2013)
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 = 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) {
// 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 (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
// fpt = mother->T() *1e13*3e10;
}
+ else { //particle's mother exists and the information about it can be added to hiddeninfo:
+ tInfo->SetMotherPdgCode(mother->GetPdgCode());
+ }
}
}
tEvent->SetNormalizedMult(multV0);
}
- if (mcP) delete [] motherids;
+ // if (mcP) delete [] motherids;
// cout<<"end of reading nt "<<nofTracks<<" real number "<<realnofTracks<<endl;
if(aodv0->GetCharge()!=0) continue;
if(aodv0->ChargeProng(0)==aodv0->ChargeProng(1)) continue;
if(aodv0->CosPointingAngle(fV1)<0.998) continue;
+
+ AliAODTrack* daughterTrackPos = (AliAODTrack*)aodv0->GetDaughter(0); //getting positive daughter track
+ AliAODTrack* daughterTrackNeg = (AliAODTrack*)aodv0->GetDaughter(1); //getting negative daughter track
+ if(!daughterTrackPos) continue; //Daughter tracks must exist
+ if(!daughterTrackNeg) continue;
+ if(daughterTrackNeg->Charge() == daughterTrackPos->Charge() ) continue; //and have different charge
+
AliFemtoV0* trackCopyV0 = CopyAODtoFemtoV0(aodv0);
+ if(mcP) {
+ daughterTrackPos->SetAODEvent(fEvent);
+ daughterTrackNeg->SetAODEvent(fEvent);
+ if(daughterTrackPos->GetLabel() > 0 && daughterTrackNeg->GetLabel() > 0 ) {
+ AliAODMCParticle* mcParticlePos = (AliAODMCParticle*)mcP->At(daughterTrackPos->GetLabel());
+ AliAODMCParticle* mcParticleNeg = (AliAODMCParticle*)mcP->At(daughterTrackNeg->GetLabel() );
+ if((mcParticlePos!=NULL) && (mcParticleNeg!=NULL)){
+ //mcparticle->GetMother() will return a "-1" if the particle doesn't have a true mother (i.e. it's a fake track or primary)
+ int motherOfPosID = mcParticlePos->GetMother();
+ int motherOfNegID = mcParticleNeg->GetMother();
+ if ((motherOfPosID > -1) && (motherOfPosID == motherOfNegID)){
+ AliFemtoModelHiddenInfo *tInfo = new AliFemtoModelHiddenInfo();
+ // Both daughter tracks refer to the same mother. Return the MCParticle index of that mother.
+ AliAODMCParticle *v0 = (AliAODMCParticle*)mcP->At(motherOfPosID); //our V0 particle
+ // if(v0->GetLabel() > numberOfLastHijingLabel ) //if true - the particle is injected
+ //continue;
+ tInfo->SetPDGPid(v0->GetPdgCode());
+ int v0MotherId = v0->GetMother();
+ if(v0MotherId>-1) { //particle has a mother
+ AliAODMCParticle* motherOfV0 = (AliAODMCParticle*)mcP->At(v0MotherId);
+ tInfo->SetMotherPdgCode(motherOfV0->GetPdgCode());
+ }
+ trackCopyV0->SetHiddenInfo(tInfo);
+ }
+ }
+ }
+ }
tEvent->V0Collection()->push_back(trackCopyV0);
count_pass++;
//cout<<"Pushback v0 to v0collection"<<endl;
fTrueMomentum(0),
fEmissionPoint(0),
fPDGPid(0),
+ fMotherPdg(0),
fMass(0),
fTrueMomentumPos(0),
fEmissionPointPos(0),
fTrueMomentum(0),
fEmissionPoint(0),
fPDGPid(0),
+ fMotherPdg(0),
fMass(0),
fTrueMomentumPos(0),
fEmissionPointPos(0),
if (aInfo.GetEmissionPoint())
SetEmissionPointPos(aInfo.GetEmissionPoint());
fPDGPid = aInfo.GetPDGPid();
+ fMotherPdg = aInfo.GetMotherPdgCode();
fMass = aInfo.GetMass();
if (aInfo.GetTrueMomentumPos())
SetEmissionPoint(aInfo.GetEmissionPoint());
else SetEmissionPoint(0);
fPDGPid = aInfo.GetPDGPid();
+ fMotherPdg = aInfo.GetMotherPdgCode();
fMass = aInfo.GetMass();
if (fTrueMomentumPos) delete fTrueMomentumPos;
{
return fPDGPid;
}
+Int_t AliFemtoModelHiddenInfo::GetMotherPdgCode() const
+{
+ return fMotherPdg;
+}
//_____________________________________________
Double_t AliFemtoModelHiddenInfo::GetMass() const
{
{
fPDGPid = aPid;
}
+void AliFemtoModelHiddenInfo::SetMotherPdgCode(Int_t aMotherPdg)
+{
+ fMotherPdg = aMotherPdg;
+}
//_____________________________________________
void AliFemtoModelHiddenInfo::SetMass(Double_t aMass)
{
fEmissionPoint->SetT(aT);
}
else {
- fEmissionPoint = new AliFemtoLorentzVector(aRx, aRy, aRz, aT);
+ fEmissionPoint = new AliFemtoLorentzVector(aRx, aRy, aRz, aT);
}
}
fEmissionPointPos->SetT(aT);
}
else {
- fEmissionPointPos = new AliFemtoLorentzVector(aRx, aRy, aRz, aT);
+ fEmissionPointPos = new AliFemtoLorentzVector(aRx, aRy, aRz, aT);
}
}
fEmissionPointNeg->SetT(aT);
}
else {
- fEmissionPointNeg = new AliFemtoLorentzVector(aRx, aRy, aRz, aT);
+ fEmissionPointNeg = new AliFemtoLorentzVector(aRx, aRy, aRz, aT);
}
}
AliFemtoThreeVector *GetTrueMomentum() const;
AliFemtoLorentzVector *GetEmissionPoint() const;
Int_t GetPDGPid() const;
+ Int_t GetMotherPdgCode() const;
Double_t GetMass() const;
AliFemtoThreeVector *GetTrueMomentumPos() const;
void SetEmissionPoint(const AliFemtoLorentzVector& aPos);
void SetEmissionPoint(Double_t aRx, Double_t aRy, Double_t aRz, Double_t aT);
void SetPDGPid(Int_t aPid);
+ void SetMotherPdgCode(Int_t motherPdg);
void SetMass(Double_t aMass);
void SetTrueMomentumPos(AliFemtoThreeVector *aMom);
// !!! MANDATORY !!!
// --- Copy the hidden info from AliFemtoTrack to AliFemtoParticle
virtual AliFemtoHiddenInfo* Clone() const;
-
+
protected:
virtual AliFemtoHiddenInfo* GetParticleHiddenInfo() const;
AliFemtoThreeVector *fTrueMomentum; // True (simulated) momentum
AliFemtoLorentzVector *fEmissionPoint; // Emission point coordinates
Int_t fPDGPid; // True PID of the particle
+ Int_t fMotherPdg; // PDG code of particle's mother
Double_t fMass; // True particle mass
//daughter particles