AliPhysics  2c6b7ad (2c6b7ad)

Example of execution macro. More...

#include <Riostream.h>
#include <TString.h>
#include <TFile.h>
#include <TChain.h>
#include <TROOT.h>
#include <TSystem.h>
#include <TApplication.h>
#include <TKey.h>
#include <TProfile.h>
#include <TH1F.h>
#include "TGrid.h"
#include "TGridCollection.h"
#include "TAlienCollection.h"
#include "TGridResult.h"
#include "AliLog.h"
#include "AliAnalysisGrid.h"
#include "AliAnalysisManager.h"
#include "AliMCEventHandler.h"
#include "AliAnalysisTaskSE.h"
#include "AliESDEvent.h"
#include "AliAODEvent.h"
#include "AliESDInputHandler.h"
#include "AliAODInputHandler.h"
#include "AliAODHandler.h"
#include "AliMultiInputEventHandler.h"
#include "AliAnalysisDataContainer.h"
#include "AliAnalysisTaskCaloTrackCorrelation.h"
#include "AliAnaCaloTrackCorrMaker.h"
#include "PWGGA/CaloTrackCorrelations/macros/AddTaskGammaHadronCorrelationSelectAnalysis.C"
#include "AliPhysicsSelection.h"
#include "AliPhysicsSelectionTask.h"
#include "OADB/macros/AddTaskPhysicsSelection.C"
#include "AliMultSelectionTask.h"
#include "OADB/COMMON/MULTIPLICITY/macros/AddTaskMultSelection.C"
#include "AliTaskCDBconnect.h"
#include "PWGPP/PilotTrain/AddTaskCDBconnect.C"
#include "AliAnalysisTaskEMCALClusterize.h"
#include "PWGPP/EMCAL/macros/AddTaskEMCALClusterize.C"
#include "AliEmcalCorrectionTask.h"
#include "PWG/EMCAL/macros/AddTaskEmcalCorrectionTask.C"
Include dependency graph for ana.C:

Go to the source code of this file.

Enumerations

enum  anaModes {
  mLocal = 0, mPROOF = 1, mPlugin = 2, mGRID = 3,
  mLocal, mGRID, mLocal = 0, mPROOF = 1,
  mPlugin = 2, mGRID = 3, mLocalCAF = 4, mLocal,
  mLocalCAF, mPROOF, mGRID, mLocal,
  mLocalCAF, mPROOF, mGRID
}
 Different analysis modes. More...
 

Functions

void SetupPar (char *pararchivename)
 Execute multiplicity task. More...
 
void CheckInputData (const anaModes mode)
 Sets input data and tree strings. More...
 
void CreateChain (const anaModes mode, TChain *chain, TChain *chainxs)
 Fills chain with data files paths. More...
 
void CheckEnvironmentVariables ()
 
Bool_t GetAverageXsection (TTree *tree, Double_t &xs, Float_t &ntr, Int_t &n)
 
void LoadLibraries (Int_t)
 
void ana (anaModes mode=mGRID)
 

Variables

char * kInDir = (char*)"/user/data/files/"
 
char * kPattern = (char*)""
 Directory path to files. More...
 
Int_t kFile = 10
 Common pattern in directory name containing files. More...
 
char * kXML = (char*)"collection.xml"
 Maximum number of files to analyze. More...
 
const char * kXSFileName = (char*)"pyxsec.root"
 Global name for the xml collection file with data on grid. More...
 
TArrayF * xsArr
 Name of file with pT-hard cross sections. More...
 
TArrayItrArr
 
Bool_t bCheckXS = kFALSE
 Check during configuration the cross section, does not do anything to analysis. More...
 
Bool_t kMC = kFALSE
 Set some default values, but used values are set in the code! More...
 
TString kInputData = "ESD"
 With real data kMC = kFALSE. More...
 
Int_t kYear = 2011
 ESD, AOD, MC, deltaAOD. More...
 
TString kPeriod ="LHC11c"
 Year of data. More...
 
TString kCollision = "pp"
 Run period. More...
 
Bool_t outAOD = kFALSE
 Collision type: pp, pPb, PbPb. More...
 
TString kTreeName
 Create output AOD, needed by some. More...
 
TString kPass = ""
 "esdTree" or "aodTree" or "TE" for pure MC kinematics analysis More...
 
Int_t kRun = 0
 "passX" More...
 
Bool_t bEMCCluster = kFALSE
 Run number. More...
 
Bool_t bEMCCorrFra = kFALSE
 Use the EMCal clusterization task. More...
 
