CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentProducer.cc
Go to the documentation of this file.
1 
8 #include "AlignmentProducer.h"
13 
15 
16 // System include files
17 #include <memory>
18 #include <sstream>
19 
20 // Framework
26 
28 
29 // Conditions database
32 
33 // Geometry
57 
58 // Tracking, LAS and cluster flag map (fwd is enough!)
63 
64 // Alignment
74 
75 //_____________________________________________________________________________
77  theAlignmentAlgo(0), theAlignmentParameterStore(0),
78  theAlignableExtras(0), theAlignableTracker(0), theAlignableMuon(0),
79  globalPositions_(0),
80  nevent_(0), theParameterSet(iConfig),
81  theMaxLoops( iConfig.getUntrackedParameter<unsigned int>("maxLoops") ),
82  stNFixAlignables_(iConfig.getParameter<int>("nFixAlignables") ),
83  stRandomShift_(iConfig.getParameter<double>("randomShift")),
84  stRandomRotation_(iConfig.getParameter<double>("randomRotation")),
85  applyDbAlignment_( iConfig.getUntrackedParameter<bool>("applyDbAlignment")),
86  checkDbAlignmentValidity_( iConfig.getUntrackedParameter<bool>("checkDbAlignmentValidity")),
87  doMisalignmentScenario_(iConfig.getParameter<bool>("doMisalignmentScenario")),
88  saveToDB_(iConfig.getParameter<bool>("saveToDB")),
89  saveApeToDB_(iConfig.getParameter<bool>("saveApeToDB")),
90  saveDeformationsToDB_(iConfig.getParameter<bool>("saveDeformationsToDB")),
91  doTracker_( iConfig.getUntrackedParameter<bool>("doTracker") ),
92  doMuon_( iConfig.getUntrackedParameter<bool>("doMuon") ),
93  useExtras_( iConfig.getUntrackedParameter<bool>("useExtras") ),
94  useSurvey_( iConfig.getParameter<bool>("useSurvey") ),
95  tjTkAssociationMapTag_(iConfig.getParameter<edm::InputTag>("tjTkAssociationMapTag")),
96  beamSpotTag_(iConfig.getParameter<edm::InputTag>("beamSpotTag")),
97  tkLasBeamTag_(iConfig.getParameter<edm::InputTag>("tkLasBeamTag")),
98  clusterValueMapTag_(iConfig.getParameter<edm::InputTag>("hitPrescaleMapTag"))
99 {
100  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::AlignmentProducer";
101 
102  // Tell the framework what data is being produced
103  if (doTracker_) {
105  }
106  if (doMuon_) {
109  }
110 
111  // Create the alignment algorithm
112  edm::ParameterSet algoConfig = iConfig.getParameter<edm::ParameterSet>( "algoConfig" );
113  edm::VParameterSet iovSelection = iConfig.getParameter<edm::VParameterSet>( "RunRangeSelection" );
114  algoConfig.addUntrackedParameter<edm::VParameterSet>( "RunRangeSelection", iovSelection );
115  std::string algoName = algoConfig.getParameter<std::string>( "algoName" );
116  theAlignmentAlgo = AlignmentAlgorithmPluginFactory::get( )->create( algoName, algoConfig );
117 
118  // Check if found
119  if ( !theAlignmentAlgo )
120  throw cms::Exception("BadConfig") << "Couldn't find algorithm called " << algoName;
121 
122  edm::ParameterSet monitorConfig = iConfig.getParameter<edm::ParameterSet>( "monitorConfig" );
123  std::vector<std::string> monitors = monitorConfig.getUntrackedParameter<std::vector<std::string> >( "monitors" );
124 
125  for (std::vector<std::string>::const_iterator miter = monitors.begin(); miter != monitors.end(); ++miter) {
126  AlignmentMonitorBase* newMonitor = AlignmentMonitorPluginFactory::get()->create(*miter, monitorConfig.getUntrackedParameter<edm::ParameterSet>(*miter));
127 
128  if (!newMonitor) throw cms::Exception("BadConfig") << "Couldn't find monitor named " << *miter;
129 
130  theMonitors.push_back(newMonitor);
131  }
132 }
133 
134 
135 //_____________________________________________________________________________
136 // Delete new objects
138 {
139  delete theAlignmentAlgo;
140 
142  delete theAlignableExtras;
143  delete theAlignableTracker;
144  delete theAlignableMuon;
145 
146  delete globalPositions_;
147 }
148 
149 
150 //_____________________________________________________________________________
151 // Produce tracker geometry
152 boost::shared_ptr<TrackerGeometry>
154 {
155  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceTracker";
156  return theTracker;
157 }
158 
159 //_____________________________________________________________________________
160 // Produce muonDT geometry
161 boost::shared_ptr<DTGeometry>
163 {
164  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceDT";
165  return theMuonDT;
166 }
167 
168 //_____________________________________________________________________________
169 // Produce muonCSC geometry
170 boost::shared_ptr<CSCGeometry>
172 {
173  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceCSC";
174  return theMuonCSC;
175 }
176 
177 
178 //_____________________________________________________________________________
179 // Initialize algorithm
181 {
182  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob";
183 
184  // Create the geometries from the ideal geometries (first time only)
185  this->createGeometries_( iSetup );
186 
187  // Retrieve and apply alignments, if requested (requires DB setup)
188  if ( applyDbAlignment_ ) {
189  // we need GlobalPositionRcd - and have to keep track for later removal
190  // before writing again to DB...
191  edm::ESHandle<Alignments> globalPositionRcd;
192  iSetup.get<GlobalPositionRcd>().get(globalPositionRcd);
193  globalPositions_ = new Alignments(*globalPositionRcd);
194 
195  if ( doTracker_ ) { // apply to tracker
196  this->applyDB<TrackerGeometry,TrackerAlignmentRcd,TrackerAlignmentErrorRcd>
197  (&(*theTracker), iSetup,
199  this->applyDB<TrackerGeometry,TrackerSurfaceDeformationRcd>(&(*theTracker), iSetup);
200  }
201 
202  if ( doMuon_ ) { // apply to tracker
203  this->applyDB<DTGeometry,DTAlignmentRcd,DTAlignmentErrorRcd>
204  (&(*theMuonDT), iSetup,
206  this->applyDB<CSCGeometry,CSCAlignmentRcd,CSCAlignmentErrorRcd>
207  (&(*theMuonCSC), iSetup,
209  }
210  }
211 
212  // Create alignable tracker and muon
213  if (doTracker_) {
215  }
216 
217  if (doMuon_) {
219  }
220 
221  if (useExtras_) {
223  }
224 
225  // Create alignment parameter builder
226  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
227  << "Creating AlignmentParameterBuilder";
228  edm::ParameterSet aliParamBuildCfg =
229  theParameterSet.getParameter<edm::ParameterSet>("ParameterBuilder");
230  AlignmentParameterBuilder alignmentParameterBuilder(theAlignableTracker,
233  aliParamBuildCfg );
234  // Fix alignables if requested
235  if (stNFixAlignables_>0) alignmentParameterBuilder.fixAlignables(stNFixAlignables_);
236 
237  // Get list of alignables
238  Alignables theAlignables = alignmentParameterBuilder.alignables();
239  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
240  << "got " << theAlignables.size() << " alignables";
241 
242  // Create AlignmentParameterStore
243  edm::ParameterSet aliParamStoreCfg =
245  theAlignmentParameterStore = new AlignmentParameterStore(theAlignables, aliParamStoreCfg);
246  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
247  << "AlignmentParameterStore created!";
248 
249  // Apply misalignment scenario to alignable tracker and muon if requested
250  // WARNING: this assumes scenarioConfig can be passed to both muon and tracker
252  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
253  << "Applying misalignment scenario to "
254  << (doTracker_ ? "tracker" : "")
255  << (doMuon_ ? (doTracker_ ? " and muon" : "muon") : ".");
256  edm::ParameterSet scenarioConfig
257  = theParameterSet.getParameter<edm::ParameterSet>( "MisalignmentScenario" );
258  if (doTracker_) {
259  TrackerScenarioBuilder scenarioBuilder( theAlignableTracker );
260  scenarioBuilder.applyScenario( scenarioConfig );
261  }
262  if (doMuon_) {
263  MuonScenarioBuilder muonScenarioBuilder( theAlignableMuon );
264  muonScenarioBuilder.applyScenario( scenarioConfig );
265  }
266  } else {
267  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
268  << "NOT applying misalignment scenario!";
269  }
270 
271  // Apply simple misalignment
272  const std::string sParSel(theParameterSet.getParameter<std::string>("parameterSelectorSimple"));
273  this->simpleMisalignment_(theAlignables, sParSel, stRandomShift_, stRandomRotation_, true);
274 
275  // Initialize alignment algorithm
276  theAlignmentAlgo->initialize( iSetup,
278  theAlignmentParameterStore );
279 
280  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin();
281  monitor != theMonitors.end(); ++monitor) {
282  (*monitor)->beginOfJob(theAlignableTracker, theAlignableMuon, theAlignmentParameterStore);
283  }
284 }
285 
286 //_____________________________________________________________________________
287 // Terminate algorithm
289 {
290  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfJob";
291 
292  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin(); monitor != theMonitors.end(); ++monitor) {
293  (*monitor)->endOfJob();
294  }
295 
296  if (0 == nevent_) {
297  edm::LogError("Alignment") << "@SUB=AlignmentProducer::endOfJob" << "Did not process any "
298  << "events in last loop, do not dare to store to DB.";
299  } else {
300 
301  // Expand run ranges and make them unique
302  edm::VParameterSet runRangeSelectionVPSet(theParameterSet.getParameter<edm::VParameterSet>("RunRangeSelection"));
303  RunRanges uniqueRunRanges(this->makeNonOverlappingRunRanges(runRangeSelectionVPSet));
304  if (uniqueRunRanges.empty()) { // create dummy IOV
305  const RunRange runRange(cond::timeTypeSpecs[cond::runnumber].beginValue,
307  uniqueRunRanges.push_back(runRange);
308  }
309 
310  std::vector<AlgebraicVector> beamSpotParameters;
311 
312  for (RunRanges::const_iterator iRunRange = uniqueRunRanges.begin();
313  iRunRange != uniqueRunRanges.end();
314  ++iRunRange) {
315 
317 
318  // Save alignments to database
320  this->writeForRunRange((*iRunRange).first);
321 
322  // Deal with extra alignables, e.g. beam spot
323  if (theAlignableExtras) {
325  if (!alis.empty()) {
326  BeamSpotAlignmentParameters *beamSpotAliPars = dynamic_cast<BeamSpotAlignmentParameters*>(alis[0]->alignmentParameters());
327  beamSpotParameters.push_back(beamSpotAliPars->parameters());
328  }
329  }
330  }
331 
332  if (theAlignableExtras) {
333  std::ostringstream bsOutput;
334 
335  std::vector<AlgebraicVector>::const_iterator itPar = beamSpotParameters.begin();
336  for (RunRanges::const_iterator iRunRange = uniqueRunRanges.begin();
337  iRunRange != uniqueRunRanges.end();
338  ++iRunRange, ++itPar) {
339  bsOutput << "Run range: " << (*iRunRange).first << " - " << (*iRunRange).second << "\n";
340  bsOutput << " Displacement: x=" << (*itPar)[0] << ", y=" << (*itPar)[1] << "\n";
341  bsOutput << " Slope: dx/dz=" << (*itPar)[2] << ", dy/dz=" << (*itPar)[3] << "\n";
342  }
343 
344  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfJob"
345  << "Parameters for alignable beamspot:\n"
346  << bsOutput.str();
347  }
348 
349  }
350 }
351 
352 //_____________________________________________________________________________
353 // Called at beginning of loop
354 void AlignmentProducer::startingNewLoop(unsigned int iLoop )
355 {
356  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::startingNewLoop"
357  << "Starting loop number " << iLoop;
358 
359  nevent_ = 0;
360 
362 
363  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin(); monitor != theMonitors.end(); ++monitor) {
364  (*monitor)->startingNewLoop();
365  }
366 
367  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::startingNewLoop"
368  << "Now physically apply alignments to geometry...";
369 
370 
371  // Propagate changes to reconstruction geometry (from initialisation or iteration)
372  GeometryAligner aligner;
373  if ( doTracker_ ) {
374  std::auto_ptr<Alignments> alignments(theAlignableTracker->alignments());
375  std::auto_ptr<AlignmentErrors> alignmentErrors(theAlignableTracker->alignmentErrors());
376  aligner.applyAlignments<TrackerGeometry>( &(*theTracker),&(*alignments),&(*alignmentErrors), AlignTransform() ); // don't apply global a second time!
377  std::auto_ptr<AlignmentSurfaceDeformations> aliDeforms(theAlignableTracker->surfaceDeformations());
378  aligner.attachSurfaceDeformations<TrackerGeometry>(&(*theTracker), &(*aliDeforms));
379 
380  }
381  if ( doMuon_ ) {
382  std::auto_ptr<Alignments> dtAlignments( theAlignableMuon->dtAlignments());
383  std::auto_ptr<AlignmentErrors> dtAlignmentErrors( theAlignableMuon->dtAlignmentErrors());
384  std::auto_ptr<Alignments> cscAlignments( theAlignableMuon->cscAlignments());
385  std::auto_ptr<AlignmentErrors> cscAlignmentErrors( theAlignableMuon->cscAlignmentErrors());
386 
387  aligner.applyAlignments<DTGeometry>( &(*theMuonDT), &(*dtAlignments), &(*dtAlignmentErrors), AlignTransform() ); // don't apply global a second time!
388  aligner.applyAlignments<CSCGeometry>( &(*theMuonCSC), &(*cscAlignments), &(*cscAlignmentErrors), AlignTransform() ); // nope!
389  }
390 }
391 
392 
393 //_____________________________________________________________________________
394 // Called at end of loop
396 AlignmentProducer::endOfLoop(const edm::EventSetup& iSetup, unsigned int iLoop)
397 {
398 
399  if (0 == nevent_) {
400  // beginOfJob is usually called by the framework in the first event of the first loop
401  // (a hack: beginOfJob needs the EventSetup that is not well defined without an event)
402  // and the algorithms rely on the initialisations done in beginOfJob. We cannot call
403  // this->beginOfJob(iSetup); here either since that will access the EventSetup to get
404  // some geometry information that is not defined either without having seen an event.
405  edm::LogError("Alignment") << "@SUB=AlignmentProducer::endOfLoop"
406  << "Did not process any events in loop " << iLoop
407  << ", stop processing without terminating algorithm.";
408  return kStop;
409  }
410 
411  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfLoop"
412  << "Ending loop " << iLoop << ", terminating algorithm.";
413 
415 
416  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin(); monitor != theMonitors.end(); ++monitor) {
417  (*monitor)->endOfLoop(iSetup);
418  }
419 
420  if ( iLoop == theMaxLoops-1 || iLoop >= theMaxLoops ) return kStop;
421  else return kContinue;
422 }
423 
424 //_____________________________________________________________________________
425 // Called at each event
428  const edm::EventSetup& setup )
429 {
430  ++nevent_;
431 
432  // reading in survey records
433  this->readInSurveyRcds(setup);
434 
435  // Printout event number
436  for ( int i=10; i<10000000; i*=10 )
437  if ( nevent_<10*i && (nevent_%i)==0 )
438  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::duringLoop"
439  << "Events processed: " << nevent_;
440 
441  // Retrieve trajectories and tracks from the event
442  // -> merely skip if collection is empty
444  if (event.getByLabel(tjTkAssociationMapTag_, m_TrajTracksMap)) {
445 
446  // Form pairs of trajectories and tracks
447  ConstTrajTrackPairCollection trajTracks;
448  for ( TrajTrackAssociationCollection::const_iterator iPair = m_TrajTracksMap->begin();
449  iPair != m_TrajTracksMap->end(); ++iPair) {
450  trajTracks.push_back( ConstTrajTrackPair( &(*(*iPair).key), &(*(*iPair).val) ) );
451  }
453  event.getByLabel(beamSpotTag_, beamSpot);
454 
455  if (nevent_==1 && theAlignableExtras) {
456  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::duringLoop"
457  << "initializing AlignableBeamSpot" << std::endl;
458  theAlignableExtras->initializeBeamSpot(beamSpot->x0(), beamSpot->y0(), beamSpot->z0(),
459  beamSpot->dxdz(), beamSpot->dydz());
460  }
461 
462  // Run the alignment algorithm with its input
463  const AliClusterValueMap *clusterValueMapPtr = 0;
464  if(clusterValueMapTag_.encode().size()){//check that the input tag is not empty
465  edm::Handle<AliClusterValueMap> clusterValueMap;
466  event.getByLabel(clusterValueMapTag_, clusterValueMap);
467  clusterValueMapPtr = &(*clusterValueMap);
468  }
469 
470  const AlignmentAlgorithmBase::EventInfo eventInfo(event.id(), trajTracks, *beamSpot,
471  clusterValueMapPtr);
472  theAlignmentAlgo->run(setup, eventInfo);
473 
474 
475  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin();
476  monitor != theMonitors.end(); ++monitor) {
477  (*monitor)->duringLoop(event, setup, trajTracks); // forward eventInfo?
478  }
479  } else {
480  edm::LogError("Alignment") << "@SUB=AlignmentProducer::duringLoop"
481  << "No track collection found: skipping event";
482  }
483 
484 
485  return kContinue;
486 }
487 
488 // ----------------------------------------------------------------------------
490 {
491  theAlignmentAlgo->beginRun(setup); // do not forward edm::Run...
492 }
493 
494 // ----------------------------------------------------------------------------
496 {
497  // call with or without las beam info...
498  typedef AlignmentAlgorithmBase::EndRunInfo EndRunInfo;
499  if (tkLasBeamTag_.encode().size()) { // non-empty InputTag
502  run.getByLabel(tkLasBeamTag_, lasBeams);
503  run.getByLabel(tkLasBeamTag_, tsoses);
504 
505  theAlignmentAlgo->endRun(EndRunInfo(run.id(), &(*lasBeams), &(*tsoses)), setup);
506  } else {
507  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endRun"
508  << "No Tk LAS beams to forward to algorithm.";
509  theAlignmentAlgo->endRun(EndRunInfo(run.id(), 0, 0), setup);
510  }
511 }
512 
513 // ----------------------------------------------------------------------------
515  const edm::EventSetup &setup)
516 {
517  theAlignmentAlgo->beginLuminosityBlock(setup); // do not forward edm::LuminosityBlock
518 }
519 
520 // ----------------------------------------------------------------------------
522  const edm::EventSetup &setup)
523 {
524  theAlignmentAlgo->endLuminosityBlock(setup); // do not forward edm::LuminosityBlock
525 }
526 
527 // ----------------------------------------------------------------------------
528 
529 void AlignmentProducer::simpleMisalignment_(const Alignables &alivec, const std::string &selection,
530  float shift, float rot, bool local)
531 {
532 
533  std::ostringstream output; // collecting output
534 
535  if (shift > 0. || rot > 0.) {
536  output << "Adding random flat shift of max size " << shift
537  << " and adding random flat rotation of max size " << rot <<" to ";
538 
539  std::vector<bool> commSel(0);
540  if (selection != "-1") {
541  AlignmentParameterSelector aSelector(0,0); // no alignable needed here...
542  const std::vector<char> cSel(aSelector.convertParamSel(selection));
543  if (cSel.size() < RigidBodyAlignmentParameters::N_PARAM) {
544  throw cms::Exception("BadConfig")
545  << "[AlignmentProducer::simpleMisalignment_]\n"
546  << "Expect selection string '" << selection << "' to be at least of length "
547  << RigidBodyAlignmentParameters::N_PARAM << " or to be '-1'.\n"
548  << "(Most probably you have to adjust the parameter 'parameterSelectorSimple'.)";
549  }
550  for (std::vector<char>::const_iterator cIter = cSel.begin(); cIter != cSel.end(); ++cIter) {
551  commSel.push_back(*cIter == '0' ? false : true);
552  }
553  output << "parameters defined by (" << selection
554  << "), representing (x,y,z,alpha,beta,gamma),";
555  } else {
556  output << "the active parameters of each alignable,";
557  }
558  output << " in " << (local ? "local" : "global") << " frame.";
559 
560  for (std::vector<Alignable*>::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
561  Alignable* ali=(*it);
562  std::vector<bool> mysel(commSel.empty() ? ali->alignmentParameters()->selector() : commSel);
563 
564  if (std::abs(shift)>0.00001) {
565  double s0 = 0., s1 = 0., s2 = 0.;
566  if (mysel[RigidBodyAlignmentParameters::dx]) s0 = shift * double(random()%1000-500)/500.;
567  if (mysel[RigidBodyAlignmentParameters::dy]) s1 = shift * double(random()%1000-500)/500.;
568  if (mysel[RigidBodyAlignmentParameters::dz]) s2 = shift * double(random()%1000-500)/500.;
569 
570  if (local) ali->move( ali->surface().toGlobal(align::LocalVector(s0,s1,s2)) );
571  else ali->move( align::GlobalVector(s0,s1,s2) );
572 
573  //AlignmentPositionError ape(dx,dy,dz);
574  //ali->addAlignmentPositionError(ape);
575  }
576 
577  if (std::abs(rot)>0.00001) {
579  if (mysel[RigidBodyAlignmentParameters::dalpha]) r(1)=rot*double(random()%1000-500)/500.;
580  if (mysel[RigidBodyAlignmentParameters::dbeta]) r(2)=rot*double(random()%1000-500)/500.;
581  if (mysel[RigidBodyAlignmentParameters::dgamma]) r(3)=rot*double(random()%1000-500)/500.;
582 
583  const align::RotationType mrot = align::toMatrix(r);
584  if (local) ali->rotateInLocalFrame(mrot);
585  else ali->rotateInGlobalFrame(mrot);
586 
587  //ali->addAlignmentPositionErrorFromRotation(mrot);
588  }
589  } // end loop on alignables
590  } else {
591  output << "No simple misalignment added!";
592  }
593  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::simpleMisalignment_" << output.str();
594 }
595 
596 
597 //__________________________________________________________________________________________________
599 {
601  iSetup.get<IdealGeometryRecord>().get( cpv );
602 
603  if (doTracker_) {
604  edm::ESHandle<GeometricDet> geometricDet;
605  iSetup.get<IdealGeometryRecord>().get( geometricDet );
606  TrackerGeomBuilderFromGeometricDet trackerBuilder;
607  theTracker = boost::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*geometricDet)) );
608  }
609 
610  if (doMuon_) {
612  iSetup.get<MuonNumberingRecord>().get(mdc);
613  DTGeometryBuilderFromDDD DTGeometryBuilder;
615  theMuonDT = boost::shared_ptr<DTGeometry>(new DTGeometry );
616  DTGeometryBuilder.build( theMuonDT, &(*cpv), *mdc);
617  theMuonCSC = boost::shared_ptr<CSCGeometry>( new CSCGeometry );
618  CSCGeometryBuilder.build( theMuonCSC, &(*cpv), *mdc );
619  }
620 }
621 
623 {
624  const std::vector<Alignable*>& comp = ali->components();
625 
626  unsigned int nComp = comp.size();
627 
628  for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo_(comp[i]);
629 
631 
632  if ( ali->id() != error.rawId() ||
633  ali->alignableObjectId() != error.structureType() )
634  {
635  throw cms::Exception("DatabaseError")
636  << "Error reading survey info from DB. Mismatched id!";
637  }
638 
639  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[theSurveyIndex].translation();
640  const CLHEP::HepRotation& rot = theSurveyValues->m_align[theSurveyIndex].rotation();
641 
642  AlignableSurface surf( align::PositionType( pos.x(), pos.y(), pos.z() ),
643  align::RotationType( rot.xx(), rot.xy(), rot.xz(),
644  rot.yx(), rot.yy(), rot.yz(),
645  rot.zx(), rot.zy(), rot.zz() ) );
646 
647  surf.setWidth( ali->surface().width() );
648  surf.setLength( ali->surface().length() );
649 
650  ali->setSurvey( new SurveyDet( surf, error.matrix() ) );
651 
652  ++theSurveyIndex;
653 }
654 
656 
657  // Get Survey Rcds and add Survey Info
658  if ( doTracker_ && useSurvey_ ){
659  bool tkSurveyBool = watchTkSurveyRcd_.check(iSetup);
660  bool tkSurveyErrBool = watchTkSurveyErrRcd_.check(iSetup);
661  edm::LogInfo("Alignment") << "watcher tksurveyrcd: " << tkSurveyBool;
662  edm::LogInfo("Alignment") << "watcher tksurveyerrrcd: " << tkSurveyErrBool;
663  if ( tkSurveyBool || tkSurveyErrBool){
664 
665  edm::LogInfo("Alignment") << "ADDING THE SURVEY INFORMATION";
667  edm::ESHandle<SurveyErrors> surveyErrors;
668 
669  iSetup.get<TrackerSurveyRcd>().get(surveys);
670  iSetup.get<TrackerSurveyErrorRcd>().get(surveyErrors);
671 
672  theSurveyIndex = 0;
673  theSurveyValues = &*surveys;
674  theSurveyErrors = &*surveyErrors;
676  }
677  }
678 
679  if ( doMuon_ && useSurvey_) {
680  bool DTSurveyBool = watchTkSurveyRcd_.check(iSetup);
681  bool DTSurveyErrBool = watchTkSurveyErrRcd_.check(iSetup);
682  bool CSCSurveyBool = watchTkSurveyRcd_.check(iSetup);
683  bool CSCSurveyErrBool = watchTkSurveyErrRcd_.check(iSetup);
684 
685  if ( DTSurveyBool || DTSurveyErrBool || CSCSurveyBool || CSCSurveyErrBool ){
686  edm::ESHandle<Alignments> dtSurveys;
687  edm::ESHandle<SurveyErrors> dtSurveyErrors;
688  edm::ESHandle<Alignments> cscSurveys;
689  edm::ESHandle<SurveyErrors> cscSurveyErrors;
690 
691  iSetup.get<DTSurveyRcd>().get(dtSurveys);
692  iSetup.get<DTSurveyErrorRcd>().get(dtSurveyErrors);
693  iSetup.get<CSCSurveyRcd>().get(cscSurveys);
694  iSetup.get<CSCSurveyErrorRcd>().get(cscSurveyErrors);
695 
696  theSurveyIndex = 0;
697  theSurveyValues = &*dtSurveys;
698  theSurveyErrors = &*dtSurveyErrors;
699  std::vector<Alignable*> barrels = theAlignableMuon->DTBarrel();
700  for (std::vector<Alignable*>::const_iterator iter = barrels.begin(); iter != barrels.end(); ++iter) {
701  addSurveyInfo_(*iter);
702  }
703 
704  theSurveyIndex = 0;
705  theSurveyValues = &*cscSurveys;
706  theSurveyErrors = &*cscSurveyErrors;
707  std::vector<Alignable*> endcaps = theAlignableMuon->CSCEndcaps();
708  for (std::vector<Alignable*>::const_iterator iter = endcaps.begin(); iter != endcaps.end(); ++iter) {
709  addSurveyInfo_(*iter);
710  }
711  }
712  }
713 
714 }
715 
716 
718 // a templated method - but private, so not accessible from outside
719 // ==> does not have to be in header file
720 template<class G, class Rcd, class ErrRcd>
722  const AlignTransform &globalCoordinates) const
723 {
724  // 'G' is the geometry class for that DB should be applied,
725  // 'Rcd' is the record class for its Alignments
726  // 'ErrRcd' is the record class for its AlignmentErrors
727  // 'globalCoordinates' are global transformation for this geometry
728 
729  const Rcd & record = iSetup.get<Rcd>();
731  const edm::ValidityInterval & validity = record.validityInterval();
732  const edm::IOVSyncValue first = validity.first();
733  const edm::IOVSyncValue last = validity.last();
734  if (first!=edm::IOVSyncValue::beginOfTime() ||
736  throw cms::Exception("DatabaseError")
737  << "@SUB=AlignmentProducer::applyDB"
738  << "\nTrying to apply "
739  << record.key().name()
740  << " with multiple IOVs in tag.\n"
741  << "Validity range is "
742  << first.eventID().run() << " - " << last.eventID().run();
743  }
744  }
745 
746  edm::ESHandle<Alignments> alignments;
747  record.get(alignments);
748 
749  edm::ESHandle<AlignmentErrors> alignmentErrors;
750  iSetup.get<ErrRcd>().get(alignmentErrors);
751 
752  GeometryAligner aligner;
753  aligner.applyAlignments<G>(geometry, &(*alignments), &(*alignmentErrors),
754  globalCoordinates);
755 }
756 
757 
759 // a templated method - but private, so not accessible from outside
760 // ==> does not have to be in header file
761 template<class G, class DeformationRcd>
763 {
764  // 'G' is the geometry class for that DB should be applied,
765  // 'DeformationRcd' is the record class for its surface deformations
766 
767  const DeformationRcd & record = iSetup.get<DeformationRcd>();
769  const edm::ValidityInterval & validity = record.validityInterval();
770  const edm::IOVSyncValue first = validity.first();
771  const edm::IOVSyncValue last = validity.last();
772  if (first!=edm::IOVSyncValue::beginOfTime() ||
774  throw cms::Exception("DatabaseError")
775  << "@SUB=AlignmentProducer::applyDB"
776  << "\nTrying to apply "
777  << record.key().name()
778  << " with multiple IOVs in tag.\n"
779  << "Validity range is "
780  << first.eventID().run() << " - " << last.eventID().run();
781  }
782  }
784  record.get(surfaceDeformations);
785 
786  GeometryAligner aligner;
787  aligner.attachSurfaceDeformations<G>(geometry, &(*surfaceDeformations));
788 }
789 
792 {
793  if ( doTracker_ ) { // first tracker
794  const AlignTransform *trackerGlobal = 0; // will be 'removed' from constants
795  if (globalPositions_) { // i.e. applied before in applyDB
798  }
799 
800  Alignments *alignments = theAlignableTracker->alignments();
802  this->writeDB(alignments, "TrackerAlignmentRcd",
803  alignmentErrors, "TrackerAlignmentErrorRcd", trackerGlobal,
804  time);
805  }
806 
807  if ( doMuon_ ) { // now muon
808  const AlignTransform *muonGlobal = 0; // will be 'removed' from constants
809  if (globalPositions_) { // i.e. applied before in applyDB
811  DetId(DetId::Muon));
812  }
813  // Get alignments+errors, first DT - ownership taken over by writeDB(..), so no delete
814  Alignments *alignments = theAlignableMuon->dtAlignments();
815  AlignmentErrors *alignmentErrors = theAlignableMuon->dtAlignmentErrors();
816  this->writeDB(alignments, "DTAlignmentRcd",
817  alignmentErrors, "DTAlignmentErrorRcd", muonGlobal,
818  time);
819 
820  // Get alignments+errors, now CSC - ownership taken over by writeDB(..), so no delete
821  alignments = theAlignableMuon->cscAlignments();
822  alignmentErrors = theAlignableMuon->cscAlignmentErrors();
823  this->writeDB(alignments, "CSCAlignmentRcd",
824  alignmentErrors, "CSCAlignmentErrorRcd", muonGlobal,
825  time);
826  }
827 
828  // Save surface deformations to database
830  AlignmentSurfaceDeformations *alignmentSurfaceDeformations = theAlignableTracker->surfaceDeformations();
831  this->writeDB(alignmentSurfaceDeformations, "TrackerSurfaceDeformationRcd", time);
832  }
833 }
834 
837  const std::string &alignRcd,
838  AlignmentErrors *alignmentErrors,
839  const std::string &errRcd,
840  const AlignTransform *globalCoordinates,
841  cond::Time_t time) const
842 {
843  Alignments * tempAlignments = alignments;
844  AlignmentErrors * tempAlignmentErrors = alignmentErrors;
845 
846  // Call service
848  if (!poolDb.isAvailable()) { // Die if not available
849  delete tempAlignments; // promised to take over ownership...
850  delete tempAlignmentErrors; // dito
851  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
852  }
853 
854  if (globalCoordinates // happens only if (applyDbAlignment_ == true)
855  && globalCoordinates->transform() != AlignTransform::Transform::Identity) {
856 
857  tempAlignments = new Alignments(); // temporary storage for
858  tempAlignmentErrors = new AlignmentErrors(); // final alignments and errors
859 
860  GeometryAligner aligner;
861  aligner.removeGlobalTransform(alignments, alignmentErrors,
862  *globalCoordinates,
863  tempAlignments, tempAlignmentErrors);
864 
865  delete alignments; // have to delete original alignments
866  delete alignmentErrors; // same thing for the errors
867 
868  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::writeDB"
869  << "globalCoordinates removed from alignments (" << alignRcd
870  << ") and errors (" << alignRcd << ").";
871  }
872 
873  if (saveToDB_) {
874  edm::LogInfo("Alignment") << "Writing Alignments to " << alignRcd << ".";
875  poolDb->writeOne<Alignments>(tempAlignments, time, alignRcd);
876  } else { // poolDb->writeOne(..) takes over 'alignments' ownership,...
877  delete tempAlignments; // ...otherwise we have to delete, as promised!
878  }
879 
880  if (saveApeToDB_) {
881  edm::LogInfo("Alignment") << "Writing AlignmentErrors to " << errRcd << ".";
882  poolDb->writeOne<AlignmentErrors>(tempAlignmentErrors, time, errRcd);
883  } else { // poolDb->writeOne(..) takes over 'alignmentErrors' ownership,...
884  delete tempAlignmentErrors; // ...otherwise we have to delete, as promised!
885  }
886 }
887 
888 
890 void AlignmentProducer::writeDB(AlignmentSurfaceDeformations *alignmentSurfaceDeformations,
891  const std::string &surfaceDeformationRcd,
892  cond::Time_t time) const
893 {
894  // Call service
896  if (!poolDb.isAvailable()) { // Die if not available
897  delete alignmentSurfaceDeformations; // promised to take over ownership...
898  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
899  }
900 
901  if (saveDeformationsToDB_) {
902  edm::LogInfo("Alignment") << "Writing AlignmentSurfaceDeformations to "
903  << surfaceDeformationRcd << ".";
904  poolDb->writeOne<AlignmentSurfaceDeformations>(alignmentSurfaceDeformations, time,
905  surfaceDeformationRcd);
906  } else { // poolDb->writeOne(..) takes over 'surfaceDeformation' ownership,...
907  delete alignmentSurfaceDeformations; // ...otherwise we have to delete, as promised!
908  }
909 }
910 
913 {
914  static bool oldRunRangeSelectionWarning = false;
915 
918 
919  RunRanges uniqueRunRanges;
920  if (!RunRangeSelectionVPSet.empty()) {
921 
922  std::map<RunNumber,RunNumber> uniqueFirstRunNumbers;
923 
924  for (std::vector<edm::ParameterSet>::const_iterator ipset = RunRangeSelectionVPSet.begin();
925  ipset != RunRangeSelectionVPSet.end();
926  ++ipset) {
927  const std::vector<std::string> RunRangeStrings = (*ipset).getParameter<std::vector<std::string> >("RunRanges");
928  for (std::vector<std::string>::const_iterator irange = RunRangeStrings.begin();
929  irange != RunRangeStrings.end();
930  ++irange) {
931 
932  if ((*irange).find(':')==std::string::npos) {
933 
934  RunNumber first = beginValue;
935  long int temp = strtol((*irange).c_str(), 0, 0);
936  if (temp!=-1) first = temp;
937  uniqueFirstRunNumbers[first] = first;
938 
939  } else {
940 
941  if (!oldRunRangeSelectionWarning) {
942  edm::LogWarning("BadConfig") << "@SUB=AlignmentProducer::makeNonOverlappingRunRanges"
943  << "Config file contains old format for 'RunRangeSelection'. Only the start run\n"
944  << "number is used internally. The number of the last run is ignored and can be\n"
945  << "safely removed from the config file.\n";
946  oldRunRangeSelectionWarning = true;
947  }
948 
949  std::vector<std::string> tokens = edm::tokenize(*irange, ":");
950  long int temp;
951  RunNumber first = beginValue;
952  temp = strtol(tokens[0].c_str(), 0, 0);
953  if (temp!=-1) first = temp;
954  uniqueFirstRunNumbers[first] = first;
955  }
956  }
957  }
958 
959  for (std::map<RunNumber,RunNumber>::iterator iFirst = uniqueFirstRunNumbers.begin();
960  iFirst!=uniqueFirstRunNumbers.end();
961  ++iFirst) {
962  uniqueRunRanges.push_back(std::pair<RunNumber,RunNumber>((*iFirst).first, endValue));
963  }
964  for (unsigned int i = 0;i<uniqueRunRanges.size()-1;++i) {
965  uniqueRunRanges[i].second = uniqueRunRanges[i+1].first - 1;
966  }
967 
968  } else {
969 
970  uniqueRunRanges.push_back(std::pair<RunNumber,RunNumber>(beginValue, endValue));
971 
972  }
973 
974  return uniqueRunRanges;
975 }
976 
RunNumber_t run() const
Definition: EventID.h:42
std::vector< Alignable * > Alignables
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
align::Scalar width() const
AlignmentProducer(const edm::ParameterSet &iConfig)
Constructor.
virtual void beginLuminosityBlock(const edm::EventSetup &setup)
called at begin of luminosity block (no lumi block info passed yet)
virtual void beginRun(const edm::EventSetup &setup)
called at begin of run
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:177
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual void terminate()=0
Call at end of job (must be implemented in derived class)
AlignmentErrors * dtAlignmentErrors()
boost::shared_ptr< TrackerGeometry > theTracker
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:91
const bool doMisalignmentScenario_
RunID const & id() const
Definition: RunBase.h:41
virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo)=0
Run the algorithm (must be implemented in derived class)
Builds a scenario from configuration and applies it to the alignable Muon.
AlignmentAlgorithmBase * theAlignmentAlgo
~AlignmentProducer()
Destructor.
const EventID & eventID() const
Definition: IOVSyncValue.h:42
virtual boost::shared_ptr< TrackerGeometry > produceTracker(const TrackerDigiGeometryRecord &iRecord)
Produce the tracker geometry.
Time_t beginValue
Definition: Time.h:45
Class to update a given geometry with a set of alignments.
void simpleMisalignment_(const Alignables &alivec, const std::string &selection, float shift, float rot, bool local)
Apply random shifts and rotations to selected alignables, according to configuration.
JetCorrectorParameters::Record record
Definition: classes.h:11
void readInSurveyRcds(const edm::EventSetup &)
read in survey records
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
ErrorMatrix matrix() const
Definition: SurveyError.h:72
virtual boost::shared_ptr< DTGeometry > produceDT(const MuonGeometryRecord &iRecord)
Produce the muon DT geometry.
align::Alignables DTBarrel()
selection
main part
Definition: corrVsCorr.py:98
virtual void endLuminosityBlock(const edm::EventSetup &setup)
called at end of luminosity block (no lumi block info passed yet)
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup)
Called at run start and calling algorithms beginRun.
#define abs(x)
Definition: mlp_lapack.h:159
#define DEFINE_FWK_LOOPER(type)
virtual Status endOfLoop(const edm::EventSetup &, unsigned int iLoop)
Called at end of loop.
edm::ParameterSet theParameterSet
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
const std::vector< bool > & selector(void) const
Get alignment parameter selector vector.
void setWidth(align::Scalar width)
TRandom random
Definition: MVATrainer.cc:138
const edm::InputTag tkLasBeamTag_
const Alignments * theSurveyValues
void addSurveyInfo_(Alignable *)
Add survey info to an alignable.
uint8_t structureType() const
Definition: SurveyError.h:62
void createGeometries_(const edm::EventSetup &)
Create tracker and muon geometries.
virtual Alignables components() const =0
Return vector of all direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:14
std::string encode() const
Definition: InputTag.cc:72
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:57
void removeGlobalTransform(const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates, Alignments *newAlignments, AlignmentErrors *newAlignmentErrors)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const bool applyDbAlignment_
define event information passed to algorithms
tuple s2
Definition: indexGen.py:106
const IOVSyncValue & last() const
virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup)
called at end of run - order of arguments like in EDProducer etc.
AlignmentAlgorithmBase::RunNumber RunNumber
void build(boost::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
void setLength(align::Scalar length)
const unsigned int theMaxLoops
const AlgebraicVector & parameters(void) const
Get alignment parameters.
AlignableExtras * theAlignableExtras
virtual bool setParametersForRunRange(const RunRange &rr)
Alignments * dtAlignments()
unsigned long long Time_t
Definition: Time.h:16
align::Alignables CSCEndcaps()
const bool checkDbAlignmentValidity_
boost::shared_ptr< CSCGeometry > theMuonCSC
static const IOVSyncValue & beginOfTime()
const edm::InputTag clusterValueMapTag_
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
bool isAvailable() const
Definition: Service.h:47
unsigned int theSurveyIndex
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
AlignmentErrors * alignmentErrors() const
Return alignment errors, sorted by DetId.
AlignmentErrors * cscAlignmentErrors()
std::vector< AlignmentMonitorBase * > theMonitors
void writeDB(Alignments *alignments, const std::string &alignRcd, AlignmentErrors *alignmentErrors, const std::string &errRcd, const AlignTransform *globalCoordinates, cond::Time_t time) const
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates)
virtual void startingNewLoop(unsigned int iLoop)
Called at beginning of loop.
RunRanges makeNonOverlappingRunRanges(const edm::VParameterSet &RunRangeSelectionVPSet)
AlignmentParameterStore * theAlignmentParameterStore
align::ID rawId() const
Definition: SurveyError.h:67
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
AlignmentSurfaceDeformations * surfaceDeformations() const
Return surface deformations, sorted by DetId.
Definition: Alignable.cc:216
virtual void initialize(const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store)=0
Call at beginning of job (must be implemented in derived class)
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the tracker.
boost::shared_ptr< DTGeometry > theMuonDT
void initializeBeamSpot(double x, double y, double z, double dxdz, double dydz)
Initialize the alignable beam spot with the given parameters.
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
const edm::InputTag beamSpotTag_
bool first
Definition: L1TdeRCT.cc:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
virtual void endRun(const edm::Run &run, const edm::EventSetup &setup)
Called at run end - currently reading TkFittedLasBeam if an InpuTag is given for that.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
const SurveyErrors * theSurveyErrors
const edm::InputTag tjTkAssociationMapTag_
edm::ESWatcher< TrackerSurveyErrorRcd > watchTkSurveyErrRcd_
virtual Status duringLoop(const edm::Event &event, const edm::EventSetup &setup)
Called at each event.
Definition: DetId.h:20
AlignableMuon * theAlignableMuon
const bool saveDeformationsToDB_
virtual void endOfJob()
Called at end of job.
AlgebraicVector EulerAngles
Definition: Definitions.h:36
align::Scalar length() const
const double stRandomShift_
virtual void beginOfJob()
Definition: EDLooperBase.cc:72
Transform transform() const
void build(boost::shared_ptr< DTGeometry > theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:209
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
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &setup)
Called at lumi block end, calling algorithm&#39;s endLuminosityBlock.
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Alignments * cscAlignments()
TrackerGeometry * build(const GeometricDet *gd)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
ESHandle< TrackerGeometry > geometry
edm::EventID id() const
Definition: EventBase.h:56
virtual boost::shared_ptr< CSCGeometry > produceCSC(const MuonGeometryRecord &iRecord)
Produce the muon CSC geometry.
edm::ESWatcher< TrackerSurveyRcd > watchTkSurveyRcd_
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
AlignableTracker * theAlignableTracker
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:40
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &setup)
Called at lumi block start, calling algorithm&#39;s beginLuminosityBlock.
std::vector< char > convertParamSel(const std::string &selString) const
Converting std::string into std::vector&lt;char&gt;
static unsigned int const shift
void applyDB(G *geometry, const edm::EventSetup &iSetup, const AlignTransform &globalPosition) const
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
void writeForRunRange(cond::Time_t time)
const IOVSyncValue & first() const
Alignments * alignments() const
Return alignments, sorted by DetId.
Time_t endValue
Definition: Time.h:46
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:21
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
define run information passed to algorithms (in endRun)
Builds a scenario from configuration and applies it to the alignable tracker.
const Alignments * globalPositions_
GlobalPositions that might be read from DB, NULL otherwise.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
Alignables & beamSpot()
Return beam spot alignable as a vector with one element.
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the Muon.
T get(const Candidate &c)
Definition: component.h:56
AlignmentAlgorithmBase::RunRange RunRange
const double stRandomRotation_
Definition: Run.h:33
std::vector< RunRange > RunRanges