3 // Emcal particle trigger class, which can contain either
7 #include "AliEmcalTriggerPatchInfo.h"
9 #include "AliEMCALGeometry.h"
12 //_________________________________________________________________________________________________
13 AliEmcalTriggerPatchInfo::AliEmcalTriggerPatchInfo() :
21 fOffSet(kTriggerTypeEnd)
23 // Default constructor.
29 //_________________________________________________________________________________________________
30 AliEmcalTriggerPatchInfo::AliEmcalTriggerPatchInfo(const AliEmcalTriggerPatchInfo &p) :
32 fCenterGeo(p.fCenterGeo),
33 fCenterMass(p.fCenterMass),
37 fTriggerBits(p.fTriggerBits),
41 fEdgeCell[0] = p.fEdgeCell[0];
42 fEdgeCell[1] = p.fEdgeCell[1];
45 //_________________________________________________________________________________________________
46 AliEmcalTriggerPatchInfo::~AliEmcalTriggerPatchInfo()
51 //_________________________________________________________________________________________________
52 AliEmcalTriggerPatchInfo &AliEmcalTriggerPatchInfo::operator=(const AliEmcalTriggerPatchInfo &p)
54 // Assignment operator.
57 fCenterGeo = p.fCenterGeo;
58 fCenterMass = p.fCenterMass;
62 fTriggerBits = p.fTriggerBits;
63 fEdgeCell[0] = p.fEdgeCell[0];
64 fEdgeCell[1] = p.fEdgeCell[1];
70 //_________________________________________________________________________________________________
71 void AliEmcalTriggerPatchInfo::GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells ){
73 // return cell indices of the given patch in hte cell array
74 Int_t globCol, globRow, i, j, k, absId, cellAbsId[4];;
78 // get corner, convert from cells to trigger channels
79 globCol = GetEdgeCellX() / 2;
80 globRow = GetEdgeCellY() / 2;
82 // get the absolute trigger ID
83 geom->GetAbsFastORIndexFromPositionInEMCAL( globCol, globRow, absId );
84 // convert to the 4 absId of the cells composing the trigger channel
85 geom->GetCellIndexFromFastORIndex( absId, cellAbsId );
87 // sum the available energy in the 32/32 window of cells
88 // step over trigger channels and get all the corresponding cells
89 for( i = 0; i < 16; i++ ){
90 for( j = 0; j < 16; j++ ){
91 // get the 4 cells composing the trigger channel
92 geom->GetAbsFastORIndexFromPositionInEMCAL( globCol+i, globRow+j, absId );
93 geom->GetCellIndexFromFastORIndex( absId, cellAbsId );
94 // add amplitudes and find patch edges
95 for( k = 0; k < 4; k++ ){
96 cells->SetAt( cellAbsId[k], i*16*4+j*4+k );
99 } // 32x32 cell window
105 //_________________________________________________________________________________________________
106 void AliEmcalTriggerPatchInfo::SetLorentzVector( TLorentzVector &lv, TVector3 &v, Double_t e ){
108 Double_t r = TMath::Sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2] ) ;
110 lv.SetPxPyPzE( e*v[0]/r, e*v[1]/r, e*v[2]/r, e) ;