ATLAS Offline Software
Loading...
Searching...
No Matches
sTgcDigitizationTool Class Reference

#include <sTgcDigitizationTool.h>

Inheritance diagram for sTgcDigitizationTool:

Classes

class  sTgcSimDigitData

Public Types

using sTgcSimDigitVec = std::vector<sTgcSimDigitData>
using sTgcSimDigitCont = std::vector<sTgcSimDigitVec>
using DigiConditions = sTgcDigitMaker::DigiConditions
using sTgcDigitVec = sTgcDigitMaker::sTgcDigitVec
using sTgcDigtCont = std::vector<sTgcDigitVec>

Public Member Functions

 sTgcDigitizationTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize ()
 Initialize.
StatusCode prepareEvent (const EventContext &ctx, const unsigned int)
 When being run from PileUpToolsAlgs, this method is called at the start of the subevts loop.
StatusCode processBunchXing (int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents)
 When being run from PileUpToolsAlgs, this method is called for each active bunch-crossing to process current SubEvents bunchXing is in ns.
StatusCode mergeEvent (const EventContext &ctx)
 When being run from PileUpToolsAlgs, this method is called at the end of the subevts loop.
virtual StatusCode processAllSubEvents (const EventContext &ctx)
 alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
StatusCode digitize (const EventContext &ctx)
 Just calls processAllSubEvents - leaving for back-compatibility (IMuonDigitizationTool)

Private Member Functions

CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, const EventContext &ctx) const
template<class CondType>
StatusCode retrieveCondData (const EventContext &ctx, SG::ReadCondHandleKey< CondType > &key, const CondType *&condPtr) const
StatusCode getNextEvent (const EventContext &ctx)
 Get next event and extract collection of hit collections.
StatusCode doDigitization (const EventContext &ctx)
 Core part of digitization use by mergeEvent (IPileUpTool) and digitize (IMuonDigitizationTool)
double getChannelThreshold (const EventContext &ctx, const Identifier &channelID, const NswCalibDbThresholdData &thresholdData) const
StatusCode processDigitsWithVMM (const EventContext &ctx, const DigiConditions &digiCond, sTgcSimDigitCont &unmergedContainer, const double vmmDeadTime, const bool isNeighbourOn, sTgcDigtCont &outDigitContainer, MuonSimDataCollection &outSdoContainer) const
sTgcSimDigitVec processDigitsWithVMM (const EventContext &ctx, const DigiConditions &digiCond, const double vmmDeadTime, sTgcSimDigitVec &unmergedDigits, const bool isNeighborOn) const

Static Private Member Functions

static uint16_t bcTagging (const double digittime)

Private Attributes

ServiceHandle< PileUpMergeSvcm_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", "Merge service used in digitization"}
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc", "Random Number Service used in Muon digitization"}
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_detMgrKey
SG::ReadCondHandleKey< Muon::DigitEffiDatam_effiKey
std::unique_ptr< sTgcDigitMakerm_digitizer {}
std::unique_ptr< TimedHitCollection< sTGCSimHit > > m_thpcsTGC {}
std::vector< std::unique_ptr< sTGCSimHitCollection > > m_STGCHitCollList {}
ToolHandle< Muon::INSWCalibSmearingToolm_smearingTool {this,"SmearingTool","Muon::NSWCalibSmearingTool/STgcCalibSmearingTool"}
ToolHandle< Muon::INSWCalibToolm_calibTool {this,"CalibrationTool","Muon::NSWCalibTool/NSWCalibTool"}
SG::WriteHandleKey< sTgcDigitContainerm_outputDigitCollectionKey {this,"OutputObjectName","sTGC_DIGITS","WriteHandleKey for Output sTgcDigitContainer"}
SG::WriteHandleKey< MuonSimDataCollectionm_outputSDO_CollectionKey {this,"OutputSDOName","sTGC_SDO","WriteHandleKey for Output MuonSimDataCollection"}
Gaudi::Property< bool > m_doSmearing {this,"doSmearing",false}
Gaudi::Property< bool > m_doToFCorrection {this,"doToFCorrection",false}
Gaudi::Property< bool > m_doEfficiencyCorrection {this,"doEfficiencyCorrection",false}
Gaudi::Property< double > m_runVoltage {this,"operatingHVinkV",2.8}
Gaudi::Property< std::string > m_rndmEngineName {this,"RndmEngine","MuonDigitization","Random engine name"}
Gaudi::Property< bool > m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."}
SG::ReadHandleKey< sTGCSimHitCollectionm_hitsContainerKey {this, "InputObjectName", "sTGC_Hits", "name of the input object"}
std::string m_inputObjectName {""}
Gaudi::Property< bool > m_useCondThresholds {this, "useCondThresholds", false, "Use conditions data to get VMM charge threshold values"}
SG::ReadCondHandleKey< NswCalibDbThresholdDatam_condThrshldsKey {this, "CondThrshldsKey", "NswCalibDbThresholdData", "Key of NswCalibDbThresholdData object containing calibration data (VMM thresholds)"}
Gaudi::Property< int > m_doChannelTypes {this,"doChannelTypes",3}
Gaudi::Property< bool > m_doPadSharing {this,"padChargeSharing", false}
Gaudi::Property< double > m_deadtimeStrip {this,"deadtimeStrip", 250}
Gaudi::Property< double > m_deadtimePad {this,"deadtimePad" , 250}
Gaudi::Property< double > m_deadtimeWire {this,"deadtimeWire" , 250}
Gaudi::Property< bool > m_doNeighborOn {this,"neighborOn", true}
Gaudi::Property< double > m_energyDepositThreshold {this,"energyDepositThreshold",300.0*CLHEP::eV,"Minimum energy deposit for hit to be digitized"}
Gaudi::Property< double > m_limitElectronKineticEnergy {this,"limitElectronKineticEnergy",5.0*CLHEP::MeV,"Minimum kinetic energy for electron hit to be digitized"}
Gaudi::Property< double > m_chargeThreshold {this,"chargeThreshold", 0.030, "vmm charge threshold in pC, need to set useCondThresholds to false if one wants to use this threshold value otherwise the one from the conditions database is used"}
Gaudi::Property< bool > m_applyAsBuiltBLines {this, "applyAsBuiltBLines",false, "correct the hit position by the as built and B-lines parameters"}
const double m_timeJitterElectronicsStrip {2.f}
const double m_timeJitterElectronicsPad {2.f}
const double m_hitTimeMergeThreshold {30.f}

structors and AlgTool implementation

virtual bool toProcess (int bunchXing) const override
 the method this base class helps implementing
virtual bool filterPassed () const override
 dummy implementation of passing filter
virtual void resetFilter () override
 dummy implementation of filter reset
Gaudi::Property< int > m_firstXing
Gaudi::Property< int > m_lastXing
Gaudi::Property< int > m_vetoPileUpTruthLinks
bool m_filterPassed {true}

Detailed Description

Class methods and properties

In the initialize() method... In the execute() method...

Definition at line 45 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

Member Typedef Documentation

◆ DigiConditions

◆ sTgcDigitVec

◆ sTgcDigtCont

◆ sTgcSimDigitCont

◆ sTgcSimDigitVec

Constructor & Destructor Documentation

◆ sTgcDigitizationTool()

sTgcDigitizationTool::sTgcDigitizationTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 42 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

