CMS 3D CMS Logo

PCLTrackerAlProducer.cc
Go to the documentation of this file.
1 
11 /*** Header file ***/
12 #include "PCLTrackerAlProducer.h"
13 
14 /*** Core framework functionality ***/
15 
21 
26 
27 /*** Alignment ***/
40 
41 /*** Geometry ***/
43 
46 
56 
57 
58 
59 //_____________________________________________________________________________
62  theAlignmentAlgo(0),
63  theAlignmentParameterStore(0),
64  theTrackerAlignables(0),
65  theMuonAlignables(0),
66  theExtraAlignables(0),
67  globalPositions_(0),
68 
69  /* Steering parameters */
70  theParameterSet(config),
71  stNFixAlignables_ (config.getParameter<int> ("nFixAlignables")),
72  stRandomShift_ (config.getParameter<double> ("randomShift")),
73  stRandomRotation_ (config.getParameter<double> ("randomRotation")),
74  applyDbAlignment_ (config.getUntrackedParameter<bool>("applyDbAlignment")),
75  checkDbAlignmentValidity_(config.getUntrackedParameter<bool>("checkDbAlignmentValidity")),
76  doMisalignmentScenario_ (config.getParameter<bool> ("doMisalignmentScenario")),
77  saveToDB_ (config.getParameter<bool> ("saveToDB")),
78  saveApeToDB_ (config.getParameter<bool> ("saveApeToDB")),
79  saveDeformationsToDB_ (config.getParameter<bool> ("saveDeformationsToDB")),
80  doTracker_ (config.getUntrackedParameter<bool>("doTracker") ),
81  doMuon_ (config.getUntrackedParameter<bool>("doMuon") ),
82  useExtras_ (config.getUntrackedParameter<bool>("useExtras")),
83  useSurvey_ (config.getParameter<bool> ("useSurvey")),
84  enableAlignableUpdates_ (config.getParameter<bool> ("enableAlignableUpdates")),
85 
86  /* Event input tags */
87  tjTkAssociationMapTag_ (config.getParameter<edm::InputTag>("tjTkAssociationMapTag")),
88  beamSpotTag_ (config.getParameter<edm::InputTag>("beamSpotTag")),
89  tkLasBeamTag_ (config.getParameter<edm::InputTag>("tkLasBeamTag")),
90  clusterValueMapTag_ (config.getParameter<edm::InputTag>("hitPrescaleMapTag")),
91  theFirstRun (cond::timeTypeSpecs[cond::runnumber].endValue)
92 {
93 
94  tjTkAssociationMapToken = consumes<TrajTrackAssociationCollection>(tjTkAssociationMapTag_);
95  beamSpotToken = consumes<reco::BeamSpot>(beamSpotTag_);
96  tkLasBeamToken = consumes<TkFittedLasBeamCollection>(tkLasBeamTag_);
97  tsosVectorToken = consumes<TsosVectorCollection>(tkLasBeamTag_);
98  clusterValueMapToken = consumes<AliClusterValueMap>(clusterValueMapTag_);
99 
100 
101  createAlignmentAlgorithm(config);
102  createCalibrations (config);
103  createMonitors (config);
104 }
105 
106 //_____________________________________________________________________________
109 {
110  delete theAlignmentAlgo;
111 
112  for (auto iCal = theCalibrations.begin();
113  iCal != theCalibrations.end();
114  ++iCal) {
115  delete *iCal;
116  }
117 
118  // TODO: Delete monitors as well?
119 
120  delete theAlignmentParameterStore;
121  delete theTrackerAlignables;
122  delete theMuonAlignables;
123  delete theExtraAlignables;
124  delete globalPositions_;
125 }
126 
127 
128 
129 //=============================================================================
130 //=== INTERFACE IMPLEMENTATION ===
131 //=============================================================================
132 
133 //_____________________________________________________________________________
136 {
137  nevent_ = 0;
138 
139  for (auto iCal = theCalibrations.begin();
140  iCal != theCalibrations.end();
141  ++iCal) {
142  (*iCal)->beginOfJob(theTrackerAlignables,
143  theMuonAlignables,
144  theExtraAlignables);
145  }
146 
147  for (auto monitor = theMonitors.begin();
148  monitor != theMonitors.end();
149  ++monitor) {
150  (*monitor)->beginOfJob(theTrackerAlignables,
151  theMuonAlignables,
152  theAlignmentParameterStore);
153  }
154 }
155 
156 //_____________________________________________________________________________
159 {
160  finish();
161 
162  for (auto monitor = theMonitors.begin();
163  monitor != theMonitors.end();
164  ++monitor) {
165  (*monitor)->endOfJob();
166  }
167 
168  for (auto iCal = theCalibrations.begin();
169  iCal != theCalibrations.end();
170  ++iCal) {
171  (*iCal)->endOfJob();
172  }
173 }
174 
175 //_____________________________________________________________________________
178 {
179  const bool changed{setupChanged(setup)};
180  if (changed) {
181  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::beginRun"
182  << "EventSetup-Record changed.";
183  initAlignmentAlgorithm(setup);
184  }
185 
186  theAlignmentAlgo->beginRun(run, setup, changed);
187 
188  if (setupChanged(setup)) {
189  initAlignmentAlgorithm(setup);
190  }
191 
192  //store the first run analyzed to be used for setting the IOV
193  if(theFirstRun > (cond::Time_t) run.id().run()) {
194  theFirstRun = (cond::Time_t) run.id().run();
195  }
196 
197 
198 }
199 
200 //_____________________________________________________________________________
203 {
204  // TODO: Either MP nor HIP is implementing the endRun() method... so this
205  // seems to be useless?
206 
207  if (tkLasBeamTag_.encode().size()) {
210  run.getByToken(tkLasBeamToken, lasBeams);
211  run.getByToken(tsosVectorToken, tsoses);
212 
213  theAlignmentAlgo->endRun(EndRunInfo(run.id(), &(*lasBeams),
214  &(*tsoses)), setup);
215  } else {
216  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::endRun"
217  << "No Tk LAS beams to forward to algorithm.";
218  theAlignmentAlgo->endRun(EndRunInfo(run.id(), 0, 0), setup);
219  }
220 }
221 
222 //_____________________________________________________________________________
225  const edm::EventSetup& setup)
226 {
227  // Do not forward edm::LuminosityBlock
228  theAlignmentAlgo->beginLuminosityBlock(setup);
229 }
230 
231 //_____________________________________________________________________________
234  const edm::EventSetup& setup)
235 {
236  // Do not forward edm::LuminosityBlock
237  theAlignmentAlgo->endLuminosityBlock(setup);
238 }
239 
240 //_____________________________________________________________________________
243 {
244  if (!theAlignmentAlgo->processesEvents()) {
245  edm::LogWarning("BadConfig") << "@SUB=PCLTrackerAlProducer::analyze"
246  << "Skipping event. The current configuration "
247  << "of the alignment algorithm does not need "
248  << "to process any events.";
249  return;
250  }
251 
252  if (setupChanged(setup)) {
253  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::analyze"
254  << "EventSetup-Record changed.";
255  initAlignmentAlgorithm(setup);
256  }
257 
258  if (nevent_== 0 && theExtraAlignables) {
259  initBeamSpot(event);
260  }
261 
262  ++nevent_;
263 
264  // reading in survey records
265  readInSurveyRcds(setup);
266 
267  // Retrieve trajectories and tracks from the event
268  // -> merely skip if collection is empty
269  edm::Handle<TrajTrackAssociationCollection> handleTrajTracksCollection;
270 
271  if (event.getByToken(tjTkAssociationMapToken, handleTrajTracksCollection)) {
272  // Form pairs of trajectories and tracks
273  ConstTrajTrackPairs trajTracks;
274  for (auto iter = handleTrajTracksCollection->begin();
275  iter != handleTrajTracksCollection->end();
276  ++iter) {
277  trajTracks.push_back(ConstTrajTrackPair(&(*(*iter).key), &(*(*iter).val)));
278  }
279 
280  //check that the input tag is not empty
281  const AliClusterValueMap* clusterValueMapPtr = 0;
282  if (clusterValueMapTag_.encode().size()) {
283  edm::Handle<AliClusterValueMap> clusterValueMap;
284  event.getByToken(clusterValueMapToken, clusterValueMap);
285  clusterValueMapPtr = &(*clusterValueMap);
286  }
287 
288  const EventInfo eventInfo(event.id(),
289  trajTracks,
290  *theBeamSpot,
291  clusterValueMapPtr);
292 
293  // Run the alignment algorithm with its input
294  theAlignmentAlgo->run(setup, eventInfo);
295 
296  for (auto monitor = theMonitors.begin();
297  monitor != theMonitors.end();
298  ++monitor) {
299  (*monitor)->duringLoop(event, setup, trajTracks); // forward eventInfo?
300  }
301 
302  } else {
303  edm::LogError("Alignment") << "@SUB=PCLTrackerAlProducer::analyze"
304  << "No track collection found: skipping event";
305  }
306 }
307 
308 
309 
310 //=============================================================================
311 //=== PRIVATE METHOD IMPLEMENTATION ===
312 //=============================================================================
313 
314 /*** Code which is independent of Event & Setup
315  Called from constructor ***/
316 
317 //_____________________________________________________________________________
320 {
322  edm::VParameterSet iovSelection = config.getParameter<edm::VParameterSet>("RunRangeSelection");
323  algoConfig.addUntrackedParameter<edm::VParameterSet>("RunRangeSelection", iovSelection);
324 
325  // provide required parameters while keeping current functionality for PCL:
326  algoConfig.addUntrackedParameter<align::RunNumber>("firstIOV", 1);
327  algoConfig.addUntrackedParameter<bool>("enableAlignableUpdates",
328  enableAlignableUpdates_);
329 
330  std::string algoName = algoConfig.getParameter<std::string>("algoName");
331  theAlignmentAlgo = AlignmentAlgorithmPluginFactory::get()->create(algoName, algoConfig);
332 
333  if (!theAlignmentAlgo) {
334  throw cms::Exception("BadConfig")
335  << "Couldn't find the called alignment algorithm: " << algoName;
336  }
337 }
338 
339 //_____________________________________________________________________________
342 {
344  std::vector<std::string> monitors = monitorConfig.getUntrackedParameter<std::vector<std::string>>("monitors");
345 
346  for (auto miter = monitors.begin();
347  miter != monitors.end();
348  ++miter) {
350  *miter, monitorConfig.getUntrackedParameter<edm::ParameterSet>(*miter)
351  );
352 
353  if (!newMonitor) {
354  throw cms::Exception("BadConfig") << "Couldn't find monitor named "
355  << *miter;
356  }
357 
358  theMonitors.push_back(newMonitor);
359  }
360 }
361 
362 //_____________________________________________________________________________
365 {
367 
368  for (auto iCalib = calibrations.begin();
369  iCalib != calibrations.end();
370  ++iCalib) {
371  theCalibrations.push_back(
373  iCalib->getParameter<std::string>("calibrationName"), *iCalib
374  )
375  );
376  }
377 
378  // Not all algorithms support calibrations - so do not pass empty vector
379  // and throw if non-empty and not supported:
380  if (!theCalibrations.empty()) {
381  if (theAlignmentAlgo->supportsCalibrations()) {
382  theAlignmentAlgo->addCalibrations(theCalibrations);
383 
384  } else {
385  throw cms::Exception("BadConfig")
386  << "[TrackerAlignmentProducerForPCL::init]\n"
387  << "Configured " << theCalibrations.size() << " calibration(s) "
388  << "for algorithm not supporting it.";
389  }
390  }
391 }
392 
393 
394 
395 /*** Code which is dependent of Event & Setup
396  Called and checked for each Event ***/
397 
398 //_____________________________________________________________________________
401 {
402  bool changed = false;
403 
404  if (watchIdealGeometryRcd.check(setup)) {
405  changed = true;
406  }
407 
408  if (watchGlobalPositionRcd.check(setup)) {
409  changed = true;
410  }
411 
412  if (doTracker_) {
413  if (watchTrackerAlRcd.check(setup)) {
414  changed = true;
415  }
416 
417  if (watchTrackerAlErrorExtRcd.check(setup)) {
418  changed = true;
419  }
420 
421  if (watchTrackerSurDeRcd.check(setup)) {
422  changed = true;
423  }
424  }
425 
426  if (doMuon_) {
427  if (watchDTAlRcd.check(setup)) {
428  changed = true;
429  }
430 
431  if (watchDTAlErrExtRcd.check(setup)) {
432  changed = true;
433  }
434 
435  if (watchCSCAlRcd.check(setup)) {
436  changed = true;
437  }
438 
439  if (watchCSCAlErrExtRcd.check(setup)) {
440  changed = true;
441  }
442  }
443 
444  /* TODO: ExtraAlignables: Which record(s) to check?
445  *
446  if (useExtras_) {}
447  */
448 
449  return changed;
450 }
451 
452 //_____________________________________________________________________________
455 {
456  // Retrieve tracker topology from geometry
457  edm::ESHandle<TrackerTopology> tTopoHandle;
458  setup.get<TrackerTopologyRcd>().get(tTopoHandle);
459  const TrackerTopology* const tTopo = tTopoHandle.product();
460 
461  // Create the geometries from the ideal geometries (first time only)
462  //std::shared_ptr<TrackingGeometry> theTrackerGeometry;
463  createGeometries(setup, tTopo);
464 
465  applyAlignmentsToDB(setup);
466  createAlignables(tTopo);
467  buildParameterStore();
468  applyMisalignment();
469 
470  // Initialize alignment algorithm and integrated calibration and pass the
471  // latter to algorithm
472  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::initAlignmentAlgorithm"
473  << "Initializing alignment algorithm.";
474  theAlignmentAlgo->initialize(setup,
475  theTrackerAlignables,
476  theMuonAlignables,
477  theExtraAlignables,
478  theAlignmentParameterStore);
479 
480  applyAlignmentsToGeometry();
481 }
482 
483 //_____________________________________________________________________________
486 {
487  event.getByToken(beamSpotToken, theBeamSpot);
488 
489  if (theExtraAlignables) {
490  edm::LogInfo("Alignment") << "@SUB=TrackerAlignmentProducerForPCL::initBeamSpot"
491  << "Initializing AlignableBeamSpot";
492 
493  theExtraAlignables->initializeBeamSpot(theBeamSpot->x0(),
494  theBeamSpot->y0(),
495  theBeamSpot->z0(),
496  theBeamSpot->dxdz(),
497  theBeamSpot->dydz());
498  }
499 }
500 
501 //_____________________________________________________________________________
504 {
505  if (doTracker_) {
506  edm::ESHandle<GeometricDet> geometricDet;
507  setup.get<IdealGeometryRecord>().get(geometricDet);
508 
509  TrackerGeomBuilderFromGeometricDet trackerBuilder;
510 
512  setup.get<PTrackerParametersRcd>().get( ptp );
513 
514  theTrackerGeometry = std::shared_ptr<TrackerGeometry>(
515  trackerBuilder.build(&(*geometricDet), *ptp, tTopo )
516  );
517  }
518 
519  if (doMuon_) {
522 
523  setup.get<IdealGeometryRecord>().get(cpv);
524  setup.get<MuonNumberingRecord>().get(mdc);
525 
526  theMuonDTGeometry = std::make_shared<DTGeometry>();
527  theMuonCSCGeometry = std::make_shared<CSCGeometry>();
528 
529  DTGeometryBuilderFromDDD DTGeometryBuilder;
531  DTGeometryBuilder.build (theMuonDTGeometry, &(*cpv), *mdc);
532  CSCGeometryBuilder.build(theMuonCSCGeometry, &(*cpv), *mdc);
533  }
534 }
535 
536 //_____________________________________________________________________________
539 {
540  // Retrieve and apply alignments, if requested (requires z setup)
541  if (applyDbAlignment_) {
542  // we need GlobalPositionRcd - and have to keep track for later removal
543  // before writing again to DB...
544 
545  edm::ESHandle<Alignments> globalAlignments;
546  setup.get<GlobalPositionRcd>().get(globalAlignments);
547  globalPositions_ = new Alignments(*globalAlignments);
548 
549  if (doTracker_) {
550  applyDB<TrackerGeometry,
553  &(*theTrackerGeometry),
554  setup,
556  );
557 
558  applyDB<TrackerGeometry,
560  &(*theTrackerGeometry),
561  setup
562  );
563  }
564 
565  if (doMuon_) {
566  applyDB<DTGeometry,
569  &(*theMuonDTGeometry),
570  setup,
571  align::DetectorGlobalPosition(*globalPositions_, DetId(DetId::Muon))
572  );
573 
574  applyDB<CSCGeometry,
577  &(*theMuonCSCGeometry),
578  setup,
579  align::DetectorGlobalPosition(*globalPositions_, DetId(DetId::Muon))
580  );
581  }
582  }
583 }
584 
585 //_____________________________________________________________________________
588 {
589  if (doTracker_) {
590  theTrackerAlignables = new AlignableTracker(&(*theTrackerGeometry), tTopo);
591  }
592 
593  if (doMuon_) {
594  theMuonAlignables = new AlignableMuon(&(*theMuonDTGeometry), &(*theMuonCSCGeometry));
595  }
596 
597  if (useExtras_) {
598  theExtraAlignables = new AlignableExtras();
599  }
600 }
601 
602 //_____________________________________________________________________________
605 {
606  // Create alignment parameter builder
607  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::buildParameterStore"
608  << "Creating AlignmentParameterBuilder";
609 
610  edm::ParameterSet alParamBuildCfg = theParameterSet.getParameter<edm::ParameterSet>("ParameterBuilder");
611  edm::ParameterSet alParamStoreCfg = theParameterSet.getParameter<edm::ParameterSet>("ParameterStore");
612 
613  AlignmentParameterBuilder alignmentParameterBuilder(theTrackerAlignables,
614  theMuonAlignables,
615  theExtraAlignables,
616  alParamBuildCfg);
617 
618  // Fix alignables if requested
619  if (stNFixAlignables_ > 0) {
620  alignmentParameterBuilder.fixAlignables(stNFixAlignables_);
621  }
622 
623  // Get list of alignables
624  Alignables theAlignables = alignmentParameterBuilder.alignables();
625  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::buildParameterStore"
626  << "got " << theAlignables.size() << " alignables";
627 
628  // Create AlignmentParameterStore
629  theAlignmentParameterStore = new AlignmentParameterStore(theAlignables, alParamStoreCfg);
630  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::buildParameterStore"
631  << "AlignmentParameterStore created!";
632 }
633 
634 //_____________________________________________________________________________
637 {
638  // Apply misalignment scenario to alignable tracker and muon if requested
639  // WARNING: this assumes scenarioConfig can be passed to both muon and tracker
640 
641  if (doMisalignmentScenario_ && (doTracker_ || doMuon_)) {
642  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::beginOfJob"
643  << "Applying misalignment scenario to "
644  << (doTracker_ ? "tracker" : "")
645  << (doMuon_ ? (doTracker_ ? " and muon" : "muon") : ".");
646  edm::ParameterSet scenarioConfig = theParameterSet.getParameter<edm::ParameterSet>("MisalignmentScenario");
647 
648  if (doTracker_) {
649  TrackerScenarioBuilder scenarioBuilder(theTrackerAlignables);
650  scenarioBuilder.applyScenario(scenarioConfig);
651  }
652  if (doMuon_) {
653  MuonScenarioBuilder muonScenarioBuilder(theMuonAlignables);
654  muonScenarioBuilder.applyScenario(scenarioConfig);
655  }
656 
657  } else {
658  edm::LogInfo("Alignment") << "@SUB=TrackerAlignmentProducerForPCL::beginOfJob"
659  << "NOT applying misalignment scenario!";
660  }
661 
662  // Apply simple misalignment
663  const std::string sParSel(theParameterSet.getParameter<std::string>("parameterSelectorSimple"));
664  //simpleMisalignment(theAlignables, sParSel, stRandomShift_, stRandomRotation_, true);
665  simpleMisalignment(theAlignmentParameterStore->alignables(), sParSel, stRandomShift_, stRandomRotation_, true);
666 }
667 
668 //_____________________________________________________________________________
671  float shift, float rot, bool local)
672 {
673  std::ostringstream output; // collecting output
674 
675  if (shift > 0. || rot > 0.) {
676  output << "Adding random flat shift of max size " << shift
677  << " and adding random flat rotation of max size " << rot <<" to ";
678 
679  std::vector<bool> commSel(0);
680  if (selection != "-1") {
681  AlignmentParameterSelector aSelector(0,0); // no alignable needed here...
682  const std::vector<char> cSel(aSelector.convertParamSel(selection));
683 
684  if (cSel.size() < RigidBodyAlignmentParameters::N_PARAM) {
685  throw cms::Exception("BadConfig")
686  << "[PCLTrackerAlProducer::simpleMisalignment_]\n"
687  << "Expect selection string '" << selection << "' to be at least of length "
688  << RigidBodyAlignmentParameters::N_PARAM << " or to be '-1'.\n"
689  << "(Most probably you have to adjust the parameter 'parameterSelectorSimple'.)";
690  }
691 
692  for (auto cIter = cSel.begin();
693  cIter != cSel.end();
694  ++cIter) {
695  commSel.push_back(*cIter == '0' ? false : true);
696  }
697  output << "parameters defined by (" << selection
698  << "), representing (x,y,z,alpha,beta,gamma),";
699 
700  } else {
701  output << "the active parameters of each alignable,";
702  }
703  output << " in " << (local ? "local" : "global") << " frame.";
704 
705  for (auto it = alivec.begin();
706  it != alivec.end();
707  ++it) {
708  Alignable* ali = (*it);
709  std::vector<bool> mysel(commSel.empty() ? ali->alignmentParameters()->selector() : commSel);
710 
711  if (std::abs(shift)>0.00001) {
712  double s0 = 0., s1 = 0., s2 = 0.;
713 
714  if (mysel[RigidBodyAlignmentParameters::dx]) s0 = shift * double(random()%1000-500)/500.;
715  if (mysel[RigidBodyAlignmentParameters::dy]) s1 = shift * double(random()%1000-500)/500.;
716  if (mysel[RigidBodyAlignmentParameters::dz]) s2 = shift * double(random()%1000-500)/500.;
717 
718  if (local) ali->move( ali->surface().toGlobal(align::LocalVector(s0,s1,s2)) );
719  else ali->move( align::GlobalVector(s0,s1,s2) );
720 
721  //AlignmentPositionError ape(dx,dy,dz);
722  //ali->addAlignmentPositionError(ape);
723  }
724 
725  if (std::abs(rot)>0.00001) {
727  if (mysel[RigidBodyAlignmentParameters::dalpha]) r(1)=rot*double(random()%1000-500)/500.;
728  if (mysel[RigidBodyAlignmentParameters::dbeta]) r(2)=rot*double(random()%1000-500)/500.;
729  if (mysel[RigidBodyAlignmentParameters::dgamma]) r(3)=rot*double(random()%1000-500)/500.;
730 
731  const align::RotationType mrot = align::toMatrix(r);
732  if (local) ali->rotateInLocalFrame(mrot);
733  else ali->rotateInGlobalFrame(mrot);
734  //ali->addAlignmentPositionErrorFromRotation(mrot);
735  }
736  }
737 
738  } else {
739  output << "No simple misalignment added!";
740  }
741 
742  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::simpleMisalignment_" << output.str();
743 }
744 
745 //_____________________________________________________________________________
748 {
749  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::startingNewLoop"
750  << "Now physically apply alignments to geometry...";
751 
752  // Propagate changes to reconstruction geometry (from initialisation or iteration)
753  GeometryAligner aligner;
754 
755  if (doTracker_) {
756  std::auto_ptr<Alignments> alignments( theTrackerAlignables->alignments());
757  std::auto_ptr<AlignmentErrorsExtended> alignmentErrExt(theTrackerAlignables->alignmentErrors());
758  std::auto_ptr<AlignmentSurfaceDeformations> aliDeforms( theTrackerAlignables->surfaceDeformations());
759 
761  &(*theTrackerGeometry),
762  &(*alignments),
763  &(*alignmentErrExt),
765  ); // don't apply global a second time!
766 
768  &(*theTrackerGeometry),
769  &(*aliDeforms)
770  );
771  }
772 
773  if (doMuon_) {
774  std::auto_ptr<Alignments> dtAlignments( theMuonAlignables->dtAlignments());
775  std::auto_ptr<Alignments> cscAlignments(theMuonAlignables->cscAlignments());
776 
777  std::auto_ptr<AlignmentErrorsExtended> dtAlignmentErrExt(
778  theMuonAlignables->dtAlignmentErrorsExtended()
779  );
780  std::auto_ptr<AlignmentErrorsExtended> cscAlignmentErrExt(
781  theMuonAlignables->cscAlignmentErrorsExtended()
782  );
783 
784  aligner.applyAlignments<DTGeometry>(
785  &(*theMuonDTGeometry),
786  &(*dtAlignments),
787  &(*dtAlignmentErrExt),
789  ); // don't apply global a second time!
790 
791  aligner.applyAlignments<CSCGeometry>(
792  &(*theMuonCSCGeometry),
793  &(*cscAlignments),
794  &(*cscAlignmentErrExt),
796  ); // nope!
797  }
798 }
799 
800 //_____________________________________________________________________________
801 template<class G, class Rcd, class ErrRcd>
804  const AlignTransform& globalCoordinates) const
805 {
806  // 'G' is the geometry class for that DB should be applied,
807  // 'Rcd' is the record class for its Alignments
808  // 'ErrRcd' is the record class for its AlignmentErrorsExtended
809  // 'globalCoordinates' are global transformation for this geometry
810 
811  const Rcd& record = setup.get<Rcd>();
812  if (checkDbAlignmentValidity_) {
813  const edm::ValidityInterval & validity = record.validityInterval();
814  const edm::IOVSyncValue first = validity.first();
815  const edm::IOVSyncValue last = validity.last();
816 
817  if (first != edm::IOVSyncValue::beginOfTime() ||
818  last != edm::IOVSyncValue::endOfTime()) {
819  throw cms::Exception("DatabaseError")
820  << "@SUB=PCLTrackerAlProducer::applyDB"
821  << "\nTrying to apply " << record.key().name()
822  << " with multiple IOVs in tag.\nValidity range is "
823  << first.eventID().run() << " - " << last.eventID().run();
824  }
825  }
826 
827  edm::ESHandle<Alignments> alignments;
828  record.get(alignments);
829 
831  setup.get<ErrRcd>().get(alignmentErrExt);
832 
833  GeometryAligner aligner;
834  aligner.applyAlignments<G>(geometry, &(*alignments), &(*alignmentErrExt),
835  globalCoordinates);
836 }
837 
838 //_____________________________________________________________________________
839 template<class G, class DeformationRcd>
842 {
843  // 'G' is the geometry class for that DB should be applied,
844  // 'DeformationRcd' is the record class for its surface deformations
845 
846  const DeformationRcd & record = setup.get<DeformationRcd>();
847  if (checkDbAlignmentValidity_) {
848  const edm::ValidityInterval & validity = record.validityInterval();
849  const edm::IOVSyncValue first = validity.first();
850  const edm::IOVSyncValue last = validity.last();
851 
852  if (first != edm::IOVSyncValue::beginOfTime() ||
853  last != edm::IOVSyncValue::endOfTime()) {
854  throw cms::Exception("DatabaseError")
855  << "@SUB=PCLTrackerAlProducer::applyDB"
856  << "\nTrying to apply " << record.key().name()
857  << " with multiple IOVs in tag.\nValidity range is "
858  << first.eventID().run() << " - " << last.eventID().run();
859  }
860  }
862  record.get(surfaceDeformations);
863 
864  GeometryAligner aligner;
865  aligner.attachSurfaceDeformations<G>(geometry, &(*surfaceDeformations));
866 }
867 
868 //_____________________________________________________________________________
871 {
872 
873  // Get Survey Rcds and add Survey Info
874  if (doTracker_ && useSurvey_) {
875  bool tkSurveyBool = watchTkSurveyRcd.check(setup);
876  bool tkSurveyErrBool = watchTkSurveyErrExtRcd.check(setup);
877 
878  if (tkSurveyBool || tkSurveyErrBool) {
880  edm::ESHandle<SurveyErrors> surveyErrors;
881  setup.get<TrackerSurveyRcd>(). get(surveys);
882  setup.get<TrackerSurveyErrorExtendedRcd>().get(surveyErrors);
883 
884  theSurveyIndex = 0;
885  theSurveyValues = &(*surveys);
886  theSurveyErrors = &(*surveyErrors);
887 
888  addSurveyInfo(theTrackerAlignables);
889  }
890  }
891 
892  if (doMuon_ && useSurvey_) {
893  bool DTSurveyBool = watchTkSurveyRcd.check(setup);
894  bool DTSurveyErrBool = watchTkSurveyErrExtRcd.check(setup);
895  bool CSCSurveyBool = watchTkSurveyRcd.check(setup);
896  bool CSCSurveyErrBool = watchTkSurveyErrExtRcd.check(setup);
897 
898  if (DTSurveyBool || DTSurveyErrBool || CSCSurveyBool || CSCSurveyErrBool) {
899  edm::ESHandle<Alignments> dtSurveys;
900  edm::ESHandle<SurveyErrors> dtSurveyErrors;
901  edm::ESHandle<Alignments> cscSurveys;
902  edm::ESHandle<SurveyErrors> cscSurveyErrors;
903  setup.get<DTSurveyRcd>(). get(dtSurveys);
904  setup.get<DTSurveyErrorExtendedRcd>(). get(dtSurveyErrors);
905  setup.get<CSCSurveyRcd>(). get(cscSurveys);
906  setup.get<CSCSurveyErrorExtendedRcd>().get(cscSurveyErrors);
907 
908  theSurveyIndex = 0;
909  theSurveyValues = &(*dtSurveys);
910  theSurveyErrors = &(*dtSurveyErrors);
911 
912  Alignables barrels = theMuonAlignables->DTBarrel();
913  for (auto iter = barrels.begin();
914  iter != barrels.end();
915  ++iter) {
916  addSurveyInfo(*iter);
917  }
918 
919  theSurveyIndex = 0;
920  theSurveyValues = &(*cscSurveys);
921  theSurveyErrors = &(*cscSurveyErrors);
922 
923  Alignables endcaps = theMuonAlignables->CSCEndcaps();
924  for (auto iter = endcaps.begin();
925  iter != endcaps.end();
926  ++iter) {
927  addSurveyInfo(*iter);
928  }
929  }
930  }
931 
932 }
933 
934 //_____________________________________________________________________________
937 {
938  edm::LogInfo("Alignment") << "ADDING THE SURVEY INFORMATION";
939 
940  const std::vector<Alignable*>& comp = alignable->components();
941  for (size_t i = 0; i < comp.size(); ++i) {
942  addSurveyInfo(comp[i]);
943  }
944 
945  const SurveyError& error = theSurveyErrors->m_surveyErrors[theSurveyIndex];
946 
947  if (alignable->id() != error.rawId() ||
948  alignable->alignableObjectId() != error.structureType()) {
949  throw cms::Exception("DatabaseError")
950  << "Error reading survey info from DB. Mismatched id!";
951  }
952 
953  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[theSurveyIndex].translation();
954  const CLHEP::HepRotation& rot = theSurveyValues->m_align[theSurveyIndex].rotation();
955 
956  AlignableSurface surf(align::PositionType(pos.x(), pos.y(), pos.z()),
957  align::RotationType(rot.xx(), rot.xy(), rot.xz(),
958  rot.yx(), rot.yy(), rot.yz(),
959  rot.zx(), rot.zy(), rot.zz()));
960  surf.setWidth (alignable->surface().width());
961  surf.setLength(alignable->surface().length());
962 
963  alignable->setSurvey(new SurveyDet(surf, error.matrix()));
964 
965  ++theSurveyIndex;
966 }
967 
968 
969 
970 /*** Code for writing results to database
971  Called from endJob() ***/
972 
973 //_____________________________________________________________________________
976 {
977  if (theAlignmentAlgo->processesEvents() && nevent_ == 0) {
978  edm::LogError("Alignment") << "@SUB=PCLTrackerAlProducer::finish"
979  << "Did not process any events, stop "
980  << "without terminating algorithm.";
981  return;
982  }
983 
984  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::finish"
985  << "Terminating algorithm.";
986  theAlignmentAlgo->terminate();
987 
988  if (saveToDB_ || saveApeToDB_ || saveDeformationsToDB_) {
989  // if this is not the harvesting step there is no reason to look for the
990  // PEDE log and res files and to call the storeAlignmentsToDB method
991  if (theAlignmentAlgo->storeAlignments()) {
992  storeAlignmentsToDB();
993  }
994  } else {
995  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::finish"
996  << "no payload to be stored!";
997 
998  }
999 }
1000 
1001 //_____________________________________________________________________________
1004 {
1005  if (theAlignmentAlgo->processesEvents() && nevent_ == 0) {
1006  // TODO: If this is the case, it would be already caught in finish()
1007  edm::LogError("Alignment") << "@SUB=PCLTrackerAlProducer::endOfJob"
1008  << "Did not process any events in last loop, "
1009  << "do not dare to store to DB.";
1010  } else {
1011  // Expand run ranges and make them unique
1012  const auto runRangeSelectionVPSet =
1013  theParameterSet.getParameter<edm::VParameterSet>("RunRangeSelection");
1014  align::RunRanges uniqueRunRanges
1015  (align::makeUniqueRunRanges(runRangeSelectionVPSet, theFirstRun));
1016 
1017  std::vector<AlgebraicVector> beamSpotParameters;
1018 
1019  for (auto iRunRange = uniqueRunRanges.begin();
1020  iRunRange != uniqueRunRanges.end();
1021  ++iRunRange) {
1022 
1023  theAlignmentAlgo->setParametersForRunRange(*iRunRange);
1024 
1025  // Save alignments to database
1026  if (saveToDB_ || saveApeToDB_ || saveDeformationsToDB_) {
1027  writeForRunRange((*iRunRange).first);
1028  }
1029 
1030  // Deal with extra alignables, e.g. beam spot
1031  if (theExtraAlignables) {
1032  Alignables &alis = theExtraAlignables->beamSpot();
1033  if (!alis.empty()) {
1034  BeamSpotAlignmentParameters *beamSpotAliPars = dynamic_cast<BeamSpotAlignmentParameters*>(alis[0]->alignmentParameters());
1035  beamSpotParameters.push_back(beamSpotAliPars->parameters());
1036  }
1037  }
1038  }
1039 
1040  if (theExtraAlignables) {
1041  std::ostringstream bsOutput;
1042 
1043  auto itPar = beamSpotParameters.begin();
1044  for (auto iRunRange = uniqueRunRanges.begin();
1045  iRunRange != uniqueRunRanges.end();
1046  ++iRunRange, ++itPar) {
1047  bsOutput << "Run range: " << (*iRunRange).first << " - " << (*iRunRange).second << "\n";
1048  bsOutput << " Displacement: x=" << (*itPar)[0] << ", y=" << (*itPar)[1] << "\n";
1049  bsOutput << " Slope: dx/dz=" << (*itPar)[2] << ", dy/dz=" << (*itPar)[3] << "\n";
1050  }
1051 
1052  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::endOfJob"
1053  << "Parameters for alignable beamspot:\n"
1054  << bsOutput.str();
1055  }
1056  }
1057 }
1058 
1059 //_____________________________________________________________________________
1062 {
1063  // first tracker
1064  if (doTracker_) {
1065  const AlignTransform* trackerGlobal = 0; // will be 'removed' from constants
1066  if (globalPositions_) { // i.e. applied before in applyDB
1067  trackerGlobal = &align::DetectorGlobalPosition(*globalPositions_,
1069  }
1070 
1071  // theTrackerAlignables->alignments calls new
1072  Alignments* alignments = theTrackerAlignables->alignments();
1073  AlignmentErrorsExtended* alignmentErrExt = theTrackerAlignables->alignmentErrors();
1074 
1075  writeDB(alignments, "TrackerAlignmentRcd",
1076  alignmentErrExt, "TrackerAlignmentErrorExtendedRcd",
1077  trackerGlobal,
1078  time);
1079  }
1080 
1081  // Save surface deformations to database
1082  if (doTracker_ && saveDeformationsToDB_) {
1083  AlignmentSurfaceDeformations* alignmentSurfaceDeformations = theTrackerAlignables->surfaceDeformations();
1084  writeDB(alignmentSurfaceDeformations, "TrackerSurfaceDeformationRcd", time);
1085  }
1086 
1087  // now muon
1088  if (doMuon_) {
1089  const AlignTransform* muonGlobal = 0; // will be 'removed' from constants
1090  if (globalPositions_) { // i.e. applied before in applyDB
1091  muonGlobal = &align::DetectorGlobalPosition(*globalPositions_,
1092  DetId(DetId::Muon));
1093  }
1094 
1095  // Get alignments+errors, first DT - ownership taken over by writeDB(..), so no delete
1096  Alignments* alignments = theMuonAlignables->dtAlignments();
1097  AlignmentErrorsExtended* alignmentErrExt = theMuonAlignables->dtAlignmentErrorsExtended();
1098 
1099  writeDB(alignments, "DTAlignmentRcd",
1100  alignmentErrExt, "DTAlignmentErrorExtendedRcd",
1101  muonGlobal,
1102  time);
1103 
1104  // Get alignments+errors, now CSC - ownership taken over by writeDB(..), so no delete
1105  alignments = theMuonAlignables->cscAlignments();
1106  alignmentErrExt = theMuonAlignables->cscAlignmentErrorsExtended();
1107 
1108  writeDB(alignments, "CSCAlignmentRcd",
1109  alignmentErrExt, "CSCAlignmentErrorExtendedRcd",
1110  muonGlobal,
1111  time);
1112  }
1113 }
1114 
1115 //_____________________________________________________________________________
1117 ::writeDB(Alignments* alignments, const std::string &alignRcd,
1118  AlignmentErrorsExtended* alignmentErrExt, const std::string &errRcd,
1119  const AlignTransform *globalCoordinates,
1120  cond::Time_t time) const
1121 {
1122  Alignments* tempAlignments = alignments;
1123  AlignmentErrorsExtended* tempAlignmentErrExt = alignmentErrExt;
1124 
1125  // Call service
1127  if (!poolDb.isAvailable()) { // Die if not available
1128  delete tempAlignments; // promised to take over ownership...
1129  delete tempAlignmentErrExt; // dito
1130 
1131  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
1132  }
1133 
1134  if (globalCoordinates && // happens only if (applyDbAlignment_ == true)
1135  globalCoordinates->transform() != AlignTransform::Transform::Identity) {
1136 
1137  tempAlignments = new Alignments(); // temporary storage for
1138  tempAlignmentErrExt = new AlignmentErrorsExtended(); // final alignments and errors
1139 
1140  GeometryAligner aligner;
1141  aligner.removeGlobalTransform(alignments, alignmentErrExt,
1142  *globalCoordinates,
1143  tempAlignments, tempAlignmentErrExt);
1144 
1145  delete alignments; // have to delete original alignments
1146  delete alignmentErrExt; // same thing for the errors
1147 
1148  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::writeDB"
1149  << "globalCoordinates removed from alignments ("
1150  << alignRcd << ") and errors (" << alignRcd << ").";
1151  }
1152 
1153  if (saveToDB_) {
1154  edm::LogInfo("Alignment") << "Writing Alignments for run " << time
1155  << " to " << alignRcd << ".";
1156  poolDb->writeOne<Alignments>(tempAlignments, time, alignRcd);
1157 
1158  } else {
1159  // poolDb->writeOne(..) takes over 'alignments' ownership, ...
1160  delete tempAlignments; // ...otherwise we have to delete, as promised!
1161  }
1162 
1163  if (saveApeToDB_) {
1164  edm::LogInfo("Alignment") << "Writing AlignmentErrorsExtended for run "
1165  << time << " to " << errRcd << ".";
1166  poolDb->writeOne<AlignmentErrorsExtended>(tempAlignmentErrExt, time, errRcd);
1167 
1168  } else {
1169  // poolDb->writeOne(..) takes over 'alignmentErrors' ownership, ...
1170  delete tempAlignmentErrExt; // ...otherwise we have to delete, as promised!
1171  }
1172 }
1173 
1174 //_____________________________________________________________________________
1176 ::writeDB(AlignmentSurfaceDeformations* alignmentSurfaceDeformations,
1177  const std::string &surfaceDeformationRcd,
1178  cond::Time_t time) const
1179 {
1180  // Call service
1182  if (!poolDb.isAvailable()) { // Die if not available
1183  delete alignmentSurfaceDeformations; // promised to take over ownership...
1184  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
1185  }
1186 
1187  if (saveDeformationsToDB_) {
1188  edm::LogInfo("Alignment") << "Writing AlignmentSurfaceDeformations for run "
1189  << time << " to " << surfaceDeformationRcd << ".";
1190  poolDb->writeOne<AlignmentSurfaceDeformations>(alignmentSurfaceDeformations, time,
1191  surfaceDeformationRcd);
1192 
1193  } else {
1194  // poolDb->writeOne(..) takes over 'surfaceDeformation' ownership,...
1195  delete alignmentSurfaceDeformations; // ...otherwise we have to delete, as promised!
1196  }
1197 }
1198 
1199 
1200 
RunNumber_t run() const
Definition: EventID.h:39
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
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void buildParameterStore()
Creates the , which manages all Alignables.
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:139
void createCalibrations(const edm::ParameterSet &)
Creates the calibrations (specified in config-file)
RunID const & id() const
Definition: RunBase.h:39
Builds a scenario from configuration and applies it to the alignable Muon.
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
RunNumber_t run() const
Definition: RunID.h:39
def create(alignables, pedeDump, additionalData, outputFile, config)
const EventID & eventID() const
Definition: IOVSyncValue.h:42
const_iterator end() const
last iterator over the map (read only)
Class to update a given geometry with a set of alignments.
void applyMisalignment()
Applies misalignment scenario to .
JetCorrectorParameters::Record record
Definition: classes.h:7
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
ErrorMatrix matrix() const
Definition: SurveyError.h:76
void writeDB(Alignments *, const std::string &, AlignmentErrorsExtended *, const std::string &, const AlignTransform *, cond::Time_t) const
std::vector< RunRange > RunRanges
Definition: Utilities.h:39
void storeAlignmentsToDB()
Writes Alignments (i.e. Records) to database-file.
Tracker-AlignmentProducer for Prompt Calibration Loop (PCL)
selection
main part
Definition: corrVsCorr.py:98
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
void setWidth(align::Scalar width)
Definition: config.py:1
TRandom random
Definition: MVATrainer.cc:138
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
void applyAlignmentsToDB(const edm::EventSetup &)
uint8_t structureType() const
Definition: SurveyError.h:66
void applyDB(G *, const edm::EventSetup &, const AlignTransform &) const
virtual ~PCLTrackerAlProducer()
Destructor.
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:61
define event information passed to algorithms
const IOVSyncValue & last() const
void setLength(align::Scalar length)
const AlgebraicVector & parameters(void) const
Get alignment parameters.
void createMonitors(const edm::ParameterSet &)
Creates the monitors (specified in config-file)
std::vector< ConstTrajTrackPair > ConstTrajTrackPairs
unsigned long long Time_t
Definition: Time.h:16
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
static const IOVSyncValue & beginOfTime()
virtual Alignables components() const =0
Return vector of all direct components.
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
virtual void endJob() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Run.h:240
RunRanges makeUniqueRunRanges(const edm::VParameterSet &runRanges, const RunNumber &defaultRun)
Definition: Utilities.cc:263
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
void simpleMisalignment(const Alignables &, const std::string &, float, float, bool)
Applies misalignment scenario to .
void removeGlobalTransform(const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates, Alignments *newAlignments, AlignmentErrorsExtended *newAlignmentErrorsExtended)
bool isAvailable() const
Definition: Service.h:46
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
align::ID rawId() const
Definition: SurveyError.h:71
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the tracker.
void readInSurveyRcds(const edm::EventSetup &)
Reads in survey records.
bool setupChanged(const edm::EventSetup &)
Checks if one of the EventSetup-Records has changed.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
virtual void beginJob() override
Definition: DetId.h:18
void createGeometries(const edm::EventSetup &, const TrackerTopology *)
Creates ideal geometry from IdealGeometryRecord.
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
virtual void endRun(const edm::Run &, const edm::EventSetup &) override
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:208
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:356
const T & get() const
Definition: EventSetup.h:56
void build(std::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
ESHandle< TrackerGeometry > geometry
edm::EventID id() const
Definition: EventBase.h:58
Definition: plugin.cc:24
HLT enums.
void writeForRunRange(cond::Time_t)
void build(std::shared_ptr< CSCGeometry > theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:42
void addSurveyInfo(Alignable *)
Adds survey info to an Alignable.
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector<char>
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
void initBeamSpot(const edm::Event &)
Initializes Beamspot of Alignables .
static unsigned int const shift
void createAlignmentAlgorithm(const edm::ParameterSet &)
Creates the choosen alignment algorithm (specified in config-file)
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
const_iterator begin() const
first iterator over the map (read only)
eventInfo
add run, event number and lumi section
const IOVSyncValue & first() const
Builds a scenario from configuration and applies it to the alignable tracker.
void createAlignables(const TrackerTopology *const)
T const * product() const
Definition: ESHandle.h:86
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the Muon.
T get(const Candidate &c)
Definition: component.h:55
PCLTrackerAlProducer(const edm::ParameterSet &)
Constructor.
Definition: event.py:1
Definition: Run.h:42
cond::RealTimeType< cond::runnumber >::type RunNumber
Definition: Utilities.h:37
void initAlignmentAlgorithm(const edm::EventSetup &)