fTriggerDetector(), fTriggerDetectorString(),
fFidCutTrigger(0),
fMinChargedPt(0), fMinNeutralPt(0),
-fStack(0),
+fStack(0), fAODMCparticles(0),
//fParton2(0), fParton3(0),
fParton6(0), fParton7(0),
fJet6(), fJet7(),
fTrigger(), fLVTmp(),
-fPtHard(0),
+fNPrimaries(0), fPtHard(0),
fhPtHard(0), fhPtParton(0), fhPtJet(0),
fhPtPartonPtHard(0), fhPtJetPtHard(0), fhPtJetPtParton(0)
{
AliDebug(1,"Start");
- if( fStack->GetNprimary() < 7 ) return kFALSE ;
+ if( fNPrimaries < 7 )
+ {
+ AliDebug(1,Form("End, not enough partons, n primaries %d",fNPrimaries));
+ return kFALSE ;
+ }
//Get the index of the mother
iparton = (fStack->Particle(indexTrig))->GetFirstMother();
if(iparton < 6)
{
- //printf("This particle is not from hard process - pdg %d, parton index %d\n",partType, iparton);
+ AliDebug(1,Form("This particle is not from hard process - pdg %d, parton index %d\n",partType, iparton));
return kFALSE;
}
AliDebug(1,"Start");
- Int_t nPrimary = fStack->GetNprimary();
-
// if( nPrimary > 2 ) fParton2 = fStack->Particle(2) ;
// if( nPrimary > 3 ) fParton3 = fStack->Particle(3) ;
Float_t p6eta = -10;
Float_t p6pt = 0 ;
fParton6 = 0x0;
- if( nPrimary > 6 )
+
+ if( fNPrimaries > 6 )
{
fParton6 = fStack->Particle(6) ;
p6pt = fParton6->Pt();
p6phi = fParton6->Phi();
if(p6phi < 0) p6phi +=TMath::TwoPi();
}
-
+
Float_t p7phi = -1 ;
Float_t p7eta = -10;
Float_t p7pt = 0 ;
fParton7 = 0x0;
- if( nPrimary > 7 )
+ if( fNPrimaries > 7 )
{
fParton7 = fStack->Particle(7) ;
p7pt = fParton7->Pt();
p7phi = fParton7->Phi();
if(p7phi < 0) p7phi +=TMath::TwoPi();
}
-
-
+
//printf("parton6: pt %2.2f, eta %2.2f, phi %2.2f with pdg %d\n",fParton6->Pt(),fParton6->Eta(),p6phi, fParton6->GetPdgCode());
//printf("parton7: pt %2.2f, eta %2.2f, phi %2.2f with pdg %d\n",fParton7->Pt(),fParton7->Eta(),p7phi, fParton7->GetPdgCode());
if(phiTrig < 0 ) phiTrig += TMath::TwoPi();
//Loop on primaries, start from position 8, no partons
- for(Int_t ipr = 8; ipr < fStack->GetNprimary(); ipr ++ )
+ for(Int_t ipr = 8; ipr < fNPrimaries; ipr ++ )
{
TParticle * particle = fStack->Particle(ipr) ;
// ---------------------------------------------------
// Get the index of the mother, get from what parton
Int_t ipartonAway = particle->GetFirstMother();
- if(ipartonAway < 0) return;
+ if(ipartonAway < 0)
+ {
+ AliDebug(1,"End, no mother index");
+ return;
+ }
TParticle * mother = fStack->Particle(ipartonAway);
while (ipartonAway > 7)
Float_t sumChPt = 0;
//Loop on primaries, start from position 8, no partons
- for(Int_t ipr = 8; ipr < fStack->GetNprimary(); ipr ++ )
+ for(Int_t ipr = 8; ipr < fNPrimaries; ipr ++ )
{
if(ipr == indexTrig) continue;
TParticle * particle = fStack->Particle(ipr) ;
AliDebug(1,"Start");
- fStack = GetMCStack() ;
- if( !fStack )
- AliFatal("No Stack available, STOP");
+ // Get the ESD MC particles container
+ fStack = 0;
+ if( GetReader()->ReadStack() )
+ {
+ fStack = GetMCStack();
+ if( !fStack )
+ {
+ AliFatal("Stack not available, is the MC handler called? STOP");
+ return;
+ }
+ fNPrimaries = fStack->GetNprimary(); // GetNtrack();
+ }
+
+ // Get the AOD MC particles container
+ fAODMCparticles = 0;
+ if( GetReader()->ReadAODMCParticles() )
+ {
+ fAODMCparticles = GetReader()->GetAODMCParticles();
+ if( !fAODMCparticles )
+ {
+ AliFatal("Standard MCParticles not available!");
+ return;
+ }
+ fNPrimaries = fAODMCparticles->GetEntriesFast();
+ }
+
GetPartonsAndJets();
- for(Int_t ipr = 0; ipr < fStack->GetNprimary(); ipr ++ )
+ for(Int_t ipr = 0; ipr < fNPrimaries; ipr ++ )
{
TParticle * particle = fStack->Particle(ipr) ;
private:
- Int_t fTriggerDetector ; // Detector : EMCAL, PHOS, CTS
- TString fTriggerDetectorString ; // Detector : EMCAL, PHOS, CTS
+ Int_t fTriggerDetector ; // Detector : EMCAL, PHOS, CTS
+ TString fTriggerDetectorString ; // Detector : EMCAL, PHOS, CTS
- AliFiducialCut* fFidCutTrigger; //! fiducial cut for the trigger detector
+ AliFiducialCut * fFidCutTrigger; //! fiducial cut for the trigger detector
- Float_t fMinChargedPt; //! Minimum energy for charged particles in correlation
- Float_t fMinNeutralPt; //! Minimum energy for neutral particles in correlation
+ Float_t fMinChargedPt; //! Minimum energy for charged particles in correlation
+ Float_t fMinNeutralPt; //! Minimum energy for neutral particles in correlation
- AliStack * fStack; //! access stack
-
-// TParticle * fParton2; //! Initial state Parton
-// TParticle * fParton3; //! Initial state Parton
+ AliStack * fStack; //! access ESD stack
+ TClonesArray * fAODMCparticles ; //! access AOD stack
+
+// TParticle * fParton2; //! Initial state Parton
+// TParticle * fParton3; //! Initial state Parton
- TParticle * fParton6; //! Final state Parton
- TParticle * fParton7; //! Final state Parton
+ TParticle * fParton6; //! Final state Parton
+ TParticle * fParton7; //! Final state Parton
- TLorentzVector fJet6; //! Pythia jet close to parton in position 6
- TLorentzVector fJet7; //! Pythia jet close to parton in position 7
+ TLorentzVector fJet6; //! Pythia jet close to parton in position 6
+ TLorentzVector fJet7; //! Pythia jet close to parton in position 7
- TLorentzVector fTrigger; //! Trigger momentum, avoid generating TLorentzVectors per event
- TLorentzVector fLVTmp; //! momentum, avoid generating TLorentzVectors per event
+ TLorentzVector fTrigger; //! Trigger momentum, avoid generating TLorentzVectors per event
+ TLorentzVector fLVTmp; //! momentum, avoid generating TLorentzVectors per event
- Float_t fPtHard; //! Generated pT hard
+ Int_t fNPrimaries; //! N primaries
+ Float_t fPtHard; //! Generated pT hard
// Histograms
AliAnaGeneratorKine (const AliAnaGeneratorKine & gk) ; // cpy ctor
AliAnaGeneratorKine & operator = (const AliAnaGeneratorKine & gk) ; // cpy assignment
- ClassDef(AliAnaGeneratorKine,5)
+ ClassDef(AliAnaGeneratorKine,6)
} ;