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

#include <TileDigitsToTTL1.h>

Inheritance diagram for TileDigitsToTTL1:
Collaboration diagram for TileDigitsToTTL1:

Public Member Functions

 TileDigitsToTTL1 (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~TileDigitsToTTL1 ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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 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
 

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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< TileDigitsContainerm_digitsContainerKey
 
SG::WriteHandleKey< TileTTL1Containerm_ttl1ContainerKey
 
std::string m_infoName
 
TileFragHash::TYPE m_rChType
 
const TileIDm_tileID
 
const TileHWIDm_tileHWID
 
const TileInfom_tileInfo
 
const CaloLVL1_IDm_TT_ID
 
ToolHandle< TileCondToolEmscalem_tileToolEmscale
 main Tile Calibration tool More...
 
DataObjIDColl m_extendedExtraObjects
 
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 52 of file TileDigitsToTTL1.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileDigitsToTTL1()

TileDigitsToTTL1::TileDigitsToTTL1 ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 60 of file TileDigitsToTTL1.cxx.

61  : AthAlgorithm(name, pSvcLocator)
62  , m_tileID(0)
63  , m_tileHWID(0)
64  , m_tileInfo(0)
65  , m_TT_ID(0)
66  , m_tileToolEmscale("TileCondToolEmscale")
67 {
68  // which CIS constants will be used for calibration
70 
71  declareProperty("TileInfoName", m_infoName = "TileInfo");
72  declareProperty("TileCondToolEmscale" , m_tileToolEmscale);
73 }

◆ ~TileDigitsToTTL1()

TileDigitsToTTL1::~TileDigitsToTTL1 ( )
virtual

Definition at line 75 of file TileDigitsToTTL1.cxx.

75  {
76 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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 TileDigitsToTTL1::execute ( )

Definition at line 106 of file TileDigitsToTTL1.cxx.

106  {
107 
108  ATH_MSG_DEBUG( "Executing TileDigitsToTTL1" );
109 
110  /*......................................................*/
111  // Step 2: Get all global parameters that will be needed for processing.
112  int nSamp = m_tileInfo->NdigitSamples(); // number of time slices for each chan
113  int iTrig = m_tileInfo->ItrigSample(); // index of the triggering time slice
114 
115  /* Get TileNoise flag from TileInfo (true => generate noise in TileDigits) */
116  bool tileNoise = m_tileInfo->TileNoise();
117  /* Get TileZeroSuppress flag from TileInfo
118  (true => apply threshold to Digits) */
119  bool tileThresh = m_tileInfo->TileZeroSuppress();
120  // declare array for random number generation for noise in samples.
121  double Rndm[16]; // Can't use variable size array
122 
123  ATH_MSG_DEBUG( "nSamp=" << nSamp
124  << ", iTrig=" << iTrig
125  << ", tileNoise=" << ((tileNoise) ? "true" : "false")
126  << ", tileThresh=" << ((tileThresh) ? "true" : "false") );
127 
128  /*......................................................*/
129  // step 3: Get digit container from TES and create TTL1 container
130  /* Note that digit container has 256 collections (one for each drawer),
131  but TTL1 container has no collections and no structure. */
133  ATH_CHECK( digitsContainer.isValid() );
134 
136  ATH_CHECK( ttl1Container.record(std::make_unique<TileTTL1Container>()) );
137  ATH_MSG_DEBUG( "TileTTL1Container registered successfully (" << m_ttl1ContainerKey.key() << ")" );
138 
139  /*......................................................*/
140  // Step 4: Create temporary arrays for processing signals.
141  /* Create array for all TT amplitudes in a single drawer. */
142  Identifier ttId[16]; // array of TT identifiers in a single drawer
143  bool ttDigit[16]; // array of TT occupancy in a single drawer
144  int nTT; // number of digit towers in this drawer.
145  int nDigit; // number of digits in this drawer.
146  int nIgnore; // number of ignored digits in this drawer.
147  int nTTTot = 0; // total number of digit towers.
148  int nDigitTot = 0; // total number of digits.
149  int nIgnoreTot = 0; // total number of ignored digits.
150  float ttAmpTot = 0; // total energy in good level-1 towers.
151  float ttAmpTotIg = 0.; // total energy in "ignored" level-1 towers.
152  int minieta, maxieta, posneg;
153 
154  /* Create array for the nSamp time-samples of a single tower. */
155  std::vector<float> ttL1samples(nSamp);
156 
157  /*......................................................*/
158  // Step 5: Begin loop over all collections (collection = electronic drawer).
159  for (const TileDigitsCollection* digitsCollection : *digitsContainer) {
160 
161  HWIdentifier drawer_id = m_tileHWID->drawer_id(digitsCollection->identify());
162  int ros = m_tileHWID->ros(drawer_id);
163  int drawer = m_tileHWID->drawer(drawer_id);
164  int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
165 
166  switch (ros) {
168  posneg = +1;
169  minieta = 0;
170  maxieta = 8;
171  break;
173  posneg = -1;
174  minieta = 0;
175  maxieta = 8;
176  break;
178  posneg = +1;
179  minieta = 9;
180  maxieta = 14;
181  break;
183  posneg = -1;
184  minieta = 9;
185  maxieta = 14;
186  break;
187  default:
188  posneg = minieta = maxieta = 0;
189  }
190 
191  /* Zero temporary array of trigger tower amplitudes (TTL1amp) for this collection. */
192  memset(ttDigit, 0, sizeof(ttDigit));
193  std::vector<std::vector<float> > myttAmp(16);
194  for (int ii = 0; ii < 16; ++ii)
195  myttAmp[ii].resize(nSamp);
196 
197  nTT = nIgnore = nDigit = 0;
198 
199  /*......................................................*/
200  // Step 6: Iterate over all digits in this collection, summing amps for each tower.
201  for (const TileDigits* tile_digits : *digitsCollection) {
202 
203  // get digits
204  std::vector<float> samples = tile_digits->samples();
205  // get number of time samples & compare with
206  // int nSamp = m_tileInfo->NdigitSamples();
207  int nSamp2 = samples.size();
208  if (nSamp2 != nSamp) {
209  ATH_MSG_ERROR( "nSamp from TileInfo=" << nSamp
210  << " nSamp from digits= " << nSamp2 );
211  }
212  /* Get digit HWIdentifier (= channel_id) */
213  HWIdentifier adcId = tile_digits->adc_HWID();
214  int channel = m_tileHWID->channel(adcId);
215  int adc = m_tileHWID->adc(adcId);
216  // Subtract pedestal, that is samples[0] and convert from ADC counts to pCb.
217  float pedestal = samples[0];
218  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
219 
220  samples[jsamp] = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc,
222 
223  }
224  Identifier pmt_id = tile_digits->pmt_ID();
225  if (pmt_id.is_valid()) {
226 
227  /* Get TT Identifier for this pmt */
228  Identifier tt_id = tile_digits->tt_ID();
229  /* Get eta-phi indices of TTL1 for this channel. */
230  int ieta = m_TT_ID->eta(tt_id);
231  int iphi = m_TT_ID->phi(tt_id); // (same as module).
232  if (iphi != drawer)
233  ATH_MSG_ERROR( "drawer=" << drawer << ", iphi=" << iphi );
234 
235  if (ttDigit[ieta]) { // already exists - just add charge for each sample
236  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
237  myttAmp[ieta][jsamp] += samples[jsamp];
238  }
239  } else { // digit in new TT
240  ttId[ieta] = tt_id;
241  ttDigit[ieta] = true;
242  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
243  myttAmp[ieta][jsamp] = samples[jsamp];
244  }
245  if (ieta >= minieta && ieta <= maxieta)
246  ++nTT; // count only valid TT
247  }
248  ++nDigit;
249  if (ieta < minieta || ieta > maxieta)
250  ++nIgnore;
251 
252  //Sum cell energy for comparison to other algos.
253  // convert pCb to MeV
254  float e = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc,
256 
257  if (ieta >= minieta && ieta <= maxieta) {
258  ttAmpTot += e;
259  } else {
260  ttAmpTotIg += e;
261  }
262 
263  if (msgLvl(MSG::VERBOSE)) {
264  /* Diagnostic checks: */
265  int side = m_tileID->side(pmt_id);
266  int tower = m_tileID->tower(pmt_id);
267  int sample = m_tileID->sample(pmt_id);
268  int pmt = m_tileID->pmt(pmt_id);
269  int channel = m_tileHWID->channel(adcId);
270 
271  msg(MSG::VERBOSE) << "New Digit:"
272  << " ros=" << ros
273  << ", drawer=" << drawer
274  << ", ch=" << channel
275  << ", side=" << side
276  << ", tower=" << tower
277  << ", sample=" << sample
278  << ", pmt=" << pmt
279  << ", e=" << e
280  << ", ie=" << ieta
281  << ", ip=" << iphi;
282 
283  if (ieta >= minieta && ieta <= maxieta)
284  msg(MSG::VERBOSE) << endmsg;
285  else
286  msg(MSG::VERBOSE) << " Outside limits" << endmsg;
287  }
288 
289  } else {
290  ATH_MSG_VERBOSE( "Tile Channel with no tt_id" );
291  }
292  } // end loop over digits in this drawer.
293 
294  nTTTot += nTT;
295  nDigitTot += nDigit;
296  nIgnoreTot += nIgnore;
297 
298  ATH_MSG_VERBOSE( " Statistics for"
299  << " ROS=" << ros
300  << ", drawer=" << drawer
301  << "; posneg=" << posneg
302  << ", minieta=" << minieta
303  << ", maxieta=" << maxieta
304  << "; nTT=" << nTT
305  << ", nDigit=" << nDigit
306  << ", nIgnore=" << nIgnore );
307 
308  /*......................................................*/
309  // Step 7: We now have all the TTL1 amplitudes for this drawer.
310  // Loop over towers to produce the electronics signals (= time samples).
311  // If tileNoise is requested, generate random numbers to give noise
312  for (int ieta = minieta; ieta <= maxieta; ++ieta) {
313  int iphi = drawer;
314  bool Good = ttDigit[ieta];
315  if (tileNoise)
316  Good = true;
317 
318  if (Good) {
319  if (!ttDigit[ieta])
320  ttId[ieta] = m_TT_ID->tower_id(posneg, 1, 0, ieta, drawer);
321 
322  float ttL1Calib = m_tileInfo->TTL1Calib(ttId[ieta]);
323  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
324  myttAmp[ieta][jsamp] *= ttL1Calib; // convert pCb to mV
325  }
326 
327  /* Include shaping fuction, pedestal, and noise. */
328  if (tileNoise)
329  CLHEP::RandGauss::shootArray(nSamp, Rndm);
330  float ttL1Ped = m_tileInfo->TTL1Ped(ttId[ieta]);
331  float ttL1NoiseSigma = m_tileInfo->TTL1NoiseSigma(ttId[ieta]);
332  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
333  ttL1samples[jsamp] = myttAmp[ieta][jsamp] + ttL1Ped;
334  if (tileNoise)
335  ttL1samples[jsamp] += ttL1NoiseSigma * Rndm[jsamp];
336  } // end loop over samples
337  if (tileThresh) {
338  float ttL1Thresh = m_tileInfo->TTL1Thresh(ttId[ieta]);
339  if (ttL1samples[iTrig] - ttL1Ped < ttL1Thresh)
340  Good = false;
341  }
342  } // end first "Good" section.
343  /* Create the new TTL1 object and store in TTL1Container. */
344  if (Good) {
345  ATH_MSG_DEBUG( " TTL1: "
346  << " ros=" << ros
347  << ", ieta=" << ieta
348  << ", iphi=" << iphi
349  << ", digitTrue=" << ttDigit[ieta]
350  << ", Good=" << Good
351  << ", amp0=" << myttAmp[ieta][iTrig]
352  << ", digitIn=" << ttL1samples[iTrig] );
353 
354  /*
355  The following lines are commented out.
356 
357  if (msgLvl(MSG::VERBOSE)) {
358  msg(MSG::VERBOSE) << " ttL1Digits=";
359  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
360  msg(MSG::VERBOSE) << ttL1samples[jsamp] << " ";
361  }
362  msg(MSG::VERBOSE) << endmsg;
363 
364  msg(MSG::VERBOSE) << " Rndm=";
365  for (int jsamp = 0; jsamp < nSamp; ++jsamp) {
366  msg(MSG::VERBOSE) << Rndm[jsamp] << " ";
367  }
368  msg(MSG::VERBOSE) << endmsg;
369  }
370  The preceding lines are commented out.
371  */
372 
373  ttl1Container->push_back(std::make_unique<TileTTL1>(ttId[ieta], ttL1samples));
374  } // end second "Good" section.
375  } // end loop over towers
376  } // end loop over collections
377 
378 
379  // Execution completed.
380  ATH_MSG_DEBUG( "TileDigitsToTTL1 execution completed." );
381  ATH_MSG_DEBUG( " nTTTot=" << nTTTot
382  << " nDigitTot=" << nDigitTot
383  << " nIgnoreTot=" << nIgnoreTot
384  << " ttAmpTot=" << ttAmpTot
385  << " ttAmpTotIg=" << ttAmpTotIg
386  << " =>eneTot=" << ttAmpTot + ttAmpTotIg );
387 
388  return StatusCode::SUCCESS;
389 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode TileDigitsToTTL1::finalize ( )

