AliPhysics  5403132 (5403132)

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 "AliPhysicsSelection.h"
#include "AliPhysicsSelectionTask.h"
#include "AliMultiInputEventHandler.h"
#include "AliAnalysisTaskCaloTrackCorrelation.h"
#include "AliAnalysisTaskCounter.h"
#include "AliAnalysisDataContainer.h"
#include "TSystemDirectory.h"
#include "CreateESDChain.C"
#include "AddTaskPhysicsSelection.C"
#include "AliCentralitySelectionTask.h"
#include "AliMultSelectionTask.h"
#include "AliVZEROEPSelectionTask.h"
#include "AliEPSelectionTask.h"
#include "AddTaskCentrality.C"
#include "AddTaskMultSelection.C"
#include "AddTaskVZEROEPSelection.C"
#include "AddTaskEventplane.C"
#include "AddTaskCounter.C"
#include "AliAnalysisTaskEMCALClusterize.h"
#include "AddTaskEMCALClusterize.C"
#include "AliAnaCalorimeterQA.h"
#include "AddTaskCalorimeterQA.C"
#include "AddTaskCaloTrackCorr.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 LoadLibraries (Int_t)
 Load analysis libraries. More...
 
void SetupPar (char *pararchivename)
 
void CheckInputData (const Int_t mode)
 Sets input data and tree strings. More...
 
void CreateChain (const Int_t 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 ana (Int_t mode=mGRID)
 

Variables

char * kInDir = (char*)"/user/data/files/"
 
char * kPattern = (char*)""
 Global, path to data files. More...
 
Int_t kFile = 2
 Data are in files kInDir/kPattern+i. More...
 
char * kDatasetPROOF = (char*)"/alice/vernet/LHC11b_149646"
 Number of files to analyze in local mode. More...
 
Int_t kDatasetNMaxFiles = 20
 
TString ccin2p3UserName = "arbor"
 
TString alienUserName = "narbor"
 
char * kXML = (char*)"collection.xml"
 
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 kMC = kFALSE
 
TString kInputData = "ESD"
 With real data kMC = kFALSE. More...
 
Int_t kYear = 2011
 ESD, AOD, MC, deltaAOD. More...
 
TString kCollision = "pp"
 
Bool_t outAOD = kFALSE
 
TString kTreeName
 Some tasks doesnt need it. More...
 
TString kPass = ""
 
char kTrigger [1024]
 
Int_t kRun = 0
 

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 84 of file ana.C.

Function Documentation

void ana ( Int_t  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, 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 162 of file ana.C.

Referenced by AddAnalysisTasks(), anaGenKine(), ConfigureChargedAnalysis(), ConfigureClusterPileUpAnalysis(), ConfigureClusterShape(), ConfigureElectronAnalysis(), ConfigureEMCALTriggerClusterAnalysis(), ConfigureGenKine(), ConfigureGenKineAnalysis(), ConfigureHadronCorrelationAnalysis(), ConfigureInClusterIMAnalysis(), 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 1201 of file ana.C.

Referenced by ana().

void CheckInputData ( const Int_t  mode)

Sets input data and tree strings.

Definition at line 726 of file ana.C.

Referenced by ana().

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

Fills chain with data files paths.

Definition at line 968 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 1293 of file ana.C.

Referenced by ana().

void LoadLibraries ( Int_t  )

Load analysis libraries.

Definition at line 612 of file ana.C.

Referenced by ana().

void SetupPar ( char *  pararchivename)

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

Definition at line 680 of file ana.C.

Referenced by LoadPar().

Variable Documentation

TString alienUserName = "narbor"

Definition at line 108 of file ana.C.

TString ccin2p3UserName = "arbor"

Definition at line 107 of file ana.C.

TString kCollision = "pp"

Definition at line 132 of file ana.C.

Referenced by ana().

Int_t kDatasetNMaxFiles = 20

Definition at line 106 of file ana.C.

char* kDatasetPROOF = (char*)"/alice/vernet/LHC11b_149646"

Number of files to analyze in local mode.

Definition at line 105 of file ana.C.

Int_t kFile = 2

Data are in files kInDir/kPattern+i.

Definition at line 99 of file ana.C.

Referenced by CheckInputData(), and CreateChain().

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

Definition at line 97 of file ana.C.

Referenced by CheckInputData(), and CreateChain().

TString kInputData = "ESD"

With real data kMC = kFALSE.

Definition at line 130 of file ana.C.

TString kPass = ""

Definition at line 135 of file ana.C.

char* kPattern = (char*)""

Global, path to data files.

Definition at line 98 of file ana.C.

Referenced by CheckInputData(), and CreateChain().

Int_t kRun = 0

Definition at line 137 of file ana.C.

Referenced by ana(), CheckEnvironmentVariables(), CheckInputData(), and emcalReclusterize().

TString kTreeName

Some tasks doesnt need it.

Definition at line 134 of file ana.C.

char kTrigger[1024]

Definition at line 136 of file ana.C.

Referenced by CheckEnvironmentVariables().

char* kXML = (char*)"collection.xml"
const char* kXSFileName = (char*)"pyxsec.root"

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

Definition at line 120 of file ana.C.

Referenced by CreateChain().

Int_t kYear = 2011

ESD, AOD, MC, deltaAOD.

Definition at line 131 of file ana.C.

Referenced by ana(), and CheckEnvironmentVariables().

TArrayI* trArr

Definition at line 124 of file ana.C.

TArrayF* xsArr

Name of file with pT-hard cross sections.

Definition at line 123 of file ana.C.

Referenced by CreateChain(), and GetAverageXsection().