ATLAS Offline Software
BCM_DigitizationTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <cmath>
6 
7 #include "BCM_DigitizationTool.h"
8 
11 
12 // CLHEP includes
13 #include "CLHEP/Random/RandomEngine.h"
14 #include "CLHEP/Random/RandGaussZiggurat.h"
15 
19 #include "xAODEventInfo/EventInfo.h" // NEW EDM
20 #include "xAODEventInfo/EventAuxInfo.h" // NEW EDM
22 
23 //----------------------------------------------------------------------
24 // Constructor with parameters:
25 //----------------------------------------------------------------------
26 BCM_DigitizationTool::BCM_DigitizationTool(const std::string &type, const std::string &name, const IInterface *parent) :
28 {
29  declareProperty("ModNoise", m_modNoise, "RMS noise averaged over modules");
30  declareProperty("ModSignal", m_modSignal, "Average MIP signal in modules");
31  declareProperty("NinoThr", m_ninoThr, "NINO threshold voltage");
32 }
33 
34 //----------------------------------------------------------------------
35 // Initialize method:
36 //----------------------------------------------------------------------
38 {
39  ATH_MSG_VERBOSE ( "initialize()");
40 
42  ATH_CHECK(m_mergeSvc.retrieve());
43  }
44 
45  // get random service
46  ATH_CHECK(m_rndmGenSvc.retrieve());
47 
48  // check the input object name
49  if (m_hitsContainerKey.key().empty()) {
50  ATH_MSG_FATAL("Property InputObjectName not set !");
51  return StatusCode::FAILURE;
52  }
54  ATH_MSG_DEBUG("Input objects in container : '" << m_inputObjectName << "'");
55 
56  // Initialize ReadHandleKey
57  ATH_CHECK(m_hitsContainerKey.initialize(true));
58 
59  // Write handle keys
61  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputKey);
63  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputSDOKey);
64 
65  return StatusCode::SUCCESS;
66 }
67 
68 //----------------------------------------------------------------------
69 // createOutpuContainers method:
70 //----------------------------------------------------------------------
72 {
73  // Creating output RDO container
74  SG::WriteHandle<BCM_RDO_Container> outputContainer(m_outputKey, ctx);
75  ATH_CHECK(outputContainer.record(std::make_unique<BCM_RDO_Container>()));
76  if (!outputContainer.isValid()) {
77  ATH_MSG_ERROR("Could not record output BCM RDO container " << outputContainer.name() << " to store " << outputContainer.store());
78  return StatusCode::FAILURE;
79  }
80 
81  ATH_MSG_DEBUG("Recorded output BCM RDO container " << outputContainer.name() << " in store " << outputContainer.store());
82  m_rdoContainer = outputContainer.ptr();
83 
84  // Creating output SDO collection container
86  ATH_CHECK(outputSDOContainer.record(std::make_unique<InDetSimDataCollection>()));
87  if (!outputSDOContainer.isValid()) {
88  ATH_MSG_ERROR("Could not record output BCM SDO container " << outputSDOContainer.name() << " to store " << outputSDOContainer.store());
89  return StatusCode::FAILURE;
90  }
91 
92  ATH_MSG_DEBUG("Recorded output BCM SDO container " << outputSDOContainer.name() << " in store " << outputSDOContainer.store());
93  m_simDataCollMap = outputSDOContainer.ptr();
94 
95 
96  // Clear G4 hit info vectors
97  for (unsigned int iMod=0; iMod<8; ++iMod) {
98  m_enerVect[iMod].clear();
99  m_timeVect[iMod].clear();
100  m_depositVect[iMod].clear();
101  }
102 
103  return StatusCode::SUCCESS;
104 }
105 
106 //----------------------------------------------------------------------
107 // ProcessSiHit method:
108 //----------------------------------------------------------------------
109 void BCM_DigitizationTool::processSiHit(const SiHit &currentHit, double eventTime, unsigned int evtIndex, const EventContext& ctx)
110 {
111  const int moduleNo = currentHit.getLayerDisk();
112  const float enerDep = computeEnergy(currentHit.energyLoss(), currentHit.localStartPosition(), currentHit.localEndPosition());
113  const float hitTime = currentHit.meanTime() + eventTime + m_timeDelay;
114  // Fill vectors with hit info
115  m_enerVect[moduleNo].push_back(enerDep);
116  m_timeVect[moduleNo].push_back(hitTime);
117  // Create new deposit and add to vector
118  const HepMcParticleLink particleLink = HepMcParticleLink::getRedirectedLink(currentHit.particleLink(), evtIndex, ctx); // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc.
119  const int barcode = HepMC::barcode(particleLink); // FIXME barcode-based
120  if (
121  (barcode == 0 && particleLink.id() == 0) // delta-ray
122  || MC::isSingleParticle(particleLink)
123  ) {
124  return;
125  }
126  m_depositVect[moduleNo].emplace_back(particleLink,currentHit.energyLoss());
127 }
128 
129 //----------------------------------------------------------------------
130 // createRDOs method:
131 //----------------------------------------------------------------------
132 void BCM_DigitizationTool::createRDOsAndSDOs(const EventContext& ctx)
133 {
134  // Set the RNG to use for this event.
135  ATHRNG::RNGWrapper* rngWrapper = m_rndmGenSvc->getEngine(this);
136  rngWrapper->setSeed( name(), ctx );
137 
138  // Digitize hit info and create RDO for each module
139  for (int iMod=0; iMod<8; ++iMod) {
140  if (!m_depositVect[iMod].empty()) m_simDataCollMap->emplace(Identifier(iMod), m_depositVect[iMod]);
141  std::vector<float> analog = createAnalog(iMod,m_enerVect[iMod],m_timeVect[iMod]);
142  addNoise(iMod,analog, rngWrapper->getEngine(ctx));
143  for (int iGain=0; iGain<2; ++iGain) {
144  std::bitset<64> digital = applyThreshold(iGain*8+iMod,analog);
145  int p1x,p1w,p2x,p2w;
146  applyFilter(digital);
147  findPulses(digital,p1x,p1w,p2x,p2w);
148  fillRDO(iGain*8+iMod,p1x,p1w,p2x,p2w);
149  }
150  }
151  }
152 
153 //----------------------------------------------------------------------
154 // PrepareEvent method:
155 //----------------------------------------------------------------------
156 StatusCode BCM_DigitizationTool::prepareEvent(const EventContext& ctx, unsigned int nInputEvents)
157 {
158  ATH_MSG_DEBUG ( "prepareEvent() called for " << nInputEvents << " input events" );
159 
161 
162  return StatusCode::SUCCESS;
163 }
164 
165 //----------------------------------------------------------------------//
166 // Digitize method: //
167 //----------------------------------------------------------------------//
169 {
170  ATH_MSG_DEBUG ( "processAllSubEvents()" );
171 
173 
174  // Fetch SiHitCollections for this bunch crossing
175  if (!m_onlyUseContainerName) {
177  if (!hitCollection.isValid()) {
178  ATH_MSG_ERROR("Could not get BCM SiHitCollection container " << hitCollection.name() <<
179  " from store " << hitCollection.store());
180  return StatusCode::FAILURE;
181  }
182  const unsigned int evtIndex = 0;
183  const double time = 0.0;
184  ATH_MSG_DEBUG ( "SiHitCollection found with " << hitCollection->size() << " hits" );
185  // Read hits from this collection
186  for (const auto& siHit : *hitCollection) {
187  processSiHit(siHit, time, evtIndex, ctx);
188  }
189 
190  }
191  else {
192  using TimedHitCollList = PileUpMergeSvc::TimedList<SiHitCollection>::type;
193  TimedHitCollList hitCollList;
194  if (!(m_mergeSvc->retrieveSubEvtsData(m_inputObjectName, hitCollList).isSuccess()) && hitCollList.empty()) {
195  ATH_MSG_ERROR ( "Could not fill TimedHitCollList" );
196  return StatusCode::FAILURE;
197  } else {
198  ATH_MSG_DEBUG ( hitCollList.size() << " SiHitCollections with key " << m_inputObjectName << " found" );
199  }
200 
201  // Store hit info in vectors and fill SDO map
202  TimedHitCollList::iterator iColl(hitCollList.begin());
203  TimedHitCollList::iterator endColl(hitCollList.end());
204  for (; iColl != endColl; ++iColl) {
205  const SiHitCollection* tmpColl(iColl->second);
206  const unsigned int evtIndex = (iColl->first).index();
207  const double time = (iColl->first).time();
208  ATH_MSG_DEBUG ( "SiHitCollection found with " << tmpColl->size() << " hits" );
209  // Read hits from this collection
210  for (const auto& siHit : *tmpColl) {
211  processSiHit(siHit, time, evtIndex, ctx);
212  }
213  }
214  }
215 
216  createRDOsAndSDOs(ctx);
217 
218  return StatusCode::SUCCESS;
219 }
220 
221 //----------------------------------------------------------------------
222 // ProcessBunchXing method:
223 //----------------------------------------------------------------------
225  SubEventIterator bSubEvents,
226  SubEventIterator eSubEvents)
227 {
228  const EventContext &ctx = Gaudi::Hive::currentContext();
229 
230  ATH_MSG_DEBUG ( "processBunchXing() " << bunchXing );
231 
232  SubEventIterator iEvt = bSubEvents;
233  for (; iEvt!=eSubEvents; ++iEvt) {
234  StoreGateSvc& seStore = *iEvt->ptr()->evtStore();
235  ATH_MSG_VERBOSE ( "SubEvt StoreGate " << seStore.name() << " :"
236  << " bunch crossing : " << bunchXing
237  << " time offset : " << iEvt->time()
238  << " event number : " << iEvt->ptr()->eventNumber()
239  << " run number : " << iEvt->ptr()->runNumber()
240  );
241  const SiHitCollection* seHitColl = nullptr;
242  CHECK(seStore.retrieve(seHitColl,m_inputObjectName));
243  ATH_MSG_DEBUG ( "SiHitCollection found with " << seHitColl->size() << " hits" );
244  SiHitCollection::const_iterator i = seHitColl->begin();
245  SiHitCollection::const_iterator e = seHitColl->end();
246  // Read hits from this collection
247  for (; i!=e; ++i) {
248  processSiHit(*i, iEvt->time(), iEvt->index(), ctx);
249  }
250  }
251 
252  return StatusCode::SUCCESS;
253 }
254 
255 //----------------------------------------------------------------------
256 // MergeEvent method:
257 //----------------------------------------------------------------------
259 {
260  ATH_MSG_DEBUG ( "mergeEvent()" );
261 
262  createRDOsAndSDOs(ctx);
263 
264  return StatusCode::SUCCESS;
265 }
266 
267 //----------------------------------------------------------------------
268 // ComputeEnergy method:
269 //----------------------------------------------------------------------
270 float BCM_DigitizationTool::computeEnergy(float simEner, const HepGeom::Point3D<double>& startPos, const HepGeom::Point3D<double>& endPos)
271 {
272  // Initialize output energy
273  float calcEner = 0;
274  // Break hit up into 10 discrete energy deposits
275  // For each deposit, weight energy by charge collection efficiency based on position on diamond surface
276  float xStep, yStep, rStep, r0Step, effStep;
277  for (int iStep=0; iStep<10; ++iStep) {
278  xStep = startPos.x()+iStep*(endPos.x()-startPos.x())/9;
279  yStep = startPos.y()+iStep*(endPos.y()-startPos.y())/9;
280  if (xStep==0 && yStep==0) effStep = 1.;
281  else {
282  rStep = sqrt(pow(xStep,2)+pow(yStep,2));
283  r0Step = std::abs(yStep)>std::abs(xStep) ? rStep*m_effPrmDistance/std::abs(yStep) : rStep*m_effPrmDistance/std::abs(xStep);
284  effStep = 1/(1+std::exp((rStep-r0Step)/m_effPrmSharpness));
285  }
286  calcEner+= 0.1*simEner*effStep;
287  }
288  return calcEner;
289 }
290 
291 //----------------------------------------------------------------------
292 // CreateAnalog method:
293 //----------------------------------------------------------------------
294 std::vector<float> BCM_DigitizationTool::createAnalog(int iMod, const std::vector<float>& enerVect, const std::vector<float>& timeVect)
295 {
296  std::vector<float> analog(64,0);
297  for (unsigned int iHit=0; iHit<enerVect.size(); ++iHit) {
298  float enerDep = enerVect.at(iHit);
299  float hitTime = timeVect.at(iHit);
300  int startBin = (int)(hitTime*64/25);
301  float signalMax = enerDep*m_modSignal[iMod]/m_mipDeposit;
302  float slopeup = signalMax/5; // pulse rise in 2ns ~ 5 bins @ 390ps/bin
303  float slopedown = signalMax/10; // pulse fall in 3.8ns ~ 10 bins @ 390ps/bin
304  int iBin = startBin-1;
305  float signal = 0;
306  if (iBin>=0 && startBin<64) {
307  while (signal>=0 && iBin<64) {
308  analog[iBin] += signal;
309  signal += slopeup;
310  if (iBin > startBin+4) signal -= slopeup+slopedown;
311  iBin++;
312  }
313  }
314  }
315  return analog;
316 }
317 
318 //----------------------------------------------------------------------
319 // AddNoise method:
320 //----------------------------------------------------------------------
321 void BCM_DigitizationTool::addNoise(int iMod, std::vector<float> &analog, CLHEP::HepRandomEngine* randomEngine)
322 {
323  for (float & iBin : analog) iBin+=CLHEP::RandGaussZiggurat::shoot(randomEngine,0.,m_modNoise[iMod]);
324 }
325 
326 //----------------------------------------------------------------------
327 // ApplyThreshold method:
328 //----------------------------------------------------------------------
329 std::bitset<64> BCM_DigitizationTool::applyThreshold(int iChan, const std::vector<float>& analog)
330 {
331  std::bitset<64> digital;
332  digital.reset();
333  float factor = iChan<8 ? 1./13 : 12./13;
334  for (int iBin=0; iBin<64; ++iBin)
335  if (analog[iBin]*factor>m_ninoThr[iChan%8]) digital.set(iBin);
336  return digital;
337 }
338 
339 //----------------------------------------------------------------------
340 // ApplyFilter method:
341 //----------------------------------------------------------------------
342 void BCM_DigitizationTool::applyFilter(std::bitset<64> &digital)
343 {
344  // 1101, 1011 -> 1111
345  for (int iSamp=2; iSamp<63; iSamp++) {
346  if (digital[iSamp-2] && digital[iSamp-1] && !digital[iSamp] && digital[iSamp+1]) digital[iSamp] = 1;
347  if (digital[iSamp-2] && !digital[iSamp-1] && digital[iSamp] && digital[iSamp+1]) digital[iSamp-1] = 1;
348  }
349  // 010 -> 000
350  if (digital[0] && !digital[1]) digital[0] = 0;
351  for (int iSamp=1; iSamp<63; iSamp++) {
352  if (!digital[iSamp-1] && digital[iSamp] && !digital[iSamp+1]) digital[iSamp] = 0;
353  }
354  if (!digital[62] && digital[63]) digital[63] = 0;
355 }
356 
357 //----------------------------------------------------------------------
358 // FindPulses method:
359 //----------------------------------------------------------------------
360 void BCM_DigitizationTool::findPulses(const std::bitset<64>& digital, int &p1x, int &p1w, int &p2x, int &p2w)
361 {
362  p1x = 0; p1w = 0; p2x = 0; p2w = 0;
363 
364  if (!digital.count()) return; // skip if waveform is empty
365 
366  bool p1done = false, p2done = false; bool ignorepulse = false;
367  if (digital[0] && digital[1]) ignorepulse = true;
368  else if (!digital[0] && digital[1] && digital[2]) p1x = 1;
369  for (int iBin=2; iBin<63; iBin++) {
370  if (!digital[iBin-2] && !digital[iBin-1] && digital[iBin] && digital[iBin+1]) { // rising edge
371  if (!p1done && !p2done) p1x = iBin;
372  else if (p1done && !p2done) p2x = iBin;
373  }
374  else if (digital[iBin-2] && digital[iBin-1] && !digital[iBin] && !digital[iBin+1]) { // falling edge
375  if (!ignorepulse) {
376  if (!p1done && !p2done) {
377  p1w = iBin - p1x;
378  p1done = true;
379  if (p1w >= 32) {
380  p2x = p1x + 31;
381  p2w = p1w - 31;
382  p2done = true;
383  p1w = 31;
384  }
385  }
386  else if (p1done && !p2done) {
387  p2w = iBin - p2x;
388  p2done = true;
389  if (p2w >= 32) p2w = 31;
390  }
391  }
392  else ignorepulse = false;
393  }
394  }
395  if (digital[61] && digital[62] && !digital[63]) {
396  if (!ignorepulse) {
397  if (!p1done && !p2done) {
398  p1w = 63 - p1x;
399  p1done = true;
400  if (p1w >= 32) {
401  p2x = p1x + 31;
402  p2w = p1w - 31;
403  p2done = true;
404  p1w = 31;
405  }
406  }
407  else if (p1done && !p2done) {
408  p2w = 63 - p2x;
409  p2done = true;
410  if (p2w >= 32) p2w = 31;
411  }
412  }
413  else ignorepulse = false;
414  }
415  else if (digital[62] && digital[63]) {
416  if (!ignorepulse) {
417  if (!p1done && !p2done) {
418  p1w = 1;
419  p1done = true;
420  if (64 - p1x >= 32) {
421  p2x = p1x + 31;
422  p2w = 1;
423  p2done = true;
424  p1w = 31;
425  }
426  }
427  else if (p1done && !p2done) {
428  p2w = 1;
429  p2done = true;
430  if (64 - p2x >= 32) p2w = 31;
431  }
432  }
433  else ignorepulse = false;
434  }
435 }
436 
437 //----------------------------------------------------------------------
438 // FillRDO method:
439 //----------------------------------------------------------------------
440 void BCM_DigitizationTool::fillRDO(unsigned int chan, int p1x, int p1w, int p2x, int p2w)
441 {
442  BCM_RDO_Collection *RDOColl = nullptr;
443  // Check if collection for this channel already exists
444  bool collExists = false;
447  for (; it_coll!=it_collE; ++it_coll) {
448  if ((*it_coll)->getChannel()==chan) {
449  collExists = true;
450  RDOColl = *it_coll;
451  }
452  }
453  // Create the RDO collection if needed
454  if (!collExists) {
455  RDOColl = new BCM_RDO_Collection(chan);
456  // Add collection to container
457  m_rdoContainer->push_back(RDOColl);
458  }
459  // Create RDO & add it to collection
460  BCM_RawData *bcmrdo = new BCM_RawData(chan,p1x,p1w,p2x,p2w,0,0,0);
461  if (bcmrdo) RDOColl->push_back(bcmrdo);
462 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
BCM_DigitizationTool::processSiHit
void processSiHit(const SiHit &currentHit, double eventTime, unsigned int evtIndex, const EventContext &ctx)
Definition: BCM_DigitizationTool.cxx:109
BCM_DigitizationTool::m_modSignal
std::vector< float > m_modSignal
Most probable MIP signal.
Definition: BCM_DigitizationTool.h:81
BCM_DigitizationTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
PileUpToolBase methods.
Definition: BCM_DigitizationTool.cxx:156
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
BCM_DigitizationTool::findPulses
static void findPulses(const std::bitset< 64 > &digital, int &p1x, int &p1w, int &p2x, int &p2w)
Find first two pulses on digital waveform.
Definition: BCM_DigitizationTool.cxx:360
SiHit::localEndPosition
HepGeom::Point3D< double > localEndPosition() const
Definition: SiHit.cxx:153
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SG::VarHandleBase::name
const std::string & name() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:75
BCM_DigitizationTool::fillRDO
void fillRDO(unsigned int chan, int p1x, int p1w, int p2x, int p2w)
Create raw data object and put it in the container.
Definition: BCM_DigitizationTool.cxx:440
SiHit::getLayerDisk
int getLayerDisk() const
Definition: SiHit.cxx:164
AtlasHitsVector
Definition: AtlasHitsVector.h:33
BCM_DigitizationTool::m_timeDelay
Gaudi::Property< float > m_timeDelay
Definition: BCM_DigitizationTool.h:86
BCM_DigitizationTool::m_timeVect
std::vector< float > m_timeVect[8]
G4 hit times.
Definition: BCM_DigitizationTool.h:105
BCM_DigitizationTool::m_simDataCollMap
InDetSimDataCollection * m_simDataCollMap
Output SDO map.
Definition: BCM_DigitizationTool.h:98
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
BCM_DigitizationTool::m_ninoThr
std::vector< float > m_ninoThr
NINO threshold.
Definition: BCM_DigitizationTool.h:82
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
AtlasHitsVector::begin
const_iterator begin() const
Definition: AtlasHitsVector.h:131
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
AtlasHitsVector::const_iterator
CONT::const_iterator const_iterator
Definition: AtlasHitsVector.h:43
BCM_DigitizationTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Definition: BCM_DigitizationTool.h:100
BCM_DigitizationTool::initialize
virtual StatusCode initialize() override final
Definition: BCM_DigitizationTool.cxx:37
BCM_DigitizationTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Definition: BCM_DigitizationTool.cxx:168
SiHit
Definition: SiHit.h:19
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
StoreGateSvc::retrieve
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
SiHit::meanTime
double meanTime() const
Definition: SiHit.h:180
Cut::signal
@ signal
Definition: SUSYToolsAlg.cxx:67
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
BCM_DigitizationTool::applyThreshold
std::bitset< 64 > applyThreshold(int chan, const std::vector< float > &analog)
Do ToT digitization.
Definition: BCM_DigitizationTool.cxx:329
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
BCM_DigitizationTool::createOutputContainers
StatusCode createOutputContainers(const EventContext &ctx)
Create the RDO and SDO containers.
Definition: BCM_DigitizationTool.cxx:71
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
lumiFormat.i
int i
Definition: lumiFormat.py:85
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
BCM_DigitizationTool::createAnalog
std::vector< float > createAnalog(int mod, const std::vector< float > &enerVect, const std::vector< float > &timeVect)
Fill in hit pulses on analog waveform.
Definition: BCM_DigitizationTool.cxx:294
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
BCM_RawData
Definition: BCM_RawData.h:36
BCM_DigitizationTool::m_rdoContainer
BCM_RDO_Container * m_rdoContainer
Output RDO container.
Definition: BCM_DigitizationTool.h:97
BCM_DigitizationTool::m_onlyUseContainerName
BooleanProperty m_onlyUseContainerName
Definition: BCM_DigitizationTool.h:88
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
BCM_DigitizationTool::processBunchXing
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
Definition: BCM_DigitizationTool.cxx:224
SG::VarHandleBase::store
std::string store() const
Return the name of the store holding the object we are proxying.
Definition: StoreGate/src/VarHandleBase.cxx:376
BCM_RawData.h
SiHit::particleLink
const HepMcParticleLink & particleLink() const
Definition: SiHit.h:190
test_pyathena.parent
parent
Definition: test_pyathena.py:15
BCM_RDO_Collection.h
BCM_DigitizationTool::m_modNoise
std::vector< float > m_modNoise
RMS Gaussian noise.
Definition: BCM_DigitizationTool.h:80
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
BCM_DigitizationTool::createRDOsAndSDOs
void createRDOsAndSDOs(const EventContext &ctx)
Definition: BCM_DigitizationTool.cxx:132
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
MC::isSingleParticle
bool isSingleParticle(const T &p)
Identify a particlegun particle.
Definition: HepMCHelpers.h:74
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
PileUpToolBase
Definition: PileUpToolBase.h:18
BCM_DigitizationTool::m_enerVect
std::vector< float > m_enerVect[8]
G4 hit energies, weighted.
Definition: BCM_DigitizationTool.h:104
BCM_DigitizationTool.h
SiHit::energyLoss
double energyLoss() const
Definition: SiHit.h:175
SG::WriteHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
EventAuxInfo.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
errorcheck.h
Helpers for checking error return status codes and reporting errors.
BCM_DigitizationTool::BCM_DigitizationTool
BCM_DigitizationTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters.
Definition: BCM_DigitizationTool.cxx:26
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
BCM_DigitizationTool::m_effPrmDistance
Gaudi::Property< float > m_effPrmDistance
Definition: BCM_DigitizationTool.h:84
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
RNGWrapper.h
EventInfo.h
BCM_DigitizationTool::m_hitsContainerKey
SG::ReadHandleKey< SiHitCollection > m_hitsContainerKey
Definition: BCM_DigitizationTool.h:89
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
BCM_DigitizationTool::m_rndmGenSvc
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Random number service.
Definition: BCM_DigitizationTool.h:101
BCM_DigitizationTool::addNoise
void addNoise(int mod, std::vector< float > &analog, CLHEP::HepRandomEngine *randomEngine)
Add noise to analog waveform.
Definition: BCM_DigitizationTool.cxx:321
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
DeMoScan.index
string index
Definition: DeMoScan.py:364
BCM_DigitizationTool::m_inputObjectName
std::string m_inputObjectName
Definition: BCM_DigitizationTool.h:90
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
AtlasHitsVector::end
const_iterator end() const
Definition: AtlasHitsVector.h:134
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
BCM_DigitizationTool::computeEnergy
float computeEnergy(float simEner, const HepGeom::Point3D< double > &startPos, const HepGeom::Point3D< double > &endPos)
Compute energy deposit depending on hit position.
Definition: BCM_DigitizationTool.cxx:270
BCM_DigitizationTool::m_effPrmSharpness
Gaudi::Property< float > m_effPrmSharpness
Definition: BCM_DigitizationTool.h:85
AtlasHitsVector::size
size_type size() const
Definition: AtlasHitsVector.h:143
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
BCM_DigitizationTool::applyFilter
static void applyFilter(std::bitset< 64 > &digital)
Apply hole and spike filter to digital waveform.
Definition: BCM_DigitizationTool.cxx:342
hitTime
float hitTime(const AFP_SIDSimHit &hit)
Definition: AFP_SIDSimHit.h:39
BCM_DigitizationTool::m_outputKey
SG::WriteHandleKey< BCM_RDO_Container > m_outputKey
Definition: BCM_DigitizationTool.h:93
BCM_RDO_Collection
Definition: BCM_RDO_Collection.h:27
BCM_DigitizationTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
Definition: BCM_DigitizationTool.cxx:258
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
SiHit::localStartPosition
HepGeom::Point3D< double > localStartPosition() const
Definition: SiHit.cxx:146
HepMCHelpers.h
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
BCM_DigitizationTool::m_depositVect
std::vector< InDetSimData::Deposit > m_depositVect[8]
Deposit vectors for SDO map.
Definition: BCM_DigitizationTool.h:106
BCM_DigitizationTool::m_mipDeposit
Gaudi::Property< float > m_mipDeposit
Definition: BCM_DigitizationTool.h:83
BCM_DigitizationTool::m_outputSDOKey
SG::WriteHandleKey< InDetSimDataCollection > m_outputSDOKey
Definition: BCM_DigitizationTool.h:94
Identifier
Definition: IdentifierFieldParser.cxx:14