ATLAS Offline Software
Loading...
Searching...
No Matches
VP1RawDataColl_MM_RDO.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5
7// //
8// Implementation of class VP1RawDataColl_MM_RDO //
9// //
10// Author: Riccardo Maria BIANCHI <riccardo.maria.bianchi>
11// Initial version: December 2024 //
12// //
14
19
24
26
28
29//____________________________________________________________________
34
35//____________________________________________________________________
42
43
44//____________________________________________________________________
46 : VP1RawDataCollBase(common,key), m_d(new Imp)
47{
48 connect(common->controller(), SIGNAL(mmAllowedChargeChanged(const VP1Interval&)),
49 this, SLOT(setMmAllowedCharge(const VP1Interval&)));
50 setMmAllowedCharge(common->controller()->mmAllowedCharge());
51 connect(common->controller(), SIGNAL(mmAllowedTimeChanged(const VP1Interval&)),
52 this, SLOT(setMmAllowedTime(const VP1Interval&)));
53 setMmAllowedTime(common->controller()->mmAllowedTime());
54}
55
56//____________________________________________________________________
61
62//____________________________________________________________________
67
68//____________________________________________________________________
71 message("Muon geometry not configured in job");
72 return false;
73 }
74
75 // get the detMgr
76 // TODO: we should probably simplify by moving to:
77 // const MuonGM::MuonDetectorManager * detmgr = VP1DetInfo::muonDetMgr();
79 "MuonDetectorManager"};
80 detMgrKey.initialize().ignore();
82
83 SG::ReadHandleKey<MmDigitContainer> digitContainerKey{"MM_DIGITS"};
84 digitContainerKey.initialize().ignore();
85
86 const EventContext& ctx = Gaudi::Hive::currentContext();
87
88 SG::ReadHandle<MmDigitContainer> container(digitContainerKey, ctx);
89 if (!container.isValid()) {
90 std::cout << "Could not find MmDigitContainer called " << container.name()
91 << " in store " << container.store() << std::endl;
92 }
93
94 // Iterate on the collections
95 for (const MmDigitCollection* coll : *container) {
97 for (const MmDigit* digit : *coll) {
98 const Identifier digitId{digit->identify()};
99
100 // example from Johannes
101 /*
102 mdtReadoutElement = detMgr->getMdtReadoutElement(digitId);
103 const Amg::Vector3D tubePos = mdtReadoutElement->tubePos(digitId);
104 */
105
106 if (digit)
107 addHandle(new VP1RawDataHandle_MM_RDO(this, digit));
108 }
109 }
110
111 return true;
112}
113
114//____________________________________________________________________
116{
117 const auto* digit = static_cast<const VP1RawDataHandle_MM_RDO*>(handle);
118 return m_d->mmAllowedCharge.contains(digit->amplitude()) &&
119 m_d->mmAllowedTime.contains(digit->time());
120}
121
123{
124 if (m_d->mmAllowedCharge == range)
125 return;
126 m_d->mmAllowedCharge = range;
128}
129
131{
132 if (m_d->mmAllowedTime == range)
133 return;
134 m_d->mmAllowedTime = range;
136}
Use IdentifiableContainer with MmDigitCollection.
StatusCode initialize(bool used=true)
Property holding a SG store/key/clid from which a ReadHandle is made.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void message(const QString &) const
static bool hasMuonGeometry()
static void setMaterialParametersFromRGB(SoMaterial *m, const int r, const int g, const int b, const double &brightness=0.0, const double &transp=0.0)
VP1RawDataCollBase(VP1RawDataCommonData *, const QString &key)
void addHandle(VP1RawDataHandleBase *)
void assignDefaultMaterial(SoMaterial *) const
static QStringList availableCollections(IVP1System *)
void setMmAllowedCharge(const VP1Interval &)
bool cut(VP1RawDataHandleBase *)
VP1RawDataColl_MM_RDO(VP1RawDataCommonData *, const QString &key)
void setMmAllowedTime(const VP1Interval &)
QStringList getKeys() const