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

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 28 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 11 of file TrigT1MBTS.cxx.

12  : AthAlgorithm(name, pSvcLocator),
13  m_thresholdNumber{{0,1,2,3,4,5,6,7}, {8,9,10,11,12,13,14,15}},
14  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
15 {}

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 LVL1::TrigT1MBTS::execute ( )

Definition at line 179 of file TrigT1MBTS.cxx.

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

◆ 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 18 of file TrigT1MBTS.cxx.

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

◆ 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 68 of file TrigT1MBTS.h.

◆ m_cablestart_a

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

Definition at line 54 of file TrigT1MBTS.h.

◆ m_cablestart_c

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

Definition at line 55 of file TrigT1MBTS.h.

◆ m_cablestarts_a

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

Definition at line 56 of file TrigT1MBTS.h.

◆ m_cablestarts_c

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

Definition at line 57 of file TrigT1MBTS.h.

◆ m_CFD_fraction

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

Definition at line 65 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 60 of file TrigT1MBTS.h.

◆ m_thresholdNumber12

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

Definition at line 61 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 49 of file TrigT1MBTS.h.

◆ m_thresholds_c

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

Definition at line 51 of file TrigT1MBTS.h.

◆ m_thresholds_short_a

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

Definition at line 50 of file TrigT1MBTS.h.

◆ m_thresholds_short_c

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

Definition at line 52 of file TrigT1MBTS.h.

◆ m_ThrVecSize12

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

Definition at line 70 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 40 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 46 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 64 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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
TileTBID::is_tiletb
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition: TileTBID.cxx:86
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:49
LVL1::TrigT1MBTS::m_thresholds_short_c
std::vector< float > m_thresholds_short_c
Definition: TrigT1MBTS.h:52
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
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:55
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:40
LVL1::TrigT1MBTS::m_thresholdNumber12
std::vector< std::vector< unsigned int > > m_thresholdNumber12
Definition: TrigT1MBTS.h:61
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
LVL1::TrigT1MBTS::m_cablestarts_a
std::vector< int > m_cablestarts_a
Definition: TrigT1MBTS.h:56
python.PyAthena.module
module
Definition: PyAthena.py:134
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:60
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:64
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:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::TrigT1MBTS::m_ThrVecSize12
bool m_ThrVecSize12
Definition: TrigT1MBTS.h:70
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:68
LVL1::TrigT1MBTS::m_thresholds_short_a
std::vector< float > m_thresholds_short_a
Definition: TrigT1MBTS.h:50
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:195
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:46
LVL1::TrigT1MBTS::m_cablestarts_c
std::vector< int > m_cablestarts_c
Definition: TrigT1MBTS.h:57
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
LVL1::TrigT1MBTS::m_thresholds_c
std::vector< float > m_thresholds_c
Definition: TrigT1MBTS.h:51
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:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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:790
LVL1::TrigT1MBTS::m_CFD_fraction
float m_CFD_fraction
Definition: TrigT1MBTS.h:65
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
LVL1::TrigT1MBTS::m_cablestart_a
int m_cablestart_a
Definition: TrigT1MBTS.h:54
TileContainer
Definition: TileContainer.h:38
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >