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