ATLAS Offline Software
Classes | Public Member Functions | Protected Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MdtDigitizationTool Class Reference

#include <MdtDigitizationTool.h>

Inheritance diagram for MdtDigitizationTool:
Collaboration diagram for MdtDigitizationTool:

Classes

struct  GeoCorOut
 

Public Member Functions

 MdtDigitizationTool (const std::string &type, const std::string &name, const IInterface *pIID)
 
virtual ~MdtDigitizationTool ()=default
 
virtual StatusCode initialize () override final
 Initialize. More...
 
StatusCode prepareEvent (const EventContext &ctx, const unsigned int) override final
 When being run from PileUpToolsAlgs, this method is called at the start of the subevts loop. More...
 
virtual StatusCode processBunchXing (int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
 When being run from PileUpToolsAlgs, this method is called for each active bunch-crossing to process current SubEvents bunchXing is in ns. More...
 
StatusCode mergeEvent (const EventContext &ctx) override final
 When being run from PileUpToolsAlgs, this method is called at the end of the subevts loop. More...
 
virtual StatusCode processAllSubEvents (const EventContext &ctx) override final
 alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents. More...
 

Protected Attributes

ServiceHandle< PileUpMergeSvcm_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""}
 
BooleanProperty m_onlyUseContainerName
 
SG::ReadHandleKey< MDTSimHitCollectionm_hitsContainerKey {this, "InputObjectName", "MDT_Hits", ""}
 
std::string m_inputObjectName {""}
 
SG::WriteHandleKey< MdtDigitContainerm_outputObjectKey
 
SG::WriteHandleKey< MuonSimDataCollectionm_outputSDOKey
 
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
 
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainerm_calibDbKey
 
SG::ReadCondHandleKey< MdtCondDbDatam_readKey {this, "ReadKey", "MdtCondDbData", "Key of MdtCondDbData"}
 

Private Types

using Collections_t = std::vector< std::unique_ptr< MdtDigitCollection > >
 

Private Member Functions

CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, const EventContext &ctx) const
 
int digitizeTime (double time, bool isHPTDC, CLHEP::HepRandomEngine *rndmEngine) const
 
double minimumTof (Identifier DigitId, const MuonGM::MuonDetectorManager *detMgr) const
 
bool insideMatchingWindow (double time) const
 
bool insideMaskWindow (double time) const
 
bool checkMDTSimHit (const EventContext &ctx, const MDTSimHit &hit) const
 
bool handleMDTSimHit (const EventContext &ctx, const TimedHitPtr< MDTSimHit > &phit, CLHEP::HepRandomEngine *twinRndmEngine, CLHEP::HepRandomEngine *toolRndmEngine)
 
bool createDigits (const EventContext &ctx, Collections_t &collections, MuonSimDataCollection *sdoContainer, CLHEP::HepRandomEngine *rndmEngine)
 
GeoCorOut correctGeometricalWireSag (const MDTSimHit &hit, const Identifier &id, const MuonGM::MdtReadoutElement *element) const
 
StatusCode getNextEvent (const EventContext &ctx)
 
StatusCode doDigitization (const EventContext &ctx, Collections_t &collections, MuonSimDataCollection *sdoContainer)
 
MdtDigitCollectiongetDigitCollection (Identifier elementId, Collections_t &collections)
 
void fillMaps (const MDTSimHit *mdtHit, const Identifier digitId, const double driftR)
 

Static Private Member Functions

static MDTSimHit applyDeformations (const MDTSimHit &, const MuonGM::MdtReadoutElement *, const Identifier &)
 

Private Attributes

MDT_SortedHitVector m_hits
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
const MdtHitIdHelperm_muonHelper {}
 
const MuonGM::MuonDetectorManagerm_MuonGeoMgr {}
 
ToolHandle< IMDT_DigitizationToolm_digiTool
 
std::vector< MDTSimHitCollection * > m_MDTHitCollList
 
Gaudi::Property< double > m_offsetTDC {this, "OffsetTDC", 800., "TDC offset used if no calibration data is found"}
 
Gaudi::Property< double > m_signalSpeed {this, "SignalSpeed", 0.85*Gaudi::Units::c_light}
 
Gaudi::Property< double > m_ns2TDCAMT {this, "ns2TDCAMT", 0.78125, "Conversion factor TDC/ns for AMT chips"}
 
Gaudi::Property< double > m_ns2TDCHPTDC {this, "ns2TDCHPTDC", 0.1953125, "Conversion factor TDC/ns for HPTDC chips"}
 
Gaudi::Property< double > m_resTDC {this, "ResolutionTDC", 0.5, "TDC resolution"}
 
Gaudi::Property< double > m_t0ShiftTuning {this,"TunedT0Shift",-17.,"Fine tuned t0 shift value in ns"}
 
Gaudi::Property< bool > m_checkMDTSimHits {this, "CheckSimHits", true, "Control on the hit validity"}
 
Gaudi::Property< bool > m_useTof {this, "UseTof", true, "Option for the tof calculation"}
 
Gaudi::Property< bool > m_useAttenuation {this, "UseAttenuation", false, ""}
 
Gaudi::Property< bool > m_useProp {this, "UseProp", true, ""}
 
Gaudi::Property< bool > m_useWireSagGeom {this, "UseWireSagGeom", false, "Option for the wire sagitta correction"}
 
Gaudi::Property< bool > m_useWireSagRT {this, "UseWireSagRT", false, "Option for the wire sagitta correction"}
 
Gaudi::Property< bool > m_useTwin {this, "UseTwin", false, ""}
 
Gaudi::Property< bool > m_useAllBOLTwin {this, "UseAllBOLTwin", false, ""}
 
Gaudi::Property< double > m_resTwin {this, "ResolutionTwinTube", 1.05, "Twin Tube resolution"}
 
Gaudi::Property< bool > m_useTimeWindow {this, "UseTimeWindow", true, ""}
 
Gaudi::Property< double > m_bunchCountOffset {this, "BunchCountOffset", -200., "Bunch crossing offset"}
 
Gaudi::Property< double > m_matchingWindow {this, "MatchingWindow", 1000., "Matching window"}
 
Gaudi::Property< double > m_maskWindow {this, "MaskWindow", 250., "Masked window"}
 
Gaudi::Property< double > m_deadTime {this, "DeadTime", 700., "MDT drift tube dead time"}
 
Gaudi::Property< bool > m_DiscardEarlyHits {this, "DiscardEarlyHits", true, ""}
 
Gaudi::Property< bool > m_useOffSet1 {this, "UseOffSet1", true, ""}
 
Gaudi::Property< bool > m_useOffSet2 {this, "UseOffSet2", true, ""}
 
Gaudi::Property< bool > m_useDeformations {this, "UseDeformations", false, ""}
 
Gaudi::Property< bool > m_DoQballCharge {this, "DoQballCharge", false, "dEdx for Qballs with account of electric charge"}
 
std::unique_ptr< TimedHitCollection< MDTSimHit > > m_thpcMDT {}
 
Gaudi::Property< bool > m_includePileUpTruth {this, "IncludePileUpTruth", true, "Include pile-up truth info"}
 

structors and AlgTool implementation

Gaudi::Property< int > m_firstXing
 
Gaudi::Property< int > m_lastXing
 
Gaudi::Property< int > m_vetoPileUpTruthLinks
 
bool m_filterPassed {true}
 
virtual bool toProcess (int bunchXing) const override
 the method this base class helps implementing More...
 
virtual StatusCode processAllSubEvents (const EventContext &ctx)=0
 dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface. More...
 
virtual bool filterPassed () const override
 dummy implementation of passing filter More...
 
virtual void resetFilter () override
 dummy implementation of filter reset More...
 

Detailed Description

In the initialize() method, the PileUpMerge and StoreGate services are initialized, and a pointer to an instance of the class MuonDetectorManager is retrieved from the detector store and used to obtain a MdtIdHelper.The MdtDigitContainer is initialized and the simulation identifier helper retrieved, together with the pointer to the digitization tool. Random numbers are obtained in the code from a dedicated stream via AtRndmSvc, which is also initialized in the initialize() method.

In the execute() method, the digits and the SDOs (Simulation Data Object, container for simulation data to be preserved after the digitization procedue, and persistified together with the RDOs) containers are created and recorded on StoreGate; the MDTSimHit collection are merged using the TimedHitCollection sorted container (done in handleMDTSimHit(TimedHitPtr <MDTSimHit>& hit)) method); into a loop over the TimedHitCollection for the given DetectorElement, the handleMDTSimHit() method converts the SimID into the Offline ID to be associated to the Digit and pass to the digitization tool the drift radius and the distance to the chamber RO side (for the propagation delay computation). The digitization tool returns a drift time and an ADC count which are used together with the Offline ID, to create the digit object (in createDigits() method).

The finalize() method returns a SUCCESS StatusCode if the digitization procedure ends succesfully.

Definition at line 93 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h.

Member Typedef Documentation

◆ Collections_t

using MdtDigitizationTool::Collections_t = std::vector<std::unique_ptr<MdtDigitCollection> >
private

Constructor & Destructor Documentation

◆ MdtDigitizationTool()

MdtDigitizationTool::MdtDigitizationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  pIID 
)

Definition at line 65 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

65  :
66  PileUpToolBase(type, name, pIID) {}

◆ ~MdtDigitizationTool()

virtual MdtDigitizationTool::~MdtDigitizationTool ( )
virtualdefault

Member Function Documentation

◆ applyDeformations()

