|
ATLAS Offline Software
|
#include <CalibrationFileIOTool.h>
|
| CalibrationFileIOTool (const std::string &t, const std::string &n, const IInterface *p) |
| constructor More...
|
|
StatusCode | WriteT0 (const MdtTubeFitContainer *t0_output, const NtupleStationId &station_id, int, int) override |
| write out t0 More...
|
|
StatusCode | WriteRt (const RtCalibrationOutput *rt_relation, std::shared_ptr< const IRtResolution > resolution, const NtupleStationId &station_id, int, int, bool, bool) override |
| write rt More...
|
|
StatusCode | LoadT0 (std::map< NtupleStationId, MdtStationT0Container * > &t0s, int) override |
| load t0s More...
|
|
StatusCode | LoadRt (std::map< NtupleStationId, IRtRelation * > &rts, std::map< NtupleStationId, IRtResolution * > &res, int) override |
| load rts More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
bool | fill_rt (std::unique_ptr< RtDataFromFile::RtRelation > &rt, const std::shared_ptr< const IRtRelation > &new_rt, const std::shared_ptr< const MuonCalib::IRtResolution > &resolut) |
| fill rt relation More...
|
|
void | read_rt_relation (const std::string &fname, std::map< NtupleStationId, IRtRelation * > &rts, std::map< NtupleStationId, IRtResolution * > &res, const MuonCalib::NtupleStationId &id) |
| create the rt relation and resolution More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 17 of file CalibrationFileIOTool.h.
◆ StoreGateSvc_t
◆ CalibrationFileIOTool()
MuonCalib::CalibrationFileIOTool::CalibrationFileIOTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ fill_rt()
fill rt relation
Definition at line 153 of file CalibrationFileIOTool.cxx.
160 std::shared_ptr<const RtChebyshev> rt_Chebyshev = std::dynamic_pointer_cast<const RtChebyshev>(new_rt);
161 std::shared_ptr<const RtRelationLookUp> rt_lookup = std::dynamic_pointer_cast<const RtRelationLookUp>(new_rt);
169 unsigned int nb_points(100);
170 double t_length(rt_Chebyshev->tUpper() - rt_Chebyshev->tLower());
171 double bin_size(t_length /
static_cast<double>(nb_points - 1));
172 for (
unsigned int k = 0;
k < nb_points;
k++) {
173 double time(rt_Chebyshev->tLower() +
k * bin_size);
174 double radius(rt_Chebyshev->radius(time));
177 if (std::isnan(time) || std::isnan(
radius) || std::isnan(resol)) {
181 rt->addEntry(time,
radius, resol);
187 double t_min(rt_param[0]);
188 double bin_size = rt_param[1];
189 unsigned int nb_points(rt_lookup->nPar() - 2);
190 for (
unsigned int k = 0;
k < nb_points;
k++) {
191 double radius(rt_param[
k + 2]);
195 if (std::isnan(
radius) || std::isnan(resol)) {
199 rt->addEntry(t_min + bin_size *
k, rt_param[
k + 2], resol);
206 if (new_rt->HasTmaxDiff()) rt->addEntry(new_rt->GetTmaxDiff(), -9999, 0);
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& MuonCalib::ICalibrationIOTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
interface method
Definition at line 35 of file ICalibrationIOTool.h.
36 static const InterfaceID IID_CalibrationIOTool(
"MuonCalib::ICalibrationIOTool", 1, 0);
37 return IID_CalibrationIOTool;
◆ interpret_chamber_name()
bool MuonCalib::CalibrationFileIOTool::interpret_chamber_name |
( |
const std::string & |
nm, |
|
|
const char * |
prefix, |
|
|
std::string & |
station, |
|
|
int & |
eta, |
|
|
int & |
phi, |
|
|
int & |
ml |
|
) |
| |
|
inlinestaticprivate |
extract station identifier from file name
Definition at line 212 of file CalibrationFileIOTool.cxx.
215 std::string prefix_st(
prefix);
216 if (!
nm.starts_with( prefix_st))
return false;
218 if (!
nm.ends_with(
".dat"))
return false;
220 std::string cutout(
nm, prefix_st.size(),
nm.size() - 4 - prefix_st.size());
222 int uscore_pos(cutout.find(
'_'));
223 if (uscore_pos <= 0)
return false;
224 station = std::string(cutout, 0, uscore_pos);
226 std::string cutout2(cutout, uscore_pos + 1);
227 int count_items(sscanf(cutout2.c_str(),
"%80d_%80d_%80d", &phi, &eta, &ml));
228 if (count_items < 2)
return false;
229 if (count_items != 3) ml = 0;
◆ LoadRt()
◆ LoadT0()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ read_rt_relation()
create the rt relation and resolution
Definition at line 233 of file CalibrationFileIOTool.cxx.
243 std::vector<double>
r,
t,
res;
249 float multilayer_diff(9e9);
254 infile >> multilayer_diff;
265 ATH_MSG_WARNING(
"Not enough good rt points for " <<
id.regionId() <<
"!");
268 std::vector<MuonCalib::SamplePoint> point(
r.size());
269 for (
unsigned int k = 0;
k < point.size();
k++) {
270 point[
k].set_x1(
t[
k]);
271 point[
k].set_x2(
r[
k]);
272 point[
k].set_error(1.0);
281 if (multilayer_diff < 8e8)
rts[
id]->SetTmaxDiff(multilayer_diff);
284 for (
unsigned int k = 0;
k < point.size();
k++) {
285 point[
k].set_x1(
t[
k]);
286 point[
k].set_x2(
res[
k]);
287 point[
k].set_error(1.0);
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ WriteRt()
write rt
Implements MuonCalib::ICalibrationIOTool.
Definition at line 70 of file CalibrationFileIOTool.cxx.
73 RtDataFromFile rt_data;
74 std::shared_ptr<const IRtRelation> new_rt = rt_relation->rt();
75 std::unique_ptr<RtDataFromFile::RtRelation> rt = std::make_unique<RtDataFromFile::RtRelation>();
77 rt->setRegionId(station_id.FixedId());
78 rt_data.setVersion(2, 0);
80 if (station_id.RegionHash() != 0) { rt->setRegionId(station_id.RegionHash()); }
84 rt_data.addRt(rt_region_id, rt.get(), rt_relation->fullInfo().get());
87 system((
"mkdir -p " +
m_calib_dir +
"/rts").c_str());
88 std::string rt_file_name(
m_calib_dir +
"/rts/Rt_" + station_id.regionId() +
".dat");
91 return StatusCode::SUCCESS;
◆ WriteT0()
write out t0
Implements MuonCalib::ICalibrationIOTool.
Definition at line 51 of file CalibrationFileIOTool.cxx.
54 system((
"mkdir -p " +
m_calib_dir +
"/t0s").c_str());
56 std::string t0_file_name(
m_calib_dir +
"/t0s/T0" + station_id.regionId() +
".dat");
59 ATH_MSG_ERROR(
"Could not open t0 file " << t0_file_name <<
"!");
60 return StatusCode::FAILURE;
63 TubeDataFromFile t0_file;
64 t0_file.setNRegions(1);
65 t0_file.addTubes(0, t0_output);
67 return StatusCode::SUCCESS;
◆ m_calib_dir
std::string MuonCalib::CalibrationFileIOTool::m_calib_dir |
|
private |
◆ m_detStore
◆ m_evtStore
◆ m_rt_lookup
bool MuonCalib::CalibrationFileIOTool::m_rt_lookup |
|
private |
◆ m_use_fixed_id
bool MuonCalib::CalibrationFileIOTool::m_use_fixed_id |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
virtual double resolution(double t, double bgRate=0.0) const =0
returns resolution for a give time and background rate
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
static RtResolutionChebyshev getRtResolutionChebyshev(const std::vector< SamplePoint > &sample_points, const unsigned int &order)
< get an RtResolutionChebyshev resembling the sigma(t) function as described by the sample points in ...
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Equidistant look up table for rt-relations with the time as key.
double resolution[nGasTypes][nParametersResolution]
virtual void setOwner(IDataHandleHolder *o)=0
static RtRelationLookUp getRtRelationLookUp(const std::vector< SamplePoint > &sample_points)
std::pair< std::vector< unsigned int >, bool > res
std::vector< double > ParVec
static RtChebyshev getRtChebyshev(const std::vector< SamplePoint > &sample_points, const unsigned int &order)
< get an RtChebyshev resembling the r(t) function as described by the sample points in the vector "sa...
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
#define ATLAS_THREAD_SAFE
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>