34 : mpReaderConfig_(config.getParameter<
edm::
ParameterSet>(
"MillePedeFileReader")) {}
43 edm::LogInfo(
"MillePedeDQMModule") <<
"Booking histograms";
48 h_xPos = booker.
book1D(
"Xpos",
"Alignment fit #DeltaX;;#mum", 36, 0., 36.);
49 h_xRot = booker.
book1D(
"Xrot",
"Alignment fit #Delta#theta_{X};;#murad", 36, 0., 36.);
50 h_yPos = booker.
book1D(
"Ypos",
"Alignment fit #DeltaY;;#mum", 36, 0., 36.);
51 h_yRot = booker.
book1D(
"Yrot",
"Alignment fit #Delta#theta_{Y};;#murad", 36, 0., 36.);
52 h_zPos = booker.
book1D(
"Zpos",
"Alignment fit #DeltaZ;;#mum", 36, 0., 36.);
53 h_zRot = booker.
book1D(
"Zrot",
"Alignment fit #Delta#theta_{Z};;#murad", 36, 0., 36.);
55 statusResults = booker.
book2D(
"statusResults",
"Status of SiPixelAli PCL workflow;;", 6, 0., 6., 1, 0., 1.);
67 throw cms::Exception(
"LogicError") <<
"@SUB=MillePedeDQMModule::dqmEndJob\n" 68 <<
"Try to read MillePede results before initializing MillePedeFileReader";
73 auto theResults =
mpReader_->getResults();
74 std::string exitCodeStr = theResults.getExitMessage();
96 auto thresholds_ = thresholdHandle.
product();
98 auto myThresholds = std::make_shared<AlignPCLThresholds>();
103 const auto trackerGeometry = builder.
build(&(*geometricDet), *ptp, &(*tTopo));
104 tracker_ = std::make_unique<AlignableTracker>(trackerGeometry, &(*tTopo));
114 mpReader_ = std::make_unique<MillePedeFileReader>(
119 TH2F* histo_status = statusHisto->
getTH2F();
120 auto theResults =
mpReader_->getResults();
122 histo_status->SetBinContent(1, 1, theResults.getDBUpdated());
123 histo_status->GetXaxis()->SetBinLabel(1,
"DB updated");
124 histo_status->SetBinContent(2, 1, theResults.exceedsCutoffs());
125 histo_status->GetXaxis()->SetBinLabel(2,
"significant movement");
126 histo_status->SetBinContent(3, 1, theResults.getDBVetoed());
127 histo_status->GetXaxis()->SetBinLabel(3,
"DB update vetoed");
128 histo_status->SetBinContent(4, 1, !theResults.exceedsThresholds());
129 histo_status->GetXaxis()->SetBinLabel(4,
"within max movement");
130 histo_status->SetBinContent(5, 1, !theResults.exceedsMaxError());
131 histo_status->GetXaxis()->SetBinLabel(5,
"within max error");
132 histo_status->SetBinContent(6, 1, !theResults.belowSignificance());
133 histo_status->GetXaxis()->SetBinLabel(6,
"above significance");
137 std::array<double, 6> Xcut_, sigXcut_, maxMoveXcut_, maxErrorXcut_;
138 std::array<double, 6> tXcut_, sigtXcut_, maxMovetXcut_, maxErrortXcut_;
140 std::array<double, 6> Ycut_, sigYcut_, maxMoveYcut_, maxErrorYcut_;
141 std::array<double, 6> tYcut_, sigtYcut_, maxMovetYcut_, maxErrortYcut_;
143 std::array<double, 6> Zcut_, sigZcut_, maxMoveZcut_, maxErrorZcut_;
144 std::array<double, 6> tZcut_, sigtZcut_, maxMovetZcut_, maxErrortZcut_;
146 auto myMap =
mpReader_->getThresholdMap();
148 std::vector<std::string> alignablesList;
149 for (
auto it = myMap.begin(); it != myMap.end(); ++it) {
150 alignablesList.push_back(it->first);
153 for (
auto& alignable : alignablesList) {
156 Xcut_[detIndex] = myMap[alignable].getXcut();
157 sigXcut_[detIndex] = myMap[alignable].getSigXcut();
158 maxMoveXcut_[detIndex] = myMap[alignable].getMaxMoveXcut();
159 maxErrorXcut_[detIndex] = myMap[alignable].getErrorXcut();
161 Ycut_[detIndex] = myMap[alignable].getYcut();
162 sigYcut_[detIndex] = myMap[alignable].getSigYcut();
163 maxMoveYcut_[detIndex] = myMap[alignable].getMaxMoveYcut();
164 maxErrorYcut_[detIndex] = myMap[alignable].getErrorYcut();
166 Zcut_[detIndex] = myMap[alignable].getZcut();
167 sigZcut_[detIndex] = myMap[alignable].getSigZcut();
168 maxMoveZcut_[detIndex] = myMap[alignable].getMaxMoveZcut();
169 maxErrorZcut_[detIndex] = myMap[alignable].getErrorZcut();
171 tXcut_[detIndex] = myMap[alignable].getThetaXcut();
172 sigtXcut_[detIndex] = myMap[alignable].getSigThetaXcut();
173 maxMovetXcut_[detIndex] = myMap[alignable].getMaxMoveThetaXcut();
174 maxErrortXcut_[detIndex] = myMap[alignable].getErrorThetaXcut();
176 tYcut_[detIndex] = myMap[alignable].getThetaYcut();
177 sigtYcut_[detIndex] = myMap[alignable].getSigThetaYcut();
178 maxMovetYcut_[detIndex] = myMap[alignable].getMaxMoveThetaYcut();
179 maxErrortYcut_[detIndex] = myMap[alignable].getErrorThetaYcut();
181 tZcut_[detIndex] = myMap[alignable].getThetaZcut();
182 sigtZcut_[detIndex] = myMap[alignable].getSigThetaZcut();
183 maxMovetZcut_[detIndex] = myMap[alignable].getMaxMoveThetaZcut();
184 maxErrortZcut_[detIndex] = myMap[alignable].getErrorThetaZcut();
201 const std::array<double, 6>&
cut,
202 const std::array<double, 6>&
sigCut,
203 const std::array<double, 6>& maxMoveCut,
204 const std::array<double, 6>& maxErrorCut,
205 const std::array<double, 6>& obs,
206 const std::array<double, 6>& obsErr) {
207 TH1F* histo_0 = histo->
getTH1F();
209 double max_ = *std::max_element(maxMoveCut.begin(), maxMoveCut.end());
211 histo_0->SetMinimum(-(max_));
212 histo_0->SetMaximum(max_);
223 for (
size_t i = 0;
i < obs.size(); ++
i) {
225 histo_0->SetBinContent(
i + 1, obs[
i]);
226 histo_0->SetBinError(i + 1, obsErr[i]);
230 histo_0->SetBinContent(8 + i * 5, cut[i]);
233 histo_0->SetBinContent(9 + i * 5, sigCut[i]);
236 histo_0->SetBinContent(10 + i * 5, maxMoveCut[i]);
239 histo_0->SetBinContent(11 + i * 5, maxErrorCut[i]);
257 if (alignableId ==
"TPBHalfBarrelXminus") {
259 }
else if (alignableId ==
"TPBHalfBarrelXplus") {
261 }
else if (alignableId ==
"TPEHalfCylinderXminusZminus") {
263 }
else if (alignableId ==
"TPEHalfCylinderXplusZminus") {
265 }
else if (alignableId ==
"TPEHalfCylinderXminusZplus") {
267 }
else if (alignableId ==
"TPEHalfCylinderXplusZplus") {
270 throw cms::Exception(
"LogicError") <<
"@SUB=MillePedeDQMModule::getIndexFromString\n" 271 <<
"Retrieving conversion for not supported Alignable partition" << alignableId;
const edm::ParameterSet mpReaderConfig_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
void fillStatusHisto(MonitorElement *statusHisto)
virtual TH2F * getTH2F() const
void setCurrentFolder(std::string const &fullpath)
std::vector< ParameterSet > VParameterSet
virtual TH1F * getTH1F() const
bool setupChanged(const edm::EventSetup &)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
DQM Plotter for PCL-Alignment.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
MonitorElement * binariesAvalaible
edm::ESWatcher< IdealGeometryRecord > watchIdealGeometryRcd_
MillePedeDQMModule(const edm::ParameterSet &)
void bookHistograms(DQMStore::IBooker &)
void fillExpertHisto(MonitorElement *histo, const std::array< double, 6 > &cut, const std::array< double, 6 > &sigCut, const std::array< double, 6 > &maxMoveCut, const std::array< double, 6 > &maxErrorCut, const std::array< double, 6 > &obs, const std::array< double, 6 > &obsErr)
void beginRun(const edm::Run &, const edm::EventSetup &) override
void addUntrackedParameter(std::string const &name, T const &value)
void setAlignPCLThresholds(const int &Nrecords, const threshold_map &Thresholds)
MonitorElement * statusResults
bool check(const edm::EventSetup &iSetup)
edm::ESWatcher< TrackerTopologyRcd > watchTrackerTopologyRcd_
edm::ESWatcher< PTrackerParametersRcd > watchPTrackerParametersRcd_
std::unique_ptr< AlignableTracker > tracker_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
std::unique_ptr< MillePedeFileReader > mpReader_
MonitorElement * bookString(TString const &name, TString const &value)
int getIndexFromString(const std::string &alignableId)
MonitorElement * exitCode
~MillePedeDQMModule() override
T const * product() const
MonitorElement * bookInt(TString const &name)