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

#include <TrigT1MBTS.h>

Inheritance diagram for LVL1::TrigT1MBTS:
Collaboration diagram for LVL1::TrigT1MBTS:

Public Member Functions

 TrigT1MBTS (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
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, V, H > &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, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const TileTBIDm_tileTBID {nullptr}
 A data member to retain a pointer to the Tile Test Beam Identifier service. More...
 
Gaudi::Property< std::string > m_tileTTL1ContainerName {this, "TileTTL1ContainerName", "TileTTL1MBTS"}
 A data member to contain the name of the TileTTL1 container that contains the input MBTS information. More...
 
std::vector< float > m_thresholds_a
 The thresholds for the level 1 MBTS trigger. More...
 
std::vector< float > m_thresholds_short_a
 
std::vector< float > m_thresholds_c
 
std::vector< float > m_thresholds_short_c
 
int m_cablestart_a {0}
 
int m_cablestart_c {0}
 
std::vector< int > m_cablestarts_a
 
std::vector< int > m_cablestarts_c
 
std::vector< std::vector< unsigned int > > m_thresholdNumber
 A data member containing the mapping from channel,phi to threshold number. More...
 
std::vector< std::vector< unsigned int > > m_thresholdNumber12
 
Gaudi::Property< unsigned int > m_tZeroBin {this, "TzeroBin", 3}
 The index of the sample bin corresponding to a particle arriving from the IP. More...
 
float m_CFD_fraction {0.9}
 
bool m_badDataFound {false}
 A flag to prevent the trigger simulation from running over bad input data. More...
 
bool m_ThrVecSize12 {false}
 
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

Author
W. H. Bell W.Bel.nosp@m.l@ce.nosp@m.rn.ch

An algorithm to simulate the level 1 MBTS trigger. This algorithm records a data object of MbtsCTP type into StoreGate. The object contains the input bits for the CTP simulation.

Definition at line 24 of file TrigT1MBTS.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

◆ TrigT1MBTS()

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

Definition at line 13 of file TrigT1MBTS.cxx.

14  : AthAlgorithm(name, pSvcLocator),
15  m_thresholdNumber{{0,1,2,3,4,5,6,7}, {8,9,10,11,12,13,14,15}},
16  m_thresholdNumber12{{0,1,2,3,4,5,6,7}, {8,1000,9,1000,10,1000,11,1000}} // in Run 2 the outer MBTS were reduced to 4
17 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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, V, H > &  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 LVL1::TrigT1MBTS::execute ( )

Definition at line 181 of file TrigT1MBTS.cxx.

182 {
183  // Retrieve the TileTTL1 container that contains the input MBTS information.
184  const TileTTL1Container* tileTTL1MBTSContainer{nullptr};
185  StatusCode sc = evtStore()->retrieve(tileTTL1MBTSContainer, m_tileTTL1ContainerName);
186  if( sc.isFailure() || !tileTTL1MBTSContainer ) {
187  ATH_MSG_WARNING(m_tileTTL1ContainerName << " not found. This event will be skipped.");
188  return StatusCode::SUCCESS;
189  }
190 
191  // Check for previous bug: there should be 24 or less depending on
192  // the configuration of the Tile algorithm that creates the
193  // TileTTL1MBTS container.
194  if(tileTTL1MBTSContainer->size() > 32) {
195  if(!m_badDataFound) {
196  ATH_MSG_WARNING("BAD DATA!!! tileTTL1MBTSContainer->size() = " << tileTTL1MBTSContainer->size());
197  ATH_MSG_WARNING("There should be no more than 24 TileTTL1MBTS elements in one event.");
198  ATH_MSG_WARNING("This event will be skipped. Any further bad data will be skipped.");
199  m_badDataFound = true;
200  }
201  return StatusCode::SUCCESS;
202  }
203 
204  unsigned int triggersEBA = 0; // Number of triggers in EBA
205  unsigned int triggersEBC = 0; // Number of triggers in EBC
206  unsigned int single_triggers_A = 0;
207  unsigned int single_triggers_C = 0;
208 
209  // Loop over all Lvl 1 MBTS trigger paddles
210  for(const TileTTL1 * ttl1_mbts : *tileTTL1MBTSContainer) {
211 
212  // Find out which MBTS paddle this is.
213  Identifier id = ttl1_mbts->identify();
214  if (!m_tileTBID->is_tiletb(id)) {
215  ATH_MSG_ERROR("This is not an MBTS identifier!");
216  return StatusCode::FAILURE;
217  }
218 
219  int phi = m_tileTBID->phi(id);
220  if(phi < 0 || phi > 7) {
221  ATH_MSG_ERROR("Phi value " << phi << " is out of range!");
222  return StatusCode::FAILURE;
223  }
224 
225  int channel = m_tileTBID->channel(id);
226  if(channel < 0 || channel > 1) {
227  ATH_MSG_ERROR("Channel value " << channel << " is out of range!");
228  return StatusCode::FAILURE;
229  }
230 
231  int detSide = m_tileTBID->type(id);
232  if(detSide != -1 && detSide != 1) {
233  ATH_MSG_ERROR("Side value " << detSide << " is out of range!");
234  return StatusCode::FAILURE;
235  }
236 
237  // Retrieve the MBTS signal samples.
238  const std::vector<double> & samples = ttl1_mbts->samples();
239  unsigned int numSamples = samples.size();
240  if(m_tZeroBin >= numSamples) {
241  ATH_MSG_ERROR("t0 bin index " << m_tZeroBin << " is greater than the number of bins " << numSamples);
242  return StatusCode::FAILURE;
243  }
244 
245  ATH_MSG_DEBUG("Sample [" << m_tZeroBin << "]=" << samples[m_tZeroBin]);
246  /*
247  // Only the even counters are used for RunII
248  if(channel == 1 && phi > 7 && phi%2 != 0) {
249  ATH_MSG_DEBUG("Out counter " << phi << " is not used for RunII! This counter will be skipped!");
250  continue;
251  }
252  */
253  // Single input triggers.
254  unsigned int thresholdIndex = m_thresholdNumber[channel][phi];
255  unsigned int thresholdIndex12 = m_thresholdNumber12[channel][phi];
256  if(thresholdIndex > (unsigned int)m_thresholds_c.size() || thresholdIndex > (unsigned int)m_thresholds_a.size()) {
257  ATH_MSG_ERROR("Threshold index \"" << thresholdIndex << "\" for single triggers is out of range.");
258  return StatusCode::FAILURE;
259  }
260 
261  if(thresholdIndex12 == 1000){
262  ATH_MSG_DEBUG("this is a needless counter for run2, the sample will be skipped!");
263  continue;
264  }
265 
266  // Emulate CFD samples[m_tZeroBin]*m_CFD_fraction
267  float ThrValue_a = 0;
268  float ThrValue_c = 0;
269  if(m_ThrVecSize12) {
270  ThrValue_a = m_thresholds_short_a[thresholdIndex12];
271  ThrValue_c = m_thresholds_short_c[thresholdIndex12];
272  } else {
273  ThrValue_a = m_thresholds_a[thresholdIndex];
274  ThrValue_c = m_thresholds_c[thresholdIndex];
275  }
276 
277  if((samples[m_tZeroBin]*m_CFD_fraction > ThrValue_c && detSide == -1) ||
278  (samples[m_tZeroBin]*m_CFD_fraction > ThrValue_a && detSide == 1))
279  {
280  // Add the trigger bit to the correct trigger word
281  if(detSide == -1)
282  { // EBC
283  single_triggers_C += (1<<m_cablestarts_c[thresholdIndex]);
284  triggersEBC++; // Increment the number of EBC triggers
285  }
286  else if (detSide == 1)
287  { // EBA
288  single_triggers_A += (1<<m_cablestarts_a[thresholdIndex]);
289  triggersEBA++; // Increment the number of EBA triggers.
290  }
291 
292  ATH_MSG_DEBUG( "Single input triggered on sample " << m_tZeroBin << " of " << numSamples << " bins.");
293  }
294  }
295 
296  // Cropping to 3 bits
297  if (triggersEBA>7) triggersEBA=7;
298  if (triggersEBC>7) triggersEBC=7;
299 
300  ATH_MSG_DEBUG( "Multis: "<< triggersEBA <<" and "<< triggersEBC );
301 
302  unsigned int cableWordA = single_triggers_A + (triggersEBA<<m_cablestart_a);
303  unsigned int cableWordC = single_triggers_C + (triggersEBC<<m_cablestart_c);
304 
305  // Record the CTP trigger word in StoreGate.
306  MbtsCTP *mbtsACTP = new MbtsCTP(cableWordA);
307  MbtsCTP *mbtsCCTP = new MbtsCTP(cableWordC);
308 
309  // Methods used in CTPsimulation are added for testing
310  ATH_MSG_DEBUG( " (in CTPSimulation) mbtsA cable word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill( '0' ) << mbtsACTP->cableWord0() );
311  ATH_MSG_DEBUG( " (in CTPSimulation) Mult of mbtsA is: "<< static_cast<int>( (mbtsACTP->cableWord0() >> m_cablestart_a) & static_cast<unsigned int>( pow( 2, 3 ) - 1 ) ) );
312  ATH_MSG_DEBUG( " mbtsC cable " << mbtsCCTP->print() );
313  ATH_MSG_DEBUG( " (in CTPSimulation) mbtsC cable word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill( '0' ) << mbtsCCTP->cableWord0() );
314  ATH_MSG_DEBUG( " (in CTPSimulation) Mult of mbtsC is: "<< static_cast<int>( (mbtsCCTP->cableWord0() >> m_cablestart_c) & static_cast<unsigned int>( pow( 2, 3 ) - 1 ) ) );
315 
316  ATH_CHECK(evtStore()->record(mbtsACTP, DEFAULT_MbtsACTPLocation, false));
317  ATH_CHECK(evtStore()->record(mbtsCCTP, DEFAULT_MbtsCCTPLocation, false));
318 
319  return StatusCode::SUCCESS;
320 }

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

◆ initialize()

StatusCode LVL1::TrigT1MBTS::initialize ( )

Definition at line 20 of file TrigT1MBTS.cxx.

21 {
22  ATH_MSG_INFO("Initialising TrigT1MBTS, name = " << name());
23 
24  m_thresholds_a.clear();
25  m_thresholds_c.clear();
26  m_thresholds_short_a.clear();
27  m_thresholds_short_c.clear();
28  m_thresholds_a.resize(16,0);// set the threshold to zero here -
29  // override again further down
30  m_thresholds_c.resize(16,0);// set the threshold to zero here -
31  // override again further down
32  m_thresholds_short_a.resize(12,0);// set the threshold to zero here -
33  // override again further down
34  m_thresholds_short_c.resize(12,0);// set the threshold to zero here -
35  // override again further down
36  m_cablestarts_a.clear();
37  m_cablestarts_c.clear();
38  m_cablestarts_a.resize(16,0);// default is bit 0
39  m_cablestarts_c.resize(16,0);// default is bit 0
40 
41  // Retrieve TileTBID helper from det store
42  // (The MBTS was added to the Test Beam (TB) list.)
44 
45  const TrigConf::L1Menu * l1menu = nullptr;
47 
48  // MBTS
49  for (std::shared_ptr<TrigConf::L1Threshold> thr : l1menu->thresholds("MBTS")) {
50  if(thr->name() != "MBTS_A" && thr->name() != "MBTS_C") {
51  continue;
52  }
53  std::string connName = l1menu->connectorNameFromThreshold(thr->name());
54  unsigned int startbit = l1menu->connector(connName).triggerLine(thr->name()).startbit();
55  m_ThrVecSize12 = true; // TODO: check for (thresholds[0]->thresholdValueVector().size() == 12);
56  std::vector<float> hwThrValues(12, 0.0); // TODO need to add configuration access in TrigConfData/Threshold.h
57  if(thr->name() == "MBTS_A") {
58  m_cablestart_a = startbit;
59  if(m_ThrVecSize12) {
60  m_thresholds_short_a = std::move(hwThrValues);
61  } else {
62  m_thresholds_a = std::move(hwThrValues);
63  }
64  } else {
65  m_cablestart_c = startbit;
66  if(m_ThrVecSize12) {
67  m_thresholds_short_c = std::move(hwThrValues);
68  } else {
69  m_thresholds_c = std::move(hwThrValues);
70  }
71  }
72  }
73 
74  // MBTSSI
75  for (std::shared_ptr<TrigConf::L1Threshold> thr : l1menu->thresholds("MBTSSI")) {
76  //m_singleCounterInputs = true;
77  std::string thrname = thr->name();
78  // figure out module number from threshold name
79  size_t module = std::stoi(thrname.substr(6));
80  float hwValue = 0; // TODO implement access
81  std::string connName = l1menu->connectorNameFromThreshold(thr->name());
82  unsigned int startbit = l1menu->connector(connName).triggerLine(thr->name()).startbit();
83  ATH_MSG_INFO("Read " << thrname << " with voltage " << hwValue << "mV at bit " << startbit << " on " << connName);
84  // Get the discriminator threshold settings (single inputs) for the C side.
85  bool isCSide = thrname.find("MBTS_C")==0;
86  if(isCSide) {
87  if(module >= m_thresholds_c.size()) {
88  ATH_MSG_WARNING("Module number " << module << " on side C out of range");
89  } else {
90  m_thresholds_c[module] = hwValue;
91  m_cablestarts_c[module] = startbit;
92  }
93  } else if(thrname.starts_with("MBTS_A") && thrname.size()>6) {
94  // Get the discriminator threshold settings (single inputs) for the A side.
95  // figure out module number from threshold name
96  if(module >= m_thresholds_a.size()) {
97  ATH_MSG_WARNING("Module number " << module << " on side A out of range");
98  } else {
99  m_thresholds_a[module] = hwValue;
100  m_cablestarts_a[module] = startbit;
101  }
102  }
103  }
104 
105 
106  // MBTS_A, MBTS_C or MBTS_A, MBTS_C, MBTS_0, MBTS_1,...,MBTS_15 are used.
107  // Therefore thess messages are just INFO rather than warning.
108  if(m_thresholds_a.size() != 16) {
109  ATH_MSG_INFO("MBTS_A Lvl 1 single input thresholds not set. Triggers will be disabled.");
110  m_thresholds_a.clear();
111  for(size_t i=0;i<16;i++) {
112  m_thresholds_a.push_back(10000000);
113  }
114  }
115  if(m_thresholds_c.size() != 16) {
116  ATH_MSG_INFO("MBTS_C Lvl 1 single input thresholds not set. Triggers will be disabled.");
117  m_thresholds_c.clear();
118  for(size_t i=0;i<16;i++) {
119  m_thresholds_c.push_back(10000000);
120  }
121  }
122 
123  // Print out the state of this algorithm
124  if(msgLvl(MSG::INFO)) {
125  msg(MSG::INFO) << "=================== Settings ==================" << endmsg;
126  msg(MSG::INFO) << "TileTTL1ContainerName = " << m_tileTTL1ContainerName << endmsg;
127  msg(MSG::INFO) << "Sample t0 bin index = " << m_tZeroBin << endmsg;
128  msg(MSG::INFO) << "CFD fraction constant = " << m_CFD_fraction << endmsg;
129  if(m_ThrVecSize12){
130  msg(MSG::INFO) << "C side thresholds for single inputs = {";
131  for(size_t i=0;i<12;i++) {
133  if(i<11) msg(MSG::INFO) << ",";
134  }
135  msg(MSG::INFO) << "}" << endmsg;
136  msg(MSG::INFO) << "A side thresholds for single inputs = {";
137  for(size_t i=0;i<12;i++) {
139  if(i<11) msg(MSG::INFO) << ",";
140  }
141  msg(MSG::INFO) << "}" << endmsg;
142  if(msgLvl(MSG::INFO)) {
143  msg(MSG::DEBUG) << "thresholdNumber12: ";
144  for(size_t j=0;j<2;j++) {
145  for(size_t i=0;i<8;i++) {
147  if(i<7) msg(MSG::DEBUG) << ",";
148  }
149  msg(MSG::DEBUG) << endmsg;
150  }
151  }
152  } else {
153  msg(MSG::INFO) << "C side thresholds for single inputs = {";
154  for(size_t i=0;i<16;i++) {
156  if(i<15) msg(MSG::INFO) << ",";
157  }
158  msg(MSG::INFO) << "}" << endmsg;
159  msg(MSG::INFO) << "A side thresholds for single inputs = {";
160  for(size_t i=0;i<16;i++) {
162  if(i<15) msg(MSG::INFO) << ",";
163  }
164  msg(MSG::INFO) << "}" << endmsg;
165  }
166 
167  msg(MSG::DEBUG) << "thresholdNumber: " << endmsg;
168  for(size_t j=0;j<2;j++) {
169  for(size_t i=0;i<8;i++) {
171  if(i<7) msg(MSG::DEBUG) << ",";
172  }
173  msg(MSG::DEBUG) << endmsg;
174  }
175  msg(MSG::INFO) << "===============================================" << endmsg;
176  }
177  return StatusCode::SUCCESS;
178 }

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

bool LVL1::TrigT1MBTS::m_badDataFound {false}
private

A flag to prevent the trigger simulation from running over bad input data.


Definition at line 64 of file TrigT1MBTS.h.

◆ m_cablestart_a

int LVL1::TrigT1MBTS::m_cablestart_a {0}
private

Definition at line 50 of file TrigT1MBTS.h.

◆ m_cablestart_c

int LVL1::TrigT1MBTS::m_cablestart_c {0}
private

Definition at line 51 of file TrigT1MBTS.h.

◆ m_cablestarts_a

std::vector<int> LVL1::TrigT1MBTS::m_cablestarts_a
private

Definition at line 52 of file TrigT1MBTS.h.

◆ m_cablestarts_c

std::vector<int> LVL1::TrigT1MBTS::m_cablestarts_c
private

Definition at line 53 of file TrigT1MBTS.h.

◆ m_CFD_fraction

float LVL1::TrigT1MBTS::m_CFD_fraction {0.9}
private

Definition at line 61 of file TrigT1MBTS.h.

◆ 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_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_thresholdNumber

std::vector<std::vector<unsigned int> > LVL1::TrigT1MBTS::m_thresholdNumber
private

A data member containing the mapping from channel,phi to threshold number.

Definition at line 56 of file TrigT1MBTS.h.

◆ m_thresholdNumber12

std::vector<std::vector<unsigned int> > LVL1::TrigT1MBTS::m_thresholdNumber12
private

Definition at line 57 of file TrigT1MBTS.h.

◆ m_thresholds_a

std::vector<float> LVL1::TrigT1MBTS::m_thresholds_a
private

The thresholds for the level 1 MBTS trigger.

Definition at line 45 of file TrigT1MBTS.h.

◆ m_thresholds_c

std::vector<float> LVL1::TrigT1MBTS::m_thresholds_c
private

Definition at line 47 of file TrigT1MBTS.h.

◆ m_thresholds_short_a

std::vector<float> LVL1::TrigT1MBTS::m_thresholds_short_a
private

Definition at line 46 of file TrigT1MBTS.h.

◆ m_thresholds_short_c

std::vector<float> LVL1::TrigT1MBTS::m_thresholds_short_c
private

Definition at line 48 of file TrigT1MBTS.h.

◆ m_ThrVecSize12

bool LVL1::TrigT1MBTS::m_ThrVecSize12 {false}
private

Definition at line 66 of file TrigT1MBTS.h.

◆ m_tileTBID

const TileTBID* LVL1::TrigT1MBTS::m_tileTBID {nullptr}
private

A data member to retain a pointer to the Tile Test Beam Identifier service.

The MBTS identifiers were added after the other tile identifiers. To avoid confusion and extra work they were added to the Test Bem (TB) Identifier service.

Definition at line 36 of file TrigT1MBTS.h.

◆ m_tileTTL1ContainerName

Gaudi::Property<std::string> LVL1::TrigT1MBTS::m_tileTTL1ContainerName {this, "TileTTL1ContainerName", "TileTTL1MBTS"}
private

A data member to contain the name of the TileTTL1 container that contains the input MBTS information.

This data member is used as a job option property

Definition at line 42 of file TrigT1MBTS.h.

◆ m_tZeroBin

Gaudi::Property<unsigned int> LVL1::TrigT1MBTS::m_tZeroBin {this, "TzeroBin", 3}
private

The index of the sample bin corresponding to a particle arriving from the IP.

Definition at line 60 of file TrigT1MBTS.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
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TileTBID::is_tiletb
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition: TileTBID.cxx:88
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LVL1::TrigT1MBTS::m_thresholds_a
std::vector< float > m_thresholds_a
The thresholds for the level 1 MBTS trigger.
Definition: TrigT1MBTS.h:45
LVL1::TrigT1MBTS::m_thresholds_short_c
std::vector< float > m_thresholds_short_c
Definition: TrigT1MBTS.h:48
TileTTL1
Definition: TileTTL1.h:26
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
LVL1::TrigT1MBTS::m_cablestart_c
int m_cablestart_c
Definition: TrigT1MBTS.h:51
AthCommonMsg< Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
LVL1::TrigT1MBTS::m_tileTBID
const TileTBID * m_tileTBID
A data member to retain a pointer to the Tile Test Beam Identifier service.
Definition: TrigT1MBTS.h:36
LVL1::TrigT1MBTS::m_thresholdNumber12
std::vector< std::vector< unsigned int > > m_thresholdNumber12
Definition: TrigT1MBTS.h:57
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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
LVL1::TrigT1MBTS::m_cablestarts_a
std::vector< int > m_cablestarts_a
Definition: TrigT1MBTS.h:52
python.PyAthena.module
module
Definition: PyAthena.py:131
LVL1::TrigT1MBTS::m_thresholdNumber
std::vector< std::vector< unsigned int > > m_thresholdNumber
A data member containing the mapping from channel,phi to threshold number.
Definition: TrigT1MBTS.h:56
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
LVL1::TrigT1MBTS::m_tZeroBin
Gaudi::Property< unsigned int > m_tZeroBin
The index of the sample bin corresponding to a particle arriving from the IP.
Definition: TrigT1MBTS.h:60
IBLCalibrationConfig.thr
thr
Definition: IBLCalibrationConfig.py:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
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
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::TrigT1MBTS::m_ThrVecSize12
bool m_ThrVecSize12
Definition: TrigT1MBTS.h:66
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
LVL1::TrigT1MBTS::m_badDataFound
bool m_badDataFound
A flag to prevent the trigger simulation from running over bad input data.
Definition: TrigT1MBTS.h:64
LVL1::TrigT1MBTS::m_thresholds_short_a
std::vector< float > m_thresholds_short_a
Definition: TrigT1MBTS.h:46
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
LVL1::TrigT1MBTS::m_tileTTL1ContainerName
Gaudi::Property< std::string > m_tileTTL1ContainerName
A data member to contain the name of the TileTTL1 container that contains the input MBTS information.
Definition: TrigT1MBTS.h:42
LVL1::TrigT1MBTS::m_cablestarts_c
std::vector< int > m_cablestarts_c
Definition: TrigT1MBTS.h:53
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
LVL1::TrigT1MBTS::m_thresholds_c
std::vector< float > m_thresholds_c
Definition: TrigT1MBTS.h:47
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
TileTBID::phi
int phi(const Identifier &id) const
extract phi field from MBTS identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:165
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
LVL1::TrigT1MBTS::m_CFD_fraction
float m_CFD_fraction
Definition: TrigT1MBTS.h:61
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
LVL1::TrigT1MBTS::m_cablestart_a
int m_cablestart_a
Definition: TrigT1MBTS.h:50
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
TileContainer
Definition: TileContainer.h:38
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14