7#include "GaudiKernel/PhysicalConstants.h"
10#include "GaudiKernel/ITHistSvc.h"
23 ATH_CHECK(
book(TH2D(
"DriftRadiusVsTime",
"DriftRadiusVsTime", 680, 0., 680., 100, 0., 15.),
"MdtCalibDbAlgTest",
"MdtCalibDbAlgTest"));
24 ATH_CHECK(
book(TH2D(
"DriftVelocityVsTime",
"DriftVelocityVsTime", 680, 0., 680., 140, -0.1, 0.6),
"MdtCalibDbAlgTest",
"MdtCalibDbAlgTest"));
25 ATH_CHECK(
book(TH2D(
"DriftTimeVsRadius",
"DriftTimeVsRadius", 100, 0., 15., 680, 0., 680.),
"MdtCalibDbAlgTest",
"MdtCalibDbAlgTest"));
26 ATH_CHECK(
book(TH2D(
"DriftTimeClosure",
"DriftTimeClosure", 680, 0., 680., 680, 0., 680.),
"MdtCalibDbAlgTest",
"MdtCalibDbAlgTest"));
28 return StatusCode::SUCCESS;
34 return StatusCode::SUCCESS;
45 constexpr double inversePropSpeed = 1. / Gaudi::Units::c_light;
47 if (mdt->status() != Muon::MdtDriftCircleStatus::MdtStatusDriftTime){
56 const float driftV =
m_calibrationTool->getCalibConstants(ctx, mdt->identify())->rtRelation->rt()->driftVelocity(tdcAdj);
57 std::optional<double> driftTime =
m_calibrationTool->getCalibConstants(ctx, mdt->identify())->rtRelation->tr()->driftTime(mdt->driftRadius());
58 const float f_driftTime =
static_cast<float>(driftTime.value_or(0.));
73 hist(
"DriftRadiusVsTime")->Fill(tdcAdj, mdt->driftRadius());
74 hist(
"DriftVelocityVsTime")->Fill(tdcAdj, driftV);
75 hist(
"DriftTimeVsRadius")->Fill(mdt->driftRadius(), f_driftTime);
76 hist(
"DriftTimeClosure")->Fill(tdcAdj, f_driftTime);
80 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
StatusCode book(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.
TH1 * hist(const std::string &histName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered histograms of any type.
Readout element to describe the Monitored Drift Tube (Mdt) chambers Mdt chambers usually comrpise out...
double activeTubeLength(const IdentifierHash &hash) const
Amg::Vector3D globalTubePos(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the position of the tube mid point in the ATLAS coordinate frame.
unsigned multilayer() const
Returns the multi layer of the readout element [1;\2].
int stationEta() const
Returns the stationEta (positive A site, negative C site).
int stationName() const
Returns the stationName (BIS, BOS, etc) encoded into the integer.
int stationPhi() const
Returns the stationPhi (1-8) -> sector (2*phi - (isSmall)).
MuonVal::ScalarBranch< float > & m_out_driftTime
MuonVal::ScalarBranch< float > & m_out_globalPosZ
SG::ReadHandleKey< xAOD::MdtDriftCircleContainer > m_MdtKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
MuonVal::ScalarBranch< float > & m_out_globalPos
MuonVal::ScalarBranch< float > & m_out_tubeLength
MuonVal::ScalarBranch< float > & m_out_driftRadius
MuonVal::ScalarBranch< uint8_t > & m_out_ml
MuonVal::ScalarBranch< uint8_t > & m_out_stPhi
ActsTrk::GeoContextReadKey_t m_geoCtxKey
virtual StatusCode initialize() override
MuonVal::ScalarBranch< float > & m_out_driftVelocity
MuonVal::ScalarBranch< int16_t > & m_out_stEta
virtual StatusCode finalize() override
MuonVal::ScalarBranch< uint8_t > & m_out_tube
MuonVal::ScalarBranch< uint8_t > & m_out_stIndex
MuonVal::ScalarBranch< float > & m_out_tdc
MuonVal::ScalarBranch< float > & m_out_globalPosY
ToolHandle< IMdtCalibrationTool > m_calibrationTool
pointer to MdtCalibSvc
MuonVal::ScalarBranch< float > & m_out_globalPosX
MuonVal::MuonTesterTree m_tree
MuonVal::ScalarBranch< float > & m_out_tdcAdj
MuonVal::ScalarBranch< uint8_t > & m_out_tl
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Eigen::Matrix< double, 3, 1 > Vector3D
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MdtDriftCircle_v1 MdtDriftCircle
MdtDriftCircleContainer_v1 MdtDriftCircleContainer