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

#include <TileTriggerDefaultCalibTool.h>

Inheritance 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< StoreGateSvcStoreGateSvc_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

std::string m_ntupleID
int m_maxNTT
unsigned int m_nevpmt
const CaloLVL1_IDm_TT_ID
const TileHWIDm_tileHWID
const TileIDm_tileID
const TileCablingServicem_tileCablingService
ToolHandle< TileCondToolEmscalem_tileToolEmscale
 main Tile Calibration tool
SG::ReadHandleKey< TileDQstatusm_dqStatusKey
SG::ReadHandleKey< TileRawChannelContainerm_rawChannelContainerKey
SG::ReadHandleKey< xAOD::TriggerTowerContainerm_triggerTowerContainerKey
ToolHandle< LVL1::IL1CaloTTIdToolsm_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
unsigned int m_ipmt
unsigned int m_ipmtCount
unsigned int m_ipmtOld
float m_DACvalue
int m_nEvtGlobal
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 388 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 , m_TT_ID(nullptr)
40 , m_tileHWID(nullptr)
41 , m_tileID(nullptr)
42 , m_tileCablingService(nullptr)
43 , m_charge(0)
44 , m_ipmt(0)
45 , m_ipmtCount(0)
46 , m_ipmtOld(0)
47 , m_DACvalue(0)
48 , m_nEvtGlobal(0)
49{
50 declareInterface<ITileCalibTool>( this );
51 declareProperty("MaxNTriggerTowers", m_maxNTT=7200);
52 declareProperty("NtupleID", m_ntupleID="h3000");
53 declareProperty("NumEventPerPMT", m_nevpmt=195); // changed from 200 to 195
54
63
72
75}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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]
const TileCablingService * m_tileCablingService
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 77 of file TileTriggerDefaultCalibTool.cxx.

78{
79 delete[] m_meanTile;
80 delete[] m_rmsTile;
81 delete[] m_meanTileDAC;
82 delete[] m_rmsTileDAC;
83 delete[] m_ietaTile;
84 delete[] m_iphiTile;
85 delete[] m_ipmtTile;
86 delete[] m_nEvtTile;
87 delete[] m_meanL1Calo;
88 delete[] m_rmsL1Calo;
89 delete[] m_meanL1CaloDAC;
90 delete[] m_rmsL1CaloDAC;
91 delete[] m_ietaL1Calo;
92 delete[] m_iphiL1Calo;
93 delete[] m_ipmtL1Calo;
94 delete[] m_nEvtL1Calo;
95 delete[] m_meanTileL1Calo;
96 delete[] m_rmsTileL1Calo;
97}

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 }

◆ 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 135 of file TileTriggerDefaultCalibTool.cxx.

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

466{
467 ATH_MSG_DEBUG ( "finalizeTrigger()" );
468 return StatusCode::SUCCESS;
469}

◆ finalizeCalculations()

StatusCode TileTriggerDefaultCalibTool::finalizeCalculations ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 377 of file TileTriggerDefaultCalibTool.cxx.

378{
379 ATH_MSG_INFO ( "finalizeCalculations()" );
380
381 for (int ros=0;ros<5;ros++) {
382 for (int drawer=0;drawer<64;drawer++) {
383 for (int chan=0;chan<48;chan++) {
384 if (m_nEvtTile[ros][drawer][chan] > 0){
389 }
390
391 if(m_rmsTile[ros][drawer][chan] <= square(m_meanTile[ros][drawer][chan]))
392 m_rmsTile[ros][drawer][chan] = 0;
393 else
394 m_rmsTile[ros][drawer][chan] = sqrt(m_rmsTile[ros][drawer][chan] - square(m_meanTile[ros][drawer][chan]));
395
396 if(m_rmsTileDAC[ros][drawer][chan] <= square(m_meanTileDAC[ros][drawer][chan]))
398 else
399 m_rmsTileDAC[ros][drawer][chan] = sqrt(m_rmsTileDAC[ros][drawer][chan] - square(m_meanTileDAC[ros][drawer][chan]));
400
401 if (m_nEvtL1Calo[ros][drawer][chan] > 0){
406 }
407
408 if(m_rmsL1Calo[ros][drawer][chan] <= square(m_meanL1Calo[ros][drawer][chan]))
409 m_rmsL1Calo[ros][drawer][chan] = 0;
410 else
411 m_rmsL1Calo[ros][drawer][chan] = sqrt(m_rmsL1Calo[ros][drawer][chan] - square(m_meanL1Calo[ros][drawer][chan]));
412
413 if(m_rmsL1CaloDAC[ros][drawer][chan] <= square(m_meanL1CaloDAC[ros][drawer][chan]))
415 else
416 m_rmsL1CaloDAC[ros][drawer][chan] = sqrt(m_rmsL1CaloDAC[ros][drawer][chan] - square(m_meanL1CaloDAC[ros][drawer][chan]));
417
419 if(m_rmsTileL1Calo[ros][drawer][chan] <= square(m_meanTileL1Calo[ros][drawer][chan]))
421 else
422 m_rmsTileL1Calo[ros][drawer][chan] = sqrt(m_rmsTileL1Calo[ros][drawer][chan] - square(m_meanTileL1Calo[ros][drawer][chan]));
423 }
424 }
425 }
426
427 return StatusCode::SUCCESS;
428}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode TileTriggerDefaultCalibTool::initialize ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 99 of file TileTriggerDefaultCalibTool.cxx.

