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

level 1 ZDC trigger simulation More...

#include <TrigT1Run3ZDC.h>

Inheritance diagram for LVL1::TrigT1Run3ZDC:
Collaboration diagram for LVL1::TrigT1Run3ZDC:

Public Member Functions

 TrigT1Run3ZDC (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &ctx) const override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
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::ReadDecorHandleKey< xAOD::ZdcModuleContainerm_zdcModuleCalibEnergyKey
 
const ZdcIDm_zdcId {}
 
SG::ReadHandleKey< ZdcLucrodDataContainerm_zldContainerName
 
SG::WriteHandleKey< ZdcCTPm_zdcCTPLocation
 
Gaudi::Property< std::string > m_lutFile
 
Gaudi::Property< unsigned int > m_minSampleAna
 
Gaudi::Property< unsigned int > m_maxSampleAna
 
Gaudi::Property< unsigned int > m_negHG2ndDerivThresh
 
Gaudi::Property< unsigned int > m_negLG2ndDerivThresh
 
Gaudi::Property< unsigned int > m_baselineDelta
 
std::shared_ptr< ZDCTriggerSimFADCm_triggerSimHGPtr
 Two data member to hold the ZDCTrigger Object that computes the LUT logic: shared ptr to ensure cleanup. More...
 
std::shared_ptr< ZDCTriggerSimFADCm_triggerSimLGPtr
 
std::shared_ptr< ZDCTriggerSim::FADCInputsm_hgFADC_ptr
 A data member to hold the ZDCTrigger Object that stores flash ADC input values: shared ptr to ensure cleanup. More...
 
std::shared_ptr< ZDCTriggerSim::FADCInputsm_lgFADC_ptr
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
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

level 1 ZDC trigger simulation

Definition at line 45 of file TrigT1Run3ZDC.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TrigT1Run3ZDC()

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

Definition at line 21 of file TrigT1Run3ZDC.cxx.

22  : AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ cardinality()

unsigned int AthReentrantAlgorithm::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 55 of file AthReentrantAlgorithm.cxx.

