39 consumes<AlignmentToken, edm::InProcess>(
config.getParameter<
edm::InputTag>(
"alignmentTokenSrc"));
49 edm::LogInfo(
"MillePedeDQMModule") <<
"Booking histograms";
54 h_xPos = booker.
book1D(
"Xpos",
"Alignment fit #DeltaX;;#mum", 36, 0., 36.);
55 h_xRot = booker.
book1D(
"Xrot",
"Alignment fit #Delta#theta_{X};;#murad", 36, 0., 36.);
56 h_yPos = booker.
book1D(
"Ypos",
"Alignment fit #DeltaY;;#mum", 36, 0., 36.);
57 h_yRot = booker.
book1D(
"Yrot",
"Alignment fit #Delta#theta_{Y};;#murad", 36, 0., 36.);
58 h_zPos = booker.
book1D(
"Zpos",
"Alignment fit #DeltaZ;;#mum", 36, 0., 36.);
59 h_zRot = booker.
book1D(
"Zrot",
"Alignment fit #Delta#theta_{Z};;#murad", 36, 0., 36.);
61 statusResults = booker.
book2D(
"statusResults",
"Status of SiPixelAli PCL workflow;;", 6, 0., 6., 1, 0., 1.);
73 throw cms::Exception(
"LogicError") <<
"@SUB=MillePedeDQMModule::dqmEndJob\n"
74 <<
"Try to read MillePede results before initializing MillePedeFileReader";
79 auto theResults =
mpReader_->getResults();
80 std::string exitCodeStr = theResults.getExitMessage();
102 auto thresholds_ = thresholdHandle.
product();
104 auto myThresholds = std::make_shared<AlignPCLThresholds>();
105 myThresholds->setAlignPCLThresholds(thresholds_->getNrecords(), thresholds_->getThreshold_Map());
109 const auto trackerGeometry = builder.
build(&(*geometricDet), *ptp, &(*tTopo));
110 tracker_ = std::make_unique<AlignableTracker>(trackerGeometry, &(*tTopo));
120 mpReader_ = std::make_unique<MillePedeFileReader>(
125 TH2F* histo_status = statusHisto->
getTH2F();
126 auto theResults =
mpReader_->getResults();
128 histo_status->SetBinContent(1, 1, theResults.getDBUpdated());
129 histo_status->GetXaxis()->SetBinLabel(1,
"DB updated");
130 histo_status->SetBinContent(2, 1, theResults.exceedsCutoffs());
131 histo_status->GetXaxis()->SetBinLabel(2,
"significant movement");
132 histo_status->SetBinContent(3, 1, theResults.getDBVetoed());
133 histo_status->GetXaxis()->SetBinLabel(3,
"DB update vetoed");
134 histo_status->SetBinContent(4, 1, !theResults.exceedsThresholds());
135 histo_status->GetXaxis()->SetBinLabel(4,
"within max movement");
136 histo_status->SetBinContent(5, 1, !theResults.exceedsMaxError());
137 histo_status->GetXaxis()->SetBinLabel(5,
"within max error");
138 histo_status->SetBinContent(6, 1, !theResults.belowSignificance());
139 histo_status->GetXaxis()->SetBinLabel(6,
"above significance");
143 std::array<double, 6> Xcut_, sigXcut_, maxMoveXcut_, maxErrorXcut_;
144 std::array<double, 6> tXcut_, sigtXcut_, maxMovetXcut_, maxErrortXcut_;
146 std::array<double, 6> Ycut_, sigYcut_, maxMoveYcut_, maxErrorYcut_;
147 std::array<double, 6> tYcut_, sigtYcut_, maxMovetYcut_, maxErrortYcut_;
149 std::array<double, 6> Zcut_, sigZcut_, maxMoveZcut_, maxErrorZcut_;
150 std::array<double, 6> tZcut_, sigtZcut_, maxMovetZcut_, maxErrortZcut_;
152 auto myMap =
mpReader_->getThresholdMap();
154 std::vector<std::string> alignablesList;
155 for (
auto it = myMap.begin(); it != myMap.end(); ++it) {
156 alignablesList.push_back(it->first);
159 for (
auto& alignable : alignablesList) {
162 Xcut_[detIndex] = myMap[alignable].getXcut();
163 sigXcut_[detIndex] = myMap[alignable].getSigXcut();
164 maxMoveXcut_[detIndex] = myMap[alignable].getMaxMoveXcut();
165 maxErrorXcut_[detIndex] = myMap[alignable].getErrorXcut();
167 Ycut_[detIndex] = myMap[alignable].getYcut();
168 sigYcut_[detIndex] = myMap[alignable].getSigYcut();
169 maxMoveYcut_[detIndex] = myMap[alignable].getMaxMoveYcut();
170 maxErrorYcut_[detIndex] = myMap[alignable].getErrorYcut();
172 Zcut_[detIndex] = myMap[alignable].getZcut();
173 sigZcut_[detIndex] = myMap[alignable].getSigZcut();
174 maxMoveZcut_[detIndex] = myMap[alignable].getMaxMoveZcut();
175 maxErrorZcut_[detIndex] = myMap[alignable].getErrorZcut();
177 tXcut_[detIndex] = myMap[alignable].getThetaXcut();
178 sigtXcut_[detIndex] = myMap[alignable].getSigThetaXcut();
179 maxMovetXcut_[detIndex] = myMap[alignable].getMaxMoveThetaXcut();
180 maxErrortXcut_[detIndex] = myMap[alignable].getErrorThetaXcut();
182 tYcut_[detIndex] = myMap[alignable].getThetaYcut();
183 sigtYcut_[detIndex] = myMap[alignable].getSigThetaYcut();
184 maxMovetYcut_[detIndex] = myMap[alignable].getMaxMoveThetaYcut();
185 maxErrortYcut_[detIndex] = myMap[alignable].getErrorThetaYcut();
187 tZcut_[detIndex] = myMap[alignable].getThetaZcut();
188 sigtZcut_[detIndex] = myMap[alignable].getSigThetaZcut();
189 maxMovetZcut_[detIndex] = myMap[alignable].getMaxMoveThetaZcut();
190 maxErrortZcut_[detIndex] = myMap[alignable].getErrorThetaZcut();
207 const std::array<double, 6>&
cut,
208 const std::array<double, 6>&
sigCut,
209 const std::array<double, 6>& maxMoveCut,
210 const std::array<double, 6>& maxErrorCut,
211 const std::array<double, 6>& obs,
212 const std::array<double, 6>& obsErr) {
213 TH1F* histo_0 =
histo->getTH1F();
215 double max_ = *std::max_element(maxMoveCut.begin(), maxMoveCut.end());
217 histo_0->SetMinimum(-(max_));
218 histo_0->SetMaximum(max_);
229 for (
size_t i = 0;
i < obs.size(); ++
i) {
231 histo_0->SetBinContent(
i + 1, obs[
i]);
232 histo_0->SetBinError(
i + 1, obsErr[
i]);
236 histo_0->SetBinContent(8 +
i * 5,
cut[
i]);
239 histo_0->SetBinContent(9 +
i * 5,
sigCut[
i]);
242 histo_0->SetBinContent(10 +
i * 5, maxMoveCut[
i]);
245 histo_0->SetBinContent(11 +
i * 5, maxErrorCut[
i]);
263 if (alignableId ==
"TPBHalfBarrelXminus") {
265 }
else if (alignableId ==
"TPBHalfBarrelXplus") {
267 }
else if (alignableId ==
"TPEHalfCylinderXminusZminus") {
269 }
else if (alignableId ==
"TPEHalfCylinderXplusZminus") {
271 }
else if (alignableId ==
"TPEHalfCylinderXminusZplus") {
273 }
else if (alignableId ==
"TPEHalfCylinderXplusZplus") {
276 throw cms::Exception(
"LogicError") <<
"@SUB=MillePedeDQMModule::getIndexFromString\n"
277 <<
"Retrieving conversion for not supported Alignable partition" << alignableId;