AliAnalysisTaskSE(),
fDiJets(0),
fDiJetsIn(0),
+ fUseAODInput(kFALSE),
+ fFillAOD(kFALSE),
+ fJetBranch("jets"),
+ fAOD(0),
fHistList(0),
fH1DeltaPt(0),
fH1DeltaPhi(0),
AliAnalysisTaskSE(name),
fDiJets(0),
fDiJetsIn(0),
+ fUseAODInput(kFALSE),
+ fFillAOD(kFALSE),
+ fJetBranch("jets"),
+ fAOD(0),
fHistList(0),
fH1DeltaPt(0),
fH1DeltaPhi(0),
{
// Create the output container
//
- if (fDebug > 1) printf("AnalysisTaskDiJets::CreateOutPutData() \n");
+ if (fDebug) printf("AnalysisTaskDiJets::CreateOutPutData() \n");
fDiJets = new TClonesArray("AliAODDiJet", 0);
- fDiJets->SetName("dijets");
- AddAODBranch("TClonesArray", &fDiJets);
+ if (fFillAOD){
+ fDiJets->SetName(Form("dijets_%s",fJetBranch.Data()));
+ AddAODBranch("TClonesArray", &fDiJets);
+ }
if (!fHistList) fHistList = new TList();
Float_t pi=TMath::Pi();
void AliAnalysisTaskDiJets::Init()
{
// Initialization
- if (fDebug > 1) printf("AnalysisTaskDiJets::Init() \n");
+ if (fDebug) printf("AnalysisTaskDiJets::Init() \n");
}
//----------------------------------------------------------------------
{
// Execute analysis for current event
//
- fDiJets->Delete();
- AliAODEvent* aod = dynamic_cast<AliAODEvent*> (InputEvent());
-
- if(!aod){
- // We do not have an input AOD, look in the output
- aod = AODEvent();
- if(!aod){
- if (fDebug >1) printf("%s:%d AODEvent not found in the Output",(char*)__FILE__,__LINE__);
+ if (fDiJets) fDiJets->Delete();
+
+ if(fUseAODInput){
+ fAOD = dynamic_cast<AliAODEvent*> (InputEvent());
+ if(!fAOD){
+ // We do not have an input AOD, look in the output
+ if (fDebug) printf("%s:%d No AOD event in the input\n",(char*)__FILE__,__LINE__);
+ return;
+ }
+ } else {
+ fAOD = AODEvent();
+ if(!fAOD){
+ if (fDebug) printf("%s:%d AODEvent not found in the Output",(char*)__FILE__,__LINE__);
return;
}
}
- TClonesArray* jets = aod->GetJets();
-
+ TClonesArray* jets = (TClonesArray*) fAOD->FindListObject(fJetBranch.Data());
// N.B. if we take the aod from the output this is always
// empty and since it is the same as fDiJets
- fDiJetsIn = (TClonesArray*) (aod->GetList()->FindObject("dijets"));
+ fDiJetsIn = (TClonesArray*) (fAOD->GetList()->FindObject("dijets"));
if (fDiJetsIn) {
- if (fDebug >1) printf("Found %d dijets in old list \n", fDiJetsIn->GetEntries());
+ if (fDebug) printf("Found %d dijets in old list \n", fDiJetsIn->GetEntries());
AliAODJet* jj1, *jj2;
AliAODDiJet* testJ;
}
Int_t nj = jets->GetEntriesFast();
- if (fDebug >1) printf("There are %5d jets in the event \n", nj);
+ if (fDebug) printf("There are %5d jets in the event \n", nj);
if (nj < 2){
PostData(1, fHistList);
{
// Terminate analysis
//
- if (fDebug > 1) printf("AnalysisDiJets: Terminate() \n");
+ if (fDebug) printf("AnalysisDiJets: Terminate() \n");
}