MDTSimHit MdtDigitizationTool::applyDeformations ( const MDTSimHit hit,
const MuonGM::MdtReadoutElement element,
const Identifier DigitId 
)
staticprivate

Definition at line 856 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

857  {
858  // make the deformation
859  Amg::Vector3D hitAtGlobalFrame = element->nodeform_localToGlobalTransf(DigitId) * hit.localPosition();
860  Amg::Vector3D hitDeformed = element->globalToLocalTransf(DigitId) * hitAtGlobalFrame;
861  MDTSimHit simhit2(hit);
862  // apply the deformation
863  simhit2.setDriftRadius(hitDeformed.perp());
864  simhit2.setLocalPosition(hitDeformed);
865  return simhit2;
866 }

◆ checkMDTSimHit()

bool MdtDigitizationTool::checkMDTSimHit ( const EventContext &  ctx,
const MDTSimHit hit 
) const
private

Definition at line 585 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

585  {
586  // get the hit Identifier and info
587  const int id = hit.MDTid();
588  std::string stationName = m_muonHelper->GetStationName(id);
591  int multilayer = m_muonHelper->GetMultiLayer(id);
592  int layer = m_muonHelper->GetLayer(id);
593  int tube = m_muonHelper->GetTube(id);
594 
595  Identifier DigitId = m_idHelperSvc->mdtIdHelper().channelID(stationName, stationEta, stationPhi, multilayer, layer, tube);
596  ATH_MSG_DEBUG("Working on hit: " << m_idHelperSvc->mdtIdHelper().show_to_string(DigitId) << " "
597  << m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(DigitId))
598  << " " << stationEta << " " << stationPhi);
599 
600  //+MASKING OF DEAD/MISSING CHAMBERS
601  if (!m_readKey.empty()) {
603  if (!readCdo.isValid()) {
604  ATH_MSG_WARNING(m_readKey.fullKey() << " is not available.");
605  return false;
606  }
607  if (!readCdo->isGood(DigitId)) return false;
608  }
609  //-MASKING OF DEAD/MISSING CHAMBERS
610 
611  double tubeL{0.}, tubeR{0.};
613 
614  if (!element) {
615  ATH_MSG_ERROR("MuonGeoManager does not return valid element for given id!");
616  } else {
617  tubeL = element->tubeLength(DigitId);
618  tubeR = element->innerTubeRadius();
619  }
620 
621  bool ok(true);
622 
623  if (std::abs(hit.driftRadius()) > tubeR) {
624  ok = false;
625  ATH_MSG_DEBUG("MDTSimHit has invalid radius: " << hit.driftRadius() << " tubeRadius " << tubeR);
626  }
627 
628  if (std::abs(hit.localPosition().z()) > 0.5 * tubeL) {
629  ok = false;
630  ATH_MSG_DEBUG("MDTSimHit has invalid position along tube: " << hit.localPosition().z() << " tubeLength " << tubeL);
631  }
632 
633  if (m_useTof) {
634  double minTof = minimumTof(DigitId, m_MuonGeoMgr);
635  if ((hit.globalTime() < 0 || hit.globalTime() > 10 * minTof) && m_DiscardEarlyHits) {
636  ok = false;
637  ATH_MSG_DEBUG("MDTSimHit has invalid global time: " << hit.globalTime() << " minimum Tof " << minTof);
638  }
639  } else {
640  ATH_MSG_DEBUG("MDTSimHit global time: " << hit.globalTime() << " accepted anyway as UseTof is false");
641  }
642 
643  return ok;
644 }

◆ correctGeometricalWireSag()

MdtDigitizationTool::GeoCorOut MdtDigitizationTool::correctGeometricalWireSag ( const MDTSimHit hit,
const Identifier id,
const MuonGM::MdtReadoutElement element 
) const
private

Definition at line 868 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

869  {
870  Amg::Vector3D lpos = hit.localPosition();
871  Amg::Transform3D gToWireFrame = element->globalToLocalTransf(id);
872 
873  // local track direction in precision plane
874  Amg::Vector3D ldir(-lpos.y(), lpos.x(), 0.);
875  ldir.normalize();
876 
877  // calculate the position of the hit sagged wire frame
878  // transform to global coords
879  const Amg::Transform3D& transf{element->localToGlobalTransf(id)};
880  Amg::Vector3D gpos = transf*lpos;
881  Amg::Vector3D gdir = transf* ldir;
882 
883  // get wire surface
884  const Trk::SaggedLineSurface& surface = element->surface(id);
885 
886  // check whether direction is pointing away from IP
887  double pointingCheck = gpos.dot(gdir) < 0 ? -1. : 1.;
888  if (pointingCheck < 0) { gdir *= pointingCheck; }
889 
890  double trackingSign = 1.;
891  double localSag = 0.0;
892  if (m_useWireSagGeom) {
893  // calculate local hit position in nominal wire frame
895  surface.globalToLocal(gpos, gpos, lp);
896 
897  // calculate sagged wire position
898  std::unique_ptr<const Trk::StraightLineSurface> wireSurface {surface.correctedSurface(lp)};
899  // calculate displacement of wire from nominal
900  // To do this, note that the sagged surface is modeled as a straight line
901  // through the point in the space that the bit of wire closest to the hit
902  // sagged to and is parallel to the nominal wire. Find the center of the
903  // sagged surface in global coordinates, transform this into the nominal
904  // surface's local coordinates, and calculate that point's distance from
905  // the origin.
906  const Amg::Vector3D gSaggedSpot = wireSurface->center();
907  Amg::Vector3D lSaggedSpot = gToWireFrame * gSaggedSpot;
908 
909  localSag = lSaggedSpot.perp();
910 
911  // global to local sagged wire frame transform
912  gToWireFrame = wireSurface->transform().inverse();
913 
914  // local hit position in sagged wire frame
915  lpos = gToWireFrame * gpos;
916  ldir = gToWireFrame * gdir;
917  ldir.normalize();
918 
919  // compute drift radius ( = impact parameter)
920  double alpha = -1 * lpos.dot(ldir);
921  lpos = lpos + alpha * ldir;
922 
923  // calculate global point of closest approach
924  Amg::Vector3D saggedGPos = wireSurface->transform() * lpos;
925 
926  // recalculate tracking sign
928  wireSurface->globalToLocal(saggedGPos, gdir, lpsag);
929  trackingSign = lpsag[Trk::locR] < 0 ? -1. : 1.;
930 
931  } else {
932  // recalculate tracking sign
934  surface.globalToLocal(gpos, gdir, lpsag);
935  trackingSign = lpsag[Trk::locR] < 0 ? -1. : 1.;
936  }
937 
938  // local gravity vector
939  Amg::Vector3D gravityDir =-1. * Amg::Vector3D::UnitY();
940  Amg::Vector3D lgravDir = gToWireFrame * gravityDir;
941 
942  // Project gravity vector onto X-Y plane, so the z-components (along the wire)
943  // don't contribute to the dot-product.
944  lgravDir.z() = 0.;
945 
946  // calculate whether hit above or below wire (using gravity direction
947  // 1 -> hit below wire (in same hemisphere as gravity vector)
948  //-1 -> hit above wire (in opposite hemisphere as gravity vector)
949  double sign = lpos.dot(lgravDir) < 0 ? -1. : 1.;
950 
951  return {sign, trackingSign, lpos, localSag};
952 }

◆ createDigits()

bool MdtDigitizationTool::createDigits ( const EventContext &  ctx,
Collections_t collections,
MuonSimDataCollection sdoContainer,
CLHEP::HepRandomEngine *  rndmEngine 
)
private

Definition at line 646 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

648  {
649  Identifier currentDigitId{0}, currentElementId{0};
650 
651  double currentDeadTime = 0.;
652  MdtDigitCollection* digitCollection = nullptr;
653  // loop over sorted hits
654  m_hits.sort();
655  HitIt it = m_hits.begin();
656 
657  // +For Cosmics add
658  double timeOffsetEvent = 0.0;
659  double timeOffsetTotal = 0.0;
660 
661  // this offset emulates the timing spead of cosmics: +/- 1 BC
662  if (m_useTof == false && m_useOffSet2 == true) {
663  int inum = CLHEP::RandFlat::shootInt(rndmEngine, 0, 10);
664  if (inum == 8) {
665  timeOffsetEvent = -25.0;
666  } else if (inum == 9) {
667  timeOffsetEvent = 25.0;
668  }
669  ATH_MSG_DEBUG("Emulating timing spead of cosmics: +/- 1 BC. Adding " << timeOffsetEvent << " ns to time");
670  }
671  //-ForCosmics
672 
674  if (!mdtCalibConstants.isValid()) {
675  ATH_MSG_FATAL("Failed to retrieve set of calibration constants "<<mdtCalibConstants.fullKey());
676  return false;
677  }
678  for (; it != m_hits.end(); ++it) {
679  Identifier idDigit = it->id;
680  Identifier elementId = m_idHelperSvc->mdtIdHelper().elementID(idDigit);
682 
683  // Check if we are in a new chamber, if so get the DigitCollection
684  if (elementId != currentElementId) {
685  currentElementId = elementId;
686  digitCollection = getDigitCollection(elementId, collections);
687 
688  //+ForCosmics
689  // this offset emulates the time jitter of cosmic ray muons w.r.t LVL1 accept
690  if (m_useTof == false && m_useOffSet1 == true) {
691  timeOffsetTotal = timeOffsetEvent + CLHEP::RandFlat::shoot(rndmEngine, -12.5, 12.5);
692  ATH_MSG_DEBUG("Emulating time jitter of cosmic ray muons w.r.t LVL1 accept. Adding " << timeOffsetTotal << " ns to time");
693  }
694  //-ForCosmics
695  }
696  if (!digitCollection) {
697  ATH_MSG_ERROR("Trying to use nullptr digitCollection");
698  return false;
699  }
700 
701  float driftRadius = it->radius;
702  double driftTime = it->time;
703  double charge = it->adc;
704 
705  ATH_MSG_VERBOSE("New hit : driftTime " << driftTime << " adc " << charge);
706 
707  // check if we are in a new tube
708  if (idDigit != currentDigitId) {
709  currentDigitId = idDigit;
710  // set the deadTime
711  currentDeadTime = driftTime + charge + m_deadTime;
712  ATH_MSG_VERBOSE("New tube, setting dead time: " << currentDeadTime << " driftTime " << driftTime);
713  } else {
714  // check if tube is dead
715  if (driftTime > currentDeadTime) {
716  // tube produces a second hit, set the new deadtime
717  currentDeadTime = driftTime + charge + m_deadTime;
718  ATH_MSG_VERBOSE("Additional hit, setting dead time: " << currentDeadTime << " driftTime " << driftTime);
719  } else {
720  // tube is dead go to next hit
721  ATH_MSG_VERBOSE("Hit within dead time: " << currentDeadTime << " driftTime " << driftTime);
722  continue;
723  }
724  }
725 
726  const TimedHitPtr<MDTSimHit>& phit = *(it->simhit);
727  const MDTSimHit& hit(*phit);
728 
729  // check if the hits lies within the TDC time window
730  // subtrack the minimum Tof (= globalPosition().mag()/c) from the tof of the hit
731  double relativeTime = driftTime - minimumTof(idDigit, m_MuonGeoMgr);
732  bool insideMatch = insideMatchingWindow(relativeTime);
733  bool insideMask = insideMaskWindow(relativeTime);
734  if (insideMask && insideMatch) {
735  ATH_MSG_WARNING(" Digit in matching AND masking window, please check window definition: relative time " << relativeTime);
736  insideMask = false;
737  }
738  if (insideMatch || insideMask) {
739  // get calibration constants from DbTool
740  double t0 = m_offsetTDC;
741  const MuonCalib::MdtFullCalibData* data{mdtCalibConstants->getCalibData(idDigit, msgStream())};
742  if (data && data->tubeCalib) {
743  // extract calibration constants for single tube
744  const MuonCalib::MdtTubeCalibContainer::SingleTubeCalib* singleTubeData = data->tubeCalib->getCalib(idDigit);
745  if (singleTubeData) {
746  ATH_MSG_DEBUG("Extracted the following calibration constant for "<<m_idHelperSvc->toString(idDigit)<<" "<<singleTubeData->t0);
747  t0 = singleTubeData->t0 + m_t0ShiftTuning;
748  } else ATH_MSG_WARNING("No calibration data found, using t0=" << m_offsetTDC<<" "<<m_idHelperSvc->toString(idDigit));
749  } else {
750  ATH_MSG_WARNING("No calibration data found, using t0=" << m_offsetTDC<<" for "<<m_idHelperSvc->toString(idDigit));
751  }
752  bool isHPTDC = m_idHelperSvc->hasHPTDC(idDigit);
753  int tdc = digitizeTime(driftTime + t0 + timeOffsetTotal, isHPTDC, rndmEngine);
754  int adc = digitizeTime(it->adc, isHPTDC, rndmEngine);
755  ATH_MSG_DEBUG(" >> Digit Id = " << m_idHelperSvc->mdtIdHelper().show_to_string(idDigit) << " driftTime " << driftTime
756  << " driftRadius " << driftRadius << " TDC " << tdc << " ADC " << adc << " mask bit "
757  << insideMask);
758 
759  MdtDigit* newDigit = new MdtDigit(idDigit, tdc, adc, insideMask);
760  digitCollection->push_back(newDigit);
761 
762  ATH_MSG_VERBOSE(" createDigits() phit-" << &phit << " hit-" << hit.print() << " localZPos = " << hit.localPosition().z());
763 
764  // Do not store pile-up truth information
765  if (!m_includePileUpTruth && HepMC::ignoreTruthLink(phit->particleLink(), m_vetoPileUpTruthLinks)) { continue; }
766 
767  // Create the Deposit for MuonSimData
768  MuonSimData::Deposit deposit(HepMcParticleLink::getRedirectedLink(phit->particleLink(), phit.eventId(), ctx), // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc.
769  MuonMCData(driftRadius, hit.localPosition().z()));
770 
771  // Record the SDO collection in StoreGate
772  std::vector<MuonSimData::Deposit> deposits;
773  deposits.push_back(deposit);
774  MuonSimData tempSDO(deposits, 0);
775  const Amg::Vector3D& tempLocPos = (*(it->simhit))->localPosition();
776  Amg::Vector3D p = geo->localToGlobalTransf(idDigit)*tempLocPos;
777  tempSDO.setPosition(p);
778  tempSDO.setTime(hitTime(phit));
779  sdoContainer->insert(std::make_pair(idDigit, tempSDO));
780 
781  } else {
782  ATH_MSG_DEBUG(" >> OUTSIDE TIME WINDOWS << "
783  << " Digit Id = " << m_idHelperSvc->toString(idDigit) << " driftTime " << driftTime
784  << " --> hit ignored");
785  }
786  } // for (; it != hits.end(); ++it)
787 
788  return true;
789 }

◆ digitizeTime()

int MdtDigitizationTool::digitizeTime ( double  time,
bool  isHPTDC,
CLHEP::HepRandomEngine *  rndmEngine 
) const
private

Definition at line 812 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

812  {
813  int tdcCount{0};
814  double tmpCount = isHPTDC ? time / m_ns2TDCHPTDC : time / m_ns2TDCAMT;
815  tdcCount = CLHEP::RandGaussZiggurat::shoot(rndmEngine, tmpCount, m_resTDC);
816  if (tdcCount < 0 || tdcCount > 4096) { ATH_MSG_DEBUG(" Count outside TDC window: " << tdcCount); }
817  return tdcCount;
818 }

◆ doDigitization()

StatusCode MdtDigitizationTool::doDigitization ( const EventContext &  ctx,
Collections_t collections,
MuonSimDataCollection sdoContainer 
)
private

Definition at line 315 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

316  {
317  // Set the RNGs to use for this event.
318  CLHEP::HepRandomEngine* rndmEngine = getRandomEngine("", ctx);
319  CLHEP::HepRandomEngine* twinRndmEngine = getRandomEngine("Twin", ctx);
320  CLHEP::HepRandomEngine* toolRndmEngine = getRandomEngine(m_digiTool->name(), ctx);
321 
322  // get the iterator infos for this DetEl
323  // iterate over hits and fill id-keyed drift time map
325 
326  // Perform null check on m_thpcMDT
327  if (!m_thpcMDT) {
328  ATH_MSG_ERROR("m_thpcMDT is null");
329  return StatusCode::FAILURE;
330  }
331 
332  while (m_thpcMDT->nextDetectorElement(i, e)) {
333  // Loop over the hits:
334  while (i != e) {
335  handleMDTSimHit(ctx, *i, twinRndmEngine, toolRndmEngine);
336  ++i;
337  }
338  }
339 
340  // loop over drift time map entries, convert to tdc value and construct/store the digit
341  createDigits(ctx, collections, sdoContainer, rndmEngine);
342 
343  // reset hits
344  m_hits.clear();
345 
346  // reset the pointer if it is not null
347  m_thpcMDT.reset();
348 
349  return StatusCode::SUCCESS;
350 }

◆ fillMaps()

void MdtDigitizationTool::fillMaps ( const MDTSimHit mdtHit,
const Identifier  digitId,
const double  driftR 
)
private

◆ filterPassed()

virtual bool PileUpToolBase::filterPassed ( ) const
inlineoverridevirtualinherited

dummy implementation of passing filter

Definition at line 49 of file PileUpToolBase.h.

49 { return m_filterPassed; }

◆ getDigitCollection()

MdtDigitCollection * MdtDigitizationTool::getDigitCollection ( Identifier  elementId,
Collections_t collections 
)
private

Definition at line 791 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

791  {
792  IdContext mdtContext = m_idHelperSvc->mdtIdHelper().module_context();
793  IdentifierHash coll_hash;
794  if (m_idHelperSvc->mdtIdHelper().get_hash(elementId, coll_hash, &mdtContext)) {
795  ATH_MSG_ERROR("Unable to get MDT hash id from MDT Digit collection "
796  << "context begin_index = " << mdtContext.begin_index() << " context end_index = " << mdtContext.end_index()
797  << " the identifier is ");
798  elementId.show();
799  }
800 
801  if (coll_hash >= collections.size()) {
802  collections.resize (coll_hash+1);
803  }
804 
805  auto& coll = collections[coll_hash];
806  if (!coll) {
807  coll = std::make_unique<MdtDigitCollection>(elementId, coll_hash);
808  }
809  return coll.get();
810 }

◆ getNextEvent()

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

Definition at line 187 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

