1 #ifndef DETPEDESTALDUNE_CXX 2 #define DETPEDESTALDUNE_CXX 7 #include "nuevdb/IFDatabase/Table.h" 43 const string myname =
"DetPedestalDUNE::Configure: ";
55 fDefaultMean[
geo::kV] = p.
get<
float>(
"DefaultMeanV",0.);
59 fDefaultMean[
geo::kZ] = p.
get<
float>(
"DefaultMeanZ",0.);
72 std::cout << myname <<
" CSVFile: " << fCSVFileName <<
std::endl;
73 std::cout << myname <<
" UseDefaults: " << fUseDefaults <<
std::endl;
74 std::cout << myname <<
" DefaultMean[U]: " << fDefaultMean[
geo::kU] <<
std::endl;
78 std::cout << myname <<
" DefaultMean[V]: " << fDefaultMean[
geo::kV] <<
std::endl;
82 std::cout << myname <<
" DefaultMean[Z]: " << fDefaultMean[
geo::kZ] <<
std::endl;
99 std::cout << __PRETTY_FUNCTION__ <<
" Called with run " << ts <<
std::endl;
102 std::cout << __PRETTY_FUNCTION__ <<
" Method of determining pedestals is undefined! Either set UseDB or CSVFileName in fhicl. ";
104 std::cout <<
"Aborting per request." <<
std::endl;
124 std::cerr <<
"Detector name is undefined. Aborting." <<
std::endl;
133 int meanIdx = t.
AddCol(
"mean",
"float");
134 int rmsIdx = t.
AddCol(
"rms",
"float");
135 int meanErrIdx = t.
AddCol(
"meanerr",
"float");
136 int rmsErrIdx = t.
AddCol(
"rmserr",
"float");
148 std::cout <<
"Number of pedestals from database/CSV file is 0. This should never be the case! ";
150 std::cout <<
"Aborting, per request." <<
std::endl;
157 float mean,
rms, meanerr, rmserr;
159 for (
int i=0; i<t.
NRow(); ++i) {
160 mean = rms = meanerr = rmserr = 0.;
165 row->
Col(meanIdx).
Get(mean);
166 row->
Col(meanErrIdx).
Get(meanerr);
167 row->
Col(rmsIdx).
Get(rms);
168 row->
Col(rmsErrIdx).
Get(rmserr);
176 std::cout << __PRETTY_FUNCTION__ <<
": using run " << row->
VldTime()
246 std::cerr <<
"DetPedestalDUNE: Validity time is not set! Aborting." <<
std::endl;
269 std::cerr <<
"DetPedestalDUNE: Validity time is not set! Aborting." <<
std::endl;
291 std::cerr <<
"DetPedestalDUNE: Validity time is not set! Aborting." <<
std::endl;
313 std::cerr <<
"DetPedestalDUNE: Validity time is not set! Aborting." <<
std::endl;
327 for (; itMean !=
fMeanMap.end(); ++itMean) {
328 std::cout <<
"Channel: " << itMean->first <<
", Mean = " << itMean->second
Pedestal provider class for DUNE.
std::map< geo::View_t, float > fDefaultRmsErr
double rms(sqlite3 *db, std::string const &table_name, std::string const &column_name)
std::unordered_map< raw::ChannelID_t, float > fRmsMap
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::unordered_map< raw::ChannelID_t, float > fRmsErrMap
std::unordered_map< raw::ChannelID_t, float > fMeanMap
Planes which measure Z direction.
virtual float PedRmsErr(raw::ChannelID_t ch) const
float DefaultRms(geo::View_t v) const
virtual float PedMean(raw::ChannelID_t ch) const
Retrieve pedestal information.
virtual float PedRms(raw::ChannelID_t ch) const
DetPedestalDUNE(std::string detName="")
T get(std::string const &key) const
std::map< geo::View_t, float > fDefaultMeanErr
unsigned __int64 uint64_t
float DefaultRmsErr(geo::View_t v) const
bool Configure(fhicl::ParameterSet const &pset)
std::map< geo::View_t, float > fDefaultRms
float DefaultMean(geo::View_t v) const
std::unordered_map< raw::ChannelID_t, float > fMeanErrMap
std::map< geo::View_t, float > fDefaultMean
art::ServiceHandle< lbne::ChannelMapService > fChannelMap
unsigned int ChannelID_t
Type representing the ID of a readout channel.
float DefaultMeanErr(geo::View_t v) const
double mean(sqlite3 *db, std::string const &table_name, std::string const &column_name)
virtual float PedMeanErr(raw::ChannelID_t ch) const
QTextStream & endl(QTextStream &s)