// analysis
#include "AliAnalysisTaskGamma.h"
#include "AliAnalysisManager.h"
+#include "AliESDInputHandler.h"
#include "AliMCEventHandler.h"
#include "AliMCEvent.h"
#include "AliAnaGamma.h"
// Create the output container
//AODs
- OpenFile(0);
+// OpenFile(0);
AliAODHandler* handler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
fAOD = handler->GetAOD();
fTreeG = handler->GetTree();
fAna->Init();
//In case of MC analysis
+/*
+ // NOT ALLOWED TO SET MC HANDLER FROM WITHIN AN ANALYSIS TASK !!! (MG)
Int_t datatype = fAna->GetReader()->GetDataType();
if(datatype == AliGammaReader::kMC || datatype == AliGammaReader::kMCData ){
AliMCEventHandler * mc = new AliMCEventHandler();
(AliAnalysisManager::GetAnalysisManager())->SetMCtruthEventHandler(mc);
}
-
+*/
AliDebug(1,"End");
}
// Connect the input data
//
AliDebug(1,"ConnectInputData() ");
+ AliESDInputHandler* esdH = (AliESDInputHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
+ fESD = esdH->GetEvent();
fChain = (TChain*)GetInputData(0);
- fESD = new AliESDEvent();
- fESD->ReadFromTree(fChain);
-
}
//_____________________________________________________
/* History of cvs commits:
*
* $Log$
+ * Revision 1.4 2007/10/29 13:48:42 gustavo
+ * Corrected coding violations
+ *
*
*/
for (iParticle=0 ; iParticle < stack->GetNprimary() ; iParticle++) {
TParticle * particle = stack->Particle(iParticle);
-
//Keep partons
if(particle->GetStatusCode() == 21 && iParticle>=2){//All partons, not nucleus
}
else{
//Take out some particles like neutrinos
- if(!SkipNeutralParticles(particle->GetPdgCode())){
+ if(!SkipNeutralParticles(particle->GetPdgCode()) && !particle->IsPrimary()){ // protection added (MG)
TParticle * pmother =stack->Particle(particle->GetFirstMother());
if(IsInPHOS(particle->Phi(),particle->Eta())){
if(particle->GetPdgCode()==22)SetPhotonStatus(particle,pmother);