|
ATLAS Offline Software
|
#include <MM_DigitizationTool.h>
|
StatusCode | digitize (const EventContext &ctx, const TimedHits &hitsToDigit, xAOD::MuonSimHitContainer *sdoContainer) const override final |
| Digitize the time ordered hits and write them to the digit format specific for the detector technology. More...
|
|
CLHEP::HepRandomEngine * | getRandomEngine (const EventContext &ctx) const |
|
xAOD::MuonSimHit * | addSDO (const TimedHit &hit, xAOD::MuonSimHitContainer *sdoContainer) const |
| Adds the timed simHit to the output SDO container. More...
|
|
const ActsGeometryContext & | getGeoCtx (const EventContext &ctx) const |
| Returns the reference to the ActsGeometryContext needed to fetch global positions from the Readout geometry. More...
|
|
template<class Container > |
StatusCode | retrieveContainer (const EventContext &ctx, const SG::ReadHandleKey< Container > &key, const Container *&contPtr) const |
| Helper function to retrieve a container from StoreGate. More...
|
|
template<class Container > |
StatusCode | retrieveConditions (const EventContext &ctx, const SG::ReadCondHandleKey< Container > &key, const Container *&contPtr) const |
| Helper function to access the conditions data. More...
|
|
template<class DigitColl > |
DigitColl * | fetchCollection (const Identifier &hitId, OutDigitCache_t< DigitColl > &digitCache) const |
| Helper function that provides fetches the proper DigitCollection from the DigitCache for a given hit identifier If the Collection is fetched for the first time, it's inserted into the cache first. More...
|
|
template<class DigitCont , class DigitColl > |
StatusCode | writeDigitContainer (const EventContext &ctx, const SG::WriteHandleKey< DigitCont > &key, OutDigitCache_t< DigitColl > &&digitCache, unsigned int hashMax) const |
| Helper function to move the collected digits into the final DigitContainer. More...
|
|
|
SG::WriteHandleKey< MmDigitContainer > | m_writeKey {this, "OutputObjectName", "MM_DIGITS"} |
|
SG::ReadCondHandleKey< Muon::DigitEffiData > | m_effiDataKey {this, "EffiDataKey", "MmDigitEff", "Efficiency constants of the individual MM gasGaps"} |
|
SG::ReadCondHandleKey< NswErrorCalibData > | m_uncertCalibKey {this, "ErrorCalibKey", "NswUncertData", "Key of the parametrized NSW uncertainties"} |
|
SG::ReadCondHandleKey< NswCalibDbThresholdData > | m_condThrshldsKey |
|
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > | m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj"} |
|
ToolHandle< Muon::INSWCalibSmearingTool > | m_smearingTool {this, "SmearingTool", "Muon::NSWCalibSmearingTool/MMCalibSmearingTool"} |
|
ToolHandle< Muon::INSWCalibTool > | m_calibrationTool {this, "CalibrationTool", "Muon::NSWCalibTool/NSWCalibTool"} |
|
Gaudi::Property< bool > | m_digitizeMuonOnly {this, "ProcessTrueMuonsOnly", true, "If set to true hit with pdgId != 13 are skipped"} |
|
Gaudi::Property< std::string > | m_vmmReadoutMode {this, "vmmReadoutMode", "peak", "For readout (DAQ) path. Can be peak or threshold"} |
|
Gaudi::Property< std::string > | m_vmmARTMode {this, "vmmARTMode", "threshold", "For ART (trigger) path. Can be peak or threshold"} |
|
Gaudi::Property< double > | m_energyThreshold {this, "EnergyThreshold", 50, "Minimal energy to process an electron sim hit"} |
|
Gaudi::Property< double > | m_timeWindowLowerOffset |
|
Gaudi::Property< double > | m_timeWindowUpperOffset |
|
Gaudi::Property< double > | m_DiffMagSecondMuonHit {this, "DiffMagSecondMuonHit", 0.1} |
|
Gaudi::Property< int > | m_maskMultiplet {this, "MaskMultiplet", 0, "0: all, 1: first, 2: second, 3: both"} |
|
Gaudi::Property< bool > | m_writeOutputFile {this, "SaveInternalHistos", false} |
|
Gaudi::Property< bool > | m_needsMcEventCollHelper {this, "UseMcEventCollectionHelper", false} |
|
Gaudi::Property< bool > | m_checkMMSimHits {this, "CheckSimHits", true, "Control on the hit validity"} |
|
Gaudi::Property< bool > | m_useTimeWindow {this, "UseTimeWindow", true} |
|
Gaudi::Property< bool > | m_vmmNeighborLogic {this, "VMMNeighborLogic", false} |
|
Gaudi::Property< bool > | m_doSmearing |
|
Gaudi::Property< float > | m_qThreshold {this, "qThreshold", 0.001, "Charge Threshold"} |
|
Gaudi::Property< float > | m_driftGapWidth {this, "DriftGapWidth", 5.04, "Drift Gap Width of 5.04 mm"} |
|
Gaudi::Property< float > | m_crossTalk1 {this, "crossTalk1", 0.3, "Strip Cross Talk with Nearest Neighbor"} |
|
Gaudi::Property< float > | m_crossTalk2 {this, "crossTalk2", 0.09, "Strip Cross Talk with 2nd Nearest Neighbor"} |
|
Gaudi::Property< float > | m_avalancheGain {this, "AvalancheGain", 6.0e3, "avalanche Gain for rach gas mixture"} |
|
Gaudi::Property< float > | m_electronicsThreshold |
|
Gaudi::Property< float > | m_stripdeadtime {this, "StripDeadTime", 200, "dead-time for strip, default value 200 ns = 8 BCs"} |
|
Gaudi::Property< float > | m_ARTdeadtime {this, "ARTDeadTime", 200, "dead-time for ART, default value 200 ns = 8 BCs"} |
|
Gaudi::Property< bool > | m_useCondThresholds |
|
Gaudi::Property< bool > | m_useThresholdScaling |
|
Gaudi::Property< float > | m_thresholdScaleFactor |
|
Gaudi::Property< float > | m_vmmDeadtime {this, "vmmDeadtime", 200, "Specifies how much before the lower time limit the VMM simulation should start evaluating the signal"} |
|
Gaudi::Property< float > | m_vmmUpperGrazeWindow {this, "vmmUpperGrazeWindow", 150, "Specifies how much above the upper time window boundary the VMM sim evaluates the signal."} |
|
Gaudi::Property< double > | m_deadTime {this, "deadTime", 300. * Gaudi::Units::ns} |
|
std::unique_ptr< MM_StripsResponseSimulation > | m_StripsResponseSimulation {} |
|
std::unique_ptr< MM_ElectronicsResponseSimulation > | m_ElectronicsResponseSimulation {} |
|
std::map< int, NoiseCalibConstants > | m_noiseParams {} |
| Define a map to cache the noise parameters individually Key: stationName * std::abs(stationEta) More...
|
|
std::array< std::atomic< unsigned >, 8 > m_allHits | ATLAS_THREAD_SAFE {} |
|
std::array< std::atomic< unsigned >, 8 > m_acceptedHits | ATLAS_THREAD_SAFE {} |
|
SG::ReadHandleKey< xAOD::MuonSimHitContainer > | m_simHitKey {this, "SimHitKey", ""} |
|
SG::ReadHandleKey< ActsGeometryContext > | m_geoCtxKey |
|
ServiceHandle< PileUpMergeSvc > | m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", ""} |
|
Gaudi::Property< std::string > | m_streamName {this, "StreamName", ""} |
|
ServiceHandle< IAthRNGSvc > | m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""} |
|
SG::WriteHandleKey< xAOD::MuonSimHitContainer > | m_sdoKey {this, "OutputSDOName", ""} |
|
Gaudi::Property< bool > | m_onlyUseContainerName |
|
Gaudi::Property< bool > | m_includePileUpTruth {this, "IncludePileUpTruth", true, "Include pile-up truth info"} |
|
std::string | m_inputObjectName {""} |
|
TimedHits | m_timedHits {} |
|
std::vector< SimHitLocalCopy > | m_simHits {} |
|
◆ DeadTimeMap
◆ DigiCache
◆ NoiseCalibConstants
◆ OutDigitCache_t
DigitContainers are sorted by DigitCollections which are the ensemble of all hits in a given MuonChamber.
To fill the final DigitContainer thread-safely, the DigitCollections shall be cached pre cached in a OutDigitCache_t vector which is later moved to the final DigitContainer
Definition at line 109 of file MuonDigitizationTool.h.
◆ PileUpHits
◆ SimHitLocalCopy
Create a local copy of the sim hits to ensure overlayed hits across the events remain valid.
Definition at line 172 of file MuonDigitizationTool.h.
◆ TimedHit
◆ TimedHits
◆ MM_DigitizationTool()
MM_DigitizationTool::MM_DigitizationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
pIID |
|
) |
| |
◆ addSDO()
Adds the timed simHit to the output SDO container.
The hit may be rejected if it's originating from pile-up and the pile-up truth skimming strategy is applied
Definition at line 148 of file MuonDigitizationTool.cxx.
164 acc_eventTime(*sdoHit) = hit.eventTime();
165 acc_eventID(*sdoHit) = hit.eventId();
166 acc_puType(*sdoHit) = hit.pileupType();
◆ combinedStripResponseAllHits()
Definition at line 427 of file MuonPhaseII/MuonDigitization/MmDigitizationR4/src/MM_DigitizationTool.cxx.
429 const EventContext& ctx = Gaudi::Hive::currentContext();
436 if (!readThresholds.isValid()) {
ATH_MSG_ERROR(
"Cannot find conditions data container for VMM thresholds!"); }
437 thresholdData = readThresholds.cptr();
440 std::vector<int> v_stripStripResponseAllHits;
441 std::vector<std::vector<float>> v_timeStripResponseAllHits;
442 std::vector<std::vector<float>> v_qStripResponseAllHits;
443 std::vector<float> v_stripThresholdResponseAllHits;
445 Identifier digitID = v_stripDigitOutput.at(0).digitID();
446 double max_kineticEnergy = 0.0;
449 for (
auto& i_stripDigitOutput : v_stripDigitOutput) {
451 if (i_stripDigitOutput.kineticEnergy() > max_kineticEnergy) {
452 digitID = i_stripDigitOutput.digitID();
453 max_kineticEnergy = i_stripDigitOutput.kineticEnergy();
456 for (
size_t i = 0;
i < i_stripDigitOutput.NumberOfStripsPos().
size(); ++
i) {
457 int strip_id = i_stripDigitOutput.NumberOfStripsPos().at(
i);
460 for (
size_t ii = 0; ii < v_stripStripResponseAllHits.size(); ++ii) {
461 if (v_stripStripResponseAllHits.at(ii) == strip_id) {
462 for (
size_t iii = 0; iii < i_stripDigitOutput.chipTime().at(
i).
size(); ++iii) {
463 v_timeStripResponseAllHits.at(ii).push_back(i_stripDigitOutput.chipTime().at(
i).at(iii));
464 v_qStripResponseAllHits.at(ii).push_back(i_stripDigitOutput.chipCharge().at(
i).at(iii));
470 v_stripStripResponseAllHits.push_back(strip_id);
471 v_timeStripResponseAllHits.push_back(i_stripDigitOutput.chipTime().at(
i));
472 v_qStripResponseAllHits.push_back(i_stripDigitOutput.chipCharge().at(
i));
474 const Identifier id = idHelper.channelID(digitID,
475 idHelper.multilayer(digitID),
476 idHelper.gasGap(digitID), strip_id);
478 if (!thresholdData->getThreshold(
id,
threshold))
479 ATH_MSG_ERROR(
"Cannot find retrieve VMM threshold from conditions data base!");
480 v_stripThresholdResponseAllHits.push_back(
threshold);
483 idHelper.multilayer(digitID),
484 idHelper.gasGap(digitID), strip_id);
492 v_stripThresholdResponseAllHits.push_back(
threshold);
501 v_qStripResponseAllHits,
502 v_timeStripResponseAllHits,
503 v_stripThresholdResponseAllHits,
508 return stripDigitOutputAllHits;
◆ digitize()
|
finaloverrideprotectedvirtual |
Digitize the time ordered hits and write them to the digit format specific for the detector technology.
A new MuonSimHitContainer pointer is parsed to also create the MuonSDO. If a new SDO should be added to the container plese use the addSDO() method as defined below.
Reject hit within the dead time interval
Implements MuonR4::MuonDigitizationTool.
Definition at line 187 of file MuonPhaseII/MuonDigitization/MmDigitizationR4/src/MM_DigitizationTool.cxx.
208 fieldCondObj->getInitializedCache(fieldCache);
213 std::vector<MM_ElectronicsToolInput> v_stripDigitOutput;
216 for (
const TimedHit& simHit : hitsToDigit) {
225 const double hitKineticEnergy = simHit->kineticEnergy();
237 const Amg::Vector3D locPos{xAOD::toEigen(simHit->localPosition())};
246 const double globalHitTime = simHit->globalTime();
247 const double tofCorrection = globalHitPosition.mag() /
CLHEP::c_light;
248 const double eventTime = simHit.eventTime();
249 const double bunchTime = globalHitTime - tofCorrection + eventTime;
253 ATH_MSG_DEBUG(
"hitID " << hitId <<
" Hit bunch time " << bunchTime <<
" tof/G4 hit time " << globalHitTime <<
" globalHitPosition " << globalHitPosition <<
" hit: r " << globalHitPosition.perp() <<
" z " << globalHitPosition.z() <<
" mclink " << particleLink <<
" gas gap " <<
m_idHelperSvc->toStringGasGap(hitId) <<
"Kinetic energy " << hitKineticEnergy);
262 if (inAngleCompliment_XZ < 0.0) inAngleCompliment_XZ += 180;
263 if (inAngleCompliment_YZ < 0.0) inAngleCompliment_YZ += 180;
266 double inAngle_XZ = 90. - inAngleCompliment_XZ;
267 double inAngle_YZ = 90. - inAngleCompliment_YZ;
270 int readoutSide = readOutEle->
readoutSide(measHash);
271 if (readoutSide == 1) {
272 inAngle_XZ = (-inAngle_XZ);
276 int gasGap = idHelper.gasGap(hitId);
280 std::optional<double> lambda;
282 lambda = Amg::intersect<3>(locPos,
locDir, Amg::Vector3D::UnitZ(), -shift);
284 lambda = Amg::intersect<3>(locPos,
locDir, Amg::Vector3D::UnitZ(), shift);
288 Amg::Vector2D positionOnSurface{hitOnSurface.x(), hitOnSurface.y()};
292 Amg::Vector3D hitAfterTimeShift(hitOnSurface.x(), hitOnSurface.y(), shiftTimeOffset);
293 lambda = Amg::intersect<3>(hitAfterTimeShift,
locDir, Amg::Vector3D::UnitZ(), -shiftTimeOffset);
294 Amg::Vector3D hitAfterTimeShiftOnSurface = hitAfterTimeShift + lambda.value_or(0.) *
locDir;
296 if (std::abs(hitAfterTimeShiftOnSurface.z()) > 0.1){
297 ATH_MSG_WARNING(
"Bad propagation to surface after time shift " << hitAfterTimeShiftOnSurface);
301 const unsigned int hitGapInNsw = (idHelper.multilayer(hitId) -1) * 4 + idHelper.gasGap(hitId) -1;
302 ++m_allHits[hitGapInNsw];
306 int channelNumber = design.stripNumber(positionOnSurface);
310 if (!design.insideTrapezoid(positionOnSurface)) {
312 <<
" is outside bounds "<<std::endl<<design<<
" rejecting it");
317 idHelper.multilayer(hitId),
318 idHelper.gasGap(hitId),
323 <<
" channel " << channelNumber <<
" positionOnSurface " <<
Amg::toString(positionOnSurface));
327 if(efficiencyMap && efficiencyMap->getEfficiency(clusId) < CLHEP::RandFlat::shoot(rndEngine, 0., 1.)){
336 double distToStrip = design.distanceToStrip(positionOnSurface, channelNumber);
339 Amg::Vector3D hitOnSurfaceGlobal{locToGlobal * hitOnSurface};
341 fieldCache.
getField(hitOnSurfaceGlobal.data(), magneticField.data());
344 Amg::Vector3D localMagneticField{ locToGlobal.linear().inverse() * magneticField };
345 if (readoutSide == -1) {localMagneticField[
Amg::y] = -localMagneticField[
Amg::y];}
348 const MM_DigitToolInput stripDigitInput(channelNumber, distToStrip, inAngle_XZ, inAngle_YZ, localMagneticField,
349 design.firstStripNumber(),
350 design.numStrips() + design.firstStripNumber() - 1,
351 idHelper.gasGap(hitId), eventTime + globalHitTime);
353 double stripPitch = design.stripPitch();
355 double gainFraction = 1.0;
365 v_stripDigitOutput.push_back(stripDigitOutput);
367 addSDO(simHit, sdoContainer);
368 ++m_acceptedHits[hitGapInNsw];
372 if (v_stripDigitOutput.empty()) {
373 ATH_MSG_DEBUG(
"MM_DigitizationTool::doDigitization() -- there is no strip response on this VMM.");
384 <<
" is not a MM Identifier, skipping");
392 if (!electronicsOutputForReadout.isValid()) {
394 " there is no electronics response (peak or threshold finding mode) even though there is a strip response.");
397 for (
unsigned int firedCh = 0; firedCh < electronicsOutputForReadout.stripPos().
size(); ++firedCh) {
399 const int channel = electronicsOutputForReadout.stripPos()[firedCh];
400 double time = electronicsOutputForReadout.stripTime()[firedCh];
401 double charge = electronicsOutputForReadout.stripCharge()[firedCh];
404 idHelper.multilayer(stripDigitOutputAllHits.
digitID()),
405 idHelper.gasGap(stripDigitOutputAllHits.
digitID()),
418 v_stripDigitOutput.clear();
420 }
while(viewer.next());
424 return StatusCode::SUCCESS;
◆ fetchCollection()
template<class DigitColl >
Helper function that provides fetches the proper DigitCollection from the DigitCache for a given hit identifier If the Collection is fetched for the first time, it's inserted into the cache first.
◆ fillTimedHits()
StatusCode MuonR4::MuonDigitizationTool::fillTimedHits |
( |
PileUpHits && |
hitColl, |
|
|
TimedHits & |
timedHits |
|
) |
| const |
|
privateinherited |
Translates the PileUpHits into the timed hits format.
Definition at line 50 of file MuonDigitizationTool.cxx.
51 for (
const auto& [timeIndex, simHitColl] : hitColl) {
52 timedHits.reserve(timedHits.capacity() + simHitColl->size());
54 timedHits.emplace_back(timeIndex.time(), timeIndex.index(), simHit, timeIndex.type());
57 std::sort(timedHits.begin(), timedHits.end(),
59 if (a->identify() != b->identify()){
60 return a->identify() < b->identify();
62 if (
a.eventId() !=
b.eventId()) {
63 return a.eventId() < b.eventId();
65 return a.eventTime() <
b.eventTime();
67 return StatusCode::SUCCESS;
◆ filterPassed()
virtual bool PileUpToolBase::filterPassed |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ finalize()
StatusCode MM_DigitizationTool::finalize |
( |
| ) |
|
|
finaloverride |
Definition at line 173 of file MuonPhaseII/MuonDigitization/MmDigitizationR4/src/MM_DigitizationTool.cxx.
175 std::stringstream statstr{};
177 for (
unsigned int g = 0;
g < m_allHits.size(); ++
g) {
178 allHits += m_allHits[
g];
179 statstr<<
" *** Layer "<<(
g+1)<<
" "<<percentage(m_acceptedHits[
g],m_allHits[
g])
180 <<
"% of "<<m_allHits[
g]<<std::endl;
182 if(!allHits)
return StatusCode::SUCCESS;
183 ATH_MSG_INFO(
"Tried to convert "<<allHits<<
" hits. Successes rate per layer "<<std::endl<<statstr.str());
184 return StatusCode::SUCCESS;
◆ getGeoCtx()
◆ getRandomEngine()
CLHEP::HepRandomEngine * MuonR4::MuonDigitizationTool::getRandomEngine |
( |
const EventContext & |
ctx | ) |
const |
|
protectedinherited |
◆ hitTime()
double MuonR4::MuonDigitizationTool::hitTime |
( |
const TimedHit & |
hit | ) |
|
|
staticprotectedinherited |
Returns the global time of the hit which is the sum of eventTime & individual hit time.
Definition at line 69 of file MuonDigitizationTool.cxx.
70 return hit.eventTime() + hit->globalTime();
◆ initialize()
StatusCode MM_DigitizationTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Reimplemented from PileUpToolBase.
Definition at line 36 of file MuonPhaseII/MuonDigitization/MmDigitizationR4/src/MM_DigitizationTool.cxx.
54 strip_cfg.NSWCalib::MicroMegaGas::operator=(prop);
83 std::for_each(vmmReadoutMode.begin(), vmmReadoutMode.end(), [](
char&
c) { c = ::tolower(c); });
84 if (vmmReadoutMode.find(
"peak") != std::string::npos)
86 else if (vmmReadoutMode.find(
"threshold") != std::string::npos)
89 ATH_MSG_ERROR(
"MM_DigitizationTool can't interperet vmmReadoutMode option! (Should be 'peak' or 'threshold'.) Contains: "
91 return StatusCode::FAILURE;
95 std::for_each(vmmARTMode.begin(), vmmARTMode.end(), [](
char&
c) { c = ::tolower(c); });
96 if (vmmARTMode.find(
"peak") != std::string::npos){
98 }
else if (vmmARTMode.find(
"threshold") != std::string::npos){
101 ATH_MSG_ERROR(
"MM_DigitizationTool can't interperet vmmARTMode option! (Should be 'peak' or 'threshold'.) Contains: " <<
m_vmmARTMode);
108 int stripNumberShortestStrip{-1}, stripNumberLongestStrip{-1};
109 Identifier tmpIdShortestStrip{0},tmpIdLongestStrip{0};
110 double shortestStripLength{FLT_MAX}, longestStripLength{0};
111 IdentifierHash tmpIdHashShortestStrip{0},tmpIdHashLongestStrip{0};
114 for (std::string sectorType : {
"MML",
"MMS"}) {
115 for (
int etaStation : {1, 2}) {
118 tmpId =
m_idHelperSvc->mmIdHelper().channelID(sectorType, etaStation, 1, 1, 1, 1);
122 tmpIdShortestStrip =
m_idHelperSvc->mmIdHelper().channelID(sectorType, etaStation, 1, 1, 1, stripNumberShortestStrip);
123 tmpIdHashShortestStrip = detectorReadoutElement->
measurementHash(tmpIdShortestStrip);
124 shortestStripLength = detectorReadoutElement->
stripLength(tmpIdHashShortestStrip);
125 stripNumberLongestStrip = design.numStrips() + stripNumberShortestStrip - 1;
126 tmpIdLongestStrip =
m_idHelperSvc->mmIdHelper().channelID(sectorType, etaStation, 1, 1, 1, stripNumberLongestStrip);
127 tmpIdHashLongestStrip = detectorReadoutElement->
measurementHash(tmpIdLongestStrip);
128 longestStripLength = design.stripLength(tmpIdHashLongestStrip);
132 if (sectorType ==
"MMS") {
133 if ( etaStation == 1){
135 noise_smallEta1.slope = (maxNoiseSmall_eta1 - minNoiseSmall_eta1) / (longestStripLength - shortestStripLength);
136 noise_smallEta1.intercept = minNoiseSmall_eta1 - noise_smallEta1.slope* shortestStripLength;
137 }
else if ( etaStation == 2){
139 noise_smallEta2.slope = (maxNoiseSmall_eta2 - minNoiseSmall_eta2) / (longestStripLength - shortestStripLength);
140 noise_smallEta2.intercept = minNoiseSmall_eta2 - noise_smallEta2.slope * shortestStripLength;
142 }
else if (sectorType ==
"MML") {
143 if ( etaStation == 1){
145 noise_largeEta1.slope = (maxNoiseLarge_eta1 - minNoiseLarge_eta1) / (longestStripLength - shortestStripLength);
146 noise_largeEta1.intercept = minNoiseLarge_eta1 - noise_largeEta1.slope * shortestStripLength;
147 }
else if ( etaStation == 2){
149 noise_largeEta2.slope = (maxNoiseLarge_eta2 - minNoiseLarge_eta2) / (longestStripLength - shortestStripLength);
150 noise_largeEta2.intercept = minNoiseLarge_eta2 - noise_largeEta2.slope * shortestStripLength;
170 return StatusCode::SUCCESS;
◆ mergeEvent()
StatusCode MuonR4::MuonDigitizationTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
finaloverrideinherited |
Definition at line 98 of file MuonDigitizationTool.cxx.
104 ATH_CHECK(sdoContainer.record(std::make_unique<xAOD::MuonSimHitContainer>(),
105 std::make_unique<xAOD::MuonSimHitAuxContainer>()));
110 return StatusCode::SUCCESS;
◆ passDeadTime()
Returns whether the new digit is within the dead time window.
channelId: Identifier of the fired channel
hitTime: Current hit time
deadTimeWindow: Dead time to pass before the next hit may be accepted
deadTimeMap: Map storing the last hit times from each Identifier
Channel not seen before
Update dead time map & accept hit
Definition at line 169 of file MuonDigitizationTool.cxx.
175 if (insertItr.second) {
178 if (
hitTime - insertItr.first->second < deadTimeWindow) {
182 insertItr.first->second =
hitTime;
◆ prepareEvent()
StatusCode MuonR4::MuonDigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
const unsigned int |
nInputEvents |
|
) |
| |
|
finaloverrideinherited |
When being run from PileUpToolsAlgs, this method is called at the start of the subevts loop.
Not able to access SubEvents
Definition at line 41 of file MuonDigitizationTool.cxx.
44 ATH_MSG_DEBUG(
"prepareEvent() called for " << nInputEvents <<
" input events");
47 return StatusCode::SUCCESS;
◆ processAllSubEvents() [1/3]
StatusCode MuonR4::MuonDigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
const |
|
inherited |
Reentrant version of the digitization tool.
In case of single hits container just load the collection using read handles
Definition at line 77 of file MuonDigitizationTool.cxx.
92 ATH_CHECK(sdoContainer.record(std::make_unique<xAOD::MuonSimHitContainer>(),
93 std::make_unique<xAOD::MuonSimHitAuxContainer>()));
96 return StatusCode::SUCCESS;
◆ processAllSubEvents() [2/3]
StatusCode MuonR4::MuonDigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtualinherited |
◆ processAllSubEvents() [3/3]
virtual StatusCode IPileUpTool::processAllSubEvents |
|
inherited |
dummy implementation to allow compilation while all Digitization packages are migrated to use this new interface.
◆ processBunchXing()
|
finaloverridevirtualinherited |
Reimplemented from PileUpToolBase.
Definition at line 114 of file MuonDigitizationTool.cxx.
121 for (
auto& [hitPtr, hitContainer] : hitList) {
122 auto copyContainer = std::make_unique<xAOD::MuonSimHitContainer>();
123 auto copyAuxContainer = std::make_unique<xAOD::MuonSimHitAuxContainer>();
124 copyContainer->setStore(copyAuxContainer.get());
126 (*copyContainer->push_back(std::make_unique<xAOD::MuonSimHit>())) = (*copyMe);
128 hitListPermanent.emplace_back(hitPtr, copyContainer.get());
129 m_simHits.emplace_back(std::move(copyContainer), std::move(copyAuxContainer));
132 return StatusCode::SUCCESS;
◆ resetFilter()
virtual void PileUpToolBase::resetFilter |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ retrieveConditions()
template<class Container >
Helper function to access the conditions data.
If the key is empty, the conditions object is assigned to be a nullptr Otherwise, a failure is returned if the Conditions data are not available in the event.
◆ retrieveContainer()
template<class Container >
Helper function to retrieve a container from StoreGate.
If the readHandleKey is empty, the container is assigned to be a nullptr and the operation is marked as success. Otherwise, a failure is returned if the Container cannot be fetched from StoreGate
◆ toProcess()
virtual bool PileUpToolBase::toProcess |
( |
int |
bunchXing | ) |
const |
|
inlineoverridevirtualinherited |
◆ writeDigitContainer()
template<class DigitCont , class DigitColl >
Helper function to move the collected digits into the final DigitContainer.
The function needs the maximal size of the container in advance which is provided by calling the module_hash_max() function of the corresponding MuonIdHelper.
◆ ATLAS_THREAD_SAFE [1/2]
std::array<std::atomic<unsigned>, 8> m_allHits MuonR4::MM_DigitizationTool::ATLAS_THREAD_SAFE {} |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/2]
std::array<std::atomic<unsigned>, 8> m_acceptedHits MuonR4::MM_DigitizationTool::ATLAS_THREAD_SAFE {} |
|
mutableprivate |
◆ m_ARTdeadtime
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_ARTdeadtime {this, "ARTDeadTime", 200, "dead-time for ART, default value 200 ns = 8 BCs"} |
|
private |
◆ m_avalancheGain
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_avalancheGain {this, "AvalancheGain", 6.0e3, "avalanche Gain for rach gas mixture"} |
|
private |
◆ m_calibrationTool
◆ m_checkMMSimHits
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_checkMMSimHits {this, "CheckSimHits", true, "Control on the hit validity"} |
|
private |
◆ m_condThrshldsKey
◆ m_crossTalk1
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_crossTalk1 {this, "crossTalk1", 0.3, "Strip Cross Talk with Nearest Neighbor"} |
|
private |
◆ m_crossTalk2
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_crossTalk2 {this, "crossTalk2", 0.09, "Strip Cross Talk with 2nd Nearest Neighbor"} |
|
private |
◆ m_deadTime
Gaudi::Property<double> MuonR4::MM_DigitizationTool::m_deadTime {this, "deadTime", 300. * Gaudi::Units::ns} |
|
private |
◆ m_detMgr
◆ m_DiffMagSecondMuonHit
Gaudi::Property<double> MuonR4::MM_DigitizationTool::m_DiffMagSecondMuonHit {this, "DiffMagSecondMuonHit", 0.1} |
|
private |
◆ m_digitizeMuonOnly
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_digitizeMuonOnly {this, "ProcessTrueMuonsOnly", true, "If set to true hit with pdgId != 13 are skipped"} |
|
private |
◆ m_doSmearing
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_doSmearing |
|
private |
◆ m_driftGapWidth
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_driftGapWidth {this, "DriftGapWidth", 5.04, "Drift Gap Width of 5.04 mm"} |
|
private |
◆ m_effiDataKey
◆ m_ElectronicsResponseSimulation
◆ m_electronicsThreshold
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_electronicsThreshold |
|
private |
◆ m_energyThreshold
Gaudi::Property<double> MuonR4::MM_DigitizationTool::m_energyThreshold {this, "EnergyThreshold", 50, "Minimal energy to process an electron sim hit"} |
|
private |
◆ m_fieldCondObjInputKey
◆ m_filterPassed
bool PileUpToolBase::m_filterPassed {true} |
|
protectedinherited |
◆ 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_geoCtxKey
Initial value:{this, "AlignmentKey", "ActsAlignment",
"Geometry context"}
Definition at line 152 of file MuonDigitizationTool.h.
◆ m_idHelperSvc
Initial value:{this, "MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 142 of file MuonDigitizationTool.h.
◆ m_includePileUpTruth
Gaudi::Property<bool> MuonR4::MuonDigitizationTool::m_includePileUpTruth {this, "IncludePileUpTruth", true, "Include pile-up truth info"} |
|
privateinherited |
◆ m_inputObjectName
std::string MuonR4::MuonDigitizationTool::m_inputObjectName {""} |
|
privateinherited |
◆ 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_maskMultiplet
Gaudi::Property<int> MuonR4::MM_DigitizationTool::m_maskMultiplet {this, "MaskMultiplet", 0, "0: all, 1: first, 2: second, 3: both"} |
|
private |
◆ m_mergeSvc
◆ m_needsMcEventCollHelper
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_needsMcEventCollHelper {this, "UseMcEventCollectionHelper", false} |
|
private |
◆ m_noiseParams
◆ m_onlyUseContainerName
Gaudi::Property<bool> MuonR4::MuonDigitizationTool::m_onlyUseContainerName |
|
privateinherited |
Initial value:{this, "OnlyUseContainerName", false,
"Don't use the ReadHandleKey directly. Just extract the container name from it."}
Definition at line 163 of file MuonDigitizationTool.h.
◆ m_qThreshold
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_qThreshold {this, "qThreshold", 0.001, "Charge Threshold"} |
|
private |
◆ m_rndmSvc
◆ m_sdoKey
◆ m_simHitKey
◆ m_simHits
◆ m_smearingTool
◆ m_streamName
Gaudi::Property<std::string> MuonR4::MuonDigitizationTool::m_streamName {this, "StreamName", ""} |
|
privateinherited |
◆ m_stripdeadtime
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_stripdeadtime {this, "StripDeadTime", 200, "dead-time for strip, default value 200 ns = 8 BCs"} |
|
private |
◆ m_StripsResponseSimulation
◆ m_thresholdScaleFactor
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_thresholdScaleFactor |
|
private |
◆ m_timedHits
TimedHits MuonR4::MuonDigitizationTool::m_timedHits {} |
|
privateinherited |
◆ m_timeWindowLowerOffset
Gaudi::Property<double> MuonR4::MM_DigitizationTool::m_timeWindowLowerOffset |
|
private |
◆ m_timeWindowUpperOffset
Gaudi::Property<double> MuonR4::MM_DigitizationTool::m_timeWindowUpperOffset |
|
private |
◆ m_uncertCalibKey
◆ m_useCondThresholds
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_useCondThresholds |
|
private |
◆ m_useThresholdScaling
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_useThresholdScaling |
|
private |
◆ m_useTimeWindow
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_useTimeWindow {this, "UseTimeWindow", true} |
|
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.
◆ m_vmmARTMode
Gaudi::Property<std::string> MuonR4::MM_DigitizationTool::m_vmmARTMode {this, "vmmARTMode", "threshold", "For ART (trigger) path. Can be peak or threshold"} |
|
private |
◆ m_vmmDeadtime
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_vmmDeadtime {this, "vmmDeadtime", 200, "Specifies how much before the lower time limit the VMM simulation should start evaluating the signal"} |
|
private |
◆ m_vmmNeighborLogic
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_vmmNeighborLogic {this, "VMMNeighborLogic", false} |
|
private |
◆ m_vmmReadoutMode
Gaudi::Property<std::string> MuonR4::MM_DigitizationTool::m_vmmReadoutMode {this, "vmmReadoutMode", "peak", "For readout (DAQ) path. Can be peak or threshold"} |
|
private |
◆ m_vmmUpperGrazeWindow
Gaudi::Property<float> MuonR4::MM_DigitizationTool::m_vmmUpperGrazeWindow {this, "vmmUpperGrazeWindow", 150, "Specifies how much above the upper time window boundary the VMM sim evaluates the signal."} |
|
private |
◆ m_writeKey
◆ m_writeOutputFile
Gaudi::Property<bool> MuonR4::MM_DigitizationTool::m_writeOutputFile {this, "SaveInternalHistos", false} |
|
private |
The documentation for this class was generated from the following files:
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
double stripLength(const IdentifierHash &measHash) const
Returns the strip length.
virtual double stripLength(int stripNumb) const
Returns length of the strip.
Eigen::Matrix< double, 2, 1 > Vector2D
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
#define THROW_EXCEPTION(MSG)
bool empty() const
Test if the key is blank.
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
a link optimized in size for a GenParticle in a McEventCollection
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
int readoutSide(const IdentifierHash &measHash) const
Returns the readout side.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
int firstStripNumber() const
Returns the number of the first strip.
Include the GeoPrimitives which need to be put first.
const StripLayer & stripLayer(const Identifier &measId) const
A wrapper class for event-slot-local random engines.
double charge(const T &p)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
const StripDesign & design() const
Returns the underlying strip design.
IdentifierHash measurementHash(const Identifier &measId) const override final
Constructs the identifier hash from the full measurement Identifier.
def time(flags, cells_name, *args, **kw)
IdentifierHash layerHash(const Identifier &measId) const override final
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
float peakTime
power of responce function
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
a struct encapsulating the identifier of a pile-up event