76 edm::LogInfo(
"AlignPCLThresholdsWriter") <<
"Size of AlignPCLThresholds object " << myThresholds.size() << std::endl;
79 std::array<std::string, 6> mandatories = {{
"X",
"Y",
"Z",
"thetaX",
"thetaY",
"thetaZ"}};
80 std::vector<std::string> alignables;
86 if (
std::find(alignables.begin(), alignables.end(), alignableId) == alignables.end()) {
87 alignables.push_back(alignableId);
91 for (
auto& alignable : alignables) {
99 std::vector<std::string> presentDOF;
102 std::vector<AlignPCLThreshold::coordThresholds> extraDOFs = std::vector<AlignPCLThreshold::coordThresholds>();
104 for (
auto& thePSet : m_parameters) {
108 const double cutoff(thePSet.getParameter<
double>(
"cut"));
109 const double sigCut(thePSet.getParameter<
double>(
"sigCut"));
110 const double maxMoveCut(thePSet.getParameter<
double>(
"maxMoveCut"));
111 const double maxErrorCut(thePSet.getParameter<
double>(
"maxErrorCut"));
113 if (alignableId == alignable) {
114 presentDOF.push_back(DOF);
138 <<
"Appending Extra degree of freeedom: " << DOF <<
" " <<
mapOntoEnum(DOF) << std::endl;
141 extraDOFs.push_back(ExtraDOF);
145 myThresholds.setAlignPCLThreshold(alignableId,
a);
152 <<
"Size of AlignPCLThresholds object " << myThresholds.size() << std::endl;
153 for (
auto& mandatory : mandatories) {
154 if (
std::find(presentDOF.begin(), presentDOF.end(), mandatory) == presentDOF.end()) {
156 <<
"Configuration for DOF: " << mandatory <<
" for alignable " << alignable <<
"is not present \n"
157 <<
"Will build object with defaults!" << std::endl;
165 edm::LogInfo(
"AlignPCLThresholdsWriter") <<
"Content of AlignPCLThresholds " << std::endl;
168 myThresholds.printAll();
172 if (poolDbService.isAvailable()) {
175 poolDbService->writeOneIOV(myThresholds, valid_time,
m_record);
const std::vector< edm::ParameterSet > m_parameters
DOFs::dof mapOntoEnum(std::string coord)
const unsigned int m_minNrecords
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned long long Time_t
Log< level::Info, false > LogInfo
const std::string m_record
cond::Time_t currentTime() const
Log< level::Warning, false > LogWarning
void setThresholds(float theCut, float theSigCut, float theErrorCut, float theMaxMoveCut, const std::string &theLabel)