33 return StatusCode::SUCCESS;
42 return StatusCode::FAILURE;
45 if (!segmentColl.
cptr()) {
46 ATH_MSG_WARNING(
"Obtained zero pointer for MuonSegmentCollection at " << segmentColl.
name());
47 return StatusCode::FAILURE;
51 ATH_MSG_DEBUG(
"Retrieved MuonSegmentCollection " << segmentColl->size());
54 msc.reserve(segmentColl->size());
58 if (ms) msc.push_back(ms);
61 if (msc.size() != segmentColl->size()) {
62 ATH_MSG_WARNING(
"Input segment collection (size " << segmentColl->size() <<
") and translated MuonSegment collection (size "
63 << msc.size() <<
") are not the same size.");
66 std::unique_ptr<TrackCollection> newtracks{
m_trackMaker->find(ctx, msc)};
67 if (!newtracks) newtracks = std::make_unique<TrackCollection>();
79 return mstrk->perigeeParameters()->momentum().perp() / 1000.0;
82 return -log(tan(mstrk->perigeeParameters()->parameters()[
Trk::theta] * 0.5));
85 [](
auto const& mstrk) {
return mstrk->perigeeParameters()->parameters()[
Trk::phi0]; });
87 auto mssegs_eta =
Monitored::Collection(
"mssegs_eta", msc, [](
auto const& seg) {
return seg->globalPosition().eta(); });
88 auto mssegs_phi =
Monitored::Collection(
"mssegs_phi", msc, [](
auto const& seg) {
return seg->globalPosition().phi(); });
90 auto monitorIt =
Monitored::Group(
m_monTool, mstrks_n, mstrks_pt, mstrks_eta, mstrks_phi, mssegs_n, mssegs_eta, mssegs_phi);
92 const auto nTracks = newtracks->size();
95 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
defines an "iterator" over instances of a given type in StoreGateSvc
An algorithm that can be simultaneously executed in multiple threads.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
virtual StatusCode execute(const EventContext &ctx) const override
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
helper Tool
MuPatTrackBuilder(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandleKey< TrackCollection > m_spectroTrackKey
Track output Key for tracks strictly in MS.
SG::ReadHandleKey< Trk::SegmentCollection > m_segmentKey
Key of input MuonSegmentCombination collection.
virtual StatusCode initialize() override
ToolHandle< GenericMonitoringTool > m_monTool
ToolHandle< Muon::IMuonTrackFinder > m_trackMaker
Actual tool to do the track finding.
This is the common class for 3D segments used in the muon spectrometer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Base class for all TrackSegment implementations, extends the common MeasurementBase.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
std::vector< const Muon::MuonSegment * > MuonSegmentCollection