 |
ATLAS Offline Software
|
#include <NSWCalibTool.h>
|
virtual | ~NSWCalibTool ()=default |
|
StatusCode | calibrateClus (const EventContext &ctx, const Muon::MMPrepData *prepData, const Amg::Vector3D &globalPos, std::vector< NSWCalib::CalibratedStrip > &calibClus) const override |
|
StatusCode | distToTime (const EventContext &ctx, const Muon::MMPrepData *prepData, const Amg::Vector3D &globalPos, const std::vector< double > &driftDistances, std::vector< double > &driftTimes) const override |
|
StatusCode | calibrateClus (const EventContext &ctx, const ActsGeometryContext &gctx, const xAOD::MMCluster *prepData, const Amg::Vector3D &globalPos, std::vector< NSWCalib::CalibratedStrip > &calibClus) const override |
|
StatusCode | calibrateStrip (const EventContext &ctx, const Identifier &id, const double time, const double charge, const double theta, const double lorentzAngle, NSWCalib::CalibratedStrip &calibStrip) const override |
|
StatusCode | calibrateStrip (const EventContext &ctx, const Muon::MM_RawData *mmRawData, NSWCalib::CalibratedStrip &calibStrip) const override |
|
StatusCode | calibrateStrip (const EventContext &ctx, const Muon::STGC_RawData *sTGCRawData, NSWCalib::CalibratedStrip &calibStrip) const override |
|
bool | tdoToTime (const EventContext &ctx, const bool inCounts, const int tdo, const Identifier &chnlId, float &time, const int relBCID) const override |
|
bool | timeToTdo (const EventContext &ctx, const float time, const Identifier &chnlId, int &tdo, int &relBCID) const override |
|
bool | chargeToPdo (const EventContext &ctx, const float charge, const Identifier &chnlId, int &pdo) const override |
|
bool | pdoToCharge (const EventContext &ctx, const bool inCounts, const int pdo, const Identifier &chnlId, float &charge) const override |
|
virtual StatusCode | initialize () override |
|
NSWCalib::MicroMegaGas | mmGasProperties () const override |
|
float | mmPeakTime () const override |
|
float | stgcPeakTime () const override |
|
|
const NswCalibDbTimeChargeData * | getCalibData (const EventContext &ctx) const |
|
bool | loadMagneticField (const EventContext &ctx, MagField::AtlasFieldCache &fieldCache) const |
|
const Muon::mmCTPClusterCalibData * | getCTPClusterCalibData (const EventContext &ctx) const |
|
bool | timeToTdoMM (const NswCalibDbTimeChargeData *tdoPdoData, const float time, const Identifier &chnlId, int &tdo, int &relBCID) const |
|
bool | timeToTdoSTGC (const NswCalibDbTimeChargeData *tdoPdoData, const float time, const Identifier &chnlId, int &tdo, int &relBCID) const |
|
float | applyT0Calibration (const EventContext &ctx, const Identifier &id, float time) const |
|
StatusCode | initializeGasProperties () |
|
bool | localStripPosition (const Identifier &id, Amg::Vector2D &locPos) const |
|
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > | m_fieldCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj"} |
|
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > | m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"} |
|
SG::ReadCondHandleKey< NswCalibDbTimeChargeData > | m_condTdoPdoKey {this, "condTdoPdoKey", "NswCalibDbTimeChargeData", "Key of NswCalibDbTimeChargeData object containing calibration data (TDO and PDO)"} |
|
SG::ReadCondHandleKey< NswT0Data > | m_condT0Key {this, "condT0Key", "NswT0Data", "Key of NswT0Data containing the t0 calibration data"} |
|
Gaudi::Property< bool > | m_isData {this, "isData", false, "Processing data"} |
|
Gaudi::Property< bool > | m_CalibDriftVelocityFromData {this, "calibrateDriftVelocityFromData", false, "calibrateDriftVelocityFromData"} |
|
SG::ReadCondHandleKey< Muon::mmCTPClusterCalibData > | m_ctpClusterCalibKey {this, "CTPClusterCalibKey", "mmCTPClusterCalibData", "Key of the CTP cluster calibration corrections"} |
|
Gaudi::Property< double > | m_vDrift {this, "DriftVelocity",0.047, "Drift velocity"} |
|
Gaudi::Property< double > | m_timeRes {this, "TimeResolution", 25., "Time resolution"} |
|
Gaudi::Property< double > | m_longDiff {this, "longDiff", 0.019} |
|
Gaudi::Property< double > | m_transDiff {this, "transDiff", 0.036} |
|
Gaudi::Property< double > | m_ionUncertainty {this,"ionUncertainty", 4.0} |
|
Gaudi::Property< float > | m_mmPeakTime {this, "mmPeakTime", 200.} |
|
Gaudi::Property< float > | m_stgcPeakTime {this, "sTgcPeakTime", 0.} |
|
Gaudi::Property< std::string > | m_gasMixture {this, "GasMixture", "ArCo2_937"} |
|
Gaudi::Property< float > | m_mmLatencyMC {this,"mmLatencyMC",25} |
|
Gaudi::Property< float > | m_mmLatencyData {this,"mmLatencyData",0} |
|
Gaudi::Property< float > | m_stgcLatencyMC {this,"stgcLatencyMC",-50} |
|
Gaudi::Property< float > | m_stgcLatencyData {this,"stgcLatencyData",-50} |
|
Gaudi::Property< bool > | m_applyMmT0Calib {this, "applyMmT0Calib", false, "apply the MM t0 calibration"} |
|
Gaudi::Property< bool > | m_applysTgcT0Calib {this, "applysTgcT0Calib", false, "apply the sTGC t0 calibration"} |
|
Gaudi::Property< bool > | m_applyMmBFieldCalib {this, "applyMmBFieldCalib", true, "apply the MM BField correction in reconstruction"} |
|
Gaudi::Property< float > | m_mmT0TargetValue {this, "mmT0TargetValue", 50.0, "target mean value for the MM t0 calibration"} |
|
Gaudi::Property< float > | m_stgcT0TargetValue {this,"stgcT0TargetValue", 0.0 ,"target mean value for the sTGC t0 calibration"} |
|
double | m_interactionDensitySigma {0.0F} |
|
double | m_interactionDensityMean {0.0F} |
|
angleFunction | m_lorentzAngleFunction {NSWCalib::MicroMegaGas::dummy_func()} |
|
Definition at line 26 of file NSWCalibTool.h.
◆ angleFunction
◆ TimeCalibConst
◆ TimeCalibType
◆ ~NSWCalibTool()
virtual Muon::NSWCalibTool::~NSWCalibTool |
( |
| ) |
|
|
virtualdefault |
◆ applyT0Calibration()
float Muon::NSWCalibTool::applyT0Calibration |
( |
const EventContext & |
ctx, |
|
|
const Identifier & |
id, |
|
|
float |
time |
|
) |
| const |
|
private |
Definition at line 458 of file NSWCalibTool.cxx.
460 if(!readT0.isValid()){
461 ATH_MSG_ERROR(
"Cannot find conditions data container for T0s!");
464 bool isGood = readT0->getT0(
id, t0);
465 if(!isGood || t0==0){
466 ATH_MSG_DEBUG(
"failed to retrieve good t0 from database, skipping t0 calibration");
470 float newTime =
time + (targetT0 -
t0);
471 ATH_MSG_DEBUG(
"doing T0 calibration for RDO " <<
m_idHelperSvc->toString(
id) <<
" time " << time <<
" t0 from database " << t0 <<
" t0 target " << targetT0 <<
" new time " << newTime);
◆ calibrateClus() [1/2]
magnetic field
get the component parallel to to the eta strips (same used in digitization)
swap sign depending on the readout side
loop over prepData strips
Definition at line 138 of file NSWCalibTool.cxx.
140 double lorentzAngle {0.};
146 fieldCache.
getField(globalPos.data(), magneticField.data());
149 double phi = globalPos.phi();
150 double bfield = (magneticField.x()*
std::sin(phi)-magneticField.y()*
std::cos(phi))*1000.;
155 if (changeSign) bfield = -bfield;
171 calibClus.push_back(std::move(calibStrip));
173 return StatusCode::SUCCESS;
◆ calibrateClus() [2/2]
magnetic field
get the component parallel to to the eta strips (same used in digitization)
swap sign depending on the readout side
loop over prepData strips
Definition at line 99 of file NSWCalibTool.cxx.
101 double lorentzAngle {0.};
107 fieldCache.
getField(globalPos.data(), magneticField.data());
110 double phi = globalPos.phi();
111 double bfield = (magneticField.x()*
std::sin(phi)-magneticField.y()*
std::cos(phi))*1000.;
116 if (changeSign) bfield = -bfield;
132 calibClus.push_back(std::move(calibStrip));
134 return StatusCode::SUCCESS;
◆ calibrateStrip() [1/3]
transversal and longitudinal components of the resolution
Definition at line 178 of file NSWCalibTool.cxx.
185 return StatusCode::FAILURE;
203 float max_half_drifttime = (vDrift != 0 ) ? 2.5/vDrift : 50.;
207 ATH_MSG_VERBOSE(
"Original drift time: " << time <<
" new max half drift time: " << max_half_drifttime <<
" new time: " << calibStrip.
time <<
" targett0 " <<
m_mmT0TargetValue );
211 double vDriftCorrected = vDrift *
std::cos(lorentzAngle);
219 calibStrip.
dx =
std::sin(lorentzAngle) * calibStrip.
time * vDrift;
221 return StatusCode::SUCCESS;
◆ calibrateStrip() [2/3]
Definition at line 225 of file NSWCalibTool.cxx.
232 return StatusCode::FAILURE;
260 ATH_MSG_DEBUG(
"Calibrating RDO " <<
m_idHelperSvc->toString(rdoId) <<
"with pdo: " << mmRawData->
charge() <<
" tdo: "<< mmRawData->
time() <<
" relBCID "<< mmRawData->
relBcid() <<
" charge and time in counts " <<
261 mmRawData->
timeAndChargeInCounts() <<
" isData "<<
m_isData <<
" to charge: " << calibStrip.
charge <<
" electrons time after corrections " << calibStrip.
time <<
" ns time before corrections "<< time <<
"ns");
272 calibStrip.
locPos = locPos;
274 return StatusCode::SUCCESS;
◆ calibrateStrip() [3/3]
Definition at line 277 of file NSWCalibTool.cxx.
292 return StatusCode::FAILURE;
311 calibStrip.
locPos = locPos;
312 return StatusCode::SUCCESS;
◆ chargeToPdo()
bool Muon::NSWCalibTool::chargeToPdo |
( |
const EventContext & |
ctx, |
|
|
const float |
charge, |
|
|
const Identifier & |
chnlId, |
|
|
int & |
pdo |
|
) |
| const |
|
override |
◆ distToTime()
retrieve the magnetic field
get the component parallel to to the eta strips (same used in digitization)
swap sign depending on the readout side
loop over drift distances
Definition at line 324 of file NSWCalibTool.cxx.
329 fieldCache.
getField(globalPos.data(), magneticField.data());
332 const double phi = globalPos.phi();
333 double bfield = (magneticField.x()*
std::sin(phi)-magneticField.y()*
std::cos(phi))*1000.;
338 if (changeSign) bfield = -bfield;
341 for (
const double dist : driftDistances){
343 driftTimes.push_back(time);
345 return StatusCode::SUCCESS;
◆ getCalibData()
Definition at line 78 of file NSWCalibTool.cxx.
81 if(!readTdoPdo.isValid()){
82 ATH_MSG_ERROR(
"Cannot find conditions data container for TDOs and PDOs!");
85 return readTdoPdo.cptr();
◆ getCTPClusterCalibData()
Definition at line 88 of file NSWCalibTool.cxx.
91 if (!ctpClusterCalibDB.isValid()) {
92 ATH_MSG_FATAL(
"Failed to retrieve the parameterized errors "<<ctpClusterCalibDB.fullKey());
95 return ctpClusterCalibDB.cptr();
◆ initialize()
StatusCode Muon::NSWCalibTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ initializeGasProperties()
StatusCode Muon::NSWCalibTool::initializeGasProperties |
( |
| ) |
|
|
private |
Definition at line 63 of file NSWCalibTool.cxx.
66 return StatusCode::FAILURE;
75 return StatusCode::SUCCESS;
◆ loadMagneticField()
Definition at line 315 of file NSWCalibTool.cxx.
317 if (!readHandle.isValid()) {
321 readHandle.cptr()->getInitializedCache(fieldCache);
◆ localStripPosition()
◆ mmGasProperties()
◆ mmPeakTime()
float Muon::NSWCalibTool::mmPeakTime |
( |
| ) |
const |
|
inlineoverride |
◆ pdoToCharge()
bool Muon::NSWCalibTool::pdoToCharge |
( |
const EventContext & |
ctx, |
|
|
const bool |
inCounts, |
|
|
const int |
pdo, |
|
|
const Identifier & |
chnlId, |
|
|
float & |
charge |
|
) |
| const |
|
override |
◆ stgcPeakTime()
float Muon::NSWCalibTool::stgcPeakTime |
( |
| ) |
const |
|
inlineoverride |
◆ tdoToTime()
◆ timeToTdo()
bool Muon::NSWCalibTool::timeToTdo |
( |
const EventContext & |
ctx, |
|
|
const float |
time, |
|
|
const Identifier & |
chnlId, |
|
|
int & |
tdo, |
|
|
int & |
relBCID |
|
) |
| const |
|
override |
◆ timeToTdoMM()
Definition at line 407 of file NSWCalibTool.cxx.
415 float tdoTime = -999.9;
418 if(
t >= lowerBound+i_relBCID*25 &&
t < (lowerBound+25)+i_relBCID*25){
419 tdoTime = i_relBCID*25 -
t;
424 if(tdoTime < lowerBound) {
◆ timeToTdoSTGC()
Definition at line 433 of file NSWCalibTool.cxx.
441 float tdoTime = -999.9;
444 if(
t >= lowerBound+i_relBCID*25 &&
t < (lowerBound+25)+i_relBCID*25){
445 tdoTime = i_relBCID*25 -
t;
450 if(tdoTime < lowerBound) {
◆ m_applyMmBFieldCalib
Gaudi::Property<bool> Muon::NSWCalibTool::m_applyMmBFieldCalib {this, "applyMmBFieldCalib", true, "apply the MM BField correction in reconstruction"} |
|
private |
◆ m_applyMmT0Calib
Gaudi::Property<bool> Muon::NSWCalibTool::m_applyMmT0Calib {this, "applyMmT0Calib", false, "apply the MM t0 calibration"} |
|
private |
◆ m_applysTgcT0Calib
Gaudi::Property<bool> Muon::NSWCalibTool::m_applysTgcT0Calib {this, "applysTgcT0Calib", false, "apply the sTGC t0 calibration"} |
|
private |
◆ m_CalibDriftVelocityFromData
Gaudi::Property<bool> Muon::NSWCalibTool::m_CalibDriftVelocityFromData {this, "calibrateDriftVelocityFromData", false, "calibrateDriftVelocityFromData"} |
|
private |
◆ m_condT0Key
◆ m_condTdoPdoKey
◆ m_ctpClusterCalibKey
◆ m_fieldCondObjInputKey
◆ m_gasMixture
Gaudi::Property<std::string> Muon::NSWCalibTool::m_gasMixture {this, "GasMixture", "ArCo2_937"} |
|
private |
◆ m_idHelperSvc
◆ m_interactionDensityMean
double Muon::NSWCalibTool::m_interactionDensityMean {0.0F} |
|
private |
◆ m_interactionDensitySigma
double Muon::NSWCalibTool::m_interactionDensitySigma {0.0F} |
|
private |
◆ m_ionUncertainty
Gaudi::Property<double> Muon::NSWCalibTool::m_ionUncertainty {this,"ionUncertainty", 4.0} |
|
private |
◆ m_isData
Gaudi::Property<bool> Muon::NSWCalibTool::m_isData {this, "isData", false, "Processing data"} |
|
private |
◆ m_longDiff
Gaudi::Property<double> Muon::NSWCalibTool::m_longDiff {this, "longDiff", 0.019} |
|
private |
◆ m_lorentzAngleFunction
◆ m_mmLatencyData
Gaudi::Property<float> Muon::NSWCalibTool::m_mmLatencyData {this,"mmLatencyData",0} |
|
private |
◆ m_mmLatencyMC
Gaudi::Property<float> Muon::NSWCalibTool::m_mmLatencyMC {this,"mmLatencyMC",25} |
|
private |
◆ m_mmPeakTime
Gaudi::Property<float> Muon::NSWCalibTool::m_mmPeakTime {this, "mmPeakTime", 200.} |
|
private |
◆ m_mmT0TargetValue
Gaudi::Property<float> Muon::NSWCalibTool::m_mmT0TargetValue {this, "mmT0TargetValue", 50.0, "target mean value for the MM t0 calibration"} |
|
private |
◆ m_muDetMgrKey
◆ m_stgcLatencyData
Gaudi::Property<float> Muon::NSWCalibTool::m_stgcLatencyData {this,"stgcLatencyData",-50} |
|
private |
◆ m_stgcLatencyMC
Gaudi::Property<float> Muon::NSWCalibTool::m_stgcLatencyMC {this,"stgcLatencyMC",-50} |
|
private |
◆ m_stgcPeakTime
Gaudi::Property<float> Muon::NSWCalibTool::m_stgcPeakTime {this, "sTgcPeakTime", 0.} |
|
private |
◆ m_stgcT0TargetValue
Gaudi::Property<float> Muon::NSWCalibTool::m_stgcT0TargetValue {this,"stgcT0TargetValue", 0.0 ,"target mean value for the sTGC t0 calibration"} |
|
private |
◆ m_timeRes
Gaudi::Property<double> Muon::NSWCalibTool::m_timeRes {this, "TimeResolution", 25., "Time resolution"} |
|
private |
◆ m_transDiff
Gaudi::Property<double> Muon::NSWCalibTool::m_transDiff {this, "transDiff", 0.036} |
|
private |
◆ m_vDrift
Gaudi::Property<double> Muon::NSWCalibTool::m_vDrift {this, "DriftVelocity",0.047, "Drift velocity"} |
|
private |
The documentation for this class was generated from the following files:
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position – local or global If the strip number is outside the range of valid strips,...
const Identifier identify() const
static constexpr double s_lowerTimeBound
virtual const Amg::Vector3D & globalPosition() const override final
Returns the global position.
Eigen::Matrix< double, 2, 1 > Vector2D
bool timeAndChargeInCounts() const
const Identifier & identify() const
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
std::vector< ALFA_RawData_p1 > t0
const MuonGMR4::MmReadoutElement * readoutElement() const
Retrieve the associated MmReadoutElement.
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
static constexpr int s_BCWindow
static constexpr double s_lowerTimeBound
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position - should be renamed to channel position If the strip number is outside the range of va...
IdentifierHash layerHash() const
Returns the hash of the associated layer (Needed for surface retrieval)
const std::vector< int > & stripCharges() const
returns the list of charges
const Identifier & identify() const
: Returns the Athena identifier of the micro mega cluster It's constructed from the measurementHash &...
const std::vector< uint16_t > & stripNumbers() const
returns the list of strip numbers
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
const std::vector< uint16_t > & stripNumbers() const
returns the list of strip numbers
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
const std::vector< short int > & stripTimes() const
returns the list of times
Identifier identify() const
return the identifier
double getCTPCorrectedDriftVelocity(const Identifier &identifier, const double theta) const
const std::vector< int16_t > & stripTimes() const
returns the list of times
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
double charge(const T &p)
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
def time(flags, cells_name, *args, **kw)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h)
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
const Amg::Transform3D & localToGlobalTrans(const ActsGeometryContext &ctx) const
Returns the local to global transformation into the ATLAS coordinate system.
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
const sTgcReadoutElement * getsTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
unsigned int charge() const
constexpr int pow(int base, int exp) noexcept
double channelWidth() const
calculate local channel width
bool timeAndChargeInCounts() const
const CalibConstants * getCalibForChannel(const CalibDataType type, const Identifier &channelId) const
Retrieves the calibration constant for a particular readout channel.
static constexpr int s_BCWindow
const std::vector< int > & stripCharges() const
returns the list of charges