1 #ifndef ALIANALYSISTASKEMCALEMBEDDINGHELPER_H 2 #define ALIANALYSISTASKEMCALEMBEDDINGHELPER_H 24 class AliGenPythiaEventHeader;
31 #include <TStopwatch.h> 33 #include <AliAnalysisTaskSE.h> 34 #include "AliEventCuts.h" 106 bool Initialize(
bool removeDummyTask =
false);
260 std::ostream &
Print(std::ostream &in)
const;
261 std::string
toString(
bool includeFileList =
false)
const;
Bool_t fRandomEventNumberAccess
If true, it will start embedding from a random entry in the file rather than from the first...
Double_t fZVertexCut
Z vertex cut on embedded event.
void UserExec(Option_t *option)
void RecordEmbeddedEventProperties()
void SetPrintTimingInfoToLog(bool b)
Set whether to print and plot execution time of InitTree()
Double_t GetPtHardJetPtRejectionFactor() const
void SetESD(const char *treeName="esdTree")
Set to embed from ESD.
void ConnectToAliEn() const
Int_t fPtHardBin
ptHard bin for the given pythia production
bool fMCRejectOutliers
If true, MC outliers will be rejected.
double fPythiaCrossSection
! Pythia cross section for the current event (extracted from the pythia header).
Bool_t GetRandomEventNumberAccess() const
void SetZVertexCut(Double_t zVertex)
std::string GetAutoConfigureTrainTypePath() const
double GetPythiaXSection() const
Int_t fLowerEntry
! First entry of the current tree to be used for embedding
TRandom3 fRandom
for random rejection of events
TString fFileListFilename
Name of the file list containing paths to files to embed.
void SetEmbeddedEventProperties()
int fPythiaTrialsFromFile
! Average number of trials extracted from a xsec file.
Bool_t fRandomFileAccess
If true, it will start embedding from a random file in the input files list.
void SetInputFilename(const char *filename)
TStopwatch fTimer
! Timer for the InitTree() function
Int_t fCurrentEntry
! Current entry in the current tree
TFile * fExternalFile
! External file used for embedding
bool GetMCRejectOutliers() const
Int_t fNPtHardBins
Total number of pt hard bins.
TChain * fChain
! External TChain (tree) containing the events available for embedding
void SetConfigurationPath(const char *path)
Set path to YAML configuration file.
void SetPtHardJetPtRejectionFactor(double factor)
void RemoveDummyTask() const
bool fAutoConfigurePtHardBins
If true, attempt to auto configure pt hard bins. Only works on the LEGO train.
bool fInitializedConfiguration
Notes if the configuration has been initialized.
bool IsRunInRunlist(const std::string &path) const
AliVEvent * GetExternalEvent() const
Retrieve the embedded event from the embedding helper.
AliVHeader * fExternalHeader
! Header of the current external event
void SetFilePattern(const char *pattern)
Sets the file pattern to select AliEn files. This pattern is used as input to the alien_find command...
TString GetFilePattern() const
AliGenPythiaEventHeader * fPythiaHeader
! Pythia header of the current external event
void SetCentralityRange(double min, double max)
Set internal event centrality selection.
bool EmbeddedEventUsed() const
void DetermineFirstFileToEmbed()
const AliEventCuts * GetInternalEventCuts() const
Event cuts object for accessing centrality, etc from another task if so inclined. ...
void SetMCRejectOutliers(bool reject=true)
TString GetTreeName() const
Int_t GetNPtHardBins() const
int GetPythiaTrials() const
void RetrieveTaskPropertiesFromYAMLConfig()
bool GetAutoConfigurePtHardBins() const
std::string GetAutoConfigureBasePath() const
TString fInputFilename
Filename of input root files.
friend std::ostream & operator<<(std::ostream &in, const AliAnalysisTaskEmcalEmbeddingHelper &myTask)
std::vector< std::string > fEmbeddedRunlist
Good runlist for files to embed.
std::string fAutoConfigureBasePath
The base path to the auto configuration (for example, "/alice/cern.ch/user/a/alitrain/") ...
UInt_t GetTriggerMask() const
void SetRandomRejectionFactor(Double_t configure=1.)
void Terminate(Option_t *option)
std::string fConfigurationPath
Path to YAML configuration.
void SetAutoConfigureTrainTypePath(std::string path)
void SetAutoConfigurePtHardBins(bool configure=true)
std::string fPythiaXSecFilename
Name of the pythia x sec filename (either "pyxsec.root" or "pyxsec_hists.root")
AliAnalysisTaskEmcalEmbeddingHelper()
bool fInitializedEmbedding
! Notes where the TChain has been initialized for embedding
AliVHeader * GetEventHeader() const
bool fUseInternalEventSelection
If true, apply internal event selection though AliEventCuts.
virtual ~AliAnalysisTaskEmcalEmbeddingHelper()
std::string toString(bool includeFileList=false) const
void SetAutoConfigureIdentifier(std::string path)
bool GetUseManualInternalEventSelection() const
Whether to use manual cuts for AliEventCuts.
Int_t GetPtHardBin() const
Implementation of task to embed external events.
TString GetInputFilename() const
UInt_t fMaxNumberOfFiles
! Max number of files that are in the TChain
bool PythiaInfoFromCrossSectionFile(std::string filename)
Bool_t CheckIsEmbeddedEventSelected()
void SetAutoConfigureBasePath(std::string path)
void SetUseManualInternalEventCuts(bool b=true)
std::string GenerateUniqueFileListFilename() const
void SetMaxVertexDistance(Double_t distance)
Double_t fMaxVertexDist
Max distance between Z vertex of internal and embedded event.
AliVEvent * fExternalEvent
! Current external event available for embedding
std::vector< std::string > fPythiaCrossSectionFilenames
Paths to the pythia xsection files.
void SetRandomFileAccess(Bool_t b)
Randomly select the first file to embed from the file list. Continues sequentially afterwards...
bool fPrintTimingInfoToLog
Flag to print time to execute InitTree(), for logging purposes.
TString fTreeName
Name of the ESD/AOD tree where the events are to be found.
void Print(Option_t *opt="") const
void SetNPtHardBins(Int_t n)
Set the number of pt hard bins in the production to properly format the histograms.
TString GetFileListFilename() const
Int_t fOffset
! Offset from fLowerEntry where the loop over the tree should start
void SetRandomEventNumberAccess(Bool_t b)
bool fCreateHisto
If true, create QA histograms.
bool fEmbeddedEventUsed
! If true, the internal event was selected, so the embedded event is used. Defaults to true so other ...
bool IsFileAccessible() const
UInt_t fTriggerMask
Trigger selection mask.
double GetPythiaPtHard() const
Bool_t GetRandomFileAccess() const
Enhanced TList-derived class that implements correct merging for pt_hard binned production.
bool fWrappedAroundTree
! Notes whether we have wrapped around the tree, which is important if the offset into the tree is no...
Double_t fPtHardJetPtRejectionFactor
Factor which the pt hard bin is multiplied by to compare against pythia header jets pt...
PWG::Tools::AliYAMLConfiguration fYAMLConfig
Hanldes configuration from YAML.
double fPythiaPtHard
! Pt hard of the current event (extracted from the pythia header).
void SetFileListFilename(const char *filename)
Set the path to a file containing the list of files to embed.
AliGenPythiaEventHeader * GetPythiaHeader() const
static AliAnalysisTaskEmcalEmbeddingHelper * AddTaskEmcalEmbeddingHelper()
bool GetCreateHistos() const
void SetPtHardBin(Int_t n)
Set the pt hard bin which will be added into the file pattern. Can also be omitted and set directly i...
THistManager fHistManager
Manages access to all histograms.
bool fInitializedNewFile
! Notes where the entry indices have been initialized for a new tree in the chain ...
static AliAnalysisTaskEmcalEmbeddingHelper * fgInstance
! Global instance of this class
UInt_t fFileNumber
! File number corresponding to the current tree
bool fUseManualInternalEventCuts
If true, manual event cuts mode will be used for AliEventCuts.
bool GetUseInternalEventSelection() const
Whether internal event selection is enabled.
Container class for histograms.
std::string RemoveTrailingSlashes(std::string filename) const
AliAnalysisTaskEmcalEmbeddingHelper & operator=(const AliAnalysisTaskEmcalEmbeddingHelper &)
void SetCreateHistos(bool b)
Create QA histograms. These are necessary for proper scaling, so be careful disabling them! ...
double fCentMax
Maximum centrality for internal event selection.
AliEmcalList * fOutput
! List which owns the output histograms to be saved
AliEventCuts fInternalEventCuts
If enabled, Handles internal event selection.
std::string GetAutoConfigureIdentifier() const
void UserCreateOutputObjects()
std::string fAutoConfigureIdentifier
How the auto configuration YAML file should be identified. (for example, "rehlersTrain") ...
Double_t fRandomRejectionFactor
factor by which to reject events
bool AutoConfigurePtHardBins()
void SetTriggerMask(UInt_t triggerMask)
void SetStartingFileIndex(Int_t n)
Select the file ID to start embedding from.
void SetAOD(const char *treeName="aodTree")
Set to embed from AOD.
void SetUseInternalEventSelection(bool b=true)
Enable internal event selection. Can also be enabled through the YAML configuration.
Int_t fUpperEntry
! Last entry of the current tree to be used for embedding
Int_t fFilenameIndex
Index of vector containing paths to files to embed.
double fPythiaCrossSectionFromFile
! Average pythia cross section extracted from a xsec file.
std::vector< std::string > fFilenames
Paths to the files to embed.
bool InitializeYamlConfig()
Double_t GetMaxVertexDistance() const
static AliAnalysisTaskEmcalEmbeddingHelper * ConfigureEmcalEmbeddingHelperOnLEGOTrain()
std::string fAutoConfigureTrainTypePath
The path associated with the train type (for example, "PWGJE/Jets_EMC_PbPb/")
Double_t GetZVertexCut() const
TString fFilePattern
File pattern to select AliEn files using alien_find.
AliVEvent * InputEvent() const
SHOULD NOT BE USED! Use GetExternalEvent()! SHOULD NOT BE USED! Use GetExternalEvent()! Returns the e...
bool Initialize(bool removeDummyTask=false)
void DeterminePythiaXSecFilename()
int fPythiaTrials
! Number of pythia trials for the current event (extracted from the pythia header).
double fCentMin
Minimum centrality for internal event selection.
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()
Int_t GetStartingFileIndex() const
std::string ConstructFullPythiaXSecFilename(std::string inputFilename, const std::string &pythiaFilename, bool testIfExists) const