100{
101 ATH_MSG_INFO ( "initialize()" );
102
103 // Initialize arrays for results
104 m_charge = 0;
105 m_ipmt = 0;
106 m_ipmtOld = 0;
107 m_ipmtCount = 0;
108
109 ATH_CHECK( m_rawChannelContainerKey.initialize() );
111
112 ATH_CHECK( m_l1CaloTTIdTools.retrieve() );
113 ATH_MSG_DEBUG("L1CaloTTIdTools retrieved");
114
118
120
121 //=== get TileCondToolEmscale
122 CHECK( m_tileToolEmscale.retrieve() );
123
124 CHECK( m_dqStatusKey.initialize() );
125
126 return StatusCode::SUCCESS;
127}
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
static const TileCablingService * getInstance()
get pointer to service instance
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ initNtuple()

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

Implements ITileCalibTool.

Definition at line 129 of file TileTriggerDefaultCalibTool.cxx.

130{
131 ATH_MSG_INFO ( "initialize(" << runNumber << "," << runType << "," << rootFile << ")" );
132 return StatusCode::SUCCESS;
133}

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

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeNtuple()

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

Implements ITileCalibTool.

Definition at line 430 of file TileTriggerDefaultCalibTool.cxx.

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

Member Data Documentation

◆ m_charge

float TileTriggerDefaultCalibTool::m_charge
private

Definition at line 97 of file TileTriggerDefaultCalibTool.h.

◆ m_DACvalue

float TileTriggerDefaultCalibTool::m_DACvalue
private

Definition at line 102 of file TileTriggerDefaultCalibTool.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_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 390 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
private

Definition at line 98 of file TileTriggerDefaultCalibTool.h.

◆ m_ipmtCount

unsigned int TileTriggerDefaultCalibTool::m_ipmtCount
private

Definition at line 99 of file TileTriggerDefaultCalibTool.h.

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

Definition at line 100 of file TileTriggerDefaultCalibTool.h.

◆ 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

int TileTriggerDefaultCalibTool::m_maxNTT
private

Definition at line 51 of file TileTriggerDefaultCalibTool.h.

◆ 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

unsigned int TileTriggerDefaultCalibTool::m_nevpmt
private

Definition at line 52 of file TileTriggerDefaultCalibTool.h.

◆ m_nEvtGlobal

int TileTriggerDefaultCalibTool::m_nEvtGlobal
private

Definition at line 105 of file TileTriggerDefaultCalibTool.h.

◆ 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

std::string TileTriggerDefaultCalibTool::m_ntupleID
private

Definition at line 50 of file TileTriggerDefaultCalibTool.h.

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

Definition at line 58 of file TileTriggerDefaultCalibTool.h.

◆ m_tileHWID

const TileHWID* TileTriggerDefaultCalibTool::m_tileHWID
private

Definition at line 56 of file TileTriggerDefaultCalibTool.h.

◆ m_tileID

const TileID* TileTriggerDefaultCalibTool::m_tileID
private

Definition at line 57 of file TileTriggerDefaultCalibTool.h.

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

Definition at line 55 of file TileTriggerDefaultCalibTool.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: