Esempio n. 1
0
///
/// Main method calling all the configuration
/// It creates a CaloTrackCorrelations task for calorimeters performance studies,
/// configures it and adds it to the analysis manager.
///
/// The options that can be passed to the macro are:
/// \param suffix : A string with the type of trigger (default: MB, EMC)
/// \param simulation : A bool identifying the data as simulation
/// \param outputFile : A string to change the name of the histograms output file, default is AnalysisResults.root
/// \param year: The year the data was taken, used to configure some histograms
/// \param printSettings : A bool to enable the print of the settings per task
/// \param calibrate: if OADB was updated with calibration parameters not used in reconstruction, apply them here.
///
AliAnalysisTaskCaloTrackCorrelation *AddTaskCalorimeterQA(const char *suffix="default",
                                                          Bool_t  simulation = kFALSE,
                                                          TString outputFile = "",
                                                          Int_t   year = 2015, 
                                                          Bool_t  printSettings = kFALSE,
                                                          Bool_t  calibrate = kTRUE)
{
  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskCalorimeterQA", "No analysis manager to connect to.");
    return NULL;
  }  
  
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskCalorimeter", "This task requires an input event handler");
    return NULL;
  }
  
  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  
  Bool_t kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
  
  TString ssuffix = suffix;
  if(kUseKinematics || simulation)
  {
    simulation = kTRUE;
    printf("AddTaskCalorimeterQA - CAREFUL : Triggered events not checked in simulation!! \n");
    if(!ssuffix.Contains("default")) return NULL;
  }
  
  // Configure analysis
  //===========================================================================
  
  //Reader
  //For this particular analysis few things done by the reader.
  //Nothing else needs to be set.
  
  AliCaloTrackReader * reader = 0x0;
  if     (inputDataType.Contains("AOD")) reader = new AliCaloTrackAODReader();
  else if(inputDataType.Contains("ESD")) reader = new AliCaloTrackESDReader();
  //reader->SetDebug(10);//10 for lots of messages
  
  reader->SwitchOnEMCALCells(); 
  reader->SwitchOnEMCAL();
  reader->SwitchOnPHOSCells(); // For correlation plots
  reader->SwitchOnPHOS();      // For correlation plots
  reader->SetEMCALPtMin(0.); 
  reader->SwitchOnCTS();
  reader->SetCTSPtMin  (0.);
  reader->SetZvertexCut(10.);
  
  reader->SetDeltaAODFileName(""); //Do not create deltaAOD file, this analysis do not create branches.
  reader->SwitchOffWriteDeltaAOD()  ;
  
  if(!ssuffix.Contains("default"))
  {
    reader->SwitchOnTriggerPatchMatching();
    reader->SwitchOffBadTriggerEventsRemoval();
    reader->SetTriggerPatchTimeWindow(8,9);
    //reader->SetEventTriggerL0Threshold(2.);
  }
  
  if(!simulation) reader->AnalyzeOnlyPhysicsEvents(); // in case physics selection was not on
  
  if(calibrate && !simulation) reader->SwitchOnClusterRecalculation();
  else                         reader->SwitchOffClusterRecalculation();
  
  if(printSettings) reader->Print("");
  
  // *** Calorimeters Utils	***
  AliCalorimeterUtils *cu = new AliCalorimeterUtils;
  // Remove clusters close to borders, at least max energy cell is 1 cell away 
  cu->SetNumberOfCellsFromEMCALBorder(1);

  if      (year == 2010) cu->SetNumberOfSuperModulesUsed(4); //EMCAL first year
  else if (year <  2014) cu->SetNumberOfSuperModulesUsed(10);
  else                   cu->SetNumberOfSuperModulesUsed(20);
  
  
  cu->SwitchOffRecalibration(); // Check the reader if it is taken into account during filtering
  cu->SwitchOffRunDepCorrection();
  
  cu->SwitchOnCorrectClusterLinearity();
  
  Bool_t bExotic  = kTRUE;
  Bool_t bNonLin  = kTRUE;
  Bool_t bBadMap  = kTRUE;
  
  Bool_t bEnCalib = kFALSE;
  Bool_t bTiCalib = kFALSE;
  
  if(calibrate && !simulation)
  {
    cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
    cu->SwitchOffRunDepCorrection();    
    cu->SwitchOnRecalculateClusterPosition() ;
    
    bEnCalib = kTRUE;
    bTiCalib = kTRUE;
  }
  
  AliEMCALRecoUtils* recou = cu->GetEMCALRecoUtils();

  gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EMCAL/macros/ConfigureEMCALRecoUtils.C");

  TString recouStr = Form("(reinterpret_cast<AliEMCALRecoUtils*>(%p))", recou);
  
  gInterpreter->ProcessLine(Form("ConfigureEMCALRecoUtils(%s, %d, %d, %d, %d, %d, %d)", recouStr.Data(),
				 (Int_t)simulation,
				 (Int_t)bExotic,
				 (Int_t)bNonLin,
				 (Int_t)bEnCalib,
				 (Int_t)bBadMap,
				 (Int_t)bTiCalib));  
  
  if(bBadMap) 
    cu->SwitchOnBadChannelsRemoval();
  
  cu->SetDebug(-1);
  if(printSettings) cu->Print("");	
  
  // ##### Analysis algorithm settings ####
  
  AliAnaCalorimeterQA *emcalQA = new AliAnaCalorimeterQA();
  //emcalQA->SetDebug(10); //10 for lots of messages
  
  TString calorimeter = "EMCAL";
  emcalQA->SetCalorimeter(calorimeter);
  
  if(simulation)
  {
    // Access MC stack and fill more histograms
    emcalQA->SwitchOnDataMC() ;
    
    emcalQA->SwitchOffStudyBadClusters();
    emcalQA->SwitchOffFillAllCellTimeHisto();
  }
  else
  {
    emcalQA->SwitchOffDataMC() ;
    emcalQA->SwitchOffStudyBadClusters();
    emcalQA->SwitchOnFillAllCellTimeHisto();
  }
  
  emcalQA->AddToHistogramsName("EMCAL_"); //Begining of histograms name
  emcalQA->SwitchOffFiducialCut();
  emcalQA->SwitchOnCorrelation();
  emcalQA->SwitchOffFillAllTH3Histogram();
  emcalQA->SwitchOffFillAllPositionHistogram();
  emcalQA->SwitchOffFillAllPositionHistogram2();
  
  //Set Histrograms bins and ranges
  emcalQA->GetHistogramRanges()->SetHistoPtRangeAndNBins(0, 50, 100) ;
  emcalQA->GetHistogramRanges()->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
  emcalQA->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-0.70, 0.70, 140) ;
  
  if     ( year==2010 )
  {  
    emcalQA->GetHistogramRanges()->SetHistoPhiRangeAndNBins(80*TMath::DegToRad(), 120*TMath::DegToRad(), 48) ;
    emcalQA->GetHistogramRanges()->SetHistoXRangeAndNBins(-230,90,120);
    emcalQA->GetHistogramRanges()->SetHistoYRangeAndNBins(370,450,40);
  }
  else if ( year < 2014 )
  {            
    emcalQA->GetHistogramRanges()->SetHistoPhiRangeAndNBins(80*TMath::DegToRad(), 180*TMath::DegToRad(), 120) ;
    emcalQA->GetHistogramRanges()->SetHistoXRangeAndNBins(-460,90,200);
    emcalQA->GetHistogramRanges()->SetHistoYRangeAndNBins(100,450,100);
  }
  else // Run2
  {
    emcalQA->GetHistogramRanges()->SetHistoPhiRangeAndNBins(80*TMath::DegToRad(), 327*TMath::DegToRad(), 250) ; 
    emcalQA->GetHistogramRanges()->SetHistoXRangeAndNBins(-460,460,230);
    emcalQA->GetHistogramRanges()->SetHistoYRangeAndNBins(-450,450,225);          
  }
  
  emcalQA->GetHistogramRanges()->SetHistoMassRangeAndNBins(0., 0.65, 325) ;
  emcalQA->GetHistogramRanges()->SetHistoAsymmetryRangeAndNBins(0., 1. , 10 );
  emcalQA->GetHistogramRanges()->SetHistoPOverERangeAndNBins(0,2.,50);
  emcalQA->GetHistogramRanges()->SetHistodEdxRangeAndNBins(0.,200.,100);
  emcalQA->GetHistogramRanges()->SetHistodRRangeAndNBins(0.,0.10,50);
  //emcalQA->GetHistogramRanges()->SetHistoTimeRangeAndNBins( 400,900,250);
  //emcalQA->GetHistogramRanges()->SetHistoTimeRangeAndNBins(-275,275,250);
  emcalQA->GetHistogramRanges()->SetHistoTimeRangeAndNBins(-275,975,250);  
  emcalQA->GetHistogramRanges()->SetHistoRatioRangeAndNBins(0.,2.,100);
  emcalQA->GetHistogramRanges()->SetHistoVertexDistRangeAndNBins(0.,500.,500);
  emcalQA->GetHistogramRanges()->SetHistoNClusterCellRangeAndNBins(0,50,50);
  emcalQA->GetHistogramRanges()->SetHistoZRangeAndNBins(-350,350,175);
  emcalQA->GetHistogramRanges()->SetHistoRRangeAndNBins(430,460,30);
  emcalQA->GetHistogramRanges()->SetHistoV0SignalRangeAndNBins(0,5000,100);
  emcalQA->GetHistogramRanges()->SetHistoV0MultiplicityRangeAndNBins(0,5000,100);
  emcalQA->GetHistogramRanges()->SetHistoTrackMultiplicityRangeAndNBins(0,2500,100);
  emcalQA->GetHistogramRanges()->SetHistoShowerShapeRangeAndNBins(0, 3, 120);
  emcalQA->GetHistogramRanges()->SetHistoDiffTimeRangeAndNBins(-300, 300, 120);
  emcalQA->GetHistogramRanges()->SetHistoTrackResidualEtaRangeAndNBins(-0.075,0.075,50);
  emcalQA->GetHistogramRanges()->SetHistoTrackResidualPhiRangeAndNBins(-0.075,0.075,50);

  if(printSettings) emcalQA->Print("");
  
  // #### Configure Maker ####
  AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
  if(ssuffix.Contains("default")) maker->SwitchOffDataControlHistograms();
  else                            maker->SwitchOnDataControlHistograms();
  maker->SetReader(reader);//pointer to reader
  maker->SetCaloUtils(cu); //pointer to calorimeter utils
  maker->AddAnalysis(emcalQA,0);
  maker->SetAnaDebug(-1)  ; // 0 to at least print the event number
  maker->SwitchOnHistogramsMaker()  ;
  maker->SwitchOffAODsMaker()  ;
  
  if(simulation)
  {
    // Calculate the cross section weights, apply them to all histograms 
    // and fill xsec and trial histo. Sumw2 must be activated.
    //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionCalculation(); 
    //maker->SwitchOnSumw2Histograms();
    
    // For recent productions where the cross sections and trials are not stored in separate file
    //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionFromEventHeader() ;
    
    // Just fill cross section and trials histograms.
    maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionHistoFill(); 
    
    // Add control histogram with pT hard to control aplication of weights 
    maker->SwitchOnPtHardHistogram();
  }
  
  if(printSettings) maker->Print("");
  
  printf("======================== \n");
  printf("AddTaskCalorimeterQA() - End Configuration \n");
  printf("======================== \n");
  
  // Create task
  //===========================================================================
  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CalorimeterPerformance_%s",suffix));
  
  //task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
  
  //task->SetDebugLevel(-1);
  
  task->SetAnalysisMaker(maker);	
  
  task->SetBranches("ESD:AliESDRun.,AliESDHeader"); //just a trick to get Constantin's analysis to work
  
  mgr->AddTask(task);
  
  //Create containers
  //  AliAnalysisDataContainer *cout_pc = mgr->CreateContainer("Calo.Performance",TList::Class(),
  //							   AliAnalysisManager::kOutputContainer, "Calo.Performance.root");
	
  TString cname;
  if(outputFile.Length()==0)outputFile = AliAnalysisManager::GetCommonFileName(); 
  
  
  cname = Form("CaloQA_%s", suffix);
  AliAnalysisDataContainer *cout_pc   = mgr->CreateContainer(cname, TList::Class(), 
                                                             AliAnalysisManager::kOutputContainer, 
                                                             Form("%s:%s",outputFile.Data(),cname.Data()));
  
