AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEMCALTriggerPatchInfo.h
Go to the documentation of this file.
1 
14 #ifndef ALIEMCALTRIGGERPATCHINFO_H
15 #define ALIEMCALTRIGGERPATCHINFO_H
16 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
17  * See cxx source for full Copyright notice */
18 
19 #include "TObject.h"
20 
21 #include <TLorentzVector.h>
22 #include <TMath.h>
25 
26 
27 class AliEMCALGeometry;
28 class TArrayI;
29 
30 
41 class AliEMCALTriggerPatchInfo: public TObject {
42 
43  public:
44  enum {
47  };
48 
50  kEMCALdet = 0,
52  };
53 
57  virtual ~AliEMCALTriggerPatchInfo();
58 
59  void Reset();
60 
73  void Initialize(UChar_t col0, UChar_t row0, UChar_t size, UInt_t adc, UInt_t offlineAdc, Double_t patchE, UInt_t bitmask, const TVector3& vertex, const AliEMCALGeometry* geom);
74 
88  static AliEMCALTriggerPatchInfo* CreateAndInitialize(UChar_t col0, UChar_t row0, UChar_t size, UInt_t adc, UInt_t offlineAdc, Double_t patchE, UInt_t bitmask, const TVector3& vertex, const AliEMCALGeometry* geom);
89 
96  void RecalculateKinematics(Double_t patchE, const TVector3& vertex, const AliEMCALGeometry* geom);
97 
102  Double_t GetPhiGeo() const { return GetPhiTransform(fCenterGeo.Phi()); }
107  Double_t GetPhiCM() const { return GetPhiTransform(fCenterMass.Phi()); }
112  Double_t GetPhiMin() const { return GetPhiTransform(fEdge1.Phi()); }
117  Double_t GetPhiMax() const { return GetPhiTransform(fEdge2.Phi()); }
122  Double_t GetEtaGeo() const { return fCenterGeo.Eta(); }
127  Double_t GetEtaCM() const { return fCenterMass.Eta(); }
132  Double_t GetEtaMin() const { return fEdge2.Eta(); }
137  Double_t GetEtaMax() const { return fEdge1.Eta(); }
142  Double_t GetPatchE() const { return fCenterGeo.E(); }
147  Int_t GetADCAmp() const { return fADCAmp; }
152  Int_t GetADCOfflineAmp() const { return fADCOfflineAmp; }
157  Double_t GetADCAmpGeVRough() const { return (Double_t)fADCAmp * EMCALTrigger::kEMCL1ADCtoGeV; }
162  Int_t GetTriggerBits() const { return fTriggerBits; }
167  Int_t GetEdgeCellX() const { return fEdgeCell[0]; }
172  Int_t GetEdgeCellY() const { return fEdgeCell[1]; }
173  void GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells );
174 
179  Double_t GetPatchET() const { return GetET(GetPatchE()); }
184  Double_t GetPatchETfromADCAmp() const { return GetET(GetADCAmpGeVRough()); }
185 
190  Int_t GetRowStart() const { return fRow0; }
191 
196  Int_t GetColStart() const { return fCol0; }
197 
202  Bool_t IsLevel0() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetLevel0Bit()); }
207  Bool_t IsJetLow() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetJetLowBit()); }
212  Bool_t IsJetHigh() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetJetHighBit()); }
217  Bool_t IsGammaLow() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetGammaLowBit()); }
222  Bool_t IsGammaHigh() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetGammaHighBit()); }
227  Bool_t IsBkg() const { return false; }
232  Bool_t IsMainTrigger() const { return false; }
262  Bool_t IsBkgSimple() const { return TESTBIT(fTriggerBits, kOfflineOffset + fTriggerBitConfig.GetBkgBit()); }
267  Bool_t IsLevel0Recalc() const { return TESTBIT(fTriggerBits, kRecalcOffset + fTriggerBitConfig.GetLevel0Bit()); }
272  Bool_t IsJetLowRecalc() const { return TESTBIT(fTriggerBits, kRecalcOffset + fTriggerBitConfig.GetJetLowBit()); }
292  Bool_t IsBkgRecalc() const { return TESTBIT(fTriggerBits, kRecalcOffset + fTriggerBitConfig.GetBkgBit()); }
297  Bool_t IsMainTriggerSimple() const { return kFALSE; }
303 
308  Bool_t IsRecalc() const { return IsJetLowRecalc() || IsJetHighRecalc() || IsGammaLowRecalc() || IsGammaHighRecalc(); }
309 
314  Bool_t IsOnline() const { return IsJetLow() || IsJetHigh() || IsGammaLow() || IsGammaHigh(); }
315 
320  const TLorentzVector &GetLorentzVectorCM() const { return fCenterMass; }
325  const TLorentzVector &GetLorentzVectorCenterGeo() const { return fCenterGeo; }
330  const TLorentzVector &GetLorentzVectorEdge1() const { return fEdge1; }
335  const TLorentzVector &GetLorentzVectorEdge2() const { return fEdge2; }
336 
337  // Recalculated max patches
342  Bool_t IsRecalcJet() const { return IsJetLowRecalc() || IsJetHighRecalc(); }
347  Bool_t IsRecalcGamma() const { return IsGammaLowRecalc() || IsGammaHighRecalc(); }
348 
353  Bool_t IsEMCal() const { return (fDetectorType == kEMCALdet) ; }
354 
359  Bool_t IsDCalPHOS() const { return (fDetectorType == kDCALPHOSdet); }
360 
365 
371  Bool_t TestTriggerBit(UInt_t bitnumber) const { return TESTBIT(fTriggerBits, bitnumber); }
372 
377  UChar_t GetPatchSize() const { return fPatchSize; }
378 
383  void SetRowStart(int row0) { fRow0 = row0; }
384 
389  void SetCol0(int col0) { fCol0 = col0; }
390 
396  void SetCenterGeo( const TVector3 &v, Double_t e ) { SetLorentzVector( fCenterGeo, v, e ); }
401  void SetCenterGeo( const TLorentzVector &v ) { fCenterGeo = v; }
406  void SetCenterMass( const TLorentzVector &v ) { fCenterMass = v; }
412  void SetCenterMass( const TVector3 &v, Double_t e ) { SetLorentzVector( fCenterMass, v, e ); }
417  void SetEdge1( const TLorentzVector &v ) { fEdge1 = v; }
423  void SetEdge1( const TVector3 &v, Double_t e ) { SetLorentzVector( fEdge1, v, e ); }
428  void SetEdge2( const TLorentzVector &v ) { fEdge2 = v; }
434  void SetEdge2( const TVector3 &v, Double_t e ) { SetLorentzVector( fEdge2, v, e ); }
439  void SetADCAmp( Int_t a ) { fADCAmp = a; }
444  void SetADCOfflineAmp( Int_t a ) { fADCOfflineAmp = a; }
450  void SetEdgeCell( Int_t x, Int_t y ) { fEdgeCell[0] = x; fEdgeCell[1] = y; }
451 
456  void SetOfflineSimple() { }
457 
458  void SetLorentzVector( TLorentzVector &lv, const TVector3 &v, Double_t e );
459 
464  void SetTriggerBits( Int_t i ) { fTriggerBits = i; }
465 
471 
476  void SetOffSet(Int_t i) { fOffSet = i; }
477 
483 
489 
490 
491  protected:
492  //TLorentzVector &GetLorentzVector(const Double_t *vertex = 0) const;
493  Double_t GetPhiTransform(Double_t phiin) const;
494  Double_t GetET(Double_t energy) const;
495 
496  TLorentzVector fCenterGeo;
497  TLorentzVector fCenterMass;
498  TLorentzVector fEdge1;
499  TLorentzVector fEdge2;
500  Int_t fADCAmp;
502  Int_t fTriggerBits;
503  Int_t fEdgeCell[2];
504  Int_t fOffSet;
505  Int_t fCol0;
506  Int_t fRow0;
507  UChar_t fPatchSize;
510 
512  ClassDef(AliEMCALTriggerPatchInfo, 6) // Emcal particle class
514 };
515 #endif
UChar_t fPatchSize
Trigger patch size.
void Initialise(const AliEMCALTriggerBitConfig &ref)
const TLorentzVector & GetLorentzVectorEdge2() const
static AliEMCALTriggerPatchInfo * CreateAndInitialize(UChar_t col0, UChar_t row0, UChar_t size, UInt_t adc, UInt_t offlineAdc, Double_t patchE, UInt_t bitmask, const TVector3 &vertex, const AliEMCALGeometry *geom)
Bool_t TestTriggerBit(UInt_t bitnumber) const
Int_t fOffSet
offset of bit (different in data and MC)
void SetEdgeCell(Int_t x, Int_t y)
Int_t fADCOfflineAmp
offline (FEE) ADC amplitude
void GetCellIndices(AliEMCALGeometry *geom, TArrayI *cells)
const TLorentzVector & GetLorentzVectorCM() const
TLorentzVector fCenterGeo
geometrical center
AliEMCALTriggerBitConfig fTriggerBitConfig
Trigger bit configuration.
const Double_t kEMCL1ADCtoGeV
Conversion from EMCAL Level1 ADC to energy.
void SetEdge2(const TVector3 &v, Double_t e)
void SetEdge1(const TLorentzVector &v)
CaloDetectorType_t GetDetectorType() const
TLorentzVector fEdge2
min eta/ max phi edge
void SetCenterGeo(const TVector3 &v, Double_t e)
const AliEMCALTriggerBitConfig * GetTriggerBitConfig() const
TLorentzVector fEdge1
max eta/ min phi edge
const TLorentzVector & GetLorentzVectorCenterGeo() const
CaloDetectorType_t fDetectorType
Detector type (EMCal or DCal/PHOS)
void SetEdge2(const TLorentzVector &v)
AliEMCALTriggerPatchInfo & operator=(const AliEMCALTriggerPatchInfo &p)
void Initialize(UChar_t col0, UChar_t row0, UChar_t size, UInt_t adc, UInt_t offlineAdc, Double_t patchE, UInt_t bitmask, const TVector3 &vertex, const AliEMCALGeometry *geom)
void SetCenterMass(const TVector3 &v, Double_t e)
void RecalculateKinematics(Double_t patchE, const TVector3 &vertex, const AliEMCALGeometry *geom)
Double_t GetET(Double_t energy) const
Int_t fADCAmp
online (trigger) ADC amplitude
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Definition of trigger bit configurations.
void SetLorentzVector(TLorentzVector &lv, const TVector3 &v, Double_t e)
void SetEdge1(const TVector3 &v, Double_t e)
Int_t fTriggerBits
trigger bit mask, see definitions in AliEMCALTriggerType and TriggerMakerBits_t (above) ...
void SetTriggerBitConfig(const AliEMCALTriggerBitConfig *ref)
void SetDetectorType(CaloDetectorType_t t)
Double_t GetPhiTransform(Double_t phiin) const
Int_t fEdgeCell[2]
cell "bottom lower" edge (min phi, max eta)
void SetCenterGeo(const TLorentzVector &v)
const TLorentzVector & GetLorentzVectorEdge1() const
TEveGeoShape * geom
Definition: tpc_tracks.C:10
void SetCenterMass(const TLorentzVector &v)
Definition of EMCAL trigger bit configurations.