ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
TileTOFTool Class Reference

#include <TileTOFTool.h>

Inheritance diagram for TileTOFTool:
Collaboration diagram for TileTOFTool:

Public Member Functions

 TileTOFTool (const std::string &type, const std::string &name, const IInterface *pParent)
 
virtual ~TileTOFTool ()
 
virtual StatusCode initialize ()
 
virtual StatusCode initNtuple (int runNumber, int runType, TFile *rootfile)
 
virtual StatusCode execute ()
 
virtual StatusCode finalizeCalculations ()
 
virtual StatusCode writeNtuple (int runNumber, int runType, TFile *rootfile)
 
virtual StatusCode finalize ()
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Protected Attributes

const TileIDm_tileID
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

float timeCor (int mod_ref1, int mod_ref2, int part_ref1, int part_ref2)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_caloCellContainerKey
 
float(* m_timeCor )[64]
 
float m_LBA_LBC [4]
 
float m_LBA_EBA [4]
 
float m_LBC_EBC [4]
 
int m_Nlbc [4]
 
int m_Neba [4]
 
int m_Nebc [4]
 
float m_LA_EA
 
float m_LA_LC
 
float m_LA_EC
 
float(* m_tcor )[32][32]
 
int(* m_nPair )[32][32]
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 21 of file TileTOFTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileTOFTool()

TileTOFTool::TileTOFTool ( const std::string &  type,
const std::string &  name,
const IInterface *  pParent 
)

Definition at line 21 of file TileTOFTool.cxx.

22  : AthAlgTool( type, name, pParent ),
23  m_tileID(nullptr),
24  m_LBA_LBC(),
25  m_LBA_EBA(),
26  m_LBC_EBC(),
27  m_Nlbc(),
28  m_Neba(),
29  m_Nebc(),
30  m_LA_EA(0),
31  m_LA_LC(0),
32  m_LA_EC(0)
33 {
34  declareInterface<ITileCalibTool>( this );
35 
36  m_timeCor = new float[4][64]();
37  m_tcor = new float[4][32][32]();
38  m_nPair = new int[4][32][32]();
39 }

◆ ~TileTOFTool()

TileTOFTool::~TileTOFTool ( )
virtual

Definition at line 41 of file TileTOFTool.cxx.