42 :
43 PileUpToolBase(type, name, parent) {}
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)

Member Function Documentation

◆ bcTagging()

uint16_t sTgcDigitizationTool::bcTagging ( const double digittime)
staticprivate

Definition at line 535 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

535 {
536
537 uint16_t bctag = 0;
538
539 int bunchInteger{0}; //Define the absolute distance from t0 in units of BX
540 if(digitTime > 0) bunchInteger = (int)(abs(digitTime/25.0)); //absolute bunch for future bunches
541 else bunchInteger = (int)(abs(digitTime/25.0)) + 1; //The absolute bunch for negative time needs to be shifted by 1 as there is no negative zero bunch
542 bctag = (bctag | bunchInteger); //Store bitwise the abs(BX). This should be equivalent to regular variable assignment
543 if(digitTime < 0) bctag = ~bctag; //If from a PREVIOUS BX, apply bitwise negation
544
545 return bctag;
546}
setWord1 uint16_t

◆ digitize()

StatusCode sTgcDigitizationTool::digitize ( const EventContext & ctx)

Just calls processAllSubEvents - leaving for back-compatibility (IMuonDigitizationTool)

reads GEANT4 hits from StoreGate in each of detector components corresponding to sTGC modules which are triplets or doublets. A triplet has tree sensitive volumes and a double has two. This method calls sTgcDigitMaker::executeDigi, which digitizes every hit, for every readout element, i.e., a sensitive volume of a chamber. (IMuonDigitizationTool)

Definition at line 232 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

232 {
233 return this->processAllSubEvents(ctx);
234}
virtual StatusCode processAllSubEvents(const EventContext &ctx)
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.

◆ doDigitization()

StatusCode sTgcDigitizationTool::doDigitization ( const EventContext & ctx)
private

Core part of digitization use by mergeEvent (IPileUpTool) and digitize (IMuonDigitizationTool)

apply the smearing tool to decide if the hit has to be digitized or not based on layer efficiency

Resize the container accordingly

Definition at line 267 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

