6#include "GaudiKernel/ITHistSvc.h"
43 return StatusCode::SUCCESS;
50 const EventContext& ctx = Gaudi::Hive::currentContext();
54 return StatusCode::FAILURE;
60 m_bcId = eventInfo->bcid();
62 m_pt = eventInfo->timeStampNSOffset();
68 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
69 return StatusCode::FAILURE;
74 ATH_MSG_DEBUG(
"Size of MdtPrepDataContainer : "<<mdtPrepRawData->size());
76 for(
auto mdtColl : *mdtPrepRawData){
83 ATH_MSG_DEBUG(
"Mdt FixedId "<<fixid.
getIdInt()<<
" prd phi "<<prd->globalPosition().phi()<<
" prd theta "<<prd->globalPosition().theta());
91 ATH_MSG_DEBUG(
"Size of RpcPrepDataContainer : "<<rpcPrepRawData->size());
93 for(
auto rpcColl : *rpcPrepRawData) {
99 ATH_MSG_DEBUG(
"Rpc FixedId "<<fixid.
getIdInt()<<
" prd phi "<<prd->globalPosition().phi()<<
" prd theta "<<prd->globalPosition().theta());
107 ATH_MSG_DEBUG(
"Size of TgcPrepDataContainer : "<<tgcPrepRawData->size());
109 for (
auto tgcColl : *tgcPrepRawData) {
115 ATH_MSG_DEBUG(
"Tgc FixedId "<<fixid.
getIdInt()<<
" prd phi "<<prd->globalPosition().phi()<<
" prd theta "<<prd->globalPosition().theta());
123 ATH_MSG_INFO(
"Number of Muon StandAlone Tracks : "<<muTrks->size());
126 for (
unsigned int itrk = 0; itrk < muTrks->size(); ++itrk) {
136 if (not trkSummary)
continue;
163 return StatusCode::FAILURE;
180 return StatusCode::FAILURE;
189 return StatusCode::FAILURE;
192 unsigned int nMeasurement = 0, nHole = 0;
202 if (!measurement)
continue;
206 ATH_MSG_DEBUG(
"Total recorded hits in the track "<<itrk<<
" #Mesurement "<<nMeasurement<<
" #Hole "<<nHole) ;
214 if (!
m_tree.fill(ctx))
return StatusCode::FAILURE;
215 return StatusCode::SUCCESS;
221 if (!trackPars)
return;
228 ATH_MSG_DEBUG(
" Hole stored at position x " << pos.x() <<
" y " << pos.y() <<
" z " << pos.z());
235 ATH_MSG_DEBUG(
"None of MDT/RPC/TGC Identifier match, something wrong!");
264 else ATH_MSG_WARNING(
"This hit is not measurement o outlier, hit type wrong!");
270 int adc = prd->
adc();
271 int tdc = prd->
tdc();
273 ATH_MSG_DEBUG(
"PRD ADC "<<adc<<
" PRD TDC "<<tdc<<
" PRD gPos "<<prd_pos);
279 ATH_MSG_DEBUG(
"print "<<calibIn <<
" calibResult : "<<calibResult);
306 ATH_MSG_WARNING(
"getGlobalToStation failed to retrieve detEL byebye" );
332 <<
" detEl wireLocalCenter " <<
" x : "<<wireCenter.x()<<
" y : " << wireCenter.y()<<
" z : "<<wireCenter.z());
339 float residualBiased = -999.;
340 float pullBiased = -999.;
343 if(resPullBiased.has_value()){
344 residualBiased = resPullBiased.value().residual().front();
345 pullBiased = resPullBiased.value().pull().front();
358 ATH_MSG_DEBUG(
"prd hit global position measurement " <<
" x : "<< prd_pos.x()<<
" y : "<< prd_pos.y()<<
" z : "<<prd_pos.z());
359 ATH_MSG_DEBUG(
"MdtDriftCircleOnTrack hit global position measurement " <<
" x : " <<mrot_gPos.x()<<
" y : "<< mrot_gPos.y() <<
" z : "<<mrot_gPos.z());
360 ATH_MSG_DEBUG(
"trackHitPos from trackPars " <<
" x : "<<trkHitPos.x() <<
" y : "<<trkHitPos.y() <<
" z : "<< trkHitPos.z() );
361 ATH_MSG_DEBUG(
"trackHit Local Pos from globaltolocalCoords " <<
" x : "<< trkHitPosLoc.x() <<
" y : "<< trkHitPosLoc.y() <<
" z : "<< trkHitPosLoc.z());
362 ATH_MSG_DEBUG(
"mrod Local Pos from globaltolocalCoords " <<
" x : "<< mrot_pos.x() <<
" y : "<< mrot_pos.y() <<
" z : "<< mrot_pos.z());
364 <<
" Tube "<<fixid.
mdtTube()<<
" MROT drift R " << mrot->
driftRadius() <<
" errDriftRadius " <<
error<<
" drift Time "
365 << mrot->
driftTime() <<
" ADC "<<adc<<
" TDC "<<tdc);
366 ATH_MSG_DEBUG(
" driftRadius from driftRadius func "<<driftRadius<<
" rTrk track fit to wire "<<trackPars->parameters()[
Trk::loc1]<<
" residualBiased " << residualBiased <<
" pullBiased " << pullBiased);
406 const std::vector<const Muon::MuonClusterOnTrack*>& rots = crot->
containedROTs();
407 if (rots.size() > 0) {
408 std::vector<const Muon::MuonClusterOnTrack*>::const_iterator itR = rots.begin(), itR_end = rots.end();
409 for (; itR != itR_end; ++itR) {
456 ATH_MSG_INFO(
"MuonSegmentReader :: Finalize + Matching");
458 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
double backgroundTime() const
Return the time correction arising from background processes.
MdtDriftCircleStatus status() const
Status of the calibration.
double temperatureTime() const
Returns the time corrections stemming from temperature & pressure corrections.
double signalPropagationTime() const
Returns the signal propagation time.
double lorentzTime() const
Returns the time corrections from the signal propgation inside a magnetic field.
double tubeT0() const
Returns the point in time where the muon typically enters the chamber.
double meanAdc() const
Returns the mean tube adc.
double slewingTime() const
Returns the slewing time (Needed time that the accumulated charge passes the electronic threshold to ...
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
static std::string stationNumberToFixedStationString(const int station)
int mdtTubeLayer() const
Mdt specific:
int mdtTube() const
Mdt specific:
unsigned int getIdInt() const
int mdtMultilayer() const
Mdt specific:
VectorBranch< unsigned int > & m_rawRpc_id
ServiceHandle< Muon::IMuonIdHelperSvc > m_MuonIdHelper
VectorBranch< float > & m_trkHit_triggerTime
VectorBranch< float > & m_trk_d0
VectorBranch< int > & m_trkHit_tdc
VectorBranch< float > & m_trkHit_error
ScalarBranch< int > & m_trkTriggerHit_nHits
ScalarBranch< int > & m_lumiBlock
ScalarBranch< float > & m_pt
VectorBranch< float > & m_trk_qOverP
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_TgcPrepDataKey
ScalarBranch< int > & m_trk_nTracks
VectorBranch< int > & m_trk_ndof
virtual StatusCode initialize() override
VectorBranch< unsigned int > & m_trkTriggerHit_id
void storeHole(const Trk::TrackStateOnSurface *trk_state, unsigned int itrk)
ThreeVectorBranch m_trkHit_closestApproach
PublicToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
VectorBranch< float > & m_trk_theta
VectorBranch< int > & m_trkHit_trackIndex
VectorBranch< float > & m_rawRpc_time
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
VectorBranch< float > & m_trk_phi
VectorBranch< int > & m_trkHit_type
VectorBranch< float > & m_trk_chi2
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_MdtPrepDataKey
ThreeVectorBranch m_trkHit_gClosestApproach
void storeMeasurement(const EventContext &ctx, const MuonGM::MuonDetectorManager *MuonDetMgr, unsigned int itrk, const Trk::TrackStateOnSurface *trk_state, const Trk::MeasurementBase *measurement)
VectorBranch< int > & m_trkHole_type
VectorBranch< int > & m_trkTriggerHit_trackIndex
ThreeVectorBranch m_trkTriggerHit_gPos
ThreeVectorBranch m_trkHit_center
ScalarBranch< int > & m_runNumber
VectorBranch< float > & m_trkHit_rTrk
ScalarBranch< int > & m_trkHit_nMdtHits
VectorBranch< float > & m_trkHit_driftRadius
VectorBranch< unsigned int > & m_trkHit_id
ThreeVectorBranch m_trkHit_gPos
VectorBranch< int > & m_trk_nRpcEtaHits
VectorBranch< float > & m_trkHit_tubeT0
VectorBranch< int > & m_trk_nOutliersHits
VectorBranch< float > & m_trk_z0
ThreeVectorBranch m_rawTgc_gPos
VectorBranch< float > & m_trkHit_lorTime
VectorBranch< int > & m_trk_nMdtHoles
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
MuonDetectorManager from the conditions store.
VectorBranch< int > & m_trk_nRpcPhiHits
VectorBranch< unsigned int > & m_trkHole_id
VectorBranch< int > & m_trkHole_trackIndex
ScalarBranch< int > & m_eventNumber
VectorBranch< float > & m_trkHit_tof
VectorBranch< float > & m_trkHit_tubeMeanAdc
VectorBranch< float > & m_trkHit_localAngle
ScalarBranch< int > & m_trkHole_nHoles
ScalarBranch< int > & m_rawTgc_nRTgc
VectorBranch< int > & m_rawMdt_adc
VectorBranch< float > & m_trkHit_pull
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_RpcPrepDataKey
VectorBranch< int > & m_trk_nTgcPhiHits
ThreeVectorBranch m_trkHole_gPos
VectorBranch< float > & m_trk_eta
ThreeVectorBranch m_trkHit_pos
VectorBranch< int > & m_trkHit_calibStatus
VectorBranch< float > & m_trkHit_slewTime
ToolHandle< IMdtCalibrationTool > m_calibrationTool
pointer to MdtCalibSvc
ThreeVectorBranch m_rawMdt_gPos
VectorBranch< unsigned int > & m_rawTgc_id
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idToFixedIdTool
VectorBranch< int > & m_trkTriggerHit_type
VectorBranch< float > & m_trkTriggerHit_time
VectorBranch< float > & m_trkHit_bkgTime
virtual StatusCode finalize() override
VectorBranch< float > & m_trk_pt
VectorBranch< int > & m_trk_author
VectorBranch< int > & m_trk_nMdtHits
VectorBranch< int > & m_rawTgc_bcBitMap
VectorBranch< unsigned int > & m_rawMdt_id
VectorBranch< float > & m_trkHit_tempTime
ScalarBranch< int > & m_rawMdt_nRMdt
ScalarBranch< int > & m_timeStamp
ScalarBranch< int > & m_bcId
VectorBranch< float > & m_trkHit_driftTime
SG::ReadHandleKey< TrackCollection > m_TrkKey
virtual StatusCode execute() override
ThreeVectorBranch m_trk_perigee
ScalarBranch< int > & m_rawRpc_nRRpc
VectorBranch< float > & m_trkHit_propTime
VectorBranch< int > & m_trk_nTgcEtaHits
VectorBranch< float > & m_trkHole_driftRadius
VectorBranch< float > & m_trkHit_distRO
VectorBranch< int > & m_trkHit_adc
VectorBranch< int > & m_rawMdt_tdc
VectorBranch< float > & m_trkHit_resi
ThreeVectorBranch m_rawRpc_gPos
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
double distanceFromRO(const Amg::Vector3D &GlobalHitPosition, const Identifier &id) const
double tubeLength(const int tubeLayer, const int tube) const
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MdtReadoutElement * getMdtReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
virtual Amg::Transform3D GlobalToAmdbLRSTransform() const
Class for competing MuonClusters, it extends the Trk::CompetingRIOsOnTrack base class.
const std::vector< const MuonClusterOnTrack * > & containedROTs() const
returns the vector of SCT_ClusterOnTrack objects .
This class represents the corrected MDT measurements, where the corrections include the effects of wi...
double localAngle() const
Returns the local angle, as determined by the extrapolation used when creating this Trk::RIO_OnTrack.
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global Position.
double driftRadius() const
Returns the value of the drift radius.
double driftTime() const
Returns the value of the drift time used to obtain the drift radius.
double positionAlongWire() const
Returns the position along the wire, as determined by the extrapolation used when creating this Trk::...
virtual const MdtPrepData * prepRawData() const override final
Returns the PrepRawData used to create this corrected measurement.
Class to represent measurements from the Monitored Drift Tubes.
int adc() const
Returns the ADC (typically range is 0 to 250)
virtual const Amg::Vector3D & globalPosition() const
Returns the global position of the CENTER of the drift tube (i.e.
int tdc() const
Returns the TDC (typically range is 0 to 2500).
Class to represent calibrated clusters formed from RPC strips.
virtual const RpcPrepData * prepRawData() const override final
Returns the RpcPrepData - is a TRT_DriftCircle in this scope.
Class to represent RPC measurements.
virtual const Amg::Vector3D & globalPosition() const override
Returns the global position.
float time() const
Returns the time.
Class to represent calibrated clusters formed from TGC strips.
virtual const TgcPrepData * prepRawData() const
Returns the TgcPrepData - is a TRT_DriftCircle in this scope.
Class to represent TGC measurements.
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
uint16_t getBcBitMap() const
Returns the bcBitMap of this PRD bit2 for Previous BC, bit1 for Current BC, bit0 for Next BC.
const_pointer_type cptr()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
double chiSquared() const
returns the of the overall track fit
This class is the pure abstract base class for all fittable tracking measurements.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Detailed track summary for the muon system Give access to hit counts per chamber.
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
double pT() const
Access method for transverse momentum.
Identifier identify() const
return the identifier
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Identifier identify() const
return the identifier -extends MeasurementBase
@ Biased
RP with track state including the hit.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
represents the track state (measurement, material, fit parameters and quality) at a surface.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
A summary of the information contained by a track.
const MuonTrackSummary * muonTrackSummary() const
returns a pointer to the MuonTrackSummary if available
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
const Perigee * perigeeParameters() const
return Perigee.
const Trk::TrackSummary * trackSummary() const
Returns a pointer to the const Trk::TrackSummary owned by this const track (could be nullptr)
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters
@ numberOfMdtHoles
number of MDT measurements missing from the track
@ numberOfMdtHits
number of mdt hits
@ numberOfOutliersOnTrack
100 times the standard deviation of the chi2 from the surfaces