]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/AliJetEmbeddingFromAODTask.h
Move GenerateFixedBinArray to AliAnalysisTaskEmcal and change data type from Float...
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliJetEmbeddingFromAODTask.h
1 #ifndef ALIJETEMBEDDINGFROMAODTASK_H
2 #define ALIJETEMBEDDINGFROMAODTASK_H
3
4 // $Id$
5
6 class TFile;
7 class TObjArray;
8 class TClonesArray;
9 class TString;
10 class AliVCaloCells;
11 class AliVHeader;
12 class TH2;
13 class TH1;
14 class TLorentzVector;
15 class AliNamedString;
16
17 #include "AliJetModelBaseTask.h"
18
19 class AliJetEmbeddingFromAODTask : public AliJetModelBaseTask {
20  public:
21   AliJetEmbeddingFromAODTask();
22   AliJetEmbeddingFromAODTask(const char *name, Bool_t drawqa=kFALSE); 
23   virtual ~AliJetEmbeddingFromAODTask();
24
25   void           UserCreateOutputObjects();
26   Bool_t         UserNotify();
27
28   void           SetFileList(TObjArray *list)                      { fFileList           = list  ; }
29   void           SetAODTreeName(const char *t)                     { fAODTreeName        = t     ; }
30   void           SetAODHeaderName(const char *t)                   { fAODHeaderName      = t     ; }
31   void           SetAODTracksName(const char *n)                   { fAODTrackName       = n     ; }
32   void           SetAODClusName(const char *n)                     { fAODClusName        = n     ; }
33   void           SetAODCellsName(const char *n)                    { fAODCellsName       = n     ; }
34   void           SetAODMCParticlesName(const char *n)              { fAODMCParticlesName = n     ; }
35   void           SetCentralityRange(Double_t min, Double_t max)    { fMinCentrality      = min   ; fMaxCentrality    = max ; }
36   void           SetTriggerMask(UInt_t mask)                       { fTriggerMask        = mask  ; }
37   void           SetAODfilterBits(Int_t b0 = 0, Int_t b1 = 0)      { fAODfilterBits[0]   = b0    ; fAODfilterBits[1] = b1  ; }
38   void           SetIncludeNoITS(Bool_t f)                         { fIncludeNoITS       = f     ; }
39   void           SetCutMaxFractionSharedTPCClusters(Double_t c = 0.4) { fCutMaxFractionSharedTPCClusters  = c ; }
40   void           SetUseNegativeLabels(Bool_t f)                    { fUseNegativeLabels  = f     ; }
41   void           SetTrackEfficiency(Double_t eff = 0.95)           { fTrackEfficiency    = eff   ; }
42   void           SetTotalFiles(Int_t n)                            { fTotalFiles         = n     ; }
43   void           SetAttempts(Int_t n)                              { fAttempts           = n     ; }
44   void           SetRandomAccess(Bool_t r=kTRUE)                   { fRandomAccess       = r     ; }
45   void           SetAODMC(Bool_t a)                                { fIsAODMC            = a     ; }
46   void           SetJetMinPt(Double_t pt)                          { fJetMinPt           = pt    ; }
47   void           SetJetEtaRange(Double_t emi, Double_t ema)        { fJetMinEta = emi; fJetMaxEta = ema; }
48   void           SetJetPhiRange(Double_t pmi, Double_t pma)        { fJetMinPhi = pmi; fJetMaxPhi = pma; }
49   void           SetJetConstituentMinPt(Double_t pt)               { fJetConstituentMinPt= pt    ; }
50   void           SetJetType(Byte_t t)                              { fJetType            = t     ; }
51   void           SetJetAlgo(Byte_t t)                              { fJetAlgo            = t     ; }
52   void           SetZVertexCut(Double_t z)                         { fZVertexCut         = z     ; }
53   void           SetMaxVertexDist(Double_t d)                      { fMaxVertexDist      = d     ; }
54   void           SetParticlePtRange(Double_t min, Double_t max, Byte_t t=1) { fParticleMinPt = min; fParticleMaxPt = max; fParticleSelection = t; }
55
56  protected:
57   Bool_t          ExecOnce()            ;// intialize task
58   void            Run()                 ;// do jet model action
59   virtual TFile  *GetNextFile()         ;// get next file from fFileList
60   virtual Bool_t  OpenNextFile()        ;// open next file
61   virtual Bool_t  GetNextEntry()        ;// get next entry in current tree
62   virtual Bool_t  IsAODEventSelected()  ;// AOD event trigger/centrality selection
63   TLorentzVector  GetLeadingJet(TClonesArray *tracks, TClonesArray *clusters=0);  // get the leading jet
64   Bool_t          FindParticleInRange(TClonesArray *array);// Find particle in array within range (fParticleMinPt, fParticleMaxPt)
65
66   TObjArray     *fFileList            ;//  List of AOD files 
67   Bool_t         fRandomAccess        ;//  Random access to file number and event
68   TString        fAODTreeName         ;//  Name of the tree in the AOD file
69   TString        fAODHeaderName       ;//  Name of the header in the AOD tree
70   TString        fAODVertexName       ;//  Name of the vertex branch in the AOD tree
71   TString        fAODTrackName        ;//  Name of the track collection branch in the AOD tree
72   TString        fAODClusName         ;//  Name of the cluster collection branch in the AOD tree
73   TString        fAODCellsName        ;//  Name of the cell collection branch in the AOD tree
74   TString        fAODMCParticlesName  ;//  Name of the cell collection branch in the AOD tree
75   Double_t       fMinCentrality       ;//  Minimum centrality
76   Double_t       fMaxCentrality       ;//  Maximum centrality
77   UInt_t         fTriggerMask         ;//  Trigger selection mask
78   Double_t       fZVertexCut          ;//  Z vertex cut
79   Double_t       fMaxVertexDist       ;//  Maximum distance allowed between the vertices of the current and the embedded events
80   Double_t       fJetMinPt            ;//  Select events with a minimum jet pt
81   Double_t       fJetMinEta           ;//  Min eta for jets
82   Double_t       fJetMaxEta           ;//  Max eta for jets
83   Double_t       fJetMinPhi           ;//  Min phi for jets
84   Double_t       fJetMaxPhi           ;//  Max phi for jets
85   Double_t       fJetConstituentMinPt ;//  Jet constituent min pt
86   Double_t       fJetRadius           ;//  Jet radius
87   Byte_t         fJetType             ;//  Jet type (0=full, 1=charged, 2=neutral)
88   Byte_t         fJetAlgo             ;//  Jet algorithm (0=kT, 1=anti-kT)
89   Bool_t         fJetParticleLevel    ;//  Trigger, look at particle level jets
90   Double_t       fParticleMinPt       ;//  Select events with a particle pt between fParticleMinPt and fParticleMaxPt (see fParticleSelection)
91   Double_t       fParticleMaxPt       ;//  Select events with a particle pt between fParticleMinPt and fParticleMaxPt (see fParticleSelection)
92   Byte_t         fParticleSelection   ;//  Particles used to select events (def=0=none, 1=tracks, 2=clusters, 3=MC particles)
93   Int_t          fAODfilterBits[2]    ;//  AOD track filter bit map
94   Bool_t         fIncludeNoITS        ;//  True = includes tracks with failed ITS refit
95   Double_t       fCutMaxFractionSharedTPCClusters;  // max fraction of shared TPC clusters
96   Bool_t         fUseNegativeLabels   ;//  Whether or not should use negative MC labels
97   Double_t       fTrackEfficiency     ;//  Track efficiency
98   Bool_t         fIsAODMC             ;//  Whether the embedding AOD is MC or not
99   Int_t          fTotalFiles          ;//  Total number of files per pt hard bin
100   Int_t          fAttempts            ;//  Attempts to be tried before giving up in opening the next file
101   Bool_t         fEsdTreeMode         ;//! True = embed from ESD (must be a skimmed ESD!)
102   Int_t          fCurrentFileID       ;//! Current file being processed (via the event handler)
103   Int_t          fCurrentAODFileID    ;//! Current file ID
104   TFile         *fCurrentAODFile      ;//! Current open file
105   Int_t          fPicoTrackVersion    ;//! Version of the PicoTrack class (if any) in fCurrentAODFile
106   TTree         *fCurrentAODTree      ;//! Current open tree
107   AliVHeader    *fAODHeader           ;//! AOD header
108   TClonesArray  *fAODVertex           ;//! AOD vertex
109   TClonesArray  *fAODTracks           ;//! AOD track collection
110   TClonesArray  *fAODClusters         ;//! AOD cluster collection
111   AliVCaloCells *fAODCaloCells        ;//! AOD cell collection
112   TClonesArray  *fAODMCParticles      ;//! AOD MC particles collection
113   Int_t          fCurrentAODEntry     ;//! Current entry in the AOD tree
114   AliNamedString *fAODFilePath        ;//! Current AOD file path being embedded
115   TH2           *fHistFileMatching    ;//! Current file ID vs. AOD file ID (to be embedded)
116   TH1           *fHistAODFileError    ;//! AOD file ID (to be embedded) error
117   TH1           *fHistNotEmbedded     ;//! File ID not embedded
118   TH1           *fHistEmbeddingQA     ;//! Embedding QA
119   TH1           *fHistRejectedEvents  ;//! Rejected events
120   Int_t          fEmbeddingCount      ;//! Number of embedded events from the current file
121
122  private:
123   AliJetEmbeddingFromAODTask(const AliJetEmbeddingFromAODTask&);            // not implemented
124   AliJetEmbeddingFromAODTask &operator=(const AliJetEmbeddingFromAODTask&); // not implemented
125
126   ClassDef(AliJetEmbeddingFromAODTask, 11) // Jet embedding from AOD task
127 };
128 #endif