CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
53 
54 
55 
56 //_____________________________________________________________________________
59  theAlignmentAlgo(0),
60  theAlignmentParameterStore(0),
61  theTrackerAlignables(0),
62  theMuonAlignables(0),
63  theExtraAlignables(0),
64  globalPositions_(0),
65 
66  /* Steering parameters */
67  theParameterSet(config),
68  stNFixAlignables_ (config.getParameter<int> ("nFixAlignables")),
69  stRandomShift_ (config.getParameter<double> ("randomShift")),
70  stRandomRotation_ (config.getParameter<double> ("randomRotation")),
71  applyDbAlignment_ (config.getUntrackedParameter<bool>("applyDbAlignment")),
72  checkDbAlignmentValidity_(config.getUntrackedParameter<bool>("checkDbAlignmentValidity")),
73  doMisalignmentScenario_ (config.getParameter<bool> ("doMisalignmentScenario")),
74  saveToDB_ (config.getParameter<bool> ("saveToDB")),
75  saveApeToDB_ (config.getParameter<bool> ("saveApeToDB")),
76  saveDeformationsToDB_ (config.getParameter<bool> ("saveDeformationsToDB")),
77  doTracker_ (config.getUntrackedParameter<bool>("doTracker") ),
78  doMuon_ (config.getUntrackedParameter<bool>("doMuon") ),
79  useExtras_ (config.getUntrackedParameter<bool>("useExtras")),
80  useSurvey_ (config.getParameter<bool> ("useSurvey")),
81 
82  /* Event input tags */
83  tjTkAssociationMapTag_ (config.getParameter<edm::InputTag>("tjTkAssociationMapTag")),
84  beamSpotTag_ (config.getParameter<edm::InputTag>("beamSpotTag")),
85  tkLasBeamTag_ (config.getParameter<edm::InputTag>("tkLasBeamTag")),
86  clusterValueMapTag_ (config.getParameter<edm::InputTag>("hitPrescaleMapTag")),
87  theFirstRun (cond::timeTypeSpecs[cond::runnumber].endValue)
88 {
89  createAlignmentAlgorithm(config);
90  createCalibrations (config);
91  createMonitors (config);
92 }
93 
94 //_____________________________________________________________________________
97 {
98  delete theAlignmentAlgo;
99 
100  for (auto iCal = theCalibrations.begin();
101  iCal != theCalibrations.end();
102  ++iCal) {
103  delete *iCal;
104  }
105 
106  // TODO: Delete monitors as well?
107 
108  delete theAlignmentParameterStore;
109  delete theTrackerAlignables;
110  delete theMuonAlignables;
111  delete theExtraAlignables;
112  delete globalPositions_;
113 }
114 
115 
116 
117 //=============================================================================
118 //=== INTERFACE IMPLEMENTATION ===
119 //=============================================================================
120 
121 //_____________________________________________________________________________
124 {
125  nevent_ = 0;
126 
127  for (auto iCal = theCalibrations.begin();
128  iCal != theCalibrations.end();
129  ++iCal) {
130  (*iCal)->beginOfJob(theTrackerAlignables,
131  theMuonAlignables,
132  theExtraAlignables);
133  }
134 
135  for (auto monitor = theMonitors.begin();
136  monitor != theMonitors.end();
137  ++monitor) {
138  (*monitor)->beginOfJob(theTrackerAlignables,
139  theMuonAlignables,
140  theAlignmentParameterStore);
141  }
142 }
143 
144 //_____________________________________________________________________________
147 {
148  finish();
149 
150  for (auto monitor = theMonitors.begin();
151  monitor != theMonitors.end();
152  ++monitor) {
153  (*monitor)->endOfJob();
154  }
155 
156  for (auto iCal = theCalibrations.begin();
157  iCal != theCalibrations.end();
158  ++iCal) {
159  (*iCal)->endOfJob();
160  }
161 }
162 
163 //_____________________________________________________________________________
166 {
167  if (setupChanged(setup)) {
168  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::beginRun"
169  << "EventSetup-Record changed.";
170  initAlignmentAlgorithm(setup);
171  }
172 
173  // Do not forward edm::Run
174  theAlignmentAlgo->beginRun(setup);
175 
176  if (setupChanged(setup)) {
177  initAlignmentAlgorithm(setup);
178  }
179 
180  //store the first run analyzed to be used for setting the IOV
181  if(theFirstRun > (cond::Time_t) run.id().run()) {
182  theFirstRun = (cond::Time_t) run.id().run();
183  }
184 
185 
186 }
187 
188 //_____________________________________________________________________________
191 {
192  // TODO: Either MP nor HIP is implementing the endRun() method... so this
193  // seems to be useless?
194 
195  if (tkLasBeamTag_.encode().size()) {
198  run.getByLabel(tkLasBeamTag_, lasBeams);
199  run.getByLabel(tkLasBeamTag_, tsoses);
200 
201  theAlignmentAlgo->endRun(EndRunInfo(run.id(), &(*lasBeams),
202  &(*tsoses)), setup);
203  } else {
204  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::endRun"
205  << "No Tk LAS beams to forward to algorithm.";
206  theAlignmentAlgo->endRun(EndRunInfo(run.id(), 0, 0), setup);
207  }
208 }
209 
210 //_____________________________________________________________________________
213  const edm::EventSetup& setup)
214 {
215  // Do not forward edm::LuminosityBlock
216  theAlignmentAlgo->beginLuminosityBlock(setup);
217 }
218 
219 //_____________________________________________________________________________
222  const edm::EventSetup& setup)
223 {
224  // Do not forward edm::LuminosityBlock
225  theAlignmentAlgo->endLuminosityBlock(setup);
226 }
227 
228 //_____________________________________________________________________________
231 {
232  if (!theAlignmentAlgo->processesEvents()) {
233  edm::LogWarning("BadConfig") << "@SUB=PCLTrackerAlProducer::analyze"
234  << "Skipping event. The current configuration "
235  << "of the alignment algorithm does not need "
236  << "to process any events.";
237  return;
238  }
239 
240  if (setupChanged(setup)) {
241  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::analyze"
242  << "EventSetup-Record changed.";
243  initAlignmentAlgorithm(setup);
244  }
245 
246  if (nevent_== 0 && theExtraAlignables) {
247  initBeamSpot(event);
248  }
249 
250  ++nevent_;
251 
252  // reading in survey records
253  readInSurveyRcds(setup);
254 
255  // Retrieve trajectories and tracks from the event
256  // -> merely skip if collection is empty
257  edm::Handle<TrajTrackAssociationCollection> handleTrajTracksCollection;
258 
259  if (event.getByLabel(tjTkAssociationMapTag_, handleTrajTracksCollection)) {
260  // Form pairs of trajectories and tracks
261  ConstTrajTrackPairs trajTracks;
262  for (auto iter = handleTrajTracksCollection->begin();
263  iter != handleTrajTracksCollection->end();
264  ++iter) {
265  trajTracks.push_back(ConstTrajTrackPair(&(*(*iter).key), &(*(*iter).val)));
266  }
267 
268  //check that the input tag is not empty
269  const AliClusterValueMap* clusterValueMapPtr = 0;
270  if (clusterValueMapTag_.encode().size()) {
271  edm::Handle<AliClusterValueMap> clusterValueMap;
272  event.getByLabel(clusterValueMapTag_, clusterValueMap);
273  clusterValueMapPtr = &(*clusterValueMap);
274  }
275 
276  const EventInfo eventInfo(event.id(),
277  trajTracks,
278  *theBeamSpot,
279  clusterValueMapPtr);
280 
281  // Run the alignment algorithm with its input
282  theAlignmentAlgo->run(setup, eventInfo);
283 
284  for (auto monitor = theMonitors.begin();
285  monitor != theMonitors.end();
286  ++monitor) {
287  (*monitor)->duringLoop(event, setup, trajTracks); // forward eventInfo?
288  }
289 
290  } else {
291  edm::LogError("Alignment") << "@SUB=PCLTrackerAlProducer::analyze"
292  << "No track collection found: skipping event";
293  }
294 }
295 
296 
297 
298 //=============================================================================
299 //=== PRIVATE METHOD IMPLEMENTATION ===
300 //=============================================================================
301 
302 /*** Code which is independent of Event & Setup
303  Called from constructor ***/
304 
305 //_____________________________________________________________________________
308 {
309  edm::ParameterSet algoConfig = config.getParameter<edm::ParameterSet>("algoConfig");
310  edm::VParameterSet iovSelection = config.getParameter<edm::VParameterSet>("RunRangeSelection");
311  algoConfig.addUntrackedParameter<edm::VParameterSet>("RunRangeSelection", iovSelection);
312 
313  std::string algoName = algoConfig.getParameter<std::string>("algoName");
314  theAlignmentAlgo = AlignmentAlgorithmPluginFactory::get()->create(algoName, algoConfig);
315 
316  if (!theAlignmentAlgo) {
317  throw cms::Exception("BadConfig")
318  << "Couldn't find the called alignment algorithm: " << algoName;
319  }
320 }
321 
322 //_____________________________________________________________________________
325 {
326  edm::ParameterSet monitorConfig = config.getParameter<edm::ParameterSet>("monitorConfig");
327  std::vector<std::string> monitors = monitorConfig.getUntrackedParameter<std::vector<std::string>>("monitors");
328 
329  for (auto miter = monitors.begin();
330  miter != monitors.end();
331  ++miter) {
333  *miter, monitorConfig.getUntrackedParameter<edm::ParameterSet>(*miter)
334  );
335 
336  if (!newMonitor) {
337  throw cms::Exception("BadConfig") << "Couldn't find monitor named "
338  << *miter;
339  }
340 
341  theMonitors.push_back(newMonitor);
342  }
343 }
344 
345 //_____________________________________________________________________________
348 {
349  edm::VParameterSet calibrations = config.getParameter<edm::VParameterSet>("calibrations");
350 
351  for (auto iCalib = calibrations.begin();
352  iCalib != calibrations.end();
353  ++iCalib) {
354  theCalibrations.push_back(
356  iCalib->getParameter<std::string>("calibrationName"), *iCalib
357  )
358  );
359  }
360 
361  // Not all algorithms support calibrations - so do not pass empty vector
362  // and throw if non-empty and not supported:
363  if (!theCalibrations.empty()) {
364  if (theAlignmentAlgo->supportsCalibrations()) {
365  theAlignmentAlgo->addCalibrations(theCalibrations);
366 
367  } else {
368  throw cms::Exception("BadConfig")
369  << "[TrackerAlignmentProducerForPCL::init]\n"
370  << "Configured " << theCalibrations.size() << " calibration(s) "
371  << "for algorithm not supporting it.";
372  }
373  }
374 }
375 
376 
377 
378 /*** Code which is dependent of Event & Setup
379  Called and checked for each Event ***/
380 
381 //_____________________________________________________________________________
384 {
385  bool changed = false;
386 
387  if (watchIdealGeometryRcd.check(setup)) {
388  changed = true;
389  }
390 
391  if (watchGlobalPositionRcd.check(setup)) {
392  changed = true;
393  }
394 
395  if (doTracker_) {
396  if (watchTrackerAlRcd.check(setup)) {
397  changed = true;
398  }
399 
400  if (watchTrackerAlErrorExtRcd.check(setup)) {
401  changed = true;
402  }
403 
404  if (watchTrackerSurDeRcd.check(setup)) {
405  changed = true;
406  }
407  }
408 
409  if (doMuon_) {
410  if (watchDTAlRcd.check(setup)) {
411  changed = true;
412  }
413 
414  if (watchDTAlErrExtRcd.check(setup)) {
415  changed = true;
416  }
417 
418  if (watchCSCAlRcd.check(setup)) {
419  changed = true;
420  }
421 
422  if (watchCSCAlErrExtRcd.check(setup)) {
423  changed = true;
424  }
425  }
426 
427  /* TODO: ExtraAlignables: Which record(s) to check?
428  *
429  if (useExtras_) {}
430  */
431 
432  return changed;
433 }
434 
435 //_____________________________________________________________________________
438 {
439  // Retrieve tracker topology from geometry
440  edm::ESHandle<TrackerTopology> tTopoHandle;
441  setup.get<IdealGeometryRecord>().get(tTopoHandle);
442  const TrackerTopology* const tTopo = tTopoHandle.product();
443 
444  // Create the geometries from the ideal geometries (first time only)
445  //std::shared_ptr<TrackingGeometry> theTrackerGeometry;
446  createGeometries(setup);
447 
448  applyAlignmentsToDB(setup);
449  createAlignables(tTopo);
450  buildParameterStore();
451  applyMisalignment();
452 
453  // Initialize alignment algorithm and integrated calibration and pass the
454  // latter to algorithm
455  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::initAlignmentAlgorithm"
456  << "Initializing alignment algorithm.";
457  theAlignmentAlgo->initialize(setup,
458  theTrackerAlignables,
459  theMuonAlignables,
460  theExtraAlignables,
461  theAlignmentParameterStore);
462 
463  applyAlignmentsToGeometry();
464 }
465 
466 //_____________________________________________________________________________
469 {
470  event.getByLabel(beamSpotTag_, theBeamSpot);
471 
472  if (theExtraAlignables) {
473  edm::LogInfo("Alignment") << "@SUB=TrackerAlignmentProducerForPCL::initBeamSpot"
474  << "Initializing AlignableBeamSpot";
475 
476  theExtraAlignables->initializeBeamSpot(theBeamSpot->x0(),
477  theBeamSpot->y0(),
478  theBeamSpot->z0(),
479  theBeamSpot->dxdz(),
480  theBeamSpot->dydz());
481  }
482 }
483 
484 //_____________________________________________________________________________
487 {
488  if (doTracker_) {
489  edm::ESHandle<GeometricDet> geometricDet;
490  setup.get<IdealGeometryRecord>().get(geometricDet);
491 
492  TrackerGeomBuilderFromGeometricDet trackerBuilder;
493  theTrackerGeometry = boost::shared_ptr<TrackerGeometry>(
494  trackerBuilder.build(&(*geometricDet), theParameterSet)
495  );
496  }
497 
498  if (doMuon_) {
501 
502  setup.get<IdealGeometryRecord>().get(cpv);
503  setup.get<MuonNumberingRecord>().get(mdc);
504 
505  theMuonDTGeometry = boost::shared_ptr<DTGeometry> (new DTGeometry);
506  theMuonCSCGeometry = boost::shared_ptr<CSCGeometry>(new CSCGeometry);
507 
508  DTGeometryBuilderFromDDD DTGeometryBuilder;
510  DTGeometryBuilder.build (theMuonDTGeometry, &(*cpv), *mdc);
511  CSCGeometryBuilder.build(theMuonCSCGeometry, &(*cpv), *mdc);
512  }
513 }
514 
515 //_____________________________________________________________________________
518 {
519  // Retrieve and apply alignments, if requested (requires z setup)
520  if (applyDbAlignment_) {
521  // we need GlobalPositionRcd - and have to keep track for later removal
522  // before writing again to DB...
523 
524  edm::ESHandle<Alignments> globalAlignments;
525  setup.get<GlobalPositionRcd>().get(globalAlignments);
526  globalPositions_ = new Alignments(*globalAlignments);
527 
528  if (doTracker_) {
529  applyDB<TrackerGeometry,
532  &(*theTrackerGeometry),
533  setup,
535  );
536 
537  applyDB<TrackerGeometry,
539  &(*theTrackerGeometry),
540  setup
541  );
542  }
543 
544  if (doMuon_) {
545  applyDB<DTGeometry,
548  &(*theMuonDTGeometry),
549  setup,
550  align::DetectorGlobalPosition(*globalPositions_, DetId(DetId::Muon))
551  );
552 
553  applyDB<CSCGeometry,
556  &(*theMuonCSCGeometry),
557  setup,
558  align::DetectorGlobalPosition(*globalPositions_, DetId(DetId::Muon))
559  );
560  }
561  }
562 }
563 
564 //_____________________________________________________________________________
567 {
568  if (doTracker_) {
569  theTrackerAlignables = new AlignableTracker(&(*theTrackerGeometry), tTopo);
570  }
571 
572  if (doMuon_) {
573  theMuonAlignables = new AlignableMuon(&(*theMuonDTGeometry), &(*theMuonCSCGeometry));
574  }
575 
576  if (useExtras_) {
577  theExtraAlignables = new AlignableExtras();
578  }
579 }
580 
581 //_____________________________________________________________________________
584 {
585  // Create alignment parameter builder
586  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::buildParameterStore"
587  << "Creating AlignmentParameterBuilder";
588 
589  edm::ParameterSet alParamBuildCfg = theParameterSet.getParameter<edm::ParameterSet>("ParameterBuilder");
590  edm::ParameterSet alParamStoreCfg = theParameterSet.getParameter<edm::ParameterSet>("ParameterStore");
591 
592  AlignmentParameterBuilder alignmentParameterBuilder(theTrackerAlignables,
593  theMuonAlignables,
594  theExtraAlignables,
595  alParamBuildCfg);
596 
597  // Fix alignables if requested
598  if (stNFixAlignables_ > 0) {
599  alignmentParameterBuilder.fixAlignables(stNFixAlignables_);
600  }
601 
602  // Get list of alignables
603  Alignables theAlignables = alignmentParameterBuilder.alignables();
604  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::buildParameterStore"
605  << "got " << theAlignables.size() << " alignables";
606 
607  // Create AlignmentParameterStore
608  theAlignmentParameterStore = new AlignmentParameterStore(theAlignables, alParamStoreCfg);
609  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::buildParameterStore"
610  << "AlignmentParameterStore created!";
611 }
612 
613 //_____________________________________________________________________________
616 {
617  // Apply misalignment scenario to alignable tracker and muon if requested
618  // WARNING: this assumes scenarioConfig can be passed to both muon and tracker
619 
620  if (doMisalignmentScenario_ && (doTracker_ || doMuon_)) {
621  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::beginOfJob"
622  << "Applying misalignment scenario to "
623  << (doTracker_ ? "tracker" : "")
624  << (doMuon_ ? (doTracker_ ? " and muon" : "muon") : ".");
625  edm::ParameterSet scenarioConfig = theParameterSet.getParameter<edm::ParameterSet>("MisalignmentScenario");
626 
627  if (doTracker_) {
628  TrackerScenarioBuilder scenarioBuilder(theTrackerAlignables);
629  scenarioBuilder.applyScenario(scenarioConfig);
630  }
631  if (doMuon_) {
632  MuonScenarioBuilder muonScenarioBuilder(theMuonAlignables);
633  muonScenarioBuilder.applyScenario(scenarioConfig);
634  }
635 
636  } else {
637  edm::LogInfo("Alignment") << "@SUB=TrackerAlignmentProducerForPCL::beginOfJob"
638  << "NOT applying misalignment scenario!";
639  }
640 
641  // Apply simple misalignment
642  const std::string sParSel(theParameterSet.getParameter<std::string>("parameterSelectorSimple"));
643  //simpleMisalignment(theAlignables, sParSel, stRandomShift_, stRandomRotation_, true);
644  simpleMisalignment(theAlignmentParameterStore->alignables(), sParSel, stRandomShift_, stRandomRotation_, true);
645 }
646 
647 //_____________________________________________________________________________
650  float shift, float rot, bool local)
651 {
652  std::ostringstream output; // collecting output
653 
654  if (shift > 0. || rot > 0.) {
655  output << "Adding random flat shift of max size " << shift
656  << " and adding random flat rotation of max size " << rot <<" to ";
657 
658  std::vector<bool> commSel(0);
659  if (selection != "-1") {
660  AlignmentParameterSelector aSelector(0,0); // no alignable needed here...
661  const std::vector<char> cSel(aSelector.convertParamSel(selection));
662 
663  if (cSel.size() < RigidBodyAlignmentParameters::N_PARAM) {
664  throw cms::Exception("BadConfig")
665  << "[PCLTrackerAlProducer::simpleMisalignment_]\n"
666  << "Expect selection string '" << selection << "' to be at least of length "
667  << RigidBodyAlignmentParameters::N_PARAM << " or to be '-1'.\n"
668  << "(Most probably you have to adjust the parameter 'parameterSelectorSimple'.)";
669  }
670 
671  for (auto cIter = cSel.begin();
672  cIter != cSel.end();
673  ++cIter) {
674  commSel.push_back(*cIter == '0' ? false : true);
675  }
676  output << "parameters defined by (" << selection
677  << "), representing (x,y,z,alpha,beta,gamma),";
678 
679  } else {
680  output << "the active parameters of each alignable,";
681  }
682  output << " in " << (local ? "local" : "global") << " frame.";
683 
684  for (auto it = alivec.begin();
685  it != alivec.end();
686  ++it) {
687  Alignable* ali = (*it);
688  std::vector<bool> mysel(commSel.empty() ? ali->alignmentParameters()->selector() : commSel);
689 
690  if (std::abs(shift)>0.00001) {
691  double s0 = 0., s1 = 0., s2 = 0.;
692 
693  if (mysel[RigidBodyAlignmentParameters::dx]) s0 = shift * double(random()%1000-500)/500.;
694  if (mysel[RigidBodyAlignmentParameters::dy]) s1 = shift * double(random()%1000-500)/500.;
695  if (mysel[RigidBodyAlignmentParameters::dz]) s2 = shift * double(random()%1000-500)/500.;
696 
697  if (local) ali->move( ali->surface().toGlobal(align::LocalVector(s0,s1,s2)) );
698  else ali->move( align::GlobalVector(s0,s1,s2) );
699 
700  //AlignmentPositionError ape(dx,dy,dz);
701  //ali->addAlignmentPositionError(ape);
702  }
703 
704  if (std::abs(rot)>0.00001) {
706  if (mysel[RigidBodyAlignmentParameters::dalpha]) r(1)=rot*double(random()%1000-500)/500.;
707  if (mysel[RigidBodyAlignmentParameters::dbeta]) r(2)=rot*double(random()%1000-500)/500.;
708  if (mysel[RigidBodyAlignmentParameters::dgamma]) r(3)=rot*double(random()%1000-500)/500.;
709 
710  const align::RotationType mrot = align::toMatrix(r);
711  if (local) ali->rotateInLocalFrame(mrot);
712  else ali->rotateInGlobalFrame(mrot);
713  //ali->addAlignmentPositionErrorFromRotation(mrot);
714  }
715  }
716 
717  } else {
718  output << "No simple misalignment added!";
719  }
720 
721  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::simpleMisalignment_" << output.str();
722 }
723 
724 //_____________________________________________________________________________
727 {
728  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::startingNewLoop"
729  << "Now physically apply alignments to geometry...";
730 
731  // Propagate changes to reconstruction geometry (from initialisation or iteration)
732  GeometryAligner aligner;
733 
734  if (doTracker_) {
735  std::auto_ptr<Alignments> alignments( theTrackerAlignables->alignments());
736  std::auto_ptr<AlignmentErrorsExtended> alignmentErrExt(theTrackerAlignables->alignmentErrors());
737  std::auto_ptr<AlignmentSurfaceDeformations> aliDeforms( theTrackerAlignables->surfaceDeformations());
738 
740  &(*theTrackerGeometry),
741  &(*alignments),
742  &(*alignmentErrExt),
744  ); // don't apply global a second time!
745 
747  &(*theTrackerGeometry),
748  &(*aliDeforms)
749  );
750  }
751 
752  if (doMuon_) {
753  std::auto_ptr<Alignments> dtAlignments( theMuonAlignables->dtAlignments());
754  std::auto_ptr<Alignments> cscAlignments(theMuonAlignables->cscAlignments());
755 
756  std::auto_ptr<AlignmentErrorsExtended> dtAlignmentErrExt(
757  theMuonAlignables->dtAlignmentErrorsExtended()
758  );
759  std::auto_ptr<AlignmentErrorsExtended> cscAlignmentErrExt(
760  theMuonAlignables->cscAlignmentErrorsExtended()
761  );
762 
763  aligner.applyAlignments<DTGeometry>(
764  &(*theMuonDTGeometry),
765  &(*dtAlignments),
766  &(*dtAlignmentErrExt),
768  ); // don't apply global a second time!
769 
770  aligner.applyAlignments<CSCGeometry>(
771  &(*theMuonCSCGeometry),
772  &(*cscAlignments),
773  &(*cscAlignmentErrExt),
775  ); // nope!
776  }
777 }
778 
779 //_____________________________________________________________________________
780 template<class G, class Rcd, class ErrRcd>
783  const AlignTransform& globalCoordinates) const
784 {
785  // 'G' is the geometry class for that DB should be applied,
786  // 'Rcd' is the record class for its Alignments
787  // 'ErrRcd' is the record class for its AlignmentErrorsExtended
788  // 'globalCoordinates' are global transformation for this geometry
789 
790  const Rcd& record = setup.get<Rcd>();
791  if (checkDbAlignmentValidity_) {
792  const edm::ValidityInterval & validity = record.validityInterval();
793  const edm::IOVSyncValue first = validity.first();
794  const edm::IOVSyncValue last = validity.last();
795 
796  if (first != edm::IOVSyncValue::beginOfTime() ||
797  last != edm::IOVSyncValue::endOfTime()) {
798  throw cms::Exception("DatabaseError")
799  << "@SUB=PCLTrackerAlProducer::applyDB"
800  << "\nTrying to apply " << record.key().name()
801  << " with multiple IOVs in tag.\nValidity range is "
802  << first.eventID().run() << " - " << last.eventID().run();
803  }
804  }
805 
806  edm::ESHandle<Alignments> alignments;
807  record.get(alignments);
808 
810  setup.get<ErrRcd>().get(alignmentErrExt);
811 
812  GeometryAligner aligner;
813  aligner.applyAlignments<G>(geometry, &(*alignments), &(*alignmentErrExt),
814  globalCoordinates);
815 }
816 
817 //_____________________________________________________________________________
818 template<class G, class DeformationRcd>
821 {
822  // 'G' is the geometry class for that DB should be applied,
823  // 'DeformationRcd' is the record class for its surface deformations
824 
825  const DeformationRcd & record = setup.get<DeformationRcd>();
826  if (checkDbAlignmentValidity_) {
827  const edm::ValidityInterval & validity = record.validityInterval();
828  const edm::IOVSyncValue first = validity.first();
829  const edm::IOVSyncValue last = validity.last();
830 
831  if (first != edm::IOVSyncValue::beginOfTime() ||
832  last != edm::IOVSyncValue::endOfTime()) {
833  throw cms::Exception("DatabaseError")
834  << "@SUB=PCLTrackerAlProducer::applyDB"
835  << "\nTrying to apply " << record.key().name()
836  << " with multiple IOVs in tag.\nValidity range is "
837  << first.eventID().run() << " - " << last.eventID().run();
838  }
839  }
841  record.get(surfaceDeformations);
842 
843  GeometryAligner aligner;
844  aligner.attachSurfaceDeformations<G>(geometry, &(*surfaceDeformations));
845 }
846 
847 //_____________________________________________________________________________
850 {
851 
852  // Get Survey Rcds and add Survey Info
853  if (doTracker_ && useSurvey_) {
854  bool tkSurveyBool = watchTkSurveyRcd.check(setup);
855  bool tkSurveyErrBool = watchTkSurveyErrExtRcd.check(setup);
856 
857  if (tkSurveyBool || tkSurveyErrBool) {
859  edm::ESHandle<SurveyErrors> surveyErrors;
860  setup.get<TrackerSurveyRcd>(). get(surveys);
861  setup.get<TrackerSurveyErrorExtendedRcd>().get(surveyErrors);
862 
863  theSurveyIndex = 0;
864  theSurveyValues = &(*surveys);
865  theSurveyErrors = &(*surveyErrors);
866 
867  addSurveyInfo(theTrackerAlignables);
868  }
869  }
870 
871  if (doMuon_ && useSurvey_) {
872  bool DTSurveyBool = watchTkSurveyRcd.check(setup);
873  bool DTSurveyErrBool = watchTkSurveyErrExtRcd.check(setup);
874  bool CSCSurveyBool = watchTkSurveyRcd.check(setup);
875  bool CSCSurveyErrBool = watchTkSurveyErrExtRcd.check(setup);
876 
877  if (DTSurveyBool || DTSurveyErrBool || CSCSurveyBool || CSCSurveyErrBool) {
878  edm::ESHandle<Alignments> dtSurveys;
879  edm::ESHandle<SurveyErrors> dtSurveyErrors;
880  edm::ESHandle<Alignments> cscSurveys;
881  edm::ESHandle<SurveyErrors> cscSurveyErrors;
882  setup.get<DTSurveyRcd>(). get(dtSurveys);
883  setup.get<DTSurveyErrorExtendedRcd>(). get(dtSurveyErrors);
884  setup.get<CSCSurveyRcd>(). get(cscSurveys);
885  setup.get<CSCSurveyErrorExtendedRcd>().get(cscSurveyErrors);
886 
887  theSurveyIndex = 0;
888  theSurveyValues = &(*dtSurveys);
889  theSurveyErrors = &(*dtSurveyErrors);
890 
891  Alignables barrels = theMuonAlignables->DTBarrel();
892  for (auto iter = barrels.begin();
893  iter != barrels.end();
894  ++iter) {
895  addSurveyInfo(*iter);
896  }
897 
898  theSurveyIndex = 0;
899  theSurveyValues = &(*cscSurveys);
900  theSurveyErrors = &(*cscSurveyErrors);
901 
902  Alignables endcaps = theMuonAlignables->CSCEndcaps();
903  for (auto iter = endcaps.begin();
904  iter != endcaps.end();
905  ++iter) {
906  addSurveyInfo(*iter);
907  }
908  }
909  }
910 
911 }
912 
913 //_____________________________________________________________________________
916 {
917  edm::LogInfo("Alignment") << "ADDING THE SURVEY INFORMATION";
918 
919  const std::vector<Alignable*>& comp = alignable->components();
920  for (size_t i = 0; i < comp.size(); ++i) {
921  addSurveyInfo(comp[i]);
922  }
923 
924  const SurveyError& error = theSurveyErrors->m_surveyErrors[theSurveyIndex];
925 
926  if (alignable->id() != error.rawId() ||
927  alignable->alignableObjectId() != error.structureType()) {
928  throw cms::Exception("DatabaseError")
929  << "Error reading survey info from DB. Mismatched id!";
930  }
931 
932  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[theSurveyIndex].translation();
933  const CLHEP::HepRotation& rot = theSurveyValues->m_align[theSurveyIndex].rotation();
934 
935  AlignableSurface surf(align::PositionType(pos.x(), pos.y(), pos.z()),
936  align::RotationType(rot.xx(), rot.xy(), rot.xz(),
937  rot.yx(), rot.yy(), rot.yz(),
938  rot.zx(), rot.zy(), rot.zz()));
939  surf.setWidth (alignable->surface().width());
940  surf.setLength(alignable->surface().length());
941 
942  alignable->setSurvey(new SurveyDet(surf, error.matrix()));
943 
944  ++theSurveyIndex;
945 }
946 
947 
948 
949 /*** Code for writing results to database
950  Called from endJob() ***/
951 
952 //_____________________________________________________________________________
955 {
956  if (theAlignmentAlgo->processesEvents() && nevent_ == 0) {
957  // beginOfJob is usually called by the framework in the first event of the first loop
958  // (a hack: beginOfJob needs the EventSetup that is not well defined without an event)
959  // and the algorithms rely on the initialisations done in beginOfJob. We cannot call
960  // this->beginOfJob(iSetup); here either since that will access the EventSetup to get
961  // some geometry information that is not defined either without having seen an event.
962  edm::LogError("Alignment") << "@SUB=PCLTrackerAlProducer::finish"
963  << "Did not process any events, stop "
964  << "without terminating algorithm.";
965  return;
966  }
967 
968  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::finish"
969  << "Terminating algorithm.";
970  theAlignmentAlgo->terminate();
971 
972  storeAlignmentsToDB();
973 }
974 
975 //_____________________________________________________________________________
978 {
979  if (theAlignmentAlgo->processesEvents() && nevent_ == 0) {
980  // TODO: If this is the case, it would be already caught in finish()
981  edm::LogError("Alignment") << "@SUB=PCLTrackerAlProducer::endOfJob"
982  << "Did not process any events in last loop, "
983  << "do not dare to store to DB.";
984  } else {
985  // Expand run ranges and make them unique
986  edm::VParameterSet runRangeSelectionVPSet(theParameterSet.getParameter<edm::VParameterSet>("RunRangeSelection"));
987  RunRanges uniqueRunRanges(makeNonOverlappingRunRanges(runRangeSelectionVPSet));
988 
989  // create dummy IOV
990  if (uniqueRunRanges.empty()) {
991  const RunRange runRange(cond::timeTypeSpecs[cond::runnumber].beginValue,
993  uniqueRunRanges.push_back(runRange);
994  }
995 
996  std::vector<AlgebraicVector> beamSpotParameters;
997 
998  for (auto iRunRange = uniqueRunRanges.begin();
999  iRunRange != uniqueRunRanges.end();
1000  ++iRunRange) {
1001 
1002  theAlignmentAlgo->setParametersForRunRange(*iRunRange);
1003 
1004  // Save alignments to database
1005  if (saveToDB_ || saveApeToDB_ || saveDeformationsToDB_) {
1006  writeForRunRange((*iRunRange).first);
1007  }
1008 
1009  // Deal with extra alignables, e.g. beam spot
1010  if (theExtraAlignables) {
1011  Alignables &alis = theExtraAlignables->beamSpot();
1012  if (!alis.empty()) {
1013  BeamSpotAlignmentParameters *beamSpotAliPars = dynamic_cast<BeamSpotAlignmentParameters*>(alis[0]->alignmentParameters());
1014  beamSpotParameters.push_back(beamSpotAliPars->parameters());
1015  }
1016  }
1017  }
1018 
1019  if (theExtraAlignables) {
1020  std::ostringstream bsOutput;
1021 
1022  auto itPar = beamSpotParameters.begin();
1023  for (auto iRunRange = uniqueRunRanges.begin();
1024  iRunRange != uniqueRunRanges.end();
1025  ++iRunRange, ++itPar) {
1026  bsOutput << "Run range: " << (*iRunRange).first << " - " << (*iRunRange).second << "\n";
1027  bsOutput << " Displacement: x=" << (*itPar)[0] << ", y=" << (*itPar)[1] << "\n";
1028  bsOutput << " Slope: dx/dz=" << (*itPar)[2] << ", dy/dz=" << (*itPar)[3] << "\n";
1029  }
1030 
1031  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::endOfJob"
1032  << "Parameters for alignable beamspot:\n"
1033  << bsOutput.str();
1034  }
1035  }
1036 }
1037 
1038 //_____________________________________________________________________________
1041 {
1042  static bool oldRunRangeSelectionWarning = false;
1043 
1046 
1047  RunRanges uniqueRunRanges;
1048  if (!RunRangeSelectionVPSet.empty()) {
1049 
1050  std::map<RunNumber,RunNumber> uniqueFirstRunNumbers;
1051 
1052  for (auto ipset = RunRangeSelectionVPSet.begin();
1053  ipset != RunRangeSelectionVPSet.end();
1054  ++ipset) {
1055  const std::vector<std::string> RunRangeStrings = (*ipset).getParameter<std::vector<std::string> >("RunRanges");
1056 
1057  for (auto irange = RunRangeStrings.begin();
1058  irange != RunRangeStrings.end();
1059  ++irange) {
1060 
1061  if ((*irange).find(':') == std::string::npos) {
1062 
1063  RunNumber first = beginValue;
1064  long int temp = strtol((*irange).c_str(), 0, 0);
1065  if (temp!=-1) first = temp;
1066  uniqueFirstRunNumbers[first] = first;
1067 
1068  } else {
1069  if (!oldRunRangeSelectionWarning) {
1070  edm::LogWarning("BadConfig") << "@SUB=PCLTrackerAlProducer::makeNonOverlappingRunRanges"
1071  << "Config file contains old format for 'RunRangeSelection'. Only the start run\n"
1072  << "number is used internally. The number of the last run is ignored and can be\n"
1073  << "safely removed from the config file.\n";
1074  oldRunRangeSelectionWarning = true;
1075  }
1076 
1077  std::vector<std::string> tokens = edm::tokenize(*irange, ":");
1078  long int temp;
1079  RunNumber first = beginValue;
1080  temp = strtol(tokens[0].c_str(), 0, 0);
1081  if (temp!=-1) first = temp;
1082  uniqueFirstRunNumbers[first] = first;
1083  }
1084  }
1085  }
1086 
1087  for (auto iFirst = uniqueFirstRunNumbers.begin();
1088  iFirst != uniqueFirstRunNumbers.end();
1089  ++iFirst) {
1090  uniqueRunRanges.push_back(std::pair<RunNumber,RunNumber>((*iFirst).first, endValue));
1091  }
1092 
1093  for (size_t i = 0; i < uniqueRunRanges.size()-1; ++i) {
1094  uniqueRunRanges[i].second = uniqueRunRanges[i+1].first - 1;
1095  }
1096 
1097  } else {
1098  uniqueRunRanges.push_back(std::pair<RunNumber,RunNumber>(theFirstRun, endValue));
1099  }
1100 
1101  return uniqueRunRanges;
1102 }
1103 
1104 //_____________________________________________________________________________
1107 {
1108  // first tracker
1109  if (doTracker_) {
1110  const AlignTransform* trackerGlobal = 0; // will be 'removed' from constants
1111  if (globalPositions_) { // i.e. applied before in applyDB
1112  trackerGlobal = &align::DetectorGlobalPosition(*globalPositions_,
1114  }
1115 
1116  // theTrackerAlignables->alignments calls new
1117  Alignments* alignments = theTrackerAlignables->alignments();
1118  AlignmentErrorsExtended* alignmentErrExt = theTrackerAlignables->alignmentErrors();
1119 
1120  writeDB(alignments, "TrackerAlignmentRcd",
1121  alignmentErrExt, "TrackerAlignmentErrorExtendedRcd",
1122  trackerGlobal,
1123  time);
1124  }
1125 
1126  // Save surface deformations to database
1127  if (doTracker_ && saveDeformationsToDB_) {
1128  AlignmentSurfaceDeformations* alignmentSurfaceDeformations = theTrackerAlignables->surfaceDeformations();
1129  writeDB(alignmentSurfaceDeformations, "TrackerSurfaceDeformationRcd", time);
1130  }
1131 
1132  // now muon
1133  if (doMuon_) {
1134  const AlignTransform* muonGlobal = 0; // will be 'removed' from constants
1135  if (globalPositions_) { // i.e. applied before in applyDB
1136  muonGlobal = &align::DetectorGlobalPosition(*globalPositions_,
1137  DetId(DetId::Muon));
1138  }
1139 
1140  // Get alignments+errors, first DT - ownership taken over by writeDB(..), so no delete
1141  Alignments* alignments = theMuonAlignables->dtAlignments();
1142  AlignmentErrorsExtended* alignmentErrExt = theMuonAlignables->dtAlignmentErrorsExtended();
1143 
1144  writeDB(alignments, "DTAlignmentRcd",
1145  alignmentErrExt, "DTAlignmentErrorExtendedRcd",
1146  muonGlobal,
1147  time);
1148 
1149  // Get alignments+errors, now CSC - ownership taken over by writeDB(..), so no delete
1150  alignments = theMuonAlignables->cscAlignments();
1151  alignmentErrExt = theMuonAlignables->cscAlignmentErrorsExtended();
1152 
1153  writeDB(alignments, "CSCAlignmentRcd",
1154  alignmentErrExt, "CSCAlignmentErrorExtendedRcd",
1155  muonGlobal,
1156  time);
1157  }
1158 }
1159 
1160 //_____________________________________________________________________________
1162 ::writeDB(Alignments* alignments, const std::string &alignRcd,
1163  AlignmentErrorsExtended* alignmentErrExt, const std::string &errRcd,
1164  const AlignTransform *globalCoordinates,
1165  cond::Time_t time) const
1166 {
1167  Alignments* tempAlignments = alignments;
1168  AlignmentErrorsExtended* tempAlignmentErrExt = alignmentErrExt;
1169 
1170  // Call service
1172  if (!poolDb.isAvailable()) { // Die if not available
1173  delete tempAlignments; // promised to take over ownership...
1174  delete tempAlignmentErrExt; // dito
1175 
1176  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
1177  }
1178 
1179  if (globalCoordinates && // happens only if (applyDbAlignment_ == true)
1180  globalCoordinates->transform() != AlignTransform::Transform::Identity) {
1181 
1182  tempAlignments = new Alignments(); // temporary storage for
1183  tempAlignmentErrExt = new AlignmentErrorsExtended(); // final alignments and errors
1184 
1185  GeometryAligner aligner;
1186  aligner.removeGlobalTransform(alignments, alignmentErrExt,
1187  *globalCoordinates,
1188  tempAlignments, tempAlignmentErrExt);
1189 
1190  delete alignments; // have to delete original alignments
1191  delete alignmentErrExt; // same thing for the errors
1192 
1193  edm::LogInfo("Alignment") << "@SUB=PCLTrackerAlProducer::writeDB"
1194  << "globalCoordinates removed from alignments ("
1195  << alignRcd << ") and errors (" << alignRcd << ").";
1196  }
1197 
1198  if (saveToDB_) {
1199  edm::LogInfo("Alignment") << "Writing Alignments for run " << time
1200  << " to " << alignRcd << ".";
1201  poolDb->writeOne<Alignments>(tempAlignments, time, alignRcd);
1202 
1203  } else {
1204  // poolDb->writeOne(..) takes over 'alignments' ownership, ...
1205  delete tempAlignments; // ...otherwise we have to delete, as promised!
1206  }
1207 
1208  if (saveApeToDB_) {
1209  edm::LogInfo("Alignment") << "Writing AlignmentErrorsExtended for run "
1210  << time << " to " << errRcd << ".";
1211  poolDb->writeOne<AlignmentErrorsExtended>(tempAlignmentErrExt, time, errRcd);
1212 
1213  } else {
1214  // poolDb->writeOne(..) takes over 'alignmentErrors' ownership, ...
1215  delete tempAlignmentErrExt; // ...otherwise we have to delete, as promised!
1216  }
1217 }
1218 
1219 //_____________________________________________________________________________
1221 ::writeDB(AlignmentSurfaceDeformations* alignmentSurfaceDeformations,
1222  const std::string &surfaceDeformationRcd,
1223  cond::Time_t time) const
1224 {
1225  // Call service
1227  if (!poolDb.isAvailable()) { // Die if not available
1228  delete alignmentSurfaceDeformations; // promised to take over ownership...
1229  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
1230  }
1231 
1232  if (saveDeformationsToDB_) {
1233  edm::LogInfo("Alignment") << "Writing AlignmentSurfaceDeformations for run "
1234  << time << " to " << surfaceDeformationRcd << ".";
1235  poolDb->writeOne<AlignmentSurfaceDeformations>(alignmentSurfaceDeformations, time,
1236  surfaceDeformationRcd);
1237 
1238  } else {
1239  // poolDb->writeOne(..) takes over 'surfaceDeformation' ownership,...
1240  delete alignmentSurfaceDeformations; // ...otherwise we have to delete, as promised!
1241  }
1242 }
1243 
1244 
1245 
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:180
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:214
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:91
void createCalibrations(const edm::ParameterSet &)
Creates the calibrations (specified in config-file)
RunID const & id() const
Definition: RunBase.h:41
Builds a scenario from configuration and applies it to the alignable Muon.
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
RunRanges makeNonOverlappingRunRanges(const edm::VParameterSet &)
Makes unique RunRanges (specified in config-file)
RunNumber_t run() const
Definition: RunID.h:39
const EventID & eventID() const
Definition: IOVSyncValue.h:42
Time_t beginValue
Definition: Time.h:45
Class to update a given geometry with a set of alignments.
void applyMisalignment()
Applies misalignment scenario to .
JetCorrectorParameters::Record record
Definition: classes.h:7
#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
TrackerGeometry * build(const GeometricDet *gd, const edm::ParameterSet &pSet)
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
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)
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
virtual Alignables components() const =0
Return vector of all direct components.
void applyDB(G *, const edm::EventSetup &, const AlignTransform &) const
virtual ~PCLTrackerAlProducer()
Destructor.
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:57
define event information passed to algorithms
tuple s2
Definition: indexGen.py:106
const IOVSyncValue & last() const
void build(boost::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
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
std::pair< RunNumber, RunNumber > RunRange
static const IOVSyncValue & beginOfTime()
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
virtual void endJob() override
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
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
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.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool setupChanged(const edm::EventSetup &)
Checks if one of the EventSetup-Records has changed.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
tuple G
Definition: callgraph.py:12
void createGeometries(const edm::EventSetup &)
Creates ideal geometry from IdealGeometryRecord.
virtual void beginJob() override
std::vector< RunRange > RunRanges
Definition: DetId.h:18
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:207
std::vector< std::string > tokenize(std::string const &input, std::string const &separator)
breaks the input string into tokens, delimited by the separator
Definition: Parse.cc:57
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:268
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
void build(boost::shared_ptr< CSCGeometry > theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
ESHandle< TrackerGeometry > geometry
edm::EventID id() const
Definition: EventBase.h:60
void writeForRunRange(cond::Time_t)
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:40
void addSurveyInfo(Alignable *)
Adds survey info to an Alignable.
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector&lt;char&gt;
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 IOVSyncValue & first() const
Time_t endValue
Definition: Time.h:46
Builds a scenario from configuration and applies it to the alignable tracker.
void createAlignables(const TrackerTopology *const)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
SurfaceDeformation * create(int type, const std::vector< double > &params)
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the Muon.
T get(const Candidate &c)
Definition: component.h:55
cond::RealTimeType< cond::runnumber >::type RunNumber
PCLTrackerAlProducer(const edm::ParameterSet &)
Constructor.
Definition: Run.h:41
void initAlignmentAlgorithm(const edm::EventSetup &)