AliPhysics  vAN-20150630 (513c479)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEmcalTriggerPatchInfo.h
Go to the documentation of this file.
1 #ifndef ALIEMCALTRIGGERPATCHINFO_H
2 #define ALIEMCALTRIGGERPATCHINFO_H
3 
4 // $Id$
5 
6 #include "TObject.h"
7 
8 #include <TLorentzVector.h>
9 #include <TMath.h>
11 //#include "AliEMCALTriggerTypes.h"
13 
14 class AliEMCALGeometry;
15 class TArrayI;
16 
17 class AliEmcalTriggerPatchInfo: public TObject {
18  public:
22  virtual ~AliEmcalTriggerPatchInfo();
23 
29  };
30  // The lower bits in fTriggerBits are defined in EMCAL/AliEmcalTriggerTypes.h
31 
32  Double_t GetPhiGeo() const { return fCenterGeo.Phi(); }
33  Double_t GetPhiCM() const { return fCenterMass.Phi(); }
34  Double_t GetPhiMin() const { return fEdge1.Phi(); }
35  Double_t GetPhiMax() const { return fEdge2.Phi(); }
36  Double_t GetEtaGeo() const { return fCenterGeo.Eta(); }
37  Double_t GetEtaCM() const { return fCenterMass.Eta(); }
38  Double_t GetEtaMin() const { return fEdge2.Eta(); }
39  Double_t GetEtaMax() const { return fEdge1.Eta(); }
40  Double_t GetPatchE() const { return fCenterGeo.E(); }
41  Int_t GetADCAmp() const { return fADCAmp; }
42  Int_t GetADCOfflineAmp() const { return fADCOfflineAmp; }
43  Double_t GetADCAmpGeVRough() const { return (Double_t)fADCAmp * kEMCL1ADCtoGeV; }
44  Int_t GetTriggerBits() const { return fTriggerBits; }
45  Int_t GetEdgeCellX() const { return fEdgeCell[0]; }
46  Int_t GetEdgeCellY() const { return fEdgeCell[1]; }
47  void GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells );
48 
49  Bool_t IsLevel0() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetLevel0Bit()))&(!(fTriggerBits >> kSimpleOfflineBitNum))&1); }
50  Bool_t IsJetLow() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetJetLowBit()))&(!(fTriggerBits >> kSimpleOfflineBitNum))&1); }
51  Bool_t IsJetHigh() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetJetHighBit()))&(!(fTriggerBits >> kSimpleOfflineBitNum))&1); }
52  Bool_t IsGammaLow() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetGammaLowBit()))&(!(fTriggerBits >> kSimpleOfflineBitNum))&1); }
53  Bool_t IsGammaHigh() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetGammaHighBit()))&(!(fTriggerBits >> kSimpleOfflineBitNum))&1); }
54  Bool_t IsMainTrigger() const { return (Bool_t)((fTriggerBits >> kMainTriggerBitNum)&(!(fTriggerBits >> kSimpleOfflineBitNum))&1); }
59  Bool_t IsMainTriggerSimple() const { return (Bool_t)((fTriggerBits >> kMainTriggerBitNum)&(fTriggerBits >> kSimpleOfflineBitNum)&1); }
60  Bool_t IsOfflineSimple() const { return (Bool_t)((fTriggerBits >> kSimpleOfflineBitNum)&1); }
61 
62  // Recalculated max patches
63  Bool_t IsRecalcJet() const { return (Bool_t) ((fTriggerBits >> kRecalcJetBitNum)&1); }
64  Bool_t IsRecalcGamma() const { return (Bool_t) ((fTriggerBits >> kRecalcGammaBitNum)&1); }
65 
66 
67  void SetCenterGeo( TVector3 &v, Double_t e ) { SetLorentzVector( fCenterGeo, v, e ); }
68  void SetCenterGeo( TLorentzVector &v ) { fCenterGeo = v; }
69  void SetCenterMass( TLorentzVector &v ) { fCenterMass = v; }
70  void SetCenterMass( TVector3 &v, Double_t e ) { SetLorentzVector( fCenterMass, v, e ); }
71  void SetEdge1( TLorentzVector &v ) { fEdge1 = v; }
72  void SetEdge1( TVector3 &v, Double_t e ) { SetLorentzVector( fEdge1, v, e ); }
73  void SetEdge2( TLorentzVector &v ) { fEdge2 = v; }
74  void SetEdge2( TVector3 &v, Double_t e ) { SetLorentzVector( fEdge2, v, e ); }
75  void SetADCAmp( Int_t a ) { fADCAmp = a; }
76  void SetADCOfflineAmp( Int_t a ) { fADCOfflineAmp = a; }
77  void SetEdgeCell( Int_t x, Int_t y ) { fEdgeCell[0] = x; fEdgeCell[1] = y; }
79 
80  void SetLorentzVector( TLorentzVector &lv, TVector3 &v, Double_t e );
81 
82  void SetTriggerBits( Int_t i ) { fTriggerBits = i; }
83 
84  void SetOffSet(Int_t i) { fOffSet = i; }
85 
88 
89 
90  protected:
91  TLorentzVector &GetLorentzVector(const Double_t *vertex = 0) const;
92 
93  TLorentzVector fCenterGeo; // geometrical center
94  TLorentzVector fCenterMass; // CM
95  TLorentzVector fEdge1; // max eta/ min phi edge
96  TLorentzVector fEdge2; // min eta/ max phi edge
97  Int_t fADCAmp; // online (trigger) ADC amplitude
98  Int_t fADCOfflineAmp; // offline (FEE) ADC amplitude
99  Int_t fTriggerBits; // trigger bit mask, see definitions in AliEmcalTriggerType and TriggerMakerBits_t (above)
100  Int_t fEdgeCell[2]; // cell "bottom lower" edge (min phi, max eta)
101  Int_t fOffSet; // offset of bit (different in data and MC)
102  AliEmcalTriggerBitConfig fTriggerBitConfig; // Trigger bit configuration
103 
104  ClassDef(AliEmcalTriggerPatchInfo, 6) // Emcal particle class
105 };
106 #endif
void SetEdge2(TLorentzVector &v)
void SetEdge1(TLorentzVector &v)
TLorentzVector & GetLorentzVector(const Double_t *vertex=0) const
void SetCenterMass(TVector3 &v, Double_t e)
AliEmcalTriggerPatchInfo & operator=(const AliEmcalTriggerPatchInfo &p)
void GetCellIndices(AliEMCALGeometry *geom, TArrayI *cells)
void SetEdge1(TVector3 &v, Double_t e)
void SetEdgeCell(Int_t x, Int_t y)
void SetEdge2(TVector3 &v, Double_t e)
AliEmcalTriggerBitConfig fTriggerBitConfig
void SetCenterMass(TLorentzVector &v)
static const Double_t kEMCL1ADCtoGeV
void SetTriggerBitConfig(const AliEmcalTriggerBitConfig *ref)
void SetCenterGeo(TLorentzVector &v)
void Initialise(const AliEmcalTriggerBitConfig &ref)
void SetLorentzVector(TLorentzVector &lv, TVector3 &v, Double_t e)
const AliEmcalTriggerBitConfig * GetTriggerBitConfig() const
void SetCenterGeo(TVector3 &v, Double_t e)