Definition at line 391 of file TileDigitsToTTL1.cxx.

391  {
392 
393  ATH_MSG_INFO( "TileDigitsToTTL1::finalize() end" );
394 
395  return StatusCode::SUCCESS;
396 }

◆ initialize()

StatusCode TileDigitsToTTL1::initialize ( )

Definition at line 81 of file TileDigitsToTTL1.cxx.

81  {
82 
83  // retrieve CaloLVL1_ID, TileID, TileHWID helpers and TileIfno from det store
84 
88 
89  //=== get TileCondToolEmscale
90  CHECK( m_tileToolEmscale.retrieve() );
91 
93 
95  ATH_CHECK(m_ttl1ContainerKey.initialize());
96 
97  ATH_MSG_INFO( "TileDigitsToTTL1 initialisation completed" );
98 
99  return StatusCode::SUCCESS;
100 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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  }

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_digitsContainerKey

SG::ReadHandleKey<TileDigitsContainer> TileDigitsToTTL1::m_digitsContainerKey
private
Initial value:
{this,"TileDigitsContainer",
"TileDigitsCnt", "Input Tile digits container key"}

Definition at line 67 of file TileDigitsToTTL1.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_infoName

std::string TileDigitsToTTL1::m_infoName
private

Definition at line 73 of file TileDigitsToTTL1.h.

