 |
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, V, H > &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 |
| |
|
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| | specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
| |
|
| 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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 43 of file MdtCablingJsonDumpAlg.cxx.
44 const EventContext& ctx = Gaudi::Hive::currentContext();
45 ATH_MSG_INFO(
"Dump cabling & mezzanines into JSON file");
48 if (!detectorMgr.isValid()){
50 return StatusCode::FAILURE;
56 return StatusCode::FAILURE;
60 std::vector<MdtMezzanineCard> cached_cards{};
61 std::set<MdtCablingData> cached_chnls{};
73 std::map<TdcIdentifier, Mapping> chamber_mezz{};
78 for (
int tubeInLayer = 1 ; tubeInLayer <= nTubes; ++tubeInLayer) {
81 layer, tubeInLayer, is_valid);
92 return StatusCode::FAILURE;
95 chamber_mezz.try_emplace(tdc_id,unsetArray);
96 chamber_mezz[tdc_id][
cabling_data.channelId] = dummy_card.tubeNumber(
layer, tubeInLayer);
100 for (
auto&[tdc, mezz_mapping] : chamber_mezz) {
105 mezzCablingId.tdcId = tdc.tdcId;
111 mezzCablingId.tube = chipInCab->
tubeZero();
113 const uint8_t tubeOffSet = (mezzCablingId.tube-1)%dummy_card.numTubesPerLayer();
118 for (
size_t chan = 0 ;
chan < mezz_mapping.size(); ++
chan) {
119 const OfflineCh tube_lay =
remap.offlineTube(
chan, msgStream());
120 if (!tube_lay.isValid)
continue;
121 uint8_t tubeNumber = tube_lay.tube + tubeOffSet + 1;
122 mezz_mapping[
chan] =
remap.tubeNumber(tube_lay.layer, tubeNumber);
126 Mapping& mtmp = mezz_mapping;
127 std::vector<MdtMezzanineCard>::const_iterator itr = std::find_if(cached_cards.begin(), cached_cards.end(),
129 if (dummy_card.numTubeLayers() != card.numTubeLayers()) return false;
130 for (size_t ch =0; ch < mtmp.size(); ++ch) {
131 if (mtmp[ch] != card.tdcToTubeMap()[ch]) return false;
135 if (itr != cached_cards.end()) {
136 mezzCablingId.mezzanine_type = itr->id();
138 cached_cards.emplace_back(mezz_mapping, dummy_card.numTubeLayers(), cached_cards.size() + 10);
139 if (!cached_cards.back().checkConsistency(msgStream())) {
141 return StatusCode::FAILURE;
143 mezzCablingId.mezzanine_type = cached_cards.back().id();
145 cached_chnls.insert(std::move(mezzCablingId));
156 return StatusCode::FAILURE;
158 summary<<
"Extracted "<<cached_cards.size()<<
" mezzanine card layouts and "
159 <<cached_chnls.size()<<
" chamber channels. \n\n\n";
164 if (
cabling.mezzanine_type != card.id())
continue;
168 summary<<static_cast<int>(std::abs(chamb.eta));
169 summary<<(chamb.eta > 0 ?
"A" :
"C");
170 summary<<static_cast<int>(chamb.phi);
171 summary<<
"M"<<
static_cast<int>(chamb.multilayer);
174 summary<<static_cast<int>(
cabling.tdcId)<<
", ";
177 <<
"##############################################################\n";
183 if (!mezz_json.good()) {
185 return StatusCode::FAILURE;
187 mezz_json<<
"["<<std::endl;
188 for (
size_t i = 0;
i < cached_cards.size() ; ++
i) {
191 mezz_json<<
" \"mezzId\": "<<
static_cast<int>(card.
id())<<
",\n";
192 mezz_json<<
" \"nTubeLayer\": "<<
static_cast<int>(card.
numTubeLayers())<<
",\n";
193 mezz_json<<
" \"tdcToTubeMap\": [";
200 if (
i +1 != cached_cards.size()) mezz_json<<
",";
207 if (!chamb_json.good()) {
209 return StatusCode::FAILURE;
215 chamb_json<<
" \"station\": \""<<idHelper.
stationNameString(chamb.stationIndex)<<
"\",\n";
216 chamb_json<<
" \"eta\": "<<
static_cast<int>(chamb.eta)<<
",\n";
217 chamb_json<<
" \"phi\": "<<
static_cast<int>(chamb.phi)<<
",\n";
218 chamb_json<<
" \"ml\": "<<
static_cast<int>(chamb.multilayer)<<
",\n";
219 chamb_json<<
" \"subDet\": "<<
static_cast<int>(chamb.subdetectorId)<<
",\n";
220 chamb_json<<
" \"csm\": "<<
static_cast<int>(chamb.csm)<<
",\n";
221 chamb_json<<
" \"mrod\": "<<
static_cast<int>(chamb.mrod)<<
",\n";
222 chamb_json<<
" \"tdcId\": "<<
static_cast<int>(chamb.tdcId)<<
",\n";
223 chamb_json<<
" \"mezzId\": "<<
static_cast<int>(chamb.mezzanine_type)<<
",\n";
224 chamb_json<<
" \"tubeZero\": "<<
static_cast<int>(chamb.tube)<<
"\n";
226 if (
i +1 != cached_chnls.size()) chamb_json<<
",";
230 chamb_json<<
"]"<<std::endl;
234 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.
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...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
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::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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.