#include <MdtCalibrationT0ShiftTool.h>
|
Gaudi::Property< std::string > | m_mapFileName {this,"MapFile",""} |
|
Gaudi::Property< float > | m_centralValue {this,"CentralValue",0} |
|
Gaudi::Property< float > | m_sigma {this,"Sigma",10} |
|
Gaudi::Property< bool > | m_forceMapRecreate {this,"ForceMapRecreate",false} |
|
std::map< Identifier, float > | m_shiftValues |
|
bool | m_mapIsInitialized {false} |
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
SG::ReadCondHandleKey< MuonMDT_CablingMap > | m_mdtCab {this, "MdtCabling", "MuonMDT_CablingMap"} |
|
Provides a per-tube smearing of the T0 value.
- Author
- Andreas Hoenle
Definition at line 16 of file MdtCalibrationT0ShiftTool.h.
◆ MdtCalibrationT0ShiftTool()
MdtCalibrationT0ShiftTool::MdtCalibrationT0ShiftTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~MdtCalibrationT0ShiftTool()
MdtCalibrationT0ShiftTool::~MdtCalibrationT0ShiftTool |
( |
| ) |
|
|
default |
◆ dumpMapAsFile()
StatusCode MdtCalibrationShiftMapBase::dumpMapAsFile |
( |
| ) |
|
|
inherited |
Definition at line 22 of file MdtCalibrationShiftMapBase.cxx.
33 if (!
file.is_open()) {
35 "Cannot open map output file for writing. Tried accessing file at \"./"
37 return StatusCode::FAILURE;
41 file <<
"# This file contains shift values for MDT tubes\n";
42 file <<
"# Each Identifier is mapped to a float\n";
43 file <<
"# Below are comma separated values with formatting\n";
44 file <<
"# Identifier.get_compact(),float\n";
45 file <<
"# ------------------------------------------------\n";
50 float shiftValue = shift.second;
51 file << identifierCompact;
57 return StatusCode::SUCCESS;
◆ getValue()
◆ initialize()
StatusCode MdtCalibrationShiftMapBase::initialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ initializeMap()
StatusCode MdtCalibrationT0ShiftTool::initializeMap |
( |
| ) |
|
|
finaloverridevirtual |
Loop over all tdc channels
Implements MdtCalibrationShiftMapBase.
Definition at line 15 of file MdtCalibrationT0ShiftTool.cxx.
18 ATH_MSG_WARNING(
"Map already initalized. Multiple calls of initalizeMap should not happen.");
19 return StatusCode::SUCCESS;
25 return StatusCode::SUCCESS;
33 TRandom3
rng( 20120704);
38 ATH_MSG_ERROR(
"Null pointer to the MDT cabling conditions object");
39 return StatusCode::FAILURE;
42 for (
const auto& onl_cab : mdtCabling->getOnlineConvMap()) {
46 for (
const auto& tdc : onl_cab.second) {
51 if (!mdtCabling->getOfflineId(
cabling_data, msgStream())) {
61 " .. with channelID"<<
64 channelIdentifier <<std::endl<<
" Identifier32 " << channelIdentifier.
get_identifier32());
68 return StatusCode::FAILURE;
75 return StatusCode::FAILURE;
88 return StatusCode::SUCCESS;
◆ loadMapFromFile()
StatusCode MdtCalibrationShiftMapBase::loadMapFromFile |
( |
| ) |
|
|
inherited |
Definition at line 60 of file MdtCalibrationShiftMapBase.cxx.
64 return StatusCode::SUCCESS;
69 if (fileWithPath.empty()) {
71 return StatusCode::FAILURE;
76 if (
stat(fileWithPath.c_str(), &
buffer) != 0) {
78 << fileWithPath.c_str()
79 <<
"\" -> map can not be initialized from this file.");
80 return StatusCode::FAILURE;
84 std::ifstream
fin(fileWithPath.c_str(), std::ios::in);
86 bool initializedWithWarnings =
false;
88 while (std::getline(
fin,
line)) {
90 if (
line.empty() ||
line.compare(0, 1,
"#") == 0 ||
91 line.compare(0, 2,
"//")) {
95 std::stringstream lineStream(
line);
98 std::vector<std::string> tokenVector;
99 while (std::getline(lineStream, token,
',')) {
100 tokenVector.push_back(token);
103 if (tokenVector.size() == 2) {
109 float shift = std::stof(tokenVector[1]);
113 << fileWithPath.c_str());
116 initializedWithWarnings =
true;
120 if (initializedWithWarnings) {
122 << fileWithPath.c_str() <<
"\"");
124 ATH_MSG_INFO(
"Successfully initialized shift map from file \""
125 << fileWithPath.c_str() <<
"\"");
127 return StatusCode::SUCCESS;
◆ m_centralValue
Gaudi::Property<float> MdtCalibrationShiftMapBase::m_centralValue {this,"CentralValue",0} |
|
protectedinherited |
◆ m_forceMapRecreate
Gaudi::Property<bool> MdtCalibrationShiftMapBase::m_forceMapRecreate {this,"ForceMapRecreate",false} |
|
protectedinherited |
◆ m_idHelperSvc
◆ m_mapFileName
Gaudi::Property<std::string> MdtCalibrationShiftMapBase::m_mapFileName {this,"MapFile",""} |
|
protectedinherited |
◆ m_mapIsInitialized
bool MdtCalibrationShiftMapBase::m_mapIsInitialized {false} |
|
protectedinherited |
◆ m_mdtCab
◆ m_shiftValues
std::map<Identifier, float> MdtCalibrationShiftMapBase::m_shiftValues |
|
protectedinherited |
◆ m_sigma
Gaudi::Property<float> MdtCalibrationShiftMapBase::m_sigma {this,"Sigma",10} |
|
protectedinherited |
The documentation for this class was generated from the following files: