50 void endJob()
override;
64 : m_record(iConfig.getParameter<
std::
string>(
"record")),
65 m_minNrecords(iConfig.getParameter<unsigned
int>(
"minNRecords")),
86 std::array<std::string, 6> mandatories = {{
"X",
"Y",
"Z",
"thetaX",
"thetaY",
"thetaZ"}};
87 std::vector<std::string> alignables;
93 if (
std::find(alignables.begin(), alignables.end(), alignableId) == alignables.end()) {
94 alignables.push_back(alignableId);
98 for (
auto& alignable : alignables) {
106 std::vector<std::string> presentDOF;
109 std::vector<AlignPCLThreshold::coordThresholds> extraDOFs = std::vector<AlignPCLThreshold::coordThresholds>();
111 for (
auto& thePSet : m_parameters) {
115 const double cutoff(thePSet.getParameter<
double>(
"cut"));
116 const double sigCut(thePSet.getParameter<
double>(
"sigCut"));
117 const double maxMoveCut(thePSet.getParameter<
double>(
"maxMoveCut"));
118 const double maxErrorCut(thePSet.getParameter<
double>(
"maxErrorCut"));
120 if (alignableId == alignable) {
121 presentDOF.push_back(DOF);
126 my_X.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
129 my_Y.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
132 my_Z.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
135 my_tX.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
138 my_tY.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
141 my_tZ.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
145 <<
"Appending Extra degree of freeedom: " << DOF <<
" " <<
mapOntoEnum(DOF) << std::endl;
147 ExtraDOF.
setThresholds(cutoff, sigCut, maxErrorCut, maxMoveCut, DOF);
148 extraDOFs.push_back(ExtraDOF);
159 <<
"Size of AlignPCLThresholds object " <<
myThresholds->
size() << std::endl;
160 for (
auto& mandatory : mandatories) {
161 if (
std::find(presentDOF.begin(), presentDOF.end(), mandatory) == presentDOF.end()) {
163 <<
"Configuration for DOF: " << mandatory <<
" for alignable " << alignable <<
"is not present \n" 164 <<
"Will build object with defaults!" << std::endl;
172 edm::LogInfo(
"AlignPCLThresholdsWriter") <<
"Content of AlignPCLThresholds " << std::endl;
195 }
else if (coord ==
"Y") {
197 }
else if (coord ==
"Z") {
199 }
else if (coord ==
"thetaX") {
201 }
else if (coord ==
"thetaY") {
203 }
else if (coord ==
"thetaZ") {
void setAlignPCLThreshold(const std::string &AlignableId, const AlignPCLThreshold &Threshold)
const std::vector< edm::ParameterSet > m_parameters
DOFs::dof mapOntoEnum(std::string coord)
const unsigned int m_minNrecords
AlignPCLThresholdsWriter(const edm::ParameterSet &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void analyze(const edm::Event &, const edm::EventSetup &) override
~AlignPCLThresholdsWriter() override
#define DEFINE_FWK_MODULE(type)
unsigned long long Time_t
void addDefault(ParameterSetDescription const &psetDescription)
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void setNRecords(const int &Nrecords)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string m_record
cond::Time_t currentTime() const
AlignPCLThresholds * myThresholds
void setThresholds(float theCut, float theSigCut, float theErrorCut, float theMaxMoveCut, const std::string &theLabel)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)