1 #include "DataQualityCorrection.hxx" 2 #include "DataClasses.hxx" 3 #include "Parameters.hxx" 12 std::string base =
"highlandCorrections.DataQuality.";
16 std::string curr = GetParamString(base +
"NewValue.", pairing);
18 while (ND::params().HasParameter(curr)) {
21 if (val != 0 && val != 1) {
22 std::cerr <<
"Invalid NewValue set for DataQuality correction in parameters file." << std::endl;
23 std::cerr <<
"Values must be either 0 or 1 - correct highlandIO.parameters.dat!" << std::endl;
27 curr = GetParamString(base +
"Time.Lower.", pairing);
29 curr = GetParamString(base +
"Time.Upper.", pairing);
31 std::pair<int, int> p(lower, upper);
32 _time_periods.push_back(p);
33 _new_values.push_back(val);
35 curr = GetParamString(base +
"NewValue.", pairing);
41 std::string DataQualityCorrection::GetParamString(std::string base,
int pairing) {
44 ss << base << pairing;
64 for (
unsigned int i = 0; i < _time_periods.size(); i++) {
65 if (time >= _time_periods[i].first && time <= _time_periods[i].second) {
66 new_value = _new_values[i];
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
void Apply(AnaSpillC &spill)
Apply the variation to all tracks with TPC info.
AnaEventInfoB * EventInfo
Run, sunrun, event, time stamp, etc.
All corrections should be registered with the CorrectionManager.
bool GetIsMC() const
Return whether this spill is from Monte Carlo or not.
AnaDataQualityB * DataQuality
The ND280 data quality flags for this spill.