|
ATLAS Offline Software
|
#include <SimHitCsvDumperAlg.h>
|
| SimHitCsvDumperAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
| ~SimHitCsvDumperAlg ()=default |
|
StatusCode | initialize () override |
|
StatusCode | execute () override |
|
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 |
|
Definition at line 18 of file SimHitCsvDumperAlg.h.
◆ StoreGateSvc_t
◆ SimHitCsvDumperAlg()
MuonR4::SimHitCsvDumperAlg::SimHitCsvDumperAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~SimHitCsvDumperAlg()
MuonR4::SimHitCsvDumperAlg::~SimHitCsvDumperAlg |
( |
| ) |
|
|
default |
◆ 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 MuonR4::SimHitCsvDumperAlg::execute |
( |
| ) |
|
|
override |
No check needed that the muon is extrapolated to the same point
Definition at line 39 of file SimHitCsvDumperAlg.cxx.
41 const EventContext & context = Gaudi::Hive::currentContext();
47 std::ofstream
file{std::string(Form(
"event%09zu-",++
m_event))+
"MuonSimHit.csv"};
48 const std::string delim =
",";
50 file<<
"StationName"<<delim;
51 file<<
"StationEta"<<delim;
52 file<<
"StationPhi"<<delim;
53 file<<
"LocalPositionExtrx"<<delim;
54 file<<
"LocalPositionExtry"<<delim;
55 file<<
"LocalPositionExtrz"<<delim;
56 file<<
"LocalDirectionx"<<delim;
57 file<<
"LocalDirectiony"<<delim;
58 file<<
"LocalDirectionz"<<std::endl;
61 std::set<TrueHitInChamb> usedStations{};
73 if (std::abs(simHit->pdgId()) != 13)
continue;
78 newHit.simHit = simHit;
86 const Amg::Vector3D localPos{toChamber * xAOD::toEigen(simHit->localPosition())};
87 newHit.lDir = toChamber.linear() * xAOD::toEigen(simHit->localDirection());
89 const std::optional<double> lambda = Amg::intersect<3>(localPos, newHit.lDir, Amg::Vector3D::UnitZ(), 0.);
90 newHit.lPos = localPos + (*lambda)*newHit.lDir;
92 auto insert_itr = usedStations.insert(newHit);
94 if (insert_itr.second)
continue;
99 if ((prevMuon.lPos - newHit.lPos).mag() >
tolerance ||
100 prevMuon.lDir.dot(newHit.lDir) < angleTolerance ) {
101 ATH_MSG_WARNING(
"Muon "<<newHit.simHit->genParticleLink()<<
" has a different ending point when it starts from "
104 <<
" -- vs. "<<
m_idHelperSvc->toString(newHit.simHit->identify())
112 file<<hit.simHit->pdgId()<<delim;
117 file<<hit.lPos.x()<<delim;
118 file<<hit.lPos.y()<<delim;
119 file<<hit.lPos.z()<<delim;
121 file<<hit.lDir.x()<<delim;
122 file<<hit.lDir.y()<<delim;
123 file<<hit.lDir.z()<<std::endl;
125 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 MuonR4::SimHitCsvDumperAlg::initialize |
( |
| ) |
|
|
override |
◆ 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_detStore
◆ m_event
size_t MuonR4::SimHitCsvDumperAlg::m_event {0} |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_geoCtxKey
◆ m_idHelperSvc
Initial value:{
this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 36 of file SimHitCsvDumperAlg.h.
◆ m_inSimHitKey
Initial value:{
this, "MuonSimHitKey",{}, "List of sim hit containers"}
Definition at line 33 of file SimHitCsvDumperAlg.h.
◆ m_r4DetMgr
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
const SpectrometerSector * msSector() const
Returns the pointer to the envelope volume enclosing all chambers in the sector.
std::vector< Identifier > ID
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const MuonGMR4::MuonDetectorManager * m_r4DetMgr
Access to the readout geometry.
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::ReadHandleKeyArray< xAOD::MuonSimHitContainer > m_inSimHitKey
#define ATH_MSG_VERBOSE(x)
Property holding a SG store/key/clid from which a ReadHandle is made.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Amg::Transform3D globalToLocalTrans(const ActsGeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
Eigen::Affine3d Transform3D
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Include the GeoPrimitives which need to be put first.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Eigen::Matrix< double, 3, 1 > Vector3D
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
virtual IdentifierHash measurementHash(const Identifier &measId) const =0
Constructs the identifier hash from the full measurement Identifier.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
Helper struct to map all muons in the same chamber.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.