35 isHG_(mpReaderConfig_.getParameter<
bool>(
"isHG")) {
36 consumes<AlignmentToken, edm::InProcess>(
config.getParameter<
edm::InputTag>(
"alignmentTokenSrc"));
46 edm::LogInfo(
"MillePedeDQMModule") <<
"Booking histograms";
51 h_xPos = booker.
book1D(
"Xpos",
"Alignment fit #DeltaX;;#mum", 36, 0., 36.);
52 h_xRot = booker.
book1D(
"Xrot",
"Alignment fit #Delta#theta_{X};;#murad", 36, 0., 36.);
53 h_yPos = booker.
book1D(
"Ypos",
"Alignment fit #DeltaY;;#mum", 36, 0., 36.);
54 h_yRot = booker.
book1D(
"Yrot",
"Alignment fit #Delta#theta_{Y};;#murad", 36, 0., 36.);
55 h_zPos = booker.
book1D(
"Zpos",
"Alignment fit #DeltaZ;;#mum", 36, 0., 36.);
56 h_zRot = booker.
book1D(
"Zrot",
"Alignment fit #Delta#theta_{Z};;#murad", 36, 0., 36.);
57 statusResults = booker.
book2D(
"statusResults",
"Status of SiPixelAli PCL workflow;;", 6, 0., 6., 1, 0., 1.);
74 "Alignment fit #DeltaX for " +
layer.first +
";;#mum",
79 "Alignment fit #Delta#theta_{X} for " +
layer.first +
";;#murad",
84 "Alignment fit #DeltaY for " +
layer.first +
";;#mum",
89 "Alignment fit #Delta#theta_{Y} for " +
layer.first +
";;#murad",
94 "Alignment fit #DeltaZ for " +
layer.first +
";;#mum",
99 "Alignment fit #Delta#theta_{Z} for " +
layer.first +
";;#murad",
106 booker.
book2D(
"statusResults",
"Fraction threshold check for SiPixelAliHG PCL;;", 6, 0., 6., 10, 0., 10.);
121 throw cms::Exception(
"LogicError") <<
"@SUB=MillePedeDQMModule::dqmEndJob\n" 122 <<
"Try to read MillePede results before initializing MillePedeFileReader";
132 auto theResults =
mpReader_->getResults();
133 std::string exitCodeStr = theResults.getExitMessage();
137 vetoStr =
"DB Updated!";
139 if (theResults.isHighGranularity()) {
140 if (theResults.getDBVetoed() && theResults.getDBUpdated()) {
141 vetoStr =
"DB Update Vetoed";
146 if (theResults.exceedsCutoffs()) {
147 vetoStr =
"DB Update Vetoed";
176 auto myThresholds = std::make_shared<AlignPCLThresholdsHG>();
177 myThresholds->setAlignPCLThresholds(thresholds_->getNrecords(), thresholds_->getThreshold_Map());
178 myThresholds->setFloatMap(thresholds_->getFloatMap());
182 const auto trackerGeometry = builder.
build(geometricDet, *ptp, tTopo);
183 tracker_ = std::make_unique<AlignableTracker>(trackerGeometry, tTopo);
193 mpReader_ = std::make_unique<MillePedeFileReader>(
198 TH2F* histo_status = statusHisto->
getTH2F();
199 auto theResults =
mpReader_->getResults();
201 histo_status->SetBinContent(1, 1, theResults.getDBUpdated());
202 histo_status->GetXaxis()->SetBinLabel(1,
"DB updated");
203 histo_status->SetBinContent(2, 1, theResults.exceedsCutoffs());
204 histo_status->GetXaxis()->SetBinLabel(2,
"significant movement");
205 histo_status->SetBinContent(3, 1, theResults.getDBVetoed());
206 histo_status->GetXaxis()->SetBinLabel(3,
"DB update vetoed");
207 histo_status->SetBinContent(4, 1, !theResults.exceedsThresholds());
208 histo_status->GetXaxis()->SetBinLabel(4,
"within max movement");
209 histo_status->SetBinContent(5, 1, !theResults.exceedsMaxError());
210 histo_status->GetXaxis()->SetBinLabel(5,
"within max error");
211 histo_status->SetBinContent(6, 1, !theResults.belowSignificance());
212 histo_status->GetXaxis()->SetBinLabel(6,
"above significance");
216 TH2F* histo_status = statusHisto->
getTH2F();
217 auto& theResults =
mpReader_->getResultsHG();
218 histo_status->GetXaxis()->SetBinLabel(1,
"#DeltaX");
219 histo_status->GetXaxis()->SetBinLabel(2,
"#DeltaY");
220 histo_status->GetXaxis()->SetBinLabel(3,
"#DeltaZ");
221 histo_status->GetXaxis()->SetBinLabel(4,
"#Delta#theta_{X}");
222 histo_status->GetXaxis()->SetBinLabel(5,
"#Delta#theta_{Y}");
223 histo_status->GetXaxis()->SetBinLabel(6,
"#Delta#theta_{Z}");
226 for (
const auto&
result : theResults) {
227 histo_status->GetYaxis()->SetBinLabel(
i + 1,
result.first.data());
228 for (std::size_t
j = 0;
j <
result.second.size(); ++
j) {
229 histo_status->SetBinContent(
j + 1,
i + 1,
result.second[
j]);
236 std::array<double, SIZE_INDEX> Xcut_, sigXcut_, maxMoveXcut_, maxErrorXcut_;
237 std::array<double, SIZE_INDEX> tXcut_, sigtXcut_, maxMovetXcut_, maxErrortXcut_;
239 std::array<double, SIZE_INDEX> Ycut_, sigYcut_, maxMoveYcut_, maxErrorYcut_;
240 std::array<double, SIZE_INDEX> tYcut_, sigtYcut_, maxMovetYcut_, maxErrortYcut_;
242 std::array<double, SIZE_INDEX> Zcut_, sigZcut_, maxMoveZcut_, maxErrorZcut_;
243 std::array<double, SIZE_INDEX> tZcut_, sigtZcut_, maxMovetZcut_, maxErrortZcut_;
245 auto myMap =
mpReader_->getThresholdMap();
247 std::vector<std::string> alignablesList;
248 for (
auto it = myMap.begin(); it != myMap.end(); ++it) {
249 alignablesList.push_back(it->first);
252 for (
auto& alignable : alignablesList) {
255 Xcut_[detIndex] = myMap[alignable].getXcut();
256 sigXcut_[detIndex] = myMap[alignable].getSigXcut();
257 maxMoveXcut_[detIndex] = myMap[alignable].getMaxMoveXcut();
258 maxErrorXcut_[detIndex] = myMap[alignable].getErrorXcut();
260 Ycut_[detIndex] = myMap[alignable].getYcut();
261 sigYcut_[detIndex] = myMap[alignable].getSigYcut();
262 maxMoveYcut_[detIndex] = myMap[alignable].getMaxMoveYcut();
263 maxErrorYcut_[detIndex] = myMap[alignable].getErrorYcut();
265 Zcut_[detIndex] = myMap[alignable].getZcut();
266 sigZcut_[detIndex] = myMap[alignable].getSigZcut();
267 maxMoveZcut_[detIndex] = myMap[alignable].getMaxMoveZcut();
268 maxErrorZcut_[detIndex] = myMap[alignable].getErrorZcut();
270 tXcut_[detIndex] = myMap[alignable].getThetaXcut();
271 sigtXcut_[detIndex] = myMap[alignable].getSigThetaXcut();
272 maxMovetXcut_[detIndex] = myMap[alignable].getMaxMoveThetaXcut();
273 maxErrortXcut_[detIndex] = myMap[alignable].getErrorThetaXcut();
275 tYcut_[detIndex] = myMap[alignable].getThetaYcut();
276 sigtYcut_[detIndex] = myMap[alignable].getSigThetaYcut();
277 maxMovetYcut_[detIndex] = myMap[alignable].getMaxMoveThetaYcut();
278 maxErrortYcut_[detIndex] = myMap[alignable].getErrorThetaYcut();
280 tZcut_[detIndex] = myMap[alignable].getThetaZcut();
281 sigtZcut_[detIndex] = myMap[alignable].getSigThetaZcut();
282 maxMovetZcut_[detIndex] = myMap[alignable].getMaxMoveThetaZcut();
283 maxErrortZcut_[detIndex] = myMap[alignable].getErrorThetaZcut();
300 const std::array<double, SIZE_INDEX>&
cut,
301 const std::array<double, SIZE_INDEX>&
sigCut,
302 const std::array<double, SIZE_INDEX>& maxMoveCut,
303 const std::array<double, SIZE_INDEX>& maxErrorCut,
304 const std::array<double, SIZE_LG_STRUCTS>& obs,
305 const std::array<double, SIZE_LG_STRUCTS>& obsErr) {
306 TH1F* histo_0 =
histo->getTH1F();
308 double max_ = *std::max_element(maxMoveCut.begin(), maxMoveCut.end());
310 histo_0->SetMinimum(-(max_));
311 histo_0->SetMaximum(max_);
322 for (
size_t i = 0;
i < obs.size(); ++
i) {
324 histo_0->SetBinContent(
i + 1, obs[
i]);
325 histo_0->SetBinError(
i + 1, obsErr[
i]);
329 histo_0->SetBinContent(8 +
i * 5,
cut[
i]);
332 histo_0->SetBinContent(9 +
i * 5,
sigCut[
i]);
335 histo_0->SetBinContent(10 +
i * 5, maxMoveCut[
i]);
338 histo_0->SetBinContent(11 +
i * 5, maxErrorCut[
i]);
343 std::array<double, SIZE_INDEX> Xcut_, sigXcut_, maxMoveXcut_, maxErrorXcut_;
344 std::array<double, SIZE_INDEX> tXcut_, sigtXcut_, maxMovetXcut_, maxErrortXcut_;
346 std::array<double, SIZE_INDEX> Ycut_, sigYcut_, maxMoveYcut_, maxErrorYcut_;
347 std::array<double, SIZE_INDEX> tYcut_, sigtYcut_, maxMovetYcut_, maxErrortYcut_;
349 std::array<double, SIZE_INDEX> Zcut_, sigZcut_, maxMoveZcut_, maxErrorZcut_;
350 std::array<double, SIZE_INDEX> tZcut_, sigtZcut_, maxMovetZcut_, maxErrortZcut_;
352 auto myMap =
mpReader_->getThresholdMap();
354 std::vector<std::string> alignablesList;
355 for (
auto it = myMap.begin(); it != myMap.end(); ++it) {
356 alignablesList.push_back(it->first);
359 for (
auto& alignable : alignablesList) {
362 Xcut_[detIndex] = myMap[alignable].getXcut();
363 sigXcut_[detIndex] = myMap[alignable].getSigXcut();
364 maxMoveXcut_[detIndex] = myMap[alignable].getMaxMoveXcut();
365 maxErrorXcut_[detIndex] = myMap[alignable].getErrorXcut();
367 Ycut_[detIndex] = myMap[alignable].getYcut();
368 sigYcut_[detIndex] = myMap[alignable].getSigYcut();
369 maxMoveYcut_[detIndex] = myMap[alignable].getMaxMoveYcut();
370 maxErrorYcut_[detIndex] = myMap[alignable].getErrorYcut();
372 Zcut_[detIndex] = myMap[alignable].getZcut();
373 sigZcut_[detIndex] = myMap[alignable].getSigZcut();
374 maxMoveZcut_[detIndex] = myMap[alignable].getMaxMoveZcut();
375 maxErrorZcut_[detIndex] = myMap[alignable].getErrorZcut();
377 tXcut_[detIndex] = myMap[alignable].getThetaXcut();
378 sigtXcut_[detIndex] = myMap[alignable].getSigThetaXcut();
379 maxMovetXcut_[detIndex] = myMap[alignable].getMaxMoveThetaXcut();
380 maxErrortXcut_[detIndex] = myMap[alignable].getErrorThetaXcut();
382 tYcut_[detIndex] = myMap[alignable].getThetaYcut();
383 sigtYcut_[detIndex] = myMap[alignable].getSigThetaYcut();
384 maxMovetYcut_[detIndex] = myMap[alignable].getMaxMoveThetaYcut();
385 maxErrortYcut_[detIndex] = myMap[alignable].getErrorThetaYcut();
387 tZcut_[detIndex] = myMap[alignable].getThetaZcut();
388 sigtZcut_[detIndex] = myMap[alignable].getSigThetaZcut();
389 maxMovetZcut_[detIndex] = myMap[alignable].getMaxMoveThetaZcut();
390 maxErrortZcut_[detIndex] = myMap[alignable].getErrorThetaZcut();
425 const std::array<double, SIZE_INDEX>&
cut,
426 const std::array<double, SIZE_INDEX>&
sigCut,
427 const std::array<double, SIZE_INDEX>& maxMoveCut,
428 const std::array<double, SIZE_INDEX>& maxErrorCut,
429 const std::array<double, SIZE_HG_STRUCTS>& obs,
430 const std::array<double, SIZE_HG_STRUCTS>& obsErr) {
436 TH1F* histo_0 = histo_map[
layer.first]->getTH1F();
444 histo_0->SetBinContent(
bin, obs[
i]);
445 histo_0->SetBinError(
bin, obsErr[
i]);
453 histo_0->SetBinContent(
bin + 1, 0);
454 histo_0->SetBinError(
bin + 1, 0);
457 if (
layer.first.find(
"Disk") != std::string::npos) {
460 histo_0->GetXaxis()->SetTitle(
"Panel");
464 histo_0->GetXaxis()->SetTitle(
"Ladder");
467 histo_0->SetBinContent(
bin + 2,
cut[detIndex]);
468 histo_0->SetBinError(
bin + 2, 0);
469 histo_0->SetBinContent(
bin + 3,
sigCut[detIndex]);
470 histo_0->SetBinError(
bin + 3, 0);
471 histo_0->SetBinContent(
bin + 4, maxMoveCut[detIndex]);
472 histo_0->SetBinError(
bin + 4, 0);
473 histo_0->SetBinContent(
bin + 5, maxErrorCut[detIndex]);
474 histo_0->SetBinError(
bin + 5, 0);
479 histo_0->SetMinimum(-(max_)*1.2);
480 histo_0->SetMaximum(max_ * 1.2);
500 if (alignableId ==
"TPBHalfBarrelXminus") {
502 }
else if (alignableId ==
"TPBHalfBarrelXplus") {
504 }
else if (alignableId ==
"TPEHalfCylinderXminusZminus") {
506 }
else if (alignableId ==
"TPEHalfCylinderXplusZminus") {
508 }
else if (alignableId ==
"TPEHalfCylinderXminusZplus") {
510 }
else if (alignableId ==
"TPEHalfCylinderXplusZplus") {
512 }
else if (alignableId.rfind(
"TPBLadder", 0) == 0) {
514 }
else if (alignableId.rfind(
"TPEPanel", 0) == 0) {
517 throw cms::Exception(
"LogicError") <<
"@SUB=MillePedeDQMModule::getIndexFromString\n" 518 <<
"Retrieving conversion for not supported Alignable partition" << alignableId;
void fillExpertHisto(MonitorElement *histo, const std::array< double, SIZE_INDEX > &cut, const std::array< double, SIZE_INDEX > &sigCut, const std::array< double, SIZE_INDEX > &maxMoveCut, const std::array< double, SIZE_INDEX > &maxErrorCut, const std::array< double, SIZE_LG_STRUCTS > &obs, const std::array< double, SIZE_LG_STRUCTS > &obsErr)
const edm::ParameterSet mpReaderConfig_
void fillStatusHisto(MonitorElement *statusHisto)
std::map< std::string, MonitorElement * > h_xRot_HG
std::vector< std::pair< std::string, int > > layerVec
std::map< std::string, MonitorElement * > h_yPos_HG
void fillExpertHistos_HG()
virtual void setCurrentFolder(std::string const &fullpath)
std::vector< ParameterSet > VParameterSet
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)
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > gDetToken_
std::map< std::string, MonitorElement * > h_zRot_HG
MonitorElement * binariesAvalaible
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
virtual TH2F * getTH2F() const
edm::ESWatcher< IdealGeometryRecord > watchIdealGeometryRcd_
MonitorElement * isVetoed
MillePedeDQMModule(const edm::ParameterSet &)
std::map< std::string, MonitorElement * > h_yRot_HG
void bookHistograms(DQMStore::IBooker &)
Abs< T >::type abs(const T &t)
std::map< std::string, MonitorElement * > h_xPos_HG
void beginRun(const edm::Run &, const edm::EventSetup &) override
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::shared_ptr< PixelTopologyMap > pixelTopologyMap_
void addUntrackedParameter(std::string const &name, T const &value)
const edm::ESGetToken< AlignPCLThresholdsHG, AlignPCLThresholdsHGRcd > aliThrToken_
MonitorElement * statusResults
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
bool check(const edm::EventSetup &iSetup)
edm::ESWatcher< TrackerTopologyRcd > watchTrackerTopologyRcd_
edm::ESWatcher< PTrackerParametersRcd > watchPTrackerParametersRcd_
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
std::unique_ptr< AlignableTracker > tracker_
std::unique_ptr< MillePedeFileReader > mpReader_
int getIndexFromString(const std::string &alignableId)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * exitCode
std::map< std::string, MonitorElement * > h_zPos_HG
~MillePedeDQMModule() override
void fillStatusHistoHG(MonitorElement *statusHisto)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
void fillExpertHisto_HG(std::map< std::string, MonitorElement *> &histo_map, const std::array< double, SIZE_INDEX > &cut, const std::array< double, SIZE_INDEX > &sigCut, const std::array< double, SIZE_INDEX > &maxMoveCut, const std::array< double, SIZE_INDEX > &maxErrorCut, const std::array< double, SIZE_HG_STRUCTS > &obs, const std::array< double, SIZE_HG_STRUCTS > &obsErr)