]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/AliEmcalJetTask.h
up from salvatore
[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     kAllJets=kKT|kAKT|kFullJet|kChargedJet|kNeutralJet|kR020Jet|kR030Jet|kR040Jet|kRX1Jet|kRX2Jet|kRX3Jet
33   };
34
35
36   AliEmcalJetTask();
37   AliEmcalJetTask(const char *name);
38   virtual ~AliEmcalJetTask();
39
40   void                   UserCreateOutputObjects();
41   void                   UserExec(Option_t *option);
42   void                   Terminate(Option_t *option);
43
44   void                   SelectConstituents(UInt_t constSel, UInt_t MCconstSel)  { fConstSel = constSel; fMCConstSel = MCconstSel; };
45   void                   SetAlgo(Int_t a)                 { if (a==0) fJetType |= kKT; else fJetType |= kAKT; }  // for backward compatibility only
46   void                   SetClusName(const char *n)       { fCaloName      = n     ; }
47   void                   SetJetsName(const char *n)       { fJetsName      = n     ; }
48   void                   SetJetType(UInt_t t)             { fJetType       = t     ; }
49   void                   SetMarkConstituents(UInt_t m)    { fMarkConst     = m     ; }
50   void                   SetMinJetArea(Double_t a)        { fMinJetArea    = a     ; }
51   void                   SetMinJetClusPt(Double_t min)    { fMinJetClusPt  = min   ; }
52   void                   SetMinJetPt(Double_t j)          { fMinJetPt      = j     ; }
53   void                   SetMinJetTrackPt(Double_t min)   { fMinJetTrackPt = min   ; }
54   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)."); }
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                   SetGhostArea(Double_t gharea)    { fGhostArea      = gharea;  }
62   void                   SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB) 
63   {
64     if(!fIsPSelSet)
65     {
66       fIsPSelSet = kTRUE;
67       fOfflineTriggerMask = offlineTriggerMask;
68     }
69     else
70     {
71       AliWarning("Manually setting the event selection for jet finders is not allowed! Using trigger=old_trigger | your_trigger");  
72       fOfflineTriggerMask = fOfflineTriggerMask | offlineTriggerMask;
73     }
74   }
75
76   UInt_t                 GetJetType()                     { return fJetType; }
77
78   static bool            ComparePseudoJets(fastjet::PseudoJet a, fastjet::PseudoJet b);
79
80  protected:
81   void                   FindJets();
82   Bool_t                 DoInit();
83
84   TString                fTracksName;             // name of track collection
85   TString                fCaloName;               // name of calo cluster collection
86   TString                fJetsName;               // name of jet collection
87   UInt_t                 fJetType;                // jet type (algorithm, radius, constituents)
88   UInt_t                 fConstSel;               // select constituents from a previous jet finding
89   UInt_t                 fMCConstSel;             // select MC constituents (label!=0) from a previous jet finding
90   UInt_t                 fMarkConst;              // constituents are marked (via TObject::SetBit) as belonging to the # leading jets
91   Double_t               fRadius;                 // jet radius
92   Double_t               fMinJetTrackPt;          // min jet track momentum   (applied before clustering)
93   Double_t               fMinJetClusPt;           // min jet cluster momentum (applied before clustering)
94   Double_t               fPhiMin;                 // minimum phi for constituents (applied before clustering)
95   Double_t               fPhiMax;                 // maximum phi for constituents (applied before clustering)
96   Double_t               fEtaMin;                 // minimum eta for constituents (applied before clustering)
97   Double_t               fEtaMax;                 // maximum eta for constituents (applied before clustering)
98   Double_t               fMinJetArea;             // min area to keep jet in output
99   Double_t               fMinJetPt;               // min jet pt to keep jet in output
100   Double_t               fGhostArea;              // ghost area
101   Bool_t                 fIsInit;                 //!=true if already initialized
102   Bool_t                 fIsPSelSet;              //!=true if physics selection was set
103   Bool_t                 fIsMcPart;               //!=true if MC particles are given as input
104   Bool_t                 fIsEmcPart;              //!=true if emcal particles are given as input (for clusters)
105   TClonesArray          *fJets;                   //!jet collection
106   AliVEvent             *fEvent;                  //!current event
107   TClonesArray          *fTracks;                 //!tracks collection
108   TClonesArray          *fClus;                   //!cluster collection
109
110  private:
111   AliEmcalJetTask(const AliEmcalJetTask&);            // not implemented
112   AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
113
114   ClassDef(AliEmcalJetTask, 7) // Jet producing task
115 };
116 #endif