ATLAS Offline Software
CscDigitizationTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 #include "StoreGate/DataHandle.h"
13 #include "CLHEP/Random/RandFlat.h"
14 
15 using namespace MuonGM;
16 
17 CscDigitizationTool::CscDigitizationTool(const std::string& type,const std::string& name,const IInterface* pIID) :
18  PileUpToolBase(type, name, pIID) {
19 }
20 
22 
23  ATH_MSG_DEBUG ( "Initialized Properties :" );
24  ATH_MSG_DEBUG ( " InputObjectName " << m_inputObjectName );
25  ATH_MSG_DEBUG ( " WindowLowerOffset " << m_timeWindowLowerOffset );
26  ATH_MSG_DEBUG ( " WindowUpperOffset " << m_timeWindowUpperOffset );
27  ATH_MSG_DEBUG ( " PileUp On? " << m_isPileUp );
28  ATH_MSG_DEBUG ( " maskBadChannels? " << m_maskBadChannel );
29  ATH_MSG_DEBUG ( " amplification(gain) " << m_amplification );
30  ATH_MSG_DEBUG ( " Use NewDigitEDM? " << m_newDigitEDM );
31  ATH_MSG_DEBUG ( " Drift Velocity Set? " << m_driftVelocity );
32  ATH_MSG_DEBUG ( " NInteraction per layer from poisson not from energyLoss? " << m_NInterFixed );
33  ATH_MSG_DEBUG ( " IncludePileUpTruth " << m_includePileUpTruth );
34  ATH_MSG_DEBUG ( " VetoPileUpTruthLinks " << m_vetoPileUpTruthLinks );
35 
36  ATH_MSG_DEBUG ( " RndmSvc " << m_rndmSvc.typeAndName() );
37  ATH_MSG_DEBUG ( " cscCalibTool " << m_pcalib.typeAndName() );
38  ATH_MSG_DEBUG ( " CscSimDataCollection key " << m_cscSimDataCollectionWriteHandleKey.key());
39  ATH_MSG_DEBUG ( " CscDigitContainer key " << m_cscDigitContainerKey.key());
40 
41  // initialize transient detector store and MuonDetDescrManager
42  const MuonGM::MuonDetectorManager* muDetMgr=nullptr;
43  ATH_CHECK(detStore()->retrieve(muDetMgr));
44  ATH_MSG_DEBUG ( "MuonDetectorManager retrieved from StoreGate.");
45 
47  ATH_CHECK(m_mergeSvc.retrieve());
48  }
49 
50  //random number initialization
51  ATH_CHECK(m_rndmSvc.retrieve());
52 
54  ATH_CHECK(m_pcalib.retrieve());
55 
56  //initialize the CSC digitizer
57  m_cscDigitizer = std::make_unique<CSC_Digitizer>(CscHitIdHelper::GetHelper(), muDetMgr, &*(m_pcalib));
58  m_cscDigitizer->setAmplification(m_amplification);
59  m_cscDigitizer->setDebug ( msgLvl(MSG::DEBUG) );
60  m_cscDigitizer->setDriftVelocity(m_driftVelocity);
61  m_cscDigitizer->setElectronEnergy (m_electronEnergy);
62  if (m_NInterFixed) {
63  m_cscDigitizer->setNInterFixed();
64  }
66  ATH_CHECK(m_cscDigitizer->initialize());
67 
68  ATH_CHECK(m_idHelperSvc.retrieve());
69 
70  // check the input object name
71  if (m_hitsContainerKey.key().empty()) {
72  ATH_MSG_FATAL("Property InputObjectName not set !");
73  return StatusCode::FAILURE;
74  }
76  ATH_MSG_DEBUG("Input objects in container : '" << m_inputObjectName << "'");
77 
78  // Initialize ReadHandleKey
79  ATH_CHECK(m_hitsContainerKey.initialize(true));
80 
81  // +++ Initialize WriteHandleKey
84 
85  return StatusCode::SUCCESS;
86 
87 }
88 
89 // Inherited from PileUpTools
90 StatusCode CscDigitizationTool::prepareEvent(const EventContext& /*ctx*/, unsigned int /*nInputEvents*/) {
91 
92  if (nullptr == m_thpcCSC)
94 
95  m_cscHitCollList.clear();
96 
97  return StatusCode::SUCCESS;
98 }
100 
102 
103  ATH_MSG_DEBUG ( "in processAllSubEvents()" );
104 
105  //create and record CscDigitContainer in SG
107  ATH_CHECK(cscDigits.record(std::make_unique<CscDigitContainer>(m_idHelperSvc->cscIdHelper().module_hash_max())));
108  ATH_MSG_DEBUG("recorded CscDigitContainer with name "<<cscDigits.key());
109 
110  if (m_isPileUp) return StatusCode::SUCCESS;
111 
112  // create and record the SDO container in StoreGate
114  ATH_CHECK(cscSimData.record(std::make_unique<CscSimDataCollection>()));
115 
116  //merging of the hit collection in getNextEvent method
117  if (nullptr == m_thpcCSC ) {
118  StatusCode sc = getNextEvent(ctx);
119  if (StatusCode::FAILURE == sc) {
120  ATH_MSG_INFO ( "There are no CSC hits in this event" );
121  return sc; // there are no hits in this event
122  }
123  }
124 
125  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
126  rngWrapper->setSeed( name(), ctx );
127 
128  Collections_t collections;
129  ATH_CHECK( CoreDigitization(collections,cscSimData.ptr(), rngWrapper->getEngine(ctx), ctx) );
130  for (size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
131  if (collections[coll_hash]) {
132  ATH_CHECK( cscDigits->addCollection (collections[coll_hash].release(), coll_hash) );
133  }
134  }
135 
136  return StatusCode::SUCCESS;
137 }
138 
139 StatusCode CscDigitizationTool::CoreDigitization(Collections_t& collections,CscSimDataCollection* cscSimData, CLHEP::HepRandomEngine* rndmEngine, const EventContext& ctx) {
140 
141  std::map <IdentifierHash,deposits> myDeposits;
142  csc_map data_map;
143  csc_newmap data_SampleMap, data_SampleMapOddPhase;
144 
146 
147  // Perform null check on m_thpcCSC
148  if(!m_thpcCSC) {
149  ATH_MSG_ERROR ( "m_thpcCSC is null" );
150  return StatusCode::FAILURE;
151  }
152 
153  // get the iterator pairs for this DetEl
154  while( m_thpcCSC->nextDetectorElement(i, e) ) {
155 
156  // Loop over the hits:
157  while (i != e) {
158 
159  TimedHitPtr<CSCSimHit> phit(*i++);
160  const CSCSimHit& hit(*phit);
161 
162 
163  ATH_MSG_DEBUG(hit.print());
164 
165 
166 
167  double globalHitTime(hitTime(phit));
168  double bunchTime(globalHitTime - hit.globalTime());
169 
170  // Hit time is the G4 hit time plus the drift time.
171  // Gloabl time add the bnch crossing time to the hit time.
172  ATH_MSG_DEBUG ( "bunch time (ns) " << bunchTime << "globalHitTime (ns) " << globalHitTime << " hit Time (ns) " << hitTime(phit) );
173  m_cscDigitizer->set(bunchTime);
174 
175  std::vector<IdentifierHash> hashVec;
177  ? m_cscDigitizer->digitize_hit(&hit, hashVec, data_SampleMap, data_SampleMapOddPhase, rndmEngine)
178  : m_cscDigitizer->digitize_hit(&hit, hashVec, data_map, rndmEngine);
179 
180  if (status.isFailure()) {
181  ATH_MSG_ERROR ( "CSC Digitizer Failed to digitize a hit!" );
182  return status;
183  }
184 
185  std::vector<IdentifierHash>::const_iterator vecBeg = hashVec.begin();
186  std::vector<IdentifierHash>::const_iterator vecEnd = hashVec.end();
187  // Fetch the energy deposit.
188  const double energy = hit.energyDeposit();
189  // Determine where hit crosses the wire plane (x=0).
190  float ypos = -99999.9;
191  float zpos = ypos;
192  double xi = hit.getHitStart().x();
193  double yi = hit.getHitStart().y();
194  double zi = hit.getHitStart().z();
195  double xf = hit.getHitEnd().x();
196  double yf = hit.getHitEnd().y();
197  double zf = hit.getHitEnd().z();
198  double dx = xf - xi;
199  double dy = yf - yi;
200  double dz = zf - zi;
201  if ( dx>0.0 && xi<=0.0 && xf>=0.0 ) {
202  double f = -xi/dx;
203  ypos = yi + f*dy;
204  zpos = zi + f*dz;
205  }
206 
207  if (!m_includePileUpTruth && HepMC::ignoreTruthLink(phit->particleLink(), m_vetoPileUpTruthLinks)) {
208  hashVec.clear();
209  continue;
210  }
211  const HepMcParticleLink trackLink = HepMcParticleLink::getRedirectedLink(phit->particleLink(), phit.eventId(), ctx); // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc.
212  const auto cscd = CscMcData(energy, ypos, zpos);
213  for (; vecBeg != vecEnd; ++vecBeg) {
214  myDeposits[(*vecBeg)].emplace_back(trackLink,cscd);
215  }
216  hashVec.clear();
217  }
218  }
219 
220  // reset the pointer.
221  delete m_thpcCSC;
222  m_thpcCSC=nullptr;
223 
224  // now loop over the digit map
225  // build the digits
226  // build the digit collections and record them
227 
228  if (m_newDigitEDM) {
229  double flat = CLHEP::RandFlat::shoot(rndmEngine, 0.0,1.0); // for other particles
230  bool phaseToSet = flat<0.5;
231  if (phaseToSet)
232  return FillCollectionWithNewDigitEDM(data_SampleMapOddPhase, myDeposits, phaseToSet, collections, cscSimData);
233  else
234  return FillCollectionWithNewDigitEDM(data_SampleMap, myDeposits, phaseToSet, collections, cscSimData);
235  } else
236  return FillCollectionWithOldDigitEDM(data_map, myDeposits, collections, cscSimData);
237 
238 }
239 
240 
243  std::map<IdentifierHash,deposits>& myDeposits,
244  bool phaseToSet, Collections_t& collections,CscSimDataCollection* cscSimData
245  ) {
246 
247  CscDigitCollection * collection = nullptr;
248 
249  IdContext context = m_idHelperSvc->cscIdHelper().channel_context();
250  IdContext cscContext = m_idHelperSvc->cscIdHelper().module_context();
251 
252  Identifier prevId;
253 
254  csc_newmap::const_iterator cscMap = data_SampleMap.begin();
255  csc_newmap::const_iterator cscMapEnd = data_SampleMap.end();
256 
257  for (; cscMap != cscMapEnd; ++cscMap) {
258  Identifier digitId;
259  IdentifierHash hashId = (*cscMap).first;
260  if (m_idHelperSvc->cscIdHelper().get_id( hashId, digitId, &context ) ) {
261  ATH_MSG_ERROR ( "cannot get CSC channel identifier from hash " << hashId );
262  return StatusCode::FAILURE;
263  }
264 
265  Identifier elementId = m_idHelperSvc->cscIdHelper().parentID(digitId);
266  IdentifierHash coll_hash;
267  if (m_idHelperSvc->cscIdHelper().get_hash(elementId, coll_hash, &cscContext)) {
268  ATH_MSG_ERROR ( "Unable to get CSC hash id from CSC Digit collection "
269  << "context begin_index = " << cscContext.begin_index()
270  << " context end_index = " << cscContext.end_index()
271  << " the identifier is " );
272  elementId.show();
273  }
274 
275 
276  // get the charge
277  double stripCharge = 0.0;
278  double driftTime = 0.0;
279  const std::vector<float> samples = (*cscMap).second;
280 
281  unsigned int samplingPhase =0;
282  double samplingTime = m_pcalib->getSamplingTime();
283  m_pcalib->findCharge(samplingTime, samplingPhase, samples, stripCharge, driftTime);
284  driftTime += m_pcalib->getLatency();
285 
287  if ( !m_pcalib->isGood( hashId ) && m_maskBadChannel ) {
288  stripCharge = 0.0;
290  }
291 
292  int zsec = m_idHelperSvc->cscIdHelper().stationEta(digitId);
293  int phisec = m_idHelperSvc->cscIdHelper().stationPhi(digitId);
294  int istation = m_idHelperSvc->cscIdHelper().stationName(digitId) - 49;
295 
296  int wlay = m_idHelperSvc->cscIdHelper().wireLayer(digitId);
297  int measphi = m_idHelperSvc->cscIdHelper().measuresPhi(digitId);
298  int istrip = m_idHelperSvc->cscIdHelper().strip(digitId);
299 
300  int sector = zsec*(2*phisec-istation+1);
301 
302  auto depositsForHash = myDeposits.find(hashId);
303  if (depositsForHash != myDeposits.end() && !depositsForHash->second.empty()) {
304  depositsForHash->second[0].second.setCharge(stripCharge);
305  cscSimData->insert ( std::make_pair(digitId, CscSimData(depositsForHash->second,0)) );
306  }
307 
308  // fill the digit collections in StoreGate
309  // Now, we pass driftTime as well as stripCharge.
310  // SimHIT time should be added to distinguish prompt muons from secondary.... 11/19/2009 WP
311  ATH_MSG_DEBUG ( "NEWDigit sec:measphi:wlay:istr:chg:t(w/latency) "
312  << m_idHelperSvc->cscIdHelper().show_to_string(digitId,&context)
313  << " hash:eleId = " << hashId << " " << elementId << " " << prevId << " "
314  << sector << " " << measphi << " " << wlay << " " << istrip << " "
315  << int(stripCharge+1) << " " << float(driftTime)
316  << " phase=" << phaseToSet
317  << " samps: " << samples[0] << " " << samples[1] << " "
318  << samples[2] << " " << samples[3]
319  );
320 
321  if (prevId != elementId) {
322  if (coll_hash >= collections.size()) {
323  collections.resize (coll_hash+1);
324  }
325  collection = collections[coll_hash].get();
326  if (nullptr == collection) {
327  collections[coll_hash] = std::make_unique<CscDigitCollection>(elementId,coll_hash);
328  collection = collections[coll_hash].get();
329  }
330  if (phaseToSet) collection->set_samplingPhase();
331  collection->push_back (std::make_unique<CscDigit>(digitId, samples));
332 
333  prevId = elementId;
334  } else {
335  // According to coverity, collection could still be null here.
336  if (!collection) {
337  ATH_MSG_ERROR("Trying to use NULL CscDigitCollection");
338  return StatusCode::FAILURE;
339  }
340 
341  if (phaseToSet) collection->set_samplingPhase();
342  collection->push_back (std::make_unique<CscDigit>(digitId, samples));
343  }
344  }
345  return StatusCode::SUCCESS;
346 }
347 
348 
350 FillCollectionWithOldDigitEDM(csc_map& data_map, std::map<IdentifierHash,deposits>& myDeposits,Collections_t& collections,CscSimDataCollection* cscSimData) {
351 
352  CscDigitCollection * collection = nullptr;
353  IdContext context = m_idHelperSvc->cscIdHelper().channel_context();
354  IdContext cscContext = m_idHelperSvc->cscIdHelper().module_context();
355 
356  Identifier prevId;
357  csc_map::const_iterator cscMap = data_map.begin();
358  csc_map::const_iterator cscMapEnd = data_map.end();
359  for (; cscMap != cscMapEnd; ++cscMap) {
360  Identifier digitId;
361  IdentifierHash hashId = (*cscMap).first;
362  if (m_idHelperSvc->cscIdHelper().get_id( hashId, digitId, &context ) ) {
363  ATH_MSG_ERROR ( "cannot get CSC channel identifier from hash " << hashId );
364  return StatusCode::FAILURE;
365  }
366 
367  // get the charge
368  double stripCharge = 0.0;
369  stripCharge = ((*cscMap).second).second + m_pedestal; // + m_noiseLevel*gaus;
370  double driftTime =((*cscMap).second).first; // SimHIT time is added yet 12/03/2009
371 
373  if ( !m_pcalib->isGood( hashId ) && m_maskBadChannel ) {
374  stripCharge = 0.0;
376  }
377 
378  ATH_MSG_VERBOSE ( "CSC Digit Id = " << m_idHelperSvc->cscIdHelper().show_to_string(digitId,&context)
379  << " hash = " << hashId
380  << " charge = " << int (stripCharge+1) );
381 
382  int zsec = m_idHelperSvc->cscIdHelper().stationEta(digitId);
383  int phisec = m_idHelperSvc->cscIdHelper().stationPhi(digitId);
384  int istation = m_idHelperSvc->cscIdHelper().stationName(digitId) - 49;
385 
386  int wlay = m_idHelperSvc->cscIdHelper().wireLayer(digitId);
387  int measphi = m_idHelperSvc->cscIdHelper().measuresPhi(digitId);
388  int istrip = m_idHelperSvc->cscIdHelper().strip(digitId);
389 
390  int sector = zsec*(2*phisec-istation+1);
391 
392  auto depositsForHash = myDeposits.find(hashId);
393  if (depositsForHash != myDeposits.end() && !depositsForHash->second.empty()) {
394  depositsForHash->second[0].second.setCharge(stripCharge);
395  cscSimData->insert ( std::make_pair(digitId, CscSimData(depositsForHash->second,0)) );
396  }
397 
398  // fill the digit collections in StoreGate
399  // Now, we pass driftTime as well as stripCharge.
400  // SimHIT time should be added to distinguish prompt muons from secondary.... 11/19/2009 WP
401  auto newDigit = std::make_unique<CscDigit>(digitId, int(stripCharge+1), float(driftTime) );
402  Identifier elementId = m_idHelperSvc->cscIdHelper().parentID(digitId);
403 
404  ATH_MSG_DEBUG ( "CSC Digit sector:measphi:wlay:istrip:charge "
405  << sector << " "
406  << measphi << " " << wlay << " " << istrip
407  << " " << int(stripCharge+1) << " " << float(driftTime) << " " << (newDigit->sampleCharges()).size());
408 
409 
410  IdentifierHash coll_hash;
411  if (m_idHelperSvc->cscIdHelper().get_hash(elementId, coll_hash, &cscContext)) {
412  ATH_MSG_ERROR ( "Unable to get CSC hash id from CSC Digit collection "
413  << "context begin_index = " << cscContext.begin_index()
414  << " context end_index = " << cscContext.end_index()
415  << " the identifier is " );
416  elementId.show();
417  }
418 
419  if (prevId != elementId) {
420  if (coll_hash >= collections.size()) {
421  collections.resize (coll_hash+1);
422  }
423  collection = collections[coll_hash].get();
424  if (nullptr == collection) {
425  collections[coll_hash] = std::make_unique<CscDigitCollection>(elementId,coll_hash);
426  collection = collections[coll_hash].get();
427  }
428  collection->push_back(std::move(newDigit));
429  prevId = elementId;
430  } else {
431  // According to coverity, collection could still be null here.
432  if (collection) {
433  collection->push_back(std::move(newDigit));
434  } else {
435  ATH_MSG_ERROR("Trying to push back NULL CscDigitCollection");
436  return StatusCode::FAILURE;
437  }
438  }
439  }
440  return StatusCode::SUCCESS;
441 }
442 
443 
444 // Get next event and extract collection of hit collections:
445 StatusCode CscDigitizationTool::getNextEvent(const EventContext& ctx) // This is applicable to non-PileUp Event...
446 {
447 
448  // get the container(s)
450 
451  // In case of single hits container just load the collection using read handles
452  if (!m_onlyUseContainerName) {
454  if (!hitCollection.isValid()) {
455  ATH_MSG_ERROR("Could not get CSCSimHitCollection container " << hitCollection.name() << " from store " << hitCollection.store());
456  return StatusCode::FAILURE;
457  }
458 
459  // create a new hits collection
461  m_thpcCSC->insert(0, hitCollection.cptr());
462  ATH_MSG_DEBUG("CSCSimHitCollection found with " << hitCollection->size() << " hits");
463 
464  return StatusCode::SUCCESS;
465  }
466 
467  //this is a list<pair<time_t, DataLink<CSCSimHitCollection> > >
468  TimedHitCollList hitCollList;
469 
470  if (!(m_mergeSvc->retrieveSubEvtsData(m_inputObjectName, hitCollList).isSuccess()) ) {
471  ATH_MSG_ERROR ( "Could not fill TimedHitCollList" );
472  return StatusCode::FAILURE;
473  }
474  if (hitCollList.empty()) {
475  ATH_MSG_ERROR ( "TimedHitCollList has size 0" );
476  return StatusCode::FAILURE;
477  } else {
478  ATH_MSG_DEBUG ( hitCollList.size()
479  << " CSCSimHitCollections with key " << m_inputObjectName
480  << " found" );
481  }
482 
483  // create a new hits collection
485 
486  //now merge all collections into one
487  TimedHitCollList::iterator iColl(hitCollList.begin());
488  TimedHitCollList::iterator endColl(hitCollList.end());
489  while (iColl != endColl) {
490  const CSCSimHitCollection* p_collection(iColl->second);
491  m_thpcCSC->insert(iColl->first, p_collection);
492  ATH_MSG_DEBUG ( "CSCSimHitCollection found with "
493  << p_collection->size() << " hits" ); // loop on the hit collections
494  ++iColl;
495  }
496  return StatusCode::SUCCESS;
497 }
498 
499 
500 
503  SubEventIterator bSubEvents,
504  SubEventIterator eSubEvents)
505 {
506  ATH_MSG_DEBUG("CscDigitizationTool::processBunchXing() " << bunchXing);
507 
509  TimedHitCollList hitCollList;
510 
511  if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputObjectName, hitCollList, bunchXing,
512  bSubEvents, eSubEvents).isSuccess()) &&
513  hitCollList.empty()) {
514  ATH_MSG_ERROR("Could not fill TimedHitCollList");
515  return StatusCode::FAILURE;
516  } else {
517  ATH_MSG_VERBOSE(hitCollList.size() << " CSCSimHitCollection with key " <<
518  m_inputObjectName << " found");
519  }
520 
521  TimedHitCollList::iterator iColl(hitCollList.begin());
522  TimedHitCollList::iterator endColl(hitCollList.end());
523 
524  // Iterating over the list of collections
525  for( ; iColl != endColl; ++iColl){
526 
527  CSCSimHitCollection *hitCollPtr = new CSCSimHitCollection(*iColl->second);
528  PileUpTimeEventIndex timeIndex(iColl->first);
529 
530  ATH_MSG_DEBUG("CSCSimHitCollection found with " << hitCollPtr->size() <<
531  " hits");
532  ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
533  << " index: " << timeIndex.index()
534  << " type: " << timeIndex.type());
535 
536  m_thpcCSC->insert(timeIndex, hitCollPtr);
537  m_cscHitCollList.push_back(hitCollPtr);
538 
539  }
540 
541  return StatusCode::SUCCESS;
542 }
543 
545 StatusCode CscDigitizationTool::mergeEvent(const EventContext& ctx) {
546 
547  ATH_MSG_DEBUG ( "in mergeEvent()" );
548 
549  //create and record CscDigitContainer in SG
551  ATH_CHECK(cscDigits.record(std::make_unique<CscDigitContainer>(m_idHelperSvc->cscIdHelper().module_hash_max())));
552  ATH_MSG_DEBUG("recorded CscDigitContainer with name "<<cscDigits.key());
553 
554  // create and record the SDO container in StoreGate
556  ATH_CHECK(cscSimData.record(std::make_unique<CscSimDataCollection>()));
557 
558  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this);
559  rngWrapper->setSeed( name(), ctx );
560 
561  Collections_t collections;
562  ATH_CHECK(CoreDigitization(collections,cscSimData.ptr(), rngWrapper->getEngine(ctx), ctx));
563  for (size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
564  if (collections[coll_hash]) {
565  ATH_CHECK( cscDigits->addCollection (collections[coll_hash].release(), coll_hash) );
566  }
567  }
568 
569  // remove cloned one in processBunchXing......
572  while(cscHitColl!=cscHitCollEnd)
573  {
574  delete (*cscHitColl);
575  ++cscHitColl;
576  }
577  m_cscHitCollList.clear();
578 
579  return StatusCode::SUCCESS;
580 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
CscDigitizationTool::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: CscDigitizationTool.h:121
CSCSimHit::getHitEnd
const Amg::Vector3D & getHitEnd() const
Definition: CSCSimHit.h:52
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
CscDigitizationTool::m_electronEnergy
Gaudi::Property< double > m_electronEnergy
Definition: CscDigitizationTool.h:116
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
CscDigitizationTool::csc_newmap
std::map< IdentifierHash, std::vector< float > > csc_newmap
Definition: CscDigitizationTool.h:43
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
CscDigitizationTool::processBunchXing
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current subEvents. bunchXing is in ns
Definition: CscDigitizationTool.cxx:502
CscDigitizationTool::m_amplification
Gaudi::Property< double > m_amplification
Definition: CscDigitizationTool.h:103
CscDigitizationTool::m_newDigitEDM
Gaudi::Property< bool > m_newDigitEDM
Definition: CscDigitizationTool.h:114
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
IdentifiableContainerMT::addCollection
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
Definition: IdentifiableContainerMT.h:300
CscDigitizationTool::m_isPileUp
Gaudi::Property< bool > m_isPileUp
Definition: CscDigitizationTool.h:113
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
CscDigitizationTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Definition: CscDigitizationTool.h:119
CSCSimHit::globalTime
double globalTime() const
Definition: CSCSimHit.h:49
python.HLT.MinBias.MinBiasMenuSequences.zf
zf
Definition: MinBiasMenuSequences.py:187
AtlasHitsVector
Definition: AtlasHitsVector.h:33
CscDigitizationTool::CoreDigitization
StatusCode CoreDigitization(Collections_t &collections, CscSimDataCollection *cscSimData, CLHEP::HepRandomEngine *rndmEngine, const EventContext &ctx)
Definition: CscDigitizationTool.cxx:139
CscDigitizationTool::csc_map
std::map< IdentifierHash, std::pair< double, double > > csc_map
Definition: CscDigitizationTool.h:42
DataVector::get
const T * get(size_type n) const
Access an element, as an rvalue.
IdContext::end_index
size_type end_index(void) const
Definition: IdContext.h:106
CscDigitizationTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop. Not (necessarily) able to access subEvents
Definition: CscDigitizationTool.cxx:545
PileUpTimeEventIndex::index
index_type index() const
the index of the component event in PileUpEventInfo
Definition: PileUpTimeEventIndex.cxx:76
CscDigitizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscDigitizationTool.h:99
TimedHitPtr< CSCSimHit >
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CscMcData
Definition: CscSimData.h:23
HepMC::ignoreTruthLink
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
Definition: MagicNumbers.h:296
CscDigitizationTool.h
CSCSimHit::energyDeposit
double energyDeposit() const
Definition: CSCSimHit.h:50
TimedHitCollection::nextDetectorElement
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
DataHandle.h
CscDigitCollection::set_samplingPhase
void set_samplingPhase()
Definition: CscDigitCollection.h:34
CscDigitizationTool::initialize
virtual StatusCode initialize() override final
Definition: CscDigitizationTool.cxx:21
GenParticle.h
CscDigitizationTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
Definition: CscDigitizationTool.cxx:90
PileUpToolBase::m_vetoPileUpTruthLinks
Gaudi::Property< int > m_vetoPileUpTruthLinks
Definition: PileUpToolBase.h:58
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
CSCSimHitCollection
AtlasHitsVector< CSCSimHit > CSCSimHitCollection
Definition: CSCSimHitCollection.h:14
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
CscDigitizationTool::m_cscDigitContainerKey
SG::WriteHandleKey< CscDigitContainer > m_cscDigitContainerKey
Definition: CscDigitizationTool.h:95
CscHitIdHelper::GetHelper
static const CscHitIdHelper * GetHelper()
Definition: CscHitIdHelper.cxx:23
CscDigitizationTool::m_cscDigitizer
std::unique_ptr< CSC_Digitizer > m_cscDigitizer
Definition: CscDigitizationTool.h:97
CSCSimHit
Definition: CSCSimHit.h:18
CscSimData
Definition: CscSimData.h:44
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
CscDigitizationTool::m_maskBadChannel
Gaudi::Property< bool > m_maskBadChannel
Definition: CscDigitizationTool.h:102
CscDigitizationTool::FillCollectionWithNewDigitEDM
StatusCode FillCollectionWithNewDigitEDM(csc_newmap &data_SampleMap, std::map< IdentifierHash, deposits > &myDeposits, bool phaseToSet, Collections_t &collections, CscSimDataCollection *cscSimData)
Definition: CscDigitizationTool.cxx:242
TimedHitCollection::insert
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
CscDigitizationTool::m_thpcCSC
TimedHitCollection< CSCSimHit > * m_thpcCSC
Definition: CscDigitizationTool.h:106
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:92
CscDigitizationTool::m_inputObjectName
std::string m_inputObjectName
Definition: CscDigitizationTool.h:93
CscDigitizationTool::m_cscHitCollList
std::list< CSCSimHitCollection * > m_cscHitCollList
Definition: CscDigitizationTool.h:107
CscDigitizationTool::getNextEvent
StatusCode getNextEvent(const EventContext &ctx)
Definition: CscDigitizationTool.cxx:445
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
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
SG::VarHandleBase::store
std::string store() const
Return the name of the store holding the object we are proxying.
Definition: StoreGate/src/VarHandleBase.cxx:379
CscDigitizationTool::CscDigitizationTool
CscDigitizationTool(const std::string &type, const std::string &name, const IInterface *pIID)
Definition: CscDigitizationTool.cxx:17
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CscSimDataCollection
Definition: CscSimDataCollection.h:29
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
CscDigitizationTool::m_includePileUpTruth
Gaudi::Property< bool > m_includePileUpTruth
Definition: CscDigitizationTool.h:109
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
PileUpToolBase
Definition: PileUpToolBase.h:18
CscDigitizationTool::m_NInterFixed
Gaudi::Property< bool > m_NInterFixed
Definition: CscDigitizationTool.h:117
CscDigitCollection
Definition: CscDigitCollection.h:17
IdContext::begin_index
size_type begin_index(void) const
Definition: IdContext.h:100
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
CscDigitizationTool::m_hitsContainerKey
SG::ReadHandleKey< CSCSimHitCollection > m_hitsContainerKey
Definition: CscDigitizationTool.h:92
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
PileUpTimeEventIndex::time
time_type time() const
bunch xing time in ns
Definition: PileUpTimeEventIndex.cxx:71
CscDigitizationTool::m_pedestal
Gaudi::Property< double > m_pedestal
Definition: CscDigitizationTool.h:101
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
MuonDetectorManager.h
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
CSCSimHit::getHitStart
const Amg::Vector3D & getHitStart() const
Definition: CSCSimHit.h:51
CscDigitizationTool::m_driftVelocity
Gaudi::Property< double > m_driftVelocity
Definition: CscDigitizationTool.h:115
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
CSCSimHit::print
std::string print() const
Definition: CSCSimHit.cxx:101
TimedHitPtr::eventId
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
Definition: TimedHitPtr.h:42
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CscDigitizationTool::Collections_t
std::vector< std::unique_ptr< CscDigitCollection > > Collections_t
Definition: CscDigitizationTool.h:75
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
CscDigitizationTool::FillCollectionWithOldDigitEDM
StatusCode FillCollectionWithOldDigitEDM(csc_map &data_map, std::map< IdentifierHash, deposits > &myDeposits, Collections_t &collections, CscSimDataCollection *cscSimData)
Definition: CscDigitizationTool.cxx:350
CscDigitizationTool::m_pcalib
ToolHandle< ICscCalibTool > m_pcalib
Definition: CscDigitizationTool.h:89
AtlasHitsVector::size
size_type size() const
Definition: AtlasHitsVector.h:143
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
merge.status
status
Definition: merge.py:17
CscDigitizationTool::m_cscSimDataCollectionWriteHandleKey
SG::WriteHandleKey< CscSimDataCollection > m_cscSimDataCollectionWriteHandleKey
Definition: CscDigitizationTool.h:94
hitTime
float hitTime(const AFP_SIDSimHit &hit)
Definition: AFP_SIDSimHit.h:39
CscDigitizationTool::m_timeWindowUpperOffset
Gaudi::Property< double > m_timeWindowUpperOffset
Definition: CscDigitizationTool.h:112
PileUpTimeEventIndex
a struct encapsulating the identifier of a pile-up event
Definition: PileUpTimeEventIndex.h:12
PileUpTimeEventIndex::type
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
Definition: PileUpTimeEventIndex.cxx:81
IdContext
class IdContext
Definition: IdContext.h:34
StoreGateSvc.h
CscDigitizationTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Definition: CscDigitizationTool.cxx:101
TimedHitCollection< CSCSimHit >
CscDigitizationTool::m_timeWindowLowerOffset
Gaudi::Property< double > m_timeWindowLowerOffset
Definition: CscDigitizationTool.h:111
CscDigitizationTool::m_onlyUseContainerName
BooleanProperty m_onlyUseContainerName
Definition: CscDigitizationTool.h:91