Int_t xTalkEmul = 0
 Use the EMCal correction framework. More...
 
Bool_t bAnalysis = kTRUE
 Activate cross-talk emulation, 0 -no, 1 do not subtract induced energy from reference cell, 2 subtract (preferred) More...
 
Bool_t bMultiplicity = kFALSE
 Do photon/pi0 isolation correlation analysis. More...
 

Detailed Description

Example of execution macro.

Example macro to do analysis with the analysis classes in CaloTrackCorrelations, in local, grid or plugin modes.

Pay attention to the options and definitions set in the lines below

Author
Gustavo Conesa Balbastre Gusta.nosp@m.vo.C.nosp@m.onesa.nosp@m..Bal.nosp@m.bastr.nosp@m.e@ce.nosp@m.rn.ch, (LPSC-CNRS)

Definition in file ana.C.

Enumeration Type Documentation

enum anaModes

Different analysis modes.

Enumerator
mLocal 
mPROOF 

Analyze locally files in your computer.

mPlugin 

Analyze files on GRID with Plugin.

mGRID 

Analyze files on GRID with Plugin.

mLocal 
mGRID 
mLocal 
mPROOF 

Analyze locally files in your computer.

mPlugin 

Analyze files on GRID with Plugin.

mGRID 

Analyze files on GRID with Plugin.

mLocalCAF 

Analyze files on GRID, jobs launched from aliensh.

mLocal 
mLocalCAF 
mPROOF 
mGRID 
mLocal 
mLocalCAF 
mPROOF 
mGRID 

Definition at line 102 of file ana.C.

Function Documentation

void ana ( anaModes  mode = mGRID)

Main execution method. It:

  • 1) loads the needed libraries in method LoadLibraries
  • 2) depending on the files path, run etc, the variables year, collision type, data type, are obtained in methods CheckInputData and CheckEnvironmentVariables
  • 3) put the data files in a list to be passed to the analysis frame in method CreateChain
  • 4) In case of MC pt-Hard bin simulations, the file containing the cross sections is read and scaling parameter is obtained via the method GetAverageXsection
  • 5) The analysis frame is initialized via de analysis manager
  • 6) Different general analysis are initialized: Physics selection, centrality etc.
  • 7) Specialized analysis are initialized: AliAnalysistaskCounter, AliAnalysisTaskEMCALClusterizer/EMCal correction framework, AliAnalysisTaskCaloTrackCorrelations and executed for different settings.
  • 8) The output/input containers are passed to the analysis manager
  • 9) The analysis is executed
Parameters
modeanalysis mode defined in enum anaModes

Definition at line 1037 of file ana.C.

Referenced by AddAnalysisTasks(), anaGenKine(), ConfigureChargedAnalysis(), ConfigureClusterPileUpAnalysis(), ConfigureClusterShape(), ConfigureElectronAnalysis(), ConfigureEMCALTriggerClusterAnalysis(), ConfigureGenKine(), ConfigureGenKineAnalysis(), ConfigureHadronCorrelationAnalysis(), ConfigureInClusterIMAnalysis(), ConfigureInvariantMassAnalysis(), ConfigureIsolationAnalysis(), ConfigurePhotonAnalysis(), ConfigurePhotonJetAnalysis(), ConfigurePi0Analysis(), ConfigurePi0EbEAnalysis(), ConfigurePi0Flow(), ConfigurePi0KineAnalysis(), ConfigureQAAnalysis(), ConfigureRandomTriggerAnalysis(), AliAnaCaloTrackCorrMaker::FillAndGetAODBranchList(), AliAnalysisTaskDmesonJetsDetectorResponse::FillHistograms(), AliAnaCaloTrackCorrMaker::GetListOfAnalysisCuts(), AliAnaCaloTrackCorrMaker::GetOutputContainer(), AliAnaCaloTrackCorrMaker::Init(), EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup::InitialiseAnalysisComponents(), EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup::Process(), EmpiricalMaker::ProcessCent(), AliAnaCaloTrackCorrMaker::ProcessEvent(), AliAnaPi0EbE::SetAnalysisType(), AliAnalysisTaskFullppJet::SetAnaType(), and AliAnaCaloTrackCorrMaker::Terminate().

void CheckEnvironmentVariables ( )

Access one data file and set the year, collision type and run number. It is possible to set them via external parameters.

Definition at line 746 of file ana.C.

Referenced by ana().

void CheckInputData ( const anaModes  mode)

Sets input data and tree strings.

Definition at line 219 of file ana.C.

