![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
27 m_postprocess_calibration(false),
30 m_reg_sel_svc(
"RegionSelectionSvc",
name),
31 m_input_service(
"MdtCalibInputSvc",
name) {
54 return AthService::queryInterface(riid, ppvUnknown);
57 return StatusCode::SUCCESS;
89 return StatusCode::SUCCESS;
100 return StatusCode::SUCCESS;
131 std::shared_ptr<const MuonCalib::IRtResolution> resol) {
143 if (!
m_results)
return StatusCode::SUCCESS;
148 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
149 return StatusCode::FAILURE;
173 std::shared_ptr<const T0CalibrationOutput> t0_output = std::dynamic_pointer_cast<const T0CalibrationOutput>(
m_results);
174 if (t0_output !=
nullptr) {
177 if (!t0_output->
GetMap().empty()) {
178 std::map<NtupleStationId, MdtTubeFitContainer *>::const_iterator mit(t0_output->
GetMap().find(
region_id));
179 if (mit != t0_output->
GetMap().end()) { new_t0s = mit->second; }
181 if (!new_t0s)
continue;
185 if (
sc.isFailure())
return sc;
189 bool real_resolution(
true), real_rt(
true);
190 std::shared_ptr<const RtCalibrationOutput> rt_output = std::dynamic_pointer_cast<const RtCalibrationOutput>(
m_results);
192 if (rt_output->
rt()) {
193 if (!rt_output->
rt()->HasTmaxDiff()) {
196 std::const_pointer_cast<IRtRelation>(rt_output->
rt())->SetTmaxDiff(old_rel->
GetTmaxDiff());
203 real_resolution =
false;
209 if (
sc.isFailure())
return sc;
216 return StatusCode::SUCCESS;
231 if (
id.NMultilayers() < 0)
return t0;
233 for (
int i = 0;
i <
id.NMultilayers();
i++) {
234 if (n_layers <
id.NLayers(
i)) n_layers =
id.NLayers(
i);
244 bool has_bad_fits(
false);
245 for (
unsigned int ml = 0; ml <
t0->numMultilayers(); ml++) {
246 if (
static_cast<int>(ml) ==
id.NMultilayers())
break;
247 for (
unsigned int ly = 0; ly <
t0->numLayers(); ly++) {
248 if (
static_cast<int>(ly) == n_layers)
break;
249 for (
unsigned int tb = 0;
tb <
t0->numTubes();
tb++) {
250 if (
static_cast<int>(
tb) ==
n_tubes)
break;
254 if (
t0->getCalib(ml, ly,
tb)->statusCode == 0) {
256 mean_t0 +=
t0->getCalib(ml, ly,
tb)->t0;
268 for (
unsigned int ly = 0; ly < new_t0->
numLayers(); ly++) {
270 if (
t0->getCalib(ml, ly,
tb)->statusCode != 0) {
289 std::vector<SamplePoint> res_points(100);
290 for (
unsigned int i = 0;
i < 100;
i++) {
291 double di =
static_cast<double>(
i);
293 double t_old = old_rel->
tLower() + (di / 100.0) * (old_rel->
tUpper() - old_rel->
tLower());
294 res_points[
i].set_x1(t_new);
296 if (res_points[
i].
x2() > 100 &&
i > 0) res_points[
i].set_x2(res_points[
i - 1].
x2());
297 res_points[
i].set_error(1);
305 double alpha[9] = {0.31476, -0.217661, 0.118337, -0.0374466, 0.00692553, -0.000764969, 4.97305E-05, -1.75457E-06, 2.59E-08};
311 par_vec[0] = rt->
tLower();
313 for (
unsigned int i = 0;
i < 100;
i++) {
317 for (
int l = 0;
l < 9;
l++) { resol = resol + alpha[
l] *
std::pow(
r,
l); }
318 par_vec[
i + 2] = resol;
322 par_vec[0] = rt->
tLower();
327 m_resolution = std::make_shared<MuonCalib::RtResolutionLookUp>(par_vec);
bool m_postprocess_calibration
virtual double resolution(double t, double bgRate=0.0) const =0
returns resolution for a give time and background rate
void setImplementation(const std::string &impl)
set the name of the implementation used to fill this class
virtual double tUpper(void) const =0
bool InitializeGeometry(const MdtIdHelper &mdtIdHelper, const MuonGM::MuonDetectorManager *detMgr)
initialize geometry information
ToolHandle< MuonCalib::ICalibrationIOTool > m_calib_output_tool
std::string regionId() const
return the region id string
ServiceHandle< MdtCalibInputSvc > m_input_service
ServiceHandle< RegionSelectionSvc > m_reg_sel_svc
void setGroupBy(const std::string &group_by)
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
method required by the base class which is need to obtain a pointer to the service in the standard wa...
bool memorize(std::shared_ptr< const MuonCalib::IMdtCalibrationOutput > result)
memorize the result of a particular calibration (given in result) for the calibration region "regionK...
std::vector< ALFA_RawData_p1 > t0
float GetTmaxDiff() const
return the difference in total dirft time between the two multilayers (ML1 - ML2)
unsigned int numMultilayers() const
void AddRunNumber(int run_number)
add a run number to the iov interval.
static const InterfaceID & interfaceID()
Methods required as defined in the base class "Service".
const SingleTubeCalib * getCalib(const Identifier &tubeId) const
return calibration constants of a single tube
bool setCalib(SingleTubeCalib &&val, const Identifier &tubeId, MsgStream &msg)
set the calibration constants of a single tube
unsigned int numLayers() const
std::vector< double > ParVec
virtual StatusCode initialize()
initialize method as required by the base class
std::shared_ptr< const MuonCalib::IMdtCalibrationOutput > m_results
MdtCalibOutputDbSvc(const std::string &name, ISvcLocator *svc_locator)
Constructor.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual double tLower(void) const =0
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
std::map< NtupleStationId, MdtTubeFitContainer * > & GetMap()
unsigned int numTubes() const
static RtResolutionLookUp getRtResolutionLookUp(const std::vector< SamplePoint > &sample_points)
double m_flat_default_resolution
virtual double radius(double t) const =0
returns drift radius for a given time
const MdtTubeFitContainer * t0s() const
std::vector< MuonCalib::NtupleStationId > m_region_ids
std::shared_ptr< const IRtRelation > rt() const
access to private attributes
StatusCode initialize(bool used=true)
StatusCode saveCalibrationResults(void)
write out all memorized results to text files (location specified in the job options) which can be up...
generic interface for a resolution function
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
void create_default_resolution(const std::shared_ptr< const MuonCalib::IRtRelation > &rt)
Holds single-tube full calibration information of one chamber.
virtual StatusCode finalize()
finalize method as required by the base class; the finalize method calls the method "save_calibration...
bool setFit(SingleTubeFit &&val, const Identifier &tubeId, MsgStream &log)
set the calibration constants of a single tube
void reset()
reset, clear memory of results
std::shared_ptr< const MuonCalib::IRtResolution > m_resolution
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
generic interface for a rt-relation
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
static const MuonCalib::MdtTubeFitContainer * postprocess_t0s(const MuonCalib::MdtTubeFitContainer *new_t0, const MuonCalib::NtupleStationId &id)
bool m_force_default_resolution