, fDigitsArr(0), fClusterArr(0), fCaloClusterArr(0)
, fRecParam(0), fClusterizer(0)
, fUnfolder(0), fJustUnfold(kFALSE)
-, fOutputAODBranch(0), fOutputAODBranchName("")
-, fFillAODFile(kTRUE), fFillAODHeader(0)
+, fOutputAODBranch(0), fOutputAODBranchName(""), fOutputAODBranchSet(0)
+, fFillAODFile(kFALSE), fFillAODHeader(0)
, fFillAODCaloCells(0), fRun(-1)
, fRecoUtils(0), fConfigName("")
, fCellLabels(), fCellSecondLabels(), fCellTime()
, fDigitsArr(0), fClusterArr(0), fCaloClusterArr(0)
, fRecParam(0), fClusterizer(0)
, fUnfolder(0), fJustUnfold(kFALSE)
-, fOutputAODBranch(0), fOutputAODBranchName("")
-, fFillAODFile(kTRUE), fFillAODHeader(0)
+, fOutputAODBranch(0), fOutputAODBranchName(""), fOutputAODBranchSet(0)
+, fFillAODFile(kFALSE), fFillAODHeader(0)
, fFillAODCaloCells(0), fRun(-1)
, fRecoUtils(0), fConfigName("")
, fCellLabels(), fCellSecondLabels(), fCellTime()
if( IsExoticEvent() ) { fEvent = 0x0 ; return ; }
- //Magic line to write events to AOD filem put after event rejection
- AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(fFillAODFile);
+ //-------------------------------------------------------------------------------------
+ // Set the cluster array in the event (output or input)
+ //-------------------------------------------------------------------------------------
+
+ if ( fFillAODFile )
+ {
+ //Magic line to write events to AOD filem put after event rejection
+ AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
+ }
+ else if( !fOutputAODBranchSet )
+ {
+ // Create array and put it in the input event, if output AOD not selected, only once
+ InputEvent()->AddObject(fOutputAODBranch);
+ fOutputAODBranchSet = kTRUE;
+ printf("AliAnalysisTaskEMCALClusterize::UserExec() - Add AOD branch <%s> to input event\n",fOutputAODBranchName.Data());
+ }
}
if(!esd)
{
Error("InitGeometry"," - This event does not contain ESDs?");
- AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
+ if(fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
return;
}
// else triggerclasses = ((AliAODEvent*)event)->GetFiredTriggerClasses();
// //
// printf("AliAnalysisTaskEMCALClusterize - reject event %d with cluster - reject event with ncells in SM3 %d and SM4 %d\n",(Int_t)Entry(),ncellsSM3, ncellsSM4);
- // AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
+ // if(fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);;
// return;
//
if( ncellsSM3 >= ncellcut || ncellsSM4 >= 100 )
{
printf("AliAnalysisTaksEMCALClusterize::IsLEDEvent() - reject event %d with ncells in SM3 %d and SM4 %d\n",(Int_t)Entry(),ncellsSM3, ncellsSM4);
- AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);
+ if(fFillAODFile) AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kFALSE);;
return kTRUE;
}
{
// Init geometry, create list of output clusters
- if(fOutputAODBranchName.Length()!=0)
+
+ fOutputAODBranch = new TClonesArray("AliAODCaloCluster", 0);
+
+ if(fOutputAODBranchName.Length()==0)
{
- fOutputAODBranch = new TClonesArray("AliAODCaloCluster", 0);
- fOutputAODBranch->SetName(fOutputAODBranchName);
- //fOutputAODBranch->SetOwner(kFALSE);
- AddAODBranch("TClonesArray", &fOutputAODBranch);
+ fOutputAODBranchName = "newEMCALClustersArray";
+ printf("Cluster branch name not set, set it to newEMCALClustersArray \n");
}
- else
+
+ fOutputAODBranch->SetName(fOutputAODBranchName);
+
+ if( fFillAODFile )
{
- AliFatal("fOutputAODBranchName not set\n");
+ //fOutputAODBranch = new TClonesArray("AliAODCaloCluster", 0);
+
+
+ //fOutputAODBranch->SetOwner(kFALSE);
+
+ AddAODBranch("TClonesArray", &fOutputAODBranch);
}
}
if(DebugLevel() > 0 ) printf("AliAnalysisTaksEMCALClusterize::UserExec() - Skip Event %d", (Int_t) Entry());
return ;
}
-
+
//Init pointers, geometry, clusterizer, ocdb, aodb
InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
// $Id$
AliAnalysisTaskEMCALClusterize* AddTaskEMCALClusterize(
+ TString & arrayName,
+ const Bool_t bFillAOD = kFALSE,
const Int_t bMC = kFALSE,
const Bool_t exotic = kTRUE,
const TString name = "V1Unfold",
- TString & arrayName,
const TString trigger = "",
const Bool_t tm = kTRUE,
const Int_t minEcell = 50,
// Some general settings to create AOD file in case we want to keep it
clusterize->SwitchOffFillAODCaloCells();
clusterize->SwitchOffFillAODHeader();
- clusterize->FillAODFile(kFALSE); // fill aod.root with clusters?, not really needed for analysis.
+ clusterize->FillAODFile(bFillAOD); // fill aod.root with clusters?, not really needed for analysis.
// Do track matching after clusterization
if(tm) clusterize->SwitchOnTrackMatching();
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
- AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
-
mgr->ConnectInput (clusterize, 0, cinput1 );
- mgr->ConnectOutput (clusterize, 0, coutput1 );
+ if(bFillAOD)
+ {
+ printf("AddTaskEMCALClusterize - Fill output AOD\n");
+ AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ;
+ mgr->ConnectOutput (clusterize, 0, coutput1 );
+ }
return clusterize;
}