56 {
57  return 0;
58 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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::TrigT1Run3ZDC::execute ( const EventContext &  ctx) const
overridevirtual

Definition at line 115 of file TrigT1Run3ZDC.cxx.

115  {
116 
117  // create uints to hold trigger averages
118  unsigned int trigAvgAHG = 0;
119  unsigned int trigAvgCHG = 0;
120  unsigned int trigAvgALG = 0;
121  unsigned int trigAvgCLG = 0;
122 
123  // create multi-dim array to store event by event flash ADC values
124  std::array<std::array<std::array<unsigned int, 24>, 4>, 2> FADCSamplesHG;
125  std::array<std::array<std::array<unsigned int, 24>, 4>, 2> FADCSamplesLG;
126 
127  // create vectors to store flattened above multi
128  // dim arrays, in order to give the TriggerSimTool
129  // data in the proper format
130  std::vector<unsigned int> FADCFlattenedHG;
131  std::vector<unsigned int> FADCFlattenedLG;
132 
133  // access LUCROD data
134 
135  // use readhandle to retrive lucrodCollection
137  ctx);
138 
139  for (const ZdcLucrodData* zld : *lucrodCollection) {
140 
141  // get lucrod board number
142  uint32_t lucrod_id = zld->GetLucrodID();
143 
144  // unpack data for each lucrod
145  for (size_t i = 0; i < zld->GetChanDataSize(); i++) {
146 
147  // create channel object
148  const ZdcLucrodChannel& zlc = zld->GetChanData(i);
149 
150  // figure out which channel we are reading out (0,1)
151  uint16_t lucrod_channel = zlc.id;
152 
153  // variable to hold if it is a ZDC (0) or RPD (1) type
154  // lucrod
156  lucrod_id)["type"][lucrod_channel];
157 
158  // trigger based on ZDC amplitudes, don't use
159  // RPD channels
160  if (type != 0) {
161  continue;
162  }
163 
164  // retrive what side, module, and gain we are reading out
166  lucrod_id)["side"][lucrod_channel];
168  lucrod_id)["module"][lucrod_channel];
170  lucrod_id)["gain"][lucrod_channel];
171 
172  // Fill different flash ADC vectors for Low and High
173  // gain samples
174  if (gain == 0) {
175  unsigned int counter = 0;
176  for (const auto& sample : zlc.waveform) {
177  // fill low gain FADC samples
178  FADCSamplesLG.at((side == 1)).at(module).at(counter) = sample;
179  counter++;
180  }
181  } else if(gain == 1) {
182  unsigned int counter = 0;
183  for (const auto& sample : zlc.waveform) {
184  // fill high gain FADC samples
185  FADCSamplesHG.at((side == 1)).at(module).at(counter) = sample;
186  counter++;
187  }
188  }
189  // retrive Trig Avg amp for debugging
190  // from both LG and HG modules
191  if (side * gain * module == 3) {
192  trigAvgAHG = zld->GetTrigAvgA();
193  trigAvgCHG = zld->GetTrigAvgC();
194  } else if (side * module == 3) {
195  trigAvgALG = zld->GetTrigAvgA();
196  trigAvgCLG = zld->GetTrigAvgC();
197  }
198  }
199  } // end lucrod loop
200 
201  // unpack FADC data into one long vector for both
202  // high and low gain
203  for (int side : {1, 0}) {
204  for (int module : {0, 1, 2, 3}) {
205  for (const auto sample : FADCSamplesLG.at(side).at(module)) {
206  FADCFlattenedLG.push_back(sample);
207  }
208  }
209  }
210 
211  for (int side : {1, 0}) {
212  for (int module : {0, 1, 2, 3}) {
213  for (const auto sample : FADCSamplesHG.at(side).at(module)) {
214  FADCFlattenedHG.push_back(sample);
215  }
216  }
217  }
218 
219  // set data in Trigger Sim Object
220  m_hgFADC_ptr->setData(FADCFlattenedHG);
221  m_lgFADC_ptr->setData(FADCFlattenedLG);
222 
223  // call ZDCTriggerSim to actually get L1 decisions
224  unsigned int wordOutHG = m_triggerSimHGPtr->simLevel1Trig(m_hgFADC_ptr);
225  unsigned int wordOutLG = m_triggerSimLGPtr->simLevel1Trig(m_lgFADC_ptr);
226 
227  // convert int to bitset for ZDC Triggers
228  std::bitset<3> binhg(wordOutHG);
229 
230  // convert int to bitset for ZDC ALT Trigggers
231  std::bitset<3> binlg(wordOutLG);
232 
233  // ZDC L1 items are located on CTPIN SLOT 9
234  // Each slot holds 4 connectors that each carry a 32 bit trigger word
235  // ZDC HG items are located on Connector 1 (CTPCAL)
236  // at bits 25, 26, 27
237  // ZDC LG (UCC) items are located on Connector 3 (NIM3)
238  // at bits 28, 29, 30
239  // for more info see
240  // twiki.cern.ch/twiki/bin/view/Atlas/LevelOneCentralTriggerSetup#CTPIN_Slot_9
241 
242  // load HG output into trigger word on correct bits
243  unsigned int word0 = 0;
244  word0 += (binhg[0] << 25);
245  word0 += (binhg[1] << 26);
246  word0 += (binhg[2] << 27);
247 
248  // load LG output into trigger word on correct bits
249  unsigned int word1 = 0;
250  word1 += (binlg[0] << 28);
251  word1 += (binlg[1] << 29);
252  word1 += (binlg[2] << 30);
253 
254  // form CTP obejct
256 
257  // record CTP object
258  ATH_CHECK(zdcCTP.record(std::make_unique<ZdcCTP>(word0, word1)));
259 
260  // debug output
262  "Stored ZDC CTP object with words "
263  << std::endl
264  << std::hex << word0 << " from hgLUTOutput: " << std::dec << wordOutHG
265  << " AvgAmpA: " << trigAvgAHG << " C: " << trigAvgCHG << std::endl
266  << std::hex << word1 << " from lgLUTOutput: " << std::dec << wordOutLG
267  << " AvgAmpA: " << trigAvgALG << " C: " << trigAvgCLG);
268 
269  return StatusCode::SUCCESS;
270 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthReentrantAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 79 of file AthReentrantAlgorithm.cxx.