//  cname = Form("CaloQACuts_%s", suffix);
//  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(cname, TList::Class(), 
//                                                             AliAnalysisManager::kParamContainer, 
//                                                             Form("%s:%s",outputFile.Data(),cname.Data()));
  
	//Form("%s:PartCorrCuts",outputfile.Data()));	
  // Create ONLY the output containers for the data produced by the task.
  // Get and connect other common input/output containers via the manager as below
  //==============================================================================
  mgr->ConnectInput  (task, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput (task, 1, cout_pc);
//  mgr->ConnectOutput (task, 2, cout_cuts);
  
  return task;
}
Esempio n. 2
0
///
/// Main method calling all the configuration
/// Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
///
/// The options that can be passed to the macro are:
/// \param calorimeter : A string with he calorimeter used to measure the trigger particle.
/// \param simulation : A bool identifying the data as simulation.
/// \param collision: A string with the colliding system.
/// \param period : A string with the data period: LHC11h, LHC15n ... from it we extract the year.
/// \param qaan: execute the detector QA analysis.
/// \param hadronan: execute the track QA and cluster-track correlation analysis.
/// \param calibrate: if OADB was updated with calibration parameters not used in reconstruction, apply them here.
/// \param minTime: minimum time cut, leave it open by default even if calibration available, ns
/// \param maxTime: maximum time cut, leave it open by default even if calibration available, ns
/// \param minCen : An int to select the minimum centrality, -1 means no selection.
/// \param maxCen : An int to select the maximum centrality, -1 means no selection.
/// \param debugLevel : An int to define the debug level of all the tasks.
/// \param suffix : A string with the type of trigger (default: MB, EMC).
///
AliAnalysisTaskCaloTrackCorrelation *AddTaskPi0IMGammaCorrQA(const TString  calorimeter   = "EMCAL",
                                                             Bool_t   simulation    = kFALSE,
                                                             TString  collision     = "pp",
                                                             TString  period        = "",
                                                             const Bool_t   qaan          = kTRUE,
                                                             const Bool_t   hadronan      = kTRUE,
                                                             const Bool_t   calibrate     = kFALSE,
                                                             const Int_t    minTime       = -1000,
                                                             const Int_t    maxTime       =  1000,
                                                             const Int_t    minCen        = -1,
                                                             const Int_t    maxCen        = -1,
                                                             const Int_t    debugLevel    = -1,
                                                             const char *   suffix        = "default"
                                                             )
{
  // Check the global variables, and reset the provided ones if empty.
  //
  TString trigger  = suffix;
  
  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/GetAlienGlobalProductionVariables.C");
  
  Int_t   year        = 2017;
  Bool_t  printGlobal = kFALSE;
  if ( trigger.Contains("default") || trigger.Contains("INT") || trigger.Contains("MB") ) printGlobal = kTRUE;
  
  GetAlienGlobalProductionVariables(simulation,collision,period,year,printGlobal);
  
  // Get the pointer to the existing analysis manager via the static access method.
  //
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) 
  {
    ::Error("AddTaskPi0IMGammaCorrQA", "No analysis manager to connect to.");
    return NULL;
  }  
  
  // Check the analysis type using the event handlers connected to the analysis manager.
  //
  if (!mgr->GetInputEventHandler()) 
  {
    ::Error("AddTaskPi0IMGammaCorrQA", "This task requires an input event handler");
    return NULL;
  }
  
  //
  // Create task
  //
  
  // Name for containers
  TString containerName = Form("%s_Trig_%s",calorimeter.Data(), trigger.Data());
  
  if(collision!="pp" && maxCen>=0) containerName+=Form("Cen%d_%d",minCen,maxCen);
  
  TString taskName =Form("Pi0IM_GammaTrackCorr_%s",containerName.Data());
  
  AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (taskName);
  //task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
  task->SetDebugLevel(debugLevel);
  //task->SetBranches("ESD:AliESDRun.,AliESDHeader");
  //task->SetBranches("AOD:header,tracks,vertices,emcalCells,caloClusters");
  
  //
  // Init main analysis maker and pass it to the task
  AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
  task->SetAnalysisMaker(maker);
  
  //
  // Pass the task to the analysis manager
  mgr->AddTask(task);
  
  //
  // Create containers
  TString outputfile = AliAnalysisManager::GetCommonFileName();
  
  AliAnalysisDataContainer *cout_pc   = mgr->CreateContainer(trigger, TList::Class(),
                                                             AliAnalysisManager::kOutputContainer, 
                                                             Form("%s:%s",outputfile.Data(),Form("Pi0IM_GammaTrackCorr_%s",calorimeter.Data())));
  
  AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",trigger.Data()), TList::Class(),
                                                             AliAnalysisManager::kParamContainer, 
                                                             Form("%s_Parameters.root",Form("Pi0IM_GammaTrackCorr_%s",calorimeter.Data())));
  
  // Create ONLY the output containers for the data produced by the task.
  // Get and connect other common input/output containers via the manager as below
  mgr->ConnectInput  (task, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput (task, 1, cout_pc);
  mgr->ConnectOutput (task, 2, cout_cuts);
  //==============================================================================
  
  // Do not configure the wagon for certain analysis combinations
  // But create the task so that the sub-wagon train can run
  //
  gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/CheckActiveEMCalTriggerPerPeriod.C");
  Bool_t doAnalysis = CheckActiveEMCalTriggerPerPeriod(simulation,trigger,period,year);
  if(!doAnalysis) 
  {
    maker->SwitchOffProcessEvent();
    return task;
  }
  
  // #### Start analysis configuration ####
  //  
  TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  
  // Make sure the B field is enabled for track selection, some cuts need it
  //
  ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
  
  // Print settings to check all is as expected
  //
  printf("AddTaskPi0IMGammaCorrQA - Task NAME: %s \n",taskName.Data());
  
  printf("AddTaskPi0IMGammaCorrQA - Settings: data <%s>, calo <%s>, MC <%d>, collision <%s>, trigger <%s>, period <%s>, year <%d>,\n"
         "\t \t \t  CaloQA on <%d>, Track QA on <%d>, Make corrections <%d>, %d < time < %d, %d < cen < %d, debug level <%d> \n", 
         inputDataType.Data(), calorimeter.Data(),simulation, collision.Data(),trigger.Data(), period.Data(), year,
         qaan , hadronan, calibrate, minTime, maxTime, minCen, maxCen, debugLevel);
  //
  
  // General frame setting and configuration
  maker->SetReader   ( ConfigureReader   (inputDataType,collision,calibrate,minTime,maxTime,minCen,maxCen,simulation,year,debugLevel) );
  if(hadronan)maker->GetReader()->SwitchOnCTS();
  
  maker->SetCaloUtils( ConfigureCaloUtils(calorimeter,trigger,simulation,calibrate,year,debugLevel) );
  
  // Analysis tasks setting and configuration
  Int_t n = 0;//Analysis number, order is important
  
  // Cell QA
  if(qaan) maker->AddAnalysis(ConfigureQAAnalysis(calorimeter,collision,
                                                  //simulation,
                                                  year,debugLevel),n++);
  
  // Analysis with EMCal trigger or MB
  if ( !trigger.Contains("DCAL") )
  {
    // Cluster selection
    maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,0,collision,containerName,simulation,year,debugLevel)       ,n++); 
    // Previous cluster invariant mass
    maker->AddAnalysis(ConfigurePi0Analysis   (calorimeter,0,collision,containerName,simulation,year,debugLevel,minCen),n++);     
    if(hadronan)
    {
      // Isolation of selected clusters by AliAnaPhoton
      maker->AddAnalysis(ConfigureIsolationAnalysis("Photon",calorimeter,0,collision,containerName,simulation,year,debugLevel), n++);
      // Selected clusters-track correlation
      maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",calorimeter,0,collision,containerName,simulation,year,debugLevel,minCen), n++); 
    }
  }
  
  // Analysis with DCal trigger or MB
  if(year > 2014 && calorimeter=="EMCAL" && !trigger.Contains("EMCAL"))
  {
    // Cluster selection
    maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,1,collision,containerName,simulation,year,debugLevel)       , n++); 
    // Previous cluster invariant mass
    maker->AddAnalysis(ConfigurePi0Analysis   (calorimeter,1,collision,containerName,simulation,year,debugLevel,minCen),n++); 
    if(hadronan)
    {
      // Isolation of selected clusters by AliAnaPhoton
      maker->AddAnalysis(ConfigureIsolationAnalysis("Photon",calorimeter,1,collision,containerName,simulation,year,debugLevel), n++);
      // Selected clusters-track correlation
      maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",calorimeter,1,collision,containerName,simulation,year,debugLevel,minCen), n++); 
    }
  }
  
  // Charged tracks plots, any trigger
  if(hadronan)
    maker->AddAnalysis(ConfigureChargedAnalysis(collision,containerName,simulation,year,debugLevel), n++); 
  
  if(simulation)
  {
    // Calculate the cross section weights, apply them to all histograms 
    // and fill xsec and trial histo. Sumw2 must be activated.
    //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionCalculation(); 
    //maker->SwitchOnSumw2Histograms();
    
    // For recent productions where the cross sections and trials are not stored in separate file
    //maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionFromEventHeader() ;
    
    // Just fill cross section and trials histograms.
    maker->GetReader()->GetWeightUtils()->SwitchOnMCCrossSectionHistoFill(); 
    
    // Add control histogram with pT hard to control aplication of weights 
    maker->SwitchOnPtHardHistogram();
  }
  
  //
  // Select events trigger depending on trigger
  //
  if(!simulation)
  {    
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/ConfigureAndGetEventTriggerMaskAndCaloTriggerString.C");
    TString caloTriggerString = "";
    UInt_t mask = ConfigureAndGetEventTriggerMaskAndCaloTriggerString(trigger, year, caloTriggerString);
    
    task ->SelectCollisionCandidates( mask );
    maker->GetReader()->SetFiredTriggerClassName(caloTriggerString);
    printf("AddTaskPi0IMGammaCorrQA - Trigger Mask %d, caloTriggerString <%s>\n", mask, caloTriggerString.Data());
  }
  
  //
  // Final maker settings
  //
  maker->SetAnaDebug(debugLevel)  ;
  maker->SwitchOnHistogramsMaker()  ;
  maker->SwitchOnAODsMaker() ;
  maker->SwitchOnDataControlHistograms(); 
  
  if(debugLevel > 0) maker->Print("");
  
  return task;
}