예제 #1
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;
}
예제 #2
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;
}
예제 #3
0
void AddAnalysisTasks(const char *cdb_location)
{
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  mgr->SetCommonFileName("QAresults.root");
  // Statistics task
  mgr->AddStatisticsTask(kTriggerMask);
  //
  // CDB connection
  //
  if (doCDBconnect) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskCDBconnect.C");
    AliTaskCDBconnect *taskCDB = AddTaskCDBconnect(cdb_location, run_number);
    if (!taskCDB) return;
  }    
  
  //
  // Event Statistics (Jan Fiete)
  //
  if (doEventStat) {
      gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
      AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kTRUE /*MC*/);
  }
  //
  // PIDResponse(JENS)
  //
  if (doPIDResponse) {
    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); 
    AliAnalysisTaskPIDResponse *PIDResponse = AddTaskPIDResponse(kTRUE);
    PIDResponse->SelectCollisionCandidates(kTriggerMask);
  }  

   
  //
  // Centrality (A. Toia)
  //
  if (doCentrality) 
  {
    if(run_flag >= 1500)
    {
      gROOT->LoadMacro("$ALICE_PHYSICS/OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C");
      AliMultSelectionTask *taskMult = AddTaskMultSelection();
      taskMult->SetAlternateOADBforEstimators(periodName);
    }
    else
      // old scheme is only valid for PbPb
      if (iCollisionType == kPbPb)
      {
        gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskCentrality.C");
        AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
        taskCentrality->SetMCInput();
      }
  }   
  
  // Vertexing (A. Dainese)
  // 
  if (doVertex) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskVertexESD.C");
    // Specific setting for MC
    AliAnalysisTaskVertexESD* taskvertexesd =  AddTaskVertexESD(kTRUE, kTriggerMask);
    taskvertexesd->SelectCollisionCandidates(kTriggerMask);
  }  

  // TPC QA (E. Sicking)
  //
  if (doQAsym) {
  // offline trigger in AddTask
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskQAsym.C");
    AliAnalysisTaskSE * taskqasim = AddTaskQAsym(0, kTriggerMask, kTriggerHM, kTriggerEMC, kTriggerMuonBarell);
  }  
  //
  // VZERO QA  (C. Cheshkov)
  //
  if (doVZERO) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskVZEROQA.C");
    AliAnalysisTaskSE * taskv0qa = AddTaskVZEROQA(0);
