ATLAS Offline Software
Loading...
Searching...
No Matches
TileTriggerDefaultCalibTool Class Reference

#include <TileTriggerDefaultCalibTool.h>

Inheritance diagram for TileTriggerDefaultCalibTool:
Collaboration diagram for TileTriggerDefaultCalibTool:

Public Member Functions

 TileTriggerDefaultCalibTool (const std::string &type, const std::string &name, const IInterface *pParent)
virtual ~TileTriggerDefaultCalibTool ()
virtual StatusCode initialize () override
virtual StatusCode initNtuple (int runNumber, int runType, TFile *rootfile) override
virtual StatusCode execute () override
virtual StatusCode finalizeCalculations () override
virtual StatusCode writeNtuple (int runNumber, int runType, TFile *rootfile) override
virtual StatusCode finalize () override
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () 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
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.

Private Types

using Tile = TileCalibUtils
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::string > m_ntupleID {this, "NtupleID", "h3000"}
Gaudi::Property< int > m_maxNTT {this, "MaxNTriggerTowers", 7200}
Gaudi::Property< unsigned int > m_nevpmt {this, "NumEventPerPMT", 195}
const CaloLVL1_ID * m_TT_ID {nullptr}
const TileHWID * m_tileHWID {nullptr}
const TileID * m_tileID {nullptr}
const TileCablingService * m_tileCablingService {nullptr}
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
 main Tile Calibration tool
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerContainerKey
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
float(* m_meanTile )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsTile )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanTileDAC )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsTileDAC )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ietaTile )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_iphiTile )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ipmtTile )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_nEvtTile )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanL1CaloDAC )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsL1CaloDAC )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ietaL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_iphiL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ipmtL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_nEvtL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanTileL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsTileL1Calo )[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float m_charge {0}
unsigned int m_ipmt {0}
unsigned int m_ipmtCount {0}
unsigned int m_ipmtOld {0}
float m_DACvalue {0}
int m_nEvtGlobal {0}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 33 of file TileTriggerDefaultCalibTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

◆ Tile

Constructor & Destructor Documentation

◆ TileTriggerDefaultCalibTool()

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

Definition at line 37 of file TileTriggerDefaultCalibTool.cxx.

37 :
38 AthAlgTool(type, name, pParent)
39{
40 declareInterface<ITileCalibTool>( this );
41
50
59
62}
AthAlgTool()
Default constructor:
static const unsigned int MAX_ROS
Number of ROSs.
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
static const unsigned int MAX_CHAN
Number of channels in drawer.
float(* m_meanL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsTileDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsTileL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_nEvtL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ietaTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanTileDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ietaL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanTileL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanL1CaloDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ipmtL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsL1CaloDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_meanTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
float(* m_rmsTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_iphiTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_nEvtTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_ipmtTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
int(* m_iphiL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]

◆ ~TileTriggerDefaultCalibTool()

TileTriggerDefaultCalibTool::~TileTriggerDefaultCalibTool ( )
virtual

Definition at line 64 of file TileTriggerDefaultCalibTool.cxx.

65{
66 delete[] m_meanTile;
67 delete[] m_rmsTile;
68 delete[] m_meanTileDAC;
69 delete[] m_rmsTileDAC;
70 delete[] m_ietaTile;
71 delete[] m_iphiTile;
72 delete[] m_ipmtTile;
73 delete[] m_nEvtTile;
74 delete[] m_meanL1Calo;
75 delete[] m_rmsL1Calo;
76 delete[] m_meanL1CaloDAC;
77 delete[] m_rmsL1CaloDAC;
78 delete[] m_ietaL1Calo;
79 delete[] m_iphiL1Calo;
80 delete[] m_ipmtL1Calo;
81 delete[] m_nEvtL1Calo;
82 delete[] m_meanTileL1Calo;
83 delete[] m_rmsTileL1Calo;
84}

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ 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.

◆ evtStore()

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.

◆ execute()

StatusCode TileTriggerDefaultCalibTool::execute ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 122 of file TileTriggerDefaultCalibTool.cxx.

123{
124 ATH_MSG_DEBUG ( "executeTrigger()" );
125
126 const EventContext& ctx = Gaudi::Hive::currentContext();
127 const TileDQstatus* dqStatus = SG::makeHandle (m_dqStatusKey, ctx).get();
128
129 // Get TileRawChannelContainer
130 SG::ReadHandle<TileRawChannelContainer> container(m_rawChannelContainerKey);
131 ATH_CHECK( container.isValid() );
132
133 ATH_MSG_DEBUG ( "second executeTrigger()" );
134 // declare an array of pmt id for the trigger tower loop
135 //coverity[STACK_USE]
136 HWIdentifier chanIds[2][16][64][6];
137 memset(chanIds, 0, sizeof(chanIds));
138
139 // Get event's ext CIS parameters
140 const uint32_t *cispar = dqStatus->cispar();
141
142 // Mapping pmt2chan
143 int chan_bar[54] = {4 ,1 ,2 ,3 ,0 ,-1 ,
144 8 ,5 ,6 ,7 ,13,-1 ,
145 10,9 ,12,11,14,-1 ,
146 18,15,16,17,25,-1 ,
147 20,19,22,21,24,-1 ,
148 26,23,28,27,41,-1 ,
149 32,29,34,33,44,-1 ,
150 38,35,40,39,-1,-1 ,
151 36,37,42,47,46,45 };
152
153 int chan_ext[36] = {4, 5 ,2 ,3 ,16,-1 ,
154 8, 9 ,17,-1,-1,-1 ,
155 6, 7 ,14,15,38,-1 ,
156 10,11,22,23,37,-1 ,
157 20,21,30,35,-1,-1 ,
158 31,32,39,36,41,40 };
159
160 ATH_MSG_DEBUG ( "cispar[16] " << cispar[16] << ", cispas[17] " << cispar[17] << ", cispar[18] " << cispar[18] );
161 if (cispar[16] == 0x07){
162 if (cispar[18]>5) {
163 ATH_MSG_WARNING ( "Bad CISpar detected, using pmt index and charge from previous event: " << m_ipmt << " " << m_charge );
164 } else {
165 m_charge = cispar[17];
166 m_ipmt = cispar[18];
167 //m_itower = cispar[19];
168 //m_idrawer = cispar[20];
169 }
170 }
171 else if (cispar[16] == 0x107){ // bad CISpar
172 ATH_MSG_WARNING ( "Bad CISpar detected, using pmt index and charge from previous event: " << m_ipmt << " " << m_charge );
173 }
174 else
175 return StatusCode::SUCCESS;
176
177 ATH_MSG_DEBUG ( "Pattern/ipmt/charge: " << cispar[16] << " " << m_ipmt << " " << m_charge );
178 if (m_charge<1.0e-20) {
179 ATH_MSG_WARNING ( "Bad charge " << m_charge << " - skipping event" );
180 return StatusCode::SUCCESS;
181 }
182
183 if (m_ipmtOld != m_ipmt){
184 if (m_ipmt < m_ipmtOld) return StatusCode::SUCCESS;
185 m_ipmtCount = 1;
187 }
188 else
189 m_ipmtCount += 1;
190
191 if (m_ipmtCount > m_nevpmt) return StatusCode::SUCCESS; //takes into account only the first m_nevpmt events for each pmt to avoid problem with wrong CISpar
192
194
195 // Create iterator over RawChannelContainer for Tile
196 TileRawChannelContainer::const_iterator itColl = (*container).begin();
197 TileRawChannelContainer::const_iterator itCollEnd = (*container).end();
199 TileRawChannelUnit::UNIT RChUnit = container->get_unit();
200
201 // Go through all TileRawChannelCollections
202 for(; itColl != itCollEnd; ++itColl) {
203
204 //go through all TileRawChannels in collection (loop over all channels)
205 it = (*itColl)->begin();
206 itEnd = (*itColl)->end();
207
208 for(; it != itEnd; ++it) {
209
210 // get hardware id to identify adc channel
211 HWIdentifier hwid=(*it)->adc_HWID();
212 //ATH_MSG_DEBUG("HWID1: "<< m_tileHWID->to_string(hwid));
213 int ros = m_tileHWID->ros(hwid); // LBA=1 LBC=2 EBA=3 EBC=4
214 int drawer = m_tileHWID->drawer(hwid); // 0 to 63
215 int chan = m_tileHWID->channel(hwid); // 0 to 47 channel not PMT
216 int gain = m_tileHWID->adc(hwid); // low=0 high=1
217 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
218
219 // Get the PMT Id, create on the fly a mapping to the trigger tower id
220 // this mapping is to be used below in the loop over all trigger towers
221 Identifier tt_id = (*it)->tt_ID();
222 if (!tt_id.is_valid()) continue;
223 //Identifier pmt_id = (*it)->pmt_ID();
224
225 int pos_neg_z = m_TT_ID->pos_neg_z(tt_id);
226 int ieta = m_TT_ID->eta(tt_id);
227 int iphi = m_TT_ID->phi(tt_id);
228
229 if (ros < 3) {
230 if (ieta < 0 || ieta > 8) continue;
231 } else {
232 if (ieta < 9 || ieta > 14) continue;
233 }
234
235 if((ros==1) || (ros==2)){
236 // (Manually fold constants to avoid cppcheck warning.)
237 if (chan != chan_bar[(ieta*6)/*-1*/ + m_ipmt/*+1*/]) continue; // check if the chan is firing
238 }
239 else if ((ros==3) || (ros==4)){
240 if ((chan != chan_ext[((ieta-9)*6)/*-1*/ + m_ipmt/*+1*/]) || (chan == 0)) continue; // check if the chan is firing
241 }
242 else
243 continue;
244
245 float amp = (*it)->amplitude();
246 float amp_pC = m_tileToolEmscale->channelCalib(drawerIdx, chan, gain, amp, RChUnit, TileRawChannelUnit::PicoCoulombs);
247 //float amp_GeV = m_tileToolEmscale->channelCalib(drawerIdx, chan, gain, amp, RChUnit, TileRawChannelUnit::MegaElectronVolts) * 0.001;
248 //float pC2GeV = m_tileToolEmscale->channelCalib(drawerIdx, chan, 0, 1.0, TileRawChannelUnit::PicoCoulombs, TileRawChannelUnit::MegaElectronVolts) * 0.001;
249 //log << MSG::DEBUG << "ros " << ros << ", pos_neg_z " << pos_neg_z << ", drawer " << drawer <<" ieta " << ieta << ", chan " << chan << ", amplitude " << amp << endreq;
250
251 m_meanTile[ros][drawer][chan] += amp_pC;
252 m_rmsTile[ros][drawer][chan] += square(amp_pC);
253 m_meanTileDAC[ros][drawer][chan] += (amp_pC-m_charge);
254 m_rmsTileDAC[ros][drawer][chan] += square(amp_pC-m_charge);
255 m_ietaTile[ros][drawer][chan] = ieta;
256 m_iphiTile[ros][drawer][chan] = iphi;
259
260 if (pos_neg_z < 0) pos_neg_z = 0;
261 chanIds[pos_neg_z][ieta][iphi][m_ipmt] = hwid;
262 }
263
264 } // end of loop over raw channels for Tile
265
266 // loop over all L1Calo trigger channels, calculate the average and RMS
267 SG::ReadHandle<xAOD::TriggerTowerContainer> triggerTowers(m_triggerTowerContainerKey);
268 ATH_CHECK( triggerTowers.isValid() );
269
270 int ntt = 0;
271
272 for (const xAOD::TriggerTower* triggerTower : *triggerTowers) {
273
274 if(ntt>m_maxNTT) break;
275
276 if (!triggerTower->sampling()) continue; // is not hadronic
277
278 double eta = triggerTower->eta();
279 double phi = triggerTower->phi();
280 double tt_ene = 0.; //triggerTower->e();
281
282 // temporary, compute id out of the tower position
283 int pos_neg_z = m_l1CaloTTIdTools->pos_neg_z(eta);
284 int region = m_l1CaloTTIdTools->regionIndex(eta);
285 int ieta = m_l1CaloTTIdTools->etaIndex(eta);
286 int iphi = m_l1CaloTTIdTools->phiIndex(eta, phi);
287 Identifier tt_id = m_TT_ID->tower_id(pos_neg_z, 1, region, ieta, iphi);
288 //Not used, but could be useful, eg. coolId is used to get proper pedestal value
289 //Identifier id = m_ttTool->identifier(triggerTower->eta(), triggerTower->phi(), 1); //alternative way to get tt_id
290 //unsigned int coolId = m_ttTool->channelID(tt_id).id();
291
292 // check if it is a Tile tower
293 if (tt_id.is_valid() && m_TT_ID->is_tile(tt_id))
294 ++ntt;
295 else continue;
296
297 //compute L1Calo energy from ADC:
298 // - take max ADC value
299 // - subtract pedestal (about 32 ADC counts), apply 0.25 conversion factor to GeV
300 const std::vector<uint16_t>& adc = triggerTower->adc();
301 uint16_t max = *(std::max_element(adc.begin(), adc.end()));
302 uint16_t ped = adc.front();
303 tt_ene = (max - ped) * 0.25;
304 if (tt_ene < 0.) tt_ene = 0.;
305
306 // check boundaries
307 if ((ieta < 0) || (ieta > 14)) continue;
308
309 if (pos_neg_z < 0) pos_neg_z = 0;
310 HWIdentifier hwid = chanIds[pos_neg_z][ieta][iphi][m_ipmt];
311 int ros = m_tileHWID->ros(hwid); // LBA=1 LBC=2 EBA=3 EBC=4
312 if(ros >= 5 || ros <=0){continue;} // ignoring special channels, like those connected to inner MBTS in EBA/EBC 39-42,55-58
313 int drawer = m_tileHWID->drawer(hwid); // 0 to 63
314 int chan = m_tileHWID->channel(hwid); // 0 to 47 channel not PMT
315 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
316 float pC2GeV = m_tileToolEmscale->channelCalib(drawerIdx, chan, 0, 1.0, TileRawChannelUnit::PicoCoulombs, TileRawChannelUnit::MegaElectronVolts) * 0.001;
317 double tt_ene_pC = tt_ene / pC2GeV;
318
319 //comparing results from triggerTower->e() and energy computed from ADC (default method)
320 if (triggerTower->e() == 0)
321 ATH_MSG_DEBUG ( "Tower partition " << ros
322 << ", drawer "<< drawer
323 << ", chan: " << chan
324 << ", eta "<< eta
325 << ", phi: " << phi
326 << ", amplitude : " << tt_ene
327 << ", old " << triggerTower->e()
328 << ", ratio old/new " << (tt_ene == 0 ? 0 : triggerTower->e() / tt_ene ));
329
330 if ((ros==1) || (ros==2)){
331 if (chan != chan_bar[(ieta*6)-1 + m_ipmt+1]) continue; // check if the chan is firing
332 }
333 else if ((ros==3) || (ros==4)) {
334 if ((chan != chan_ext[((ieta-9)*6)-1 + m_ipmt+1]) || (chan == 0)) continue; // check if the chan is firing
335 }
336 else continue;
337
338 m_meanL1Calo[ros][drawer][chan] += tt_ene_pC;
339 m_rmsL1Calo[ros][drawer][chan] += square(tt_ene_pC);
340 m_meanL1CaloDAC[ros][drawer][chan] += tt_ene_pC - m_charge;
341 m_rmsL1CaloDAC[ros][drawer][chan] += square(tt_ene_pC - m_charge);
342 m_ietaL1Calo[ros][drawer][chan] = ieta;
343 m_iphiL1Calo[ros][drawer][chan] = iphi;
346
347 }// end of trigger tower loop for L1Calo
348
349 ++m_nEvtGlobal; // Number of MaxEvt from Athena
350
351 for (int ros=0;ros<5;ros++) {
352 for (int drawer=0;drawer<64;drawer++) {
353 for (int chan=0;chan<48;chan++) {
354 // ???
356 }
357 }
358 }
359
360 return StatusCode::SUCCESS;
361
362}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define max(a, b)
Definition cfImp.cxx:41
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:861
bool is_valid() const
Check if id is in a valid state.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
const uint32_t * cispar() const
CIS parameters.
ToolHandle< LVL1::IL1CaloTTIdTools > m_l1CaloTTIdTools
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Gaudi::Property< unsigned int > m_nevpmt
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerContainerKey
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
main Tile Calibration tool
const SG::AuxVectorData * container() const
Return the container holding this element.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.
setWord1 uint16_t
setEventNumber uint32_t

◆ 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 TileTriggerDefaultCalibTool::finalize ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 452 of file TileTriggerDefaultCalibTool.cxx.

453{
454 ATH_MSG_DEBUG ( "finalizeTrigger()" );
455 return StatusCode::SUCCESS;
456}

◆ finalizeCalculations()

StatusCode TileTriggerDefaultCalibTool::finalizeCalculations ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 364 of file TileTriggerDefaultCalibTool.cxx.

365{
366 ATH_MSG_INFO ( "finalizeCalculations()" );
367
368 for (int ros=0;ros<5;ros++) {
369 for (int drawer=0;drawer<64;drawer++) {
370 for (int chan=0;chan<48;chan++) {
371 if (m_nEvtTile[ros][drawer][chan] > 0){
376 }
377
378 if(m_rmsTile[ros][drawer][chan] <= square(m_meanTile[ros][drawer][chan]))
379 m_rmsTile[ros][drawer][chan] = 0;
380 else
381 m_rmsTile[ros][drawer][chan] = sqrt(m_rmsTile[ros][drawer][chan] - square(m_meanTile[ros][drawer][chan]));
382
383 if(m_rmsTileDAC[ros][drawer][chan] <= square(m_meanTileDAC[ros][drawer][chan]))
385 else
386 m_rmsTileDAC[ros][drawer][chan] = sqrt(m_rmsTileDAC[ros][drawer][chan] - square(m_meanTileDAC[ros][drawer][chan]));
387
388 if (m_nEvtL1Calo[ros][drawer][chan] > 0){
393 }
394
395 if(m_rmsL1Calo[ros][drawer][chan] <= square(m_meanL1Calo[ros][drawer][chan]))
396 m_rmsL1Calo[ros][drawer][chan] = 0;
397 else
398 m_rmsL1Calo[ros][drawer][chan] = sqrt(m_rmsL1Calo[ros][drawer][chan] - square(m_meanL1Calo[ros][drawer][chan]));
399
400 if(m_rmsL1CaloDAC[ros][drawer][chan] <= square(m_meanL1CaloDAC[ros][drawer][chan]))
402 else
403 m_rmsL1CaloDAC[ros][drawer][chan] = sqrt(m_rmsL1CaloDAC[ros][drawer][chan] - square(m_meanL1CaloDAC[ros][drawer][chan]));
404
406 if(m_rmsTileL1Calo[ros][drawer][chan] <= square(m_meanTileL1Calo[ros][drawer][chan]))
408 else
409 m_rmsTileL1Calo[ros][drawer][chan] = sqrt(m_rmsTileL1Calo[ros][drawer][chan] - square(m_meanTileL1Calo[ros][drawer][chan]));
410 }
411 }
412 }
413
414 return StatusCode::SUCCESS;
415}
#define ATH_MSG_INFO(x,...)

◆ initialize()

StatusCode TileTriggerDefaultCalibTool::initialize ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 86 of file TileTriggerDefaultCalibTool.cxx.

87{
88 ATH_MSG_INFO ( "initialize()" );
89
90 // Initialize arrays for results
91 m_charge = 0;
92 m_ipmt = 0;
93 m_ipmtOld = 0;
94 m_ipmtCount = 0;
95
96 ATH_CHECK( m_rawChannelContainerKey.initialize() );
98
99 ATH_CHECK( m_l1CaloTTIdTools.retrieve() );
100 ATH_MSG_DEBUG("L1CaloTTIdTools retrieved");
101
102 ATH_CHECK( detStore()->retrieve(m_TT_ID) );
103 ATH_CHECK( detStore()->retrieve(m_tileHWID) );
104 ATH_CHECK( detStore()->retrieve(m_tileID) );
105
107
108 //=== get TileCondToolEmscale
109 CHECK( m_tileToolEmscale.retrieve() );
110
111 CHECK( m_dqStatusKey.initialize() );
112
113 return StatusCode::SUCCESS;
114}
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
static const TileCablingService * getInstance()
get pointer to service instance
const TileCablingService * m_tileCablingService

◆ initNtuple()

StatusCode TileTriggerDefaultCalibTool::initNtuple ( int runNumber,
int runType,
TFile * rootfile )
overridevirtual

Implements ITileCalibTool.

Definition at line 116 of file TileTriggerDefaultCalibTool.cxx.

117{
118 ATH_MSG_INFO ( "initialize(" << runNumber << "," << runType << "," << rootFile << ")" );
119 return StatusCode::SUCCESS;
120}

◆ 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()

const InterfaceID & ITileCalibTool::interfaceID ( )
inlinestaticinherited

Definition at line 21 of file ITileCalibTool.h.

21{ return IID_ITileCalibTool; }
static const InterfaceID IID_ITileCalibTool("ITileCalibTool", 1, 0)

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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)

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ 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.

◆ updateVHKA()

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

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeNtuple()

StatusCode TileTriggerDefaultCalibTool::writeNtuple ( int runNumber,
int runType,
TFile * rootfile )
overridevirtual

Implements ITileCalibTool.

Definition at line 417 of file TileTriggerDefaultCalibTool.cxx.

418{
419 ATH_MSG_INFO ( "writeNtuple(" << runNumber << "," << runType << "," << rootFile << ")" );
420
421 TTree *t = new TTree(m_ntupleID.value().c_str(), "TileCalib-Ntuple");
422 TString ind = TString::Format("[%d][%d][%d]",Tile::MAX_ROS,Tile::MAX_DRAWER,Tile::MAX_CHAN);
423
424 t->Branch("meanTile",m_meanTile,ind.Format("meanTile%s/F",(const char *)ind));
425 t->Branch("rmsTile",m_rmsTile,ind.Format("rmsTile%s/F",(const char *)ind));
426 t->Branch("meanTileDAC",m_meanTileDAC,ind.Format("meanTileDAC%s/F",(const char *)ind));
427 t->Branch("rmsTileDAC",m_rmsTileDAC,ind.Format("rmsTileDAC%s/F",(const char *)ind));
428 t->Branch("ietaTile",m_ietaTile,ind.Format("ietaTile%s/I",(const char *)ind));
429 t->Branch("iphiTile",m_iphiTile,ind.Format("iphiTile%s/I",(const char *)ind));
430 t->Branch("ipmtTile",m_ipmtTile,ind.Format("ipmtTile%s/I",(const char *)ind));
431 t->Branch("nEvtTile",m_nEvtTile,ind.Format("nEvtTile%s/I",(const char *)ind));
432 t->Branch("meanL1Calo",m_meanL1Calo,ind.Format("meanL1Calo%s/F",(const char *)ind));
433 t->Branch("rmsL1Calo",m_rmsL1Calo,ind.Format("rmsL1Calo%s/F",(const char *)ind));
434 t->Branch("meanL1CaloDAC",m_meanL1CaloDAC,ind.Format("meanL1CaloDAC%s/F",(const char *)ind));
435 t->Branch("rmsL1CaloDAC",m_rmsL1CaloDAC,ind.Format("rmsL1CaloDAC%s/F",(const char *)ind));
436 t->Branch("ietaL1Calo",m_ietaL1Calo,ind.Format("ietaL1Calo%s/I",(const char *)ind));
437 t->Branch("iphiL1Calo",m_iphiL1Calo,ind.Format("iphiL1Calo%s/I",(const char *)ind));
438 t->Branch("ipmtL1Calo",m_ipmtL1Calo,ind.Format("ipmtL1Calo%s/I",(const char *)ind));
439 t->Branch("nEvtL1Calo",m_nEvtL1Calo,ind.Format("nEvtL1Calo%s/I",(const char *)ind));
440 t->Branch("meanTileL1Calo",m_meanTileL1Calo,ind.Format("meanTileL1Calo%s/F",(const char *)ind));
441 t->Branch("rmsTileL1Calo",m_rmsTileL1Calo,ind.Format("rmsTileL1Calo%s/F",(const char *)ind));
442 t->Branch("nEvtGlobal",&m_nEvtGlobal,"nEvtGlobal/I");
443 t->Branch("DACvalue",&m_DACvalue,"DACvalue/F");
444
445 // Fill with current values (i.e. tree will have only one entry for this whole run)
446 t->Fill();
447 t->Write();
448
449 return StatusCode::SUCCESS;
450}
Gaudi::Property< std::string > m_ntupleID

Member Data Documentation

◆ m_charge

float TileTriggerDefaultCalibTool::m_charge {0}
private

Definition at line 97 of file TileTriggerDefaultCalibTool.h.

97{0};

◆ m_DACvalue

float TileTriggerDefaultCalibTool::m_DACvalue {0}
private

Definition at line 102 of file TileTriggerDefaultCalibTool.h.

102{0};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_dqStatusKey

SG::ReadHandleKey<TileDQstatus> TileTriggerDefaultCalibTool::m_dqStatusKey
private
Initial value:
{this,
"TileDQstatus", "TileDQstatus", "TileDQstatus key"}

Definition at line 61 of file TileTriggerDefaultCalibTool.h.

61 {this,
62 "TileDQstatus", "TileDQstatus", "TileDQstatus key"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_ietaL1Calo

int(* TileTriggerDefaultCalibTool::m_ietaL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 88 of file TileTriggerDefaultCalibTool.h.

◆ m_ietaTile

int(* TileTriggerDefaultCalibTool::m_ietaTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 78 of file TileTriggerDefaultCalibTool.h.

◆ m_iphiL1Calo

int(* TileTriggerDefaultCalibTool::m_iphiL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 89 of file TileTriggerDefaultCalibTool.h.

◆ m_iphiTile

int(* TileTriggerDefaultCalibTool::m_iphiTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 79 of file TileTriggerDefaultCalibTool.h.

◆ m_ipmt

unsigned int TileTriggerDefaultCalibTool::m_ipmt {0}
private

Definition at line 98 of file TileTriggerDefaultCalibTool.h.

98{0};

◆ m_ipmtCount

unsigned int TileTriggerDefaultCalibTool::m_ipmtCount {0}
private

Definition at line 99 of file TileTriggerDefaultCalibTool.h.

99{0};

◆ m_ipmtL1Calo

int(* TileTriggerDefaultCalibTool::m_ipmtL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 90 of file TileTriggerDefaultCalibTool.h.

◆ m_ipmtOld

unsigned int TileTriggerDefaultCalibTool::m_ipmtOld {0}
private

Definition at line 100 of file TileTriggerDefaultCalibTool.h.

100{0};

◆ m_ipmtTile

int(* TileTriggerDefaultCalibTool::m_ipmtTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 80 of file TileTriggerDefaultCalibTool.h.

◆ m_l1CaloTTIdTools

ToolHandle<LVL1::IL1CaloTTIdTools > TileTriggerDefaultCalibTool::m_l1CaloTTIdTools
private
Initial value:
{this,
"L1CaloTTIdTools", "LVL1::L1CaloTTIdTools/L1CaloTTIdTools", "L1Calo TTId tools"}

Definition at line 68 of file TileTriggerDefaultCalibTool.h.

68 {this,
69 "L1CaloTTIdTools", "LVL1::L1CaloTTIdTools/L1CaloTTIdTools", "L1Calo TTId tools"};

◆ m_maxNTT

Gaudi::Property<int> TileTriggerDefaultCalibTool::m_maxNTT {this, "MaxNTriggerTowers", 7200}
private

Definition at line 51 of file TileTriggerDefaultCalibTool.h.

51{this, "MaxNTriggerTowers", 7200};

◆ m_meanL1Calo

float(* TileTriggerDefaultCalibTool::m_meanL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 84 of file TileTriggerDefaultCalibTool.h.

◆ m_meanL1CaloDAC

float(* TileTriggerDefaultCalibTool::m_meanL1CaloDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 86 of file TileTriggerDefaultCalibTool.h.

◆ m_meanTile

float(* TileTriggerDefaultCalibTool::m_meanTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 74 of file TileTriggerDefaultCalibTool.h.

◆ m_meanTileDAC

float(* TileTriggerDefaultCalibTool::m_meanTileDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 76 of file TileTriggerDefaultCalibTool.h.

◆ m_meanTileL1Calo

float(* TileTriggerDefaultCalibTool::m_meanTileL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 93 of file TileTriggerDefaultCalibTool.h.

◆ m_nevpmt

Gaudi::Property<unsigned int> TileTriggerDefaultCalibTool::m_nevpmt {this, "NumEventPerPMT", 195}
private

Definition at line 52 of file TileTriggerDefaultCalibTool.h.

52{this, "NumEventPerPMT", 195}; // changed from 200 to 195

◆ m_nEvtGlobal

int TileTriggerDefaultCalibTool::m_nEvtGlobal {0}
private

Definition at line 105 of file TileTriggerDefaultCalibTool.h.

105{0};

◆ m_nEvtL1Calo

int(* TileTriggerDefaultCalibTool::m_nEvtL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 91 of file TileTriggerDefaultCalibTool.h.

◆ m_nEvtTile

int(* TileTriggerDefaultCalibTool::m_nEvtTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 81 of file TileTriggerDefaultCalibTool.h.

◆ m_ntupleID

Gaudi::Property<std::string> TileTriggerDefaultCalibTool::m_ntupleID {this, "NtupleID", "h3000"}
private

Definition at line 50 of file TileTriggerDefaultCalibTool.h.

50{this, "NtupleID", "h3000"};

◆ m_rawChannelContainerKey

SG::ReadHandleKey<TileRawChannelContainer> TileTriggerDefaultCalibTool::m_rawChannelContainerKey
private
Initial value:
{this,
"TileRawChannelContainer", "TileRawChannelFit", "Tile raw channel container"}

Definition at line 63 of file TileTriggerDefaultCalibTool.h.

63 {this,
64 "TileRawChannelContainer", "TileRawChannelFit", "Tile raw channel container"};

◆ m_rmsL1Calo

float(* TileTriggerDefaultCalibTool::m_rmsL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 85 of file TileTriggerDefaultCalibTool.h.

◆ m_rmsL1CaloDAC

float(* TileTriggerDefaultCalibTool::m_rmsL1CaloDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 87 of file TileTriggerDefaultCalibTool.h.

◆ m_rmsTile

float(* TileTriggerDefaultCalibTool::m_rmsTile)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 75 of file TileTriggerDefaultCalibTool.h.

◆ m_rmsTileDAC

float(* TileTriggerDefaultCalibTool::m_rmsTileDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 77 of file TileTriggerDefaultCalibTool.h.

◆ m_rmsTileL1Calo

float(* TileTriggerDefaultCalibTool::m_rmsTileL1Calo)[Tile::MAX_DRAWER][Tile::MAX_CHAN]
private

Definition at line 94 of file TileTriggerDefaultCalibTool.h.

◆ m_tileCablingService

const TileCablingService* TileTriggerDefaultCalibTool::m_tileCablingService {nullptr}
private

Definition at line 58 of file TileTriggerDefaultCalibTool.h.

58{nullptr};

◆ m_tileHWID

const TileHWID* TileTriggerDefaultCalibTool::m_tileHWID {nullptr}
private

Definition at line 56 of file TileTriggerDefaultCalibTool.h.

56{nullptr};

◆ m_tileID

const TileID* TileTriggerDefaultCalibTool::m_tileID {nullptr}
private

Definition at line 57 of file TileTriggerDefaultCalibTool.h.

57{nullptr};

◆ m_tileToolEmscale

ToolHandle<TileCondToolEmscale> TileTriggerDefaultCalibTool::m_tileToolEmscale
private
Initial value:
{this,
"TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"}

main Tile Calibration tool

Definition at line 59 of file TileTriggerDefaultCalibTool.h.

59 {this,
60 "TileCondToolEmscale", "TileCondToolEmscale", "Tile em scale tool"};

◆ m_triggerTowerContainerKey

SG::ReadHandleKey<xAOD::TriggerTowerContainer> TileTriggerDefaultCalibTool::m_triggerTowerContainerKey
private
Initial value:
{this,
"TriggerTowerContainer", "xAODTriggerTowers", "Trigger Tower container"}

Definition at line 65 of file TileTriggerDefaultCalibTool.h.

65 {this,
66 "TriggerTowerContainer", "xAODTriggerTowers", "Trigger Tower container"};

◆ m_TT_ID

const CaloLVL1_ID* TileTriggerDefaultCalibTool::m_TT_ID {nullptr}
private

Definition at line 55 of file TileTriggerDefaultCalibTool.h.

55{nullptr};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: