AliRoot Core  edcc906 (edcc906)
AliEMCALTriggerPatchInfo.h
Go to the documentation of this file.
1 #ifndef ALIEMCALTRIGGERPATCHINFO_H
2 #define ALIEMCALTRIGGERPATCHINFO_H
3 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include "TObject.h"
7 
8 #include <TLorentzVector.h>
9 #include <TMath.h>
12 
13 
14 class AliEMCALGeometry;
15 class TArrayI;
16 
17 
32 class AliEMCALTriggerPatchInfo: public TObject {
33 
34  public:
35  enum {
38  };
39 
41  kEMCALdet = 0,
43  };
44 
49 
56 
64 
68  virtual ~AliEMCALTriggerPatchInfo();
69 
73  void Reset();
74 
87  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);
88 
99  void Initialize(UChar_t col0, UChar_t row0, UChar_t size, UInt_t adc, UInt_t offlineAdc, UInt_t bitmask, const AliEMCALGeometry* geom);
100 
114  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);
115 
127  static AliEMCALTriggerPatchInfo* CreateAndInitialize(UChar_t col0, UChar_t row0, UChar_t size, UInt_t adc, UInt_t offlineAdc, UInt_t bitmask, const AliEMCALGeometry* geom);
128 
135  void RecalculateKinematics(Double_t patchE, const TVector3& vertex, const AliEMCALGeometry* geom);
136 
141  Double_t GetPhiGeo() const { return GetPhiTransform(fCenterGeo.Phi()); }
142 
147  Double_t GetPhiCM() const { return GetPhiTransform(fCenterMass.Phi()); }
148 
153  Double_t GetPhiMin() const { return GetPhiTransform(fEdge1.Phi()); }
154 
159  Double_t GetPhiMax() const { return GetPhiTransform(fEdge2.Phi()); }
160 
165  Double_t GetEtaGeo() const { return fCenterGeo.Eta(); }
166 
171  Double_t GetEtaCM() const { return fCenterMass.Eta(); }
172 
177  Double_t GetEtaMin() const { return fEdge2.Eta(); }
178 
183  Double_t GetEtaMax() const { return fEdge1.Eta(); }
184 
189  Double_t GetPatchE() const { return fCenterGeo.E(); }
190 
198  Double_t GetSmearedEnergy() const { return fEnergySmeared; }
199 
204  Int_t GetADCAmp() const { return fADCAmp; }
205 
210  Int_t GetADCOfflineAmp() const { return fADCOfflineAmp; }
211 
216  Double_t GetADCAmpGeVRough() const { return (Double_t)fADCAmp * EMCALTrigger::kEMCL1ADCtoGeV; }
217 
222  Int_t GetTriggerBits() const { return fTriggerBits; }
223 
228  Int_t GetEdgeCellX() const { return fEdgeCell[0]; }
229 
234  Int_t GetEdgeCellY() const { return fEdgeCell[1]; }
235 
241  void GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells );
242 
247  Double_t GetPatchET() const { return GetET(GetPatchE()); }
248 
253  Double_t GetPatchETfromADCAmp() const { return GetET(GetADCAmpGeVRough()); }
254 
259  Int_t GetRowStart() const { return fRow0; }
260 
265  Int_t GetColStart() const { return fCol0; }
266 
271  Bool_t IsLevel0() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetLevel0Bit()); }
272 
277  Bool_t IsJetLow() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetJetLowBit()); }
278 
283  Bool_t IsJetHigh() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetJetHighBit()); }
284 
289  Bool_t IsGammaLow() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetGammaLowBit()); }
290 
295  Bool_t IsGammaHigh() const { return TESTBIT(fTriggerBits, fOffSet + fTriggerBitConfig.GetGammaHighBit()); }
296 
301  Bool_t IsBkg() const { return false; }
302 
307  Bool_t IsMainTrigger() const { return false; }
308 
314 
320 
326 
332 
338 
343  Bool_t IsBkgSimple() const { return TESTBIT(fTriggerBits, kOfflineOffset + fTriggerBitConfig.GetBkgBit()); }
344 
349  Bool_t IsLevel0Recalc() const { return TESTBIT(fTriggerBits, kRecalcOffset + fTriggerBitConfig.GetLevel0Bit()); }
350 
355  Bool_t IsJetLowRecalc() const { return TESTBIT(fTriggerBits, kRecalcOffset + fTriggerBitConfig.GetJetLowBit()); }
356 
362 
368 
374 
379  Bool_t IsBkgRecalc() const { return TESTBIT(fTriggerBits, kRecalcOffset + fTriggerBitConfig.GetBkgBit()); }
380 
385  Bool_t IsMainTriggerSimple() const { return kFALSE; }
386 
392 
397  Bool_t IsRecalc() const { return IsJetLowRecalc() || IsJetHighRecalc() || IsGammaLowRecalc() || IsGammaHighRecalc(); }
398 
403  Bool_t IsOnline() const { return IsJetLow() || IsJetHigh() || IsGammaLow() || IsGammaHigh(); }
404 
409  const TLorentzVector &GetLorentzVectorCM() const { return fCenterMass; }
410 
415  const TLorentzVector &GetLorentzVectorCenterGeo() const { return fCenterGeo; }
416 
421  const TLorentzVector &GetLorentzVectorEdge1() const { return fEdge1; }
422 
427  const TLorentzVector &GetLorentzVectorEdge2() const { return fEdge2; }
428 
429  // Recalculated max patches
434  Bool_t IsRecalcJet() const { return IsJetLowRecalc() || IsJetHighRecalc(); }
435 
440  Bool_t IsRecalcGamma() const { return IsGammaLowRecalc() || IsGammaHighRecalc(); }
441 
446  Bool_t IsEMCal() const { return (fDetectorType == kEMCALdet) ; }
447 
452  Bool_t IsDCalPHOS() const { return (fDetectorType == kDCALPHOSdet); }
453 
458 
464  Bool_t TestTriggerBit(UInt_t bitnumber) const { return TESTBIT(fTriggerBits, bitnumber); }
465 
470  UChar_t GetPatchSize() const { return fPatchSize; }
471 
476  void SetRowStart(int row0) { fRow0 = row0; }
477 
482  void SetCol0(int col0) { fCol0 = col0; }
483 
489  void SetCenterGeo( const TVector3 &v, Double_t e ) { SetLorentzVector( fCenterGeo, v, e ); }
490 
495  void SetCenterGeo( const TLorentzVector &v ) { fCenterGeo = v; }
496 
501  void SetCenterMass( const TLorentzVector &v ) { fCenterMass = v; }
502 
508  void SetCenterMass( const TVector3 &v, Double_t e ) { SetLorentzVector( fCenterMass, v, e ); }
509 
514  void SetEdge1( const TLorentzVector &v ) { fEdge1 = v; }
515 
521  void SetEdge1( const TVector3 &v, Double_t e ) { SetLorentzVector( fEdge1, v, e ); }
522 
527  void SetEdge2( const TLorentzVector &v ) { fEdge2 = v; }
528 
534  void SetEdge2( const TVector3 &v, Double_t e ) { SetLorentzVector( fEdge2, v, e ); }
535 
540  void SetADCAmp( Int_t a ) { fADCAmp = a; }
541 
546  void SetADCOfflineAmp( Int_t a ) { fADCOfflineAmp = a; }
547 
554  void SetSmearedEnergy(Double_t e) { fEnergySmeared = e; }
555 
561  void SetEdgeCell( Int_t x, Int_t y ) { fEdgeCell[0] = x; fEdgeCell[1] = y; }
562 
567  void SetOfflineSimple() { }
568 
575  void SetLorentzVector( TLorentzVector &lv, const TVector3 &v, Double_t e );
576 
581  void SetTriggerBits( Int_t i ) { fTriggerBits = i; }
582 
588 
593  void SetOffSet(Int_t i) { fOffSet = i; }
594 
600 
606 
607 
608  protected:
609  Double_t GetPhiTransform(Double_t phiin) const;
610  Double_t GetET(Double_t energy) const;
611 
612  TLorentzVector fCenterGeo;
613  TLorentzVector fCenterMass;
614  TLorentzVector fEdge1;
615  TLorentzVector fEdge2;
616  Int_t fADCAmp;
618  Double_t fEnergySmeared;
619  Int_t fTriggerBits;
620  Int_t fEdgeCell[2];
621  Int_t fOffSet;
622  Int_t fCol0;
623  Int_t fRow0;
624  UChar_t fPatchSize;
627 
629  ClassDef(AliEMCALTriggerPatchInfo, 6) // Emcal particle class
631 };
632 #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
Float_t p[]
Definition: kNNTest.C:133
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)
Double_t fEnergySmeared
Smeared patch energy.
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
EMCal geometry, singleton.
void SetCenterMass(const TLorentzVector &v)
Definition of EMCAL trigger bit configurations.