#include "AliStack.h"
#include "AliMCEvent.h"
#include "AliMCEventHandler.h"
+#include "AliESDInputHandler.h"
#include "AliAODEvent.h"
#include "AliAODHeader.h"
#include "AliAODMCHeader.h"
#include "AliGenHijingEventHeader.h"
#include "AliGenPythiaEventHeader.h"
#include "AliGenCocktailEventHeader.h"
+#include "AliGenEventHeaderTunedPbPb.h"
#include "AliLog.h"
// Implemented Notify() to read the cross sections
// from pyxsec.root
//
- TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ TTree *tree = mgr->GetTree();
Double_t xsection = 0;
UInt_t ntrials = 0;
if(tree){
}
TString fileName(curfile->GetName());
- if(fileName.Contains("AliESDs.root")){
+ TString datafile = mgr->GetInputEventHandler()->GetInputFileName();
+ if (fileName.Contains(datafile)) {
+ fileName.ReplaceAll(datafile, "pyxsec.root");
+ }
+ else if(fileName.Contains("AliESDs.root")){
fileName.ReplaceAll("AliESDs.root", "pyxsec.root");
}
else if(fileName.Contains("AliAOD.root")){
void AliAnalysisTaskMCParticleFilter::UserCreateOutputObjects()
{
// Create the output container
- PostData(1,fHistList);
+
if (OutputTree()&&fTrackFilterMother)
OutputTree()->GetUserInfo()->Add(fTrackFilterMother);
h1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}");
fHistList->Add(h1Trials);
+ PostData(1,fHistList);
}
//____________________________________________________________________
void AliAnalysisTaskMCParticleFilter::UserExec(Option_t */*option*/)
{
-// Execute analysis for current event
-//
-
-// Fill AOD tracks from Kinematic stack
-
+ // Execute analysis for current event
+ //
+
+ // Fill AOD tracks from Kinematic stack
+ PostData(1,fHistList);
+
// get AliAOD Event
AliAODEvent* aod = AODEvent();
if (!aod) {
AliGenHijingEventHeader *hiH = 0;
AliCollisionGeometry *colG = 0;
AliGenDPMjetEventHeader *dpmH = 0;
+ AliGenEventHeaderTunedPbPb *tunedH = 0;
+
// it can be only one save some casts
// assuming PYTHIA and HIJING are the most likely ones...
if(!pyH){
hiH = dynamic_cast<AliGenHijingEventHeader*>(mcEH);
if(!hiH){
dpmH = dynamic_cast<AliGenDPMjetEventHeader*>(mcEH);
+ if(!dpmH){
+ tunedH = dynamic_cast<AliGenEventHeaderTunedPbPb*>(mcEH);
+ }
}
}
fAODMcHeader->SetReactionPlaneAngle(colG->ReactionPlaneAngle());
AliInfo(Form("Found Collision Geometry. Got Reaction Plane %lf\n", colG->ReactionPlaneAngle()));
}
-
-
-
- // check varibales for charm need all daughters
- static int iTaken = 0;
- static int iAll = 0;
- static int iCharm = 0;
+ else if(tunedH) {
+ fAODMcHeader->SetReactionPlaneAngle(tunedH->GetPsi2());
+ fAODMcHeader->SetCrossSection(tunedH->GetCentrality());
+ }
Int_t j=0;
}
/*
+
+ // check varibales for charm need all daughters
+ static int iTaken = 0;
+ static int iAll = 0;
+ static int iCharm = 0;
+
for (Int_t ip = 0; ip < np; ip++){
AliMCParticle* mcpart = (AliMCParticle*) mcE->GetTrack(ip);
TParticle* part = mcpart->Particle();
aodH->StoreMCParticles();
- PostData(1,fHistList);
return;
}