CMS 3D CMS Logo

AlignmentProducerBase.cc
Go to the documentation of this file.
2 
14 
16 
21 
25 
32 
33 //------------------------------------------------------------------------------
35  : doTracker_{config.getUntrackedParameter<bool>("doTracker")},
36  doMuon_{config.getUntrackedParameter<bool>("doMuon")},
37  useExtras_{config.getUntrackedParameter<bool>("useExtras")},
38  tjTkAssociationMapTag_{config.getParameter<edm::InputTag>("tjTkAssociationMapTag")},
39  beamSpotTag_{config.getParameter<edm::InputTag>("beamSpotTag")},
40  tkLasBeamTag_{config.getParameter<edm::InputTag>("tkLasBeamTag")},
41  clusterValueMapTag_{config.getParameter<edm::InputTag>("hitPrescaleMapTag")},
42  uniqueRunRanges_{align::makeUniqueRunRanges(config.getParameter<edm::VParameterSet>("RunRangeSelection"),
44  config_{config},
45  stNFixAlignables_{config.getParameter<int>("nFixAlignables")},
46  stRandomShift_{config.getParameter<double>("randomShift")},
47  stRandomRotation_{config.getParameter<double>("randomRotation")},
48  applyDbAlignment_{config.getUntrackedParameter<bool>("applyDbAlignment")},
49  checkDbAlignmentValidity_{config.getUntrackedParameter<bool>("checkDbAlignmentValidity")},
50  doMisalignmentScenario_{config.getParameter<bool>("doMisalignmentScenario")},
51  saveToDB_{config.getParameter<bool>("saveToDB")},
52  saveApeToDB_{config.getParameter<bool>("saveApeToDB")},
53  saveDeformationsToDB_{config.getParameter<bool>("saveDeformationsToDB")},
54  useSurvey_{config.getParameter<bool>("useSurvey")},
55  enableAlignableUpdates_{config.getParameter<bool>("enableAlignableUpdates")} {
56  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::AlignmentProducerBase";
57 
58  const auto& algoConfig = config_.getParameterSet("algoConfig");
59  if (config_.existsAs<bool>("runAtPCL")) {
60  // configured in main config?
61  runAtPCL_ = config_.getParameter<bool>("runAtPCL");
62 
63  if (algoConfig.existsAs<bool>("runAtPCL") && (runAtPCL_ != algoConfig.getParameter<bool>("runAtPCL"))) {
64  throw cms::Exception("BadConfig") << "Inconsistent settings for 'runAtPCL' in configuration of the "
65  << "alignment producer and the alignment algorithm.";
66  }
67 
68  } else if (algoConfig.existsAs<bool>("runAtPCL")) {
69  // configured in algo config?
70  runAtPCL_ = algoConfig.getParameter<bool>("runAtPCL");
71 
72  } else {
73  // assume 'false' if it was not configured
74  runAtPCL_ = false;
75  }
76 
77  createAlignmentAlgorithm();
78  createMonitors();
79  createCalibrations();
80 }
81 
82 //------------------------------------------------------------------------------
84 
85 //------------------------------------------------------------------------------
87  if (isDuringLoop_)
88  return;
89 
90  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::startProcessing"
91  << "Begin";
92 
93  if (!isAlgoInitialized_) {
94  throw cms::Exception("LogicError") << "@SUB=AlignmentProducerBase::startProcessing\n"
95  << "Trying to start event processing before initializing the alignment "
96  << "algorithm.";
97  }
98 
99  nevent_ = 0;
100 
101  alignmentAlgo_->startNewLoop();
102 
103  // FIXME: Should this be done in algorithm::startNewLoop()??
104  for (const auto& iCal : calibrations_)
105  iCal->startNewLoop();
106  for (const auto& monitor : monitors_)
107  monitor->startingNewLoop();
108 
110  isDuringLoop_ = true;
111 }
112 
113 //------------------------------------------------------------------------------
115  if (!isDuringLoop_)
116  return;
117 
118  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::terminateProcessing"
119  << "Terminating algorithm.";
120  if (setup) {
121  alignmentAlgo_->terminate(*setup);
122  } else {
123  alignmentAlgo_->terminate();
124  }
125 
126  // FIXME: Should this be done in algorithm::terminate()??
127  for (const auto& iCal : calibrations_)
128  iCal->endOfLoop();
129  for (const auto& monitor : monitors_)
130  monitor->endOfLoop();
131 
132  isDuringLoop_ = false;
133 }
134 
135 //------------------------------------------------------------------------------
137  if (setupChanged(setup)) {
138  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::processEvent"
139  << "EventSetup-Record changed.";
140 
141  // updatable alignables are currently not used at PCL, but event setup
142  // changes require a complete re-initialization
143  if (runAtPCL_) {
144  initAlignmentAlgorithm(setup, /* update = */ false);
145  } else if (enableAlignableUpdates_) {
146  initAlignmentAlgorithm(setup, /* update = */ true);
147  }
148  }
149 
150  initBeamSpot(event); // must happen every event and before incrementing 'nevent_'
151 
152  ++nevent_; // must happen before the check below;
153  // otherwise subsequent checks fail for "EmptySource"
154 
155  if (!alignmentAlgo_->processesEvents()) {
156  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::processEvent"
157  << "Skipping event. The current configuration of the alignment algorithm "
158  << "does not need to process any events.";
159  return false;
160  }
161 
162  // reading in survey records
164 
165  // Printout event number
166  for (int i = 10; i < 10000000; i *= 10) {
167  if (nevent_ < 10 * i && (nevent_ % i) == 0) {
168  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::processEvent"
169  << "Events processed: " << nevent_;
170  }
171  }
172 
173  // Retrieve trajectories and tracks from the event
174  // -> merely skip if collection is empty
175  edm::Handle<TrajTrackAssociationCollection> handleTrajTracksCollection;
176 
177  if (getTrajTrackAssociationCollection(event, handleTrajTracksCollection)) {
178  // Form pairs of trajectories and tracks
179  ConstTrajTrackPairs trajTracks;
180  for (auto iter = handleTrajTracksCollection->begin(); iter != handleTrajTracksCollection->end(); ++iter) {
181  trajTracks.push_back(ConstTrajTrackPair(&(*(*iter).key), &(*(*iter).val)));
182  }
183 
184  // Run the alignment algorithm with its input
185  const AliClusterValueMap* clusterValueMapPtr{nullptr};
186  if (!clusterValueMapTag_.encode().empty()) {
187  edm::Handle<AliClusterValueMap> clusterValueMap;
188  getAliClusterValueMap(event, clusterValueMap);
189  clusterValueMapPtr = &(*clusterValueMap);
190  }
191 
192  const AlignmentAlgorithmBase::EventInfo eventInfo{event.id(), trajTracks, *beamSpot_, clusterValueMapPtr};
194 
195  for (const auto& monitor : monitors_) {
196  monitor->duringLoop(event, setup, trajTracks); // forward eventInfo?
197  }
198  } else {
199  edm::LogError("Alignment") << "@SUB=AlignmentProducerBase::processEvent"
200  << "No track collection found: skipping event";
201  }
202 
203  return true;
204 }
205 
206 //------------------------------------------------------------------------------
208  const bool changed{setupChanged(setup)};
209  if (changed) {
210  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::beginRunImpl"
211  << "EventSetup-Record changed.";
212 
213  // updatable alignables are currently not used at PCL, but event setup
214  // changes require a complete re-initialization
215  if (runAtPCL_) {
216  initAlignmentAlgorithm(setup, /* update = */ false);
217  } else if (enableAlignableUpdates_) {
218  initAlignmentAlgorithm(setup, /* update = */ true);
219  }
220  }
221 
222  alignmentAlgo_->beginRun(run, setup, changed && (runAtPCL_ || enableAlignableUpdates_));
223 
224  for (const auto& iCal : calibrations_)
225  iCal->beginRun(run, setup);
226 
227  //store the first run analyzed to be used for setting the IOV (for PCL)
228  if (firstRun_ > static_cast<cond::Time_t>(run.id().run())) {
229  firstRun_ = static_cast<cond::Time_t>(run.id().run());
230  }
231 }
232 
233 //------------------------------------------------------------------------------
235  if (!tkLasBeamTag_.encode().empty()) {
239  getTsosVectorCollection(run, tsoses);
240 
241  alignmentAlgo_->endRun(EndRunInfo(run.id(), &(*lasBeams), &(*tsoses)), setup);
242  } else {
243  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::endRunImpl"
244  << "No Tk LAS beams to forward to algorithm.";
245  alignmentAlgo_->endRun(EndRunInfo(run.id(), nullptr, nullptr), setup);
246  }
247 }
248 
249 //------------------------------------------------------------------------------
251  // Do not forward edm::LuminosityBlock
252  alignmentAlgo_->beginLuminosityBlock(setup);
253 }
254 
255 //------------------------------------------------------------------------------
257  // Do not forward edm::LuminosityBlock
258  alignmentAlgo_->endLuminosityBlock(setup);
259 }
260 
261 //------------------------------------------------------------------------------
263  auto algoConfig = config_.getParameter<edm::ParameterSet>("algoConfig");
264  algoConfig.addUntrackedParameter("RunRangeSelection", config_.getParameter<edm::VParameterSet>("RunRangeSelection"));
265  algoConfig.addUntrackedParameter<align::RunNumber>("firstIOV", runAtPCL_ ? 1 : uniqueRunRanges_.front().first);
266  algoConfig.addUntrackedParameter("enableAlignableUpdates", enableAlignableUpdates_);
267 
268  const auto& algoName = algoConfig.getParameter<std::string>("algoName");
270 }
271 
272 //------------------------------------------------------------------------------
274  const auto& monitorConfig = config_.getParameter<edm::ParameterSet>("monitorConfig");
275  auto monitors = monitorConfig.getUntrackedParameter<std::vector<std::string> >("monitors");
276  for (const auto& miter : monitors) {
277  monitors_.emplace_back(
278  AlignmentMonitorPluginFactory::get()->create(miter, monitorConfig.getUntrackedParameterSet(miter)));
279  }
280 }
281 
282 //------------------------------------------------------------------------------
284  const auto& calibrations = config_.getParameter<edm::VParameterSet>("calibrations");
285  for (const auto& iCalib : calibrations) {
286  calibrations_.emplace_back(
287  IntegratedCalibrationPluginFactory::get()->create(iCalib.getParameter<std::string>("calibrationName"), iCalib));
288  }
289 }
290 
291 //------------------------------------------------------------------------------
293  bool changed{false};
294 
296  changed = true;
297  }
298 
300  changed = true;
301  }
302 
303  if (doTracker_) {
305  changed = true;
306  }
307 
309  changed = true;
310  }
311 
313  changed = true;
314  }
315  }
316 
317  if (doMuon_) {
318  if (watchDTAlRcd_.check(setup)) {
319  changed = true;
320  }
321 
323  changed = true;
324  }
325 
326  if (watchCSCAlRcd_.check(setup)) {
327  changed = true;
328  }
329 
331  changed = true;
332  }
333  }
334 
335  /* TODO: ExtraAlignables: Which record(s) to check?
336  *
337  if (useExtras_) {}
338  */
339 
340  return changed;
341 }
342 
343 //------------------------------------------------------------------------------
345  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::initAlignmentAlgorithm"
346  << "Begin";
347 
348  auto isTrueUpdate = update && isAlgoInitialized_;
349 
350  // Retrieve tracker topology from geometry
351  edm::ESHandle<TrackerTopology> tTopoHandle;
352  setup.get<TrackerTopologyRcd>().get(tTopoHandle);
353  const TrackerTopology* const tTopo = tTopoHandle.product();
354 
355  // Create the geometries from the ideal geometries
356  createGeometries(setup, tTopo);
357 
359  createAlignables(tTopo, isTrueUpdate);
362 
363  // Initialize alignment algorithm and integrated calibration and pass the
364  // latter to algorithm
365  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::initAlignmentAlgorithm"
366  << "Initializing alignment algorithm.";
367  alignmentAlgo_->initialize(
369 
370  // Not all algorithms support calibrations - so do not pass empty vector
371  // and throw if non-empty and not supported:
372  if (!calibrations_.empty()) {
373  if (alignmentAlgo_->supportsCalibrations()) {
374  alignmentAlgo_->addCalibrations(calibrations_);
375  } else {
376  throw cms::Exception("BadConfig") << "@SUB=AlignmentProducerBase::createCalibrations\n"
377  << "Configured " << calibrations_.size() << " calibration(s) "
378  << "for algorithm not supporting it.";
379  }
380  }
381 
382  isAlgoInitialized_ = true;
383 
385 
386  if (!isTrueUpdate) { // only needed the first time
387  for (const auto& iCal : calibrations_) {
388  iCal->beginOfJob(alignableTracker_.get(), alignableMuon_.get(), alignableExtras_.get());
389  }
390  for (const auto& monitor : monitors_) {
391  monitor->beginOfJob(alignableTracker_.get(), alignableMuon_.get(), alignmentParameterStore_.get());
392  }
393  }
394  startProcessing(); // needed if derived class is non-EDLooper-based
395  // has no effect, if called during loop
396 
397  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::initAlignmentAlgorithm"
398  << "End";
399 }
400 
401 //------------------------------------------------------------------------------
404 
405  if (nevent_ == 0 && alignableExtras_) {
406  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::initBeamSpot"
407  << "Initializing AlignableBeamSpot";
408 
409  alignableExtras_->initializeBeamSpot(
411  }
412 }
413 
414 //------------------------------------------------------------------------------
416  if (doTracker_) {
417  edm::ESHandle<GeometricDet> geometricDet;
418  iSetup.get<IdealGeometryRecord>().get(geometricDet);
419 
421  iSetup.get<PTrackerParametersRcd>().get(ptp);
422 
423  TrackerGeomBuilderFromGeometricDet trackerBuilder;
424 
425  trackerGeometry_ = std::shared_ptr<TrackerGeometry>(trackerBuilder.build(&(*geometricDet), *ptp, tTopo));
426  }
427 
428  if (doMuon_) {
430  iSetup.get<IdealGeometryRecord>().get(cpv);
432  iSetup.get<IdealGeometryRecord>().get(mdc);
435  muonDTGeometry_ = std::make_shared<DTGeometry>();
436  DTGeometryBuilder.build(*muonDTGeometry_, &(*cpv), *mdc);
437  muonCSCGeometry_ = std::make_shared<CSCGeometry>();
438  CSCGeometryBuilder.build(*muonCSCGeometry_, &(*cpv), *mdc);
439  }
440 }
441 
442 //------------------------------------------------------------------------------
444  // Retrieve and apply alignments, if requested (requires z setup)
445  if (applyDbAlignment_) {
446  // we need GlobalPositionRcd - and have to keep track for later removal
447  // before writing again to DB...
448 
449  edm::ESHandle<Alignments> globalAlignments;
450  setup.get<GlobalPositionRcd>().get(globalAlignments);
451  globalPositions_ = std::make_unique<Alignments>(*globalAlignments);
452 
453  if (doTracker_) {
454  applyDB<TrackerGeometry, TrackerAlignmentRcd, TrackerAlignmentErrorExtendedRcd>(
456 
457  applyDB<TrackerGeometry, TrackerSurfaceDeformationRcd>(trackerGeometry_.get(), setup);
458  }
459 
460  if (doMuon_) {
461  applyDB<DTGeometry, DTAlignmentRcd, DTAlignmentErrorExtendedRcd>(
463 
464  applyDB<CSCGeometry, CSCAlignmentRcd, CSCAlignmentErrorExtendedRcd>(
466  }
467  }
468 }
469 
470 //------------------------------------------------------------------------------
472  if (doTracker_) {
473  if (update) {
474  alignableTracker_->update(trackerGeometry_.get(), tTopo);
475  } else {
476  alignableTracker_ = std::make_unique<AlignableTracker>(trackerGeometry_.get(), tTopo);
477  }
478  }
479 
480  if (doMuon_) {
481  if (update) {
482  alignableMuon_->update(muonDTGeometry_.get(), muonCSCGeometry_.get());
483  } else {
484  alignableMuon_ = std::make_unique<AlignableMuon>(muonDTGeometry_.get(), muonCSCGeometry_.get());
485  }
486  }
487 
488  if (useExtras_) {
489  if (update) {
490  // FIXME: Requires further code changes to track beam spot condition changes
491  } else {
492  alignableExtras_ = std::make_unique<AlignableExtras>();
493  }
494  }
495 }
496 
497 //------------------------------------------------------------------------------
499  // Create alignment parameter builder
500  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::buildParameterStore"
501  << "Creating AlignmentParameterBuilder";
502 
503  const auto& alParamBuildCfg = config_.getParameter<edm::ParameterSet>("ParameterBuilder");
504  const auto& alParamStoreCfg = config_.getParameter<edm::ParameterSet>("ParameterStore");
505 
506  AlignmentParameterBuilder alignmentParameterBuilder{
507  alignableTracker_.get(), alignableMuon_.get(), alignableExtras_.get(), alParamBuildCfg};
508 
509  // Fix alignables if requested
510  if (stNFixAlignables_ > 0) {
511  alignmentParameterBuilder.fixAlignables(stNFixAlignables_);
512  }
513 
514  // Get list of alignables
515  const auto& alignables = alignmentParameterBuilder.alignables();
516  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::buildParameterStore"
517  << "got " << alignables.size() << " alignables";
518 
519  // Create AlignmentParameterStore
520  alignmentParameterStore_ = std::make_unique<AlignmentParameterStore>(alignables, alParamStoreCfg);
521  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::buildParameterStore"
522  << "AlignmentParameterStore created!";
523 }
524 
525 //------------------------------------------------------------------------------
527  // Apply misalignment scenario to alignable tracker and muon if requested
528  // WARNING: this assumes scenarioConfig can be passed to both muon and tracker
529 
531  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::applyMisalignment"
532  << "Applying misalignment scenario to " << (doTracker_ ? "tracker" : "")
533  << (doMuon_ ? (doTracker_ ? " and muon" : "muon") : ".");
534 
535  const auto& scenarioConfig = config_.getParameterSet("MisalignmentScenario");
536 
537  if (doTracker_) {
538  TrackerScenarioBuilder scenarioBuilder(alignableTracker_.get());
539  scenarioBuilder.applyScenario(scenarioConfig);
540  }
541  if (doMuon_) {
542  MuonScenarioBuilder muonScenarioBuilder(alignableMuon_.get());
543  muonScenarioBuilder.applyScenario(scenarioConfig);
544  }
545 
546  } else {
547  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::applyMisalignment"
548  << "NOT applying misalignment scenario!";
549  }
550 
551  // Apply simple misalignment
552  const auto& sParSel = config_.getParameter<std::string>("parameterSelectorSimple");
554 }
555 
556 // ----------------------------------------------------------------------------
558  const align::Alignables& alivec, const std::string& selection, float shift, float rot, bool local) {
559  std::ostringstream output; // collecting output
560 
561  if (shift > 0. || rot > 0.) {
562  output << "Adding random flat shift of max size " << shift << " and adding random flat rotation of max size " << rot
563  << " to ";
564 
565  std::vector<bool> commSel(0);
566  if (selection != "-1") {
567  AlignmentParameterSelector aSelector(nullptr, nullptr); // no alignable needed here...
568  const std::vector<char> cSel(aSelector.convertParamSel(selection));
569  if (cSel.size() < RigidBodyAlignmentParameters::N_PARAM) {
570  throw cms::Exception("BadConfig")
571  << "[AlignmentProducerBase::simpleMisalignment_]\n"
572  << "Expect selection string '" << selection << "' to be at least of length "
573  << RigidBodyAlignmentParameters::N_PARAM << " or to be '-1'.\n"
574  << "(Most probably you have to adjust the parameter 'parameterSelectorSimple'.)";
575  }
576  for (const auto& cIter : cSel) {
577  commSel.push_back(cIter == '0' ? false : true);
578  }
579  output << "parameters defined by (" << selection << "), representing (x,y,z,alpha,beta,gamma),";
580  } else {
581  output << "the active parameters of each alignable,";
582  }
583  output << " in " << (local ? "local" : "global") << " frame.";
584 
585  for (const auto& ali : alivec) {
586  std::vector<bool> mysel(commSel.empty() ? ali->alignmentParameters()->selector() : commSel);
587 
588  if (std::abs(shift) > 0.00001) {
589  double s0 = 0., s1 = 0., s2 = 0.;
591  s0 = shift * double(random() % 1000 - 500) / 500.;
593  s1 = shift * double(random() % 1000 - 500) / 500.;
595  s2 = shift * double(random() % 1000 - 500) / 500.;
596 
597  if (local)
598  ali->move(ali->surface().toGlobal(align::LocalVector(s0, s1, s2)));
599  else
600  ali->move(align::GlobalVector(s0, s1, s2));
601 
602  //AlignmentPositionError ape(dx,dy,dz);
603  //ali->addAlignmentPositionError(ape);
604  }
605 
606  if (std::abs(rot) > 0.00001) {
609  r(1) = rot * double(random() % 1000 - 500) / 500.;
611  r(2) = rot * double(random() % 1000 - 500) / 500.;
613  r(3) = rot * double(random() % 1000 - 500) / 500.;
614 
615  const align::RotationType mrot = align::toMatrix(r);
616  if (local)
617  ali->rotateInLocalFrame(mrot);
618  else
619  ali->rotateInGlobalFrame(mrot);
620 
621  //ali->addAlignmentPositionErrorFromRotation(mrot);
622  }
623  } // end loop on alignables
624  } else {
625  output << "No simple misalignment added!";
626  }
627  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::simpleMisalignment" << output.str();
628 }
629 
630 //------------------------------------------------------------------------------
632  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::applyAlignmentsToGeometry"
633  << "Now physically apply alignments to geometry...";
634 
635  // Propagate changes to reconstruction geometry (from initialisation or iteration)
636  GeometryAligner aligner;
637 
638  if (doTracker_) {
639  if (!alignableTracker_) {
640  throw cms::Exception("LogicError") << "@SUB=AlignmentProducerBase::applyAlignmentsToGeometry\n"
641  << "Trying to apply tracker alignment before creating it.";
642  }
643 
644  std::unique_ptr<Alignments> alignments{alignableTracker_->alignments()};
645  std::unique_ptr<AlignmentErrorsExtended> alignmentErrExt{alignableTracker_->alignmentErrors()};
646  std::unique_ptr<AlignmentSurfaceDeformations> aliDeforms{alignableTracker_->surfaceDeformations()};
647 
648  aligner.applyAlignments(trackerGeometry_.get(), alignments.get(), alignmentErrExt.get(), AlignTransform());
649  aligner.attachSurfaceDeformations(trackerGeometry_.get(), aliDeforms.get());
650  }
651 
652  if (doMuon_) {
653  if (!alignableMuon_) {
654  throw cms::Exception("LogicError") << "@SUB=AlignmentProducerBase::applyAlignmentsToGeometry\n"
655  << "Trying to apply muon alignment before creating it.";
656  }
657 
658  std::unique_ptr<Alignments> dtAlignments{alignableMuon_->dtAlignments()};
659  std::unique_ptr<Alignments> cscAlignments{alignableMuon_->cscAlignments()};
660 
661  std::unique_ptr<AlignmentErrorsExtended> dtAlignmentErrExt{alignableMuon_->dtAlignmentErrorsExtended()};
662  std::unique_ptr<AlignmentErrorsExtended> cscAlignmentErrExt{alignableMuon_->cscAlignmentErrorsExtended()};
663 
664  aligner.applyAlignments(muonDTGeometry_.get(), dtAlignments.get(), dtAlignmentErrExt.get(), AlignTransform());
665  aligner.applyAlignments(muonCSCGeometry_.get(), cscAlignments.get(), cscAlignmentErrExt.get(), AlignTransform());
666  }
667 }
668 
669 //------------------------------------------------------------------------------
671  // Get Survey Rcds and add Survey Info
672  if (doTracker_ && useSurvey_) {
673  bool tkSurveyBool = watchTkSurveyRcd_.check(iSetup);
674  bool tkSurveyErrBool = watchTkSurveyErrExtRcd_.check(iSetup);
675  edm::LogInfo("Alignment") << "watcher tksurveyrcd: " << tkSurveyBool;
676  edm::LogInfo("Alignment") << "watcher tksurveyerrrcd: " << tkSurveyErrBool;
677  if (tkSurveyBool || tkSurveyErrBool) {
678  edm::LogInfo("Alignment") << "ADDING THE SURVEY INFORMATION";
680  edm::ESHandle<SurveyErrors> surveyErrors;
681 
682  iSetup.get<TrackerSurveyRcd>().get(surveys);
683  iSetup.get<TrackerSurveyErrorExtendedRcd>().get(surveyErrors);
684 
685  surveyIndex_ = 0;
686  surveyValues_ = &*surveys;
687  surveyErrors_ = &*surveyErrors;
689  }
690  }
691 
692  if (doMuon_ && useSurvey_) {
693  bool DTSurveyBool = watchTkSurveyRcd_.check(iSetup);
694  bool DTSurveyErrBool = watchTkSurveyErrExtRcd_.check(iSetup);
695  bool CSCSurveyBool = watchTkSurveyRcd_.check(iSetup);
696  bool CSCSurveyErrBool = watchTkSurveyErrExtRcd_.check(iSetup);
697 
698  if (DTSurveyBool || DTSurveyErrBool || CSCSurveyBool || CSCSurveyErrBool) {
699  edm::ESHandle<Alignments> dtSurveys;
700  edm::ESHandle<SurveyErrors> dtSurveyErrors;
701  edm::ESHandle<Alignments> cscSurveys;
702  edm::ESHandle<SurveyErrors> cscSurveyErrors;
703 
704  iSetup.get<DTSurveyRcd>().get(dtSurveys);
705  iSetup.get<DTSurveyErrorExtendedRcd>().get(dtSurveyErrors);
706  iSetup.get<CSCSurveyRcd>().get(cscSurveys);
707  iSetup.get<CSCSurveyErrorExtendedRcd>().get(cscSurveyErrors);
708 
709  surveyIndex_ = 0;
710  surveyValues_ = &*dtSurveys;
711  surveyErrors_ = &*dtSurveyErrors;
712  const auto& barrels = alignableMuon_->DTBarrel();
713  for (const auto& barrel : barrels)
715 
716  surveyIndex_ = 0;
717  surveyValues_ = &*cscSurveys;
718  surveyErrors_ = &*cscSurveyErrors;
719  const auto& endcaps = alignableMuon_->CSCEndcaps();
720  for (const auto& endcap : endcaps)
722  }
723  }
724 }
725 
726 //------------------------------------------------------------------------------
728  const auto& comps = ali->components();
729 
730  for (const auto& comp : comps)
732 
734 
735  if (ali->id() != error.rawId() || ali->alignableObjectId() != error.structureType()) {
736  throw cms::Exception("DatabaseError") << "Error reading survey info from DB. Mismatched id!";
737  }
738 
739  const auto& pos = surveyValues_->m_align[surveyIndex_].translation();
740  const auto& rot = surveyValues_->m_align[surveyIndex_].rotation();
741 
742  AlignableSurface surf(
743  align::PositionType(pos.x(), pos.y(), pos.z()),
744  align::RotationType(rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz()));
745 
746  surf.setWidth(ali->surface().width());
747  surf.setLength(ali->surface().length());
748 
749  ali->setSurvey(new SurveyDet(surf, error.matrix()));
750 
751  ++surveyIndex_;
752 }
753 
754 //------------------------------------------------------------------------------
756  for (const auto& monitor : monitors_)
757  monitor->endOfJob();
758 
759  if (alignmentAlgo_->processesEvents() && nevent_ == 0) {
760  return false;
761  }
762 
764  if (alignmentAlgo_->storeAlignments())
766  } else {
767  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::finish"
768  << "No payload to be stored!";
769  }
770 
771  // takes care of storing output of calibrations, but needs to be called only
772  // after 'storeAlignmentsToDB()'
773  for (const auto& iCal : calibrations_)
774  iCal->endOfJob();
775 
776  return true;
777 }
778 
779 //------------------------------------------------------------------------------
781  const auto runRangeSelectionVPSet = config_.getParameterSetVector("RunRangeSelection");
782 
783  // handle PCL use case
784  const auto& uniqueRunRanges =
785  (runAtPCL_ ? align::makeUniqueRunRanges(runRangeSelectionVPSet, firstRun_) : uniqueRunRanges_);
786 
787  std::vector<AlgebraicVector> beamSpotParameters;
788 
789  for (const auto& iRunRange : uniqueRunRanges) {
790  alignmentAlgo_->setParametersForRunRange(iRunRange);
791 
792  // Save alignments to database
794  writeForRunRange(iRunRange.first);
795  }
796 
797  // Deal with extra alignables, e.g. beam spot
798  if (alignableExtras_) {
799  auto& alis = alignableExtras_->beamSpot();
800  if (!alis.empty()) {
801  auto beamSpotAliPars = dynamic_cast<BeamSpotAlignmentParameters*>(alis[0]->alignmentParameters());
802  if (!beamSpotAliPars) {
803  throw cms::Exception("LogicError") << "@SUB=AlignmentProducerBase::storeAlignmentsToDB\n"
804  << "First alignable of alignableExtras_ does not have "
805  << "'BeamSpotAlignmentParameters', while it should have.";
806  }
807 
808  beamSpotParameters.push_back(beamSpotAliPars->parameters());
809  }
810  }
811  }
812 
813  if (alignableExtras_) {
814  std::ostringstream bsOutput;
815 
816  auto itPar = beamSpotParameters.cbegin();
817  for (auto iRunRange = uniqueRunRanges.cbegin(); iRunRange != uniqueRunRanges.cend(); ++iRunRange, ++itPar) {
818  bsOutput << "Run range: " << (*iRunRange).first << " - " << (*iRunRange).second << "\n";
819  bsOutput << " Displacement: x=" << (*itPar)[0] << ", y=" << (*itPar)[1] << "\n";
820  bsOutput << " Slope: dx/dz=" << (*itPar)[2] << ", dy/dz=" << (*itPar)[3] << "\n";
821  }
822 
823  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::storeAlignmentsToDB"
824  << "Parameters for alignable beamspot:\n"
825  << bsOutput.str();
826  }
827 }
828 
829 //------------------------------------------------------------------------------
831  if (doTracker_) { // first tracker
832  const AlignTransform* trackerGlobal{nullptr}; // will be 'removed' from constants
833  if (globalPositions_) { // i.e. applied before in applyDB
835  }
836 
837  auto alignments = alignableTracker_->alignments();
838  auto alignmentErrors = alignableTracker_->alignmentErrors();
839  this->writeDB(
840  alignments, "TrackerAlignmentRcd", alignmentErrors, "TrackerAlignmentErrorExtendedRcd", trackerGlobal, time);
841 
842  // Save surface deformations to database
843  if (saveDeformationsToDB_) {
844  auto alignmentSurfaceDeformations = alignableTracker_->surfaceDeformations();
845  this->writeDB(alignmentSurfaceDeformations, "TrackerSurfaceDeformationRcd", time);
846  }
847  }
848 
849  if (doMuon_) { // now muon
850  const AlignTransform* muonGlobal{nullptr}; // will be 'removed' from constants
851  if (globalPositions_) { // i.e. applied before in applyDB
853  }
854  // Get alignments+errors, first DT - ownership taken over by writeDB(..), so no delete
855  auto alignments = alignableMuon_->dtAlignments();
856  auto alignmentErrors = alignableMuon_->dtAlignmentErrorsExtended();
857  this->writeDB(alignments, "DTAlignmentRcd", alignmentErrors, "DTAlignmentErrorExtendedRcd", muonGlobal, time);
858 
859  // Get alignments+errors, now CSC - ownership taken over by writeDB(..), so no delete
860  alignments = alignableMuon_->cscAlignments();
861  alignmentErrors = alignableMuon_->cscAlignmentErrorsExtended();
862  this->writeDB(alignments, "CSCAlignmentRcd", alignmentErrors, "CSCAlignmentErrorExtendedRcd", muonGlobal, time);
863  }
864 }
865 
866 //------------------------------------------------------------------------------
868  const std::string& alignRcd,
869  AlignmentErrorsExtended* alignmentErrors,
870  const std::string& errRcd,
871  const AlignTransform* globalCoordinates,
872  cond::Time_t time) const {
873  Alignments* tempAlignments = alignments;
874  AlignmentErrorsExtended* tempAlignmentErrorsExtended = alignmentErrors;
875 
876  // Call service
878  if (!poolDb.isAvailable()) { // Die if not available
879  delete tempAlignments; // promised to take over ownership...
880  delete tempAlignmentErrorsExtended; // dito
881  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
882  }
883 
884  if (globalCoordinates // happens only if (applyDbAlignment_ == true)
885  && globalCoordinates->transform() != AlignTransform::Transform::Identity) {
886  tempAlignments = new Alignments(); // temporary storage for
887  tempAlignmentErrorsExtended = new AlignmentErrorsExtended(); // final alignments and errors
888 
889  GeometryAligner aligner;
890  aligner.removeGlobalTransform(
891  alignments, alignmentErrors, *globalCoordinates, tempAlignments, tempAlignmentErrorsExtended);
892 
893  delete alignments; // have to delete original alignments
894  delete alignmentErrors; // same thing for the errors
895 
896  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::writeDB"
897  << "globalCoordinates removed from alignments (" << alignRcd << ") and errors ("
898  << alignRcd << ").";
899  }
900 
901  if (saveToDB_) {
902  edm::LogInfo("Alignment") << "Writing Alignments for run " << time << " to " << alignRcd << ".";
903  poolDb->writeOne<Alignments>(tempAlignments, time, alignRcd);
904  } else { // poolDb->writeOne(..) takes over 'alignments' ownership,...
905  delete tempAlignments; // ...otherwise we have to delete, as promised!
906  }
907 
908  if (saveApeToDB_) {
909  edm::LogInfo("Alignment") << "Writing AlignmentErrorsExtended for run " << time << " to " << errRcd << ".";
910  poolDb->writeOne<AlignmentErrorsExtended>(tempAlignmentErrorsExtended, time, errRcd);
911  } else { // poolDb->writeOne(..) takes over 'alignmentErrors' ownership,...
912  delete tempAlignmentErrorsExtended; // ...otherwise we have to delete, as promised!
913  }
914 }
915 
916 //------------------------------------------------------------------------------
918  const std::string& surfaceDeformationRcd,
919  cond::Time_t time) const {
920  // Call service
922  if (!poolDb.isAvailable()) { // Die if not available
923  delete alignmentSurfaceDeformations; // promised to take over ownership...
924  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
925  }
926 
927  if (saveDeformationsToDB_) {
928  edm::LogInfo("Alignment") << "Writing AlignmentSurfaceDeformations for run " << time << " to "
929  << surfaceDeformationRcd << ".";
930  poolDb->writeOne<AlignmentSurfaceDeformations>(alignmentSurfaceDeformations, time, surfaceDeformationRcd);
931  } else { // poolDb->writeOne(..) takes over 'surfaceDeformation' ownership,...
932  delete alignmentSurfaceDeformations; // ...otherwise we have to delete, as promised!
933  }
934 }
Vector3DBase
Definition: Vector3DBase.h:8
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
AlignmentProducerBase::nevent_
int nevent_
Definition: AlignmentProducerBase.h:226
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< Scalar >
AlignmentProducerBase::initAlignmentAlgorithm
void initAlignmentAlgorithm(const edm::EventSetup &, bool update=false)
Definition: AlignmentProducerBase.cc:344
DTGeometryBuilder
AlignmentProducerBase::beginLuminosityBlockImpl
void beginLuminosityBlockImpl(const edm::LuminosityBlock &, const edm::EventSetup &)
begin lumi block
Definition: AlignmentProducerBase.cc:250
AlignmentProducerBase::createGeometries
void createGeometries(const edm::EventSetup &, const TrackerTopology *)
Creates ideal geometry @trackerGeometry_ from IdealGeometryRecord.
Definition: AlignmentProducerBase.cc:415
mps_fire.i
i
Definition: mps_fire.py:355
AlignmentProducerBase::alignableMuon_
std::unique_ptr< AlignableMuon > alignableMuon_
Definition: AlignmentProducerBase.h:218
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
ESTransientHandle.h
cond::TimeTypeSpecs::beginValue
Time_t beginValue
Definition: Time.h:41
funct::false
false
Definition: Factorize.h:34
AlignmentParameterBuilder
Definition: AlignmentParameterBuilder.h:25
AlignmentProducerBase::endRunImpl
void endRunImpl(const edm::Run &, const edm::EventSetup &)
end run
Definition: AlignmentProducerBase.cc:234
ALCARECOPromptCalibProdSiPixelAli0T_cff.algoConfig
algoConfig
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:95
AlignmentProducerBase::watchDTAlErrExtRcd_
edm::ESWatcher< DTAlignmentErrorExtendedRcd > watchDTAlErrExtRcd_
Definition: AlignmentProducerBase.h:251
AlignmentProducerBase::applyMisalignment
void applyMisalignment()
Applies misalignment scenario to @alignableTracker_.
Definition: AlignmentProducerBase.cc:526
AlignmentProducerBase::endLuminosityBlockImpl
void endLuminosityBlockImpl(const edm::LuminosityBlock &, const edm::EventSetup &)
end lumi block
Definition: AlignmentProducerBase.cc:256
AlignmentProducerBase::createMonitors
void createMonitors()
Creates the monitors.
Definition: AlignmentProducerBase.cc:273
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
SurveyErrors.h
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
AlignmentProducerBase::alignableExtras_
std::unique_ptr< AlignableExtras > alignableExtras_
Definition: AlignmentProducerBase.h:219
TrackerScenarioBuilder
Builds a scenario from configuration and applies it to the alignable tracker.
Definition: TrackerScenarioBuilder.h:24
edm::Run
Definition: Run.h:45
AlignmentParameterSelector.h
reco::BeamSpot::z0
double z0() const
z coordinate
Definition: BeamSpot.h:65
DTGeometryBuilderFromDDD
Definition: DTGeometryBuilderFromDDD.h:31
TrackerTopology
Definition: TrackerTopology.h:16
AlignmentProducerBase::watchDTAlRcd_
edm::ESWatcher< DTAlignmentRcd > watchDTAlRcd_
Definition: AlignmentProducerBase.h:250
MuonGeometryConstants.h
align::RunNumber
cond::RealTimeType< cond::runnumber >::type RunNumber
Definition: Utilities.h:37
Alignable
Definition: Alignable.h:27
pos
Definition: PixelAliasList.h:18
AlignmentProducerBase::AlignmentProducerBase
AlignmentProducerBase(const edm::ParameterSet &)
Definition: AlignmentProducerBase.cc:34
RigidBodyAlignmentParameters::dbeta
Definition: RigidBodyAlignmentParameters.h:24
edm::LogInfo
Definition: MessageLogger.h:254
AlignableExtras.h
GeometryAligner::removeGlobalTransform
void removeGlobalTransform(const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates, Alignments *newAlignments, AlignmentErrorsExtended *newAlignmentErrorsExtended)
Definition: GeometryAligner.h:171
AlignmentProducerBase::useSurvey_
const bool useSurvey_
Definition: AlignmentProducerBase.h:238
AlignmentProducerBase::simpleMisalignment
void simpleMisalignment(const align::Alignables &, const std::string &, float, float, bool)
Applies misalignment scenario to @alignableTracker_.
Definition: AlignmentProducerBase.cc:557
AlignmentProducerBase::watchTrackerAlErrorExtRcd_
edm::ESWatcher< TrackerAlignmentErrorExtendedRcd > watchTrackerAlErrorExtRcd_
Definition: AlignmentProducerBase.h:247
edm::VParameterSet
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
HIPAlignmentAlgorithm_cfi.algoName
algoName
Definition: HIPAlignmentAlgorithm_cfi.py:5
CSCSurveyRcd
Definition: CSCSurveyRcd.h:15
AlignmentProducerBase.h
Alignment producer base class.
DetectorGlobalPosition.h
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:43
IntegratedCalibrationPluginFactory.h
AlignmentProducer_cff.calibrations
calibrations
Definition: AlignmentProducer_cff.py:59
GeometryAligner::attachSurfaceDeformations
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
Definition: GeometryAligner.h:120
RigidBodyAlignmentParameters::dx
Definition: RigidBodyAlignmentParameters.h:24
PTrackerParameters.h
AlignmentProducerBase::surveyValues_
const Alignments * surveyValues_
Definition: AlignmentProducerBase.h:265
indexGen.s2
s2
Definition: indexGen.py:107
AlignmentAlgorithmPluginFactory.h
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
AlignmentProducerBase::isDuringLoop_
bool isDuringLoop_
Definition: AlignmentProducerBase.h:270
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
AlignmentProducerBase::doMisalignmentScenario_
const bool doMisalignmentScenario_
Definition: AlignmentProducerBase.h:236
reco::BeamSpot::dxdz
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
AlignableSurface::length
align::Scalar length() const
Definition: AlignableSurface.h:32
edm::Handle
Definition: AssociativeIterator.h:50
relativeConstraints.error
error
Definition: relativeConstraints.py:53
MuonNumberingRecord.h
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
TrackerSurveyRcd
Definition: TrackerSurveyRcd.h:15
AlignmentProducerBase::isAlgoInitialized_
bool isAlgoInitialized_
Definition: AlignmentProducerBase.h:269
RigidBodyAlignmentParameters.h
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
AlCaHLTBitMon_QueryRunRegistry.comp
comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
PTrackerParametersRcd
Definition: PTrackerParametersRcd.h:9
AlignmentProducerBase::getBeamSpot
virtual bool getBeamSpot(const edm::Event &, edm::Handle< reco::BeamSpot > &)=0
AlignmentProducerBase::uniqueRunRanges_
const align::RunRanges uniqueRunRanges_
Definition: AlignmentProducerBase.h:225
MuonScenarioBuilder.h
RigidBodyAlignmentParameters::N_PARAM
Definition: RigidBodyAlignmentParameters.h:24
DTGeometryBuilderFromDDD.h
AlignmentProducerBase::trackerGeometry_
std::shared_ptr< TrackerGeometry > trackerGeometry_
Definition: AlignmentProducerBase.h:114
SurveyDet
Definition: SurveyDet.h:15
AlignmentParameterBuilder.h
config
Definition: config.py:1
DetId
Definition: DetId.h:17
edm::AssociationMap::end
const_iterator end() const
last iterator over the map (read only)
Definition: AssociationMap.h:171
CSCGeometryBuilder
Definition: CSCGeometryBuilder.h:20
Alignable::setSurvey
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:266
ConstTrajTrackPairs
std::vector< ConstTrajTrackPair > ConstTrajTrackPairs
Definition: AlignmentAlgorithmBase.h:52
AlignmentParameterSelector::convertParamSel
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
Definition: AlignmentParameterSelector.cc:795
PoolDBOutputService.h
TrackerScenarioBuilder.h
cond::timeTypeSpecs
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:16
MuonScenarioBuilder::applyScenario
void applyScenario(const edm::ParameterSet &scenario) override
Apply misalignment scenario to the Muon.
Definition: MuonScenarioBuilder.cc:35
TrackerTopologyRcd.h
AlignmentProducerBase::beamSpot_
edm::Handle< reco::BeamSpot > beamSpot_
Definition: AlignmentProducerBase.h:221
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
AlignmentProducerBase::surveyIndex_
size_t surveyIndex_
Definition: AlignmentProducerBase.h:264
AlignmentProducerBase::writeForRunRange
void writeForRunRange(cond::Time_t)
Definition: AlignmentProducerBase.cc:830
AlignmentProducerBase::watchTkSurveyErrExtRcd_
edm::ESWatcher< TrackerSurveyErrorExtendedRcd > watchTkSurveyErrExtRcd_
Definition: AlignmentProducerBase.h:256
AlignmentProducerBase::addSurveyInfo
void addSurveyInfo(Alignable *)
Adds survey info to an Alignable.
Definition: AlignmentProducerBase.cc:727
BeamSpotAlignmentParameters.h
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
EndRunInfo
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
Definition: AlignmentAlgorithmBase.h:181
Service.h
corrVsCorr.selection
selection
main part
Definition: corrVsCorr.py:100
AlignmentProducerBase::watchIdealGeometryRcd_
edm::ESWatcher< IdealGeometryRecord > watchIdealGeometryRcd_
Definition: AlignmentProducerBase.h:243
TrackerScenarioBuilder::applyScenario
void applyScenario(const edm::ParameterSet &scenario) override
Apply misalignment scenario to the tracker.
Definition: TrackerScenarioBuilder.cc:39
Run.h
edm::ESHandle< TrackerTopology >
AlignmentProducerBase::calibrations_
CalibrationsOwner calibrations_
Definition: AlignmentProducerBase.h:213
AlignmentProducerBase::getTrajTrackAssociationCollection
virtual bool getTrajTrackAssociationCollection(const edm::Event &, edm::Handle< TrajTrackAssociationCollection > &)=0
AlignmentProducerBase::saveApeToDB_
const bool saveApeToDB_
Definition: AlignmentProducerBase.h:237
AlignmentProducerBase::applyDbAlignment_
const bool applyDbAlignment_
Definition: AlignmentProducerBase.h:235
CSCGeometryBuilder::build
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
Definition: CSCGeometryBuilder.cc:17
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
AlignmentProducerBase::watchTrackerAlRcd_
edm::ESWatcher< TrackerAlignmentRcd > watchTrackerAlRcd_
Definition: AlignmentProducerBase.h:246
Point3DBase< Scalar, GlobalTag >
AlignmentProducerBase::stNFixAlignables_
const int stNFixAlignables_
Definition: AlignmentProducerBase.h:233
SurveyError.h
AlignmentProducerBase::finish
bool finish()
Definition: AlignmentProducerBase.cc:755
AlignmentProducerBase::doTracker_
const bool doTracker_
Definition: AlignmentProducerBase.h:117
AlignmentMonitorPluginFactory.h
AlignTransform
Definition: AlignTransform.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ZMuMuAnalysisNtupler_cff.eventInfo
eventInfo
Definition: ZMuMuAnalysisNtupler_cff.py:15
AlignmentProducerBase::createAlignables
void createAlignables(const TrackerTopology *, bool update=false)
Definition: AlignmentProducerBase.cc:471
gather_cfg.monitors
monitors
Definition: gather_cfg.py:173
AlignmentProducerBase::watchCSCAlRcd_
edm::ESWatcher< CSCAlignmentRcd > watchCSCAlRcd_
Definition: AlignmentProducerBase.h:252
AlignmentProducerBase::processEvent
bool processEvent(const edm::Event &, const edm::EventSetup &)
Process event.
Definition: AlignmentProducerBase.cc:136
AlignmentProducerBase::alignmentAlgo_
std::unique_ptr< AlignmentAlgorithmBase > alignmentAlgo_
Definition: AlignmentProducerBase.h:212
edm::ParameterSet
Definition: ParameterSet.h:36
AlignmentProducerBase::alignableTracker_
std::unique_ptr< AlignableTracker > alignableTracker_
Definition: AlignmentProducerBase.h:217
edm::LogError
Definition: MessageLogger.h:183
DetId::Tracker
Definition: DetId.h:25
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
AlignmentProducerBase::doMuon_
const bool doMuon_
Definition: AlignmentProducerBase.h:117
AlignmentProducerBase::storeAlignmentsToDB
void storeAlignmentsToDB()
Writes Alignments (i.e. Records) to database-file.
Definition: AlignmentProducerBase.cc:780
AlignmentProducerBase::createCalibrations
void createCalibrations()
Creates the calibrations.
Definition: AlignmentProducerBase.cc:283
AlignmentProducerBase::getTkFittedLasBeamCollection
virtual bool getTkFittedLasBeamCollection(const edm::Run &, edm::Handle< TkFittedLasBeamCollection > &)=0
beam_dqm_sourceclient-live_cfg.monitor
monitor
Definition: beam_dqm_sourceclient-live_cfg.py:234
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
cond::runnumber
Definition: Time.h:19
AlignmentProducerBase::terminateProcessing
void terminateProcessing(const edm::EventSetup *=nullptr)
Terminate processing of events.
Definition: AlignmentProducerBase.cc:114
RigidBodyAlignmentParameters::dgamma
Definition: RigidBodyAlignmentParameters.h:24
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
edm::Service< cond::service::PoolDBOutputService >
AlignmentProducerBase::buildParameterStore
void buildParameterStore()
Creates the @alignmentParameterStore_, which manages all Alignables.
Definition: AlignmentProducerBase.cc:498
RigidBodyAlignmentParameters::dy
Definition: RigidBodyAlignmentParameters.h:24
AlignmentProducerBase::muonCSCGeometry_
std::shared_ptr< CSCGeometry > muonCSCGeometry_
Definition: AlignmentProducerBase.h:116
AlignmentProducerBase::readInSurveyRcds
void readInSurveyRcds(const edm::EventSetup &)
Reads in survey records.
Definition: AlignmentProducerBase.cc:670
AlignmentProducerBase::enableAlignableUpdates_
const bool enableAlignableUpdates_
Definition: AlignmentProducerBase.h:239
AlignmentSurfaceDeformations
Definition: AlignmentSurfaceDeformations.h:20
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
AlignmentProducerBase::applyAlignmentsToGeometry
void applyAlignmentsToGeometry()
Definition: AlignmentProducerBase.cc:631
AlignmentProducerBase::runAtPCL_
bool runAtPCL_
Definition: AlignmentProducerBase.h:227
edm::EventSetup
Definition: EventSetup.h:57
CSCGeometryBuilderFromDDD.h
AlignmentProducerBase::watchTrackerSurDeRcd_
edm::ESWatcher< TrackerSurfaceDeformationRcd > watchTrackerSurDeRcd_
Definition: AlignmentProducerBase.h:248
AlignmentProducerBase::setupChanged
bool setupChanged(const edm::EventSetup &)
Checks if one of the EventSetup-Records has changed.
Definition: AlignmentProducerBase.cc:292
AlignmentProducerBase::monitors_
AlignmentMonitors monitors_
Definition: AlignmentProducerBase.h:214
DTSurveyRcd
Definition: DTSurveyRcd.h:15
get
#define get
AlignmentProducerBase::tkLasBeamTag_
const edm::InputTag tkLasBeamTag_
LAS beams in edm::Run (ignore if empty)
Definition: AlignmentProducerBase.h:126
align::EulerAngles
AlgebraicVector EulerAngles
Definition: Definitions.h:34
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
AlignmentProducerBase::getTsosVectorCollection
virtual bool getTsosVectorCollection(const edm::Run &, edm::Handle< TsosVectorCollection > &)=0
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
alignCSCRings.r
r
Definition: alignCSCRings.py:93
reco::BeamSpot::dydz
double dydz() const
dydz slope
Definition: BeamSpot.h:80
AlignableSurface::setWidth
void setWidth(align::Scalar width)
Definition: AlignableSurface.h:34
AlignmentProducerBase::useExtras_
const bool useExtras_
Definition: AlignmentProducerBase.h:117
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::BeamSpot::x0
double x0() const
x coordinate
Definition: BeamSpot.h:61
AlignmentProducerBase::watchCSCAlErrExtRcd_
edm::ESWatcher< CSCAlignmentErrorExtendedRcd > watchCSCAlErrExtRcd_
Definition: AlignmentProducerBase.h:253
AlignmentProducerBase::surveyErrors_
const SurveyErrors * surveyErrors_
Definition: AlignmentProducerBase.h:266
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
AlignmentProducerBase::initBeamSpot
void initBeamSpot(const edm::Event &)
Initializes Beamspot @beamSpot_ of Alignables @alignableExtras_.
Definition: AlignmentProducerBase.cc:402
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
AlignableSurface
Definition: AlignableSurface.h:20
DTSurveyErrorExtendedRcd
Definition: DTSurveyErrorExtendedRcd.h:15
AlignableSurface::width
align::Scalar width() const
Definition: AlignableSurface.h:30
CSCSurveyErrorExtendedRcd
Definition: CSCSurveyErrorExtendedRcd.h:15
AlignmentProducerBase::~AlignmentProducerBase
virtual ~AlignmentProducerBase() noexcept(false)
Definition: AlignmentProducerBase.cc:83
CSCGeometryBuilderFromDDD
Definition: CSCGeometryBuilderFromDDD.h:30
edm::ValueMap
Definition: ValueMap.h:107
Exception
Definition: hltDiff.cc:246
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:56
edm::AssociationMap::begin
const_iterator begin() const
first iterator over the map (read only)
Definition: AssociationMap.h:169
ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentAlgorithmBase.h:51
AlignmentProducerBase::applyAlignmentsToDB
void applyAlignmentsToDB(const edm::EventSetup &)
Definition: AlignmentProducerBase.cc:443
AlignmentProducerBase::clusterValueMapTag_
const edm::InputTag clusterValueMapTag_
ValueMap containing associtaion cluster-flag.
Definition: AlignmentProducerBase.h:129
AlignableSurface::setLength
void setLength(align::Scalar length)
Definition: AlignableSurface.h:36
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
AlignmentProducerBase::watchGlobalPositionRcd_
edm::ESWatcher< GlobalPositionRcd > watchGlobalPositionRcd_
Definition: AlignmentProducerBase.h:244
align::makeUniqueRunRanges
RunRanges makeUniqueRunRanges(const edm::VParameterSet &runRanges, const RunNumber &defaultRun)
Definition: Utilities.cc:241
RigidBodyAlignmentParameters::dz
Definition: RigidBodyAlignmentParameters.h:24
AlignmentProducerBase::alignmentParameterStore_
std::unique_ptr< AlignmentParameterStore > alignmentParameterStore_
Definition: AlignmentProducerBase.h:216
align::toMatrix
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:34
AlignmentProducerBase::createAlignmentAlgorithm
void createAlignmentAlgorithm()
Creates the choosen alignment algorithm.
Definition: AlignmentProducerBase.cc:262
SurveyError
Definition: SurveyError.h:23
AlignmentProducerBase::globalPositions_
std::unique_ptr< const Alignments > globalPositions_
GlobalPositions that might be read from DB, nullptr otherwise.
Definition: AlignmentProducerBase.h:223
edm::ParameterSet::getParameterSetVector
VParameterSet const & getParameterSetVector(std::string const &name) const
Definition: ParameterSet.cc:2153
TrackerGeomBuilderFromGeometricDet.h
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:17
DetId::Muon
Definition: DetId.h:26
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
RigidBodyAlignmentParameters::dalpha
Definition: RigidBodyAlignmentParameters.h:24
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
AlignmentProducerBase::stRandomRotation_
const double stRandomRotation_
Definition: AlignmentProducerBase.h:234
SurveyDet.h
AlignmentProducerBase::stRandomShift_
const double stRandomShift_
Definition: AlignmentProducerBase.h:234
AlignmentProducerBase::startProcessing
void startProcessing()
Start processing of events.
Definition: AlignmentProducerBase.cc:86
ntuplemaker.time
time
Definition: ntuplemaker.py:310
event
Definition: event.py:1
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
SurveyErrors::m_surveyErrors
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:22
edm::Event
Definition: Event.h:73
AlignmentProducerBase::saveDeformationsToDB_
const bool saveDeformationsToDB_
Definition: AlignmentProducerBase.h:237
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
TrackerSurveyErrorExtendedRcd
Definition: TrackerSurveyErrorExtendedRcd.h:15
AlignmentProducerBase::muonDTGeometry_
std::shared_ptr< DTGeometry > muonDTGeometry_
Definition: AlignmentProducerBase.h:115
Alignments
Definition: Alignments.h:10
AlignmentProducer_cff.monitorConfig
monitorConfig
Definition: AlignmentProducer_cff.py:61
AlignmentProducerBase::beginRunImpl
void beginRunImpl(const edm::Run &, const edm::EventSetup &)
begin run
Definition: AlignmentProducerBase.cc:207
edm::InputTag
Definition: InputTag.h:15
AlignTransform::transform
Transform transform() const
Definition: AlignTransform.h:44
AlignmentParameterSelector
Definition: AlignmentParameterSelector.h:26
AlignmentProducerBase::config_
edm::ParameterSet config_
Definition: AlignmentProducerBase.h:231
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
MuonScenarioBuilder
Builds a scenario from configuration and applies it to the alignable Muon.
Definition: MuonScenarioBuilder.h:19
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
AlignmentProducerBase::saveToDB_
const bool saveToDB_
Definition: AlignmentProducerBase.h:237
AlignmentProducerBase::firstRun_
cond::Time_t firstRun_
Definition: AlignmentProducerBase.h:273
AlignmentProducerBase::getAliClusterValueMap
virtual bool getAliClusterValueMap(const edm::Event &, edm::Handle< AliClusterValueMap > &)=0
AlignmentProducerBase::writeDB
void writeDB(Alignments *, const std::string &, AlignmentErrorsExtended *, const std::string &, const AlignTransform *, cond::Time_t) const
Definition: AlignmentProducerBase.cc:867
update
#define update(a, b)
Definition: TrackClassifier.cc:10
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33
AlignmentProducerBase::watchTkSurveyRcd_
edm::ESWatcher< TrackerSurveyRcd > watchTkSurveyRcd_
Definition: AlignmentProducerBase.h:255
AlignmentAlgorithmBase::EventInfo
define event information passed to algorithms
Definition: AlignmentAlgorithmBase.h:72