CMS 3D CMS Logo

AlignmentProducerBase.cc
Go to the documentation of this file.
2 
14 
16 
21 
25 
32 
33 
34 //------------------------------------------------------------------------------
36  doTracker_{config.getUntrackedParameter<bool>("doTracker")},
37  doMuon_{config.getUntrackedParameter<bool>("doMuon")},
38  useExtras_{config.getUntrackedParameter<bool>("useExtras")},
39  tjTkAssociationMapTag_{config.getParameter<edm::InputTag>("tjTkAssociationMapTag")},
40  beamSpotTag_{config.getParameter<edm::InputTag>("beamSpotTag")},
41  tkLasBeamTag_{config.getParameter<edm::InputTag>("tkLasBeamTag")},
42  clusterValueMapTag_{config.getParameter<edm::InputTag>("hitPrescaleMapTag")},
44  {align::makeUniqueRunRanges(config.getParameter<edm::VParameterSet>("RunRangeSelection"),
46  config_{config},
47  stNFixAlignables_{config.getParameter<int>("nFixAlignables")},
48  stRandomShift_{config.getParameter<double>("randomShift")},
49  stRandomRotation_{config.getParameter<double>("randomRotation")},
50  applyDbAlignment_{config.getUntrackedParameter<bool>("applyDbAlignment")},
51  checkDbAlignmentValidity_{config.getUntrackedParameter<bool>("checkDbAlignmentValidity")},
52  doMisalignmentScenario_{config.getParameter<bool>("doMisalignmentScenario")},
53  saveToDB_{config.getParameter<bool>("saveToDB")},
54  saveApeToDB_{config.getParameter<bool>("saveApeToDB")},
55  saveDeformationsToDB_{config.getParameter<bool>("saveDeformationsToDB")},
56  useSurvey_{config.getParameter<bool>("useSurvey")},
57  enableAlignableUpdates_{config.getParameter<bool>("enableAlignableUpdates")}
58 {
59  edm::LogInfo("Alignment") << "@SUB=AlignmentProducerBase::AlignmentProducerBase";
60 
61  const auto& algoConfig = config_.getParameterSet("algoConfig");
62  if (hasParameter<bool>(config_, "runAtPCL")) {
63  // configured in main config?
64  runAtPCL_ = config_.getParameter<bool>("runAtPCL");
65 
66  if (hasParameter<bool>(algoConfig, "runAtPCL") &&
67  (runAtPCL_ != algoConfig.getParameter<bool>("runAtPCL"))) {
68  throw cms::Exception("BadConfig")
69  << "Inconsistent settings for 'runAtPCL' in configuration of the "
70  << "alignment producer and the alignment algorithm.";
71  }
72 
73  } else if (hasParameter<bool>(algoConfig, "runAtPCL")) {
74  // configured in algo config?
75  runAtPCL_ = algoConfig.getParameter<bool>("runAtPCL");
76 
77  } else {
78  // assume 'false' if it was not configured
79  runAtPCL_ = false;
80  }
81 
85 }
86 
87 
88 
89 //------------------------------------------------------------------------------
91 {
92  for (auto& iCal: calibrations_) delete iCal;
93 
95  delete alignableExtras_;
96  delete alignableTracker_;
97  delete alignableMuon_;
98 }
99 
100 
101 //------------------------------------------------------------------------------
102 void
104 {
105  if (isDuringLoop_) return;
106 
107  edm::LogInfo("Alignment")
108  << "@SUB=AlignmentProducerBase::startProcessing"
109  << "Begin";
110 
111  if (!isAlgoInitialized_) {
112  throw cms::Exception("LogicError")
113  << "@SUB=AlignmentProducerBase::startProcessing\n"
114  << "Trying to start event processing before initializing the alignment "
115  << "algorithm.";
116  }
117 
118  nevent_ = 0;
119 
120  alignmentAlgo_->startNewLoop();
121 
122  // FIXME: Should this be done in algorithm::startNewLoop()??
123  for (const auto& iCal: calibrations_) iCal->startNewLoop();
124  for (const auto& monitor: monitors_) monitor->startingNewLoop();
125 
127  isDuringLoop_ = true;
128 }
129 
130 
131 //------------------------------------------------------------------------------
132 void
134 {
135  if (!isDuringLoop_) return;
136 
137  edm::LogInfo("Alignment")
138  << "@SUB=AlignmentProducerBase::terminateProcessing"
139  << "Terminating algorithm.";
140  if (setup) {
141  alignmentAlgo_->terminate(*setup);
142  } else {
143  alignmentAlgo_->terminate();
144  }
145 
146  // FIXME: Should this be done in algorithm::terminate()??
147  for (const auto& iCal:calibrations_) iCal->endOfLoop();
148  for (const auto& monitor: monitors_) monitor->endOfLoop();
149 
150  isDuringLoop_ = false;
151 }
152 
153 
154 //------------------------------------------------------------------------------
155 bool
157  const edm::EventSetup& setup)
158 {
159  if (setupChanged(setup)) {
160  edm::LogInfo("Alignment")
161  << "@SUB=AlignmentProducerBase::processEvent"
162  << "EventSetup-Record changed.";
163 
164  // updatable alignables are currently not used at PCL, but event setup
165  // changes require a complete re-initialization
166  if (runAtPCL_) {
167  initAlignmentAlgorithm(setup, /* update = */ false);
168  } else if (enableAlignableUpdates_) {
169  initAlignmentAlgorithm(setup, /* update = */ true);
170  }
171  }
172 
173  initBeamSpot(event); // must happen every event and before incrementing 'nevent_'
174 
175  ++nevent_; // must happen before the check below;
176  // otherwise subsequent checks fail for "EmptySource"
177 
178  if (!alignmentAlgo_->processesEvents()) {
179  edm::LogInfo("Alignment")
180  << "@SUB=AlignmentProducerBase::processEvent"
181  << "Skipping event. The current configuration of the alignment algorithm "
182  << "does not need to process any events.";
183  return false;
184  }
185 
186  // reading in survey records
187  readInSurveyRcds(setup);
188 
189  // Printout event number
190  for ( int i=10; i<10000000; i*=10 ) {
191  if ( nevent_<10*i && (nevent_%i)==0 ) {
192  edm::LogInfo("Alignment")
193  << "@SUB=AlignmentProducerBase::processEvent"
194  << "Events processed: " << nevent_;
195  }
196  }
197 
198  // Retrieve trajectories and tracks from the event
199  // -> merely skip if collection is empty
200  edm::Handle<TrajTrackAssociationCollection> handleTrajTracksCollection;
201 
202  if (getTrajTrackAssociationCollection(event, handleTrajTracksCollection)) {
203 
204  // Form pairs of trajectories and tracks
205  ConstTrajTrackPairs trajTracks;
206  for (auto iter = handleTrajTracksCollection->begin();
207  iter != handleTrajTracksCollection->end();
208  ++iter) {
209  trajTracks.push_back(ConstTrajTrackPair(&(*(*iter).key), &(*(*iter).val)));
210  }
211 
212  // Run the alignment algorithm with its input
213  const AliClusterValueMap* clusterValueMapPtr{nullptr};
214  if (!clusterValueMapTag_.encode().empty()) {
215  edm::Handle<AliClusterValueMap> clusterValueMap;
216  getAliClusterValueMap(event, clusterValueMap);
217  clusterValueMapPtr = &(*clusterValueMap);
218  }
219 
220 
222  trajTracks,
223  *beamSpot_,
224  clusterValueMapPtr};
225  alignmentAlgo_->run(setup, eventInfo);
226 
227 
228  for (const auto& monitor: monitors_) {
229  monitor->duringLoop(event, setup, trajTracks); // forward eventInfo?
230  }
231  } else {
232  edm::LogError("Alignment")
233  << "@SUB=AlignmentProducerBase::processEvent"
234  << "No track collection found: skipping event";
235  }
236 
237  return true;
238 }
239 
240 
241 //------------------------------------------------------------------------------
242 void
244 {
245  const bool changed{setupChanged(setup)};
246  if (changed) {
247  edm::LogInfo("Alignment")
248  << "@SUB=AlignmentProducerBase::beginRunImpl"
249  << "EventSetup-Record changed.";
250 
251  // updatable alignables are currently not used at PCL, but event setup
252  // changes require a complete re-initialization
253  if (runAtPCL_) {
254  initAlignmentAlgorithm(setup, /* update = */ false);
255  } else if (enableAlignableUpdates_) {
256  initAlignmentAlgorithm(setup, /* update = */ true);
257  }
258  }
259 
260  alignmentAlgo_->beginRun(run, setup,
261  changed && (runAtPCL_ || enableAlignableUpdates_));
262 
263  for (const auto& iCal:calibrations_) iCal->beginRun(run, setup);
264 
265  //store the first run analyzed to be used for setting the IOV (for PCL)
266  if (firstRun_ > static_cast<cond::Time_t>(run.id().run())) {
267  firstRun_ = static_cast<cond::Time_t>(run.id().run());
268  }
269 }
270 
271 
272 //------------------------------------------------------------------------------
273 void
275 {
276  if (!tkLasBeamTag_.encode().empty()) {
279  getTkFittedLasBeamCollection(run, lasBeams);
280  getTsosVectorCollection(run, tsoses);
281 
282  alignmentAlgo_->endRun(EndRunInfo(run.id(), &(*lasBeams), &(*tsoses)), setup);
283  } else {
284  edm::LogInfo("Alignment")
285  << "@SUB=AlignmentProducerBase::endRunImpl"
286  << "No Tk LAS beams to forward to algorithm.";
287  alignmentAlgo_->endRun(EndRunInfo(run.id(), nullptr, nullptr), setup);
288  }
289 
290 }
291 
292 
293 //------------------------------------------------------------------------------
294 void
296  const edm::EventSetup& setup)
297 {
298  // Do not forward edm::LuminosityBlock
299  alignmentAlgo_->beginLuminosityBlock(setup);
300 }
301 
302 
303 //------------------------------------------------------------------------------
304 void
306  const edm::EventSetup& setup)
307 {
308  // Do not forward edm::LuminosityBlock
309  alignmentAlgo_->endLuminosityBlock(setup);
310 }
311 
312 
313 
314 //------------------------------------------------------------------------------
315 void
317 {
318  auto algoConfig = config_.getParameter<edm::ParameterSet>("algoConfig");
319  algoConfig.addUntrackedParameter("RunRangeSelection",
320  config_.getParameter<edm::VParameterSet>("RunRangeSelection"));
321  algoConfig.addUntrackedParameter<align::RunNumber>("firstIOV",
322  runAtPCL_ ?
323  1 :
324  uniqueRunRanges_.front().first);
325  algoConfig.addUntrackedParameter("enableAlignableUpdates",
327 
328  const auto& algoName = algoConfig.getParameter<std::string>("algoName");
329  alignmentAlgo_ = std::unique_ptr<AlignmentAlgorithmBase>
331 
332  if (!alignmentAlgo_) {
333  throw cms::Exception("BadConfig")
334  << "Couldn't find the called alignment algorithm: " << algoName;
335  }
336 }
337 
338 
339 //------------------------------------------------------------------------------
340 void
342 {
343  const auto& monitorConfig = config_.getParameter<edm::ParameterSet>("monitorConfig");
344  auto monitors = monitorConfig.getUntrackedParameter<std::vector<std::string> >("monitors");
345  for (const auto& miter: monitors) {
346  std::unique_ptr<AlignmentMonitorBase> newMonitor
348  ->create(miter, monitorConfig.getUntrackedParameterSet(miter))};
349 
350  if (!newMonitor) {
351  throw cms::Exception("BadConfig") << "Couldn't find monitor named " << miter;
352  }
353  monitors_.emplace_back(std::move(newMonitor));
354  }
355 }
356 
357 
358 //------------------------------------------------------------------------------
359 void
361 {
362  const auto& calibrations = config_.getParameter<edm::VParameterSet>("calibrations");
363  for (const auto& iCalib: calibrations) {
365  ->create(iCalib.getParameter<std::string>("calibrationName"),
366  iCalib));
367  }
368 }
369 
370 
371 //------------------------------------------------------------------------------
372 bool
374 {
375  bool changed{false};
376 
377  if (watchIdealGeometryRcd_.check(setup)) {
378  changed = true;
379  }
380 
381  if (watchGlobalPositionRcd_.check(setup)) {
382  changed = true;
383  }
384 
385  if (doTracker_) {
386  if (watchTrackerAlRcd_.check(setup)) {
387  changed = true;
388  }
389 
390  if (watchTrackerAlErrorExtRcd_.check(setup)) {
391  changed = true;
392  }
393 
394  if (watchTrackerSurDeRcd_.check(setup)) {
395  changed = true;
396  }
397  }
398 
399  if (doMuon_) {
400  if (watchDTAlRcd_.check(setup)) {
401  changed = true;
402  }
403 
404  if (watchDTAlErrExtRcd_.check(setup)) {
405  changed = true;
406  }
407 
408  if (watchCSCAlRcd_.check(setup)) {
409  changed = true;
410  }
411 
412  if (watchCSCAlErrExtRcd_.check(setup)) {
413  changed = true;
414  }
415  }
416 
417  /* TODO: ExtraAlignables: Which record(s) to check?
418  *
419  if (useExtras_) {}
420  */
421 
422  return changed;
423 }
424 
425 
426 //------------------------------------------------------------------------------
427 void
429  bool update)
430 {
431  edm::LogInfo("Alignment")
432  << "@SUB=AlignmentProducerBase::initAlignmentAlgorithm"
433  << "Begin";
434 
435  auto isTrueUpdate = update && isAlgoInitialized_;
436 
437  // Retrieve tracker topology from geometry
438  edm::ESHandle<TrackerTopology> tTopoHandle;
439  setup.get<TrackerTopologyRcd>().get(tTopoHandle);
440  const TrackerTopology* const tTopo = tTopoHandle.product();
441 
442  // Create the geometries from the ideal geometries
443  createGeometries(setup, tTopo);
444 
445  applyAlignmentsToDB(setup);
446  createAlignables(tTopo, isTrueUpdate);
449 
450  // Initialize alignment algorithm and integrated calibration and pass the
451  // latter to algorithm
452  edm::LogInfo("Alignment")
453  << "@SUB=AlignmentProducerBase::initAlignmentAlgorithm"
454  << "Initializing alignment algorithm.";
455  alignmentAlgo_->initialize(setup,
460 
461  // Not all algorithms support calibrations - so do not pass empty vector
462  // and throw if non-empty and not supported:
463  if (!calibrations_.empty()) {
464  if (alignmentAlgo_->supportsCalibrations()) {
465  alignmentAlgo_->addCalibrations(calibrations_);
466  } else {
467  throw cms::Exception("BadConfig")
468  << "@SUB=AlignmentProducerBase::createCalibrations\n"
469  << "Configured " << calibrations_.size() << " calibration(s) "
470  << "for algorithm not supporting it.";
471  }
472  }
473 
474  isAlgoInitialized_ = true;
475 
477 
478  if (!isTrueUpdate) { // only needed the first time
479  for (const auto& iCal: calibrations_) {
481  }
482  for (const auto& monitor: monitors_) {
484  }
485  }
486  startProcessing(); // needed if derived class is non-EDLooper-based
487  // has no effect, if called during loop
488 
489  edm::LogInfo("Alignment")
490  << "@SUB=AlignmentProducerBase::initAlignmentAlgorithm"
491  << "End";
492 }
493 
494 
495 //------------------------------------------------------------------------------
496 void
498 {
499  getBeamSpot(event, beamSpot_);
500 
501  if (nevent_== 0 && alignableExtras_) {
502  edm::LogInfo("Alignment")
503  << "@SUB=AlignmentProducerBase::initBeamSpot"
504  << "Initializing AlignableBeamSpot";
505 
507  beamSpot_->y0(),
508  beamSpot_->z0(),
509  beamSpot_->dxdz(),
510  beamSpot_->dydz());
511  }
512 }
513 
514 
515 //------------------------------------------------------------------------------
516 void
518  const TrackerTopology* tTopo)
519 {
520  if (doTracker_) {
521  edm::ESHandle<GeometricDet> geometricDet;
522  iSetup.get<IdealGeometryRecord>().get(geometricDet);
523 
525  iSetup.get<PTrackerParametersRcd>().get(ptp);
526 
527  TrackerGeomBuilderFromGeometricDet trackerBuilder;
528 
529  trackerGeometry_ = std::shared_ptr<TrackerGeometry>
530  (trackerBuilder.build(&(*geometricDet), *ptp, tTopo));
531  }
532 
533  if (doMuon_) {
535  iSetup.get<IdealGeometryRecord>().get(cpv);
537  iSetup.get<MuonNumberingRecord>().get(mdc);
538  DTGeometryBuilderFromDDD DTGeometryBuilder;
540  muonDTGeometry_ = std::make_shared<DTGeometry>();
541  DTGeometryBuilder.build(muonDTGeometry_, &(*cpv), *mdc);
542  muonCSCGeometry_ = std::make_shared<CSCGeometry>();
543  CSCGeometryBuilder.build(muonCSCGeometry_, &(*cpv), *mdc );
544  }
545 }
546 
547 
548 //------------------------------------------------------------------------------
549 void
551 {
552  // Retrieve and apply alignments, if requested (requires z setup)
553  if (applyDbAlignment_) {
554  // we need GlobalPositionRcd - and have to keep track for later removal
555  // before writing again to DB...
556 
557  edm::ESHandle<Alignments> globalAlignments;
558  setup.get<GlobalPositionRcd>().get(globalAlignments);
559  globalPositions_ = std::make_unique<Alignments>(*globalAlignments);
560 
561  if (doTracker_) {
565  (trackerGeometry_.get(), setup,
567  );
568 
569  applyDB<TrackerGeometry,
571  }
572 
573  if (doMuon_) {
577  (muonDTGeometry_.get(), setup,
579  );
580 
584  (muonCSCGeometry_.get(), setup,
586  );
587  }
588  }
589 }
590 
591 
592 //------------------------------------------------------------------------------
593 void
595 {
596  if (doTracker_) {
597  if (update) {
599  } else {
601  }
602  }
603 
604  if (doMuon_) {
605  if (update) {
607  } else {
609  }
610  }
611 
612  if (useExtras_) {
613  if (update) {
614  // FIXME: Requires further code changes to track beam spot condition changes
615  } else {
617  }
618  }
619 }
620 
621 
622 //------------------------------------------------------------------------------
623 void
625 {
626  // Create alignment parameter builder
627  edm::LogInfo("Alignment")
628  << "@SUB=AlignmentProducerBase::buildParameterStore"
629  << "Creating AlignmentParameterBuilder";
630 
631  const auto& alParamBuildCfg =
632  config_.getParameter<edm::ParameterSet>("ParameterBuilder");
633  const auto& alParamStoreCfg =
634  config_.getParameter<edm::ParameterSet>("ParameterStore");
635 
636  AlignmentParameterBuilder alignmentParameterBuilder{alignableTracker_,
639  alParamBuildCfg};
640 
641  // Fix alignables if requested
642  if (stNFixAlignables_ > 0) {
643  alignmentParameterBuilder.fixAlignables(stNFixAlignables_);
644  }
645 
646  // Get list of alignables
647  const auto& alignables = alignmentParameterBuilder.alignables();
648  edm::LogInfo("Alignment")
649  << "@SUB=AlignmentProducerBase::buildParameterStore"
650  << "got " << alignables.size() << " alignables";
651 
652  // Create AlignmentParameterStore
654  new AlignmentParameterStore(alignables, alParamStoreCfg);
655  edm::LogInfo("Alignment")
656  << "@SUB=AlignmentProducerBase::buildParameterStore"
657  << "AlignmentParameterStore created!";
658 }
659 
660 
661 //------------------------------------------------------------------------------
662 void
664 {
665  // Apply misalignment scenario to alignable tracker and muon if requested
666  // WARNING: this assumes scenarioConfig can be passed to both muon and tracker
667 
669  edm::LogInfo("Alignment")
670  << "@SUB=AlignmentProducerBase::applyMisalignment"
671  << "Applying misalignment scenario to "
672  << (doTracker_ ? "tracker" : "")
673  << (doMuon_ ? (doTracker_ ? " and muon" : "muon") : ".");
674 
675  const auto& scenarioConfig = config_.getParameterSet("MisalignmentScenario");
676 
677  if (doTracker_) {
678  TrackerScenarioBuilder scenarioBuilder(alignableTracker_);
679  scenarioBuilder.applyScenario(scenarioConfig);
680  }
681  if (doMuon_) {
682  MuonScenarioBuilder muonScenarioBuilder(alignableMuon_);
683  muonScenarioBuilder.applyScenario(scenarioConfig);
684  }
685 
686  } else {
687  edm::LogInfo("Alignment")
688  << "@SUB=AlignmentProducerBase::applyMisalignment"
689  << "NOT applying misalignment scenario!";
690  }
691 
692  // Apply simple misalignment
693  const auto& sParSel =
694  config_.getParameter<std::string>("parameterSelectorSimple");
697 }
698 
699 
700 // ----------------------------------------------------------------------------
701 void
703  const std::string &selection,
704  float shift, float rot, bool local)
705 {
706 
707  std::ostringstream output; // collecting output
708 
709  if (shift > 0. || rot > 0.) {
710  output << "Adding random flat shift of max size " << shift
711  << " and adding random flat rotation of max size " << rot <<" to ";
712 
713  std::vector<bool> commSel(0);
714  if (selection != "-1") {
715  AlignmentParameterSelector aSelector(nullptr,nullptr); // no alignable needed here...
716  const std::vector<char> cSel(aSelector.convertParamSel(selection));
717  if (cSel.size() < RigidBodyAlignmentParameters::N_PARAM) {
718  throw cms::Exception("BadConfig")
719  << "[AlignmentProducerBase::simpleMisalignment_]\n"
720  << "Expect selection string '" << selection << "' to be at least of length "
721  << RigidBodyAlignmentParameters::N_PARAM << " or to be '-1'.\n"
722  << "(Most probably you have to adjust the parameter 'parameterSelectorSimple'.)";
723  }
724  for (const auto& cIter: cSel) {
725  commSel.push_back(cIter == '0' ? false : true);
726  }
727  output << "parameters defined by (" << selection
728  << "), representing (x,y,z,alpha,beta,gamma),";
729  } else {
730  output << "the active parameters of each alignable,";
731  }
732  output << " in " << (local ? "local" : "global") << " frame.";
733 
734  for (const auto& ali: alivec) {
735  std::vector<bool> mysel(commSel.empty() ? ali->alignmentParameters()->selector() : commSel);
736 
737  if (std::abs(shift)>0.00001) {
738  double s0 = 0., s1 = 0., s2 = 0.;
739  if (mysel[RigidBodyAlignmentParameters::dx]) s0 = shift * double(random()%1000-500)/500.;
740  if (mysel[RigidBodyAlignmentParameters::dy]) s1 = shift * double(random()%1000-500)/500.;
741  if (mysel[RigidBodyAlignmentParameters::dz]) s2 = shift * double(random()%1000-500)/500.;
742 
743  if (local) ali->move(ali->surface().toGlobal(align::LocalVector(s0,s1,s2)));
744  else ali->move(align::GlobalVector(s0,s1,s2));
745 
746  //AlignmentPositionError ape(dx,dy,dz);
747  //ali->addAlignmentPositionError(ape);
748  }
749 
750  if (std::abs(rot)>0.00001) {
752  if (mysel[RigidBodyAlignmentParameters::dalpha]) r(1)=rot*double(random()%1000-500)/500.;
753  if (mysel[RigidBodyAlignmentParameters::dbeta]) r(2)=rot*double(random()%1000-500)/500.;
754  if (mysel[RigidBodyAlignmentParameters::dgamma]) r(3)=rot*double(random()%1000-500)/500.;
755 
756  const align::RotationType mrot = align::toMatrix(r);
757  if (local) ali->rotateInLocalFrame(mrot);
758  else ali->rotateInGlobalFrame(mrot);
759 
760  //ali->addAlignmentPositionErrorFromRotation(mrot);
761  }
762  } // end loop on alignables
763  } else {
764  output << "No simple misalignment added!";
765  }
766  edm::LogInfo("Alignment")
767  << "@SUB=AlignmentProducerBase::simpleMisalignment" << output.str();
768 }
769 
770 
771 //------------------------------------------------------------------------------
772 void
774 {
775  edm::LogInfo("Alignment")
776  << "@SUB=AlignmentProducerBase::applyAlignmentsToGeometry"
777  << "Now physically apply alignments to geometry...";
778 
779  // Propagate changes to reconstruction geometry (from initialisation or iteration)
780  GeometryAligner aligner;
781 
782  if (doTracker_) {
783  if (!alignableTracker_) {
784  throw cms::Exception("LogicError")
785  << "@SUB=AlignmentProducerBase::applyAlignmentsToGeometry\n"
786  << "Trying to apply tracker alignment before creating it.";
787  }
788 
789  std::unique_ptr<Alignments> alignments{alignableTracker_->alignments()};
790  std::unique_ptr<AlignmentErrorsExtended>
791  alignmentErrExt{alignableTracker_->alignmentErrors()};
792  std::unique_ptr<AlignmentSurfaceDeformations>
793  aliDeforms{alignableTracker_->surfaceDeformations()};
794 
795  aligner.applyAlignments(trackerGeometry_.get(), alignments.get(),
796  alignmentErrExt.get(), AlignTransform());
797  aligner.attachSurfaceDeformations(trackerGeometry_.get(), aliDeforms.get());
798  }
799 
800  if (doMuon_) {
801  if (!alignableMuon_) {
802  throw cms::Exception("LogicError")
803  << "@SUB=AlignmentProducerBase::applyAlignmentsToGeometry\n"
804  << "Trying to apply muon alignment before creating it.";
805  }
806 
807  std::unique_ptr<Alignments> dtAlignments{alignableMuon_->dtAlignments()};
808  std::unique_ptr<Alignments> cscAlignments{alignableMuon_->cscAlignments()};
809 
810  std::unique_ptr<AlignmentErrorsExtended>
811  dtAlignmentErrExt{alignableMuon_->dtAlignmentErrorsExtended()};
812  std::unique_ptr<AlignmentErrorsExtended>
813  cscAlignmentErrExt{alignableMuon_->cscAlignmentErrorsExtended()};
814 
815  aligner.applyAlignments(muonDTGeometry_.get(), dtAlignments.get(),
816  dtAlignmentErrExt.get(), AlignTransform());
817  aligner.applyAlignments(muonCSCGeometry_.get(), cscAlignments.get(),
818  cscAlignmentErrExt.get(), AlignTransform());
819  }
820 }
821 
822 
823 //------------------------------------------------------------------------------
824 void
826 {
827 
828  // Get Survey Rcds and add Survey Info
829  if ( doTracker_ && useSurvey_ ){
830  bool tkSurveyBool = watchTkSurveyRcd_.check(iSetup);
831  bool tkSurveyErrBool = watchTkSurveyErrExtRcd_.check(iSetup);
832  edm::LogInfo("Alignment") << "watcher tksurveyrcd: " << tkSurveyBool;
833  edm::LogInfo("Alignment") << "watcher tksurveyerrrcd: " << tkSurveyErrBool;
834  if ( tkSurveyBool || tkSurveyErrBool){
835 
836  edm::LogInfo("Alignment") << "ADDING THE SURVEY INFORMATION";
838  edm::ESHandle<SurveyErrors> surveyErrors;
839 
840  iSetup.get<TrackerSurveyRcd>().get(surveys);
841  iSetup.get<TrackerSurveyErrorExtendedRcd>().get(surveyErrors);
842 
843  surveyIndex_ = 0;
844  surveyValues_ = &*surveys;
845  surveyErrors_ = &*surveyErrors;
847  }
848  }
849 
850  if ( doMuon_ && useSurvey_) {
851  bool DTSurveyBool = watchTkSurveyRcd_.check(iSetup);
852  bool DTSurveyErrBool = watchTkSurveyErrExtRcd_.check(iSetup);
853  bool CSCSurveyBool = watchTkSurveyRcd_.check(iSetup);
854  bool CSCSurveyErrBool = watchTkSurveyErrExtRcd_.check(iSetup);
855 
856  if ( DTSurveyBool || DTSurveyErrBool || CSCSurveyBool || CSCSurveyErrBool ){
857  edm::ESHandle<Alignments> dtSurveys;
858  edm::ESHandle<SurveyErrors> dtSurveyErrors;
859  edm::ESHandle<Alignments> cscSurveys;
860  edm::ESHandle<SurveyErrors> cscSurveyErrors;
861 
862  iSetup.get<DTSurveyRcd>().get(dtSurveys);
863  iSetup.get<DTSurveyErrorExtendedRcd>().get(dtSurveyErrors);
864  iSetup.get<CSCSurveyRcd>().get(cscSurveys);
865  iSetup.get<CSCSurveyErrorExtendedRcd>().get(cscSurveyErrors);
866 
867  surveyIndex_ = 0;
868  surveyValues_ = &*dtSurveys;
869  surveyErrors_ = &*dtSurveyErrors;
870  const auto& barrels = alignableMuon_->DTBarrel();
871  for (const auto& barrel: barrels) addSurveyInfo(barrel);
872 
873  surveyIndex_ = 0;
874  surveyValues_ = &*cscSurveys;
875  surveyErrors_ = &*cscSurveyErrors;
876  const auto& endcaps = alignableMuon_->CSCEndcaps();
877  for (const auto& endcap: endcaps) addSurveyInfo(endcap);
878 
879  }
880  }
881 
882 }
883 
884 
885 //------------------------------------------------------------------------------
886 void
888 {
889  const auto& comps = ali->components();
890 
891  for (const auto& comp: comps) addSurveyInfo(comp);
892 
894 
895  if ( ali->id() != error.rawId() ||
896  ali->alignableObjectId() != error.structureType() )
897  {
898  throw cms::Exception("DatabaseError")
899  << "Error reading survey info from DB. Mismatched id!";
900  }
901 
902  const auto& pos = surveyValues_->m_align[surveyIndex_].translation();
903  const auto& rot = surveyValues_->m_align[surveyIndex_].rotation();
904 
905  AlignableSurface surf(align::PositionType(pos.x(), pos.y(), pos.z()),
906  align::RotationType(rot.xx(), rot.xy(), rot.xz(),
907  rot.yx(), rot.yy(), rot.yz(),
908  rot.zx(), rot.zy(), rot.zz()));
909 
910  surf.setWidth(ali->surface().width());
911  surf.setLength(ali->surface().length());
912 
913  ali->setSurvey(new SurveyDet(surf, error.matrix()));
914 
915  ++surveyIndex_;
916 }
917 
918 
919 //------------------------------------------------------------------------------
920 bool
922 {
923 
924  for (const auto& monitor: monitors_) monitor->endOfJob();
925 
926  if (alignmentAlgo_->processesEvents() && nevent_ == 0) {
927  return false;
928  }
929 
931  if (alignmentAlgo_->storeAlignments()) storeAlignmentsToDB();
932  } else {
933  edm::LogInfo("Alignment")
934  << "@SUB=AlignmentProducerBase::finish"
935  << "No payload to be stored!";
936  }
937 
938  // takes care of storing output of calibrations, but needs to be called only
939  // after 'storeAlignmentsToDB()'
940  for (const auto& iCal:calibrations_) iCal->endOfJob();
941 
942  return true;
943 }
944 
945 
946 //------------------------------------------------------------------------------
947 void
949 {
950  const auto runRangeSelectionVPSet =
951  config_.getParameterSetVector("RunRangeSelection");
952 
953  // handle PCL use case
954  const auto& uniqueRunRanges =
955  (runAtPCL_ ?
956  align::makeUniqueRunRanges(runRangeSelectionVPSet, firstRun_) :
958 
959  std::vector<AlgebraicVector> beamSpotParameters;
960 
961  for (const auto& iRunRange: uniqueRunRanges) {
962 
963  alignmentAlgo_->setParametersForRunRange(iRunRange);
964 
965  // Save alignments to database
967  writeForRunRange(iRunRange.first);
968  }
969 
970  // Deal with extra alignables, e.g. beam spot
971  if (alignableExtras_) {
972  auto& alis = alignableExtras_->beamSpot();
973  if (!alis.empty()) {
974  auto beamSpotAliPars =
975  dynamic_cast<BeamSpotAlignmentParameters*>(alis[0]->alignmentParameters());
976  if (!beamSpotAliPars) {
977  throw cms::Exception("LogicError")
978  << "@SUB=AlignmentProducerBase::storeAlignmentsToDB\n"
979  << "First alignable of alignableExtras_ does not have "
980  << "'BeamSpotAlignmentParameters', while it should have.";
981  }
982 
983  beamSpotParameters.push_back(beamSpotAliPars->parameters());
984  }
985  }
986  }
987 
988  if (alignableExtras_) {
989  std::ostringstream bsOutput;
990 
991  auto itPar = beamSpotParameters.cbegin();
992  for (auto iRunRange = uniqueRunRanges.cbegin();
993  iRunRange != uniqueRunRanges.cend();
994  ++iRunRange, ++itPar) {
995  bsOutput << "Run range: " << (*iRunRange).first << " - " << (*iRunRange).second << "\n";
996  bsOutput << " Displacement: x=" << (*itPar)[0] << ", y=" << (*itPar)[1] << "\n";
997  bsOutput << " Slope: dx/dz=" << (*itPar)[2] << ", dy/dz=" << (*itPar)[3] << "\n";
998  }
999 
1000  edm::LogInfo("Alignment")
1001  << "@SUB=AlignmentProducerBase::storeAlignmentsToDB"
1002  << "Parameters for alignable beamspot:\n" << bsOutput.str();
1003  }
1004 }
1005 
1006 
1007 //------------------------------------------------------------------------------
1008 void
1010 {
1011  if (doTracker_) { // first tracker
1012  const AlignTransform* trackerGlobal{nullptr}; // will be 'removed' from constants
1013  if (globalPositions_) { // i.e. applied before in applyDB
1016  }
1017 
1018  auto alignments = alignableTracker_->alignments();
1019  auto alignmentErrors = alignableTracker_->alignmentErrors();
1020  this->writeDB(alignments, "TrackerAlignmentRcd",
1021  alignmentErrors, "TrackerAlignmentErrorExtendedRcd", trackerGlobal,
1022  time);
1023 
1024  // Save surface deformations to database
1025  if (saveDeformationsToDB_) {
1026  auto alignmentSurfaceDeformations = alignableTracker_->surfaceDeformations();
1027  this->writeDB(alignmentSurfaceDeformations, "TrackerSurfaceDeformationRcd", time);
1028  }
1029  }
1030 
1031  if (doMuon_) { // now muon
1032  const AlignTransform* muonGlobal{nullptr}; // will be 'removed' from constants
1033  if (globalPositions_) { // i.e. applied before in applyDB
1035  DetId(DetId::Muon));
1036  }
1037  // Get alignments+errors, first DT - ownership taken over by writeDB(..), so no delete
1038  auto alignments = alignableMuon_->dtAlignments();
1039  auto alignmentErrors = alignableMuon_->dtAlignmentErrorsExtended();
1040  this->writeDB(alignments, "DTAlignmentRcd",
1041  alignmentErrors, "DTAlignmentErrorExtendedRcd", muonGlobal,
1042  time);
1043 
1044  // Get alignments+errors, now CSC - ownership taken over by writeDB(..), so no delete
1045  alignments = alignableMuon_->cscAlignments();
1046  alignmentErrors = alignableMuon_->cscAlignmentErrorsExtended();
1047  this->writeDB(alignments, "CSCAlignmentRcd",
1048  alignmentErrors, "CSCAlignmentErrorExtendedRcd", muonGlobal,
1049  time);
1050  }
1051 }
1052 
1053 
1054 //------------------------------------------------------------------------------
1056  const std::string& alignRcd,
1057  AlignmentErrorsExtended* alignmentErrors,
1058  const std::string& errRcd,
1059  const AlignTransform* globalCoordinates,
1060  cond::Time_t time) const
1061 {
1062  Alignments* tempAlignments = alignments;
1063  AlignmentErrorsExtended* tempAlignmentErrorsExtended = alignmentErrors;
1064 
1065  // Call service
1067  if (!poolDb.isAvailable()) { // Die if not available
1068  delete tempAlignments; // promised to take over ownership...
1069  delete tempAlignmentErrorsExtended; // dito
1070  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
1071  }
1072 
1073  if (globalCoordinates // happens only if (applyDbAlignment_ == true)
1074  && globalCoordinates->transform() != AlignTransform::Transform::Identity) {
1075 
1076  tempAlignments = new Alignments(); // temporary storage for
1077  tempAlignmentErrorsExtended = new AlignmentErrorsExtended(); // final alignments and errors
1078 
1079  GeometryAligner aligner;
1080  aligner.removeGlobalTransform(alignments, alignmentErrors,
1081  *globalCoordinates,
1082  tempAlignments, tempAlignmentErrorsExtended);
1083 
1084  delete alignments; // have to delete original alignments
1085  delete alignmentErrors; // same thing for the errors
1086 
1087  edm::LogInfo("Alignment")
1088  << "@SUB=AlignmentProducerBase::writeDB"
1089  << "globalCoordinates removed from alignments (" << alignRcd
1090  << ") and errors (" << alignRcd << ").";
1091  }
1092 
1093  if (saveToDB_) {
1094  edm::LogInfo("Alignment") << "Writing Alignments for run " << time
1095  << " to " << alignRcd << ".";
1096  poolDb->writeOne<Alignments>(tempAlignments, time, alignRcd);
1097  } else { // poolDb->writeOne(..) takes over 'alignments' ownership,...
1098  delete tempAlignments; // ...otherwise we have to delete, as promised!
1099  }
1100 
1101  if (saveApeToDB_) {
1102  edm::LogInfo("Alignment") << "Writing AlignmentErrorsExtended for run " << time
1103  << " to " << errRcd << ".";
1104  poolDb->writeOne<AlignmentErrorsExtended>(tempAlignmentErrorsExtended, time, errRcd);
1105  } else { // poolDb->writeOne(..) takes over 'alignmentErrors' ownership,...
1106  delete tempAlignmentErrorsExtended; // ...otherwise we have to delete, as promised!
1107  }
1108 }
1109 
1110 
1111 //------------------------------------------------------------------------------
1113  const std::string& surfaceDeformationRcd,
1114  cond::Time_t time) const
1115 {
1116  // Call service
1118  if (!poolDb.isAvailable()) { // Die if not available
1119  delete alignmentSurfaceDeformations; // promised to take over ownership...
1120  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
1121  }
1122 
1123  if (saveDeformationsToDB_) {
1124  edm::LogInfo("Alignment") << "Writing AlignmentSurfaceDeformations for run " << time
1125  << " to " << surfaceDeformationRcd << ".";
1126  poolDb->writeOne<AlignmentSurfaceDeformations>(alignmentSurfaceDeformations, time,
1127  surfaceDeformationRcd);
1128  } else { // poolDb->writeOne(..) takes over 'surfaceDeformation' ownership,...
1129  delete alignmentSurfaceDeformations; // ...otherwise we have to delete, as promised!
1130  }
1131 }
1132 
1133 
1134 //------------------------------------------------------------------------------
1135 template<typename T>
1136 bool
1138  const std::string& name)
1139 {
1140  try {
1141  config.getParameter<T>(name);
1142  } catch (const edm::Exception& e) {
1144  if (e.message().find("MissingParameter") != std::string::npos) {
1145  return false;
1146  } else {
1147  throw;
1148  }
1149  } else {
1150  throw;
1151  }
1152  }
1153 
1154  return true;
1155 }
Code categoryCode() const
Definition: EDMException.h:95
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
align::Scalar width() const
T getParameter(std::string const &) const
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:189
double z0() const
z coordinate
Definition: BeamSpot.h:68
T getUntrackedParameter(std::string const &, T const &) const
VParameterSet const & getParameterSetVector(std::string const &name) const
const edm::InputTag tjTkAssociationMapTag_
Map with tracks/trajectories.
void readInSurveyRcds(const edm::EventSetup &)
Reads in survey records.
void applyAlignmentsToDB(const edm::EventSetup &)
void createGeometries(const edm::EventSetup &, const TrackerTopology *)
Creates ideal geometry from IdealGeometryRecord.
void writeDB(Alignments *, const std::string &, AlignmentErrorsExtended *, const std::string &, const AlignTransform *, cond::Time_t) const
RunID const & id() const
Definition: RunBase.h:39
std::shared_ptr< CSCGeometry > muonCSCGeometry_
Builds a scenario from configuration and applies it to the alignable Muon.
Alignment producer base class.
RunNumber_t run() const
Definition: RunID.h:39
def create(alignables, pedeDump, additionalData, outputFile, config)
edm::ESWatcher< DTAlignmentErrorExtendedRcd > watchDTAlErrExtRcd_
void update(const DTGeometry *, const CSCGeometry *)
const_iterator end() const
last iterator over the map (read only)
edm::ESWatcher< DTAlignmentRcd > watchDTAlRcd_
Time_t beginValue
Definition: Time.h:45
Class to update a given geometry with a set of alignments.
bool processEvent(const edm::Event &, const edm::EventSetup &)
Process event.
void initAlignmentAlgorithm(const edm::EventSetup &, bool update=false)
void terminateProcessing(const edm::EventSetup *=0)
Terminate processing of events.
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
ErrorMatrix matrix() const
Definition: SurveyError.h:76
AlignableExtras * alignableExtras_
AlignmentProducerBase(const edm::ParameterSet &)
void update(const TrackerGeometry *, const TrackerTopology *)
align::Alignables DTBarrel()
selection
main part
Definition: corrVsCorr.py:98
void buildParameterStore()
Creates the , which manages all Alignables.
#define noexcept
virtual bool getAliClusterValueMap(const edm::Event &, edm::Handle< AliClusterValueMap > &)=0
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
std::string message() const
Definition: Exception.cc:187
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
virtual ~AlignmentProducerBase()(false)
const Alignments * surveyValues_
void setWidth(align::Scalar width)
Definition: config.py:1
TRandom random
Definition: MVATrainer.cc:138
virtual const Alignables & components() const =0
Return vector of all direct components.
uint8_t structureType() const
Definition: SurveyError.h:66
AlignmentParameterStore * alignmentParameterStore_
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
std::string encode() const
Definition: InputTag.cc:166
virtual bool getTkFittedLasBeamCollection(const edm::Run &, edm::Handle< TkFittedLasBeamCollection > &)=0
define event information passed to algorithms
std::shared_ptr< TrackerGeometry > trackerGeometry_
void setLength(align::Scalar length)
edm::ESWatcher< GlobalPositionRcd > watchGlobalPositionRcd_
virtual bool getTsosVectorCollection(const edm::Run &, edm::Handle< TsosVectorCollection > &)=0
double dydz() const
dydz slope
Definition: BeamSpot.h:84
void writeForRunRange(cond::Time_t)
std::vector< ConstTrajTrackPair > ConstTrajTrackPairs
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
unsigned long long Time_t
Definition: Time.h:16
align::Alignables CSCEndcaps()
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
RunRanges makeUniqueRunRanges(const edm::VParameterSet &runRanges, const RunNumber &defaultRun)
Definition: Utilities.cc:263
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
const edm::InputTag beamSpotTag_
BeamSpot.
void removeGlobalTransform(const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates, Alignments *newAlignments, AlignmentErrorsExtended *newAlignmentErrorsExtended)
edm::ESWatcher< TrackerSurveyErrorExtendedRcd > watchTkSurveyErrExtRcd_
void endRunImpl(const edm::Run &, const edm::EventSetup &)
end run
void addSurveyInfo(Alignable *)
Adds survey info to an Alignable.
bool isAvailable() const
Definition: Service.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void endLuminosityBlockImpl(const edm::LuminosityBlock &, const edm::EventSetup &)
end lumi block
align::ID rawId() const
Definition: SurveyError.h:71
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void createAlignables(const TrackerTopology *, bool update=false)
AlignmentSurfaceDeformations * surfaceDeformations() const
Return surface deformations, sorted by DetId.
Definition: Alignable.cc:263
std::unique_ptr< const Alignments > globalPositions_
GlobalPositions that might be read from DB, nullptr otherwise.
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
void initializeBeamSpot(double x, double y, double z, double dxdz, double dydz)
Initialize the alignable beam spot with the given parameters.
bool hasParameter(const edm::ParameterSet &, const std::string &name)
void startProcessing()
Start processing of events.
edm::ESWatcher< IdealGeometryRecord > watchIdealGeometryRcd_
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
virtual bool getBeamSpot(const edm::Event &, edm::Handle< reco::BeamSpot > &)=0
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
edm::ESWatcher< CSCAlignmentErrorExtendedRcd > watchCSCAlErrExtRcd_
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: DetId.h:18
edm::ESWatcher< TrackerSurfaceDeformationRcd > watchTrackerSurDeRcd_
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
AlgebraicVector EulerAngles
Definition: Definitions.h:36
align::Scalar length() const
Transform transform() const
AlignableTracker * alignableTracker_
edm::Handle< reco::BeamSpot > beamSpot_
ParameterSet const & getParameterSet(std::string const &) const
void applyMisalignment()
Applies misalignment scenario to .
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:343
const T & get() const
Definition: EventSetup.h:59
void build(std::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
const align::RunRanges uniqueRunRanges_
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
void storeAlignmentsToDB()
Writes Alignments (i.e. Records) to database-file.
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
virtual bool getTrajTrackAssociationCollection(const edm::Event &, edm::Handle< TrajTrackAssociationCollection > &)=0
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
std::shared_ptr< DTGeometry > muonDTGeometry_
edm::ESWatcher< TrackerAlignmentRcd > watchTrackerAlRcd_
void applyScenario(const edm::ParameterSet &scenario) override
Apply misalignment scenario to the tracker.
void beginLuminosityBlockImpl(const edm::LuminosityBlock &, const edm::EventSetup &)
begin lumi block
edm::ESWatcher< TrackerAlignmentErrorExtendedRcd > watchTrackerAlErrorExtRcd_
bool setupChanged(const edm::EventSetup &)
Checks if one of the EventSetup-Records has changed.
Alignments * alignments() const override
Return alignments, sorted by DetId.
#define update(a, b)
edm::ESWatcher< TrackerSurveyRcd > watchTkSurveyRcd_
void build(std::shared_ptr< DTGeometry > theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
AlignmentErrorsExtended * alignmentErrors() const override
Return alignment errors, sorted by DetId.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:42
void createCalibrations()
Creates the calibrations.
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
double y0() const
y coordinate
Definition: BeamSpot.h:66
static unsigned int const shift
void createAlignmentAlgorithm()
Creates the choosen alignment algorithm.
edm::ESWatcher< CSCAlignmentRcd > watchCSCAlRcd_
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
const edm::InputTag tkLasBeamTag_
LAS beams in edm::Run (ignore if empty)
const SurveyErrors * surveyErrors_
void initBeamSpot(const edm::Event &)
Initializes Beamspot of Alignables .
void applyScenario(const edm::ParameterSet &scenario) override
Apply misalignment scenario to the Muon.
const_iterator begin() const
first iterator over the map (read only)
eventInfo
add run, event number and lumi section
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:23
long double T
Builds a scenario from configuration and applies it to the alignable tracker.
void beginRunImpl(const edm::Run &, const edm::EventSetup &)
begin run
const edm::InputTag clusterValueMapTag_
ValueMap containing associtaion cluster-flag.
T const * product() const
Definition: ESHandle.h:86
void simpleMisalignment(const align::Alignables &, const std::string &, float, float, bool)
Applies misalignment scenario to .
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
def move(src, dest)
Definition: eostools.py:510
T get(const Candidate &c)
Definition: component.h:55
const align::Alignables & alignables(void) const
get all alignables
void applyDB(G *, const edm::EventSetup &, const AlignTransform &) const
Definition: event.py:1
Definition: Run.h:43
cond::RealTimeType< cond::runnumber >::type RunNumber
Definition: Utilities.h:38
std::unique_ptr< AlignmentAlgorithmBase > alignmentAlgo_
double x0() const
x coordinate
Definition: BeamSpot.h:64
void createMonitors()
Creates the monitors.