]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/AliEmcalJetTask.h
From Marta:
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / AliEmcalJetTask.h
1 #ifndef ALIEMCALJETTASK_H
2 #define ALIEMCALJETTASK_H
3
4 // $Id$
5
6 class TClonesArray;
7 class AliVEvent;
8
9 namespace fastjet {
10   class PseudoJet;
11 }
12
13 #include "AliLog.h"
14 #include "AliAnalysisTaskSE.h"
15
16 class AliEmcalJetTask : public AliAnalysisTaskSE {
17  public:
18
19   enum JetType {
20     kNone=0,
21     kKT=1<<0,
22     kAKT=1<<1,
23     kFullJet=1<<2,
24     kChargedJet=1<<3,
25     kNeutralJet=1<<4,
26     kR020Jet=1<<5,
27     kR030Jet=1<<6,
28     kR040Jet=1<<7,
29     kRX1Jet=1<<8,  // user defined radii, use SetRadius(Double_t)
30     kRX2Jet=1<<9,
31     kRX3Jet=1<<10
32   };
33
34
35   AliEmcalJetTask();
36   AliEmcalJetTask(const char *name);
37   virtual ~AliEmcalJetTask();
38
39   void                   UserCreateOutputObjects();
40   void                   UserExec(Option_t *option);
41   void                   Terminate(Option_t *option);
42
43   void                   SelectConstituents(UInt_t constSel, UInt_t MCconstSel)  { fConstSel = constSel; fMCConstSel = MCconstSel; };
44   void                   SetAlgo(Int_t a)                 { if (a==0) fJetType |= kKT; else fJetType |= kAKT; }  // for backward compatibility only
45   void                   SetClusName(const char *n)       { fCaloName      = n     ; }
46   void                   SetJetsName(const char *n)       { fJetsName      = n     ; }
47   void                   SetJetType(UInt_t t)             { fJetType       = t     ; }
48   void                   SetMarkConstituents(UInt_t m)    { fMarkConst     = m     ; }
49   void                   SetMinJetArea(Double_t a)        { fMinJetArea    = a     ; }
50   void                   SetMinJetClusPt(Double_t min)    { fMinJetClusPt  = min   ; }
51   void                   SetMinJetPt(Double_t j)          { fMinJetPt      = j     ; }
52   void                   SetMinJetTrackPt(Double_t min)   { fMinJetTrackPt = min   ; }
53   void                   SetRadius(Double_t r)            { fRadius        = r     ; if ((fJetType & (kRX1Jet|kRX2Jet|kRX3Jet)) == 0) AliWarning("Radius value will be ignored if jet type is not set to a user defined radius (kRX1Jet,kRX2Jet,kRX3Jet)."); }
54   void                   SetTrackEfficiency(Double_t t)   { fTrackEfficiency = t   ; }
55   void                   SetTracksName(const char *n)     { fTracksName    = n     ; }
56   void                   SetType(Int_t t)                 { if (t==0) fJetType |= kFullJet; 
57                                                             else if (t==1) fJetType |= kChargedJet; 
58                                                             else if (t==2) fJetType |= kNeutralJet; } // for backward compatibility only
59   void                   SetEtaRange(Double_t emi, Double_t ema) {fEtaMin = emi; fEtaMax = ema; }
60   void                   SetPhiRange(Double_t pmi, Double_t pma) {fPhiMin = pmi; fPhiMax = pma; }
61   void                   SetJetEtaRange(Double_t emi, Double_t ema) {fJetEtaMin = emi; fJetEtaMax = ema; }
62   void                   SetJetPhiRange(Double_t pmi, Double_t pma) {fJetPhiMin = pmi; fJetPhiMax = pma; }
63   void                   SetGhostArea(Double_t gharea)    { fGhostArea      = gharea;  }
64   void                   SetMinMCLabel(Int_t s)           { fMinMCLabel     = s     ;  }
65   void                   SetRecombScheme(Int_t scheme)    { fRecombScheme   = scheme;  }
66   void                   SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB)
67   {
68     if(!fIsPSelSet)
69     {
70       fIsPSelSet = kTRUE;
71       fOfflineTriggerMask = offlineTriggerMask;
72     }
73     else
74     {
75       AliWarning("Manually setting the event selection for jet finders is not allowed! Using trigger=old_trigger | your_trigger");  
76       fOfflineTriggerMask = fOfflineTriggerMask | offlineTriggerMask;
77     }
78   }
79   void                   SetLegacyMode(Bool_t mode)       { fLegacyMode ^= mode; }
80   void                   SetCodeDebug(Bool_t val)         { fCodeDebug = val; }
81
82   UInt_t                 GetJetType()                     { return fJetType; }
83   Bool_t                 GetLegacyMode()                  { return fLegacyMode; }
84
85  protected:
86   void                   FindJets();
87   Bool_t                 DoInit();
88   Bool_t                 GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
89
90   TString                fTracksName;             // name of track collection
91   TString                fCaloName;               // name of calo cluster collection
92   TString                fJetsName;               // name of jet collection
93   UInt_t                 fJetType;                // jet type (algorithm, radius, constituents)
94   UInt_t                 fConstSel;               // select constituents from a previous jet finding
95   UInt_t                 fMCConstSel;             // select MC constituents (label!=0) from a previous jet finding
96   UInt_t                 fMarkConst;              // constituents are marked (via TObject::SetBit) as belonging to the # leading jets
97   Double_t               fRadius;                 // jet radius
98   Double_t               fMinJetTrackPt;          // min jet track momentum   (applied before clustering)
99   Double_t               fMinJetClusPt;           // min jet cluster momentum (applied before clustering)
100   Double_t               fPhiMin;                 // minimum phi for constituents (applied before clustering)
101   Double_t               fPhiMax;                 // maximum phi for constituents (applied before clustering)
102   Double_t               fEtaMin;                 // minimum eta for constituents (applied before clustering)
103   Double_t               fEtaMax;                 // maximum eta for constituents (applied before clustering)
104   Double_t               fMinJetArea;             // min area to keep jet in output
105   Double_t               fMinJetPt;               // min jet pt to keep jet in output
106   Double_t               fJetPhiMin;              // minimum phi to keep jet in output
107   Double_t               fJetPhiMax;              // maximum phi to keep jet in output
108   Double_t               fJetEtaMin;              // minimum eta to keep jet in output
109   Double_t               fJetEtaMax;              // maximum eta to keep jet in output
110   Double_t               fGhostArea;              // ghost area
111   Int_t                  fMinMCLabel;             // minimum MC label value for the tracks/clusters being considered MC particles
112   Int_t                  fRecombScheme;           // recombination scheme used by fastjet
113   Double_t               fTrackEfficiency;        // artificial tracking inefficiency (0...1)
114   Bool_t                 fIsInit;                 //!=true if already initialized
115   Bool_t                 fIsPSelSet;              //!=true if physics selection was set
116   Bool_t                 fIsMcPart;               //!=true if MC particles are given as input
117   Bool_t                 fIsEmcPart;              //!=true if emcal particles are given as input (for clusters)
118   Bool_t                 fLegacyMode;             //! if true, enable FJ 2.x behavior
119   Bool_t                 fCodeDebug;              // use nontested code changes 
120   TClonesArray          *fJets;                   //!jet collection
121   AliVEvent             *fEvent;                  //!current event
122   TClonesArray          *fTracks;                 //!tracks collection
123   TClonesArray          *fClus;                   //!cluster collection
124
125  private:
126   AliEmcalJetTask(const AliEmcalJetTask&);            // not implemented
127   AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
128
129   ClassDef(AliEmcalJetTask, 10) // Jet producing task
130 };
131 #endif