80 {
81  // If we didn't find any symlinks to add, just return the collection
82  // from the base class. Otherwise, return the extended collection.
83  if (!m_extendedExtraObjects.empty()) {
85  }
86  return Algorithm::extraOutputDeps();
87 }

◆ filterPassed()

virtual bool AthReentrantAlgorithm::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 135 of file AthReentrantAlgorithm.h.

135  {
136  return execState( ctx ).filterPassed();
137  }

◆ initialize()

StatusCode LVL1::TrigT1Run3ZDC::initialize ( )
overridevirtual

Definition at line 28 of file TrigT1Run3ZDC.cxx.

28  {
29  ATH_CHECK(m_zdcCTPLocation.initialize());
32  // Find the full path to filename:
34  ATH_MSG_INFO("Reading file " << file);
35  std::ifstream fin(file.c_str());
36  if (!fin) {
37  ATH_MSG_ERROR("Can not read file: " << file);
38  return StatusCode::FAILURE;
39  }
41 
42  // Will eventually obtain LUTs from COOL, for now obtain them from calibration
43  // area A data member to hold the side A LUT values
44  std::array<unsigned int, 4096> sideALUTHG =
45  data["LucrodHighGain"]["LUTs"]["sideA"];
46  // A data member to hold the side C LUT values
47  std::array<unsigned int, 4096> sideCLUTHG =
48  data["LucrodHighGain"]["LUTs"]["sideC"];
49  // A data member to hold the Combined LUT values
50  std::array<unsigned int, 256> combLUTHG =
51  data["LucrodHighGain"]["LUTs"]["comb"];
52  // area A data member to hold the side A LUT values
53  std::array<unsigned int, 4096> sideALUTLG =
54  data["LucrodLowGain"]["LUTs"]["sideA"];
55  // A data member to hold the side C LUT values
56  std::array<unsigned int, 4096> sideCLUTLG =
57  data["LucrodLowGain"]["LUTs"]["sideC"];
58  // A data member to hold the Combined LUT values
59  std::array<unsigned int, 256> combLUTLG =
60  data["LucrodLowGain"]["LUTs"]["comb"];
61 
62  // Access Raw Lucrod Data
63  const ZdcID* zdcId = nullptr;
64  if (detStore()->retrieve(zdcId).isFailure()) {
65  msg(MSG::ERROR)
66  << "execute: Could not retrieve ZdcID object from the detector store"
67  << endmsg;
68  return StatusCode::FAILURE;
69  } else {
70  msg(MSG::DEBUG) << "execute: retrieved ZdcID" << endmsg;
71  }
72  m_zdcId = zdcId;
73 
74  std::array<std::array<unsigned int, 4>, 2> deriv2ndHGThresh;
75  std::array<std::array<unsigned int, 4>, 2> deriv2ndLGThresh;
76 
77  for (unsigned int side : {0, 1}) {
78  for (unsigned int module : {0, 1, 2, 3}) {
79  deriv2ndHGThresh[side][module] = m_negHG2ndDerivThresh;
80  deriv2ndLGThresh[side][module] = m_negLG2ndDerivThresh;
81  }
82  }
83 
84  // We disable the EM module in the LG trigger
85  //
86  deriv2ndLGThresh[0][0] = 4095;
87  deriv2ndLGThresh[1][0] = 4095;
88 
89  std::cout << "Trigger simulation will use sample indices: " << m_minSampleAna
90  << " through " << m_maxSampleAna
91  << ", and baselinDelta = " << m_baselineDelta << std::endl;
92 
93  // Construct Simulation Objects
94  m_triggerSimHGPtr = std::make_shared<ZDCTriggerSimFADC>(
95  ZDCTriggerSimFADC(sideALUTHG, sideCLUTHG, combLUTHG, deriv2ndHGThresh,
97 
98  m_triggerSimLGPtr = std::make_shared<ZDCTriggerSimFADC>(
99  ZDCTriggerSimFADC(sideALUTLG, sideCLUTLG, combLUTLG, deriv2ndLGThresh,
101 
102  m_hgFADC_ptr =
103  std::make_shared<ZDCTriggerSim::FADCInputs>(ZDCTriggerSim::FADCInputs());
104  m_lgFADC_ptr =
105  std::make_shared<ZDCTriggerSim::FADCInputs>(ZDCTriggerSim::FADCInputs());
106 
107  ATH_MSG_DEBUG("TrigT1Run3ZDC initilized");
108  return StatusCode::SUCCESS;
109 }

◆ inputHandles()

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

◆ isClonable()

bool AthReentrantAlgorithm::isClonable ( ) const
overridevirtualinherited

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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< Gaudi::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  }

◆ setFilterPassed()

virtual void AthReentrantAlgorithm::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 139 of file AthReentrantAlgorithm.h.

139  {
140  execState( ctx ).setFilterPassed( state );
141  }

◆ sysExecute()

StatusCode AthReentrantAlgorithm::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 67 of file AthReentrantAlgorithm.cxx.

68 {
69  return Gaudi::Algorithm::sysExecute (ctx);
70 }

◆ sysInitialize()

StatusCode AthReentrantAlgorithm::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< Gaudi::Algorithm > >.

Reimplemented in InputMakerBase, and HypoBase.

Definition at line 96 of file AthReentrantAlgorithm.cxx.

96  {
98 
99  if (sc.isFailure()) {
100  return sc;
101  }
102 
103  ServiceHandle<ICondSvc> cs("CondSvc",name());
104  for (auto h : outputHandles()) {
105  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
106  // do this inside the loop so we don't create the CondSvc until needed
107  if ( cs.retrieve().isFailure() ) {
108  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
109  return StatusCode::SUCCESS;
110  }
111  if (cs->regHandle(this,*h).isFailure()) {
112  sc = StatusCode::FAILURE;
113  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
114  << " with CondSvc");
115  }
116  }
117  }
118  return sc;
119 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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_baselineDelta

Gaudi::Property<unsigned int> LVL1::TrigT1Run3ZDC::m_baselineDelta
private
Initial value:
{
this, "BaselineDelta", 3,
"Parameter to take out average offset from raw Flash ADC values"}

Definition at line 87 of file TrigT1Run3ZDC.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 153 of file AthReentrantAlgorithm.h.

◆ m_hgFADC_ptr

std::shared_ptr<ZDCTriggerSim::FADCInputs> LVL1::TrigT1Run3ZDC::m_hgFADC_ptr
private

A data member to hold the ZDCTrigger Object that stores flash ADC input values: shared ptr to ensure cleanup.

Definition at line 100 of file TrigT1Run3ZDC.h.

◆ m_lgFADC_ptr

std::shared_ptr<ZDCTriggerSim::FADCInputs> LVL1::TrigT1Run3ZDC::m_lgFADC_ptr
private

Definition at line 101 of file TrigT1Run3ZDC.h.

◆ m_lutFile

Gaudi::Property<std::string> LVL1::TrigT1Run3ZDC::m_lutFile
private
Initial value:
{
this, "filepath_LUT", "TrigT1ZDC/zdcRun3T1LUT_v1_30_05_2023.json",
"path to LUT file"}

Definition at line 74 of file TrigT1Run3ZDC.h.

◆ m_maxSampleAna

Gaudi::Property<unsigned int> LVL1::TrigT1Run3ZDC::m_maxSampleAna
private
Initial value:
{
this, "MaxSampleAna",154, "Last Sample in ZDC LUCROD Analysis window"}

Definition at line 79 of file TrigT1Run3ZDC.h.

◆ m_minSampleAna

Gaudi::Property<unsigned int> LVL1::TrigT1Run3ZDC::m_minSampleAna
private
Initial value:
{
this, "MinSampleAna", 7, "First Sample in ZDC LUCROD Analysis window"}

Definition at line 77 of file TrigT1Run3ZDC.h.

◆ m_negHG2ndDerivThresh

Gaudi::Property<unsigned int> LVL1::TrigT1Run3ZDC::m_negHG2ndDerivThresh
private
Initial value:
{
this, "NegHG2ndDerivThresh", 45,
"Negative 2nd Derivative Threshold for High Gain LUCROD Channel"}

Definition at line 81 of file TrigT1Run3ZDC.h.

◆ m_negLG2ndDerivThresh

Gaudi::Property<unsigned int> LVL1::TrigT1Run3ZDC::m_negLG2ndDerivThresh
private
Initial value:
{
this, "NegLG2ndDerivThresh", 15,
"Negative 2nd Derivative Threshold for Low Gain LUCROD Channel"}

Definition at line 84 of file TrigT1Run3ZDC.h.

◆ m_triggerSimHGPtr

std::shared_ptr<ZDCTriggerSimFADC> LVL1::TrigT1Run3ZDC::m_triggerSimHGPtr
private

Two data member to hold the ZDCTrigger Object that computes the LUT logic: shared ptr to ensure cleanup.

Definition at line 94 of file TrigT1Run3ZDC.h.

◆ m_triggerSimLGPtr

std::shared_ptr<ZDCTriggerSimFADC> LVL1::TrigT1Run3ZDC::m_triggerSimLGPtr
private

Definition at line 95 of file TrigT1Run3ZDC.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zdcCTPLocation

SG::WriteHandleKey<ZdcCTP> LVL1::TrigT1Run3ZDC::m_zdcCTPLocation
private
Initial value:
{this, "ZdcCTPLocation",
"Write handle key for ZdcCTP"}

Definition at line 69 of file TrigT1Run3ZDC.h.

◆ m_zdcId

const ZdcID* LVL1::TrigT1Run3ZDC::m_zdcId {}
private

Definition at line 62 of file TrigT1Run3ZDC.h.

◆ m_zdcModuleCalibEnergyKey

SG::ReadDecorHandleKey<xAOD::ZdcModuleContainer> LVL1::TrigT1Run3ZDC::m_zdcModuleCalibEnergyKey
private
Initial value:
{
this, "ZdcModuleCalibEnergyKey", "ZdcModules.CalibEnergy",
"ReadHandleKey for Zdc CalibEnergy AuxData"}

Definition at line 57 of file TrigT1Run3ZDC.h.

◆ m_zldContainerName

SG::ReadHandleKey<ZdcLucrodDataContainer> LVL1::TrigT1Run3ZDC::m_zldContainerName
private
Initial value:
{
this, "ZdcLucrodDataContainerKey", TrigT1CaloDefs::ZdcLucrodDataContainer,
"Read Handle key for ZdcLucrodDataContainer"}

Definition at line 64 of file TrigT1Run3ZDC.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
LVL1::TrigT1Run3ZDC::m_negLG2ndDerivThresh
Gaudi::Property< unsigned int > m_negLG2ndDerivThresh
Definition: TrigT1Run3ZDC.h:84
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LVL1::TrigT1Run3ZDC::m_hgFADC_ptr
std::shared_ptr< ZDCTriggerSim::FADCInputs > m_hgFADC_ptr
A data member to hold the ZDCTrigger Object that stores flash ADC input values: shared ptr to ensure ...
Definition: TrigT1Run3ZDC.h:100
ZdcLucrodChannelType
Definition: ZdcLucrodData.h:12
xAOD::word1
word1
Definition: eFexEMRoI_v1.cxx:82
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
json
nlohmann::json json
Definition: HistogramDef.cxx:9
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1054
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LVL1::TrigT1CaloDefs::ZdcLucrodDataContainer
static const std::string ZdcLucrodDataContainer
Definition: TrigT1CaloDefs.h:41
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
LVL1::TrigT1CaloDefs::ZdcCTPLocation
static const std::string ZdcCTPLocation
Definition: TrigT1CaloDefs.h:80
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
LVL1::TrigT1Run3ZDC::m_triggerSimLGPtr
std::shared_ptr< ZDCTriggerSimFADC > m_triggerSimLGPtr
Definition: TrigT1Run3ZDC.h:95
LVL1::TrigT1Run3ZDC::m_zdcModuleCalibEnergyKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_zdcModuleCalibEnergyKey
Definition: TrigT1Run3ZDC.h:57
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ZdcLucrodMapRun3::getLucrod
const nlohmann::json & getLucrod(int i) const
Definition: ZdcLucrodMapRun3.h:23
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Gaudi::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::TrigT1Run3ZDC::m_zldContainerName
SG::ReadHandleKey< ZdcLucrodDataContainer > m_zldContainerName
Definition: TrigT1Run3ZDC.h:64
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
TRT::Hit::side
@ side
Definition: HitInfo.h:83
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
python.PyAthena.module
module
Definition: PyAthena.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
LVL1::TrigT1Run3ZDC::m_zdcId
const ZdcID * m_zdcId
Definition: TrigT1Run3ZDC.h:62
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthReentrantAlgorithm::AthReentrantAlgorithm
AthReentrantAlgorithm()
Default constructor:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:116
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
ZdcLucrodChannelType::waveform
std::vector< uint16_t > waveform
Definition: ZdcLucrodData.h:15
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
file
TFile * file
Definition: tile_monitor.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Gaudi::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
AthReentrantAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthReentrantAlgorithm.h:153
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:221
ZDCTriggerSimData
Definition: ZDCTriggerSim.h:58
AthReentrantAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthReentrantAlgorithm.cxx:96
LVL1::TrigT1Run3ZDC::m_maxSampleAna
Gaudi::Property< unsigned int > m_maxSampleAna
Definition: TrigT1Run3ZDC.h:79
LVL1::TrigT1Run3ZDC::m_negHG2ndDerivThresh
Gaudi::Property< unsigned int > m_negHG2ndDerivThresh
Definition: TrigT1Run3ZDC.h:81
ZDCTriggerSimFADC
Definition: ZDCTriggerSim.h:306
LVL1::TrigT1Run3ZDC::m_baselineDelta
Gaudi::Property< unsigned int > m_baselineDelta
Definition: TrigT1Run3ZDC.h:87
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
LVL1::TrigT1Run3ZDC::m_zdcCTPLocation
SG::WriteHandleKey< ZdcCTP > m_zdcCTPLocation
Definition: TrigT1Run3ZDC.h:69
a
TList * a
Definition: liststreamerinfos.cxx:10
h
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ZdcLucrodData
Definition: ZdcLucrodData.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< Gaudi::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
ZdcLucrodChannelType::id
unsigned int id
Definition: ZdcLucrodData.h:14
compute_lumi.fin
fin
Definition: compute_lumi.py:19
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
LVL1::TrigT1Run3ZDC::m_lutFile
Gaudi::Property< std::string > m_lutFile
Definition: TrigT1Run3ZDC.h:74
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
LVL1::TrigT1Run3ZDC::m_lgFADC_ptr
std::shared_ptr< ZDCTriggerSim::FADCInputs > m_lgFADC_ptr
Definition: TrigT1Run3ZDC.h:101
test_pyathena.counter
counter
Definition: test_pyathena.py:15
LVL1::TrigT1Run3ZDC::m_minSampleAna
Gaudi::Property< unsigned int > m_minSampleAna
Definition: TrigT1Run3ZDC.h:77
ZdcID
Definition: ZdcID.h:25
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 >
LVL1::TrigT1Run3ZDC::m_triggerSimHGPtr
std::shared_ptr< ZDCTriggerSimFADC > m_triggerSimHGPtr
Two data member to hold the ZDCTrigger Object that computes the LUT logic: shared ptr to ensure clean...
Definition: TrigT1Run3ZDC.h:94
ZdcLucrodMapRun3::getInstance
static const ZdcLucrodMapRun3 * getInstance()
Definition: ZdcLucrodMapRun3.cxx:10