267 {
268
269 ATH_MSG_DEBUG ("sTgcDigitizationTool::doDigitization()" );
270 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
271
272 sTgcDigitMaker::DigiConditions digitCond{};
277
278
279 // create and record the Digit container in StoreGate
280 SG::WriteHandle<sTgcDigitContainer> digitContainer(m_outputDigitCollectionKey, ctx);
281 ATH_CHECK(digitContainer.record(std::make_unique<sTgcDigitContainer>(idHelper.module_hash_max())));
282 ATH_MSG_DEBUG ( "sTgcDigitContainer recorded in StoreGate." );
283
284 // Create and record the SDO container in StoreGate
285 SG::WriteHandle<MuonSimDataCollection> sdoContainer(m_outputSDO_CollectionKey, ctx);
286 ATH_CHECK(sdoContainer.record(std::make_unique<MuonSimDataCollection>()));
287 ATH_MSG_DEBUG( "sTgcSDOCollection recorded in StoreGate." );
288
289
291
292 // Collections of digits by digit type associated with a detector element
293 sTgcSimDigitCont unmergedPadDigits{}, unmergedStripDigits{}, unmergedWireDigits{};
294 sTgcDigtCont outputDigits{};
295
296 ATH_MSG_DEBUG("create Digit container of size " << idHelper.module_hash_max());
297
298 double earliestEventTime = 9999;
299
300 // --nextDetectorElement>sets an iterator range with the hits of current detector element , returns a bool when done
301 while(m_thpcsTGC->nextDetectorElement(i, e)) {
302 int nhits = 0;
303 ATH_MSG_VERBOSE("Next Detector Element");
304 while(i != e){ //loop through the hits on this Detector Element
305 ATH_MSG_VERBOSE("Looping over hit " << nhits+1 << " on this Detector Element." );
306
307 ++nhits;
308 TimedHitPtr<sTGCSimHit> phit = *i++;
309 const sTGCSimHit& hit = *phit;
310 ATH_MSG_VERBOSE("Hit Particle ID : " << hit.particleEncoding() );
311 double eventTime = phit.eventTime();
312 if(eventTime < earliestEventTime) earliestEventTime = eventTime;
313 // Cut on energy deposit of the particle
315 ATH_MSG_VERBOSE("Hit with Energy Deposit of " << hit.depositEnergy()
316 << " less than " << m_energyDepositThreshold << ". Skip this hit." );
317 continue;
318 }
319
320 // Old HITS format doesn't have kinetic energy (i.e it is set to -1).
321 double hit_kineticEnergy = hit.kineticEnergy();
322
323 // Skip digitizing some problematic hits, if processing compatible HITS format
324 if (hit_kineticEnergy > 0.) {
325 // Skip electron with low kinetic energy, since electrons are mainly secondary particles.
326 if ((std::abs(hit.particleEncoding()) == 11) && (hit_kineticEnergy < m_limitElectronKineticEnergy)) {
327 ATH_MSG_DEBUG("Skip electron hit with kinetic energy " << hit_kineticEnergy
328 << ", which is less than the lower limit of " << m_limitElectronKineticEnergy);
329 continue;
330 }
331
332 // No support for particles with direction perpendicular to the beam line, since such particles
333 // can deposit energy on a lot of strips and pads of the gas gap. So a good model of charge
334 // spreading should be implemented. Also, these particles are rare, and most of them are
335 // secondary particles suh as electrons.
336 if (std::abs(hit.globalPosition().z() - hit.globalPrePosition().z()) < 0.00001) {
337 ATH_MSG_VERBOSE("Skip hit with a direction perpendicular to the beam line, ie z-component is less than 0.00001 mm.");
338 continue;
339 }
340 }
341
342 if(eventTime != 0){
343 ATH_MSG_DEBUG("Updated hit global time to include off set of " << eventTime << " ns from OOT bunch.");
344 }
345 else {
346 ATH_MSG_DEBUG("This hit came from the in time bunch.");
347 }
348 sTgcSimIdToOfflineId simToOffline(&idHelper);
349 const int idHit = hit.sTGCId();
350 ATH_MSG_VERBOSE("Hit ID " << idHit );
351 Identifier layid = simToOffline.convert(idHit);
352 int eventId = phit.eventId();
353
356 if (m_doSmearing) {
357 bool acceptHit = true;
358 ATH_CHECK(m_smearingTool->isAccepted(layid, acceptHit, digitCond.rndmEngine));
359 if ( !acceptHit ) {
360 ATH_MSG_DEBUG("Dropping the hit - smearing tool");
361 continue;
362 }
363 }
364
365 const MuonGM::sTgcReadoutElement* detEL = digitCond.detMgr->getsTgcReadoutElement(layid); //retreiving the sTGC this hit is located in
366 if(!detEL) {
367 ATH_MSG_WARNING("Failed to retrieve detector element for "
368 << m_idHelperSvc->toStringDetEl(layid));
369 continue;
370 }
371
372 // project the hit position to wire surface (along the incident angle)
373 ATH_MSG_VERBOSE("Projecting hit to Wire Surface" );
374 const Amg::Vector3D& HPOS{hit.globalPosition()}; //Global position of the hit
375 const Amg::Vector3D& GLODIRE{hit.globalDirection()};
376 const Amg::Vector3D& global_preStepPos{hit.globalPrePosition()};
377
378 ATH_MSG_VERBOSE("Global Direction " << Amg::toString(GLODIRE, 2) );
379 ATH_MSG_VERBOSE("Global Position " << Amg::toString(HPOS, 2) );
380
381 int surfHash_wire = detEL->surfaceHash(idHelper.gasGap(layid),
383 ATH_MSG_VERBOSE("Surface Hash for wire plane" << surfHash_wire );
384 const Trk::PlaneSurface& SURF_WIRE = detEL->surface(surfHash_wire); //Plane of the wire surface in this gasGap
385 ATH_MSG_VERBOSE("Wire Surface Defined " <<Amg::toString(SURF_WIRE.center(), 2) );
386
387 const Amg::Transform3D wireTrans = SURF_WIRE.transform().inverse();
388 Amg::Vector3D LOCDIRE = wireTrans.linear()*GLODIRE;
389 Amg::Vector3D LPOS = wireTrans * HPOS; //Position of the hit on the wire plane in local coordinates
390
391 ATH_MSG_VERBOSE("Local Direction: "<<Amg::toString(LOCDIRE, 2));
392 ATH_MSG_VERBOSE("Local Position: " << Amg::toString(LPOS, 2));
393
394 const double scale = Amg::intersect<3>(LPOS, LOCDIRE, Amg::Vector3D::UnitZ(), 0.).value_or(0);
395 // Hit on the wire surface in local coordinates
396 Amg::Vector3D hitOnSurf_wire = LPOS + scale * LOCDIRE;
397
398 //The hit on the wire in Global coordinates
399 Amg::Vector3D glob_hitOnSurf_wire = SURF_WIRE.transform() * hitOnSurf_wire;
400
401 ATH_MSG_VERBOSE("Local Hit on Wire Surface: " << Amg::toString(hitOnSurf_wire, 2));
402 ATH_MSG_VERBOSE("Global Hit on Wire Surface: " <<Amg::toString(glob_hitOnSurf_wire, 2));
403
404 ATH_MSG_DEBUG("sTgcDigitizationTool::doDigitization hits mapped");
405
406 const HepMcParticleLink particleLink = HepMcParticleLink::getRedirectedLink(hit.particleLink(), eventId, ctx); // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc.
407 const sTGCSimHit temp_hit(hit.sTGCId(), hit.globalTime(),
408 HPOS,
409 hit.particleEncoding(),
410 hit.globalDirection(),
411 hit.depositEnergy(),
412 particleLink,
413 hit_kineticEnergy,
414 global_preStepPos);
415
416
417 double globalHitTime = temp_hit.globalTime() + eventTime;
418 double tof = temp_hit.globalPosition().mag()/CLHEP::c_light;
419 double bunchTime = globalHitTime - tof;
420
421 // Create all the digits for this particular Sim Hit
422 sTgcDigitVec digiHits = m_digitizer->executeDigi(digitCond, temp_hit);
423 if (digiHits.empty()) {
424 continue;
425 }
426 ATH_MSG_VERBOSE("Hit produced " << digiHits.size() << " digits." );
427 for( std::unique_ptr<sTgcDigit>& digit : digiHits) {
428 /*
429 NOTE:
430 -----
431 Since not every hit might end up resulting in a
432 digit, this construction might take place after the hit loop
433 in a loop of its own!
434 */
435 // make new sTgcDigit
436 Identifier newDigitId = digit->identify(); //This Identifier should be sufficient to determine which RE the digit is from
437 double newTime = digit->time();
438 int newChannelType = idHelper.channelType(newDigitId);
439
440 double timeJitterElectronicsStrip = CLHEP::RandGaussZiggurat::shoot(digitCond.rndmEngine, 0, m_timeJitterElectronicsStrip);
441 double timeJitterElectronicsPad = CLHEP::RandGaussZiggurat::shoot(digitCond.rndmEngine, 0, m_timeJitterElectronicsPad);
442 if(newChannelType== sTgcIdHelper::sTgcChannelTypes::Strip)
443 newTime += timeJitterElectronicsStrip;
444 else
445 newTime += timeJitterElectronicsPad;
446 uint16_t newBcTag = bcTagging(newTime+bunchTime);
447
449 newTime += bunchTime;
450 else
451 newTime += globalHitTime;
452
453 double newCharge = digit->charge();
454
455 bool isDead{false}, isPileup{eventId != 0};
456 ATH_MSG_VERBOSE("Hit is from the main signal subevent if eventId is zero, eventId = " << eventId << " newTime: " << newTime);
457
458
459 // Create a new digit with updated time and BCTag
460 sTgcDigit newDigit(newDigitId, newBcTag, newTime, newCharge, isDead, isPileup);
461 ATH_MSG_VERBOSE("Unmerged Digit "<<m_idHelperSvc->toString(newDigitId)
462 <<" BC tag = " << newDigit.bcTag()
463 <<" digitTime = " << newDigit.time()
464 <<" charge = " << newDigit.charge()) ;
465
466
467 // Create a MuonSimData (SDO) corresponding to the digit
468 MuonSimData::Deposit deposit(particleLink, MuonMCData(hit.depositEnergy(), tof));
469 std::vector<MuonSimData::Deposit> deposits;
470 deposits.push_back(std::move(deposit));
471 MuonSimData simData(std::move(deposits), hit.particleEncoding());
472 // The sTGC SDO should be placed at the center of the gap, on the wire plane.
473 // We use the position from the hit on the wire surface which is by construction in the center of the gap
474 // glob_hitOnSurf_wire projects the whole hit to the center of the gap
475 simData.setPosition(glob_hitOnSurf_wire);
476 simData.setTime(globalHitTime);
477 const unsigned int modHash = static_cast<unsigned>(m_idHelperSvc->detElementHash(newDigitId));
478 sTgcSimDigitCont& contToPush = newChannelType == sTgcIdHelper::sTgcChannelTypes::Pad ? unmergedPadDigits :
479 newChannelType == sTgcIdHelper::sTgcChannelTypes::Strip ? unmergedStripDigits : unmergedWireDigits;
481 if (contToPush.size() <= modHash) contToPush.resize(modHash + 1);
482 contToPush[modHash].emplace_back(std::move(simData), std::move(newDigit));
483 } // end of loop digiHits
484 } // end of while(i != e)
485 } //end of while(m_thpcsTGC->nextDetectorElement(i, e))
486
487
488 /*********************
489 * Process Strip Digits *
490 *********************/
491 /* Comments from Alexandre Laurier, October 2022:
492 Big update to VMM handling of digits to sTGC digitization
493 For each channel type, the digits are processed on a layer-by-layer level
494 This is done to improve the performance of strip neighborOn functionnality
495 For wires, pads, and neighborOn=false strips, the digits on each channel
496 are ordered by earlier to latest and processed in order.
497 The digits are merged according to the VMM merging time window.
498 Above threshold digits are saved to output unless a previous digit is found
499 within the deadtime window.
500 --- For neighborOn=true strips ---
501 A strip above threshold forces the VMM readout of neighbor strips, even if
502 neighbor strips are below threshold.
503 We apply the logic as above, but for strips below threshold we search for one
504 direct neighbor strip to be above VMM threshold which triggers the VMM
505 to read the strip digit.
506 */
507 ATH_CHECK(processDigitsWithVMM(ctx, digitCond, unmergedStripDigits, m_deadtimeStrip,
508 m_doNeighborOn, outputDigits, *sdoContainer));
509 /*********************
510 * Process Pad Digits *
511 *********************/
512 ATH_CHECK(processDigitsWithVMM(ctx, digitCond, unmergedPadDigits, m_deadtimePad,
513 false, outputDigits, *sdoContainer));
514 /*********************
515 * Process Wire Digits *
516 *********************/
517 ATH_CHECK(processDigitsWithVMM(ctx, digitCond, unmergedWireDigits, m_deadtimeWire,
518 false, outputDigits, *sdoContainer));
519 /*************************************************
520 * Output the digits to the StoreGate collection *
521 *************************************************/
522 for (sTgcDigitVec& digits : outputDigits) {
523 if (digits.empty()) continue;
524 const Identifier elemID = m_idHelperSvc->chamberId(digits[0]->identify());
525 const IdentifierHash modHash = m_idHelperSvc->moduleHash(elemID);
526 std::unique_ptr<sTgcDigitCollection> collection = std::make_unique<sTgcDigitCollection>(elemID, modHash);
527 collection->insert(collection->end(), std::make_move_iterator(digits.begin()),
528 std::make_move_iterator(digits.end()));
529 ATH_CHECK(digitContainer->addCollection(collection.release(), modHash));
530 }
531 return StatusCode::SUCCESS;
532}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
virtual int surfaceHash(const Identifier &id) const override final
returns the hash to be used to look up the surface and transform in the MuonClusterReadoutElement tra...
size_type module_hash_max() const
the maximum hash value
std::pair< HepMcParticleLink, MuonMCData > Deposit
Definition MuonSimData.h:66
TimedVector::const_iterator const_iterator
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
Definition TimedHitPtr.h:47
float eventTime() const
t0 offset of the bunch xing containing the hit in ns.
Definition TimedHitPtr.h:55
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
const Amg::Vector3D & globalPrePosition() const
Definition sTGCSimHit.h:49
HitID sTGCId() const
Definition sTGCSimHit.h:51
double globalTime() const
Definition sTGCSimHit.h:41
const Amg::Vector3D & globalDirection() const
Definition sTGCSimHit.h:46
double kineticEnergy() const
Definition sTGCSimHit.h:48
const Amg::Vector3D & globalPosition() const
Definition sTGCSimHit.h:44
const HepMcParticleLink & particleLink() const
Definition sTGCSimHit.h:96
int particleEncoding() const
Definition sTGCSimHit.h:45
double depositEnergy() const
Definition sTGCSimHit.h:47
StatusCode retrieveCondData(const EventContext &ctx, SG::ReadCondHandleKey< CondType > &key, const CondType *&condPtr) const
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
StatusCode processDigitsWithVMM(const EventContext &ctx, const DigiConditions &digiCond, sTgcSimDigitCont &unmergedContainer, const double vmmDeadTime, const bool isNeighbourOn, sTgcDigtCont &outDigitContainer, MuonSimDataCollection &outSdoContainer) const
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
int channelType(const Identifier &id) const
int gasGap(const Identifier &id) const override
get the hashes
constexpr bool simData
Definition constants.h:36
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
bool isPileup(int origin)
from pileup
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.