//  taskv0qa->SelectCollisionCandidates();
  }
  if (doVZEROPbPb) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/VZERO/AddTaskVZEROPbPb.C");
    AliAnaVZEROPbPb* taskV0PbPb = (AliAnaVZEROPbPb*)AddTaskVZEROPbPb(run_number);
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVLNWU-,CVLN-");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU,CPBI2,CPBI1WU-,CPBI1-,CVHNWU,CVHN,CVLNWU,CVLN");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_B2-,CVLNWU_B2-");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_R1-,CVLN_B2-,CVLNWU_R1-,CVLNWU_B2-");
//    taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_R1-,CVLN_B2-,CVLNWU_R1-,CVLNWU_B2-,CSEMI_R1-,CSEMIWU_R1-,CCENT_R2-,CCENTWU_R2-");
  }
  //
  // TPC (Jacek Otwinowski & Michael Knichel)
  //
  //
  // Optionally MC information can be used by setting the 1st argument to true
  // Optionally friends information can be switched off by setting the 2st argument 
  // to false
  // Optionally highMult axis can be used by setting the 3st argument to true (for PbPb)
  if (doTPC) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
    AliPerformanceTask *tpcQA = 0;
    if (iCollisionType==kPbPb  || iCollisionType == kXeXe) {
       // High multiplicity Pb-Pb
       tpcQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kTRUE);
    } else {
      // Low multiplicity (pp)
       tpcQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kFALSE);
    }
    tpcQA->SelectCollisionCandidates(kTriggerMask);
    AliPerformanceRes::SetMergeEntriesCut(5000000); 
  }  

  // HLT (Alberica Toia)
  if (doHLT) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
    AliPerformanceTask *hltQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kFALSE,0,kTRUE);
    hltQA->SelectCollisionCandidates(kTriggerMask);
  }  
  //
  // SPD (A. Mastroserio)
  //
  if (doSPD) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskSPDQA.C");
    AliAnalysisTaskSPD* taskspdqa = (AliAnalysisTaskSPD*)AddTaskSPDQA();
    // Request from Annalisa
    if (iCollisionType==kPbPb  || iCollisionType == kXeXe) taskspdqa->SetHeavyIonMode();
    taskspdqa->SelectCollisionCandidates(kTriggerMask);
    taskspdqa->SetOCDBInfo(run_number, "raw://");
  }  
  //
  // SDD (F. Prino)
  //
  if (doSDD) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddSDDPoints.C");
    AliAnalysisTaskSE* tasksdd = AddSDDPoints();
    tasksdd->SelectCollisionCandidates(kTriggerMask);
  }
  //
  // SSD dEdx (Marek Chojnacki)
  //
  if (doSSDdEdx) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskdEdxSSDQA.C");
    AliAnalysisTaskSE* taskssddedx = AddTaskdEdxSSDQA();
    taskssddedx->SelectCollisionCandidates(kTriggerMask);
  }

  //
  // ITS
  //
  if (doITS) {
  // hardcoded non-zero trigger mask
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskPerformanceITS.C");
      AliAnalysisTaskITSTrackingCheck *itsQA = 0;
      AliAnalysisTaskITSTrackingCheck *itsQACent0010 = 0;
      AliAnalysisTaskITSTrackingCheck *itsQACent3050 = 0;
      AliAnalysisTaskITSTrackingCheck *itsQACent6080 = 0;
      itsQA = AddTaskPerformanceITS(kTRUE);
      if(iCollisionType==kPbPb) {
        itsQACent0010 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,3500,10000);
        itsQACent3050 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,590,1570);
        itsQACent6080 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,70,310);
      }
      else if(iCollisionType==kXeXe) {
        itsQACent0010 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,2000,6000);
        itsQACent3050 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,350,1000);
        itsQACent6080 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,40,200);
      }
  }
  //
  // ITS saTracks, align (F.Prino)
  //
  if (doITSsaTracks) {
  // offline trigger in AddTask
     gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskITSsaTracks.C");
     AliAnalysisTaskITSsaTracks *itssaTracks = AddTaskITSsaTracks(kTRUE,kFALSE);
     itssaTracks->SelectCollisionCandidates(kTriggerMask);
  }   
  if (doITSalign) {
  // no offline trigger selection
     gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskITSAlign.C");
     AliAnalysisTaskITSAlignQA *itsAlign = AddTaskITSAlign(0,2011);
  }   
  //
  // Global tracks + V0s QA
  //
  if(doESDTracks) {
    // protection for bug fixed in v5-09-14
    Bool_t disable=kTRUE;
    if(gSystem->Getenv("ALIEN_JDL_PACKAGES")){
      TString packg=gSystem->Getenv("ALIEN_JDL_PACKAGES");
      TObjArray* pkgs=packg.Tokenize("##");
      Int_t np=pkgs->GetEntries();
      Int_t ver,n1,n2;
      Char_t str2[20];
      for(Int_t i=0; i<np; i++){
	TObjString* str=(TObjString*)pkgs->At(i);
	TString s=str->GetString();
	if(s.Contains("AliPhysics")){
	  s.ReplaceAll("VO_ALICE@","");
	  sscanf(s.Data(),"AliPhysics::v%d-%d-%d-%s",&ver,&n1,&n2,str2);
	  if(ver>=5 && n1>=9 && n2>=14){
	    printf("%s -> enable ESD track QA\n",s.Data());
	    disable=kFALSE;
	  }else{
	    disable=kTRUE;
	    printf("%s -> disable ESD track QA\n",s.Data());
	  }
	}
      }
    }
    if(!disable){
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskCheckESDTracks.C");
      AliAnalysisTaskCheckESDTracks* taskestr=AddTaskCheckESDTracks("QA",kFALSE,kTRUE,kTRUE);
      taskestr->SetPtBinning(160,0.,40.);
      taskestr->SelectCollisionCandidates(kTriggerMask);
    }
  }
  //
  // TRD (Alex Bercuci, M. Fasel) 
  //
  if(doTRD) {
  
   // no offline trigger selection
      // steer individual TRD tasks
      Bool_t 
      doCheckESD(kTRUE),  // AliTRDcheckESD
      doCheckDET(kTRUE),  // AliTRDcheckDET
      doEffic(kTRUE),     // AliTRDefficiency
      doResolution(kTRUE),// AliTRDresolution
      doCheckPID(kFALSE),  // AliTRDcheckPID
      doV0Monitor(kFALSE);// AliTRDv0Monitor
      AliTRDpwgppHelper::AddTrainPerformanceTRD(AliTRDpwgppHelper::Translate(doCheckESD, doCheckDET, doEffic, doResolution, doCheckPID, doV0Monitor));
  
  
  // no offline trigger selection
  //    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTrainPerformanceTRD.C");
      // steer individual TRD tasks
 //     Bool_t 
 //     doCheckESD(kTRUE),  // AliTRDcheckESD
 //     doCheckDET(kTRUE),  // AliTRDcheckDET
 //     doEffic(kTRUE),     // AliTRDefficiency
  //    doResolution(kTRUE),// AliTRDresolution
  //    doCheckPID(kFALSE),  // AliTRDcheckPID
  //    doV0Monitor(kFALSE);// AliTRDv0Monitor
  //    AddTrainPerformanceTRD(Translate(doCheckESD, doCheckDET, doEffic, doResolution, doCheckPID, doV0Monitor));
  }

  //
  // ZDC (Chiara Oppedisano) 
  //
  if(doZDC) {
  // hardcoded kMB trigger mask
     gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/ZDC/AddTaskZDCQA.C");
     AliAnalysisTaskSE *taskZDC = AddTaskZDCQA();
     taskZDC->SelectCollisionCandidates(kTriggerMask);
  }   
  //
  // Calorimetry (Gustavo Conesa)
  //

  if(doCALO) {
        
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/CaloTrackCorrelations/macros/QA/AddTaskCalorimeterQA.C");
      AliAnalysisTaskCaloTrackCorrelation *taskCaloQA = AddTaskCalorimeterQA("default");
      taskCaloQA->SetDebugLevel(0);
      
      taskCaloQA->GetAnalysisMaker()->GetCaloUtils()->SetEMCALGeometryName("EMCAL_COMPLETE12SMV1_DCAL_8SM");
      taskCaloQA->GetAnalysisMaker()->GetCaloUtils()->SetImportGeometryFromFile(kFALSE);
      taskCaloQA->GetAnalysisMaker()->GetCaloUtils()->SetNumberOfSuperModulesUsed(20);

      AliAnaCalorimeterQA * caloqa = (AliAnaCalorimeterQA*) taskCaloQA->GetAnalysisMaker()->GetListOfAnalysisContainers()->At(0);
      AliHistogramRanges* histoRanges = caloqa->GetHistogramRanges();
      histoRanges->SetHistoPhiRangeAndNBins(77*TMath::DegToRad(), 330*TMath::DegToRad(), 253) ;

      
      // offline mask set in AddTask to kMB
//      taskCaloQA->SelectCollisionCandidates(kTriggerMask);
      // Add a new calo task with EMC1 trigger only
//      taskCaloQA = AddTaskCalorimeterQA("trigEMC");
//      taskCaloQA->SelectCollisionCandidates(kTriggerEMC);
     
//      gROOT->LoadMacro("$ALICE_ROOT/PWGGA/CaloTrackCorrelations/macros/QA/AddTaskCalorimeterQA.C");
//      AliAnalysisTaskCaloTrackCorrelation*taskCaloQA=  AddTaskCalorimeterQA("ESD",  2012,  kFALSE,  kTRUE);
//      taskCaloQA->SetDebugLevel(0);
      // offline mask set in AddTask to kMB
//      taskCaloQA->SelectCollisionCandidates(kTriggerMask);
      // Add a new calo task with EMC1 trigger only
//      taskCaloQA=  AddTaskCalorimeterQA("ESD",  2012,  kFALSE,  kTRUE,  "",  "EMC7");
//      taskCaloQA->SetDebugLevel(0);
//      taskCaloQA->SelectCollisionCandidates(kTriggerEMC);

  
//      gROOT->LoadMacro("$ALICE_ROOT/PWGGA/CaloTrackCorrelations/macros/QA/AddTaskCalorimeterQA.C");
//       AliAnalysisTaskCaloTrackCorrelation *taskCaloQA = AddTaskCalorimeterQA("ESD", 2011, kFALSE, kTRUE);
//      taskCaloQA->SetDebugLevel(0);
      // offline mask set in AddTask to kMB
//      taskCaloQA->SelectCollisionCandidates(kTriggerMask);
      // Add a new calo task with EMC1 trigger only
//      taskCaloQA = AddTaskCalorimeterQA("ESD", 2011, kFALSE, kTRUE, "", "EMC7");
//      taskCaloQA->SetDebugLevel(0);
//      taskCaloQA->SelectCollisionCandidates(kTriggerEMC);
  }

  //
  // Muon Trigger
  //
  
  if(doMUONTrig) {
  // no offline trigger selection
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskMTRchamberEfficiency.C");
      AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency(kTRUE);
  }

  //
  // Muon Efficiency (not used)
  //

  if(doMUONEff) 
  {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/MUON/dep/AddTaskMUONTrackingEfficiency.C");
    AliAnalysisTaskMuonTrackingEff *muonEfficiency = AddTaskMUONTrackingEfficiency(kTRUE,kTRUE,"");
    if (!isMuonOnly) muonEfficiency->SelectCollisionCandidates(kTriggerMask);
    muonEfficiency->UseMCLabel(kTRUE);
  }

  //
  // Muon Performance (Philippe Pillot)
  //
  //
  if (doMUONPerf) 
  {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/MUON/dep/AddTaskMuonPerformance.C");
    AliAnalysisTaskMuonPerformance* muonPerformance = AddTaskMuonPerformance();
    if (!isMuonOnly) muonPerformance->SelectCollisionCandidates(kTriggerMask);
    muonPerformance->UseMCKinematics(kTRUE);
    muonPerformance->SetMCTrigLevelFromMatchTrk(kTRUE);
 }

  //
  // V0-Decay Reconstruction (Ana Marin) (not used)
  // 

  if (doV0) {
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskV0QA.C");
      AliAnalysisTaskV0QA *taskv0QA = AddTaskV0QA(kTRUE);
  }
  //
  // Impact parameter resolution ([email protected], [email protected])
  //
  if (doImpParRes) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskImpParRes.C");
    AliAnalysisTaskSE* taskimpparres=0;
    // Specific setting for MC
    if(iCollisionType==kpp || iCollisionType==kpPb || iCollisionType==kPbp) {
       taskimpparres= AddTaskImpParRes(kTRUE);
    } else {
       taskimpparres= AddTaskImpParRes(kTRUE,-1,kTRUE,kFALSE);
    }
    taskimpparres->SelectCollisionCandidates(kTriggerMask);
  }  
  //
  // MUON QA (Philippe Pillot)
  //
  if (doMUON) {
  // trigger analysis internal
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/PilotTrain/AddTaskMuonQA.C");
    AliAnalysisTaskMuonQA* taskmuonqa = AddTaskMuonQA(kFALSE);
    taskmuonqa->GetTrackCuts()->SetIsMC(kTRUE);
  }  
  //
  // TOF (Francesca Bellini)
  //
  if (doTOF) {
  //    gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TOF/AddTaskTOFQA.C");
 //   AliAnalysisTaskTOFqa *tofQA = AddTaskTOFQA(kFALSE);
  //  tofQA->SelectCollisionCandidates(kTriggerMask);
   gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/TOF/AddTaskTOFqaID.C");
   AliAnalysisTaskTOFqaID *tofQA = AddTaskTOFqaID(kFALSE, AliVEvent::kAnyINT, 0, kFALSE, "", kTRUE, 0);
//   tofQA->SelectCollisionCandidates(kTriggerMask);
 } 
  //
  // PIDqa(JENS)
  //
  if (doPIDqa) {
    gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
    AliAnalysisTaskPIDqa *PIDQA = AddTaskPIDqa();
    PIDQA->SelectCollisionCandidates(kTriggerMask);
  }  
 
  //
  // HMPID QA (Giacomo Volpe)
  //
  if (doHMPID) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/HMPID/AddTaskHmpidQA.C");
    AliAnalysisTaskSE* taskhmpidqa= AddTaskHmpidQA(kTRUE);
      // offline mask set in AddTask to kMB
    taskhmpidqa->SelectCollisionCandidates(kTriggerMask);
  }      
  // T0 QA (Alla Mayevskaya)
  if (doT0) {
  // no offline trigger selection
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/T0/AddTaskT0QA.C");
    AliT0AnalysisTaskQA* taskt0qa= AddTaskT0QA();
    taskt0qa->SelectCollisionCandidates(kTriggerMask);
  }      
  // FMD QA (Christian Holm Christiansen)
  if (doFMD) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/AddTaskForwardQA.C");
    // Parameters: usemc, usecentrality
    AliAnalysisTaskSE *forwardQA = (AliAnalysisTaskSE *)AddTaskForwardQA(kTRUE, (Bool_t)doCentrality);
    // No offline trigger config. needed (see #84077)
  }
   //     
  // PHOS QA (Boris Polishchuk)
  //
  if (doPHOS) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/PHOSTasks/CaloCellQA/macros/AddTaskCaloCellsQA.C");
    //AliAnalysisTaskCaloCellsQA *taskPHOSCellQA1 = AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_AnyInt");
    AliAnalysisTaskCaloCellsQA *taskPHOSCellQA1 = AddTaskCaloCellsQA(5, 1, NULL,"PHOSCellsQA_AnyInt");
    taskPHOSCellQA1->SelectCollisionCandidates(kTriggerMask);
    taskPHOSCellQA1->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
    //AliAnalysisTaskCaloCellsQA *taskPHOSCellQA2 = AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_PHI7"); 
    AliAnalysisTaskCaloCellsQA *taskPHOSCellQA2 = AddTaskCaloCellsQA(5, 1, NULL,"PHOSCellsQA_PHI7");
    taskPHOSCellQA2->SelectCollisionCandidates(AliVEvent::kPHI7);
    taskPHOSCellQA2->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
    // Pi0 QA fo PbPb
    if (iCollisionType == kPbPb || iCollisionType == kXeXe) {
      gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/PHOSTasks/PHOS_PbPbQA/macros/AddTaskPHOSPbPb.C");
      AliAnalysisTaskPHOSPbPbQA* phosPbPb = AddTaskPHOSPbPbQA(0);
    }
  } 
   if (doPHOSTrig) {
     gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/PHOSTasks/PHOS_TriggerQA/macros/AddTaskPHOSTriggerQA.C");
     AliAnalysisTaskPHOSTriggerQA *taskPHOSTrig = AddTaskPHOSTriggerQA(NULL);
  }   
  //
  // EMCAL QA (Gustavo Conesa)
  //
  if (doEMCAL) {
     gROOT->LoadMacro("$ALICE_PHYSICS/PWGGA/EMCALTasks/macros/AddTaskEMCALTriggerQA.C");
     AliAnalysisTaskEMCALTriggerQA *emctrig = AddTaskEMCALTriggerQA();
  }  
   //
  // EvTrk QA (Zaida)
  //
  if (doEvTrk) {
   gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/EvTrkSelection/AddSingleTrackEfficiencyTaskForAutomaticQA.C");
   AliAnalysisTask *task = AddSingleTrackEfficiencyTaskForAutomaticQA();
 }  
   //
  // AD QA (Michal Broz))
  //
  if (doAD) {
   gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/AD/AddTaskADQA.C");
   AliAnalysisTaskADQA *task = AddTaskADQA();
 }  

   
  //     
  // FLOW and BF QA (C.Perez && A.Rodriguez)
  //
  if (doFBFqa) {
    gROOT->LoadMacro("$ALICE_PHYSICS/PWGPP/macros/AddTaskFBFqa.C");
    AliAnalysisTaskSE *qaFBFMB = (AliAnalysisTaskSE*) AddTaskFBFqa("qaFBFmb",kFALSE);
    qaFBFMB->SelectCollisionCandidates(AliVEvent::kMB);
    AliAnalysisTaskSE *qaFBFSC = (AliAnalysisTaskSE*) AddTaskFBFqa("qaFBFsc",kFALSE);
    qaFBFSC->SelectCollisionCandidates(AliVEvent::kSemiCentral);
    AliAnalysisTaskSE *qaFBFCE = (AliAnalysisTaskSE*) AddTaskFBFqa("qaFBFce",kFALSE);
    qaFBFCE->SelectCollisionCandidates(AliVEvent::kCentral);
  }
}