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

Holds single-tube full calibration information of one chamber. More...

#include <MdtTubeFitContainer.h>

Inheritance diagram for MuonCalib::MdtTubeFitContainer:
Collaboration diagram for MuonCalib::MdtTubeFitContainer:

Classes

struct  SingleTubeFit
 

Public Member Functions

 MdtTubeFitContainer (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 SingleTubeFitgetFit (const Identifier &tubeId) const
 return calibration constants of a single tube More...
 
SingleTubeFitgetFit (const Identifier &tubeId)
 
bool setFit (SingleTubeFit &&val, const Identifier &tubeId, MsgStream &log)
 set the calibration constants of a single tube More...
 
void setImplementation (const std::string &impl)
 set the name of the implementation used to fill this class More...
 
const std::string & name () const
 return the name of this class More...
 
const std::string & implementation () const
 return the name of the implementation filling this class More...
 
void setGroupBy (const std::string &group_by)
 
std::string GroupBy () const
 
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 {}
 

Private Attributes

std::vector< SingleTubeFitm_info {}
 
std::string m_name {"MdtTubeFitContainer"}
 
std::string m_implementation {"implementation"}
 
std::string m_group_by {"UNKNOWN"}
 

Detailed Description

Holds single-tube full calibration information of one chamber.

Definition at line 16 of file MdtTubeFitContainer.h.

Constructor & Destructor Documentation

◆ MdtTubeFitContainer()

MuonCalib::MdtTubeFitContainer::MdtTubeFitContainer ( 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 8 of file MdtTubeFitContainer.cxx.

9  :
11  m_info.resize(size());
12 }

Member Function Documentation

◆ getCalib()

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

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  };

◆ getFit() [1/2]

SingleTubeFit * MuonCalib::MdtTubeFitContainer::getFit ( const Identifier tubeId)

Definition at line 53 of file MdtTubeFitContainer.cxx.

53  {
54  unsigned int idx = vectorIndex(tubeId);
55  if (idx >= m_info.size()) return nullptr;
56  return &m_info[idx];
57 }

◆ getFit() [2/2]

const SingleTubeFit * MuonCalib::MdtTubeFitContainer::getFit ( const Identifier tubeId) const

return calibration constants of a single tube

Definition at line 47 of file MdtTubeFitContainer.cxx.

47  {
48  unsigned int idx = vectorIndex(tubeId);
49  if (idx >= m_info.size()) return nullptr;
50  return &m_info[idx];
51 }

◆ GroupBy()

std::string MuonCalib::MdtTubeFitContainer::GroupBy ( ) const

Definition at line 42 of file MdtTubeFitContainer.cxx.

42  {
43  if (!m_info.size()) return m_group_by;
44  return m_info.begin()->group_by;
45 }

◆ identify()

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

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
inherited

Definition at line 52 of file MdtTubeCalibContainer.cxx.

52  {
53  return m_idHelperSvc;
54 }

◆ implementation()

const std::string & MuonCalib::MdtTubeFitContainer::implementation ( ) const

return the name of the implementation filling this class

Definition at line 22 of file MdtTubeFitContainer.cxx.

22  {
23  return m_implementation;
24 }

◆ name()

const std::string & MuonCalib::MdtTubeFitContainer::name ( ) const

return the name of this class

Definition at line 18 of file MdtTubeFitContainer.cxx.

18  {
19  return m_name;
20 }

◆ numLayers()

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

Definition at line 50 of file MdtTubeCalibContainer.h.

50 { return m_nLayers; };

◆ numMultilayers()

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

Definition at line 49 of file MdtTubeCalibContainer.h.

49 { return m_nMl; };

◆ numTubes()

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

Definition at line 51 of file MdtTubeCalibContainer.h.

51 { return m_nTubes; };

◆ setCalib()

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

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 }

◆ setFit()

bool MuonCalib::MdtTubeFitContainer::setFit ( SingleTubeFit &&  val,
const Identifier tubeId,
MsgStream &  log 
)

set the calibration constants of a single tube