◆ filterPassed()

virtual bool PileUpToolBase::filterPassed ( ) const
inlineoverridevirtualinherited

dummy implementation of passing filter

Definition at line 49 of file PileUpToolBase.h.

49{ return m_filterPassed; }

◆ getChannelThreshold()

double sTgcDigitizationTool::getChannelThreshold ( const EventContext & ctx,
const Identifier & channelID,
const NswCalibDbThresholdData & thresholdData ) const
private

Definition at line 548 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

550 {
551
552 float threshold = m_chargeThreshold, elecThrsld{0.f};
553
554 if(!thresholdData.getThreshold(channelID, elecThrsld))
555 ATH_MSG_ERROR("Cannot find retrieve VMM threshold from conditions data base!");
556 if(!m_calibTool->pdoToCharge(ctx, true, elecThrsld, channelID, threshold))
557 ATH_MSG_ERROR("Cannot convert VMM charge threshold via conditions data!");
558
559 return threshold;
560}
#define ATH_MSG_ERROR(x)
bool getThreshold(const Identifier &, float &) const

◆ getNextEvent()

StatusCode sTgcDigitizationTool::getNextEvent ( const EventContext & ctx)
private

Get next event and extract collection of hit collections.

Definition at line 163 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

163 {
164
165 ATH_MSG_DEBUG ( "sTgcDigitizationTool::getNextEvent()" );
166
167 // get the container(s)
169
170 // In case of single hits container just load the collection using read handles
172 SG::ReadHandle<sTGCSimHitCollection> hitCollection(m_hitsContainerKey, ctx);
173 if (!hitCollection.isValid()) {
174 ATH_MSG_ERROR("Could not get sTGCSimHitCollection container " << hitCollection.name() << " from store " << hitCollection.store());
175 return StatusCode::FAILURE;
176 }
177
178 // create a new hits collection
179 m_thpcsTGC = std::make_unique<TimedHitCollection<sTGCSimHit>>(1);
180 m_thpcsTGC->insert(0, hitCollection.cptr());
181 ATH_MSG_DEBUG("sTGCSimHitCollection found with " << hitCollection->size() << " hits");
182 return StatusCode::SUCCESS;
183 }
184
185 //this is a list<info<time_t, DataLink<sTGCSimHitCollection> > >
186 TimedHitCollList hitCollList;
187
188 if (!(m_mergeSvc->retrieveSubEvtsData(m_inputObjectName, hitCollList).isSuccess()) ) {
189 ATH_MSG_ERROR ( "Could not fill TimedHitCollList" );
190 return StatusCode::FAILURE;
191 }
192 if (hitCollList.empty()) {
193 ATH_MSG_ERROR ( "TimedHitCollList has size 0" );
194 return StatusCode::FAILURE;
195 }
196 else {
197 ATH_MSG_DEBUG ( hitCollList.size() << " sTGC SimHitCollections with key " << m_inputObjectName << " found" );
198 }
199
200 //Perform null check on m_thpcsTGC. If pointer is not null throw error
201 if (!m_thpcsTGC) {
202 m_thpcsTGC = std::make_unique<TimedHitCollection<sTGCSimHit>>();
203 }else{
204 ATH_MSG_ERROR ( "m_thpcsTGC is not null" );
205 return StatusCode::FAILURE;
206 }
207
208 //now merge all collections into one
209 TimedHitCollList::iterator iColl(hitCollList.begin());
210 TimedHitCollList::iterator endColl(hitCollList.end());
211 while (iColl != endColl) {
212 const sTGCSimHitCollection* p_collection(iColl->second);
213 m_thpcsTGC->insert(iColl->first, p_collection);
214 ATH_MSG_DEBUG ( "sTGC SimHitCollection found with " << p_collection->size() << " hits" );
215 ++iColl;
216 }
217
218 return StatusCode::SUCCESS;
219}
AtlasHitsVector< sTGCSimHit > sTGCSimHitCollection
std::list< value_t > type
type of the collection of timed data object

◆ getRandomEngine()

CLHEP::HepRandomEngine * sTgcDigitizationTool::getRandomEngine ( const std::string & streamName,
const EventContext & ctx ) const
private

Definition at line 563 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