Referenced by ana().

void CreateChain ( const anaModes  mode,
TChain chain,
TChain chainxs 
)

Fills chain with data files paths.

Definition at line 472 of file ana.C.

Referenced by ana().

Bool_t GetAverageXsection ( TTree tree,
Double_t xs,
Float_t ntr,
Int_t n 
)

Read the PYTHIA statistics from the file pyxsec.root created by the function WriteXsection(): integrated cross section (xsection) and the number of Pyevent() calls (ntrials) and calculate the weight per one event xsection/ntrials The spectrum calculated by a user should be multiplied by this weight, something like this: TH1F *userSpectrum ... // book and fill the spectrum userSpectrum->Scale(weight)

Yuri Kharlov 19 June 2007 Gustavo Conesa 15 April 2008 Add recovery of xs from pyxsec_hists.root file 15/jan/2015

Definition at line 889 of file ana.C.

Referenced by ana().

void LoadLibraries ( Int_t  )

Load analysis libraries. Add here the call to the SetUp par files if need to work on grid with modified code.

Definition at line 957 of file ana.C.

Referenced by ana().

void SetupPar ( char *  pararchivename)

Execute multiplicity task.

Load par files, create analysis libraries For testing, if par file already decompressed and modified classes then do not decompress.

Definition at line 174 of file ana.C.

Referenced by LoadPar().

Variable Documentation

Bool_t bAnalysis = kTRUE

Activate cross-talk emulation, 0 -no, 1 do not subtract induced energy from reference cell, 2 subtract (preferred)

Definition at line 165 of file ana.C.

Bool_t bCheckXS = kFALSE

Check during configuration the cross section, does not do anything to analysis.

Definition at line 145 of file ana.C.

Bool_t bEMCCluster = kFALSE

Run number.

Activate here the desired analysis combinations, what correction/clusterization.

Definition at line 161 of file ana.C.

Bool_t bEMCCorrFra = kFALSE

Use the EMCal clusterization task.

Definition at line 162 of file ana.C.

Bool_t bMultiplicity = kFALSE

Do photon/pi0 isolation correlation analysis.

Definition at line 167 of file ana.C.

TString kCollision = "pp"

Run period.

Definition at line 153 of file ana.C.

Int_t kFile = 10

Common pattern in directory name containing files.

Definition at line 117 of file ana.C.

Referenced by CheckInputData(), and CreateChain().

char* kInDir = (char*)"/user/data/files/"

Settings to read locally several files, only for "mLocal" mode The different values are default, they can be set with environmental variables: INDIR, PATTERN, NFILES, respectivelly

Definition at line 115 of file ana.C.

TString kInputData = "ESD"

With real data kMC = kFALSE.

Definition at line 150 of file ana.C.

Bool_t kMC = kFALSE

Set some default values, but used values are set in the code!

Definition at line 149 of file ana.C.

Referenced by ana(), ChainBuilder::CheckFile(), ChainBuilder::Create(), and emcalReclusterize().

TString kPass = ""

"esdTree" or "aodTree" or "TE" for pure MC kinematics analysis

Definition at line 156 of file ana.C.

char* kPattern = (char*)""

Directory path to files.

Definition at line 116 of file ana.C.

TString kPeriod ="LHC11c"

Year of data.

Definition at line 152 of file ana.C.

Int_t kRun = 0

"passX"

Definition at line 157 of file ana.C.

Referenced by CheckEnvironmentVariables(), and emcalReclusterize().

TString kTreeName

Create output AOD, needed by some.

Definition at line 155 of file ana.C.

char* kXML = (char*)"collection.xml"

Maximum number of files to analyze.

Collection file for grid analysis

Definition at line 131 of file ana.C.

Referenced by ChainBuilder::CheckSource(), and ChainBuilder::Create().

const char* kXSFileName = (char*)"pyxsec.root"

Global name for the xml collection file with data on grid.

Scale histograms from file. Change to kTRUE when xsection file exists Put name of file containing xsection Put number of events per ESD file This is an specific case for normalization of Pythia files.

Definition at line 138 of file ana.C.

Int_t kYear = 2011

ESD, AOD, MC, deltaAOD.

Definition at line 151 of file ana.C.

Bool_t outAOD = kFALSE
TArrayI* trArr

Definition at line 142 of file ana.C.

TArrayF* xsArr

Name of file with pT-hard cross sections.

Definition at line 141 of file ana.C.

Int_t xTalkEmul = 0

Use the EMCal correction framework.

Definition at line 163 of file ana.C.