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
75 
76 //_____________________________________________________________________________
78  theAlignmentAlgo(0), theAlignmentParameterStore(0),
79  theAlignableExtras(0), theAlignableTracker(0), theAlignableMuon(0),
80  globalPositions_(0),
81  nevent_(0), theParameterSet(iConfig),
82  theMaxLoops( iConfig.getUntrackedParameter<unsigned int>("maxLoops") ),
83  stNFixAlignables_(iConfig.getParameter<int>("nFixAlignables") ),
84  stRandomShift_(iConfig.getParameter<double>("randomShift")),
85  stRandomRotation_(iConfig.getParameter<double>("randomRotation")),
86  applyDbAlignment_( iConfig.getUntrackedParameter<bool>("applyDbAlignment")),
87  checkDbAlignmentValidity_( iConfig.getUntrackedParameter<bool>("checkDbAlignmentValidity")),
88  doMisalignmentScenario_(iConfig.getParameter<bool>("doMisalignmentScenario")),
89  saveToDB_(iConfig.getParameter<bool>("saveToDB")),
90  saveApeToDB_(iConfig.getParameter<bool>("saveApeToDB")),
91  saveDeformationsToDB_(iConfig.getParameter<bool>("saveDeformationsToDB")),
92  doTracker_( iConfig.getUntrackedParameter<bool>("doTracker") ),
93  doMuon_( iConfig.getUntrackedParameter<bool>("doMuon") ),
94  useExtras_( iConfig.getUntrackedParameter<bool>("useExtras") ),
95  useSurvey_( iConfig.getParameter<bool>("useSurvey") ),
96  tjTkAssociationMapTag_(iConfig.getParameter<edm::InputTag>("tjTkAssociationMapTag")),
97  beamSpotTag_(iConfig.getParameter<edm::InputTag>("beamSpotTag")),
98  tkLasBeamTag_(iConfig.getParameter<edm::InputTag>("tkLasBeamTag")),
99  clusterValueMapTag_(iConfig.getParameter<edm::InputTag>("hitPrescaleMapTag"))
100 {
101  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::AlignmentProducer";
102 
103  // Tell the framework what data is being produced
104  if (doTracker_) {
106  }
107  if (doMuon_) {
110  }
111 
112  // Create the alignment algorithm
113  edm::ParameterSet algoConfig = iConfig.getParameter<edm::ParameterSet>( "algoConfig" );
114  edm::VParameterSet iovSelection = iConfig.getParameter<edm::VParameterSet>( "RunRangeSelection" );
115  algoConfig.addUntrackedParameter<edm::VParameterSet>( "RunRangeSelection", iovSelection );
116  std::string algoName = algoConfig.getParameter<std::string>( "algoName" );
117  theAlignmentAlgo = AlignmentAlgorithmPluginFactory::get( )->create( algoName, algoConfig );
118 
119  // Check if found
120  if ( !theAlignmentAlgo )
121  throw cms::Exception("BadConfig") << "Couldn't find algorithm called " << algoName;
122 
123  // Now create monitors:
124  edm::ParameterSet monitorConfig = iConfig.getParameter<edm::ParameterSet>( "monitorConfig" );
125  std::vector<std::string> monitors = monitorConfig.getUntrackedParameter<std::vector<std::string> >( "monitors" );
126  for (std::vector<std::string>::const_iterator miter = monitors.begin(); miter != monitors.end(); ++miter) {
127  AlignmentMonitorBase* newMonitor = AlignmentMonitorPluginFactory::get()->create(*miter, monitorConfig.getUntrackedParameter<edm::ParameterSet>(*miter));
128 
129  if (!newMonitor) throw cms::Exception("BadConfig") << "Couldn't find monitor named " << *miter;
130 
131  theMonitors.push_back(newMonitor);
132  }
133 
134  // Finally create integrated calibrations:
135  edm::VParameterSet calibrations = iConfig.getParameter<edm::VParameterSet>("calibrations");
136  for (auto iCalib = calibrations.begin(); iCalib != calibrations.end(); ++iCalib) {
137  const std::string name(iCalib->getParameter<std::string>("calibrationName"));
139  // exception comes from line before: if (!theCalibrations.back()) throw cms::Exception(..) << ..;
140  }
141 
142 }
143 
144 
145 //_____________________________________________________________________________
146 // Delete new objects
148 {
149  delete theAlignmentAlgo;
150 
151  // Delete monitors as well??
152 
153  for (auto iCal = theCalibrations.begin(); iCal != theCalibrations.end(); ++iCal) {
154  delete *iCal; // delete integrated calibration pointed to by (*iCal)
155  }
156 
158  delete theAlignableExtras;
159  delete theAlignableTracker;
160  delete theAlignableMuon;
161 
162  delete globalPositions_;
163 }
164 
165 
166 //_____________________________________________________________________________
167 // Produce tracker geometry
168 boost::shared_ptr<TrackerGeometry>
170 {
171  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceTracker";
172  return theTracker;
173 }
174 
175 //_____________________________________________________________________________
176 // Produce muonDT geometry
177 boost::shared_ptr<DTGeometry>
179 {
180  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceDT";
181  return theMuonDT;
182 }
183 
184 //_____________________________________________________________________________
185 // Produce muonCSC geometry
186 boost::shared_ptr<CSCGeometry>
188 {
189  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::produceCSC";
190  return theMuonCSC;
191 }
192 
193 
194 //_____________________________________________________________________________
195 // Initialize algorithm
197 {
198  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob";
199 
200  //Retrieve tracker topology from geometry
201  edm::ESHandle<TrackerTopology> tTopoHandle;
202  iSetup.get<IdealGeometryRecord>().get(tTopoHandle);
203  const TrackerTopology* const tTopo = tTopoHandle.product();
204 
205  // Create the geometries from the ideal geometries (first time only)
206  this->createGeometries_( iSetup );
207 
208  // Retrieve and apply alignments, if requested (requires DB setup)
209  if ( applyDbAlignment_ ) {
210  // we need GlobalPositionRcd - and have to keep track for later removal
211  // before writing again to DB...
212  edm::ESHandle<Alignments> globalPositionRcd;
213  iSetup.get<GlobalPositionRcd>().get(globalPositionRcd);
214  globalPositions_ = new Alignments(*globalPositionRcd);
215 
216  if ( doTracker_ ) { // apply to tracker
217  this->applyDB<TrackerGeometry,TrackerAlignmentRcd,TrackerAlignmentErrorRcd>
218  (&(*theTracker), iSetup,
220  this->applyDB<TrackerGeometry,TrackerSurfaceDeformationRcd>(&(*theTracker), iSetup);
221  }
222 
223  if ( doMuon_ ) { // apply to tracker
224  this->applyDB<DTGeometry,DTAlignmentRcd,DTAlignmentErrorRcd>
225  (&(*theMuonDT), iSetup,
227  this->applyDB<CSCGeometry,CSCAlignmentRcd,CSCAlignmentErrorRcd>
228  (&(*theMuonCSC), iSetup,
230  }
231  }
232 
233  // Create alignable tracker and muon
234  if (doTracker_) {
235  theAlignableTracker = new AlignableTracker( &(*theTracker), tTopo );
236  }
237 
238  if (doMuon_) {
240  }
241 
242  if (useExtras_) {
244  }
245 
246  // Create alignment parameter builder
247  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
248  << "Creating AlignmentParameterBuilder";
249  edm::ParameterSet aliParamBuildCfg =
250  theParameterSet.getParameter<edm::ParameterSet>("ParameterBuilder");
251  AlignmentParameterBuilder alignmentParameterBuilder(theAlignableTracker,
254  aliParamBuildCfg );
255  // Fix alignables if requested
256  if (stNFixAlignables_>0) alignmentParameterBuilder.fixAlignables(stNFixAlignables_);
257 
258  // Get list of alignables
259  Alignables theAlignables = alignmentParameterBuilder.alignables();
260  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
261  << "got " << theAlignables.size() << " alignables";
262 
263  // Create AlignmentParameterStore
264  edm::ParameterSet aliParamStoreCfg =
266  theAlignmentParameterStore = new AlignmentParameterStore(theAlignables, aliParamStoreCfg);
267  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
268  << "AlignmentParameterStore created!";
269 
270  // Apply misalignment scenario to alignable tracker and muon if requested
271  // WARNING: this assumes scenarioConfig can be passed to both muon and tracker
273  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
274  << "Applying misalignment scenario to "
275  << (doTracker_ ? "tracker" : "")
276  << (doMuon_ ? (doTracker_ ? " and muon" : "muon") : ".");
277  edm::ParameterSet scenarioConfig
278  = theParameterSet.getParameter<edm::ParameterSet>( "MisalignmentScenario" );
279  if (doTracker_) {
280  TrackerScenarioBuilder scenarioBuilder( theAlignableTracker );
281  scenarioBuilder.applyScenario( scenarioConfig );
282  }
283  if (doMuon_) {
284  MuonScenarioBuilder muonScenarioBuilder( theAlignableMuon );
285  muonScenarioBuilder.applyScenario( scenarioConfig );
286  }
287  } else {
288  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::beginOfJob"
289  << "NOT applying misalignment scenario!";
290  }
291 
292  // Apply simple misalignment
293  const std::string sParSel(theParameterSet.getParameter<std::string>("parameterSelectorSimple"));
294  this->simpleMisalignment_(theAlignables, sParSel, stRandomShift_, stRandomRotation_, true);
295 
296  // Initialize alignment algorithm and integrated calibration and pass the latter to algorithm
297  theAlignmentAlgo->initialize( iSetup,
299  theAlignmentParameterStore );
300  for (auto iCal = theCalibrations.begin(); iCal != theCalibrations.end(); ++iCal) {
302  }
303  // Not all algorithms support calibrations - so do not pass empty vector
304  // and throw if non-empty and not supported:
306  throw cms::Exception("BadConfig") << "[AlignmentProducer::beginOfJob]\n"
307  << "Configured " << theCalibrations.size() << " calibration(s) "
308  << "for algorithm not supporting it.";
309  }
310 
311  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin();
312  monitor != theMonitors.end(); ++monitor) {
313  (*monitor)->beginOfJob(theAlignableTracker, theAlignableMuon, theAlignmentParameterStore);
314  }
315 }
316 
317 //_____________________________________________________________________________
318 // Terminate algorithm
320 {
321  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfJob";
322 
323  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin(); monitor != theMonitors.end(); ++monitor) {
324  (*monitor)->endOfJob();
325  }
326 
327  if (0 == nevent_) {
328  edm::LogError("Alignment") << "@SUB=AlignmentProducer::endOfJob" << "Did not process any "
329  << "events in last loop, do not dare to store to DB.";
330  } else {
331 
332  // Expand run ranges and make them unique
333  edm::VParameterSet runRangeSelectionVPSet(theParameterSet.getParameter<edm::VParameterSet>("RunRangeSelection"));
334  RunRanges uniqueRunRanges(this->makeNonOverlappingRunRanges(runRangeSelectionVPSet));
335  if (uniqueRunRanges.empty()) { // create dummy IOV
336  const RunRange runRange(cond::timeTypeSpecs[cond::runnumber].beginValue,
338  uniqueRunRanges.push_back(runRange);
339  }
340 
341  std::vector<AlgebraicVector> beamSpotParameters;
342 
343  for (RunRanges::const_iterator iRunRange = uniqueRunRanges.begin();
344  iRunRange != uniqueRunRanges.end();
345  ++iRunRange) {
346 
348 
349  // Save alignments to database
351  this->writeForRunRange((*iRunRange).first);
352 
353  // Deal with extra alignables, e.g. beam spot
354  if (theAlignableExtras) {
356  if (!alis.empty()) {
357  BeamSpotAlignmentParameters *beamSpotAliPars = dynamic_cast<BeamSpotAlignmentParameters*>(alis[0]->alignmentParameters());
358  beamSpotParameters.push_back(beamSpotAliPars->parameters());
359  }
360  }
361  }
362 
363  if (theAlignableExtras) {
364  std::ostringstream bsOutput;
365 
366  std::vector<AlgebraicVector>::const_iterator itPar = beamSpotParameters.begin();
367  for (RunRanges::const_iterator iRunRange = uniqueRunRanges.begin();
368  iRunRange != uniqueRunRanges.end();
369  ++iRunRange, ++itPar) {
370  bsOutput << "Run range: " << (*iRunRange).first << " - " << (*iRunRange).second << "\n";
371  bsOutput << " Displacement: x=" << (*itPar)[0] << ", y=" << (*itPar)[1] << "\n";
372  bsOutput << " Slope: dx/dz=" << (*itPar)[2] << ", dy/dz=" << (*itPar)[3] << "\n";
373  }
374 
375  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfJob"
376  << "Parameters for alignable beamspot:\n"
377  << bsOutput.str();
378  }
379 
380  for (auto iCal = theCalibrations.begin(); iCal != theCalibrations.end(); ++iCal) {
381  (*iCal)->endOfJob();
382  }
383 
384  }
385 }
386 
387 //_____________________________________________________________________________
388 // Called at beginning of loop
389 void AlignmentProducer::startingNewLoop(unsigned int iLoop )
390 {
391  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::startingNewLoop"
392  << "Starting loop number " << iLoop;
393 
394  nevent_ = 0;
395 
397  // FIXME: Should this be done in algorithm::startNewLoop()??
398  for (auto iCal = theCalibrations.begin(); iCal != theCalibrations.end(); ++iCal) {
399  (*iCal)->startNewLoop();
400  }
401 
402  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin(); monitor != theMonitors.end(); ++monitor) {
403  (*monitor)->startingNewLoop();
404  }
405 
406  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::startingNewLoop"
407  << "Now physically apply alignments to geometry...";
408 
409 
410  // Propagate changes to reconstruction geometry (from initialisation or iteration)
411  GeometryAligner aligner;
412  if ( doTracker_ ) {
413  std::auto_ptr<Alignments> alignments(theAlignableTracker->alignments());
414  std::auto_ptr<AlignmentErrors> alignmentErrors(theAlignableTracker->alignmentErrors());
415  aligner.applyAlignments<TrackerGeometry>( &(*theTracker),&(*alignments),&(*alignmentErrors), AlignTransform() ); // don't apply global a second time!
416  std::auto_ptr<AlignmentSurfaceDeformations> aliDeforms(theAlignableTracker->surfaceDeformations());
417  aligner.attachSurfaceDeformations<TrackerGeometry>(&(*theTracker), &(*aliDeforms));
418 
419  }
420  if ( doMuon_ ) {
421  std::auto_ptr<Alignments> dtAlignments( theAlignableMuon->dtAlignments());
422  std::auto_ptr<AlignmentErrors> dtAlignmentErrors( theAlignableMuon->dtAlignmentErrors());
423  std::auto_ptr<Alignments> cscAlignments( theAlignableMuon->cscAlignments());
424  std::auto_ptr<AlignmentErrors> cscAlignmentErrors( theAlignableMuon->cscAlignmentErrors());
425 
426  aligner.applyAlignments<DTGeometry>( &(*theMuonDT), &(*dtAlignments), &(*dtAlignmentErrors), AlignTransform() ); // don't apply global a second time!
427  aligner.applyAlignments<CSCGeometry>( &(*theMuonCSC), &(*cscAlignments), &(*cscAlignmentErrors), AlignTransform() ); // nope!
428  }
429 }
430 
431 
432 //_____________________________________________________________________________
433 // Called at end of loop
435 AlignmentProducer::endOfLoop(const edm::EventSetup& iSetup, unsigned int iLoop)
436 {
437 
438  if (0 == nevent_) {
439  // beginOfJob is usually called by the framework in the first event of the first loop
440  // (a hack: beginOfJob needs the EventSetup that is not well defined without an event)
441  // and the algorithms rely on the initialisations done in beginOfJob. We cannot call
442  // this->beginOfJob(iSetup); here either since that will access the EventSetup to get
443  // some geometry information that is not defined either without having seen an event.
444  edm::LogError("Alignment") << "@SUB=AlignmentProducer::endOfLoop"
445  << "Did not process any events in loop " << iLoop
446  << ", stop processing without terminating algorithm.";
447  return kStop;
448  }
449 
450  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endOfLoop"
451  << "Ending loop " << iLoop << ", terminating algorithm.";
452 
453  theAlignmentAlgo->terminate(iSetup);
454  // FIXME: Should this be done in algorithm::terminate(const edm::EventSetup& iSetup)??
455  for (auto iCal = theCalibrations.begin(); iCal != theCalibrations.end(); ++iCal) {
456  (*iCal)->endOfLoop();
457  }
458 
459  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin(); monitor != theMonitors.end(); ++monitor) {
460  (*monitor)->endOfLoop(iSetup);
461  }
462 
463  if ( iLoop == theMaxLoops-1 || iLoop >= theMaxLoops ) return kStop;
464  else return kContinue;
465 }
466 
467 //_____________________________________________________________________________
468 // Called at each event
471  const edm::EventSetup& setup )
472 {
473  ++nevent_;
474 
475  // reading in survey records
476  this->readInSurveyRcds(setup);
477 
478  // Printout event number
479  for ( int i=10; i<10000000; i*=10 )
480  if ( nevent_<10*i && (nevent_%i)==0 )
481  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::duringLoop"
482  << "Events processed: " << nevent_;
483 
484  // Retrieve trajectories and tracks from the event
485  // -> merely skip if collection is empty
487  if (event.getByLabel(tjTkAssociationMapTag_, m_TrajTracksMap)) {
488 
489  // Form pairs of trajectories and tracks
490  ConstTrajTrackPairCollection trajTracks;
491  for ( TrajTrackAssociationCollection::const_iterator iPair = m_TrajTracksMap->begin();
492  iPair != m_TrajTracksMap->end(); ++iPair) {
493  trajTracks.push_back( ConstTrajTrackPair( &(*(*iPair).key), &(*(*iPair).val) ) );
494  }
496  event.getByLabel(beamSpotTag_, beamSpot);
497 
498  if (nevent_==1 && theAlignableExtras) {
499  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::duringLoop"
500  << "initializing AlignableBeamSpot" << std::endl;
501  theAlignableExtras->initializeBeamSpot(beamSpot->x0(), beamSpot->y0(), beamSpot->z0(),
502  beamSpot->dxdz(), beamSpot->dydz());
503  }
504 
505  // Run the alignment algorithm with its input
506  const AliClusterValueMap *clusterValueMapPtr = 0;
507  if(clusterValueMapTag_.encode().size()){//check that the input tag is not empty
508  edm::Handle<AliClusterValueMap> clusterValueMap;
509  event.getByLabel(clusterValueMapTag_, clusterValueMap);
510  clusterValueMapPtr = &(*clusterValueMap);
511  }
512 
513  const AlignmentAlgorithmBase::EventInfo eventInfo(event.id(), trajTracks, *beamSpot,
514  clusterValueMapPtr);
515  theAlignmentAlgo->run(setup, eventInfo);
516 
517 
518  for (std::vector<AlignmentMonitorBase*>::const_iterator monitor = theMonitors.begin();
519  monitor != theMonitors.end(); ++monitor) {
520  (*monitor)->duringLoop(event, setup, trajTracks); // forward eventInfo?
521  }
522  } else {
523  edm::LogError("Alignment") << "@SUB=AlignmentProducer::duringLoop"
524  << "No track collection found: skipping event";
525  }
526 
527 
528  return kContinue;
529 }
530 
531 // ----------------------------------------------------------------------------
533 {
534  theAlignmentAlgo->beginRun(setup); // do not forward edm::Run...
535 }
536 
537 // ----------------------------------------------------------------------------
539 {
540  // call with or without las beam info...
541  typedef AlignmentAlgorithmBase::EndRunInfo EndRunInfo;
542  if (tkLasBeamTag_.encode().size()) { // non-empty InputTag
545  run.getByLabel(tkLasBeamTag_, lasBeams);
546  run.getByLabel(tkLasBeamTag_, tsoses);
547 
548  theAlignmentAlgo->endRun(EndRunInfo(run.id(), &(*lasBeams), &(*tsoses)), setup);
549  } else {
550  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::endRun"
551  << "No Tk LAS beams to forward to algorithm.";
552  theAlignmentAlgo->endRun(EndRunInfo(run.id(), 0, 0), setup);
553  }
554 }
555 
556 // ----------------------------------------------------------------------------
558  const edm::EventSetup &setup)
559 {
560  theAlignmentAlgo->beginLuminosityBlock(setup); // do not forward edm::LuminosityBlock
561 }
562 
563 // ----------------------------------------------------------------------------
565  const edm::EventSetup &setup)
566 {
567  theAlignmentAlgo->endLuminosityBlock(setup); // do not forward edm::LuminosityBlock
568 }
569 
570 // ----------------------------------------------------------------------------
571 
573  float shift, float rot, bool local)
574 {
575 
576  std::ostringstream output; // collecting output
577 
578  if (shift > 0. || rot > 0.) {
579  output << "Adding random flat shift of max size " << shift
580  << " and adding random flat rotation of max size " << rot <<" to ";
581 
582  std::vector<bool> commSel(0);
583  if (selection != "-1") {
584  AlignmentParameterSelector aSelector(0,0); // no alignable needed here...
585  const std::vector<char> cSel(aSelector.convertParamSel(selection));
586  if (cSel.size() < RigidBodyAlignmentParameters::N_PARAM) {
587  throw cms::Exception("BadConfig")
588  << "[AlignmentProducer::simpleMisalignment_]\n"
589  << "Expect selection string '" << selection << "' to be at least of length "
590  << RigidBodyAlignmentParameters::N_PARAM << " or to be '-1'.\n"
591  << "(Most probably you have to adjust the parameter 'parameterSelectorSimple'.)";
592  }
593  for (std::vector<char>::const_iterator cIter = cSel.begin(); cIter != cSel.end(); ++cIter) {
594  commSel.push_back(*cIter == '0' ? false : true);
595  }
596  output << "parameters defined by (" << selection
597  << "), representing (x,y,z,alpha,beta,gamma),";
598  } else {
599  output << "the active parameters of each alignable,";
600  }
601  output << " in " << (local ? "local" : "global") << " frame.";
602 
603  for (std::vector<Alignable*>::const_iterator it = alivec.begin(); it != alivec.end(); ++it) {
604  Alignable* ali=(*it);
605  std::vector<bool> mysel(commSel.empty() ? ali->alignmentParameters()->selector() : commSel);
606 
607  if (std::abs(shift)>0.00001) {
608  double s0 = 0., s1 = 0., s2 = 0.;
609  if (mysel[RigidBodyAlignmentParameters::dx]) s0 = shift * double(random()%1000-500)/500.;
610  if (mysel[RigidBodyAlignmentParameters::dy]) s1 = shift * double(random()%1000-500)/500.;
611  if (mysel[RigidBodyAlignmentParameters::dz]) s2 = shift * double(random()%1000-500)/500.;
612 
613  if (local) ali->move( ali->surface().toGlobal(align::LocalVector(s0,s1,s2)) );
614  else ali->move( align::GlobalVector(s0,s1,s2) );
615 
616  //AlignmentPositionError ape(dx,dy,dz);
617  //ali->addAlignmentPositionError(ape);
618  }
619 
620  if (std::abs(rot)>0.00001) {
622  if (mysel[RigidBodyAlignmentParameters::dalpha]) r(1)=rot*double(random()%1000-500)/500.;
623  if (mysel[RigidBodyAlignmentParameters::dbeta]) r(2)=rot*double(random()%1000-500)/500.;
624  if (mysel[RigidBodyAlignmentParameters::dgamma]) r(3)=rot*double(random()%1000-500)/500.;
625 
626  const align::RotationType mrot = align::toMatrix(r);
627  if (local) ali->rotateInLocalFrame(mrot);
628  else ali->rotateInGlobalFrame(mrot);
629 
630  //ali->addAlignmentPositionErrorFromRotation(mrot);
631  }
632  } // end loop on alignables
633  } else {
634  output << "No simple misalignment added!";
635  }
636  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::simpleMisalignment_" << output.str();
637 }
638 
639 
640 //__________________________________________________________________________________________________
642 {
644  iSetup.get<IdealGeometryRecord>().get( cpv );
645 
646  if (doTracker_) {
647  edm::ESHandle<GeometricDet> geometricDet;
648  iSetup.get<IdealGeometryRecord>().get( geometricDet );
649  TrackerGeomBuilderFromGeometricDet trackerBuilder;
650  theTracker = boost::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*geometricDet), theParameterSet ));
651  }
652 
653  if (doMuon_) {
655  iSetup.get<MuonNumberingRecord>().get(mdc);
656  DTGeometryBuilderFromDDD DTGeometryBuilder;
658  theMuonDT = boost::shared_ptr<DTGeometry>(new DTGeometry );
659  DTGeometryBuilder.build( theMuonDT, &(*cpv), *mdc);
660  theMuonCSC = boost::shared_ptr<CSCGeometry>( new CSCGeometry );
661  CSCGeometryBuilder.build( theMuonCSC, &(*cpv), *mdc );
662  }
663 }
664 
666 {
667  const std::vector<Alignable*>& comp = ali->components();
668 
669  unsigned int nComp = comp.size();
670 
671  for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo_(comp[i]);
672 
674 
675  if ( ali->id() != error.rawId() ||
676  ali->alignableObjectId() != error.structureType() )
677  {
678  throw cms::Exception("DatabaseError")
679  << "Error reading survey info from DB. Mismatched id!";
680  }
681 
682  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[theSurveyIndex].translation();
683  const CLHEP::HepRotation& rot = theSurveyValues->m_align[theSurveyIndex].rotation();
684 
685  AlignableSurface surf( align::PositionType( pos.x(), pos.y(), pos.z() ),
686  align::RotationType( rot.xx(), rot.xy(), rot.xz(),
687  rot.yx(), rot.yy(), rot.yz(),
688  rot.zx(), rot.zy(), rot.zz() ) );
689 
690  surf.setWidth( ali->surface().width() );
691  surf.setLength( ali->surface().length() );
692 
693  ali->setSurvey( new SurveyDet( surf, error.matrix() ) );
694 
695  ++theSurveyIndex;
696 }
697 
699 
700  // Get Survey Rcds and add Survey Info
701  if ( doTracker_ && useSurvey_ ){
702  bool tkSurveyBool = watchTkSurveyRcd_.check(iSetup);
703  bool tkSurveyErrBool = watchTkSurveyErrRcd_.check(iSetup);
704  edm::LogInfo("Alignment") << "watcher tksurveyrcd: " << tkSurveyBool;
705  edm::LogInfo("Alignment") << "watcher tksurveyerrrcd: " << tkSurveyErrBool;
706  if ( tkSurveyBool || tkSurveyErrBool){
707 
708  edm::LogInfo("Alignment") << "ADDING THE SURVEY INFORMATION";
710  edm::ESHandle<SurveyErrors> surveyErrors;
711 
712  iSetup.get<TrackerSurveyRcd>().get(surveys);
713  iSetup.get<TrackerSurveyErrorRcd>().get(surveyErrors);
714 
715  theSurveyIndex = 0;
716  theSurveyValues = &*surveys;
717  theSurveyErrors = &*surveyErrors;
719  }
720  }
721 
722  if ( doMuon_ && useSurvey_) {
723  bool DTSurveyBool = watchTkSurveyRcd_.check(iSetup);
724  bool DTSurveyErrBool = watchTkSurveyErrRcd_.check(iSetup);
725  bool CSCSurveyBool = watchTkSurveyRcd_.check(iSetup);
726  bool CSCSurveyErrBool = watchTkSurveyErrRcd_.check(iSetup);
727 
728  if ( DTSurveyBool || DTSurveyErrBool || CSCSurveyBool || CSCSurveyErrBool ){
729  edm::ESHandle<Alignments> dtSurveys;
730  edm::ESHandle<SurveyErrors> dtSurveyErrors;
731  edm::ESHandle<Alignments> cscSurveys;
732  edm::ESHandle<SurveyErrors> cscSurveyErrors;
733 
734  iSetup.get<DTSurveyRcd>().get(dtSurveys);
735  iSetup.get<DTSurveyErrorRcd>().get(dtSurveyErrors);
736  iSetup.get<CSCSurveyRcd>().get(cscSurveys);
737  iSetup.get<CSCSurveyErrorRcd>().get(cscSurveyErrors);
738 
739  theSurveyIndex = 0;
740  theSurveyValues = &*dtSurveys;
741  theSurveyErrors = &*dtSurveyErrors;
742  std::vector<Alignable*> barrels = theAlignableMuon->DTBarrel();
743  for (std::vector<Alignable*>::const_iterator iter = barrels.begin(); iter != barrels.end(); ++iter) {
745  }
746 
747  theSurveyIndex = 0;
748  theSurveyValues = &*cscSurveys;
749  theSurveyErrors = &*cscSurveyErrors;
750  std::vector<Alignable*> endcaps = theAlignableMuon->CSCEndcaps();
751  for (std::vector<Alignable*>::const_iterator iter = endcaps.begin(); iter != endcaps.end(); ++iter) {
753  }
754  }
755  }
756 
757 }
758 
759 
761 // a templated method - but private, so not accessible from outside
762 // ==> does not have to be in header file
763 template<class G, class Rcd, class ErrRcd>
765  const AlignTransform &globalCoordinates) const
766 {
767  // 'G' is the geometry class for that DB should be applied,
768  // 'Rcd' is the record class for its Alignments
769  // 'ErrRcd' is the record class for its AlignmentErrors
770  // 'globalCoordinates' are global transformation for this geometry
771 
772  const Rcd & record = iSetup.get<Rcd>();
774  const edm::ValidityInterval & validity = record.validityInterval();
775  const edm::IOVSyncValue first = validity.first();
776  const edm::IOVSyncValue last = validity.last();
777  if (first!=edm::IOVSyncValue::beginOfTime() ||
779  throw cms::Exception("DatabaseError")
780  << "@SUB=AlignmentProducer::applyDB"
781  << "\nTrying to apply "
782  << record.key().name()
783  << " with multiple IOVs in tag.\n"
784  << "Validity range is "
785  << first.eventID().run() << " - " << last.eventID().run();
786  }
787  }
788 
789  edm::ESHandle<Alignments> alignments;
790  record.get(alignments);
791 
792  edm::ESHandle<AlignmentErrors> alignmentErrors;
793  iSetup.get<ErrRcd>().get(alignmentErrors);
794 
795  GeometryAligner aligner;
796  aligner.applyAlignments<G>(geometry, &(*alignments), &(*alignmentErrors),
797  globalCoordinates);
798 }
799 
800 
802 // a templated method - but private, so not accessible from outside
803 // ==> does not have to be in header file
804 template<class G, class DeformationRcd>
806 {
807  // 'G' is the geometry class for that DB should be applied,
808  // 'DeformationRcd' is the record class for its surface deformations
809 
810  const DeformationRcd & record = iSetup.get<DeformationRcd>();
812  const edm::ValidityInterval & validity = record.validityInterval();
813  const edm::IOVSyncValue first = validity.first();
814  const edm::IOVSyncValue last = validity.last();
815  if (first!=edm::IOVSyncValue::beginOfTime() ||
817  throw cms::Exception("DatabaseError")
818  << "@SUB=AlignmentProducer::applyDB"
819  << "\nTrying to apply "
820  << record.key().name()
821  << " with multiple IOVs in tag.\n"
822  << "Validity range is "
823  << first.eventID().run() << " - " << last.eventID().run();
824  }
825  }
827  record.get(surfaceDeformations);
828 
829  GeometryAligner aligner;
830  aligner.attachSurfaceDeformations<G>(geometry, &(*surfaceDeformations));
831 }
832 
835 {
836  if ( doTracker_ ) { // first tracker
837  const AlignTransform *trackerGlobal = 0; // will be 'removed' from constants
838  if (globalPositions_) { // i.e. applied before in applyDB
841  }
842 
843  Alignments *alignments = theAlignableTracker->alignments();
845  this->writeDB(alignments, "TrackerAlignmentRcd",
846  alignmentErrors, "TrackerAlignmentErrorRcd", trackerGlobal,
847  time);
848  }
849 
850  if ( doMuon_ ) { // now muon
851  const AlignTransform *muonGlobal = 0; // will be 'removed' from constants
852  if (globalPositions_) { // i.e. applied before in applyDB
854  DetId(DetId::Muon));
855  }
856  // Get alignments+errors, first DT - ownership taken over by writeDB(..), so no delete
857  Alignments *alignments = theAlignableMuon->dtAlignments();
858  AlignmentErrors *alignmentErrors = theAlignableMuon->dtAlignmentErrors();
859  this->writeDB(alignments, "DTAlignmentRcd",
860  alignmentErrors, "DTAlignmentErrorRcd", muonGlobal,
861  time);
862 
863  // Get alignments+errors, now CSC - ownership taken over by writeDB(..), so no delete
864  alignments = theAlignableMuon->cscAlignments();
865  alignmentErrors = theAlignableMuon->cscAlignmentErrors();
866  this->writeDB(alignments, "CSCAlignmentRcd",
867  alignmentErrors, "CSCAlignmentErrorRcd", muonGlobal,
868  time);
869  }
870 
871  // Save surface deformations to database
873  AlignmentSurfaceDeformations *alignmentSurfaceDeformations = theAlignableTracker->surfaceDeformations();
874  this->writeDB(alignmentSurfaceDeformations, "TrackerSurfaceDeformationRcd", time);
875  }
876 }
877 
880  const std::string &alignRcd,
881  AlignmentErrors *alignmentErrors,
882  const std::string &errRcd,
883  const AlignTransform *globalCoordinates,
884  cond::Time_t time) const
885 {
886  Alignments * tempAlignments = alignments;
887  AlignmentErrors * tempAlignmentErrors = alignmentErrors;
888 
889  // Call service
891  if (!poolDb.isAvailable()) { // Die if not available
892  delete tempAlignments; // promised to take over ownership...
893  delete tempAlignmentErrors; // dito
894  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
895  }
896 
897  if (globalCoordinates // happens only if (applyDbAlignment_ == true)
898  && globalCoordinates->transform() != AlignTransform::Transform::Identity) {
899 
900  tempAlignments = new Alignments(); // temporary storage for
901  tempAlignmentErrors = new AlignmentErrors(); // final alignments and errors
902 
903  GeometryAligner aligner;
904  aligner.removeGlobalTransform(alignments, alignmentErrors,
905  *globalCoordinates,
906  tempAlignments, tempAlignmentErrors);
907 
908  delete alignments; // have to delete original alignments
909  delete alignmentErrors; // same thing for the errors
910 
911  edm::LogInfo("Alignment") << "@SUB=AlignmentProducer::writeDB"
912  << "globalCoordinates removed from alignments (" << alignRcd
913  << ") and errors (" << alignRcd << ").";
914  }
915 
916  if (saveToDB_) {
917  edm::LogInfo("Alignment") << "Writing Alignments for run " << time
918  << " to " << alignRcd << ".";
919  poolDb->writeOne<Alignments>(tempAlignments, time, alignRcd);
920  } else { // poolDb->writeOne(..) takes over 'alignments' ownership,...
921  delete tempAlignments; // ...otherwise we have to delete, as promised!
922  }
923 
924  if (saveApeToDB_) {
925  edm::LogInfo("Alignment") << "Writing AlignmentErrors for run " << time
926  << " to " << errRcd << ".";
927  poolDb->writeOne<AlignmentErrors>(tempAlignmentErrors, time, errRcd);
928  } else { // poolDb->writeOne(..) takes over 'alignmentErrors' ownership,...
929  delete tempAlignmentErrors; // ...otherwise we have to delete, as promised!
930  }
931 }
932 
933 
935 void AlignmentProducer::writeDB(AlignmentSurfaceDeformations *alignmentSurfaceDeformations,
936  const std::string &surfaceDeformationRcd,
937  cond::Time_t time) const
938 {
939  // Call service
941  if (!poolDb.isAvailable()) { // Die if not available
942  delete alignmentSurfaceDeformations; // promised to take over ownership...
943  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
944  }
945 
946  if (saveDeformationsToDB_) {
947  edm::LogInfo("Alignment") << "Writing AlignmentSurfaceDeformations for run " << time
948  << " to " << surfaceDeformationRcd << ".";
949  poolDb->writeOne<AlignmentSurfaceDeformations>(alignmentSurfaceDeformations, time,
950  surfaceDeformationRcd);
951  } else { // poolDb->writeOne(..) takes over 'surfaceDeformation' ownership,...
952  delete alignmentSurfaceDeformations; // ...otherwise we have to delete, as promised!
953  }
954 }
955 
958 {
959  static bool oldRunRangeSelectionWarning = false;
960 
963 
964  RunRanges uniqueRunRanges;
965  if (!RunRangeSelectionVPSet.empty()) {
966 
967  std::map<RunNumber,RunNumber> uniqueFirstRunNumbers;
968 
969  for (std::vector<edm::ParameterSet>::const_iterator ipset = RunRangeSelectionVPSet.begin();
970  ipset != RunRangeSelectionVPSet.end();
971  ++ipset) {
972  const std::vector<std::string> RunRangeStrings = (*ipset).getParameter<std::vector<std::string> >("RunRanges");
973  for (std::vector<std::string>::const_iterator irange = RunRangeStrings.begin();
974  irange != RunRangeStrings.end();
975  ++irange) {
976 
977  if ((*irange).find(':')==std::string::npos) {
978 
979  RunNumber first = beginValue;
980  long int temp = strtol((*irange).c_str(), 0, 0);
981  if (temp!=-1) first = temp;
982  uniqueFirstRunNumbers[first] = first;
983 
984  } else {
985 
986  if (!oldRunRangeSelectionWarning) {
987  edm::LogWarning("BadConfig") << "@SUB=AlignmentProducer::makeNonOverlappingRunRanges"
988  << "Config file contains old format for 'RunRangeSelection'. Only the start run\n"
989  << "number is used internally. The number of the last run is ignored and can be\n"
990  << "safely removed from the config file.\n";
991  oldRunRangeSelectionWarning = true;
992  }
993 
994  std::vector<std::string> tokens = edm::tokenize(*irange, ":");
995  long int temp;
996  RunNumber first = beginValue;
997  temp = strtol(tokens[0].c_str(), 0, 0);
998  if (temp!=-1) first = temp;
999  uniqueFirstRunNumbers[first] = first;
1000  }
1001  }
1002  }
1003 
1004  for (std::map<RunNumber,RunNumber>::iterator iFirst = uniqueFirstRunNumbers.begin();
1005  iFirst!=uniqueFirstRunNumbers.end();
1006  ++iFirst) {
1007  uniqueRunRanges.push_back(std::pair<RunNumber,RunNumber>((*iFirst).first, endValue));
1008  }
1009  for (unsigned int i = 0;i<uniqueRunRanges.size()-1;++i) {
1010  uniqueRunRanges[i].second = uniqueRunRanges[i+1].first - 1;
1011  }
1012 
1013  } else {
1014 
1015  uniqueRunRanges.push_back(std::pair<RunNumber,RunNumber>(beginValue, endValue));
1016 
1017  }
1018 
1019  return uniqueRunRanges;
1020 }
1021 
RunNumber_t run() const
Definition: EventID.h:39
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:214
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
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.
virtual void terminate(const edm::EventSetup &iSetup)=0
Call at end of each loop (must be implemented in derived class)
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:7
void readInSurveyRcds(const edm::EventSetup &)
read in survey records
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
ErrorMatrix matrix() const
Definition: SurveyError.h:76
TrackerGeometry * build(const GeometricDet *gd, const edm::ParameterSet &pSet)
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.
std::vector< IntegratedCalibrationBase * > theCalibrations
#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:66
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:19
std::string encode() const
Definition: InputTag.cc:164
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)
virtual bool addCalibrations(const std::vector< IntegratedCalibrationBase * > &iCals)
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:46
unsigned int theSurveyIndex
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
AlignmentErrors * alignmentErrors() const
Return alignment errors, sorted by DetId.
AlignmentErrors * cscAlignmentErrors()
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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:71
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:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
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
tuple G
Definition: callgraph.py:12
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:18
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:88
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:206
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.
T const * product() const
Definition: ESHandle.h:86
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Alignments * cscAlignments()
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
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:23
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="")
SurfaceDeformation * create(int type, const std::vector< double > &params)
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:55
AlignmentAlgorithmBase::RunRange RunRange
const double stRandomRotation_
Definition: Run.h:41
std::vector< RunRange > RunRanges