564{
565 ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
566 std::string rngName = name()+streamName;
567 rngWrapper->setSeed( rngName, ctx );
568 CLHEP::HepRandomEngine* engine = rngWrapper->getEngine(ctx);
569 ATH_MSG_VERBOSE(streamName<<" rngName "<<rngName<<" "<<engine);
570 return engine;
571}
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

◆ initialize()

StatusCode sTgcDigitizationTool::initialize ( )
virtual

Initialize.

Reimplemented from PileUpToolBase.

Definition at line 48 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

48 {
49
50 ATH_MSG_INFO (" sTgcDigitizationTool retrieved");
51 ATH_MSG_INFO ( "Configuration sTgcDigitizationTool" );
52 ATH_MSG_INFO ( "doSmearing "<< m_doSmearing);
53 ATH_MSG_INFO ( "RndmSvc " << m_rndmSvc );
54 ATH_MSG_INFO ( "RndmEngine " << m_rndmEngineName );
55 ATH_MSG_INFO ( "InputObjectName " << m_hitsContainerKey.key());
56 ATH_MSG_INFO ( "OutputObjectName " << m_outputDigitCollectionKey.key());
57 ATH_MSG_INFO ( "OutputSDOName " << m_outputSDO_CollectionKey.key());
58 ATH_MSG_INFO ( "HV " << m_runVoltage);
59 ATH_MSG_INFO ( "threshold " << m_chargeThreshold);
60 ATH_MSG_INFO ( "useCondThresholds " << m_useCondThresholds);
61
62 if (m_hitsContainerKey.key().empty()) {
63 ATH_MSG_FATAL("Property InputObjectName not set !");
64 return StatusCode::FAILURE;
65 }
66
68 ATH_MSG_DEBUG("Input objects in container: '" << m_inputObjectName << "'");
69
70 // Pile-up merge service
72 ATH_CHECK(m_mergeSvc.retrieve());
73 }
74
75 // retrieve MuonDetctorManager from DetectorStore
76 ATH_CHECK(m_detMgrKey.initialize());
77 ATH_CHECK(m_idHelperSvc.retrieve());
79
80
81 // calibration tool
82 ATH_CHECK(m_calibTool.retrieve());
83 // initialize ReadCondHandleKey
85 // Initialize ReadHandleKey
86 ATH_CHECK(m_hitsContainerKey.initialize());
87
88 //initialize the output WriteHandleKeys
91
92 // initialize sTgcDigitMaker class to digitize hits
93 // meanGasGain is the mean value of the polya gas gain function describing the
94 // avalanche of electrons caused by the electric field
95 // Parameterization is obtained from ATL-MUON-PUB-2014-001 and the corrected
96 // fit to data to parameterize gain vs HV in kV
97 // m_runVoltage MUST BE in kV!
99 ATH_MSG_ERROR("STGC run voltage must be in kV and within fit domain of 2.3 kV to 3.2 kV");
100 return StatusCode::FAILURE;
101 }
102 double meanGasGain = 2.15 * 1E-4 * std::exp(6.88*m_runVoltage);
103 m_digitizer = std::make_unique<sTgcDigitMaker>(m_idHelperSvc.get(), m_doChannelTypes, meanGasGain, m_doPadSharing, m_applyAsBuiltBLines);
104 m_digitizer->setLevel(static_cast<MSG::Level>(msgLevel()));
105 ATH_CHECK(m_digitizer->initialize());
106
107 ATH_CHECK(m_rndmSvc.retrieve());
108 // getting our random numbers stream
109 ATH_MSG_DEBUG("Getting random number engine : <" << m_rndmEngineName << ">");
110
111 return StatusCode::SUCCESS;
112}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)

◆ mergeEvent()

StatusCode sTgcDigitizationTool::mergeEvent ( const EventContext & ctx)

When being run from PileUpToolsAlgs, this method is called at the end of the subevts loop.

Not (necessarily) able to access SubEvents

Definition at line 222 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

222 {
223 ATH_MSG_DEBUG ( "sTgcDigitizationTool::in mergeEvent()" );
225 // reset the pointer
226 m_thpcsTGC.reset();
227 m_STGCHitCollList.clear();
228
229 return StatusCode::SUCCESS;
230}
std::vector< std::unique_ptr< sTGCSimHitCollection > > m_STGCHitCollList
StatusCode doDigitization(const EventContext &ctx)
Core part of digitization use by mergeEvent (IPileUpTool) and digitize (IMuonDigitizationTool)

◆ prepareEvent()

StatusCode sTgcDigitizationTool::prepareEvent ( const EventContext & ctx,
const unsigned int nInputEvents )

When being run from PileUpToolsAlgs, this method is called at the start of the subevts loop.

Not able to access SubEvents

Definition at line 114 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

114 {
115
116 ATH_MSG_DEBUG("sTgcDigitizationTool::prepareEvent() called for " << nInputEvents << " input events" );
117 m_STGCHitCollList.clear();
118
119 return StatusCode::SUCCESS;
120}

◆ processAllSubEvents()

StatusCode sTgcDigitizationTool::processAllSubEvents ( const EventContext & ctx)
virtual

alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.

Reimplemented from PileUpToolBase.

Definition at line 236 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

236 {
237 ATH_MSG_DEBUG (" sTgcDigitizationTool::processAllSubEvents()" );
238 //merging of the hit collection in getNextEvent method
239 if (!m_thpcsTGC ) {
241 }
243 // reset the pointer
244 m_thpcsTGC.reset();
245
246 return StatusCode::SUCCESS;
247}
StatusCode getNextEvent(const EventContext &ctx)
Get next event and extract collection of hit collections.

◆ processBunchXing()

StatusCode sTgcDigitizationTool::processBunchXing ( int bunchXing,
SubEventIterator bSubEvents,
SubEventIterator eSubEvents )
virtual

When being run from PileUpToolsAlgs, this method is called for each active bunch-crossing to process current SubEvents bunchXing is in ns.

Reimplemented from PileUpToolBase.

Definition at line 123 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

125 {
126 ATH_MSG_DEBUG ( "sTgcDigitizationTool::in processBunchXing()" );
127 if (m_thpcsTGC == nullptr) {
128 m_thpcsTGC = std::make_unique<TimedHitCollection<sTGCSimHit>>();
129 }
131 TimedHitCollList hitCollList;
132
133 if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputObjectName, hitCollList, bunchXing,
134 bSubEvents, eSubEvents).isSuccess()) &&
135 hitCollList.empty()) {
136 ATH_MSG_ERROR("Could not fill TimedHitCollList");
137 return StatusCode::FAILURE;
138 } else {
139 ATH_MSG_VERBOSE(hitCollList.size() << " sTGCSimHitCollection with key " <<
140 m_inputObjectName << " found");
141 }
142
143 TimedHitCollList::iterator iColl(hitCollList.begin());
144 TimedHitCollList::iterator endColl(hitCollList.end());
145
146 // Iterating over the list of collections
147 for( ; iColl != endColl; ++iColl){
148
149 auto hitCollPtr = std::make_unique<sTGCSimHitCollection>(*iColl->second);
150 PileUpTimeEventIndex timeIndex(iColl->first);
151
152 ATH_MSG_DEBUG("sTGCSimHitCollection found with " << hitCollPtr->size() << " hits");
153 ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
154 << " index: " << timeIndex.index()
155 << " type: " << timeIndex.type());
156
157 m_thpcsTGC->insert(timeIndex, hitCollPtr.get());
158 m_STGCHitCollList.push_back(std::move(hitCollPtr));
159 }
160 return StatusCode::SUCCESS;
161}