◆ m_rChType

TileFragHash::TYPE TileDigitsToTTL1::m_rChType
private

Definition at line 75 of file TileDigitsToTTL1.h.

◆ m_tileHWID

const TileHWID* TileDigitsToTTL1::m_tileHWID
private

Definition at line 78 of file TileDigitsToTTL1.h.

◆ m_tileID

const TileID* TileDigitsToTTL1::m_tileID
private

Definition at line 77 of file TileDigitsToTTL1.h.

◆ m_tileInfo

const TileInfo* TileDigitsToTTL1::m_tileInfo
private

Definition at line 79 of file TileDigitsToTTL1.h.

◆ m_tileToolEmscale

ToolHandle<TileCondToolEmscale> TileDigitsToTTL1::m_tileToolEmscale
private

main Tile Calibration tool

Definition at line 82 of file TileDigitsToTTL1.h.

◆ m_TT_ID

const CaloLVL1_ID* TileDigitsToTTL1::m_TT_ID
private

Definition at line 80 of file TileDigitsToTTL1.h.

◆ m_ttl1ContainerKey

SG::WriteHandleKey<TileTTL1Container> TileDigitsToTTL1::m_ttl1ContainerKey
private
Initial value:
{this,"TileTTL1Container",
"TileTTL1Container","Output Tile TTL1 container key"}

