2 // Emcal trigger patch information class
3 // Can contain three types of information, distinguished by the various bits in the bit field:
4 // 1) online trigger information (no extra bits set)
5 // 2) offline recalculated trigger patches (bit 25, kSimpleOfflineTriggerBit set)
6 // 3) highest patch energy, also for events that did not fire the trigger (bits 22, 23 kRecalc... (using both online and offline info, use bit 25 to distinguish)
10 #include "AliEmcalTriggerPatchInfo.h"
12 #include "AliEMCALGeometry.h"
15 //_________________________________________________________________________________________________
16 AliEmcalTriggerPatchInfo::AliEmcalTriggerPatchInfo() :
25 fOffSet(0), // To be set explictly by the trigger maker in order to avoid hard coding
28 // Default constructor.
34 //_________________________________________________________________________________________________
35 AliEmcalTriggerPatchInfo::AliEmcalTriggerPatchInfo(const AliEmcalTriggerPatchInfo &p) :
37 fCenterGeo(p.fCenterGeo),
38 fCenterMass(p.fCenterMass),
42 fADCOfflineAmp(p.fADCOfflineAmp),
43 fTriggerBits(p.fTriggerBits),
45 fTriggerBitConfig(p.fTriggerBitConfig)
48 fEdgeCell[0] = p.fEdgeCell[0];
49 fEdgeCell[1] = p.fEdgeCell[1];
52 //_________________________________________________________________________________________________
53 AliEmcalTriggerPatchInfo::~AliEmcalTriggerPatchInfo()
58 //_________________________________________________________________________________________________
59 AliEmcalTriggerPatchInfo &AliEmcalTriggerPatchInfo::operator=(const AliEmcalTriggerPatchInfo &p)
61 // Assignment operator.
64 fCenterGeo = p.fCenterGeo;
65 fCenterMass = p.fCenterMass;
69 fADCOfflineAmp = p.fADCOfflineAmp;
70 fTriggerBits = p.fTriggerBits;
71 fEdgeCell[0] = p.fEdgeCell[0];
72 fEdgeCell[1] = p.fEdgeCell[1];
78 //_________________________________________________________________________________________________
79 void AliEmcalTriggerPatchInfo::GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells ){
81 // return cell indices of the given patch in hte cell array
82 Int_t globCol, globRow, i, j, k, absId, cellAbsId[4];;
86 // get corner, convert from cells to trigger channels
87 globCol = GetEdgeCellX() / 2;
88 globRow = GetEdgeCellY() / 2;
90 // get the absolute trigger ID
91 geom->GetAbsFastORIndexFromPositionInEMCAL( globCol, globRow, absId );
92 // convert to the 4 absId of the cells composing the trigger channel
93 geom->GetCellIndexFromFastORIndex( absId, cellAbsId );
95 // sum the available energy in the 32/32 window of cells
96 // step over trigger channels and get all the corresponding cells
97 for( i = 0; i < 16; i++ ){
98 for( j = 0; j < 16; j++ ){
99 // get the 4 cells composing the trigger channel
100 geom->GetAbsFastORIndexFromPositionInEMCAL( globCol+i, globRow+j, absId );
101 geom->GetCellIndexFromFastORIndex( absId, cellAbsId );
102 // add amplitudes and find patch edges
103 for( k = 0; k < 4; k++ ){
104 cells->SetAt( cellAbsId[k], i*16*4+j*4+k );
107 } // 32x32 cell window
113 //_________________________________________________________________________________________________
114 void AliEmcalTriggerPatchInfo::SetLorentzVector( TLorentzVector &lv, TVector3 &v, Double_t e ){
116 Double_t r = TMath::Sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2] ) ;
118 lv.SetPxPyPzE( e*v[0]/r, e*v[1]/r, e*v[2]/r, e) ;