55 edm::LogInfo(
"MillePedeDQMModule") <<
"Booking histograms";
60 h_xPos = booker.
book1D(
"Xpos",
"Alignment fit #DeltaX;;#mum", 36, 0., 36.);
61 h_xRot = booker.
book1D(
"Xrot",
"Alignment fit #Delta#theta_{X};;#murad", 36, 0., 36.);
62 h_yPos = booker.
book1D(
"Ypos",
"Alignment fit #DeltaY;;#mum", 36, 0., 36.);
63 h_yRot = booker.
book1D(
"Yrot",
"Alignment fit #Delta#theta_{Y};;#murad", 36, 0., 36.);
64 h_zPos = booker.
book1D(
"Zpos",
"Alignment fit #DeltaZ;;#mum", 36, 0., 36.);
65 h_zRot = booker.
book1D(
"Zrot",
"Alignment fit #Delta#theta_{Z};;#murad", 36, 0., 36.);
79 <<
"@SUB=MillePedeDQMModule::dqmEndJob\n" 80 <<
"Try to read MillePede results before initializing MillePedeFileReader";
94 if (!setupChanged(setup))
return;
106 auto thresholds_ = thresholdHandle.
product();
108 auto myThresholds = std::make_shared<AlignPCLThresholds>();
113 const auto trackerGeometry = builder.
build(&(*geometricDet), *ptp, &(*tTopo));
114 tracker_ = std::make_unique<AlignableTracker>(trackerGeometry, &(*tTopo));
123 ->create(labelerPlugin,
129 mpReader_ = std::make_unique<MillePedeFileReader>(mpReaderConfig_,
pedeLabeler, std::shared_ptr<const AlignPCLThresholds>(myThresholds));
138 std::array<double, 6> Xcut_, sigXcut_, maxMoveXcut_, maxErrorXcut_;
139 std::array<double, 6> tXcut_, sigtXcut_, maxMovetXcut_, maxErrortXcut_;
141 std::array<double, 6> Ycut_, sigYcut_, maxMoveYcut_, maxErrorYcut_;
142 std::array<double, 6> tYcut_, sigtYcut_, maxMovetYcut_, maxErrortYcut_;
144 std::array<double, 6> Zcut_, sigZcut_, maxMoveZcut_, maxErrorZcut_;
145 std::array<double, 6> tZcut_, sigtZcut_, maxMovetZcut_, maxErrortZcut_;
147 auto myMap = mpReader_->getThresholdMap();
149 std::vector<std::string> alignablesList;
150 for(
auto it = myMap.begin(); it != myMap.end() ; ++it){
151 alignablesList.push_back(it->first);
154 for (
auto &alignable : alignablesList){
156 int detIndex = getIndexFromString(alignable);
158 Xcut_[detIndex] = myMap[alignable].getXcut() ;
159 sigXcut_[detIndex] = myMap[alignable].getSigXcut() ;
160 maxMoveXcut_[detIndex] = myMap[alignable].getMaxMoveXcut() ;
161 maxErrorXcut_[detIndex] = myMap[alignable].getErrorXcut() ;
163 Ycut_[detIndex] = myMap[alignable].getYcut() ;
164 sigYcut_[detIndex] = myMap[alignable].getSigYcut() ;
165 maxMoveYcut_[detIndex] = myMap[alignable].getMaxMoveYcut() ;
166 maxErrorYcut_[detIndex] = myMap[alignable].getErrorYcut() ;
168 Zcut_[detIndex] = myMap[alignable].getZcut() ;
169 sigZcut_[detIndex] = myMap[alignable].getSigZcut() ;
170 maxMoveZcut_[detIndex] = myMap[alignable].getMaxMoveZcut() ;
171 maxErrorZcut_[detIndex] = myMap[alignable].getErrorZcut() ;
173 tXcut_[detIndex] = myMap[alignable].getThetaXcut() ;
174 sigtXcut_[detIndex] = myMap[alignable].getSigThetaXcut() ;
175 maxMovetXcut_[detIndex] = myMap[alignable].getMaxMoveThetaXcut() ;
176 maxErrortXcut_[detIndex] = myMap[alignable].getErrorThetaXcut() ;
178 tYcut_[detIndex] = myMap[alignable].getThetaYcut() ;
179 sigtYcut_[detIndex] = myMap[alignable].getSigThetaYcut() ;
180 maxMovetYcut_[detIndex] = myMap[alignable].getMaxMoveThetaYcut() ;
181 maxErrortYcut_[detIndex] = myMap[alignable].getErrorThetaYcut() ;
183 tZcut_[detIndex] = myMap[alignable].getThetaZcut() ;
184 sigtZcut_[detIndex] = myMap[alignable].getSigThetaYcut() ;
185 maxMovetZcut_[detIndex] = myMap[alignable].getMaxMoveThetaYcut() ;
186 maxErrortZcut_[detIndex] = myMap[alignable].getErrorThetaYcut() ;
190 fillExpertHisto(h_xPos, Xcut_, sigXcut_, maxMoveXcut_, maxErrorXcut_, mpReader_->getXobs(), mpReader_->getXobsErr());
191 fillExpertHisto(h_xRot, tXcut_, sigtXcut_, maxMovetXcut_, maxErrortXcut_, mpReader_->getTXobs(), mpReader_->getTXobsErr());
193 fillExpertHisto(h_yPos, Ycut_, sigYcut_, maxMoveYcut_, maxErrorYcut_, mpReader_->getYobs(), mpReader_->getYobsErr());
194 fillExpertHisto(h_yRot, tYcut_, sigtYcut_, maxMovetYcut_, maxErrortYcut_, mpReader_->getTYobs(), mpReader_->getTYobsErr());
196 fillExpertHisto(h_zPos, Zcut_, sigZcut_, maxMoveZcut_, maxErrorZcut_, mpReader_->getZobs(), mpReader_->getZobsErr());
197 fillExpertHisto(h_zRot, tZcut_, sigtZcut_, maxMovetZcut_, maxErrortZcut_, mpReader_->getTZobs(), mpReader_->getTZobsErr());
203 const std::array<double, 6>&
cut,
const std::array<double, 6>&
sigCut,
204 const std::array<double, 6>& maxMoveCut,
const std::array<double, 6>& maxErrorCut,
205 const std::array<double, 6>& obs,
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) {
226 histo_0->SetBinContent(
i+1, obs[
i]);
227 histo_0->SetBinError(i+1, obsErr[i]);
231 histo_0->SetBinContent(8+i*5 , cut[i]);
234 histo_0->SetBinContent(9+i*5 , sigCut[i]);
237 histo_0->SetBinContent(10+i*5, maxMoveCut[i]);
240 histo_0->SetBinContent(11+i*5, maxErrorCut[i]);
250 if (watchIdealGeometryRcd_.check(setup)) changed =
true;
251 if (watchTrackerTopologyRcd_.check(setup)) changed =
true;
252 if (watchPTrackerParametersRcd_.check(setup)) changed =
true;
262 if(alignableId ==
"TPBHalfBarrelXminus"){
264 }
else if(alignableId ==
"TPBHalfBarrelXplus"){
266 }
else if(alignableId ==
"TPEHalfCylinderXminusZminus") {
268 }
else if(alignableId ==
"TPEHalfCylinderXplusZminus") {
270 }
else if(alignableId ==
"TPEHalfCylinderXminusZplus") {
272 }
else if(alignableId ==
"TPEHalfCylinderXplusZplus") {
276 <<
"@SUB=MillePedeDQMModule::getIndexFromString\n" 277 <<
"Retrieving conversion for not supported Alignable partition"
static const char tracker_[]
std::vector< ParameterSet > VParameterSet
bool setupChanged(const edm::EventSetup &)
def setup(process, global_tag, zero_tesla=False)
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
DQM Plotter for PCL-Alignment.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
void bookHistograms(fwlite::EventContainer &eventCont)
MillePedeDQMModule(const edm::ParameterSet &)
MonitorElement * book1D(Args &&...args)
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 setCurrentFolder(const std::string &fullpath)
void addUntrackedParameter(std::string const &name, T const &value)
void setAlignPCLThresholds(const int &Nrecords, const threshold_map &Thresholds)
TH1F * getTH1F(void) const
int getIndexFromString(const std::string &alignableId)
~MillePedeDQMModule() override
T const * product() const
T get(const Candidate &c)