Definition at line 70 of file TileDigitsToTTL1.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TileDigitsToTTL1::m_tileID
const TileID * m_tileID
Definition: TileDigitsToTTL1.h:77
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TileInfo::NdigitSamples
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Definition: TileInfo.h:75
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TileDigitsToTTL1::m_digitsContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
Definition: TileDigitsToTTL1.h:67
Tile_Base_ID::pmt
int pmt(const Identifier &id) const
Definition: Tile_Base_ID.cxx:180
TileFragHash::FitFilter
@ FitFilter
Definition: TileFragHash.h:35
ReadBchFromCool.pmt
pmt
Definition: ReadBchFromCool.py:62
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TileDigitsToTTL1::m_ttl1ContainerKey
SG::WriteHandleKey< TileTTL1Container > m_ttl1ContainerKey
Definition: TileDigitsToTTL1.h:70
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TileRawChannelUnit::PicoCoulombs
@ PicoCoulombs
Definition: TileRawChannelUnit.h:18
HWIdentifier
Definition: HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::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
TileDigitsToTTL1::m_infoName
std::string m_infoName
Definition: TileDigitsToTTL1.h:73
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TRT::Hit::side
@ side
Definition: HitInfo.h:83
CaloLVL1_ID::phi
int phi(const Identifier id) const
return phi according to :
Definition: CaloLVL1_ID.h:659
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
TileInfo::ItrigSample
int ItrigSample() const
The sample at which the pulse should ideally peak.
Definition: TileInfo.h:77
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
TileInfo::TTL1NoiseSigma
double TTL1NoiseSigma(const Identifier &) const
Returns the sigma (in mV) of Noise in TTL1 adcs.
Definition: TileInfo.h:121
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileRawChannelUnit::MegaElectronVolts
@ MegaElectronVolts
Definition: TileRawChannelUnit.h:20
TileInfo::TTL1Ped
double TTL1Ped(const Identifier &) const
Returns the pedestal (in mV) for TTL1 adcs.
Definition: TileInfo.h:139
TileHWID::EXTBAR_NEG
@ EXTBAR_NEG
Definition: TileHWID.h:71
TileDigitsToTTL1::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
main Tile Calibration tool
Definition: TileDigitsToTTL1.h:82
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
AthCommonDataStore< AthCommonMsg< Algorithm > >::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
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
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
TileDigitsCollection
Definition: TileDigitsCollection.h:18
TileHWID::drawer_id
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
Definition: TileHWID.cxx:187
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TileDigits
Definition: TileDigits.h:30
TileHWID::BARREL_NEG
@ BARREL_NEG
Definition: TileHWID.h:69
TileHWID::EXTBAR_POS
@ EXTBAR_POS
Definition: TileHWID.h:70
CaloLVL1_ID::eta
int eta(const Identifier id) const
return eta according to :
Definition: CaloLVL1_ID.h:653
TileDigitsToTTL1::m_TT_ID
const CaloLVL1_ID * m_TT_ID
Definition: TileDigitsToTTL1.h:80
TileInfo::TileNoise
bool TileNoise() const
Noise switched on/off?
Definition: TileInfo.h:87
TileHWID::BARREL_POS
@ BARREL_POS
Definition: TileHWID.h:68
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TileInfo::TileZeroSuppress
bool TileZeroSuppress() const
Zero suppression switched on/off?
Definition: TileInfo.h:91
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileDigitsToTTL1::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileDigitsToTTL1.h:78
CaloLVL1_ID::tower_id
Identifier tower_id(int pos_neg_z, int sampling, int region, int eta, int phi) const
build a tower identifier
Definition: CaloLVL1_ID.h:429
TileDigitsToTTL1::m_rChType
TileFragHash::TYPE m_rChType
Definition: TileDigitsToTTL1.h:75
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TileInfo::TTL1Thresh
double TTL1Thresh(const Identifier &) const
Returns the threshold (in mV) for TTL1 adcs.
Definition: TileInfo.h:130
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17
fitman.k
k
Definition: fitman.py:528
TileDigitsToTTL1::m_tileInfo
const TileInfo * m_tileInfo
Definition: TileDigitsToTTL1.h:79
ServiceHandle< ICondSvc >
TileInfo::TTL1Calib
double TTL1Calib(const Identifier &) const
Returns the factor which converts amplitude in pCb to mV in TTL1.
Definition: TileInfo.h:112
Identifier
Definition: IdentifierFieldParser.cxx:14