AliPhysics  vAN-20150827 (3e81cbb)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEmcalTriggerPatchInfo.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2013, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
16 #include "AliLog.h"
17 #include "AliEMCALGeometry.h"
18 #include "TArrayI.h"
19 
24  TObject(),
25  fCenterGeo(),
26  fCenterMass(),
27  fEdge1(),
28  fEdge2(),
29  fADCAmp(0),
30  fADCOfflineAmp(0),
31  fTriggerBits(0),
32  fOffSet(0), // To be set explictly by the trigger maker in order to avoid hard coding
33  fTriggerBitConfig()
34 {
35  fEdgeCell[0] = -1;
36  fEdgeCell[1] = -1;
37 }
38 
45  TObject(p),
46  fCenterGeo(p.fCenterGeo),
47  fCenterMass(p.fCenterMass),
48  fEdge1(p.fEdge1),
49  fEdge2(p.fEdge2),
50  fADCAmp(p.fADCAmp),
51  fADCOfflineAmp(p.fADCOfflineAmp),
52  fTriggerBits(p.fTriggerBits),
53  fOffSet(p.fOffSet),
54  fTriggerBitConfig(p.fTriggerBitConfig)
55 {
56  // .
57  fEdgeCell[0] = p.fEdgeCell[0];
58  fEdgeCell[1] = p.fEdgeCell[1];
59 }
60 
65 {
66 }
67 
75 {
76  if (this != &p) {
79  fEdge1 = p.fEdge1;
80  fEdge2 = p.fEdge2;
81  fADCAmp = p.fADCAmp;
84  fEdgeCell[0] = p.fEdgeCell[0];
85  fEdgeCell[1] = p.fEdgeCell[1];
86  }
87 
88  return *this;
89 }
90 
96 void AliEmcalTriggerPatchInfo::GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells ){
97 
98  Int_t globCol, globRow, i, j, k, absId, cellAbsId[4];;
99 
100  cells->Set( 1024 );
101 
102  // get corner, convert from cells to trigger channels
103  globCol = GetEdgeCellX() / 2;
104  globRow = GetEdgeCellY() / 2;
105 
106  // get the absolute trigger ID
107  geom->GetAbsFastORIndexFromPositionInEMCAL( globCol, globRow, absId );
108  // convert to the 4 absId of the cells composing the trigger channel
109  geom->GetCellIndexFromFastORIndex( absId, cellAbsId );
110 
111  // sum the available energy in the 32/32 window of cells
112  // step over trigger channels and get all the corresponding cells
113  for( i = 0; i < 16; i++ ){
114  for( j = 0; j < 16; j++ ){
115  // get the 4 cells composing the trigger channel
116  geom->GetAbsFastORIndexFromPositionInEMCAL( globCol+i, globRow+j, absId );
117  geom->GetCellIndexFromFastORIndex( absId, cellAbsId );
118  // add amplitudes and find patch edges
119  for( k = 0; k < 4; k++ ){
120  cells->SetAt( cellAbsId[k], i*16*4+j*4+k );
121  }
122  }
123  } // 32x32 cell window
124 
125 
126 }
127 
128 
135 void AliEmcalTriggerPatchInfo::SetLorentzVector( TLorentzVector &lv, TVector3 &v, Double_t e ){
136  // sets the vector
137  Double_t r = TMath::Sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2] ) ;
138 
139  lv.SetPxPyPzE( e*v[0]/r, e*v[1]/r, e*v[2]/r, e) ;
140 }
141 
Int_t fTriggerBits
trigger bit mask, see definitions in AliEmcalTriggerType and TriggerMakerBits_t (above) ...
AliEmcalTriggerPatchInfo & operator=(const AliEmcalTriggerPatchInfo &p)
TLorentzVector fCenterGeo
geometrical center
void GetCellIndices(AliEMCALGeometry *geom, TArrayI *cells)
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Int_t fADCAmp
online (trigger) ADC amplitude
void SetLorentzVector(TLorentzVector &lv, TVector3 &v, Double_t e)
Class to make array of trigger patch objects in AOD/ESD events.
TLorentzVector fEdge2
min eta/ max phi edge
TLorentzVector fEdge1
max eta/ min phi edge
Int_t fEdgeCell[2]
cell "bottom lower" edge (min phi, max eta)
Int_t fADCOfflineAmp
offline (FEE) ADC amplitude