41  {
42 
43  delete[] m_timeCor;
44  delete[] m_tcor;
45  delete[] m_nPair;
46 
47 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode TileTOFTool::execute ( )
virtual

Implements ITileCalibTool.

Definition at line 66 of file TileTOFTool.cxx.

67 {
68  ATH_MSG_INFO ( "execute()" );
69 
71  ATH_CHECK( cellCONT.isValid() );
72  ATH_MSG_DEBUG ( "Cell container found" );
73 
74  CaloCellContainer::const_iterator iCell = cellCONT->begin();
75  CaloCellContainer::const_iterator lastCell = cellCONT->end();
76 
78 
79  int n = 0;
80  double x[20] = {0};
81  double y[20] = {0};
82  double z[20] = {0};
83  double t[20] = {0};
84  int part[20] = {0};
85  int mod[20] = {0};
86 
87  int section;
88  int side;
89 
90  for( ; iCell != lastCell; ++iCell) // loop over Calo cells
91  {
92  const CaloCell* cell_ptr = *iCell; // pointer to cell object
93 
94  if ( m_tileID->is_tile(cell_ptr->ID()) )
95  {
96  const TileCell* tile_cell = dynamic_cast<const TileCell*> (cell_ptr);
97 
98  if ((tile_cell!=nullptr)&&((tile_cell->ene1())>150.)&&((tile_cell->ene2())>150.)&&((tile_cell->energy())<5000.)&&(fabs(tile_cell->timeDiff())<3.5)&&(fabs(tile_cell->time())>0.00000001)) // cut to select TileCal cells crossed by muons
99  {
100  Identifier id = tile_cell->ID();
101 
102  x[n] = tile_cell->x();
103  y[n] = tile_cell->y();
104  z[n] = tile_cell->z();
105  t[n] = tile_cell->time();
106  mod[n] = m_tileID->module(id);
107 
108  section = m_tileID->section(id);
109  side = m_tileID->side(id);
110 
111  if((section == 2 || section ==3) && side == 1){part[n] = 0;} //EBA
112  else if(section == 1 && side == 1){part[n] = 1;} //LBA
113  else if(section == 1 && side == -1){part[n] = 2;} //LBC
114  else if((section == 2 || section ==3) && side == -1){part[n] = 3;} //EBC
115  n++;
116  if(n==9){break;} // events with air showers not considered
117  }
118  }
119  }
120 
121 // calculate a matrix for each partition with the time offset of each module at the bottom side of TileCal wrt each module at the bottom
122 
123 //function to calculate difference between measured time and expected TOF of the muon
124 #define TIMECOR(MOD_REF1, MOD_REF2, PART_REF1, PART_REF2, COUNT, TCOR) \
125  do { \
126  if (mod[i]==MOD_REF1 && mod[j]==MOD_REF2 && \
127  part[i]==PART_REF1 && part[j]==PART_REF2) { \
128  float TOF = sqrt(((x[j]-x[i])*(x[j]-x[i]))+((y[j]-y[i])*(y[j]-y[i]))+((z[j]-z[i])*(z[j]-z[i])))/299.792; \
129  float tc = t[j]-t[i]-TOF; \
130  ++COUNT; \
131  TCOR += tc; \
132  } \
133  } while(0)
134 
135 
136  if(n<9){
137  for(int i=0; i<n; i++) {
138  for(int j=0; j<n; j++) {
139  for(int s=0; s<4; s++) {
140  for(int k=0; k<32; k++) {
141  for(int l=0; l<32; l++) {
142  TIMECOR(k,l+32,s,s, m_nPair[s][k][l], m_tcor[s][k][l]);
143  }
144  }
145  }
146 
147  for(int s=0; s<4; s++){
148  TIMECOR(15,s+46,1,0, m_Neba[s], m_LBA_EBA[s]);
149  TIMECOR(15,s+46,1,2, m_Nlbc[s], m_LBA_LBC[s]);
150  TIMECOR(15,s+46,2,3, m_Nebc[s], m_LBC_EBC[s]);
151  }
152  }
153  }
154  }
155 
156  return StatusCode::SUCCESS;
157 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode TileTOFTool::finalize ( )
virtual

Implements ITileCalibTool.

Definition at line 402 of file TileTOFTool.cxx.

403 {
404  ATH_MSG_INFO ( "finalize()" );
405  return StatusCode::SUCCESS;
406 }

◆ finalizeCalculations()

StatusCode TileTOFTool::finalizeCalculations ( )
virtual

Implements ITileCalibTool.

Definition at line 159 of file TileTOFTool.cxx.

160 {
161  ATH_MSG_INFO ( "finalizeCalculations()" );
162 
163 // finalize calculation of the matrix
164 
165  for(int s=0; s<4; s++) {
166  for(int k=0; k<32; k++) {
167  for(int l=0; l<32; l++) {
168  if(m_nPair[s][k][l]!=0) {
169  m_tcor[s][k][l] = m_tcor[s][k][l]/m_nPair[s][k][l];
170  }
171  }
172  }}
173 
174 
175 // Offsets between different partitions
176 
177  int p0 = 0, p2 = 0, p3 = 0;
178  m_LA_EA = 0.;
179  m_LA_LC = 0.;
180  m_LA_EC = 0.;
181 
182  for(int s=0; s<4; s++){
183  if(m_Neba[s]!=0) {
184  m_LBA_EBA[s] = m_LBA_EBA[s]/m_Neba[s];
185  if(m_nPair[0][15][s+14]>5) {
186  m_LA_EA = m_LA_EA + m_tcor[0][15][s+14] - m_LBA_EBA[s];
187  p0++;
188  }
189  }
190 
191  if(m_Nlbc[s]!=0) {
192  m_LBA_LBC[s] = m_LBA_LBC[s]/m_Nlbc[s];
193  if(m_nPair[2][15][s+14]>5) {
194  m_LA_LC = m_LA_LC + m_tcor[2][15][s+14] - m_LBA_LBC[s];
195  p2++;
196  }
197  }
198 
199  if(m_Nebc[s]!=0) {
200  m_LBC_EBC[s] = m_LBC_EBC[s]/m_Nlbc[s];
201  if(m_nPair[2][15][s+14]>5) {
202  m_LA_EC = m_LA_EC + m_LA_LC + m_tcor[3][15][s+14] - m_LBC_EBC[s];
203  p3++;
204  }
205  }
206  }
207 
208  if(p0 != 0){m_LA_EA = m_LA_EA/p0; }
209  if(p2 != 0){m_LA_LC = m_LA_LC/p2; }
210  if(p3 != 0){m_LA_EC = m_LA_EC/p3; }
211 
212 // Calculation of time offsets wrt module 16 of each partition
213 
214  int n2[4][64] = {{0}};
215  memset( m_timeCor, 0, 2 * sizeof(*m_timeCor) );
216 
217  for(int s=0; s<4; s++){
218 
219  m_timeCor[s][15] = 0.; n2[s][15] = 1;
220 
221  for(int k=12; k<20; k++) {
222  if(m_nPair[s][15][k]>5) {
223  m_timeCor[s][k+32] = -m_tcor[s][15][k];
224  n2[s][k+32]=1;
225  }
226  }
227 
228 // Path to calculate all time offsets for modules in region x > 0
229 
230  for(int k=12; k<15; k++) {
231  for(int l=16; l<20; l++) {
232  if(m_nPair[s][k][l]>5) {
233  m_timeCor[s][k] += m_timeCor[s][l+32] + m_tcor[s][k][l];
234  n2[s][k]++;
235  }
236  }
237  if(n2[s][k]>0)
238  m_timeCor[s][k] /= n2[s][k];
239  }
240 
241  for(int k=12; k<16; k++) {
242  for(int l=20; l<24; l++) {
243  if(m_nPair[s][k][l]>5) {
244  m_timeCor[s][l+32] += m_timeCor[s][k] - m_tcor[s][k][l];
245  n2[s][l+32]++;
246  }
247  }
248  }
249  for(int k=52; k<56; k++) {
250  if(n2[s][k]>0) {
251  m_timeCor[s][k] /= n2[s][k];
252  }
253  }
254 
255  for(int k=8; k<12; k++) {
256  for(int l=20; l<24; l++) {
257  if(m_nPair[s][k][l]>5) {
258  m_timeCor[s][k] += m_timeCor[s][l+32] + m_tcor[s][k][l];
259  n2[s][k]++;
260  }
261  }
262  if(n2[s][k]>0)
263  m_timeCor[s][k] /= n2[s][k];
264  }
265 
266  for(int k=8; k<12; k++) {
267  for(int l=24; l<28; l++) {
268  if(m_nPair[s][k][l]>5) {
269  m_timeCor[s][l+32] += m_timeCor[s][k] - m_tcor[s][k][l];
270  n2[s][l+32]++;
271  }
272  }
273  }
274  for(int k=56; k<60; k++) {
275  if(n2[s][k]>0) {
276  m_timeCor[s][k] /=n2[s][k];
277  }
278  }
279 
280  for(int k=0; k<8; k++) {
281  for(int l=24; l<28; l++) {
282  if(m_nPair[s][k][l]>5) {
283  m_timeCor[s][k] += m_timeCor[s][l+32] + m_tcor[s][k][l];
284  n2[s][k]++;
285  }
286  }
287  if (n2[s][k]>0)
288  m_timeCor[s][k] /= n2[s][k];
289  }
290 
291  for(int k=4; k<8; k++) {
292  for(int l=28; l<32; l++) {
293  if(m_nPair[s][k][l]>5) {
294  m_timeCor[s][l+32] += m_timeCor[s][k] - m_tcor[s][k][l];
295  n2[s][l+32]++;
296  }
297  }
298  }
299  for(int k=60; k<64; k++) {
300  if(n2[s][k]>0)
301  m_timeCor[s][k] /= n2[s][k];
302  }
303 
304 // Path to calculate all time offsets for modules in region x < 0
305 
306  for(int k=16; k<20; k++) {
307  for(int l=12; l<16; l++) {
308  if(m_nPair[s][k][l]>5) {
309  m_timeCor[s][k] += m_timeCor[s][l+32] + m_tcor[s][k][l];
310  n2[s][k]++;
311  }
312  }
313  if(n2[s][k]>0)
314  m_timeCor[s][k] /= n2[s][k];
315  }
316 
317  for(int k=16; k<20; k++) {
318  for(int l=8; l<12; l++) {
319  if(m_nPair[s][k][l]>5) {
320  m_timeCor[s][l+32] += m_timeCor[s][k] - m_tcor[s][k][l];
321  n2[s][l+32]++;
322  }
323  }
324  }
325  for(int k=40; k<44; k++) {
326  if(n2[s][k]>0)
327  m_timeCor[s][k] /= n2[s][k];
328  }
329 
330  for(int k=20; k<24; k++){
331  for(int l=8; l<12; l++) {
332  if(m_nPair[s][k][l]>5) {
333  m_timeCor[s][k] += m_timeCor[s][l+32] + m_tcor[s][k][l];
334  n2[s][k]++;
335  }
336  }
337  if(n2[s][k]>0)
338  m_timeCor[s][k] /= n2[s][k];
339  }
340 
341  for(int k=20; k<24; k++) {
342  for(int l=4; l<8; l++) {
343  if(m_nPair[s][k][l]>5) {
344  m_timeCor[s][l+32] += m_timeCor[s][k] - m_tcor[s][k][l];
345  n2[s][l+32]++;
346  }
347  }
348  }
349  for(int k=36; k<40; k++) {
350  if(n2[s][k]>0) {
351  m_timeCor[s][k] /= n2[s][k];
352  }
353  }
354 
355  for(int k=24; k<32; k++) {
356  for(int l=4; l<8; l++) {
357  if(m_nPair[s][k][l]>5) {
358  m_timeCor[s][k] += m_timeCor[s][l+32] + m_tcor[s][k][l];
359  n2[s][k]++;
360  }
361  }
362  if(n2[s][k]>0)
363  m_timeCor[s][k] /= n2[s][k];
364  }
365 
366  for(int k=24; k<28; k++) {
367  for(int l=0; l<4; l++) {
368  if(m_nPair[s][k][l]>5) {
369  m_timeCor[s][l+32] += m_timeCor[s][k] - m_tcor[s][k][l];
370  n2[s][l+32]++;
371  }
372  }
373  }
374  for(int k=32; k<36; k++) {
375  if(n2[s][k]>0)
376  m_timeCor[s][k] /= n2[s][k];
377  }
378 
379  for(int l=0; l<64; l++) {
380  ATH_MSG_INFO ( "Partition: " << s << " Module: " << l+1 << " TimeCor: " << m_timeCor[s][l] << " n: " << n2[s][l] );
381  }
382  } //end of loop over different partitions
383 
384  return StatusCode::SUCCESS;
385 }

◆ initialize()

StatusCode TileTOFTool::initialize ( )
virtual

Implements ITileCalibTool.

Definition at line 51 of file TileTOFTool.cxx.

52 {
53  ATH_MSG_INFO ( "initialize()" );
54 
56 
57  return StatusCode::SUCCESS;
58 }

◆ initNtuple()

StatusCode TileTOFTool::initNtuple ( int  runNumber,
int  runType,
TFile *  rootfile 
)
virtual

Implements ITileCalibTool.

Definition at line 60 of file TileTOFTool.cxx.

61 {
62  ATH_MSG_INFO ( "initializeNtuple(" << runNumber << "," << runType << "," << rootFile << ")" );
63  return StatusCode::SUCCESS;
64 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& ITileCalibTool::interfaceID ( )
inlinestaticinherited

Definition at line 21 of file ITileCalibTool.h.

21 { return IID_ITileCalibTool; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ timeCor()

float TileTOFTool::timeCor ( int  mod_ref1,
int  mod_ref2,
int  part_ref1,
int  part_ref2 
)
private

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ writeNtuple()

StatusCode TileTOFTool::writeNtuple ( int  runNumber,
int  runType,
TFile *  rootfile 
)
virtual

Implements ITileCalibTool.

Definition at line 387 of file TileTOFTool.cxx.

388 {
389  ATH_MSG_INFO ( "writeNtuple(" << runNumber << "," << runType << "," << rootFile << ")" );
390 
391  TTree *t = new TTree("TOF", "TOF");
392  t->Branch("Time_Offset", m_timeCor, "Time_Offset[4][64]/F");
393  t->Branch("eba16_lba16", &m_LA_EA, "eba16_lba16/F");
394  t->Branch("lbc16_lba16", &m_LA_LC, "lbc16_lba16/F");
395  t->Branch("ebc16_lba16", &m_LA_EC, "ebc16_lba16/F");
396  t->Fill();
397  t->Write();
398 
399  return StatusCode::SUCCESS;
400 }

Member Data Documentation

◆ m_caloCellContainerKey

SG::ReadHandleKey<CaloCellContainer> TileTOFTool::m_caloCellContainerKey
private
Initial value:
{this,
"CaloCellContainer", "AllCalo", "Calo cell container"}

Definition at line 40 of file TileTOFTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_LA_EA

float TileTOFTool::m_LA_EA
private

Definition at line 54 of file TileTOFTool.h.

◆ m_LA_EC

float TileTOFTool::m_LA_EC
private

Definition at line 56 of file TileTOFTool.h.

◆ m_LA_LC

float TileTOFTool::m_LA_LC
private

Definition at line 55 of file TileTOFTool.h.

◆ m_LBA_EBA

float TileTOFTool::m_LBA_EBA[4]
private

Definition at line 48 of file TileTOFTool.h.

◆ m_LBA_LBC

float TileTOFTool::m_LBA_LBC[4]
private

Definition at line 47 of file TileTOFTool.h.

◆ m_LBC_EBC

float TileTOFTool::m_LBC_EBC[4]
private

Definition at line 49 of file TileTOFTool.h.

◆ m_Neba

int TileTOFTool::m_Neba[4]
private

Definition at line 51 of file TileTOFTool.h.

◆ m_Nebc

int TileTOFTool::m_Nebc[4]
private

Definition at line 52 of file TileTOFTool.h.

◆ m_Nlbc

int TileTOFTool::m_Nlbc[4]
private

Definition at line 50 of file TileTOFTool.h.

◆ m_nPair

int(* TileTOFTool::m_nPair)[32][32]
private

Definition at line 59 of file TileTOFTool.h.

◆ m_tcor

float(* TileTOFTool::m_tcor)[32][32]
private

Definition at line 58 of file TileTOFTool.h.

◆ m_tileID

const TileID* TileTOFTool::m_tileID
protected

Definition at line 36 of file TileTOFTool.h.

◆ m_timeCor

float(* TileTOFTool::m_timeCor)[64]
private

Definition at line 45 of file TileTOFTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileTOFTool::m_LA_EA
float m_LA_EA
Definition: TileTOFTool.h:54
TileCell
Definition: TileCell.h:57
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TileTOFTool::m_timeCor
float(* m_timeCor)[64]
Definition: TileTOFTool.h:45
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TileTOFTool::m_LBA_EBA
float m_LBA_EBA[4]
Definition: TileTOFTool.h:48
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TileTOFTool::m_tcor
float(* m_tcor)[32][32]
Definition: TileTOFTool.h:58
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCell::y
float y() const
get y (through CaloDetDescrElement)
Definition: CaloCell.h:420
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TileTOFTool::m_Neba
int m_Neba[4]
Definition: TileTOFTool.h:51
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TileCell::ene1
float ene1(void) const
get energy of first PMT
Definition: TileCell.h:193
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
x
#define x
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
ParticleJetTools::p3
Amg::Vector3D p3(const xAOD::TruthVertex *p)
Definition: ParticleJetLabelCommon.cxx:55
TileTOFTool::m_Nlbc
int m_Nlbc[4]
Definition: TileTOFTool.h:50
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TileTOFTool::m_LA_LC
float m_LA_LC
Definition: TileTOFTool.h:55
TileCell::timeDiff
float timeDiff(void) const
get time diff for two PMTs (data member)
Definition: TileCell.h:190
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
Tile_Base_ID::module
int module(const Identifier &id) const
Definition: Tile_Base_ID.cxx:159
lumiFormat.i
int i
Definition: lumiFormat.py:92
z
#define z
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
AtlasDetectorID::is_tile
bool is_tile(Identifier id) const
Definition: AtlasDetectorID.h:695
TIMECOR
#define TIMECOR(MOD_REF1, MOD_REF2, PART_REF1, PART_REF2, COUNT, TCOR)
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TileTOFTool::m_tileID
const TileID * m_tileID
Definition: TileTOFTool.h:36
TileTOFTool::m_LBC_EBC
float m_LBC_EBC[4]
Definition: TileTOFTool.h:49
python.OnlineISConfiguration.runType
def runType
Definition: OnlineISConfiguration.py:112
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
TileTOFTool::m_LA_EC
float m_LA_EC
Definition: TileTOFTool.h:56
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
TileCell::ene2
float ene2(void) const
get energy of second PMT
Definition: TileCell.h:195
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
TileTOFTool::m_nPair
int(* m_nPair)[32][32]
Definition: TileTOFTool.h:59
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloCell::z
float z() const
get z (through CaloDetDescrElement)
Definition: CaloCell.h:427
CaloCell::x
float x() const
get x (through CaloDetDescrElement)
Definition: CaloCell.h:413
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Tile_Base_ID::section
int section(const Identifier &id) const
Definition: Tile_Base_ID.cxx:147
TileTOFTool::m_Nebc
int m_Nebc[4]
Definition: TileTOFTool.h:52
section
void section(const std::string &sec)
Definition: TestTriggerMenuAccess.cxx:22
TileTOFTool::m_caloCellContainerKey
SG::ReadHandleKey< CaloCellContainer > m_caloCellContainerKey
Definition: TileTOFTool.h:40
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TileTOFTool::m_LBA_LBC
float m_LBA_LBC[4]
Definition: TileTOFTool.h:47
fitman.k
k
Definition: fitman.py:528