ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::mmCTPClusterCalibData Class Reference

#include <mmCTPClusterCalibData.h>

Inheritance diagram for Muon::mmCTPClusterCalibData:
Collaboration diagram for Muon::mmCTPClusterCalibData:

Classes

class  CTPParameters

Public Member Functions

 mmCTPClusterCalibData (const Muon::IMuonIdHelperSvc *idHelperSvc)
 ~mmCTPClusterCalibData ()=default
StatusCode storeConstants (const Identifier &gasGapId, CTPParameters &&newConstants)
double getCTPCorrectedDriftVelocity (const Identifier &identifier, const double theta) const
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Private Types

using parameterMap = std::unordered_map<Identifier, CTPParameters>

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

const Muon::IMuonIdHelperSvcm_idHelperSvc {nullptr}
parameterMap m_database {}
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 18 of file mmCTPClusterCalibData.h.

Member Typedef Documentation

◆ parameterMap

Definition at line 43 of file mmCTPClusterCalibData.h.

Constructor & Destructor Documentation

◆ mmCTPClusterCalibData()

Muon::mmCTPClusterCalibData::mmCTPClusterCalibData ( const Muon::IMuonIdHelperSvc * idHelperSvc)

Definition at line 9 of file mmCTPClusterCalibData.cxx.

9 :
10 AthMessaging{"mmCTPClusterCalibData"},
11 m_idHelperSvc{idHelperSvc} {}
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
const Muon::IMuonIdHelperSvc * m_idHelperSvc

◆ ~mmCTPClusterCalibData()

Muon::mmCTPClusterCalibData::~mmCTPClusterCalibData ( )
default

Member Function Documentation

◆ getCTPCorrectedDriftVelocity()

double Muon::mmCTPClusterCalibData::getCTPCorrectedDriftVelocity ( const Identifier & identifier,
const double theta ) const

Definition at line 41 of file mmCTPClusterCalibData.cxx.

41 {
42 //Identifier: There is no pcb segmentation for these corrections, stored with pcb = 1 as default! Therefore expects pcb = 1
43 //Theta: Expected in degrees
44 //Drift velocity: will be fully taken from the parametrisation from calibration file
45
46 //If not present in the map return original value
47 if( m_database.find(gasGapIdentifier) == m_database.end()) {
48 ATH_MSG_ERROR("There's no drift velocity calibration available for gasGap " << m_idHelperSvc->toStringGasGap(gasGapIdentifier)<< " size of the calib map is: " << m_database.size() );
49 }
50
51 ATH_MSG_VERBOSE( "Retrieving drift velocity for stName" << m_idHelperSvc->toStringGasGap(gasGapIdentifier) );
52
53 //Conversions of incident angle
54 double trf_theta_in_degrees = (theta > 90) ? (180 - theta) : theta;
55 double trf_theta_in_radians = trf_theta_in_degrees * Gaudi::Units::deg;
56 double tan_theta = std::tan(trf_theta_in_radians);
57
58 //Parametrisation was derived as delta_residual = x_true - x_charge_weighted = (time_true - time_charge_weighted) * v_drift * tan(theta)
59 //The fit used is a linear fit from data obtained for VMM 17 to VMM 95. Data outside this fit range were excluted due to problems with the magnetic field at the inner and outer PCBs, see figure 11.8 on page 135 of https://cds.cern.ch/record/2839930/files/CERN-THESIS-2021-354.pdf. Therefore, it is expected, that x^2 and x^3 are 0.
60 //Parametrisation from Stefanie Gotz and Fabian Vogel, for more details see:
61 //https://indico.cern.ch/event/1501492/contributions/6321472/attachments/3013528/5314031/SpatialResolution14.pdf#page=5
62 //https://indico.cern.ch/event/1458120/contributions/6138857/attachments/2942828/5170893/MuonWeekOctober24FV1.pdf
63 double vDrift = m_database.at(gasGapIdentifier).pars()[0] + ((m_database.at(gasGapIdentifier).pars()[1])*trf_theta_in_degrees);
64
65 //Remove tantheta and always return positive drift velocity!
66
67 vDrift = (tan_theta != 0 ) ? std::fabs(vDrift/tan_theta) : std::fabs(vDrift);
68
69
70 ATH_MSG_VERBOSE( "New drift velocity: " << vDrift << " for theta: " << trf_theta_in_degrees << " degrees" );
71
72 return vDrift;
73}
Scalar theta() const
theta method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 163 of file AthMessaging.h.

164{
165 MsgStream* ms = m_msg_tls.get();
166 if (!ms) {
167 if (!m_initialized.test_and_set()) initMessaging();
168 ms = new MsgStream(m_imsg,m_nm);
169 m_msg_tls.reset( ms );
170 }
171
172 ms->setLevel (m_lvl);
173 return *ms;
174}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 178 of file AthMessaging.h.

179{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152{
153 if (m_lvl <= lvl) {
154 msg() << lvl;
155 return true;
156 } else {
157 return false;
158 }
159}

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ storeConstants()

StatusCode Muon::mmCTPClusterCalibData::storeConstants ( const Identifier & gasGapId,
CTPParameters && newConstants )

Definition at line 15 of file mmCTPClusterCalibData.cxx.

16 {
17
18 if (m_database.find(gasGapIdentifier) != m_database.end()) {
19 ATH_MSG_ERROR("The drift velocity calibration constants for gas gap "<<m_idHelperSvc->toStringGasGap(gasGapIdentifier) <<" already exist. Overwriting is not allowed");
20 return StatusCode::FAILURE;
21 }
22
23 //Retrieve the calibration constants, need at least 2 parameters for currently implemented parametrisation
24 if (newConstants.pars().size() < 2) {
25 ATH_MSG_ERROR("The error calibration constants for stName:" << m_idHelperSvc->mmIdHelper().stationName(gasGapIdentifier) <<
26 " stEta: " << m_idHelperSvc->mmIdHelper().stationEta(gasGapIdentifier) <<
27 " stPhi: " << m_idHelperSvc->mmIdHelper().stationPhi(gasGapIdentifier) <<
28 " ml: " << m_idHelperSvc->mmIdHelper().multilayer(gasGapIdentifier) <<
29 " gg: " << m_idHelperSvc->mmIdHelper().gasGap(gasGapIdentifier) <<
30 " are incomplete. 2 parameters are required!");
31
32 return StatusCode::FAILURE;
33 }
34
35
36 m_database[gasGapIdentifier] = std::move(newConstants);
37
38 return StatusCode::SUCCESS;
39}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_database

parameterMap Muon::mmCTPClusterCalibData::m_database {}
private

Definition at line 44 of file mmCTPClusterCalibData.h.

44{};

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* Muon::mmCTPClusterCalibData::m_idHelperSvc {nullptr}
private

Definition at line 42 of file mmCTPClusterCalibData.h.

42{nullptr};

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files: