return fJetsList;
}
-//_____________________________________________________________
-TLorentzVector AliMCAnalysisUtils::GetMother(const Int_t label, const AliCaloTrackReader* reader)
+
+//_______________________________________________________________________________________________
+TLorentzVector AliMCAnalysisUtils::GetMother(const Int_t label, const AliCaloTrackReader* reader,
+ Bool_t & ok)
{
//Return the kinematics of the particle that generated the signal
- TLorentzVector mom;
+ Int_t pdg = -1; Int_t status = -1;
+ return GetMother(label,reader,pdg,status, ok);
+}
+
+//_______________________________________________________________________________________________
+TLorentzVector AliMCAnalysisUtils::GetMother(const Int_t label, const AliCaloTrackReader* reader,
+ Int_t & pdg, Int_t & status, Bool_t & ok)
+{
+ //Return the kinematics of the particle that generated the signal, its pdg and its status
+
+ TLorentzVector mom(0,0,0,0);
if(reader->ReadStack())
{
- if(!reader->GetStack()) {
+ if(!reader->GetStack())
+ {
if (fDebug >=0)
printf("AliMCAnalysisUtils::GetMother() - Stack is not available, check analysis settings in configuration file, STOP!!\n");
- return -1;
+
+ ok=kFALSE;
+ return mom;
}
if(label >= 0 && label < reader->GetStack()->GetNtrack())
{
TParticle * momP = reader->GetStack()->Particle(label);
momP->Momentum(mom);
+ pdg = momP->GetPdgCode();
+ status = momP->GetStatusCode();
+ }
+ else
+ {
+ ok = kFALSE;
+ return mom;
}
}
else if(reader->ReadAODMCParticles())
{
if(fDebug >= 0)
printf("AliMCAnalysisUtils::GetMother() - AODMCParticles is not available, check analysis settings in configuration file!!\n");
- return -1;
+
+ ok=kFALSE;
+ return mom;
}
Int_t nprimaries = mcparticles->GetEntriesFast();
{
AliAODMCParticle * momP = (AliAODMCParticle *) mcparticles->At(label);
mom.SetPxPyPzE(momP->Px(),momP->Py(),momP->Pz(),momP->E());
+ pdg = momP->GetPdgCode();
+ status = momP->GetStatus();
+ }
+ else
+ {
+ ok = kFALSE;
+ return mom;
}
}
+ ok = kTRUE;
+
return mom;
}
+
//_____________________________________________________________________________________
-TLorentzVector AliMCAnalysisUtils::GetMotherWithPDG(const Int_t label, const Int_t pdg, const AliCaloTrackReader* reader)
+TLorentzVector AliMCAnalysisUtils::GetMotherWithPDG(const Int_t label, const Int_t pdg, const AliCaloTrackReader* reader, Bool_t & ok)
{
//Return the kinematics of the particle that generated the signal
- TLorentzVector grandmom;
+ TLorentzVector grandmom(0,0,0,0);
if(reader->ReadStack())
{
if (fDebug >=0)
printf("AliMCAnalysisUtils::GetMotherWithPDG() - Stack is not available, check analysis settings in configuration file, STOP!!\n");
- return -1;
+
+ ok = kFALSE;
+ return grandmom;
}
if(label >= 0 && label < reader->GetStack()->GetNtrack())
{
{
if(fDebug >= 0)
printf("AliMCAnalysisUtils::GetMotherWithPDG() - AODMCParticles is not available, check analysis settings in configuration file!!\n");
- return -1;
+
+ ok=kFALSE;
+ return grandmom;
}
Int_t nprimaries = mcparticles->GetEntriesFast();
}
}
+ ok = kTRUE;
return grandmom;
}