◆ processDigitsWithVMM() [1/2]

sTgcSimDigitVec sTgcDigitizationTool::processDigitsWithVMM ( const EventContext & ctx,
const DigiConditions & digiCond,
const double vmmDeadTime,
sTgcSimDigitVec & unmergedDigits,
const bool isNeighborOn ) const
private

Sort the unmerged digit vector per layer Id -> by channel -> time from early to late arrival

Catch the cases where the channel is 1 or maxChannel

merge digits in time. Do weighed average to find time of digits originally below threshold. Follows what we expect from real VMM.

We reached another digit. No need to merge

Definition at line 630 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

634 {
635
636 const MuonGM::MuonDetectorManager* detMgr{digiCond.detMgr};
637 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
639 std::stable_sort(unmergedDigits.begin(), unmergedDigits.end(),
640 [&idHelper](const sTgcSimDigitData& a, const sTgcSimDigitData& b) {
641 const int layA = idHelper.gasGap(a.identify());
642 const int layB = idHelper.gasGap(b.identify());
643 if (layA != layB) return layA < layB;
644 const int chA = idHelper.channel(a.identify());
645 const int chB = idHelper.channel(b.identify());
646 if (chA != chB) return chA < chB;
647 return a.time() < b.time();
648 });
649 sTgcSimDigitVec savedDigits{}, premerged{};
650
651 premerged.reserve(unmergedDigits.size());
652 savedDigits.reserve(premerged.capacity());
653
654
655 auto passNeigbourLogic = [&](const sTgcSimDigitData& candidate) {
656 if (!isNeighborOn || savedDigits.empty()) return false;
657 if (savedDigits.back().identify() == candidate.identify() &&
658 std::abs(savedDigits.back().time() - candidate.time()) < vmmDeadTime) {
659 ATH_MSG_VERBOSE("Digits are too close in time ");
660 return false;
661 }
662 const Identifier digitId = candidate.identify();
663 const int channel = idHelper.channel(digitId);
664 const int maxChannel = detMgr->getsTgcReadoutElement(digitId)->numberOfStrips(digitId);
665 for (int neighbour : {std::max(1, channel -1), std::min(maxChannel, channel+1)}) {
667 if (neighbour == channel) continue;
668 const Identifier neighbourId = idHelper.channelID(digitId,
669 idHelper.multilayer(digitId),
670 idHelper.gasGap(digitId),
671 idHelper.channelType(digitId), neighbour);
672 const double threshold = m_useCondThresholds ? getChannelThreshold(ctx, neighbourId, *digiCond.thresholdData)
674 if (std::find_if(savedDigits.begin(), savedDigits.end(), [&](const sTgcSimDigitData& known){
675 return known.identify() == neighbourId &&
676 known.getDigit().charge() > threshold &&
677 std::abs(known.time() - candidate.time()) < m_hitTimeMergeThreshold;
678 }) != savedDigits.end()) return true;
679
680 }
681 return false;
682 };
683 // Sort digits on every channel by earliest to latest time
684 // Also do hit merging to help with neighborOn logic
686 for (sTgcSimDigitVec::iterator merge_me = unmergedDigits.begin(); merge_me!= unmergedDigits.end(); ++merge_me) {
688 threshold = getChannelThreshold(ctx, (*merge_me).identify(), *digiCond.thresholdData);
689 }
692 sTgcDigit& digit1{(*merge_me).getDigit()};
693 double totalCharge = digit1.charge();
694 double weightedTime = digit1.time();
695
696 sTgcSimDigitVec::iterator merge_with = merge_me + 1;
697 for ( ; merge_with!= unmergedDigits.end(); ++merge_with) {
699 if ((*merge_with).identify() != (*merge_me).identify()) {
700 break;
701 }
702 const sTgcDigit& mergeDigit{(*merge_with).getDigit()};
703 // If future digits are within window, digit1 absorbs its charge
704 if (mergeDigit.time() - digit1.time() > m_hitTimeMergeThreshold) break;
705 // If digit1 is not above threshold prior to merging, the new time is
706 // a weighted average. Do it for every merging pair.
707 if (totalCharge < threshold) {
708 weightedTime = (weightedTime * totalCharge + mergeDigit.time() * mergeDigit.charge())
709 / (totalCharge + mergeDigit.charge());
710 }
711 totalCharge += mergeDigit.charge();
712 }
713 digit1.set_charge(totalCharge);
714 digit1.set_time(weightedTime);
715 sTgcSimDigitData& mergedHit{*merge_me};
716 if (!savedDigits.empty() &&
717 savedDigits.back().identify() == digit1.identify() &&
718 std::abs(savedDigits.back().time() - digit1.time()) <= vmmDeadTime) continue;
719 if (digit1.charge() > threshold || passNeigbourLogic(mergedHit)){
720 savedDigits.emplace_back(std::move(mergedHit));
721 } else if (isNeighborOn) {
722 premerged.emplace_back(std::move(mergedHit));
723 }
724 } // end of time-ordering and hit merging loop
725 std::copy_if(std::make_move_iterator(premerged.begin()),
726 std::make_move_iterator(premerged.end()),
727 std::back_inserter(savedDigits), passNeigbourLogic);
728 return savedDigits;
729}
static Double_t a
Identifier identify() const
Definition MuonDigit.h:30
virtual int numberOfStrips(const Identifier &layerId) const override final
number of strips per layer
void set_time(float newTime)
Definition sTgcDigit.cxx:76
float time() const
Definition sTgcDigit.cxx:61
float charge() const
Definition sTgcDigit.cxx:46
void set_charge(float newCharge)
Definition sTgcDigit.cxx:71
double getChannelThreshold(const EventContext &ctx, const Identifier &channelID, const NswCalibDbThresholdData &thresholdData) const
int multilayer(const Identifier &id) const
int channel(const Identifier &id) const override
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
void stable_sort(DataModel_detail::iterator< DVL > beg, DataModel_detail::iterator< DVL > end)
Specialization of stable_sort for DataVector/List.

◆ processDigitsWithVMM() [2/2]

StatusCode sTgcDigitizationTool::processDigitsWithVMM ( const EventContext & ctx,
const DigiConditions & digiCond,
sTgcSimDigitCont & unmergedContainer,
const double vmmDeadTime,
const bool isNeighbourOn,
sTgcDigtCont & outDigitContainer,
MuonSimDataCollection & outSdoContainer ) const
private

Start the merging by looping over the digit container and grouping the hits from the same layer together.

Merge all digits

Update the container iterator to go to the next layer

Assign enough space in the container vector

Push back the SDO

apply the smearing before adding the digit

Select strips with charge > 0.001 pC to avoid having zero ADC count when converting charge [pC] to PDO [ADC count]

Definition at line 573 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

