ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MuonCalib::MdtTubeCalibContainer Class Reference

Holds single-tube calibration constants of one chamber. More...

#include <MdtTubeCalibContainer.h>

Inheritance diagram for MuonCalib::MdtTubeCalibContainer:
Collaboration diagram for MuonCalib::MdtTubeCalibContainer:

Classes

struct  SingleTubeCalib
 

Public Member Functions

 MdtTubeCalibContainer (const Muon::IMuonIdHelperSvc *idHelperSvc, const Identifier &moduleID)
 nMl = number of multilayres, nLayers = number of layers in multilayer (3 or 4); nTubes = number of tubes in one layer More...
 
const SingleTubeCalibgetCalib (const Identifier &tubeId) const
 return calibration constants of a single tube More...
 
bool setCalib (SingleTubeCalib &&val, const Identifier &tubeId, MsgStream &msg)
 set the calibration constants of a single tube More...
 
const Identifieridentify () const
 return container name and dimensions More...
 
unsigned int size () const
 
unsigned int numMultilayers () const
 
unsigned int numLayers () const
 
unsigned int numTubes () const
 
const Muon::IMuonIdHelperSvcidHelperSvc () const
 

Protected Member Functions

unsigned int vectorIndex (const Identifier &measID) const
 calculate postion of tube in vector More...
 

Protected Attributes

const Identifier m_moduleID {}
 
const Muon::IMuonIdHelperSvcm_idHelperSvc {nullptr}
 
const MdtIdHelperm_idHelper {m_idHelperSvc->mdtIdHelper()}
 
unsigned int m_nMl {0}
 number of multilayers in chamber More...
 
unsigned int m_nLayers {0}
 number of layer More...
 
unsigned int m_nTubes {0}
 number of tubes More...
 
std::vector< SingleTubeCalibm_data {}
 

Detailed Description

Holds single-tube calibration constants of one chamber.

Definition at line 16 of file MdtTubeCalibContainer.h.

Constructor & Destructor Documentation

◆ MdtTubeCalibContainer()

MuonCalib::MdtTubeCalibContainer::MdtTubeCalibContainer ( const Muon::IMuonIdHelperSvc idHelperSvc,
const Identifier moduleID 
)

nMl = number of multilayres, nLayers = number of layers in multilayer (3 or 4); nTubes = number of tubes in one layer

Definition at line 6 of file MdtTubeCalibContainer.cxx.

Member Function Documentation

◆ getCalib()

const SingleTubeCalib* MuonCalib::MdtTubeCalibContainer::getCalib ( const Identifier tubeId) const
inline

return calibration constants of a single tube

Definition at line 37 of file MdtTubeCalibContainer.h.

37  {
38  unsigned int idx = vectorIndex(tubeId);
39  if (idx >= m_data.size()) return nullptr;
40  return &m_data[idx];
41  };

◆ identify()

const Identifier& MuonCalib::MdtTubeCalibContainer::identify ( ) const
inline

return container name and dimensions

Definition at line 47 of file MdtTubeCalibContainer.h.

47 { return m_moduleID; }

◆ idHelperSvc()

const Muon::IMuonIdHelperSvc * MuonCalib::MdtTubeCalibContainer::idHelperSvc ( ) const

Definition at line 52 of file MdtTubeCalibContainer.cxx.

52  {
53  return m_idHelperSvc;
54 }

◆ numLayers()

unsigned int MuonCalib::MdtTubeCalibContainer::numLayers ( ) const
inline

Definition at line 50 of file MdtTubeCalibContainer.h.

50 { return m_nLayers; };

◆ numMultilayers()

unsigned int MuonCalib::MdtTubeCalibContainer::numMultilayers ( ) const
inline

Definition at line 49 of file MdtTubeCalibContainer.h.

49 { return m_nMl; };

◆ numTubes()

unsigned int MuonCalib::MdtTubeCalibContainer::numTubes ( ) const
inline

Definition at line 51 of file MdtTubeCalibContainer.h.

51 { return m_nTubes; };

◆ setCalib()

bool MuonCalib::MdtTubeCalibContainer::setCalib ( SingleTubeCalib &&  val,
const Identifier tubeId,
MsgStream &  msg 
)

set the calibration constants of a single tube

Make enough space for the calibration constants

Definition at line 19 of file MdtTubeCalibContainer.cxx.

19  {
21  const unsigned int index = vectorIndex(tubeId);
22  if (m_moduleID != m_idHelperSvc->chamberId(tubeId)) {
23  msg << MSG::ERROR<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
24  <<" does not correspond to chamber "<<m_idHelperSvc->chamberNameString(tubeId) <<endmsg;
25  return false;
26  }
27  if (!val) {
28  msg << MSG::ERROR<<__FILE__<<":" <<__LINE__<<" No data is parsed for "
29  << m_idHelperSvc->toString(tubeId)<<endmsg;
30  return false;
31  }
32  if (index >= m_data.size()) {
33  msg << MSG::WARNING<<__FILE__<<":"<<__LINE__<<" The channel "<<m_idHelperSvc->toString(tubeId)
34  <<"does not seem to match the anticipated chamber sizes of "
36  m_data.resize(index +1);
37  }
39  if (store) {
40  msg << MSG::ERROR<< __FILE__ <<":"<< __LINE__<< " Data has already been stored for channel "
41  << m_idHelperSvc->toString(tubeId)
42  <<", layer max: "<<m_nLayers<<", tube max: "<<m_nTubes
43  << endmsg;
44  return false;
45  }
46  store = std::move(val);
47  if (msg.level() <= MSG::VERBOSE) {
48  msg << MSG::VERBOSE<<" Succesfully stored calibration data for channel "<<m_idHelperSvc->toString(tubeId) << endmsg;
49  }
50  return true;
51 }

