 |
Belle II Software
release-05-02-19
|
17 #include <ecl/modules/eclLocalRunCalibration/ECLLocalRunCalibUnit.h>
18 #include <ecl/dbobjects/ECLCrystalLocalRunCalib.h>
19 #include <ecl/dbobjects/ECLLocalRunCalibRef.h>
25 const float& min_value,
26 const float& max_value,
27 const int*
const ndevs):
28 m_isNegAmpl(false), m_unitData(ncellids,
74 vec->push_back((obj.*getter)());
79 const std::string& dbName,
83 int exp = iov.getExperimentLow();
84 ECLDBTool refPayload(isLocal, dbName.c_str(),
88 refPayload.
write(&refobj, iov);
94 int exp = iov.getExperimentLow();
95 int run_high = iov.getRunLow() - 1;
98 payload.read(&prevIoV, ev);
102 payload.changeIoV(ev, ciov);
108 const std::string& dbName,
109 const std::string& payloadName,
112 const bool& changePrev,
115 int exp = iov.getExperimentLow();
120 nevents = cellAcc.getNOfEvents();
125 std::vector<int> counts;
127 callAccGetter<int>(&counts,
129 std::vector<float> means;
131 callAccGetter<float>(&means,
133 std::vector<float> stddevs;
135 callAccGetter<float>(&stddevs,
137 data.setNumberOfEvents(nevents);
138 data.setNumbersOfAcceptedEvents(counts);
139 data.setCalibVector(means, stddevs);
140 data.setExpRun(exp, run);
141 ECLDBTool payload(isLocal, dbName.c_str(),
142 payloadName.c_str());
147 payload.write(&data, iov);
A class that describes the interval of experiments/runs for which an object in the database is valid.
bool isNegAmpl() const
Check presence of negative amplitudes in the current run.
int getCount() const
Get number of accepted events.
float getStdDev() const
Get standard deviation.
std::vector< ECLLocalRunCalibAcc > m_unitData
Mean value and standard deviation accumulators for each cell id.
void changePreviousIoV(const ECLDBTool &payload, const IntervalOfValidity &iov)
Change previous validity interval.
void markAsRefference(const bool &isLocal, const std::string &dbName, const int &run, const IntervalOfValidity &iov)
Mark current run as reference.
ECLLocalRunCalibAcc is the class designed to accumulate mean values, standard deviation and number of...
void writeToDB(bool isLocal, const std::string &dbName, const std::string &payloadName, const IntervalOfValidity &iov, const int &run, const bool &changePrev, const bool &addref)
Write calibration results into a database.
float getMean() const
Get mean value.
void add(const int &cellid, const float &value)
Add value to accumulate mean value, standard deviation and number of accepted events.
Abstract base class for different kinds of events.
ECLLocalRunCalibUnit(const int &ncellids, const float &min_value, const float &max_value, const int *const ndevs)
Constructor.
int getRunLow() const
Getter for lowest run number.
void callAccGetter(std::vector< T > *vec, T(ECLLocalRunCalibAcc::*getter)() const)
Getter of accumulated values.
void calc()
Calculate accumulated values.
void enableNegAmpl()
This function will be called only in the case, if negative amplitudes are observed in the current run...
ECLCrystalLocalRunCalib is designed to store results of the ECL local run calibration to database.
ECLLocalRunCalibRef is designed to store reference marks to database for ECL local run calibration.
~ECLLocalRunCalibUnit()
Destructor.
bool m_isNegAmpl
m_isNegAmpl is true if there are negative amplitudes in the current run and false otherwise.