579 {
580
581 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
583 for (sTgcSimDigitVec& digitsInCham : unmergedDigits) {
584
585 if (digitsInCham.empty()) continue;
587 sTgcSimDigitVec mergedDigits = processDigitsWithVMM(ctx, digiCond, vmmDeadTime,
588 digitsInCham, isNeighbourOn);
590 if (mergedDigits.empty()) continue;
591
592 const IdentifierHash hash = m_idHelperSvc->moduleHash(mergedDigits.front().identify());
593 const unsigned int hashIdx = static_cast<unsigned>(hash);
595 if (hash >= outDigitContainer.size()) {
596 outDigitContainer.resize(hash + 1);
597 }
598 for (sTgcSimDigitData& merged : mergedDigits) {
600 outSdoContainer.insert(std::make_pair(merged.identify(), std::move(merged.getSimData())));
602 bool acceptDigit{true};
603 float chargeAfterSmearing = merged.getDigit().charge();
604 if (m_doSmearing) {
605 ATH_CHECK(m_smearingTool->smearCharge(merged.identify(), chargeAfterSmearing, acceptDigit,
606 digiCond.rndmEngine));
607 }
608 if (!acceptDigit) {
609 continue;
610 }
613 if (idHelper.channelType(merged.identify()) == sTgcIdHelper::sTgcChannelTypes::Strip &&
614 chargeAfterSmearing < 0.001) {
615 continue;
616 }
617 std::unique_ptr<sTgcDigit> finalDigit = std::make_unique<sTgcDigit>(std::move(merged.getDigit()));
618 if (m_doSmearing) {
619 finalDigit->set_charge(chargeAfterSmearing);
620 }
621 ATH_MSG_VERBOSE("Final Digit "<<m_idHelperSvc->toString(finalDigit->identify())<<
622 " BC tag = " << finalDigit->bcTag()<<
623 " digitTime = " << finalDigit->time() <<
624 " charge = " << finalDigit->charge());
625 outDigitContainer[hashIdx].push_back(std::move(finalDigit));
626 }
627 }
628 return StatusCode::SUCCESS;
629}

◆ resetFilter()

virtual void PileUpToolBase::resetFilter ( )
inlineoverridevirtualinherited

dummy implementation of filter reset

Reimplemented in MergeTruthJetsTool.

Definition at line 51 of file PileUpToolBase.h.

51{ m_filterPassed=true; }

◆ retrieveCondData()

template<class CondType>
StatusCode sTgcDigitizationTool::retrieveCondData ( const EventContext & ctx,
SG::ReadCondHandleKey< CondType > & key,
const CondType *& condPtr ) const
private

Definition at line 249 of file MuonDigitization/sTGC_Digitization/src/sTgcDigitizationTool.cxx.

251 {
252 if (key.empty()) {
253 ATH_MSG_DEBUG("No key has been configured for object "<<typeid(CondType).name()<<". Clear pointer");
254 condPtr = nullptr;
255 return StatusCode::SUCCESS;
256 }
257 SG::ReadCondHandle<CondType> readHandle{key, ctx};
258 if (!readHandle.isValid()){
259 ATH_MSG_FATAL("Failed to load conditions object "<<key.fullKey()<<".");
260 return StatusCode::FAILURE;
261 }
262 condPtr = readHandle.cptr();
263 return StatusCode::SUCCESS;
264}
const_pointer_type cptr()

◆ toProcess()

virtual bool PileUpToolBase::toProcess ( int bunchXing) const
inlineoverridevirtualinherited

the method this base class helps implementing

Reimplemented in MergeHijingParsTool, and MergeTrackRecordCollTool.

Definition at line 32 of file PileUpToolBase.h.

32 {
33 //closed interval [m_firstXing,m_lastXing]
34 return !((m_firstXing > bunchXing) || (bunchXing > m_lastXing));
35 }
Gaudi::Property< int > m_firstXing
Gaudi::Property< int > m_lastXing

Member Data Documentation

◆ m_applyAsBuiltBLines

Gaudi::Property<bool> sTgcDigitizationTool::m_applyAsBuiltBLines {this, "applyAsBuiltBLines",false, "correct the hit position by the as built and B-lines parameters"}
private

Definition at line 175 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

175{this, "applyAsBuiltBLines",false, "correct the hit position by the as built and B-lines parameters"};

◆ m_calibTool

ToolHandle<Muon::INSWCalibTool> sTgcDigitizationTool::m_calibTool {this,"CalibrationTool","Muon::NSWCalibTool/NSWCalibTool"}
private

Definition at line 139 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

139{this,"CalibrationTool","Muon::NSWCalibTool/NSWCalibTool"};

◆ m_chargeThreshold

Gaudi::Property<double> sTgcDigitizationTool::m_chargeThreshold {this,"chargeThreshold", 0.030, "vmm charge threshold in pC, need to set useCondThresholds to false if one wants to use this threshold value otherwise the one from the conditions database is used"}
private

Definition at line 173 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

173{this,"chargeThreshold", 0.030, "vmm charge threshold in pC, need to set useCondThresholds to false if one wants to use this threshold value otherwise the one from the conditions database is used"};

◆ m_condThrshldsKey

SG::ReadCondHandleKey<NswCalibDbThresholdData> sTgcDigitizationTool::m_condThrshldsKey {this, "CondThrshldsKey", "NswCalibDbThresholdData", "Key of NswCalibDbThresholdData object containing calibration data (VMM thresholds)"}
private

Definition at line 159 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

159{this, "CondThrshldsKey", "NswCalibDbThresholdData", "Key of NswCalibDbThresholdData object containing calibration data (VMM thresholds)"};

◆ m_deadtimePad

Gaudi::Property<double> sTgcDigitizationTool::m_deadtimePad {this,"deadtimePad" , 250}
private

Definition at line 166 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

166{this,"deadtimePad" , 250};

◆ m_deadtimeStrip

Gaudi::Property<double> sTgcDigitizationTool::m_deadtimeStrip {this,"deadtimeStrip", 250}
private

Definition at line 165 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

165{this,"deadtimeStrip", 250};

◆ m_deadtimeWire

Gaudi::Property<double> sTgcDigitizationTool::m_deadtimeWire {this,"deadtimeWire" , 250}
private

Definition at line 167 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

167{this,"deadtimeWire" , 250};

◆ m_detMgrKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> sTgcDigitizationTool::m_detMgrKey
private
Initial value:
{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}

Definition at line 127 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

127 {this, "DetectorManagerKey", "MuonDetectorManager",
128 "Key of input MuonDetectorManager condition data"};

◆ m_digitizer

std::unique_ptr<sTgcDigitMaker> sTgcDigitizationTool::m_digitizer {}
private

◆ m_doChannelTypes

Gaudi::Property<int> sTgcDigitizationTool::m_doChannelTypes {this,"doChannelTypes",3}
private

Definition at line 161 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

161{this,"doChannelTypes",3};

◆ m_doEfficiencyCorrection

Gaudi::Property<bool> sTgcDigitizationTool::m_doEfficiencyCorrection {this,"doEfficiencyCorrection",false}
private

Definition at line 146 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

146{this,"doEfficiencyCorrection",false};

◆ m_doNeighborOn

Gaudi::Property<bool> sTgcDigitizationTool::m_doNeighborOn {this,"neighborOn", true}
private

Definition at line 168 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

168{this,"neighborOn", true};

◆ m_doPadSharing

Gaudi::Property<bool> sTgcDigitizationTool::m_doPadSharing {this,"padChargeSharing", false}
private

Definition at line 162 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

162{this,"padChargeSharing", false};

◆ m_doSmearing