Definition at line 26 of file MdtTubeFitContainer.cxx.

26  {
27  unsigned int idx = vectorIndex(tubeId);
28  if (idx >= m_info.size()) {
29  log<<MSG::WARNING<<__FILE__<<":"<<__LINE__<<" Index "<<idx
30  <<" exceeds range "<<m_info.size()<<endmsg;
31  return false;
32  }
33  m_info[idx] = std::move(val);
34  return true;
35 }

◆ setGroupBy()

void MuonCalib::MdtTubeFitContainer::setGroupBy ( const std::string &  group_by)

Definition at line 37 of file MdtTubeFitContainer.cxx.

37  {
38  for (SingleTubeFit& fit : m_info) {
39  fit.group_by = group_by;
40  }
41 }

◆ setImplementation()

void MuonCalib::MdtTubeFitContainer::setImplementation ( const std::string &  impl)

set the name of the implementation used to fill this class

Definition at line 14 of file MdtTubeFitContainer.cxx.

14  {
16 }

◆ size()

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

Definition at line 48 of file MdtTubeCalibContainer.h.

48 { return m_data.size(); }

◆ vectorIndex()

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

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 {}
protectedinherited

Definition at line 69 of file MdtTubeCalibContainer.h.

◆ m_group_by

std::string MuonCalib::MdtTubeFitContainer::m_group_by {"UNKNOWN"}
private

Definition at line 63 of file MdtTubeFitContainer.h.

◆ m_idHelper

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

Definition at line 58 of file MdtTubeCalibContainer.h.

◆ m_idHelperSvc

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

Definition at line 57 of file MdtTubeCalibContainer.h.

◆ m_implementation

std::string MuonCalib::MdtTubeFitContainer::m_implementation {"implementation"}
private

Definition at line 62 of file MdtTubeFitContainer.h.

◆ m_info

std::vector<SingleTubeFit> MuonCalib::MdtTubeFitContainer::m_info {}
private

Definition at line 60 of file MdtTubeFitContainer.h.

◆ m_moduleID

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

Definition at line 56 of file MdtTubeCalibContainer.h.

◆ m_name

std::string MuonCalib::MdtTubeFitContainer::m_name {"MdtTubeFitContainer"}
private

Definition at line 61 of file MdtTubeFitContainer.h.

◆ m_nLayers

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

number of layer

Definition at line 67 of file MdtTubeCalibContainer.h.

◆ m_nMl

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

number of multilayers in chamber

Definition at line 66 of file MdtTubeCalibContainer.h.

◆ m_nTubes

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

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
MuonCalib::MdtTubeCalibContainer::vectorIndex
unsigned int vectorIndex(const Identifier &measID) const
calculate postion of tube in vector
Definition: MdtTubeCalibContainer.h:61
MuonCalib::MdtTubeFitContainer::m_group_by
std::string m_group_by
Definition: MdtTubeFitContainer.h:63
index
Definition: index.py:1
MuonCalib::SingleTubeFit
MdtTubeFitContainer::SingleTubeFit SingleTubeFit
Definition: MdtTubeFitContainer.cxx:7
MuonCalib::MdtTubeCalibContainer::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: MdtTubeCalibContainer.h:57
MuonCalib::MdtTubeFitContainer::m_implementation
std::string m_implementation
Definition: MdtTubeFitContainer.h:62
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
MuonCalib::MdtTubeCalibContainer::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 tu...
Definition: MdtTubeCalibContainer.cxx:6
MuonCalib::MdtTubeFitContainer::m_info
std::vector< SingleTubeFit > m_info
Definition: MdtTubeFitContainer.h:60
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
MuonValidation_CreateResolutionProfiles.fit
def fit(h, emin, emax)
Definition: MuonValidation_CreateResolutionProfiles.py:69
impl
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:46
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
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
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::MdtTubeFitContainer::m_name
std::string m_name
Definition: MdtTubeFitContainer.h:61
MuonCalib::MdtTubeCalibContainer::size
unsigned int size() const
Definition: MdtTubeCalibContainer.h:48
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