187  {
188  ATH_MSG_DEBUG("MdtDigitizationTool::getNextEvent()");
189 
190  // get the container(s)
192 
193  // In case of single hits container just load the collection using read handles
194  if (!m_onlyUseContainerName) {
196  if (!hitCollection.isValid()) {
197  ATH_MSG_ERROR("Could not get MDTSimHitCollection container " << hitCollection.name() << " from store "
198  << hitCollection.store());
199  return StatusCode::FAILURE;
200  }
201 
202  // create a new hits collection
203  m_thpcMDT = std::make_unique<TimedHitCollection<MDTSimHit>>(1);
204  m_thpcMDT->insert(0, hitCollection.cptr());
205  ATH_MSG_DEBUG("MDTSimHitCollection found with " << hitCollection->size() << " hits");
206 
207  return StatusCode::SUCCESS;
208  }
209 
210  // this is a list<info<time_t, DataLink<MDTSimHitCollection> > >
211  TimedHitCollList hitCollList;
212 
213  if (!(m_mergeSvc->retrieveSubEvtsData(m_inputObjectName, hitCollList).isSuccess())) {
214  ATH_MSG_ERROR("Could not fill TimedHitCollList");
215  return StatusCode::FAILURE;
216  }
217  if (hitCollList.empty()) {
218  ATH_MSG_ERROR("TimedHitCollList has size 0");
219  return StatusCode::FAILURE;
220  } else {
221  ATH_MSG_DEBUG(hitCollList.size() << " MDTSimHitCollections with key " << m_inputObjectName << " found");
222  }
223 
224  // create a new hits collection
225  m_thpcMDT = std::make_unique<TimedHitCollection<MDTSimHit>>();
226 
227  // now merge all collections into one
228  TimedHitCollList::iterator iColl(hitCollList.begin());
229  TimedHitCollList::iterator endColl(hitCollList.end());
230  while (iColl != endColl) {
231  const MDTSimHitCollection* p_collection(iColl->second);
232  m_thpcMDT->insert(iColl->first, p_collection);
233  ATH_MSG_DEBUG("MDTSimHitCollection found with " << p_collection->size() << " hits");
234  ++iColl;
235  }
236  return StatusCode::SUCCESS;
237 }

◆ getRandomEngine()

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

Definition at line 239 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

239  {
240  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
241  std::string rngName = name() + streamName;
242  rngWrapper->setSeed(rngName, ctx);
243  return rngWrapper->getEngine(ctx);
244 }

◆ handleMDTSimHit()

bool MdtDigitizationTool::handleMDTSimHit ( const EventContext &  ctx,
const TimedHitPtr< MDTSimHit > &  phit,
CLHEP::HepRandomEngine *  twinRndmEngine,
CLHEP::HepRandomEngine *  toolRndmEngine 
)
private

Definition at line 352 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

354  {
355  const MDTSimHit& hit(*phit);
356  MDTSimHit newSimhit(*phit); // hit can be modified later
357 
358  double globalHitTime(hitTime(phit));
359 
360  // Important checks for hits (global time, position along tube, masked chambers etc..) DO NOT SET THIS CHECK TO FALSE IF YOU DON'T KNOW
361  // WHAT YOU'RE DOING !
362  if (m_checkMDTSimHits && !checkMDTSimHit(ctx, hit)) return false;
363 
364  const int id = hit.MDTid();
365  double driftRadius = hit.driftRadius();
366  ATH_MSG_DEBUG("Hit bunch time " << globalHitTime - hit.globalTime() << " tot " << globalHitTime << " tof " << hit.globalTime()
367  << " driftRadius " << driftRadius);
368 
369  std::string stationName = m_muonHelper->GetStationName(id);
372  int multilayer = m_muonHelper->GetMultiLayer(id);
373  int layer = m_muonHelper->GetLayer(id);
374  int tube = m_muonHelper->GetTube(id);
375 
376  // construct Atlas identifier from components
377  Identifier DigitId = m_idHelperSvc->mdtIdHelper().channelID(stationName, stationEta, stationPhi, multilayer, layer, tube);
378 
379  // get distance to readout
380  double distRO(0.);
381 
382  // find the detector element associated to the hit
384 
385  if (!element) {
386  ATH_MSG_ERROR("MuonGeoManager does not return valid element for given id!");
387  return false;
388  } else {
389  distRO = element->tubeFrame_localROPos(DigitId).z();
390  }
391 
392  if (m_useDeformations) {
393  newSimhit = applyDeformations(hit, element, DigitId);
394  driftRadius = newSimhit.driftRadius();
395  }
396 
397  // store local hit position + sign
398  GeoCorOut result = correctGeometricalWireSag(hit, DigitId, element);
399  if (m_useDeformations) { result = correctGeometricalWireSag(newSimhit, DigitId, element); }
400  double saggingSign = result.sagSign;
401  double trackingSign = result.trackingSign;
402  Amg::Vector3D lpos = result.localPosition;
403  double localSag = result.localSag;
404 
405  // set segment (radius + distance to readout)
406  if (m_useWireSagGeom) {
407  driftRadius = lpos.perp();
408 
409  double projectiveSag = hit.driftRadius() - std::abs(driftRadius);
410  if (m_useDeformations) projectiveSag = newSimhit.driftRadius() - std::abs(driftRadius);
411 
412  ATH_MSG_DEBUG(" Geometrical WIRESAGINFO "
413  << stationName << " " << stationEta << " " << stationPhi << " " << multilayer << " " << layer << " " << tube << " "
414  << Amg::toString(hit.localPosition(), 3) << " "
415  << hit.driftRadius() << " " << element->tubeLength(DigitId) << " " << " " << localSag
416  << " " << projectiveSag << " " << driftRadius << " " << saggingSign);
417  }
418 
419  // correctly set sign of drift radius
420  driftRadius *= trackingSign;
421 
422  //+Implementation for RT_Relation_DB_Tool
423  MdtDigiToolInput digiInput(std::abs(driftRadius), distRO, 0., 0., 0., 0., DigitId);
424  double qcharge = 1.;
425  double qgamma = -9999.;
426 
427  if (m_DoQballCharge) {
428  // chargeCalculator returns the value of electric charge for Qball particle.
429  // particleGamma returns the value of gamma for Qball particle.
430  qgamma = particleGamma(ctx, hit, phit.eventId());
431  qcharge = chargeCalculator(ctx, hit, phit.eventId());
432 
433  digiInput = MdtDigiToolInput{std::abs(driftRadius), distRO, 0., 0., qcharge, qgamma, DigitId};
434  }
435 
436  // digitize input
437  MdtDigiToolOutput digiOutput(m_digiTool->digitize(ctx, digiInput, toolRndmEngine));
438  //-Implementation for RT_Relation_DB_Tool
439 
440  // simulate tube response, check if tube fired
441  if (digiOutput.wasEfficient()) {
442  double driftTime = digiOutput.driftTime();
443  double adc = digiOutput.adc();
444 
445  ATH_MSG_VERBOSE("Tube efficient: driftTime " << driftTime << " adc value " << adc);
446 
447  // compute RT effect
448  if (m_useWireSagRT && !element->barrel() && stationName != "EOS" && stationName != "EOL") {
449  Amg::Vector3D gpos = element->localToGlobalTransf(DigitId)*lpos;
450 
451  // fit parameters for drift time difference vs impact radius for a wire 500 microns off axis
452  // garfield calculation. details on http://dslevin.home.cern.ch/atlas/wiresag.ppt
453  // Line below: old code
454  // double param[4] = {-0.3025,0.58303,0.012177,0.0065818};
455  // New code
456  static constexpr std::array<double, 6> param{-4.47741E-3, 1.75541E-2, -1.32913E-2, 2.57938E-3, -4.55015E-5, -1.70821E-7};
457 
458  // get delta T, change in drift time for reference sag (default=100 microns) and scale by projective sag
459  double deltaT{0.};
460  double dR = std::abs(driftRadius);
461  for (int i = 0; i < 6; ++i) { deltaT += param[i] * std::pow(dR, i); }
462 
463  // reference sag now set to 0.1 mm
464  double referenceSag = 0.1;
465 
466  // Calculate angle at which track cross plane of sag.
467  // Note that this assumes the track is coming from the center of the detector.
468  double cosTheta = std::abs(gpos.z()) / gpos.mag();
469 
470  // This calculates the sag seen by a track; if a particle passes parallel to the sag,
471  // the shift in drift circle location will have no affect.
472  double projectiveSag = localSag * cosTheta;
473 
474  deltaT *= (projectiveSag / referenceSag);
475 
476  // saggingSign is calculated by the correctGeometricalWireSag function of this class
477  // It is +/- 1 depending on whether or not the track passed above or below the wire.
478  deltaT = -1 * saggingSign * deltaT;
479 
480  double driftTimeOriginal = driftTime;
481  driftTime += deltaT; // update drift time
482 
483  ATH_MSG_DEBUG(" RT WIRESAGINFO " << stationName << " " << stationEta << " " << stationPhi << " " << multilayer << " " << layer
484  << " " << tube << " " << Amg::toString(hit.localPosition(), 3)
485  << " " << driftRadius << " " << element->tubeLength(DigitId) / 1000.
486  << " " << cosTheta << " " << localSag << " " << projectiveSag << " " << deltaT << " "
487  << driftTimeOriginal << " " << driftTime);
488  } // m_useWireSagRT
489 
490  if (m_useProp) {
491  double position_along_wire = hit.localPosition().z();
492  if (m_useDeformations) { position_along_wire = newSimhit.localPosition().z(); }
493 
494  // prop delay calculated with respect to the center of the tube
495  double sign(-1.);
496  if (distRO < 0.) sign = 1.;
497  double propagation_delay = sign * (1. / m_signalSpeed) * position_along_wire;
498  //------------------------------------------------------------
499  // calculate propagation delay, as readout side the side with
500  // negative local
501  // position along the wire is taken
502 
503  driftTime += propagation_delay; // add prop time
504  ATH_MSG_VERBOSE("Position along wire: " << position_along_wire << " propagation delay: " << propagation_delay
505  << " new driftTime " << driftTime);
506  }
507 
508  // add tof + bunch time
509  if (m_useTof) {
510  driftTime += globalHitTime;
511  ATH_MSG_VERBOSE("Time off Flight + bunch offset: " << globalHitTime << " new driftTime " << driftTime);
512  }
513  ATH_MSG_DEBUG(m_idHelperSvc->mdtIdHelper().show_to_string(DigitId)
514  << " Drift time computation " << driftTime << " radius " << driftRadius << " adc " << adc);
515 
516  // add hit to hit collection
517  m_hits.insert(mdt_hit_info(DigitId, driftTime, adc, driftRadius, &phit));
518  ATH_MSG_VERBOSE(" handleMDTSimHit() phit-" << &phit << " hit.localPosition().z() = " << hit.localPosition().z()
519  << " driftRadius = " << driftRadius);
520 
521  // + TWIN TUBES (A. Koutsman)
522  if (m_useTwin) {
523  // two chambers in ATLAS are installed with Twin Tubes; in detector coordinates BOL4A13 & BOL4C13; only INNER multilayer(=1) is
524  // with twin tubes
525  bool BOL4X13 = false;
526  // find these two chambers in identifier scheme coordinates as in MdtIdHelper
527  if (stationName == "BOL" && std::abs(stationEta) == 4 && stationPhi == 7 && multilayer == 1) { BOL4X13 = true; }
528 
529  // implement twin tubes digitizing either for all BOL (m_useAllBOLTwin = true) _OR_ only for two chambers really installed
530  if ((m_useAllBOLTwin && stationName == "BOL") || BOL4X13) {
531  int twin_tube = 0;
532  Identifier twin_DigitId{0};
533  double twin_sign_driftTime = 0.;
534  // twinpair is connected via a HV-jumper with a delay of ~6ns
535  constexpr double HV_delay = 6.;
536  double twin_tubeLength{0.}, twin_geo_pos_along_wire{0.},
537  twin_sign_pos_along_wire{0.}, twin_sign{-1.};
538 
539  // twinpair is interconnected with one tube in between, so modulo 4 they are identical
540  if (tube % 4 == 1 || tube % 4 == 2)
541  twin_tube = tube + 2;
542  else if (tube % 4 == 0 || tube % 4 == 3)
543  twin_tube = tube - 2;
544  // construct Atlas identifier from components for the twin
545  twin_DigitId = m_idHelperSvc->mdtIdHelper().channelID(stationName, stationEta, stationPhi, multilayer, layer, twin_tube);
546  // get twin tube length for propagation delay
547  twin_tubeLength = element->tubeLength(twin_DigitId);
548 
549  // prop delay calculated with respect to the center of the tube
550  if (distRO < 0.) twin_sign = 1.;
551  twin_geo_pos_along_wire = hit.localPosition().z();
552  if (m_useDeformations) { twin_geo_pos_along_wire = newSimhit.localPosition().z(); }
553  twin_sign_pos_along_wire = twin_sign * twin_geo_pos_along_wire;
554  double twin_propagation_delay = twin_sign * (1. / m_signalSpeed) * twin_geo_pos_along_wire;
555 
556  // calculate drift-time for twin from prompt driftTime + propagation delay + length of tube + hv-delay
557  // ( -2* for propagation_delay, cause prop_delay already in driftTime)
558  twin_sign_driftTime = driftTime + twin_tubeLength / m_signalSpeed - 2 * twin_propagation_delay + HV_delay;
559 
560  // smear the twin time by a gaussian with a stDev given by m_resTwin
561  double rand = CLHEP::RandGaussZiggurat::shoot(twinRndmEngine, twin_sign_driftTime, m_resTwin);
562  twin_sign_driftTime = rand;
563 
564  ATH_MSG_DEBUG(" TWIN TUBE stname " << stationName << " steta " << stationEta << " stphi " << stationPhi << " mLayer "
565  << multilayer << " layer " << layer << " tube " << tube
566  << " signed position along wire = " << twin_sign_pos_along_wire
567  << " propagation delay = " << twin_propagation_delay << " drifttime = " << driftTime
568  << " twin_driftTime = " << twin_sign_driftTime
569  << " TWIN time-difference = " << (twin_sign_driftTime - driftTime));
570 
571  // add twin-hit to hit collection
572  m_hits.insert(mdt_hit_info(twin_DigitId, twin_sign_driftTime, adc, driftRadius, &phit));
573 
574  } // end select all BOLs or installed chambers
575  } // end if(m_useTwin){
576  // - TWIN TUBES (A. Koutsman)
577  } else {
578  ATH_MSG_DEBUG(m_idHelperSvc->mdtIdHelper().show_to_string(DigitId) << " Tube not efficient "
579  << " radius " << driftRadius);
580  }
581 
582  return true;
583 }

◆ initialize()

StatusCode MdtDigitizationTool::initialize ( )
finaloverridevirtual

Initialize.

Reimplemented from PileUpToolBase.

Definition at line 68 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

68  {
69  ATH_MSG_INFO("Configuration MdtDigitizationTool");
70  ATH_MSG_INFO("RndmSvc " << m_rndmSvc);
71  ATH_MSG_INFO("DigitizationTool " << m_digiTool);
72  ATH_MSG_INFO("OffsetTDC " << m_offsetTDC);
73  ATH_MSG_INFO("ns2TDCAMT " << m_ns2TDCAMT);
74  ATH_MSG_INFO("ns2TDCHPTDC " << m_ns2TDCHPTDC);
75  ATH_MSG_INFO("ResolutionTDC " << m_resTDC);
76  ATH_MSG_INFO("SignalSpeed " << m_signalSpeed);
77  ATH_MSG_INFO("InputObjectName " << m_inputObjectName);
78  ATH_MSG_INFO("OutputObjectName " << m_outputObjectKey.key());
79  ATH_MSG_INFO("OutputSDOName " << m_outputSDOKey.key());
80  ATH_MSG_INFO("UseAttenuation " << m_useAttenuation);
81  ATH_MSG_INFO("UseTof " << m_useTof);
82  ATH_MSG_INFO("UseProp " << m_useProp);
83  ATH_MSG_INFO("UseWireSagGeom " << m_useWireSagGeom);
84  ATH_MSG_INFO("UseWireSagRT " << m_useWireSagRT);
85  ATH_MSG_INFO("UseDeformations " << m_useDeformations);
86  ATH_MSG_INFO("UseTimeWindow " << m_useTimeWindow);
87  ATH_MSG_INFO("BunchCountOffset " << m_bunchCountOffset);
88  ATH_MSG_INFO("MatchingWindow " << m_matchingWindow);
89  ATH_MSG_INFO("MaskWindow " << m_maskWindow);
90  ATH_MSG_INFO("DeadTime " << m_deadTime);
91  ATH_MSG_INFO("DiscardEarlyHits " << m_DiscardEarlyHits);
92  ATH_MSG_INFO("CheckSimHits " << m_checkMDTSimHits);
93  ATH_MSG_INFO("UseTwin " << m_useTwin);
94  ATH_MSG_INFO("UseAllBOLTwin " << m_useAllBOLTwin);
95  ATH_MSG_INFO("ResolutionTwinTube " << m_resTwin);
96  ATH_MSG_INFO("DoQballCharge " << m_DoQballCharge);
97  if (!m_useTof) {
98  ATH_MSG_INFO("UseCosmicsOffSet1 " << m_useOffSet1);
99  ATH_MSG_INFO("UseCosmicsOffSet2 " << m_useOffSet2);
100  }
101  ATH_MSG_INFO("IncludePileUpTruth " << m_includePileUpTruth);
102  ATH_MSG_INFO("VetoPileUpTruthLinks " << m_vetoPileUpTruthLinks);
103 
104  // initialize transient detector store and MuonGeoModel OR MuonDetDescrManager
105  if (detStore()->contains<MuonGM::MuonDetectorManager>("Muon")) {
107  ATH_MSG_DEBUG("Retrieved MuonGeoModelDetectorManager from StoreGate");
108  }
109 
110  // initialize MuonIdHelperSvc
111  ATH_CHECK(m_idHelperSvc.retrieve());
112 
113  if (m_onlyUseContainerName) { ATH_CHECK(m_mergeSvc.retrieve()); }
114 
115  // check the input object name
116  if (m_hitsContainerKey.key().empty()) {
117  ATH_MSG_FATAL("Property InputObjectName not set !");
118  return StatusCode::FAILURE;
119  }
121  ATH_MSG_DEBUG("Input objects in container : '" << m_inputObjectName << "'");
122 
123  // Initialize ReadHandleKey
124  ATH_CHECK(m_hitsContainerKey.initialize());
126 
127  // initialize the output WriteHandleKeys
129  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputObjectKey);
131  ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputSDOKey);
132  ATH_MSG_DEBUG("Output Digits: '" << m_outputObjectKey.key() << "'");
133 
134  // simulation identifier helper
135  m_muonHelper = MdtHitIdHelper::GetHelper(m_idHelperSvc->mdtIdHelper().tubeMax());
136 
137  // get the r->t conversion tool
138  ATH_CHECK(m_digiTool.retrieve());
139  ATH_MSG_DEBUG("Retrieved digitization tool!" << m_digiTool);
140 
141  ATH_CHECK(m_rndmSvc.retrieve());
143  return StatusCode::SUCCESS;
144 }

◆ insideMaskWindow()

bool MdtDigitizationTool::insideMaskWindow ( double  time) const
private

Definition at line 846 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

846  {
847  if (m_useTimeWindow)
848  if (time < static_cast<double>(m_bunchCountOffset) - m_maskWindow || time > m_bunchCountOffset) {
849  ATH_MSG_VERBOSE("hit outside MaskWindow " << time);
850  return false;
851  }
852  return true;
853 }

◆ insideMatchingWindow()

bool MdtDigitizationTool::insideMatchingWindow ( double  time) const
private

Definition at line 837 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

837  {
838  if (m_useTimeWindow)
839  if (time < m_bunchCountOffset || time > static_cast<double>(m_bunchCountOffset) + m_matchingWindow) {
840  ATH_MSG_VERBOSE("hit outside MatchingWindow " << time);
841  return false;
842  }
843  return true;
844 }

◆ mergeEvent()

StatusCode MdtDigitizationTool::mergeEvent ( const EventContext &  ctx)
finaloverride

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 246 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

246  {
247  ATH_MSG_DEBUG("MdtDigitizationTool::in mergeEvent()");
248 
249  // create and record the Digit container in StoreGate
251  ATH_CHECK(digitContainer.record(std::make_unique<MdtDigitContainer>(m_idHelperSvc->mdtIdHelper().module_hash_max())));
252  ATH_MSG_DEBUG("Recorded MdtDigitContainer called " << digitContainer.name() << " in store " << digitContainer.store());
253 
254  // create and record the SDO container in StoreGate
256  ATH_CHECK(sdoContainer.record(std::make_unique<MuonSimDataCollection>()));
257  ATH_MSG_DEBUG("Recorded MuonSimDataCollection called " << sdoContainer.name() << " in store " << sdoContainer.store());
258 
259  Collections_t collections;
260  StatusCode status = doDigitization(ctx, collections, sdoContainer.ptr());
261  if (status.isFailure()) { ATH_MSG_ERROR("doDigitization Failed"); }
262 
263  for (size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
264  if (collections[coll_hash]) {
265  ATH_CHECK( digitContainer->addCollection (collections[coll_hash].release(), coll_hash) );
266  }
267  }
268 
269  // Clean-up
272  while (MDTHitColl != MDTHitCollEnd) {
273  delete (*MDTHitColl);
274  ++MDTHitColl;
275  }
276  m_MDTHitCollList.clear();
277 
278  return status;
279 }

◆ minimumTof()

double MdtDigitizationTool::minimumTof ( Identifier  DigitId,
const MuonGM::MuonDetectorManager detMgr 
) const
private

Definition at line 820 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

820  {
821  if (!m_useTof) return 0.;
822 
823  // get distance to vertex for tof correction before applying the time window
824  double distanceToVertex(0.);
825  const MuonGM::MdtReadoutElement* element = detMgr->getMdtReadoutElement(DigitId);
826 
827  if (!element) {
828  ATH_MSG_ERROR("MuonGeoManager does not return valid element for given id!");
829  } else {
830  distanceToVertex = element->tubePos(DigitId).mag();
831  }
832  // what about this? does this also need to be 1/m_signalSpeed ?
833  ATH_MSG_DEBUG("minimumTof calculated " << distanceToVertex * s_inv_c_light);
834  return distanceToVertex * s_inv_c_light;
835 }

◆ prepareEvent()

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

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

Not able to access SubEvents

Definition at line 146 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

146  {
147  ATH_MSG_DEBUG("MdtDigitizationTool::prepareEvent() called for " << nInputEvents << " input events");
148 
149  m_MDTHitCollList.clear();
150  m_thpcMDT = std::make_unique<TimedHitCollection<MDTSimHit>>();
151 
152  return StatusCode::SUCCESS;
153 }

◆ processAllSubEvents() [1/2]

StatusCode MdtDigitizationTool::processAllSubEvents ( const EventContext &  ctx)
finaloverridevirtual

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

Reimplemented from PileUpToolBase.

Definition at line 281 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

281  {
282  ATH_MSG_DEBUG("MdtDigitizationTool::processAllSubEvents()");
283 
284  // create and record the Digit container in StoreGate
286  ATH_CHECK(digitContainer.record(std::make_unique<MdtDigitContainer>(m_idHelperSvc->mdtIdHelper().module_hash_max())));
287  ATH_MSG_DEBUG("Recorded MdtDigitContainer called " << digitContainer.name() << " in store " << digitContainer.store());
288 
289  // create and record the SDO container in StoreGate
291  ATH_CHECK(sdoContainer.record(std::make_unique<MuonSimDataCollection>()));
292  ATH_MSG_DEBUG("Recorded MuonSimDataCollection called " << sdoContainer.name() << " in store " << sdoContainer.store());
293 
294  StatusCode status = StatusCode::SUCCESS;
295  if (!m_thpcMDT) {
296  status = getNextEvent(ctx);
297  if (StatusCode::FAILURE == status) {
298  ATH_MSG_INFO("There are no MDT hits in this event");
299  return status;
300  }
301  }
302 
303  Collections_t collections;
304  ATH_CHECK(doDigitization(ctx, collections, sdoContainer.ptr()));
305 
306  for (size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
307  if (collections[coll_hash]) {
308  ATH_CHECK( digitContainer->addCollection (collections[coll_hash].release(), coll_hash) );
309  }
310  }
311 
312  return status;
313 }

◆ processAllSubEvents() [2/2]

virtual StatusCode IPileUpTool::processAllSubEvents
inherited

dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.

◆ processBunchXing()

StatusCode MdtDigitizationTool::processBunchXing ( int  bunchXing,
SubEventIterator  bSubEvents,
SubEventIterator  eSubEvents 
)
finaloverridevirtual

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 155 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx.

155  {
156  ATH_MSG_DEBUG("MdtDigitizationTool::processBunchXing() " << bunchXing);
157 
159  TimedHitCollList hitCollList;
160 
161  if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputObjectName, hitCollList, bunchXing, bSubEvents, eSubEvents).isSuccess()) &&
162  hitCollList.empty()) {
163  ATH_MSG_ERROR("Could not fill TimedHitCollList");
164  return StatusCode::FAILURE;
165  } else {
166  ATH_MSG_VERBOSE(hitCollList.size() << " MDTSimHitCollection with key " << m_inputObjectName << " found");
167  }
168 
169  TimedHitCollList::iterator iColl(hitCollList.begin());
170  TimedHitCollList::iterator endColl(hitCollList.end());
171 
172  // Iterating over the list of collections
173  for (; iColl != endColl; ++iColl) {
174  MDTSimHitCollection* hitCollPtr = new MDTSimHitCollection(*iColl->second);
175  PileUpTimeEventIndex timeIndex(iColl->first);
176 
177  ATH_MSG_DEBUG("MDTSimHitCollection found with " << hitCollPtr->size() << " hits");
178  ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time() << " index: " << timeIndex.index() << " type: " << timeIndex.type());
179 
180  m_thpcMDT->insert(timeIndex, hitCollPtr);
181  m_MDTHitCollList.push_back(hitCollPtr);
182  }
183 
184  return StatusCode::SUCCESS;
185 }

◆ 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; }

◆ 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  }

Member Data Documentation

◆ m_bunchCountOffset

Gaudi::Property<double> MdtDigitizationTool::m_bunchCountOffset {this, "BunchCountOffset", -200., "Bunch crossing offset"}
private

◆ m_calibDbKey

SG::ReadCondHandleKey<MuonCalib::MdtCalibDataContainer> MdtDigitizationTool::m_calibDbKey
protected
Initial value:
{this, "CalibDataKey", "MdtCalibConstants",
"Conditions object containing the calibrations"}

Definition at line 225 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h.

◆ m_checkMDTSimHits

Gaudi::Property<bool> MdtDigitizationTool::m_checkMDTSimHits {this, "CheckSimHits", true, "Control on the hit validity"}
private

◆ m_deadTime

Gaudi::Property<double> MdtDigitizationTool::m_deadTime {this, "DeadTime", 700., "MDT drift tube dead time"}
private

◆ m_digiTool

ToolHandle<IMDT_DigitizationTool> MdtDigitizationTool::m_digiTool
private
Initial value:
{this, "DigitizationTool", "MDT_Response_DigiTool",
"Tool which handle the digitization process"}

Definition at line 150 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h.

◆ m_DiscardEarlyHits

Gaudi::Property<bool> MdtDigitizationTool::m_DiscardEarlyHits {this, "DiscardEarlyHits", true, ""}
private

◆ m_DoQballCharge

Gaudi::Property<bool> MdtDigitizationTool::m_DoQballCharge {this, "DoQballCharge", false, "dEdx for Qballs with account of electric charge"}
private

◆ m_filterPassed

bool PileUpToolBase::m_filterPassed {true}
protectedinherited

Definition at line 60 of file PileUpToolBase.h.

◆ 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.

◆ m_hits

MDT_SortedHitVector MdtDigitizationTool::m_hits
private

◆ m_hitsContainerKey

SG::ReadHandleKey<MDTSimHitCollection> MdtDigitizationTool::m_hitsContainerKey {this, "InputObjectName", "MDT_Hits", ""}
protected

◆ m_idHelperSvc

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

◆ m_includePileUpTruth

Gaudi::Property<bool> MdtDigitizationTool::m_includePileUpTruth {this, "IncludePileUpTruth", true, "Include pile-up truth info"}
private

◆ m_inputObjectName

std::string MdtDigitizationTool::m_inputObjectName {""}
protected

◆ 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.

◆ m_maskWindow

Gaudi::Property<double> MdtDigitizationTool::m_maskWindow {this, "MaskWindow", 250., "Masked window"}
private

◆ m_matchingWindow

Gaudi::Property<double> MdtDigitizationTool::m_matchingWindow {this, "MatchingWindow", 1000., "Matching window"}
private

◆ m_MDTHitCollList

std::vector<MDTSimHitCollection*> MdtDigitizationTool::m_MDTHitCollList
private

◆ m_mergeSvc

ServiceHandle<PileUpMergeSvc> MdtDigitizationTool::m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""}
protected

◆ m_MuonGeoMgr

const MuonGM::MuonDetectorManager* MdtDigitizationTool::m_MuonGeoMgr {}
private

◆ m_muonHelper

const MdtHitIdHelper* MdtDigitizationTool::m_muonHelper {}
private

◆ m_ns2TDCAMT

Gaudi::Property<double> MdtDigitizationTool::m_ns2TDCAMT {this, "ns2TDCAMT", 0.78125, "Conversion factor TDC/ns for AMT chips"}
private

◆ m_ns2TDCHPTDC

Gaudi::Property<double> MdtDigitizationTool::m_ns2TDCHPTDC {this, "ns2TDCHPTDC", 0.1953125, "Conversion factor TDC/ns for HPTDC chips"}
private

◆ m_offsetTDC

Gaudi::Property<double> MdtDigitizationTool::m_offsetTDC {this, "OffsetTDC", 800., "TDC offset used if no calibration data is found"}
private

◆ m_onlyUseContainerName

BooleanProperty MdtDigitizationTool::m_onlyUseContainerName
protected
Initial value:
{this, "OnlyUseContainerName", true,
"Don't use the ReadHandleKey directly. Just extract the container name from it."}

Definition at line 214 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h.

◆ m_outputObjectKey

SG::WriteHandleKey<MdtDigitContainer> MdtDigitizationTool::m_outputObjectKey
protected
Initial value:
{this, "OutputObjectName", "MDT_DIGITS",
"WriteHandleKey for Output MdtDigitContainer"}

Definition at line 218 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h.

◆ m_outputSDOKey

SG::WriteHandleKey<MuonSimDataCollection> MdtDigitizationTool::m_outputSDOKey
protected
Initial value:
{this, "OutputSDOName", "MDT_SDO",
"WriteHandleKey for Output MuonSimDataCollection"}

Definition at line 220 of file MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h.

◆ m_readKey

SG::ReadCondHandleKey<MdtCondDbData> MdtDigitizationTool::m_readKey {this, "ReadKey", "MdtCondDbData", "Key of MdtCondDbData"}
protected

◆ m_resTDC

Gaudi::Property<double> MdtDigitizationTool::m_resTDC {this, "ResolutionTDC", 0.5, "TDC resolution"}
private

◆ m_resTwin

Gaudi::Property<double> MdtDigitizationTool::m_resTwin {this, "ResolutionTwinTube", 1.05, "Twin Tube resolution"}
private

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> MdtDigitizationTool::m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""}
protected

◆ m_signalSpeed

Gaudi::Property<double> MdtDigitizationTool::m_signalSpeed {this, "SignalSpeed", 0.85*Gaudi::Units::c_light}
private

◆ m_t0ShiftTuning

Gaudi::Property<double> MdtDigitizationTool::m_t0ShiftTuning {this,"TunedT0Shift",-17.,"Fine tuned t0 shift value in ns"}
private

◆ m_thpcMDT

std::unique_ptr<TimedHitCollection<MDTSimHit> > MdtDigitizationTool::m_thpcMDT {}
private

◆ m_useAllBOLTwin

Gaudi::Property<bool> MdtDigitizationTool::m_useAllBOLTwin {this, "UseAllBOLTwin", false, ""}
private

◆ m_useAttenuation

Gaudi::Property<bool> MdtDigitizationTool::m_useAttenuation {this, "UseAttenuation", false, ""}
private

◆ m_useDeformations

Gaudi::Property<bool> MdtDigitizationTool::m_useDeformations {this, "UseDeformations", false, ""}
private

◆ m_useOffSet1

Gaudi::Property<bool> MdtDigitizationTool::m_useOffSet1 {this, "UseOffSet1", true, ""}
private

◆ m_useOffSet2

Gaudi::Property<bool> MdtDigitizationTool::m_useOffSet2 {this, "UseOffSet2", true, ""}
private

◆ m_useProp

Gaudi::Property<bool> MdtDigitizationTool::m_useProp {this, "UseProp", true, ""}
private

◆ m_useTimeWindow

Gaudi::Property<bool> MdtDigitizationTool::m_useTimeWindow {this, "UseTimeWindow", true, ""}
private

◆ m_useTof

Gaudi::Property<bool> MdtDigitizationTool::m_useTof {this, "UseTof", true, "Option for the tof calculation"}
private

◆ m_useTwin

Gaudi::Property<bool> MdtDigitizationTool::m_useTwin {this, "UseTwin", false, ""}
private

◆ m_useWireSagGeom

Gaudi::Property<bool> MdtDigitizationTool::m_useWireSagGeom {this, "UseWireSagGeom", false, "Option for the wire sagitta correction"}
private

◆ m_useWireSagRT

Gaudi::Property<bool> MdtDigitizationTool::m_useWireSagRT {this, "UseWireSagRT", false, "Option for the wire sagitta correction"}
private

◆ 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.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MdtHitIdHelper::GetMultiLayer
int GetMultiLayer(const int &hid) const
Definition: MdtHitIdHelper.cxx:79
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib::t0
float t0
< relative t0 in chamber (ns)
Definition: MdtTubeCalibContainer.h:20
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
MdtDigitizationTool::m_bunchCountOffset
Gaudi::Property< double > m_bunchCountOffset
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:180
MdtDigitizationTool::m_ns2TDCAMT
Gaudi::Property< double > m_ns2TDCAMT
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:158
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:129
MdtDigiToolInput
Definition: MdtDigiToolInput.h:26
MuonSimData::Deposit
std::pair< HepMcParticleLink, MuonMCData > Deposit
Definition: MuonSimData.h:66
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
MdtDigitizationTool::getRandomEngine
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:239
get_generator_info.result
result
Definition: get_generator_info.py:21
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trk::SaggedLineSurface::correctedSurface
virtual StraightLineSurface * correctedSurface(const Amg::Vector2D &lp) const override final
Get the NEW corrected surface - this is a factory (the user has to delete the surface)
Definition: SaggedLineSurface.cxx:86
MuonGM::MdtReadoutElement::tubeLength
double tubeLength(const int tubeLayer, const int tube) const
MdtDigitizationTool::insideMaskWindow
bool insideMaskWindow(double time) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:846
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
PileUpToolBase::m_filterPassed
bool m_filterPassed
Definition: PileUpToolBase.h:60
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
MdtDigitizationTool::m_useWireSagRT
Gaudi::Property< bool > m_useWireSagRT
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:171
MDTSimHit::localPosition
const Amg::Vector3D & localPosition() const
Definition: MDTSimHit.h:54
MuonGM::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
MdtDigitizationTool::m_outputSDOKey
SG::WriteHandleKey< MuonSimDataCollection > m_outputSDOKey
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:220
particleGamma
double particleGamma(const EventContext &ctx, const MDTSimHit &hit, unsigned short eventId=0)
Definition: particleGamma.h:36
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
MdtDigitizationTool::m_t0ShiftTuning
Gaudi::Property< double > m_t0ShiftTuning
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:161
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MdtDigit
Definition: MdtDigit.h:19
MDTSimHit
Definition: MDTSimHit.h:21
MdtDigitizationTool::m_useAllBOLTwin
Gaudi::Property< bool > m_useAllBOLTwin
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:175
MdtDigitizationTool::m_maskWindow
Gaudi::Property< double > m_maskWindow
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:182
MdtDigitizationTool::m_signalSpeed
Gaudi::Property< double > m_signalSpeed
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:156
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
AtlasHitsVector
Definition: AtlasHitsVector.h:33
chargeCalculator
double chargeCalculator(const EventContext &ctx, const MDTSimHit &hit, unsigned short eventId=0)
Definition: chargeCalculator.h:30
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MDTSimHitCollection
AtlasHitsVector< MDTSimHit > MDTSimHitCollection
Definition: MDTSimHitCollection.h:14
MDT_SortedHitVector::sort
void sort()
Definition: MDT_SortedHitVector.h:43
MuonGM::MdtReadoutElement::nodeform_localToGlobalTransf
Amg::Transform3D nodeform_localToGlobalTransf(const Identifier &id) const
MdtDigitizationTool::m_digiTool
ToolHandle< IMDT_DigitizationTool > m_digiTool
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:150
IdContext::end_index
size_type end_index(void) const
Definition: IdContext.h:106
MuonGM::MdtReadoutElement::barrel
bool barrel() const
Returns whether the chamber is in the barrel (Assement on first later in stationName)
MdtHitIdHelper::GetZSector
int GetZSector(const int &hid) const
Definition: MdtHitIdHelper.cxx:73
TimedHitPtr< MDTSimHit >
Trk::locR
@ locR
Definition: ParamDefs.h:50
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
MdtDigitizationTool::minimumTof
double minimumTof(Identifier DigitId, const MuonGM::MuonDetectorManager *detMgr) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:820
MdtHitIdHelper::GetHelper
static const MdtHitIdHelper * GetHelper(unsigned int nTubes=78)
Definition: MdtHitIdHelper.cxx:24
PileUpToolBase::m_lastXing
Gaudi::Property< int > m_lastXing
Definition: PileUpToolBase.h:56
MdtDigitizationTool::m_matchingWindow
Gaudi::Property< double > m_matchingWindow
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:181
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
HepMC::ignoreTruthLink
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
Definition: MagicNumbers.h:296
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
MdtDigitizationTool::m_deadTime
Gaudi::Property< double > m_deadTime
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:183
MdtDigitizationTool::applyDeformations
static MDTSimHit applyDeformations(const MDTSimHit &, const MuonGM::MdtReadoutElement *, const Identifier &)
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:856
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
PileUpToolBase::m_vetoPileUpTruthLinks
Gaudi::Property< int > m_vetoPileUpTruthLinks
Definition: PileUpToolBase.h:58
MdtDigitizationTool::m_useProp
Gaudi::Property< bool > m_useProp
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:167
MdtDigitizationTool::getNextEvent
StatusCode getNextEvent(const EventContext &ctx)
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:187
MdtDigiToolOutput
Definition: MdtDigiToolOutput.h:19
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
MuonGM::MdtReadoutElement::globalToLocalTransf
Amg::Transform3D globalToLocalTransf(const int tubeLayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:400
MdtDigitizationTool::m_useTof
Gaudi::Property< bool > m_useTof
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:165
Trk::StraightLineSurface::globalToLocal
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for StraightLineSurface: GlobalToLocal method without dynamic memory allocation This method...
Definition: StraightLineSurface.cxx:164
MdtHitIdHelper::GetPhiSector
int GetPhiSector(const int &hid) const
Definition: MdtHitIdHelper.cxx:68
MdtDigitizationTool::m_checkMDTSimHits
Gaudi::Property< bool > m_checkMDTSimHits
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:164
MdtDigitizationTool::m_offsetTDC
Gaudi::Property< double > m_offsetTDC
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:155
MdtHitIdHelper::GetStationName
std::string GetStationName(const int &hid) const
Definition: MdtHitIdHelper.cxx:57
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MdtDigitizationTool::m_DoQballCharge
Gaudi::Property< bool > m_DoQballCharge
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:195
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
MdtDigitizationTool::insideMatchingWindow
bool insideMatchingWindow(double time) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:837
TRT::Hit::driftTime
@ driftTime
Definition: HitInfo.h:43
MdtDigitizationTool::m_MDTHitCollList
std::vector< MDTSimHitCollection * > m_MDTHitCollList
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:152
MuonGM::MuonDetectorManager::getMdtReadoutElement
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:204
MdtDigitizationTool::m_inputObjectName
std::string m_inputObjectName
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:217
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
MdtDigitizationTool::m_resTDC
Gaudi::Property< double > m_resTDC
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:160
MdtDigitizationTool::m_useWireSagGeom
Gaudi::Property< bool > m_useWireSagGeom
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:170
lumiFormat.i
int i
Definition: lumiFormat.py:92
MdtDigitizationTool::m_calibDbKey
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_calibDbKey
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:225
MdtDigitizationTool::m_MuonGeoMgr
const MuonGM::MuonDetectorManager * m_MuonGeoMgr
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:148
MdtDigitizationTool::m_resTwin
Gaudi::Property< double > m_resTwin
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:176
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Trk::driftRadius
@ driftRadius
trt, straws
Definition: ParamDefs.h:59
MdtDigitizationTool::m_useOffSet2
Gaudi::Property< bool > m_useOffSet2
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:188
MdtDigitizationTool::m_outputObjectKey
SG::WriteHandleKey< MdtDigitContainer > m_outputObjectKey
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:218
MdtDigitizationTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:213
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MdtDigitizationTool::m_useTimeWindow
Gaudi::Property< bool > m_useTimeWindow
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:179
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
MdtDigitizationTool::m_useAttenuation
Gaudi::Property< bool > m_useAttenuation
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:166
MdtDigitizationTool::m_useDeformations
Gaudi::Property< bool > m_useDeformations
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:192
PileUpToolBase::PileUpToolBase
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PileUpToolBase.cxx:7
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MdtDigitizationTool::m_thpcMDT
std::unique_ptr< TimedHitCollection< MDTSimHit > > m_thpcMDT
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:198
MdtHitIdHelper::GetLayer
int GetLayer(const int &hid) const
Definition: MdtHitIdHelper.cxx:84
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
MdtDigitizationTool::m_readKey
SG::ReadCondHandleKey< MdtCondDbData > m_readKey
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:228
MuonGM::MdtReadoutElement::localToGlobalTransf
const Amg::Transform3D & localToGlobalTransf(const Identifier &id) const
MdtDigitizationTool::correctGeometricalWireSag
GeoCorOut correctGeometricalWireSag(const MDTSimHit &hit, const Identifier &id, const MuonGM::MdtReadoutElement *element) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:868
Identifier::show
void show() const
Print out in hex form.
Definition: Identifier.cxx:36
MDTSimHit::globalTime
double globalTime() const
Definition: MDTSimHit.h:48
mdt_hit_info
Definition: MDT_SortedHitVector.h:8
MDTSimHit::MDTid
HitID MDTid() const
Definition: MDTSimHit.h:62
IdContext::begin_index
size_type begin_index(void) const
Definition: IdContext.h:100
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MdtDigitizationTool::m_includePileUpTruth
Gaudi::Property< bool > m_includePileUpTruth
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:201
MdtDigitizationTool::m_onlyUseContainerName
BooleanProperty m_onlyUseContainerName
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:214
MDTSimHit::driftRadius
double driftRadius() const
Definition: MDTSimHit.h:51
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
MdtDigitCollection
Definition: MdtDigitCollection.h:18
MdtDigitizationTool::digitizeTime
int digitizeTime(double time, bool isHPTDC, CLHEP::HepRandomEngine *rndmEngine) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:812
charge
double charge(const T &p)
Definition: AtlasPID.h:494
MdtDigitizationTool::m_hitsContainerKey
SG::ReadHandleKey< MDTSimHitCollection > m_hitsContainerKey
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:216
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
MuonSimData
Definition: MuonSimData.h:62
HitIt
HitVector::iterator HitIt
Definition: MDT_SortedHitVector.h:31
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
MdtDigitizationTool::checkMDTSimHit
bool checkMDTSimHit(const EventContext &ctx, const MDTSimHit &hit) const
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:585
MdtDigitizationTool::m_useOffSet1
Gaudi::Property< bool > m_useOffSet1
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:187
MdtDigitizationTool::doDigitization
StatusCode doDigitization(const EventContext &ctx, Collections_t &collections, MuonSimDataCollection *sdoContainer)
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:315
MdtDigitizationTool::m_useTwin
Gaudi::Property< bool > m_useTwin
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:174
MdtDigitizationTool::m_hits
MDT_SortedHitVector m_hits
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:141
MuonGM::MdtReadoutElement::tubeFrame_localROPos
Amg::Vector3D tubeFrame_localROPos(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:282
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
MdtDigitizationTool::m_DiscardEarlyHits
Gaudi::Property< bool > m_DiscardEarlyHits
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:184
MdtDigitizationTool::handleMDTSimHit
bool handleMDTSimHit(const EventContext &ctx, const TimedHitPtr< MDTSimHit > &phit, CLHEP::HepRandomEngine *twinRndmEngine, CLHEP::HepRandomEngine *toolRndmEngine)
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:352
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
MuonGM::MdtReadoutElement::tubePos
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
MdtDigitizationTool::m_ns2TDCHPTDC
Gaudi::Property< double > m_ns2TDCHPTDC
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:159
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
TimedHitPtr::eventId
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
Definition: TimedHitPtr.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MdtDigitizationTool::createDigits
bool createDigits(const EventContext &ctx, Collections_t &collections, MuonSimDataCollection *sdoContainer, CLHEP::HepRandomEngine *rndmEngine)
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:646
PileUpToolBase::m_firstXing
Gaudi::Property< int > m_firstXing
Definition: PileUpToolBase.h:54
MdtDigitizationTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:143
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:875
MdtHitIdHelper::GetTube
int GetTube(const int &hid) const
Definition: MdtHitIdHelper.cxx:89
Trk::SaggedLineSurface
Definition: SaggedLineSurface.h:35
AtlasHitsVector::size
size_type size() const
Definition: AtlasHitsVector.h:143
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:18
merge.status
status
Definition: merge.py:17
MdtDigitizationTool::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:223
MDT_SortedHitVector::insert
void insert(const mdt_hit_info &hit)
Definition: MDT_SortedHitVector.h:47
hitTime
float hitTime(const AFP_SIDSimHit &hit)
Definition: AFP_SIDSimHit.h:39
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
IdentifierHash
Definition: IdentifierHash.h:38
PileUpTimeEventIndex
a struct encapsulating the identifier of a pile-up event
Definition: PileUpTimeEventIndex.h:12
IdContext
class IdContext
Definition: IdContext.h:34
TimedHitCollection
Definition: TimedHitCollection.h:15
MdtDigitizationTool::m_muonHelper
const MdtHitIdHelper * m_muonHelper
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:144
calibdata.tube
tube
Definition: calibdata.py:31
MdtDigitizationTool::getDigitCollection
MdtDigitCollection * getDigitCollection(Identifier elementId, Collections_t &collections)
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.cxx:791
MuonMCData
Definition: MuonSimData.h:42
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
MdtDigitizationTool::Collections_t
std::vector< std::unique_ptr< MdtDigitCollection > > Collections_t
Definition: MuonDigitization/MDT_Digitization/src/MdtDigitizationTool.h:125