◆ size()

unsigned int MuonCalib::MdtTubeCalibContainer::size ( ) const
inline

Definition at line 48 of file MdtTubeCalibContainer.h.

48 { return m_data.size(); }

◆ vectorIndex()

unsigned int MuonCalib::MdtTubeCalibContainer::vectorIndex ( const Identifier measID) const
inlineprotected

calculate postion of tube in vector

Definition at line 61 of file MdtTubeCalibContainer.h.

61  {
62  return (m_idHelper.multilayer(measID) - 1) * (m_nLayers * m_nTubes) +
63  (m_idHelper.tubeLayer(measID) - 1) * m_nTubes +
64  (m_idHelper.tube(measID) -1);
65  }

Member Data Documentation

◆ m_data

std::vector<SingleTubeCalib> MuonCalib::MdtTubeCalibContainer::m_data {}
protected

Definition at line 69 of file MdtTubeCalibContainer.h.

◆ m_idHelper

const MdtIdHelper& MuonCalib::MdtTubeCalibContainer::m_idHelper {m_idHelperSvc->mdtIdHelper()}
protected

Definition at line 58 of file MdtTubeCalibContainer.h.

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* MuonCalib::MdtTubeCalibContainer::m_idHelperSvc {nullptr}
protected

Definition at line 57 of file MdtTubeCalibContainer.h.

◆ m_moduleID

const Identifier MuonCalib::MdtTubeCalibContainer::m_moduleID {}
protected

Definition at line 56 of file MdtTubeCalibContainer.h.

◆ m_nLayers

unsigned int MuonCalib::MdtTubeCalibContainer::m_nLayers {0}
protected

number of layer

Definition at line 67 of file MdtTubeCalibContainer.h.

◆ m_nMl

unsigned int MuonCalib::MdtTubeCalibContainer::m_nMl {0}
protected

number of multilayers in chamber

Definition at line 66 of file MdtTubeCalibContainer.h.

◆ m_nTubes

unsigned int MuonCalib::MdtTubeCalibContainer::m_nTubes {0}
protected

number of tubes

Definition at line 68 of file MdtTubeCalibContainer.h.


The documentation for this class was generated from the following files:
MdtIdHelper::multilayer
int multilayer(const Identifier &id) const
Access to components of the ID.
Definition: MdtIdHelper.cxx:722
SGTest::store
TestStore store
Definition: TestStore.cxx:23
MuonCalib::MdtTubeCalibContainer::m_idHelper
const MdtIdHelper & m_idHelper
Definition: MdtTubeCalibContainer.h:58
MdtIdHelper::tubeMax
int tubeMax() const
Definition: MdtIdHelper.cxx:770
MdtIdHelper::numberOfMultilayers
int numberOfMultilayers(const Identifier &id) const
Definition: MdtIdHelper.cxx:496
MuonCalib::MdtTubeCalibContainer::vectorIndex
unsigned int vectorIndex(const Identifier &measID) const
calculate postion of tube in vector
Definition: MdtTubeCalibContainer.h:61
index
Definition: index.py:1
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
MuonCalib::MdtTubeCalibContainer::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: MdtTubeCalibContainer.h:57
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
MuonCalib::MdtTubeCalibContainer::m_nTubes
unsigned int m_nTubes
number of tubes
Definition: MdtTubeCalibContainer.h:68
MdtIdHelper::tubeLayerMax
static int tubeLayerMax()
Definition: MdtIdHelper.cxx:766
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MdtIdHelper::tube
int tube(const Identifier &id) const
Definition: MdtIdHelper.cxx:726
MuonCalib::MdtTubeCalibContainer::m_moduleID
const Identifier m_moduleID
Definition: MdtTubeCalibContainer.h:56
Muon::IMuonIdHelperSvc::chamberId
virtual Identifier chamberId(const Identifier &id) const =0
create a chamber ID
DeMoScan.index
string index
Definition: DeMoScan.py:364
Muon::IMuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const =0
print all fields to string
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MdtIdHelper::multilayerID
Identifier multilayerID(const Identifier &channeldID) const
Definition: MdtIdHelper.cxx:333
MuonCalib::MdtTubeCalibContainer::SingleTubeCalib
Definition: MdtTubeCalibContainer.h:18
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
MuonCalib::MdtTubeCalibContainer::m_nMl
unsigned int m_nMl
number of multilayers in chamber
Definition: MdtTubeCalibContainer.h:66
MuonCalib::MdtTubeCalibContainer::m_data
std::vector< SingleTubeCalib > m_data
Definition: MdtTubeCalibContainer.h:69
Muon::IMuonIdHelperSvc::chamberNameString
virtual std::string chamberNameString(const Identifier &id) const =0
print chamber name to string
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
MuonCalib::MdtTubeCalibContainer::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition: MdtTubeCalibContainer.cxx:52
MuonCalib::MdtTubeCalibContainer::m_nLayers
unsigned int m_nLayers
number of layer
Definition: MdtTubeCalibContainer.h:67
Identifier
Definition: IdentifierFieldParser.cxx:14