Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <RpcDigitizationTool.h>
|
ServiceHandle< PileUpMergeSvc > | m_mergeSvc {this, "PileUpMergeSvc", "PileUpMergeSvc", "Pile up service"} |
|
Gaudi::Property< bool > | m_onlyUseContainerName |
|
SG::ReadHandleKey< RPCSimHitCollection > | m_hitsContainerKey {this, "InputObjectName", "RPC_Hits", "name of the input object"} |
|
std::string | m_inputHitCollectionName {""} |
|
SG::WriteHandleKey< RpcDigitContainer > | m_outputDigitCollectionKey |
|
SG::WriteHandleKey< MuonSimDataCollection > | m_outputSDO_CollectionKey |
|
SG::WriteHandleKey< RPCSimHitCollection > | m_simHitValidKey {this, "SimHitValidationKey", "InputRpcHits"} |
|
ServiceHandle< IAthRNGSvc > | m_rndmSvc {this, "RndmSvc", "AthRNGSvc", ""} |
|
Gaudi::Property< std::string > | m_RPC_TimeSchema {this, "RPC_TimeSchema", "RPC_TimeSchema", "Tag info name of Rpc Time Info"} |
|
Gaudi::Property< bool > | m_sdoAreOnlyDigits |
|
Gaudi::Property< bool > | m_Efficiency_fromCOOL {this, "Efficiency_fromCOOL", false, "Read efficiency from CoolDB"} |
|
Gaudi::Property< bool > | m_EfficiencyPatchForBMShighEta |
|
Gaudi::Property< bool > | m_ClusterSize_fromCOOL {this, "ClusterSize_fromCOOL", false, "Read cluster size from CoolDB"} |
|
Gaudi::Property< bool > | m_ClusterSize1_2uncorr |
|
Gaudi::Property< bool > | m_BOG_BOF_DoubletR2_OFF {this, "Force_BOG_BOF_DoubletR2_OFF", false, "Turn-off BOG and BOF with DoubletR=2"} |
|
Gaudi::Property< bool > | m_ignoreRunDepConfig |
|
Gaudi::Property< bool > | m_Efficiency_BIS78_fromCOOL {this, "Efficiency_BIS78_fromCOOL", false, " read BIS78 Efficiency from COOL DB"} |
|
Gaudi::Property< bool > | m_ClusterSize_BIS78_fromCOOL {this, "ClusterSize_BIS78_fromCOOL", false, " read BIS78 Cluster Size from COOL DB"} |
|
Gaudi::Property< bool > | m_RPCInfoFromDb {this, "RPCInfoFromDb", false, ""} |
|
Gaudi::Property< float > | m_CutMaxClusterSize {this, "CutMaxClusterSize", 5.0, ""} |
|
Gaudi::Property< int > | m_CutProjectedTracks {this, "CutProjectedTracks", 100, ""} |
|
int | m_BOF_id {-1} |
|
int | m_BOG_id {-1} |
|
int | m_BOS_id {-1} |
|
int | m_BIL_id {-1} |
|
int | m_BIS_id {-1} |
|
|
StatusCode | initializeRunDependentParameters () |
|
template<class CondType > |
StatusCode | retrieveCondData (const EventContext &ctx, const SG::ReadCondHandleKey< CondType > &key, const CondType *&condPtr) const |
|
StatusCode | getNextEvent (const EventContext &ctx) |
| Get next event and extract collection of hit collections: More...
|
|
StatusCode | doDigitization (const EventContext &ctx, Collections_t &collections, MuonSimDataCollection *sdoContainer) |
| Digitization functionality shared with RPC_PileUpTool. More...
|
|
StatusCode | fillTagInfo () |
|
long long int | PackMCTruth (float proptime, float tof, float posx, float posz) const |
|
std::array< int, 3 > | physicalClusterSize (const EventContext &ctx, const MuonGM::RpcReadoutElement *reEle, const Identifier &id, const Amg::Vector3D &posAtCentre, CLHEP::HepRandomEngine *rndmEngine) const |
| Cluster simulation: first step. More...
|
|
std::array< int, 3 > | TurnOnStrips (const MuonGM::RpcReadoutElement *reEle, std::array< int, 3 > &&pcs, const Identifier &id) const |
| Cluster simulation: second step. More...
|
|
double | PropagationTime (const MuonGM::RpcReadoutElement *reEle, const Identifier &id, const Amg::Vector3D &globPos) const |
| Calculates the propagation time along the strip. More...
|
|
Amg::Transform3D | fromSimHitToLayer (const MuonGM::RpcReadoutElement *readOutEle, const Identifier &layerId) const |
| Returns the position of the hit expressed in the gasGap coordinate system. More...
|
|
bool | outsideWindow (double time) const |
|
std::pair< bool, bool > | detectionEfficiency (const EventContext &ctx, const Identifier &ideta, const Identifier &idphi, CLHEP::HepRandomEngine *rndmEngine, const HepMcParticleLink &trkParticle) const |
| Evaluate detection efficiency. More...
|
|
double | FCPEfficiency (const HepMC::ConstGenParticlePtr &genParticle) const |
|
int | determineClusterSize (const EventContext &ctx, const Identifier &id, double xstripnorm, CLHEP::HepRandomEngine *rndmEngine) const |
|
|
static void | UnPackMCTruth (double theWord, float &proptime, float &tof, float &posy, float &posz) |
|
static double | timeOverThreshold (CLHEP::HepRandomEngine *rndmEngine) |
|
|
Gaudi::Property< double > | m_UncorrJitter {this, "UncorrJitter", 1.5, "jitter uncorrelated between eta and phi"} |
| Calculates the position of the hit wrt to the strip panel this transformation is needed since the impact point comes from the SD int he gas gap's reference frame. More...
|
|
Gaudi::Property< double > | m_CorrJitter {this, "CorrJitter", 0.0, "jitter correlated between eta and phi"} |
|
Gaudi::Property< double > | m_UncorrJitter_BIS78 {this, "UncorrJitter_BIS78", 0.3, "jitter uncorrelated between eta and phi BIS78"} |
|
Gaudi::Property< double > | m_CorrJitter_BIS78 {this, "CorrJitter_BIS78", 0.0, "jitter correlated between eta and phi BIS78"} |
|
Gaudi::Property< double > | m_timeWindowLowerOffset {this, "WindowLowerOffset", -100., "digitization window lower limit"} |
|
Gaudi::Property< double > | m_timeWindowUpperOffset {this, "WindowUpperOffset", +150., "digitization window lower limit"} |
|
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > | m_detMgrKey |
|
const RpcIdHelper * | m_idHelper {} |
|
const RpcHitIdHelper * | m_muonHelper {} |
|
std::vector< std::unique_ptr< RPCSimHitCollection > > | m_RPCHitCollList |
|
std::unique_ptr< TimedHitCollection< RPCSimHit > > | m_thpcRPC {} |
|
SG::ReadCondHandleKey< RpcCondDbData > | m_readKey {this, "ReadKey", "RpcCondDbData", "Key of RpcCondDbData"} |
|
std::map< Identifier, std::vector< MuonSimData::Deposit > > | m_sdo_tmp_map |
|
Gaudi::Property< int > | m_deadTime {this, "DeadTime", 100., "dead time"} |
|
Gaudi::Property< bool > | m_patch_for_rpc_time {this, "PatchForRpcTime", false, ""} |
|
Gaudi::Property< double > | m_rpc_time_shift |
|
Gaudi::Property< bool > | m_validationSetup {this, "ValidationSetup", false, ""} |
|
Gaudi::Property< bool > | m_includePileUpTruth {this, "IncludePileUpTruth", true, "pileup truth veto"} |
|
Gaudi::Property< bool > | m_turnON_efficiency {this, "turnON_efficiency", true, ""} |
|
Gaudi::Property< bool > | m_kill_deadstrips {this, "KillDeadStrips", false, ""} |
|
Gaudi::Property< bool > | m_turnON_clustersize {this, "turnON_clustersize", true, ""} |
|
Gaudi::Property< int > | m_FirstClusterSizeInTail {this, "FirstClusterSizeInTail", 3, ""} |
|
Gaudi::Property< std::vector< float > > | m_PhiAndEtaEff_A {this, "PhiAndEtaEff_A", {}, ""} |
|
Gaudi::Property< std::vector< float > > | m_OnlyPhiEff_A {this, "OnlyPhiEff_A", {}, ""} |
|
Gaudi::Property< std::vector< float > > | m_OnlyEtaEff_A {this, "OnlyEtaEff_A", {}, ""} |
|
Gaudi::Property< std::vector< float > > | m_PhiAndEtaEff_C {this, "PhiAndEtaEff_C", {}, ""} |
|
Gaudi::Property< std::vector< float > > | m_OnlyPhiEff_C {this, "OnlyPhiEff_C", {}, ""} |
|
Gaudi::Property< std::vector< float > > | m_OnlyEtaEff_C {this, "OnlyEtaEff_C", {}, ""} |
|
Gaudi::Property< float > | m_PhiAndEtaEff_BIS78 {this, "PhiAndEtaEff_BIS78", 0.93, ""} |
|
Gaudi::Property< float > | m_OnlyEtaEff_BIS78 {this, "OnlyEtaEff_BIS78", 0.96, ""} |
|
Gaudi::Property< float > | m_OnlyPhiEff_BIS78 {this, "OnlyPhiEff_BIS78", 0.96, ""} |
|
Gaudi::Property< std::vector< double > > | m_FracClusterSize1_A {this, "FracClusterSize1_A", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_FracClusterSize2_A {this, "FracClusterSize2_A", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_FracClusterSizeTail_A {this, "FracClusterSizeTail_A", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_MeanClusterSizeTail_A {this, "MeanClusterSizeTail_A", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_FracClusterSize1_C {this, "FracClusterSize1_C", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_FracClusterSize2_C {this, "FracClusterSize2_C", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_FracClusterSizeTail_C {this, "FracClusterSizeTail_C", {}, ""} |
|
Gaudi::Property< std::vector< double > > | m_MeanClusterSizeTail_C {this, "MeanClusterSizeTail_C", {}, ""} |
|
Gaudi::Property< float > | m_FracClusterSize1_BIS78 {this, "FracClusterSize1_BIS78", 0.60, ""} |
|
Gaudi::Property< float > | m_FracClusterSize2_BIS78 {this, "FracClusterSize2_BIS78", 0.35, ""} |
|
Gaudi::Property< float > | m_FracClusterSizeTail_BIS78 {this, "FracClusterSizeTail_BIA78", 0.05, ""} |
|
Gaudi::Property< float > | m_MeanClusterSizeTail_BIS78 {this, "MeanClusterSizeTail_BIA78", 3.5, ""} |
|
Gaudi::Property< bool > | m_muonOnlySDOs {this, "MuonOnlySDOs", true, ""} |
|
Class methods and properties
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 an rpcIdHelper. The ASCII file G4RPC_Digitizer.txt is read and its contents are used by the algorithm in order to simulate clusters. Random numbers are obtained in the code from a dedicated stream via AtRndmSvc, which is also initialized in the initialize() method. The execute() has responsibility for steering the digitization/cluster simulation process. A loop over the RPCHits is performed, converting each SimID to OID. The method physicalClusterSize is hence called, which creates a cluster of size 1 or two according to the impact point of the particle along the strip. The final size of the cluster is decided by the method TurnOnStrips. The last step in the creation of the digitization is the calculation of the propagation time of the electrical signal along the strip length. This is done in the PropagationTime method. In the hit collections coming from the RPCSensitiveDetector, it sometimes happen that many hits are produced by the same crossing particle, which are very close both in space and time. This is related to ionization and production of secondaries in the gas, and it is thus safe, and also recommended, to eliminate these multiple hits before proceeding to reconstruction. The execute() method provides this functionality using a dead time: once a hit is found on a given strip, every other hit coming from the same strip before the dead time is ignored.
Definition at line 64 of file RpcDigitizationTool.h.
◆ Collections_t
◆ RpcDigitizationTool()
RpcDigitizationTool::RpcDigitizationTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
pIID |
|
) |
| |
◆ detectionEfficiency()
Evaluate detection efficiency.
Definition at line 1088 of file RpcDigitizationTool.cxx.
1096 ATH_MSG_DEBUG(
"RpcDigitizationTool::in DetectionEfficiency");
1104 float maxGeomEff{0.99}, PhiAndEtaEff{0.99}, OnlyEtaEff{0.f}, OnlyPhiEff{0.f};
1113 return std::make_pair(
false,
false);
1118 return std::make_pair(
true,
true);
1120 bool etaStripOn{
true}, phiStripOn{
true};
1161 ATH_MSG_DEBUG(
"Efficiencies and cluster size + dead strips will be extracted from COOL");
1163 double FracDeadStripEta{0.}, FracDeadStripPhi{0.};
1164 double EtaPanelEfficiency{1.}, PhiPanelEfficiency{1.}, GapEfficiency{1.};
1165 int RPC_ProjectedTracksEta = 0;
1167 std::optional<double> fracDeadStripEtaFromCOOL = readCdo->getFracDeadStrip(IdEta);
1168 std::optional<double> fracDeadStripPhiFromCOOL = readCdo->getFracDeadStrip(IdPhi);
1170 bool noEntryInDb = !fracDeadStripEtaFromCOOL || !fracDeadStripPhiFromCOOL;
1172 FracDeadStripEta = fracDeadStripEtaFromCOOL.value_or(0.);
1173 FracDeadStripPhi = fracDeadStripPhiFromCOOL.value_or(0.);
1174 RPC_ProjectedTracksEta = readCdo->getProjectedTrack(IdEta).value_or(0);
1176 EtaPanelEfficiency = readCdo->getEfficiency(IdEta).value_or(1.);
1177 PhiPanelEfficiency = readCdo->getEfficiency(IdPhi).value_or(1.);
1178 GapEfficiency = readCdo->getGapEfficiency(IdEta).value_or(1.);
1180 if (std::abs(FracDeadStripEta - 1.) < 0.001) {
1181 ATH_MSG_DEBUG(
"Watch out: SPECIAL CASE: Read from Cool: FracDeadStripEta/Phi "
1182 << FracDeadStripEta <<
"/" << FracDeadStripPhi <<
" RPC_ProjectedTracksEta " << RPC_ProjectedTracksEta
1183 <<
" Eta/PhiPanelEfficiency " << EtaPanelEfficiency <<
"/" << PhiPanelEfficiency <<
" gapEff " << GapEfficiency
1187 FracDeadStripPhi = 0.;
1188 ATH_MSG_VERBOSE(
"Watch out: SPECIAL CASE: Resetting FracDeadStripPhi " << FracDeadStripPhi <<
" ignoring phi dead strips ");
1196 bool changing =
false;
1197 ATH_MSG_DEBUG(
"Read from Cool: FracDeadStripEta/Phi " << FracDeadStripEta <<
"/" << FracDeadStripPhi <<
" RPC_ProjectedTracksEta "
1198 << RPC_ProjectedTracksEta <<
" Eta/PhiPanelEfficiency " << EtaPanelEfficiency
1199 <<
"/" << PhiPanelEfficiency <<
" gapEff " << GapEfficiency);
1201 if ((maxGeomEff - FracDeadStripEta) - EtaPanelEfficiency < -0.011) {
1202 ATH_MSG_DEBUG(
"Ineff. from dead strips on Eta Panel larger that measured efficiency: deadFrac="
1204 ATH_MSG_DEBUG(
"... see the corresponding report from RpcDetectorStatusDbTool");
1206 EtaPanelEfficiency = maxGeomEff - FracDeadStripEta;
1210 if ((maxGeomEff - FracDeadStripPhi) - PhiPanelEfficiency < -0.011) {
1211 ATH_MSG_DEBUG(
"Ineff. from dead strips on Phi Panel larger that measured efficiency: deadFrac="
1213 ATH_MSG_DEBUG(
"... see the corresponding report among the warnings of RpcDetectorStatusDbTool");
1215 PhiPanelEfficiency = maxGeomEff - FracDeadStripPhi;
1219 if ((maxGeomEff - FracDeadStripEta * FracDeadStripPhi) - GapEfficiency < -0.011) {
1220 ATH_MSG_DEBUG(
"Ineff. from dead strips on Eta/Phi Panels larger that measured EtaORPhi efficiency: deadFrac="
1221 << FracDeadStripEta * FracDeadStripPhi <<
" EtaORPhi Eff=" << GapEfficiency <<
" for GasGap "
1223 ATH_MSG_DEBUG(
"... see the corresponding report among the warnings of RpcDetectorStatusDbTool");
1225 GapEfficiency = maxGeomEff - FracDeadStripEta * FracDeadStripPhi;
1229 ATH_MSG_DEBUG(
"Rinormalized Values from Cool: FracDeadStripEta/Phi "
1230 << FracDeadStripEta <<
"/" << FracDeadStripPhi <<
" RPC_ProjectedTracksEta " << RPC_ProjectedTracksEta
1231 <<
" Eta/PhiPanelEfficiency " << EtaPanelEfficiency <<
"/" << PhiPanelEfficiency <<
" gapEff " << GapEfficiency);
1235 if ((FracDeadStripEta > 0.0 && FracDeadStripEta < 1.0) || (FracDeadStripPhi > 0.0 && FracDeadStripPhi < 1.0) || (noEntryInDb)) {
1236 EtaPanelEfficiency = EtaPanelEfficiency / (maxGeomEff - FracDeadStripEta);
1237 PhiPanelEfficiency = PhiPanelEfficiency / (maxGeomEff - FracDeadStripPhi);
1238 GapEfficiency = GapEfficiency / (maxGeomEff - FracDeadStripEta * FracDeadStripPhi);
1240 if (EtaPanelEfficiency > maxGeomEff) EtaPanelEfficiency = maxGeomEff;
1241 if (PhiPanelEfficiency > maxGeomEff) PhiPanelEfficiency = maxGeomEff;
1242 if (GapEfficiency > maxGeomEff) GapEfficiency = maxGeomEff;
1244 if (EtaPanelEfficiency > GapEfficiency) GapEfficiency = EtaPanelEfficiency;
1245 if (PhiPanelEfficiency > GapEfficiency) GapEfficiency = PhiPanelEfficiency;
1246 ATH_MSG_DEBUG(
"Eff Redefined (to correct for deadfrac): FracDeadStripEta/Phi "
1247 <<
" Eta/PhiPanelEfficiency " << EtaPanelEfficiency <<
"/" << PhiPanelEfficiency <<
" gapEff "
1253 PhiAndEtaEff =
float(EtaPanelEfficiency + PhiPanelEfficiency - GapEfficiency);
1254 if (PhiAndEtaEff < 0.) PhiAndEtaEff = 0.;
1255 OnlyEtaEff =
float(EtaPanelEfficiency - PhiAndEtaEff);
1256 if (OnlyEtaEff < 0.) OnlyEtaEff = 0.;
1257 OnlyPhiEff =
float(PhiPanelEfficiency - PhiAndEtaEff);
1258 if (OnlyPhiEff < 0.) OnlyPhiEff = 0.;
1262 bool applySpecialPatch =
false;
1268 applySpecialPatch =
true;
1270 "Applying special patch for BMS at |eta|=6 lowPt plane -dbbZ=2 and dbPhi=1 ... will use default eff. for Id "
1273 "Applying special patch: THIS HAS TO BE DONE IF /RPC/DQMF/ELEMENT_STATUS tag is "
1274 "RPCDQMFElementStatus_2012_Jaunuary_2");
1280 if (applySpecialPatch || RPC_ProjectedTracksEta < m_CutProjectedTracks || RPC_ProjectedTracksEta > 10000000 ||
1281 EtaPanelEfficiency > 1 || EtaPanelEfficiency < 0 || PhiPanelEfficiency > 1 || PhiPanelEfficiency < 0 || GapEfficiency > 1 ||
1282 GapEfficiency < 0) {
1288 <<
" resetting eff. from cool with default(python) values ");
1305 float effgap = PhiAndEtaEff + OnlyEtaEff + OnlyPhiEff;
1306 float s_EtaPanelEfficiency = 1. - FracDeadStripEta;
1307 float s_PhiPanelEfficiency = 1. - FracDeadStripPhi;
1308 float s_PhiAndEtaEff = s_EtaPanelEfficiency * s_PhiPanelEfficiency / effgap;
1309 if (s_PhiAndEtaEff < PhiAndEtaEff) PhiAndEtaEff = s_PhiAndEtaEff;
1310 float s_OnlyEtaEff = s_EtaPanelEfficiency - PhiAndEtaEff;
1311 float s_OnlyPhiEff = s_PhiPanelEfficiency - PhiAndEtaEff;
1313 if (s_OnlyEtaEff < OnlyEtaEff) OnlyEtaEff = s_OnlyEtaEff;
1314 if (s_OnlyPhiEff < OnlyPhiEff) OnlyPhiEff = s_OnlyPhiEff;
1318 float VolEff = PhiAndEtaEff + OnlyEtaEff + OnlyPhiEff;
1319 if (VolEff > maxGeomEff) {
1320 PhiAndEtaEff = (PhiAndEtaEff / VolEff) * maxGeomEff;
1321 OnlyEtaEff = (OnlyEtaEff / VolEff) * maxGeomEff;
1322 OnlyPhiEff = (OnlyPhiEff / VolEff) * maxGeomEff;
1335 PhiAndEtaEff = PhiAndEtaEff * eff_sf;
1336 OnlyEtaEff = OnlyEtaEff * eff_sf;
1337 OnlyPhiEff = OnlyPhiEff * eff_sf;
1341 float I0 = PhiAndEtaEff;
1342 float I1 = PhiAndEtaEff + OnlyEtaEff;
1343 float ITot = PhiAndEtaEff + OnlyEtaEff + OnlyPhiEff;
1345 float GapEff = ITot ;
1346 float PhiEff = PhiAndEtaEff + OnlyPhiEff;
1347 float EtaEff = PhiAndEtaEff + OnlyEtaEff;
1349 ATH_MSG_DEBUG(
"DetectionEfficiency: Final Efficiency Values applied for "
1351 <<
"=OnlyEtaEff " << OnlyPhiEff <<
"=OnlyPhiEff " << GapEff <<
"=GapEff " << EtaEff <<
"=EtaEff " << PhiEff
1354 float rndmEff = CLHEP::RandFlat::shoot(rndmEngine, 1);
1359 }
else if ((I0 <= rndmEff) && (rndmEff < I1)) {
1362 }
else if ((I1 <= rndmEff) && (rndmEff <= ITot)) {
1370 return std::make_pair(etaStripOn, phiStripOn);
◆ determineClusterSize()
int RpcDigitizationTool::determineClusterSize |
( |
const EventContext & |
ctx, |
|
|
const Identifier & |
id, |
|
|
double |
xstripnorm, |
|
|
CLHEP::HepRandomEngine * |
rndmEngine |
|
) |
| const |
|
private |
Definition at line 1374 of file RpcDigitizationTool.cxx.
1378 ATH_MSG_DEBUG(
"RpcDigitizationTool::in determineClusterSize");
1382 int ClusterSize = 1;
1384 double FracClusterSize1{1.}, FracClusterSize2{0.}, MeanClusterSize{1.},
1385 FracClusterSizeTail{0.}, MeanClusterSizeTail{1.},
1386 FracClusterSize2norm{0.};
1440 int RPC_ProjectedTracks = readCdo->getProjectedTrack(Id).value_or(0);
1441 FracClusterSize1 = readCdo->getFracClusterSize1(Id).value_or(1.);
1442 FracClusterSize2 = readCdo->getFracClusterSize2(Id).value_or(0.);
1443 MeanClusterSize = readCdo->getMeanClusterSize(Id).value_or(1.);
1446 ATH_MSG_DEBUG(
"FracClusterSize1 and 2 " << FracClusterSize1 <<
" " << FracClusterSize2);
1448 FracClusterSizeTail = 1. - FracClusterSize1 - FracClusterSize2;
1450 MeanClusterSizeTail = MeanClusterSize - FracClusterSize1 - 2 * FracClusterSize2;
1452 ATH_MSG_DEBUG(
"MeanClusterSizeTail and FracClusterSizeTail " << MeanClusterSizeTail <<
" " << FracClusterSizeTail);
1455 if (RPC_ProjectedTracks < m_CutProjectedTracks || RPC_ProjectedTracks > 10000000 || MeanClusterSize >
m_CutMaxClusterSize ||
1456 MeanClusterSize <= 1 || FracClusterSizeTail < 0 || FracClusterSize1 < 0 || FracClusterSize2 < 0 || FracClusterSizeTail > 1 ||
1457 FracClusterSize1 > 1 || FracClusterSize2 > 1) {
1493 FracClusterSize1 =
std::min(FracClusterSize1, 1.);
1494 FracClusterSize2 =
std::min(FracClusterSize2, 1.);
1495 FracClusterSizeTail =
std::min(FracClusterSizeTail, 1.);
1496 float FracTot = FracClusterSize1 + FracClusterSize2 + FracClusterSizeTail;
1497 if (FracTot != 1. && FracTot > 0) {
1498 FracClusterSize1 = FracClusterSize1 / FracTot;
1499 FracClusterSize2 = FracClusterSize2 / FracTot;
1500 FracClusterSizeTail = FracClusterSizeTail / FracTot;
1502 if (MeanClusterSizeTail < 0 || MeanClusterSizeTail > 10) MeanClusterSizeTail = 1;
1504 ATH_MSG_VERBOSE(
"ClusterSize Final " << FracClusterSize1 <<
" FracClusterSize1 " << FracClusterSize2 <<
" FracClusterSize2 "
1505 << FracClusterSizeTail <<
" " << FracClusterSizeTail <<
" MeanClusterSizeTail "
1506 << MeanClusterSizeTail);
1508 float FracClusterSize1plus2 = FracClusterSize1 + FracClusterSize2;
1509 float ITot = FracClusterSize1 + FracClusterSize2 + FracClusterSizeTail;
1511 if (FracClusterSize1plus2 != 0) {
1513 FracClusterSize2norm = FracClusterSize2 / FracClusterSize1plus2;
1516 float rndmCS = CLHEP::RandFlat::shoot(rndmEngine, ITot);
1520 if (rndmCS < FracClusterSize1plus2) {
1522 if (xstripnorm <= FracClusterSize2norm / 2. * 1.3) {
1524 }
else if ((1.0 - FracClusterSize2norm / 2. * 1.3) <= xstripnorm) {
1530 float rndmCS1_2 = CLHEP::RandFlat::shoot(rndmEngine, 1);
1531 ClusterSize = 1 + (rndmCS1_2 < FracClusterSize2norm);
1534 }
else if ((FracClusterSize1plus2 <= rndmCS) && (rndmCS <= ITot)) {
1536 ClusterSize +=
int(CLHEP::RandExponential::shoot(rndmEngine, MeanClusterSizeTail));
1537 float rndmLR = CLHEP::RandFlat::shoot(rndmEngine, 1.0);
1538 if (rndmLR > 0.5) ClusterSize = -ClusterSize;
1544 if (rndmCS < FracClusterSize1) {
1546 }
else if (rndmCS < FracClusterSize1 + FracClusterSize2) {
1549 ClusterSize =
int(CLHEP::RandExponential::shoot(rndmEngine, MeanClusterSizeTail));
1551 ClusterSize =
std::max(ClusterSize, 1);
1552 if (ClusterSize > 1) {
1553 float rndmLR = CLHEP::RandFlat::shoot(rndmEngine, 1.0);
1554 if (rndmLR > 0.5) ClusterSize = -ClusterSize;
◆ doDigitization()
Digitization functionality shared with RPC_PileUpTool.
Let's pray that we will never discover that BIS78 is mounted upside down
Use special jitter consant for BIS & BIL chambers.
If a jitter constant has been defined smear it!
Definition at line 481 of file RpcDigitizationTool.cxx.
486 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
492 std::unique_ptr<RPCSimHitCollection> inputSimHitColl{std::make_unique<RPCSimHitCollection>(
"RPC_Hits")};
502 return StatusCode::FAILURE;
505 struct SimDataContent {
507 std::vector<MuonSimData::Deposit> deposits;
515 std::map<Identifier, SimDataContent> channelSimDataMap;
526 const int idHit = hit.RPCid();
528 const double globalHitTime{
hitTime(phit)};
530 const double G4Time{hit.globalTime()};
532 const double bunchTime{globalHitTime - hit.globalTime()};
534 ATH_MSG_DEBUG(
"Global time " << globalHitTime <<
" G4 time " << G4Time <<
" Bunch time " << bunchTime);
537 ATH_MSG_VERBOSE(
"Validation: globalHitTime, G4Time, BCtime = " << globalHitTime <<
" " << G4Time <<
" " << bunchTime);
538 inputSimHitColl->Emplace(idHit, globalHitTime, hit.localPosition(),
540 hit.postLocalPosition(),
541 hit.energyDeposit(), hit.stepLength(), hit.particleEncoding(), hit.kineticEnergy());
578 bool isValidEta{
false}, isValidPhi{
false};
581 if (!isValidEta || !isValidPhi) {
584 <<
" doubletR " <<
doubletR <<
" doubletZ " << doubletZ <<
" doubletPhi " <<
doubletPhi <<
" gasGap "
593 const double corrtimejitter = tmp_CorrJitter > 0.01 ?
594 CLHEP::RandGaussZiggurat::shoot(rndmEngine, 0., tmp_CorrJitter) : 0.;
600 const Amg::Vector3D hitDir{(hit.postLocalPosition() - hit.localPosition()).
unit()};
602 Amg::intersect<3>(hit.localPosition(), hitDir, Amg::Vector3D::UnitX(), 0).value_or(0) * hitDir;
604 std::array<int, 3> pcseta =
physicalClusterSize(ctx, reEle, idpaneleta, gapCentre, rndmEngine);
605 ATH_MSG_VERBOSE(
"Simulated cluster on eta panel: size/first/last= " << pcseta[0] <<
"/" << pcseta[1] <<
"/" << pcseta[2]);
606 std::array<int, 3> pcsphi =
physicalClusterSize(ctx, reEle, idpanelphi, gapCentre, rndmEngine);
607 ATH_MSG_VERBOSE(
"Simulated cluster on phi panel: size/first/last= " << pcsphi[0] <<
"/" << pcsphi[1] <<
"/" << pcsphi[2]);
616 const auto [etaStripOn, phiStripOn] =
detectionEfficiency(ctx, idpaneleta, idpanelphi, rndmEngine, particleLink);
617 ATH_MSG_DEBUG(
"SetPhiOn " << phiStripOn <<
" SetEtaOn " << etaStripOn);
619 for (
bool imeasphi : {
false,
true}) {
620 if (!imeasphi && (!etaStripOn || !isValidEta))
continue;
621 if (imeasphi && (!phiStripOn || !isValidPhi))
continue;
625 const Identifier& atlasId = !imeasphi ? atlasRpcIdeta : atlasRpcIdphi;
626 std::array<int, 3>
pcs{!imeasphi ? pcseta : pcsphi};
629 <<
" doubletR " <<
doubletR <<
" doubletZ " << doubletZ <<
" doubletPhi " <<
doubletPhi
630 <<
" gasGap " <<
gasGap <<
" measphi " << imeasphi);
657 double tns = G4Time + proptime + corrtimejitter;
658 ATH_MSG_VERBOSE(
"TOF+propagation time " << tns <<
" /s where proptime " << proptime <<
"/s");
660 double time = tns + bunchTime;
666 double*
b =
reinterpret_cast<double*
>(&packedMCword);
677 if (std::abs(hit.particleEncoding()) == 13 || hit.particleEncoding() == 0) {
678 if (channelSimDataMap.find(atlasId) == channelSimDataMap.end()) {
679 SimDataContent&
content = channelSimDataMap[atlasId];
681 content.deposits.push_back(deposit);
697 for (
int clus =
pcs[1]; clus <=
pcs[2]; ++clus) {
702 <<
" "<<
doubletPhi<<
" "<<
gasGap <<
" "<< imeasphi<<
" "<< clus<<
" is invalid");
708 ATH_MSG_WARNING(
"Temporary skipping creation of RPC digit for stationName="
710 <<
", doubletZ=" << doubletZ <<
", doubletPhi=" <<
doubletPhi <<
", gasGap=" <<
gasGap
711 <<
", measuresPhi=" << imeasphi <<
", strip=" << clus <<
", cf. ATLASRECTS-6124");
712 return StatusCode::SUCCESS;
716 return StatusCode::FAILURE;
725 std::vector<MuonSimData::Deposit> newdeps;
726 newdeps.push_back(deposit);
736 for (
auto it = channelSimDataMap.begin();
it != channelSimDataMap.end(); ++
it) {
740 auto insertResult = sdoContainer->insert(std::make_pair(
it->first,
simData));
741 if (!insertResult.second)
742 ATH_MSG_WARNING(
"Attention: this sdo is not recorded, since the identifier already exists in the sdoContainer map");
758 const std::vector<MuonSimData::Deposit> theDeps = (*map_iter).second;
762 std::multimap<double, MuonSimData::Deposit>
times;
765 for (
unsigned int k = 0;
k < theDeps.size();
k++) {
766 double time = theDeps[
k].second.secondEntry();
767 times.insert(std::multimap<double, MuonSimData::Deposit>::value_type(
time, theDeps[
k]));
777 double last_time = -10000;
778 for (; map_dep_iter !=
times.end(); ++map_dep_iter) {
779 double currTime = (*map_dep_iter).first;
785 if (sdoContainer->find(theId) != sdoContainer->end())
787 std::map<Identifier, MuonSimData>::const_iterator
it = sdoContainer->find(theId);
788 std::vector<MuonSimData::Deposit> deps = ((*it).second).getdeposits();
789 deps.push_back((*map_dep_iter).second);
792 std::vector<MuonSimData::Deposit> deposits;
793 deposits.push_back((*map_dep_iter).second);
795 sdoContainer->insert(std::make_pair(theId,
MuonSimData(deposits, 0)));
796 if (!insertResult.second)
798 "Attention TEMP: this sdo is not recorded, since the identifier already exists in the sdoContainer map");
802 if (std::abs(currTime - last_time) > (
m_deadTime)) {
803 ATH_MSG_DEBUG(
"deposit with time " << currTime <<
" is distant enough from previous (if any) hit on teh same strip");
804 last_time = (*map_dep_iter).first;
807 double uncorrjitter = 0;
810 if (tmp_UncorrJitter > 0.01) uncorrjitter = CLHEP::RandGaussZiggurat::shoot(rndmEngine, 0., tmp_UncorrJitter);
820 double newDigit_time = currTime + uncorrjitter +
m_rpc_time_shift -
tp - propTimeFromStripCenter;
822 double digi_ToT = -1.;
825 ATH_MSG_VERBOSE(
"last_time=currTime " << last_time <<
" jitter " << uncorrjitter <<
" TOFcorrection " <<
tp <<
" shift "
829 bool outsideDigitizationWindow =
outsideWindow(newDigit_time);
830 if (outsideDigitizationWindow) {
831 ATH_MSG_VERBOSE(
"hit outside digitization window - do not produce digits");
840 last_time = (*map_dep_iter).first;
842 std::unique_ptr<RpcDigit> newDigit = std::make_unique<RpcDigit>(theId, newDigit_time, digi_ToT,
false);
847 IdentifierHash coll_hash;
849 ATH_MSG_ERROR(
"Unable to get RPC hash id from RPC Digit collection "
850 <<
"context begin_index = " << rpcContext.
begin_index()
851 <<
" context end_index = " << rpcContext.
end_index() <<
" the identifier is ");
859 if (coll_hash >= collections.size()) {
860 collections.resize (coll_hash+1);
862 digitCollection = collections[coll_hash].
get();
863 if (!digitCollection) {
864 collections[coll_hash] = std::make_unique<RpcDigitCollection>(elemId, coll_hash);
865 digitCollection = collections[coll_hash].
get();
867 digitCollection->
push_back(std::move(newDigit));
871 if (sdoContainer->find(theId) != sdoContainer->end()) {
872 std::map<Identifier, MuonSimData>::const_iterator
it = sdoContainer->find(theId);
873 std::vector<MuonSimData::Deposit> deps = ((*it).second).getdeposits();
874 deps.push_back((*map_dep_iter).second);
876 std::vector<MuonSimData::Deposit> deposits;
877 deposits.push_back((*map_dep_iter).second);
879 sdoContainer->insert(std::make_pair(theId,
MuonSimData(deposits, 0)));
880 if (!insertResult.second)
882 "Attention: this sdo is not recorded, since teh identifier already exists in the sdoContainer map");
887 ATH_MSG_DEBUG(
"discarding digit due to dead time: " << (*map_dep_iter).first <<
" " << last_time);
896 ATH_CHECK(validHandle.record(std::move(inputSimHitColl)));
899 return StatusCode::SUCCESS;
◆ FCPEfficiency()
Definition at line 1561 of file RpcDigitizationTool.cxx.
1562 double qcharge = 1.;
1563 const int particlePdgId = genParticle->pdg_id();
1565 qcharge = (
static_cast<double>((std::abs(particlePdgId) / 1000) % 100)) / (
static_cast<double>((std::abs(particlePdgId) / 10) % 100));
1566 qcharge = ((
static_cast<double>((
static_cast<int>(qcharge * 100))))) / 100;
1567 if (particlePdgId < 0.0) qcharge = -qcharge;
1569 const double QPx = genParticle->momentum().px();
1570 const double QPy = genParticle->momentum().py();
1571 const double QPz = genParticle->momentum().pz();
1572 const double QE = genParticle->momentum().e();
1574 const double QP = std::hypot(QPx, QPy, QPz);
1575 const double QM = QM2 >=0 ? std::sqrt(QM2) : -1.;
1577 const double qbetagamma = QM > 0. ? QP / QM : -1.;
1581 for (
int i = 0;
i < 12;
i++) {
1582 if (Charge[
i] == std::abs(qcharge)) {
1587 int i_v = -99, j_v = 99;
1588 if (qbetagamma != -1) {
1589 for (
int i = 0;
i < 15;
i++) {
1590 if (Velocity[
i] <= qbetagamma) { i_v =
i; }
1592 for (
int i = 14;
i >= 0;
i--) {
1593 if (Velocity[
i] >= qbetagamma) { j_v =
i; }
1598 double eff_fcp = 1.0, eff_muon = 1.0;
1599 if (i_e >= 0 && i_e <= 11) {
1600 if (validIndex(j_v, N_Velocity) && validIndex(i_v, N_Velocity) && (j_v - i_v) == 1) {
1601 const double delta_v = Velocity[i_v] - Velocity[j_v];
1602 eff_fcp = (Eff_garfield[i_e][i_v] - Eff_garfield[i_e][j_v]) / delta_v * qbetagamma +
1603 (Eff_garfield[i_e][j_v] * Velocity[i_v] - Eff_garfield[i_e][i_v] * Velocity[j_v]) / delta_v;
1604 eff_muon = (Eff_garfield[11][i_v] - Eff_garfield[11][j_v]) / delta_v * qbetagamma +
1605 (Eff_garfield[11][j_v] * Velocity[i_v] - Eff_garfield[11][i_v] * Velocity[j_v]) / delta_v;
1606 }
else if (i_v == 14 && j_v == 99) {
1607 eff_fcp = Eff_garfield[i_e][14];
1608 eff_muon = Eff_garfield[11][14];
1609 }
else if (i_v == -99 && j_v == 0) {
1610 eff_fcp = Eff_garfield[i_e][0];
1611 eff_muon = Eff_garfield[11][0];
1613 ATH_MSG_WARNING(
"Wrong particle with unknown velocity! Scale factor is set to be 1.");
1616 ATH_MSG_WARNING(
"Wrong particle with unknown charge! Scale factor is set to be 1.");
1619 const double eff_SF = eff_fcp / eff_muon;
◆ fillTagInfo()
StatusCode RpcDigitizationTool::fillTagInfo |
( |
| ) |
|
|
private |
Definition at line 1059 of file RpcDigitizationTool.cxx.
1061 SmartIF<ITagInfoMgr> tagInfoMgr{Gaudi::svcLocator()->service(
"TagInfoMgr")};
1062 if (!tagInfoMgr) {
return StatusCode::FAILURE; }
1064 std::string RpctimeSchema =
"";
1065 std::stringstream RpctimeShift;
1069 RpctimeSchema =
"Datalike_TOFoff_TimeShift" + RpctimeShift.str() +
"nsec";
1071 RpctimeSchema =
"G4like_TOFon_TimeShift" + RpctimeShift.str() +
"nsec";
1076 if (
sc.isFailure()) {
1083 return StatusCode::SUCCESS;
◆ filterPassed()
virtual bool PileUpToolBase::filterPassed |
( |
| ) |
const |
|
inlineoverridevirtualinherited |
◆ fromSimHitToLayer()
Returns the position of the hit expressed in the gasGap coordinate system.
Yep. The second gas gap is upside down. But only for the rotated modules. If you're asking yourself why that's the case, my fellow reader I've not even the glimpse of a clue about this beauty
Definition at line 901 of file RpcDigitizationTool.cxx.
905 if (reEle->NphiStripPanels() != reEle->nGasGapPerLay()) {
912 const bool flip = reEle->numberOfLayers() == 2 &&
◆ getNextEvent()
StatusCode RpcDigitizationTool::getNextEvent |
( |
const EventContext & |
ctx | ) |
|
|
private |
Get next event and extract collection of hit collections:
Definition at line 351 of file RpcDigitizationTool.cxx.
363 if (!hitCollection.isValid()) {
364 ATH_MSG_ERROR(
"Could not get RPCSimHitCollection container " << hitCollection.name() <<
" from store "
365 << hitCollection.store());
366 return StatusCode::FAILURE;
370 m_thpcRPC = std::make_unique<TimedHitCollection<RPCSimHit>>(1);
371 m_thpcRPC->insert(0, hitCollection.cptr());
372 ATH_MSG_DEBUG(
"RPCSimHitCollection found with " << hitCollection->size() <<
" hits");
374 return StatusCode::SUCCESS;
377 TimedHitCollList hitCollList;
381 return StatusCode::FAILURE;
383 if (hitCollList.empty()) {
385 return StatusCode::FAILURE;
391 m_thpcRPC = std::make_unique<TimedHitCollection<RPCSimHit>>();
395 while (iColl != endColl) {
397 m_thpcRPC->insert(iColl->first, p_collection);
402 return StatusCode::SUCCESS;
◆ initialize()
StatusCode RpcDigitizationTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
◆ initializeRunDependentParameters()
StatusCode RpcDigitizationTool::initializeRunDependentParameters |
( |
| ) |
|
|
private |
Definition at line 177 of file RpcDigitizationTool.cxx.
180 SmartIF<IGeoModelSvc> geoModel{Gaudi::svcLocator()->service(
"GeoModelSvc")};
183 return StatusCode::FAILURE;
187 std::string atlasVersion = geoModel->atlasVersion();
189 SmartIF<IRDBAccessSvc> rdbAccess{Gaudi::svcLocator()->service(
"RDBAccessSvc")};
192 return StatusCode::FAILURE;
198 std::string configVal =
"";
200 IRDBRecordset_ptr atlasCommonRec = rdbAccess->getRecordsetPtr(
"AtlasCommon", atlasVersion,
"ATLAS");
201 if (atlasCommonRec->size() == 0) {
204 configVal = (*atlasCommonRec)[0]->getString(
"CONFIG");
205 ATH_MSG_INFO(
"From DD Database, Configuration is " << configVal);
206 if (configVal ==
"RUN1") {
208 }
else if (configVal ==
"RUN2") {
210 }
else if (configVal ==
"RUN3") {
212 }
else if (configVal ==
"RUN4") {
216 ATH_MSG_FATAL(
"Unexpected value for geometry config read from the database: " << configVal);
217 return StatusCode::FAILURE;
224 ATH_MSG_INFO(
"From Geometry DB: MuonSpectrometer configuration is: RUN1 or MuonGeometry = R.06");
226 ATH_MSG_INFO(
"From Geometry DB: MuonSpectrometer configuration is: RUN2 or MuonGeometry = R.07");
227 else if (
run == Run3)
228 ATH_MSG_INFO(
"From Geometry DB: MuonSpectrometer configuration is: RUN3 or MuonGeometry = R.09");
229 else if (
run == Run4)
230 ATH_MSG_INFO(
"From Geometry DB: MuonSpectrometer configuration is: RUN4 or MuonGeometry = R.10");
243 if (configVal ==
"RUN1") {
262 ATH_MSG_INFO(
"Run3/4: configuration parameter not from COOL");
269 ATH_MSG_INFO(
"RPC Run1/2/3-dependent configuration is enforced");
271 ATH_MSG_WARNING(
"Run1/2/3-dependent configuration is bypassed; be careful with option settings");
282 return StatusCode::SUCCESS;
◆ mergeEvent()
StatusCode RpcDigitizationTool::mergeEvent |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
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 406 of file RpcDigitizationTool.cxx.
417 ATH_CHECK(sdoContainer.record(std::make_unique<MuonSimDataCollection>()));
427 for (
size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
428 if (collections[coll_hash]) {
429 ATH_CHECK( digitContainer->addCollection (collections[coll_hash].release(), coll_hash) );
◆ outsideWindow()
bool RpcDigitizationTool::outsideWindow |
( |
double |
time | ) |
const |
|
inlineprivate |
◆ PackMCTruth()
long long int RpcDigitizationTool::PackMCTruth |
( |
float |
proptime, |
|
|
float |
tof, |
|
|
float |
posx, |
|
|
float |
posz |
|
) |
| const |
|
private |
Definition at line 1008 of file RpcDigitizationTool.cxx.
1011 ATH_MSG_WARNING(
"A poblem: packing a propagation time <0 " << proptime <<
" redefine it as 0");
1014 long long int new_proptime =
int(proptime * 10) & 0xff;
1020 long long int new_bctime =
int((bctime + 300.) * 10.) & 0xffff;
1025 long long int new_posy =
int((posy + 1500.) * 10.) & 0xffff;
1030 long long int new_posz =
int((posz + 1500.) * 10.) & 0xffff;
1032 return (new_proptime + (new_bctime << 8) + (new_posy << 24) + (new_posz << 40));
◆ physicalClusterSize()
Cluster simulation: first step.
The impact point of the particle across the strip is used to decide whether the cluster size should be 1 or 2
Definition at line 923 of file RpcDigitizationTool.cxx.
930 std::array<int, 3>
result{};
936 const double pitch= ele->StripPitch(measuresPhi);
939 const int nstrip = ele->stripNumber(position.block<2,1>(0,0),
id);
940 const int numStrips = ele->Nstrips(measuresPhi);
945 if (nstrip < 1 || nstrip > numStrips) {
946 return make_array<int, 3>(-1);
949 float xstripnorm = (locStripPos -position).
x() / pitch ;
◆ prepareEvent()
StatusCode RpcDigitizationTool::prepareEvent |
( |
const EventContext & |
ctx, |
|
|
const unsigned int |
|
|
) |
| |
|
finaloverridevirtual |
When being run from PileUpToolsAlgs, this method is called at the start of the subevts loop.
Not able to access SubEvents
Definition at line 305 of file RpcDigitizationTool.cxx.
310 m_thpcRPC = std::make_unique<TimedHitCollection<RPCSimHit>>();
313 return StatusCode::SUCCESS;
◆ processAllSubEvents() [1/2]
StatusCode RpcDigitizationTool::processAllSubEvents |
( |
const EventContext & |
ctx | ) |
|
|
finaloverridevirtual |
alternative interface which uses the PileUpMergeSvc to obtain all the required SubEvents.
Reimplemented from PileUpToolBase.
Definition at line 440 of file RpcDigitizationTool.cxx.
454 ATH_CHECK(sdoContainer.record(std::make_unique<MuonSimDataCollection>()));
463 if (StatusCode::FAILURE ==
status) {
471 for (
size_t coll_hash = 0; coll_hash < collections.size(); ++coll_hash) {
472 if (collections[coll_hash]) {
473 ATH_CHECK( digitContainer->addCollection (collections[coll_hash].release(), coll_hash) );
◆ 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()
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 317 of file RpcDigitizationTool.cxx.
321 TimedHitCollList hitCollList;
324 hitCollList.empty()) {
326 return StatusCode::FAILURE;
335 for (; iColl != endColl; ++iColl) {
339 ATH_MSG_DEBUG(
"RPCSimHitCollection found with " << hitCollPtr->
size() <<
" hits");
340 ATH_MSG_VERBOSE(
"time index info. time: " << timeIndex.time() <<
" index: " << timeIndex.index() <<
" type: " << timeIndex.type());
342 m_thpcRPC->insert(timeIndex, hitCollPtr);
346 return StatusCode::SUCCESS;
◆ PropagationTime()
Calculates the propagation time along the strip.
Definition at line 992 of file RpcDigitizationTool.cxx.
998 distance = ele->distanceToPhiReadout(globPos);
1000 distance = ele->distanceToEtaReadout(globPos);
1004 return std::abs(
distance * SIG_VEL * 1.
e-3);
◆ resetFilter()
virtual void PileUpToolBase::resetFilter |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ retrieveCondData()
template<class CondType >
Definition at line 286 of file RpcDigitizationTool.cxx.
291 ATH_MSG_DEBUG(
"No key has been configured for object "<<
typeid(CondType).
name()<<
". Clear pointer");
293 return StatusCode::SUCCESS;
296 if (!readHandle.isValid()){
298 return StatusCode::FAILURE;
300 condPtr = readHandle.cptr();
301 return StatusCode::SUCCESS;
◆ timeOverThreshold()
double RpcDigitizationTool::timeOverThreshold |
( |
CLHEP::HepRandomEngine * |
rndmEngine | ) |
|
|
staticprivate |
Definition at line 1623 of file RpcDigitizationTool.cxx.
1626 constexpr
double tot_mean_narrow = 16.;
1627 constexpr
double tot_sigma_narrow = 2.;
1628 constexpr
double tot_mean_wide = 15.;
1629 constexpr
double tot_sigma_wide = 4.5;
1633 if (CLHEP::RandFlat::shoot(rndmEngine)<0.75) {
1634 thetot = CLHEP::RandGaussZiggurat::shoot(rndmEngine, tot_mean_narrow, tot_sigma_narrow);
1636 thetot = CLHEP::RandGaussZiggurat::shoot(rndmEngine, tot_mean_wide, tot_sigma_wide);
1639 return (thetot > 0.) ? thetot : 0.;
◆ toProcess()
virtual bool PileUpToolBase::toProcess |
( |
int |
bunchXing | ) |
const |
|
inlineoverridevirtualinherited |
◆ TurnOnStrips()
Cluster simulation: second step.
Additional strips are turned on in order to reproduce the observed cluster size distribution
Definition at line 961 of file RpcDigitizationTool.cxx.
970 }
else if (
pcs[0] == 2) {
972 }
else if (
pcs[0] > 2) {
974 if (fmod(
pcs[0], 2) == 0)
pcs[1] =
pcs[1] + 1;
976 }
else if (
pcs[0] < -2) {
983 pcs[1] = std::clamp(
pcs[1], 1, nstrips);
984 pcs[2] = std::clamp(
pcs[2], 1, nstrips);
◆ UnPackMCTruth()
void RpcDigitizationTool::UnPackMCTruth |
( |
double |
theWord, |
|
|
float & |
proptime, |
|
|
float & |
tof, |
|
|
float & |
posy, |
|
|
float & |
posz |
|
) |
| |
|
staticprivate |
Definition at line 1036 of file RpcDigitizationTool.cxx.
1038 using Repacker =
union
1046 MCTruth.dWord = theWord;
1047 proptime = ((MCTruth.iWord) & 0x00000000000000ffLL) / 10.;
1048 bctime = (((MCTruth.iWord) & 0x0000000000ffff00LL) >> 8) / 10.;
1049 posy = (((MCTruth.iWord) & 0x000000ffff000000LL) >> 24) / 10.;
1050 posz = (((MCTruth.iWord) & 0x00ffff0000000000LL) >> 40) / 10.;
1053 bctime = bctime - 300.;
1054 posy = posy - 1500.;
1055 posz = posz - 1500.;
◆ m_BIL_id
int RpcDigitizationTool::m_BIL_id {-1} |
|
protected |
◆ m_BIS_id
int RpcDigitizationTool::m_BIS_id {-1} |
|
protected |
◆ m_BOF_id
int RpcDigitizationTool::m_BOF_id {-1} |
|
protected |
◆ m_BOG_BOF_DoubletR2_OFF
Gaudi::Property<bool> RpcDigitizationTool::m_BOG_BOF_DoubletR2_OFF {this, "Force_BOG_BOF_DoubletR2_OFF", false, "Turn-off BOG and BOF with DoubletR=2"} |
|
protected |
◆ m_BOG_id
int RpcDigitizationTool::m_BOG_id {-1} |
|
protected |
◆ m_BOS_id
int RpcDigitizationTool::m_BOS_id {-1} |
|
protected |
◆ m_ClusterSize1_2uncorr
Gaudi::Property<bool> RpcDigitizationTool::m_ClusterSize1_2uncorr |
|
protected |
Initial value:{this, "ClusterSize1_2uncorr", false,
"Cluster size 1 and 2 not correlated to track position"}
Definition at line 235 of file RpcDigitizationTool.h.
◆ m_ClusterSize_BIS78_fromCOOL
Gaudi::Property<bool> RpcDigitizationTool::m_ClusterSize_BIS78_fromCOOL {this, "ClusterSize_BIS78_fromCOOL", false, " read BIS78 Cluster Size from COOL DB"} |
|
protected |
◆ m_ClusterSize_fromCOOL
Gaudi::Property<bool> RpcDigitizationTool::m_ClusterSize_fromCOOL {this, "ClusterSize_fromCOOL", false, "Read cluster size from CoolDB"} |
|
protected |
◆ m_CorrJitter
Gaudi::Property<double> RpcDigitizationTool::m_CorrJitter {this, "CorrJitter", 0.0, "jitter correlated between eta and phi"} |
|
private |
◆ m_CorrJitter_BIS78
Gaudi::Property<double> RpcDigitizationTool::m_CorrJitter_BIS78 {this, "CorrJitter_BIS78", 0.0, "jitter correlated between eta and phi BIS78"} |
|
private |
◆ m_CutMaxClusterSize
Gaudi::Property<float> RpcDigitizationTool::m_CutMaxClusterSize {this, "CutMaxClusterSize", 5.0, ""} |
|
protected |
◆ m_CutProjectedTracks
Gaudi::Property<int> RpcDigitizationTool::m_CutProjectedTracks {this, "CutProjectedTracks", 100, ""} |
|
protected |
◆ m_deadTime
Gaudi::Property<int> RpcDigitizationTool::m_deadTime {this, "DeadTime", 100., "dead time"} |
|
private |
◆ m_detMgrKey
Initial value:{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}
Definition at line 158 of file RpcDigitizationTool.h.
◆ m_Efficiency_BIS78_fromCOOL
Gaudi::Property<bool> RpcDigitizationTool::m_Efficiency_BIS78_fromCOOL {this, "Efficiency_BIS78_fromCOOL", false, " read BIS78 Efficiency from COOL DB"} |
|
protected |
◆ m_Efficiency_fromCOOL
Gaudi::Property<bool> RpcDigitizationTool::m_Efficiency_fromCOOL {this, "Efficiency_fromCOOL", false, "Read efficiency from CoolDB"} |
|
protected |
◆ m_EfficiencyPatchForBMShighEta
Gaudi::Property<bool> RpcDigitizationTool::m_EfficiencyPatchForBMShighEta |
|
protected |
Initial value:{this, "EfficiencyPatchForBMShighEta", false,
"special patch to be true only when m_Efficiency_fromCOOL=true and "
"/RPC/DQMF/ELEMENT_STATUS tag is RPCDQMFElementStatus_2012_Jaunuary_26"}
Definition at line 231 of file RpcDigitizationTool.h.
◆ m_filterPassed
bool PileUpToolBase::m_filterPassed {true} |
|
protectedinherited |
◆ m_FirstClusterSizeInTail
Gaudi::Property<int> RpcDigitizationTool::m_FirstClusterSizeInTail {this, "FirstClusterSizeInTail", 3, ""} |
|
private |
◆ 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_FracClusterSize1_A
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_FracClusterSize1_A {this, "FracClusterSize1_A", {}, ""} |
|
private |
◆ m_FracClusterSize1_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_FracClusterSize1_BIS78 {this, "FracClusterSize1_BIS78", 0.60, ""} |
|
private |
◆ m_FracClusterSize1_C
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_FracClusterSize1_C {this, "FracClusterSize1_C", {}, ""} |
|
private |
◆ m_FracClusterSize2_A
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_FracClusterSize2_A {this, "FracClusterSize2_A", {}, ""} |
|
private |
◆ m_FracClusterSize2_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_FracClusterSize2_BIS78 {this, "FracClusterSize2_BIS78", 0.35, ""} |
|
private |
◆ m_FracClusterSize2_C
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_FracClusterSize2_C {this, "FracClusterSize2_C", {}, ""} |
|
private |
◆ m_FracClusterSizeTail_A
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_FracClusterSizeTail_A {this, "FracClusterSizeTail_A", {}, ""} |
|
private |
◆ m_FracClusterSizeTail_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_FracClusterSizeTail_BIS78 {this, "FracClusterSizeTail_BIA78", 0.05, ""} |
|
private |
◆ m_FracClusterSizeTail_C
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_FracClusterSizeTail_C {this, "FracClusterSizeTail_C", {}, ""} |
|
private |
◆ m_hitsContainerKey
◆ m_idHelper
◆ m_ignoreRunDepConfig
Gaudi::Property<bool> RpcDigitizationTool::m_ignoreRunDepConfig |
|
protected |
Initial value:{this, "IgnoreRunDependentConfig", false,
"true if we want to force the RUN1/RUN2 dependent options"}
Definition at line 238 of file RpcDigitizationTool.h.
◆ m_includePileUpTruth
Gaudi::Property<bool> RpcDigitizationTool::m_includePileUpTruth {this, "IncludePileUpTruth", true, "pileup truth veto"} |
|
private |
◆ m_inputHitCollectionName
std::string RpcDigitizationTool::m_inputHitCollectionName {""} |
|
protected |
◆ m_kill_deadstrips
Gaudi::Property<bool> RpcDigitizationTool::m_kill_deadstrips {this, "KillDeadStrips", false, ""} |
|
private |
◆ m_lastXing
Gaudi::Property<int> PileUpToolBase::m_lastXing |
|
protectedinherited |
Initial value:{this, "LastXing", 999,
"Last bunch-crossing in which det is live"}
Definition at line 56 of file PileUpToolBase.h.
◆ m_MeanClusterSizeTail_A
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_MeanClusterSizeTail_A {this, "MeanClusterSizeTail_A", {}, ""} |
|
private |
◆ m_MeanClusterSizeTail_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_MeanClusterSizeTail_BIS78 {this, "MeanClusterSizeTail_BIA78", 3.5, ""} |
|
private |
◆ m_MeanClusterSizeTail_C
Gaudi::Property<std::vector<double> > RpcDigitizationTool::m_MeanClusterSizeTail_C {this, "MeanClusterSizeTail_C", {}, ""} |
|
private |
◆ m_mergeSvc
◆ m_muonHelper
◆ m_muonOnlySDOs
Gaudi::Property<bool> RpcDigitizationTool::m_muonOnlySDOs {this, "MuonOnlySDOs", true, ""} |
|
private |
◆ m_OnlyEtaEff_A
Gaudi::Property<std::vector<float> > RpcDigitizationTool::m_OnlyEtaEff_A {this, "OnlyEtaEff_A", {}, ""} |
|
private |
◆ m_OnlyEtaEff_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_OnlyEtaEff_BIS78 {this, "OnlyEtaEff_BIS78", 0.96, ""} |
|
private |
◆ m_OnlyEtaEff_C
Gaudi::Property<std::vector<float> > RpcDigitizationTool::m_OnlyEtaEff_C {this, "OnlyEtaEff_C", {}, ""} |
|
private |
◆ m_OnlyPhiEff_A
Gaudi::Property<std::vector<float> > RpcDigitizationTool::m_OnlyPhiEff_A {this, "OnlyPhiEff_A", {}, ""} |
|
private |
◆ m_OnlyPhiEff_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_OnlyPhiEff_BIS78 {this, "OnlyPhiEff_BIS78", 0.96, ""} |
|
private |
◆ m_OnlyPhiEff_C
Gaudi::Property<std::vector<float> > RpcDigitizationTool::m_OnlyPhiEff_C {this, "OnlyPhiEff_C", {}, ""} |
|
private |
◆ m_onlyUseContainerName
Gaudi::Property<bool> RpcDigitizationTool::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 RpcDigitizationTool.h.
◆ m_outputDigitCollectionKey
Initial value:{
this, "OutputObjectName", "RPC_DIGITS", "WriteHandleKey for Output RpcDigitContainer"}
Definition at line 218 of file RpcDigitizationTool.h.
◆ m_outputSDO_CollectionKey
Initial value:{
this, "OutputSDOName", "RPC_SDO", "WriteHandleKey for Output MuonSimDataCollection"}
Definition at line 220 of file RpcDigitizationTool.h.
◆ m_patch_for_rpc_time
Gaudi::Property<bool> RpcDigitizationTool::m_patch_for_rpc_time {this, "PatchForRpcTime", false, ""} |
|
private |
◆ m_PhiAndEtaEff_A
Gaudi::Property<std::vector<float> > RpcDigitizationTool::m_PhiAndEtaEff_A {this, "PhiAndEtaEff_A", {}, ""} |
|
private |
◆ m_PhiAndEtaEff_BIS78
Gaudi::Property<float> RpcDigitizationTool::m_PhiAndEtaEff_BIS78 {this, "PhiAndEtaEff_BIS78", 0.93, ""} |
|
private |
◆ m_PhiAndEtaEff_C
Gaudi::Property<std::vector<float> > RpcDigitizationTool::m_PhiAndEtaEff_C {this, "PhiAndEtaEff_C", {}, ""} |
|
private |
◆ m_readKey
◆ m_rndmSvc
◆ m_rpc_time_shift
Gaudi::Property<double> RpcDigitizationTool::m_rpc_time_shift |
|
private |
Initial value:{this, "PatchForRpcTimeShift", 12.5,
"shift rpc digit time to match hardware time calibration: Zmumu muons are at the center of "
"BC0, i.e. at 12.5ns+BC0shift w.r.t. RPC readout (BC0shift=2x3.125)"}
Definition at line 168 of file RpcDigitizationTool.h.
◆ m_RPC_TimeSchema
Gaudi::Property<std::string> RpcDigitizationTool::m_RPC_TimeSchema {this, "RPC_TimeSchema", "RPC_TimeSchema", "Tag info name of Rpc Time Info"} |
|
protected |
◆ m_RPCHitCollList
◆ m_RPCInfoFromDb
Gaudi::Property<bool> RpcDigitizationTool::m_RPCInfoFromDb {this, "RPCInfoFromDb", false, ""} |
|
protected |
◆ m_sdo_tmp_map
◆ m_sdoAreOnlyDigits
Gaudi::Property<bool> RpcDigitizationTool::m_sdoAreOnlyDigits |
|
protected |
Initial value:{this, "RPCSDOareRPCDigits", true,
"decide is SDO deposits are saved for all G4 hits or only for those accepted as digits"}
Definition at line 227 of file RpcDigitizationTool.h.
◆ m_simHitValidKey
◆ m_thpcRPC
◆ m_timeWindowLowerOffset
Gaudi::Property<double> RpcDigitizationTool::m_timeWindowLowerOffset {this, "WindowLowerOffset", -100., "digitization window lower limit"} |
|
private |
◆ m_timeWindowUpperOffset
Gaudi::Property<double> RpcDigitizationTool::m_timeWindowUpperOffset {this, "WindowUpperOffset", +150., "digitization window lower limit"} |
|
private |
◆ m_turnON_clustersize
Gaudi::Property<bool> RpcDigitizationTool::m_turnON_clustersize {this, "turnON_clustersize", true, ""} |
|
private |
◆ m_turnON_efficiency
Gaudi::Property<bool> RpcDigitizationTool::m_turnON_efficiency {this, "turnON_efficiency", true, ""} |
|
private |
◆ m_UncorrJitter
Gaudi::Property<double> RpcDigitizationTool::m_UncorrJitter {this, "UncorrJitter", 1.5, "jitter uncorrelated between eta and phi"} |
|
private |
Calculates the position of the hit wrt to the strip panel this transformation is needed since the impact point comes from the SD int he gas gap's reference frame.
Definition at line 126 of file RpcDigitizationTool.h.
◆ m_UncorrJitter_BIS78
Gaudi::Property<double> RpcDigitizationTool::m_UncorrJitter_BIS78 {this, "UncorrJitter_BIS78", 0.3, "jitter uncorrelated between eta and phi BIS78"} |
|
private |
◆ m_validationSetup
Gaudi::Property<bool> RpcDigitizationTool::m_validationSetup {this, "ValidationSetup", false, ""} |
|
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:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
USAGE: openCoraCool.exe "COOLONL_SCT/COMP200".
std::string GetStationName(const int &hid) const
int stationNameIndex(const std::string &name) const
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
constexpr uint8_t stationPhi
station Phi 1 to 8
virtual const Amg::Transform3D & transform() const override
Return local to global transform.
static const RpcHitIdHelper * GetHelper(unsigned int nGasGaps=2)
std::pair< HepMcParticleLink, MuonMCData > Deposit
int GetDoubletPhi(const int &hid) const
Identifier elementID(int stationName, int stationEta, int stationPhi, int doubletR) const
int GetMeasuresPhi(const int &hid) const
int doubletZ(const Identifier &id) const
size_type end_index() const
bool measuresPhi(const Identifier &id) const override
int GetDoubletZ(const int &hid) const
const T * get(size_type n) const
Access an element, as an rvalue.
AtlasHitsVector< RPCSimHit > RPCSimHitCollection
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
int stationName(const Identifier &id) const
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
const std::string & key() const
Return the StoreGate ID for the referenced object.
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
bool isGenericMultichargedParticle(const T &p)
In addition, there is a need to identify ”Q-ball” and similar very exotic (multi-charged) particles w...
std::list< value_t > type
type of the collection of timed data object
int gasGap(const Identifier &id) const override
get the hashes
HepMC::ConstGenParticlePtr cptr() const
Dereference.
a link optimized in size for a GenParticle in a McEventCollection
size_type begin_index() const
Amg::Transform3D localToGlobalTransf(const Identifier &id) const
int GetPhiSector(const int &hid) const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
int doubletR(const Identifier &id) const
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
Identifier panelID(const Identifier &padID, int gasGap, int measuresPhi) const
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
int GetGasGapLayer(const int &hid) const
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
const GenParticle * ConstGenParticlePtr
Definition of ATLAS Math & Geometry primitives (Amg)
bool rotatedRpcModule() const
A wrapper class for event-slot-local random engines.
Amg::Vector3D stripPos(const Identifier &id) const
bool valid(const Identifier &id) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
static HepMcParticleLink getRedirectedLink(const HepMcParticleLink &particleLink, uint32_t eventIndex, const EventContext &ctx)
Return a HepMcParticleLink pointing at the same particle, but in a different GenEvent.
StatusCode initialize(bool used=true)
int stationEta(const Identifier &id) const
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Eigen::Matrix< double, 3, 1 > Vector3D
#define THROW_EXCEPTION(MESSAGE)
size_type module_hash_max() const
the maximum hash value
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
void print(Identifier id, const IdContext *context=0) const
Expanded print out of any identifier.
int GetDoubletR(const int &hid) const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
def time(flags, cells_name, *args, **kw)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override
Create hash id from compact id (return == 0 for OK)
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
IdContext module_context() const
id for module
float hitTime(const AFP_SIDSimHit &hit)
constexpr uint8_t stationEta
1 to 3
constexpr int pow(int base, int exp) noexcept
a struct encapsulating the identifier of a pile-up event
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
int GetZSector(const int &hid) const
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
int doubletPhi(const Identifier &id) const