Gaudi::Property<bool> sTgcDigitizationTool::m_doSmearing {this,"doSmearing",false}
private

Definition at line 144 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

144{this,"doSmearing",false};

◆ m_doToFCorrection

Gaudi::Property<bool> sTgcDigitizationTool::m_doToFCorrection {this,"doToFCorrection",false}
private

Definition at line 145 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

145{this,"doToFCorrection",false};

◆ m_effiKey

SG::ReadCondHandleKey<Muon::DigitEffiData> sTgcDigitizationTool::m_effiKey
private
Initial value:
{this, "EffiDigiKey", "sTgcDigitEff",
"Key of the efficiency data in the CondStore"}

Definition at line 130 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

130 {this, "EffiDigiKey", "sTgcDigitEff",
131 "Key of the efficiency data in the CondStore"};

◆ m_energyDepositThreshold

Gaudi::Property<double> sTgcDigitizationTool::m_energyDepositThreshold {this,"energyDepositThreshold",300.0*CLHEP::eV,"Minimum energy deposit for hit to be digitized"}
private

Definition at line 170 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

170{this,"energyDepositThreshold",300.0*CLHEP::eV,"Minimum energy deposit for hit to be digitized"};

◆ m_filterPassed

bool PileUpToolBase::m_filterPassed {true}
protectedinherited

Definition at line 60 of file PileUpToolBase.h.

60{true};

◆ m_firstXing

Gaudi::Property<int> PileUpToolBase::m_firstXing
protectedinherited
Initial value:
{this, "FirstXing", -999,
"First bunch-crossing in which det is live"}

Definition at line 54 of file PileUpToolBase.h.

54 {this, "FirstXing", -999,
55 "First bunch-crossing in which det is live"};

◆ m_hitsContainerKey

SG::ReadHandleKey<sTGCSimHitCollection> sTgcDigitizationTool::m_hitsContainerKey {this, "InputObjectName", "sTGC_Hits", "name of the input object"}
private

Definition at line 155 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

155{this, "InputObjectName", "sTGC_Hits", "name of the input object"};

◆ m_hitTimeMergeThreshold

const double sTgcDigitizationTool::m_hitTimeMergeThreshold {30.f}
private

Definition at line 179 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

179{30.f}; //30ns = resolution of peak finding descriminator

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> sTgcDigitizationTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 125 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

125{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_inputObjectName

std::string sTgcDigitizationTool::m_inputObjectName {""}
private

◆ m_lastXing

Gaudi::Property<int> PileUpToolBase::m_lastXing
protectedinherited
Initial value:
{this, "LastXing", 999,
"Last bunch-crossing in which det is live"}

Definition at line 56 of file PileUpToolBase.h.

56 {this, "LastXing", 999,
57 "Last bunch-crossing in which det is live"};

◆ m_limitElectronKineticEnergy

Gaudi::Property<double> sTgcDigitizationTool::m_limitElectronKineticEnergy {this,"limitElectronKineticEnergy",5.0*CLHEP::MeV,"Minimum kinetic energy for electron hit to be digitized"}
private

Definition at line 171 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

171{this,"limitElectronKineticEnergy",5.0*CLHEP::MeV,"Minimum kinetic energy for electron hit to be digitized"};

◆ m_mergeSvc

ServiceHandle<PileUpMergeSvc> sTgcDigitizationTool::m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", "Merge service used in digitization"}
private

Definition at line 123 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

123{this, "PileUpMergeSvc", "PileUpMergeSvc", "Merge service used in digitization"};

◆ m_onlyUseContainerName

Gaudi::Property<bool> sTgcDigitizationTool::m_onlyUseContainerName {this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."}
private

Definition at line 154 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

154{this, "OnlyUseContainerName", true, "Don't use the ReadHandleKey directly. Just extract the container name from it."};

◆ m_outputDigitCollectionKey

SG::WriteHandleKey<sTgcDigitContainer> sTgcDigitizationTool::m_outputDigitCollectionKey {this,"OutputObjectName","sTGC_DIGITS","WriteHandleKey for Output sTgcDigitContainer"}
private

Definition at line 141 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

141{this,"OutputObjectName","sTGC_DIGITS","WriteHandleKey for Output sTgcDigitContainer"}; // name of the output digits

◆ m_outputSDO_CollectionKey

SG::WriteHandleKey<MuonSimDataCollection> sTgcDigitizationTool::m_outputSDO_CollectionKey {this,"OutputSDOName","sTGC_SDO","WriteHandleKey for Output MuonSimDataCollection"}
private

Definition at line 142 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

142{this,"OutputSDOName","sTGC_SDO","WriteHandleKey for Output MuonSimDataCollection"}; // name of the output SDOs

◆ m_rndmEngineName

Gaudi::Property<std::string> sTgcDigitizationTool::m_rndmEngineName {this,"RndmEngine","MuonDigitization","Random engine name"}
private

Definition at line 152 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

152{this,"RndmEngine","MuonDigitization","Random engine name"};

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> sTgcDigitizationTool::m_rndmSvc {this, "RndmSvc", "AthRNGSvc", "Random Number Service used in Muon digitization"}
private

Definition at line 124 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

124{this, "RndmSvc", "AthRNGSvc", "Random Number Service used in Muon digitization"};

◆ m_runVoltage

Gaudi::Property<double> sTgcDigitizationTool::m_runVoltage {this,"operatingHVinkV",2.8}
private

Definition at line 150 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

150{this,"operatingHVinkV",2.8};

◆ m_smearingTool

ToolHandle<Muon::INSWCalibSmearingTool> sTgcDigitizationTool::m_smearingTool {this,"SmearingTool","Muon::NSWCalibSmearingTool/STgcCalibSmearingTool"}
private

Definition at line 138 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

138{this,"SmearingTool","Muon::NSWCalibSmearingTool/STgcCalibSmearingTool"};

◆ m_STGCHitCollList

std::vector<std::unique_ptr<sTGCSimHitCollection> > sTgcDigitizationTool::m_STGCHitCollList {}
private

◆ m_thpcsTGC

std::unique_ptr<TimedHitCollection<sTGCSimHit> > sTgcDigitizationTool::m_thpcsTGC {}
private

◆ m_timeJitterElectronicsPad

const double sTgcDigitizationTool::m_timeJitterElectronicsPad {2.f}
private

◆ m_timeJitterElectronicsStrip

const double sTgcDigitizationTool::m_timeJitterElectronicsStrip {2.f}
private

◆ m_useCondThresholds

Gaudi::Property<bool> sTgcDigitizationTool::m_useCondThresholds {this, "useCondThresholds", false, "Use conditions data to get VMM charge threshold values"}
private

Definition at line 158 of file MuonDigitization/sTGC_Digitization/sTGC_Digitization/sTgcDigitizationTool.h.

158{this, "useCondThresholds", false, "Use conditions data to get VMM charge threshold values"};

◆ m_vetoPileUpTruthLinks

Gaudi::Property<int> PileUpToolBase::m_vetoPileUpTruthLinks
protectedinherited
Initial value:
{this, "VetoPileUpTruthLinks", true,
"Ignore links to suppressed pile-up truth"}

Definition at line 58 of file PileUpToolBase.h.

58 {this, "VetoPileUpTruthLinks", true,
59 "Ignore links to suppressed pile-up truth"};

The documentation for this class was generated from the following files: