// require AOD handler
AliAODHandler *aodH = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
- if (!aodH) Fatal("Init", "No AOD handler. Halting.");
-
-//require dielectron framework
- if (!fDielectron) {
- Error("Init","Dielectron framework class required. Please create and instance with proper cuts and set it via 'SetDielectron' before executing this task!!!");
- return;
- }
- fDielectron->Init();
-
+ if (!aodH) AliFatal("No AOD handler. Halting.");
+
aodH->AddFilteredAOD("AliAOD.Dielectron.root", "DielectronEvents");
// AddAODBranch("AliDielectronCandidates",fDielectron->GetPairArraysPointer(),"deltaAOD.Dielectron.root");
}
//
// Initilise histograms
//
+
+ //require dielectron framework
+ if (!fDielectron) {
+ AliFatal("Dielectron framework class required. Please create and instance with proper cuts and set it via 'SetDielectron' before executing this task!!!");
+ return;
+ }
+ fDielectron->Init();
+
if (!fEventStat){
fEventStat=new TH1D("hEventStat","Event statistics",5,0,5);
fEventStat->GetXaxis()->SetBinLabel(1,"Before Phys. Sel.");
{
// Execute analysis for current event:
AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
+ if (!aod) return;
+
Double_t vtxPrim[3] = {0.,0.,0.};
AliAODVertex* primvtx = aod->GetPrimaryVertex();
// Check if this candidate is matched to a MC signal
// If no, return kFALSE
// If yes, return kTRUE
- //
+ //
+ if (!mcArray) return kFALSE;
+
Int_t labMom[2]={0,0};
Int_t i,j,lab,labMother,pdgMother,pdgPart,labJPSIMother,pdgJPSIMother;
AliAODMCParticle *part=0;
Bool_t isAOD=man->GetInputEventHandler()->IsA()==AliAODInputHandler::Class();
AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
+ if (!inputHandler) return;
if ( inputHandler->GetPIDResponse() ){
AliDielectronVarManager::SetPIDResponse( inputHandler->GetPIDResponse() );
void SetRejectPileup(Bool_t pileup=kTRUE) { fRejectPileup=pileup; }
void AddDielectron(AliDielectron * const die) { fListDielectron.Add(die); }
-private:
+protected:
enum {kAllEvents=0, kSelectedEvents, kV0andEvents, kFilteredEvents, kPileupEvents, kNbinsEvent};
TList fListDielectron; // List of dielectron framework instances
TList fListHistos; //! List of histogram manager lists in the framework classes
TObjArray** GetPairArraysPointer() { return &fPairCandidates; }
void SetHistogramManager(AliDielectronHistos * const histos) { fHistos=histos; }
+ AliDielectronHistos* GetHistoManager() const { return fHistos; }
const THashList * GetHistogramList() const { return fHistos?fHistos->GetHistogramList():0x0; }
Bool_t HasCandidates() const { return GetPairArray(1)?GetPairArray(1)->GetEntriesFast()>0:0; }
void AddSignalMC(AliDielectronSignalMC* signal);
void SetDebugTree(AliDielectronDebugTree * const tree) { fDebugTree=tree; }
-
+
+ const TObjArray* GetMCSignals() const { return fSignalsMC; }
static const char* TrackClassName(Int_t i) { return (i>=0&&i<4)?fgkTrackClassNames[i]:""; }
static const char* PairClassName(Int_t i) { return (i>=0&&i<11)?fgkPairClassNames[i]:""; }
if (step!=fNSteps) {
AliError("Something went wrong in the step filling!!!");
}
- if(isMCTruth) delete isMCTruth;
+ if(isMCTruth) delete [] isMCTruth;
}
//________________________________________________________________
}
//____________________________________________________________
-Int_t AliDielectronMC::GetNPrimary()
+Int_t AliDielectronMC::GetNPrimary() const
{
//
// return the number of primary track from MC event
}
//____________________________________________________________
-AliVParticle* AliDielectronMC::GetMCTrackFromMCEvent(Int_t itrk)
+AliVParticle* AliDielectronMC::GetMCTrackFromMCEvent(Int_t itrk) const
{
//
// return MC track directly from MC event
//________________________________________________________________________________
-Int_t AliDielectronMC::GetMothersLabel(Int_t daughterLabel) {
+Int_t AliDielectronMC::GetMothersLabel(Int_t daughterLabel) const {
//
// Get the label of the mother for particle with label daughterLabel
//
//________________________________________________________________________________
-Int_t AliDielectronMC::GetPdgFromLabel(Int_t label) {
+Int_t AliDielectronMC::GetPdgFromLabel(Int_t label) const {
//
// Get particle code using the label from stack
//
//________________________________________________________________________________
-Bool_t AliDielectronMC::CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) {
+Bool_t AliDielectronMC::CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) const {
//
// Check the source for the particle
//
//________________________________________________________________________________
-Bool_t AliDielectronMC::IsMCTruth(const AliDielectronPair* pair, AliDielectronSignalMC* signalMC) {
+Bool_t AliDielectronMC::IsMCTruth(const AliDielectronPair* pair, const AliDielectronSignalMC* signalMC) const {
//
// Check if the pair corresponds to the MC truth in signalMC
//
//____________________________________________________________
-Bool_t AliDielectronMC::HaveSameMother(const AliDielectronPair * pair)
+Bool_t AliDielectronMC::HaveSameMother(const AliDielectronPair * pair) const
{
//
// Check whether two particles have the same mother
void Initialize(); // initialization
Int_t GetNMCTracks(); // return number of generated tracks
Int_t GetNMCTracksFromStack(); // return number of generated tracks from stack
- Int_t GetNPrimary(); // return number of primary tracks
+ Int_t GetNPrimary() const; // return number of primary tracks
Int_t GetNPrimaryFromStack(); // return number of primary tracks from stack
Int_t GetMCPID(const AliESDtrack* _track); // return MC PID
Int_t GetMCPID(const AliAODTrack* _track); // return MC PID for AODtrack
Bool_t IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother);
Bool_t IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
Bool_t IsMCMotherToEE(const AliVParticle *particle, Int_t pdgMother);
- Bool_t IsMCTruth(const AliDielectronPair* pair, AliDielectronSignalMC* signalMC);
+ Bool_t IsMCTruth(const AliDielectronPair* pair, const AliDielectronSignalMC* signalMC) const;
Bool_t IsMCTruth(Int_t ipart, AliDielectronSignalMC* signalMC, Int_t branch);
- Int_t GetMothersLabel(Int_t daughterLabel);
- Int_t GetPdgFromLabel(Int_t label);
+ Int_t GetMothersLabel(Int_t daughterLabel) const;
+ Int_t GetPdgFromLabel(Int_t label) const;
- Bool_t HaveSameMother(const AliDielectronPair *pair);
+ Bool_t HaveSameMother(const AliDielectronPair *pair) const;
Int_t GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother);
Int_t GetLabelMotherWithPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
AliVParticle* GetMCTrackFromMCEvent(AliVParticle *track); // return MC track directly from MC event
- AliVParticle* GetMCTrackFromMCEvent(Int_t itrk); // return MC track directly from MC event
+ AliVParticle* GetMCTrackFromMCEvent(Int_t itrk) const; // return MC track directly from MC event
TParticle* GetMCTrackFromStack(const AliESDtrack* _track); // return MC track from stack
AliMCParticle* GetMCTrack(const AliESDtrack* _track); // return MC track associated with reco track
AliAODMCParticle* GetMCTrack( const AliAODTrack* _track); // return MC track associated with reco AOD track
Int_t GetLabelMotherWithPdgAOD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t checkBothCharges) const;
- Bool_t CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source);
+ Bool_t CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) const;
ClassDef(AliDielectronMC, 0)
};