|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "CLHEP/Random/RandFlat.h"
36 return StatusCode::SUCCESS;
41 return StatusCode::SUCCESS;
45 const EventContext& ctx{Gaudi::Hive::currentContext()};
47 std::unordered_map <const SpacePointBucket*, std::vector<const MuonR4::Segment*>> segmentMap;
65 if ( !
m_isMC && segmentMap[bucket].
size() == 0) {
66 if (CLHEP::RandFlat::shoot(rndEngine,0.,1.) >
m_fracToKeep) {
76 std::unordered_map<const SpacePoint*, std::vector<int16_t>> spacePointToSegment;
78 auto match_itr = segmentMap.find(bucket);
80 if (match_itr != segmentMap.end()) {
81 unsigned int segIdx{0};
83 for (
const auto& meas :
segment->measurements()) {
84 spacePointToSegment[meas->spacePoint()].push_back(segIdx);
98 unsigned int layer{0};
100 for (
const auto& hitsInLay :
sorter.mdtHits()) {
101 for (
const auto sp : hitsInLay){
111 unsigned int mdt_ML =
m_idHelperSvc->mdtIdHelper().multilayer(
id);
112 unsigned int mdt_TL =
m_idHelperSvc->mdtIdHelper().tubeLayer(
id);
113 unsigned int mdt_nL =
m_idHelperSvc->mdtIdHelper().tubeLayerMax(
id);
117 const std::vector<int16_t>& segIdxs = spacePointToSegment[sp];
140 Amg::Vector3D globalPos = sp->msSector()->localToGlobalTrans(*gctx) * sp->positionInChamber();
148 for (
const auto& hitsInLay :
sorter.stripHits()) {
150 for (
const auto sp : hitsInLay){
152 const std::vector<int16_t>& segIdxs = spacePointToSegment[sp];
175 Amg::Vector3D globalPos = sp->msSector()->localToGlobalTrans(*gctx) * sp->positionInChamber();
188 if (!
m_tree.
fill(ctx))
return StatusCode::FAILURE;
192 return StatusCode::SUCCESS;
199 rngWrapper->
setSeed(rngName, ctx);
MuonVal::VectorBranch< bool > & m_spoint_measuresPhi
MuonVal::VectorBranch< bool > & m_spoint_measuresEta
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
MuonVal::VectorBranch< unsigned int > & m_spoint_dimension
CLHEP::HepRandomEngine * getRandomEngine(const EventContext &ctx) const
: The muon space point bucket represents a collection of points that will bre processed together in t...
StatusCode init(OWNER *instance)
Initialize method.
SG::ReadHandleKey< MuonR4::SegmentContainer > m_inSegmentKey
MuonVal::VectorBranch< uint16_t > & m_spoint_adc
MuonVal::ScalarBranch< float > & m_bucket_max
The SpacePointPerLayerSorter groups the space points by their layer Identifier.
MuonVal::MuonTesterTree m_tree
MuonVal::VectorBranch< float > & m_spoint_covYX
virtual StatusCode execute() override final
Placeholder for what will later be the muon segment EDM representation.
MuonVal::MuonIdentifierBranch m_spoint_id
MuonVal::ThreeVectorBranch m_spoint_globalPosition
virtual StatusCode finalize() override final
#define ATH_MSG_VERBOSE(x)
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
MuonVal::ScalarBranch< float > & m_bucket_min
MuonVal::ScalarBranch< short > & m_spoint_mdtLayer
MuonVal::VectorBranch< unsigned int > & m_spoint_nPhiInstances
@ MdtStatusDriftTime
The tube produced a vaild measurement.
ServiceHandle< IAthRNGSvc > m_rndmSvc
MuonVal::ThreeVectorBranch m_segmentPos
MuonVal::VectorBranch< float > & m_spoint_covXY
MuonVal::VectorBranch< float > & m_spoint_covY
MuonVal::ScalarBranch< uint16_t > & m_bucket_layers
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
MuonVal::VectorBranch< bool > & m_spoint_isMdt
MuonVal::ThreeVectorBranch m_spoint_localPosition
MuonVal::VectorBranch< bool > & m_spoint_isStrip
Gaudi::Property< bool > m_isMC
MuonVal::ScalarBranch< short > & m_spoint_mdtTube
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< double > m_fracToKeep
virtual void push_back(const Identifier &id)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::MatrixBranch< int16_t > & m_spoint_mat
MuonVal::VectorBranch< float > & m_spoint_driftR
void push_back(const T &value)
Adds a new element at the end of the vector.
virtual StatusCode initialize() override final
MuonVal::VectorBranch< uint16_t > & m_spoint_layer
A wrapper class for event-slot-local random engines.
MuonVal::VectorBranch< uint16_t > & m_spoint_tdc
Eigen::Matrix< double, 3, 1 > Vector3D
MuonVal::ScalarBranch< uint16_t > & m_bucket_spacePoints
MuonVal::ScalarBranch< uint16_t > & m_bucket_segments
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
This header ties the generic definitions in this package.
MuonVal::VectorBranch< float > & m_segment_numberDoF
bool fill(const EventContext &ctx)
Fills the tree per call.
MuonVal::VectorBranch< float > & m_segment_chiSquared
StatusCode write()
Finally write the TTree objects.
SG::ReadHandleKey< SpacePointContainer > m_readKey
size_t size() const
Returns the number of actual saved elements.
bool isPresent() const
Is the referenced object present in SG?
Gaudi::Property< std::string > m_streamName
Handle class for reading from StoreGate.
https://gitlab.cern.ch/atlas/athena/-/blob/master/MuonSpectrometer/MuonReconstruction/MuonRecEvent/Mu...
MuonVal::ThreeVectorBranch m_segmentDir
MuonVal::VectorBranch< unsigned int > & m_spoint_nEtaInstances
MuonVal::VectorBranch< float > & m_spoint_covX
TTree * tree()
TTree object.
MuonVal::VectorBranch< uint16_t > & m_spoint_nSegments
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
bool addBranch(std::shared_ptr< IMuonTesterBranch > branch)
Branch is added to the tree without transferring the ownership.