![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <MdtCablingJsonDumpAlg.h>
|
| MdtCablingJsonDumpAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~MdtCablingJsonDumpAlg ()=default |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual unsigned int | cardinality () const override final |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > | m_DetectorManagerKey |
|
SG::ReadCondHandleKey< MuonMDT_CablingMap > | m_cablingKey {this, "ReadKey", "MuonMDT_CablingMap", "Key of input MDT cabling map"} |
|
Gaudi::Property< std::string > | m_summaryTxt {this, "SummaryFile", "SummaryFile.txt", "Summary of the extracted mapping"} |
|
Gaudi::Property< std::string > | m_mezzJSON {this, "OutMezzanineJSON", "MezzMapping.json", "Mezzanine JSON"} |
|
Gaudi::Property< std::string > | m_cablingJSON {this, "OutCablingJSON", "MdtCabling.json", "Cabling JSON"} |
|
DataObjIDColl | m_extendedExtraObjects |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 21 of file MdtCablingJsonDumpAlg.h.
◆ CablingData
◆ StoreGateSvc_t
◆ MdtCablingJsonDumpAlg()
MdtCablingJsonDumpAlg::MdtCablingJsonDumpAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~MdtCablingJsonDumpAlg()
virtual MdtCablingJsonDumpAlg::~MdtCablingJsonDumpAlg |
( |
| ) |
|
|
virtualdefault |
◆ cardinality()
virtual unsigned int MdtCablingJsonDumpAlg::cardinality |
( |
| ) |
const |
|
inlinefinaloverridevirtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode MdtCablingJsonDumpAlg::execute |
( |
| ) |
|
|
overridevirtual |
Struct to perform the mapping between online offline tube
Create the cabling object
Test if the online channel can be found
Next step is to filter all the mezzanine cards
Assign MROD / SubDet / CSM
Offline Identifier (stationIdx, eta,phi, ml)
Tube zero
The staggering of the hedgehog cards does not coincide with the multi-layer staggering i.e. tubeZero is 2,3,4,5 or 2,3,4,5,6,7.
Check whether the same layout is already used somewhere
Summary file
Write mezzanine file
Definition at line 45 of file MdtCablingJsonDumpAlg.cxx.
46 const EventContext& ctx = Gaudi::Hive::currentContext();
47 ATH_MSG_INFO(
"Dump cabling & mezzanines into JSON file");
50 if (!detectorMgr.isValid()){
52 return StatusCode::FAILURE;
58 return StatusCode::FAILURE;
62 std::vector<MdtMezzanineCard> cached_cards{};
63 std::set<MdtCablingData> cached_chnls{};
76 std::map<TdcIdentifier, Mapping> chamber_mezz{};
78 for (
int tubeInLayer = 1 ; tubeInLayer <= readEle->
getNtubesperlayer(); ++tubeInLayer) {
81 layer, tubeInLayer, is_valid);
92 return StatusCode::FAILURE;
95 if (chamber_mezz.find(tdc_id) == chamber_mezz.end()) {
98 chamber_mezz[tdc_id][
cabling_data.channelId] = dummy_card.tubeNumber(
layer, tubeInLayer);
102 for (
auto&[tdc, mezz_mapping] : chamber_mezz) {
107 mezzCablingId.tdcId = tdc.tdcId;
113 mezzCablingId.tube = chipInCab->
tubeZero();
115 const uint8_t tubeOffSet = (mezzCablingId.tube-1)%dummy_card.numTubesPerLayer();
120 for (
size_t chan = 0 ;
chan < mezz_mapping.size(); ++
chan) {
121 const OfflineCh tube_lay =
remap.offlineTube(
chan, msgStream());
122 if (!tube_lay.isValid)
continue;
123 uint8_t tubeNumber = tube_lay.tube + tubeOffSet + 1;
124 mezz_mapping[
chan] =
remap.tubeNumber(tube_lay.layer, tubeNumber);
128 Mapping& mtmp = mezz_mapping;
129 std::vector<MdtMezzanineCard>::const_iterator itr = std::find_if(cached_cards.begin(), cached_cards.end(),
131 if (dummy_card.numTubeLayers() != card.numTubeLayers()) return false;
132 for (size_t ch =0; ch < mtmp.size(); ++ch) {
133 if (mtmp[ch] != card.tdcToTubeMap()[ch]) return false;
137 if (itr != cached_cards.end()) {
138 mezzCablingId.mezzanine_type = itr->id();
140 cached_cards.emplace_back(mezz_mapping, dummy_card.numTubeLayers(), cached_cards.size() + 10);
141 if (!cached_cards.back().checkConsistency(msgStream())) {
143 return StatusCode::FAILURE;
145 mezzCablingId.mezzanine_type = cached_cards.back().id();
147 cached_chnls.insert(std::move(mezzCablingId));
158 return StatusCode::FAILURE;
160 summary<<
"Extracted "<<cached_cards.size()<<
" mezzanine card layouts and "
161 <<cached_chnls.size()<<
" chamber channels. "<<std::endl<<std::endl<<std::endl;
166 if (
cabling.mezzanine_type != card.id())
continue;
170 summary<<static_cast<int>(std::abs(chamb.eta));
171 summary<<(chamb.eta > 0 ?
"A" :
"C");
172 summary<<static_cast<int>(chamb.phi);
173 summary<<
"M"<<
static_cast<int>(chamb.multilayer);
176 summary<<static_cast<int>(
cabling.tdcId)<<
", ";
179 <<
"##############################################################"<<std::endl;
185 if (!mezz_json.good()) {
187 return StatusCode::FAILURE;
189 mezz_json<<
"["<<std::endl;
190 for (
size_t i = 0;
i < cached_cards.size() ; ++
i) {
192 mezz_json<<
" {"<<std::endl;
193 mezz_json<<
" \"mezzId\": "<<
static_cast<int>(card.
id())<<
","<<std::endl;
194 mezz_json<<
" \"nTubeLayer\": "<<
static_cast<int>(card.
numTubeLayers())<<
","<<std::endl;
195 mezz_json<<
" \"tdcToTubeMap\": [";
200 mezz_json<<
"]"<<std::endl;
202 if (
i +1 != cached_cards.size()) mezz_json<<
",";
203 mezz_json<<std::endl;
209 if (!chamb_json.good()) {
211 return StatusCode::FAILURE;
213 chamb_json<<
"["<<std::endl;
216 chamb_json<<
" {"<<std::endl;
217 chamb_json<<
" \"station\": \""<<idHelper.
stationNameString(chamb.stationIndex)<<
"\","<<std::endl;
218 chamb_json<<
" \"eta\": "<<
static_cast<int>(chamb.eta)<<
","<<std::endl;
219 chamb_json<<
" \"phi\": "<<
static_cast<int>(chamb.phi)<<
","<<std::endl;
220 chamb_json<<
" \"ml\": "<<
static_cast<int>(chamb.multilayer)<<
","<<std::endl;
221 chamb_json<<
" \"subDet\": "<<
static_cast<int>(chamb.subdetectorId)<<
","<<std::endl;
222 chamb_json<<
" \"csm\": "<<
static_cast<int>(chamb.csm)<<
","<<std::endl;
223 chamb_json<<
" \"mrod\": "<<
static_cast<int>(chamb.mrod)<<
","<<std::endl;
224 chamb_json<<
" \"tdcId\": "<<
static_cast<int>(chamb.tdcId)<<
","<<std::endl;
225 chamb_json<<
" \"mezzId\": "<<
static_cast<int>(chamb.mezzanine_type)<<
","<<std::endl;
226 chamb_json<<
" \"tubeZero\": "<<
static_cast<int>(chamb.tube)<<std::endl;
228 if (
i +1 != cached_chnls.size()) chamb_json<<
",";
229 chamb_json<<std::endl;
232 chamb_json<<
"]"<<std::endl;
236 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ initialize()
StatusCode MdtCablingJsonDumpAlg::initialize |
( |
| ) |
|
|
overridevirtual |
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_cablingJSON
Gaudi::Property<std::string> MdtCablingJsonDumpAlg::m_cablingJSON {this, "OutCablingJSON", "MdtCabling.json", "Cabling JSON"} |
|
private |
◆ m_cablingKey
◆ m_DetectorManagerKey
Initial value:{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}
Definition at line 34 of file MdtCablingJsonDumpAlg.h.
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_idHelperSvc
◆ m_mezzJSON
Gaudi::Property<std::string> MdtCablingJsonDumpAlg::m_mezzJSON {this, "OutMezzanineJSON", "MezzMapping.json", "Mezzanine JSON"} |
|
private |
◆ m_summaryTxt
Gaudi::Property<std::string> MdtCablingJsonDumpAlg::m_summaryTxt {this, "SummaryFile", "SummaryFile.txt", "Summary of the extracted mapping"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
int getNLayers() const
Returns the number of tube layers inside the multilayer.
Gaudi::Property< std::string > m_mezzJSON
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const Mapping & tdcToTubeMap() const
Returns the underlying TDC -> Tube conversion map.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
uint8_t numTubeLayers() const
returns the number of layers
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const_id_iterator detectorElement_end() const
#define ATH_MSG_VERBOSE(x)
Helper struct to search through the std::set if a conversion from online -> offline is needed.
static constexpr uint8_t NOTSET
uint8_t id() const
returns mezzanine database identifier
virtual void setOwner(IDataHandleHolder *o)=0
MdtMezzanineCard - Helper struct to represent the structure of a mezzanine card in a consistent way E...
virtual StatusCode sysInitialize() override
Override sysInitialize.
Split the offline part of the cabling apart to use it later for sorting.
SG::ReadCondHandleKey< MuonMDT_CablingMap > m_cablingKey
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
const MdtCablingOffData & offId() const
get the offline identifier
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::string > m_summaryTxt
int getMultilayer() const
Returns the multilayer represented by the readout element.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Gaudi::Property< std::string > m_cablingJSON
const std::string & stationNameString(const int &index) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
StatusCode initialize(bool used=true)
DataObjIDColl m_extendedExtraObjects
Identifier elementID(int stationName, int stationEta, int stationPhi) const
std::map< std::string, std::string > remap
list of directories to be explicitly remapped
#define ATH_MSG_WARNING(x)
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>