CMS 3D CMS Logo

AlignmentAlgorithmBase.h
Go to the documentation of this file.
1 
2 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
3 #define Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
4 
19 #include <vector>
20 #include <utility>
21 #include <memory>
22 
23 class AlignableTracker;
24 class AlignableMuon;
25 class AlignableExtras;
28 class Trajectory;
29 // These data formats cannot be forward declared since they are typedef's,
30 // so include the headers that define the typedef's
31 // (no need to include in dependencies in BuildFile):
32 // class TsosVectorCollection;
33 // class TkFittedLasBeamCollection;
34 // class AliClusterValueMap;
41 
42 namespace edm {
43  class EventSetup;
44  class ParameterSet;
45 } // namespace edm
46 namespace reco {
47  class Track;
48  class BeamSpot;
49 } // namespace reco
50 
51 /*** Global typedefs part I (see EOF for part II) ***/
52 typedef std::pair<const Trajectory *, const reco::Track *> ConstTrajTrackPair;
53 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairs;
54 
55 typedef std::vector<IntegratedCalibrationBase *> Calibrations;
56 typedef std::vector<std::unique_ptr<IntegratedCalibrationBase>> CalibrationsOwner;
57 
58 typedef std::vector<IntegratedCalibrationBase *> Calibrations;
59 
61 public:
62  // TODO: DEPRECATED: For not breaking the interface, used in serveral files.
63  // If possible use the global typedefs above.
64  // With global typedefs one does not have to typedef again like
65  // 'typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair;'
66  // in other files.
67  typedef std::pair<const Trajectory *, const reco::Track *> ConstTrajTrackPair;
68  typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
71 
73  class EventInfo {
74  public:
75  EventInfo(const edm::EventID &theEventId,
76  const ConstTrajTrackPairCollection &theTrajTrackPairs,
77  const reco::BeamSpot &theBeamSpot,
78  const AliClusterValueMap *theClusterValueMap)
79  : eventId_(theEventId),
80  trajTrackPairs_(theTrajTrackPairs),
81  beamSpot_(theBeamSpot),
82  clusterValueMap_(theClusterValueMap) {}
83 
84  const edm::EventID eventId() const { return eventId_; }
86  const reco::BeamSpot &beamSpot() const { return beamSpot_; }
88 
89  private:
94  };
95 
97  class EndRunInfo {
98  public:
99  EndRunInfo(const edm::RunID &theRunId,
100  const TkFittedLasBeamCollection *theTkLasBeams,
101  const TsosVectorCollection *theTkLasBeamTsoses)
102  : runId_(theRunId), tkLasBeams_(theTkLasBeams), tkLasBeamTsoses_(theTkLasBeamTsoses) {}
103 
104  const edm::RunID runId() const { return runId_; }
107 
108  private:
112  };
113 
116 
119 
121  virtual void initialize(const edm::EventSetup &setup,
124  AlignableExtras *extras,
125  AlignmentParameterStore *store) = 0;
126 
129  virtual bool supportsCalibrations() { return false; }
132  virtual bool addCalibrations(const Calibrations &) { return false; }
133  // Overloading for the owning vector
134  bool addCalibrations(const CalibrationsOwner &cals) {
136  tmp.reserve(cals.size());
137  for (const auto &ptr : cals) {
138  tmp.push_back(ptr.get());
139  }
140  return addCalibrations(tmp);
141  }
142 
144  virtual bool processesEvents() { return true; }
145 
147  virtual bool storeAlignments() { return true; }
148 
149  // TODO: DEPRECATED: Actually, there are no iterative algorithms, use
150  // initialze() and terminate()
153  virtual void startNewLoop() {}
154 
156  virtual void terminate(const edm::EventSetup &iSetup) = 0;
158  virtual void terminate() {}
159 
161  virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
162 
164  virtual void beginRun(const edm::Run &, const edm::EventSetup &, bool changed){};
165 
167  virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup){};
168 
171 
173  virtual void endLuminosityBlock(const edm::EventSetup &setup){};
174 
177  virtual bool setParametersForRunRange(const RunRange &rr) { return false; };
178 };
179 
180 /*** Global typedefs part II ***/
183 
184 #endif
AlignmentAlgorithmBase::EndRunInfo::runId
const edm::RunID runId() const
Definition: AlignmentAlgorithmBase.h:104
AlignmentAlgorithmBase::ConstTrajTrackPairCollection
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: AlignmentAlgorithmBase.h:68
TsosVectorCollection
std::vector< std::vector< TrajectoryStateOnSurface > > TsosVectorCollection
Definition: TsosVectorCollection.h:16
AlignmentAlgorithmBase::EventInfo::eventId
const edm::EventID eventId() const
Definition: AlignmentAlgorithmBase.h:84
edm::RunID
Definition: RunID.h:28
TkFittedLasBeamCollectionFwd.h
muon
Definition: MuonCocktails.h:17
align::RunRange
std::pair< RunNumber, RunNumber > RunRange
Definition: Utilities.h:38
edm::Run
Definition: Run.h:45
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
edm
HLT enums.
Definition: AlignableModifier.h:19
align::RunNumber
cond::RealTimeType< cond::runnumber >::type RunNumber
Definition: Utilities.h:37
AlignmentAlgorithmBase::addCalibrations
virtual bool addCalibrations(const Calibrations &)
Definition: AlignmentAlgorithmBase.h:132
IntegratedCalibrationBase
Definition: IntegratedCalibrationBase.h:40
AlignmentAlgorithmBase::beginRun
virtual void beginRun(const edm::Run &, const edm::EventSetup &, bool changed)
called at begin of run
Definition: AlignmentAlgorithmBase.h:164
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
AlignmentAlgorithmBase::endLuminosityBlock
virtual void endLuminosityBlock(const edm::EventSetup &setup)
called at end of luminosity block (no lumi block info passed yet)
Definition: AlignmentAlgorithmBase.h:173
AlignmentAlgorithmBase
Definition: AlignmentAlgorithmBase.h:60
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
AlignmentAlgorithmBase::supportsCalibrations
virtual bool supportsCalibrations()
Definition: AlignmentAlgorithmBase.h:129
ConstTrajTrackPairs
std::vector< ConstTrajTrackPair > ConstTrajTrackPairs
Definition: AlignmentAlgorithmBase.h:53
TsosVectorCollection.h
AliClusterValueMapFwd.h
EndRunInfo
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
Definition: AlignmentAlgorithmBase.h:182
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
AlignmentAlgorithmBase::EndRunInfo::tkLasBeamTsoses_
const TsosVectorCollection * tkLasBeamTsoses_
might be null!
Definition: AlignmentAlgorithmBase.h:111
AlignableTracker
Definition: AlignableTracker.h:17
AlignableExtras
Definition: AlignableExtras.h:19
AlignmentAlgorithmBase::EndRunInfo
define run information passed to algorithms (in endRun)
Definition: AlignmentAlgorithmBase.h:97
AlignmentAlgorithmBase::EventInfo::beamSpot
const reco::BeamSpot & beamSpot() const
Definition: AlignmentAlgorithmBase.h:86
AlignmentAlgorithmBase::addCalibrations
bool addCalibrations(const CalibrationsOwner &cals)
Definition: AlignmentAlgorithmBase.h:134
CalibrationsOwner
std::vector< std::unique_ptr< IntegratedCalibrationBase > > CalibrationsOwner
Definition: AlignmentAlgorithmBase.h:56
AlignmentAlgorithmBase::initialize
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)
AlignmentAlgorithmBase::endRun
virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup)
called at end of run - order of arguments like in EDProducer etc.
Definition: AlignmentAlgorithmBase.h:167
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
AlignmentAlgorithmBase::ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentAlgorithmBase.h:67
AlignmentAlgorithmBase::terminate
virtual void terminate()
Called at end of job (must be implemented in derived class)
Definition: AlignmentAlgorithmBase.h:158
edm::ParameterSet
Definition: ParameterSet.h:47
Calibrations
std::vector< IntegratedCalibrationBase * > Calibrations
Definition: AlignmentAlgorithmBase.h:55
Event.h
ParameterSet
Definition: Functions.h:16
AlignmentAlgorithmBase::RunNumber
align::RunNumber RunNumber
Definition: AlignmentAlgorithmBase.h:69
AlignmentAlgorithmBase::EndRunInfo::tkLasBeams
const TkFittedLasBeamCollection * tkLasBeams() const
Definition: AlignmentAlgorithmBase.h:105
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:38
EventInfo
AlignmentAlgorithmBase::EventInfo EventInfo
Definition: AlignmentAlgorithmBase.h:181
Utilities.h
edm::EventSetup
Definition: EventSetup.h:58
AlignmentAlgorithmBase::EventInfo::trajTrackPairs_
const ConstTrajTrackPairCollection & trajTrackPairs_
Definition: AlignmentAlgorithmBase.h:91
AlignmentAlgorithmBase::EventInfo::clusterValueMap
const AliClusterValueMap * clusterValueMap() const
Definition: AlignmentAlgorithmBase.h:87
AlignmentAlgorithmBase::processesEvents
virtual bool processesEvents()
Returns whether algorithm proccesses events in current configuration.
Definition: AlignmentAlgorithmBase.h:144
dumpTauVariables_cfi.eventInfo
eventInfo
add run, event number and lumi section
Definition: dumpTauVariables_cfi.py:12
AlignmentParameterStore
Definition: AlignmentParameterStore.h:23
AlignmentAlgorithmBase::EndRunInfo::tkLasBeams_
const TkFittedLasBeamCollection * tkLasBeams_
Definition: AlignmentAlgorithmBase.h:110
Trajectory
Definition: Trajectory.h:38
AlignmentAlgorithmBase::AlignmentAlgorithmBase
AlignmentAlgorithmBase(const edm::ParameterSet &, const edm::ConsumesCollector &)
Constructor.
Definition: AlignmentAlgorithmBase.h:115
edm::ValueMap
Definition: ValueMap.h:107
ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentAlgorithmBase.h:52
AlignmentAlgorithmBase::EventInfo::eventId_
const edm::EventID eventId_
might be null!
Definition: AlignmentAlgorithmBase.h:90
TkFittedLasBeamCollection
std::vector< TkFittedLasBeam > TkFittedLasBeamCollection
Definition: TkFittedLasBeamCollectionFwd.h:3
submitPVValidationJobs.runInfo
dictionary runInfo
Definition: submitPVValidationJobs.py:1013
AlignmentAlgorithmBase::EventInfo::clusterValueMap_
const AliClusterValueMap * clusterValueMap_
Definition: AlignmentAlgorithmBase.h:93
AlignmentAlgorithmBase::~AlignmentAlgorithmBase
virtual ~AlignmentAlgorithmBase()
Destructor.
Definition: AlignmentAlgorithmBase.h:118
AlignmentAlgorithmBase::RunRange
align::RunRange RunRange
Definition: AlignmentAlgorithmBase.h:70
AlignmentAlgorithmBase::setParametersForRunRange
virtual bool setParametersForRunRange(const RunRange &rr)
Definition: AlignmentAlgorithmBase.h:177
AlignmentAlgorithmBase::storeAlignments
virtual bool storeAlignments()
Returns whether algorithm produced results to be stored.
Definition: AlignmentAlgorithmBase.h:147
ConsumesCollector.h
EventSetup
AlignmentAlgorithmBase::startNewLoop
virtual void startNewLoop()
Definition: AlignmentAlgorithmBase.h:153
edm::EventID
Definition: EventID.h:31
AlignmentAlgorithmBase::EventInfo::trajTrackPairs
const ConstTrajTrackPairCollection & trajTrackPairs() const
Definition: AlignmentAlgorithmBase.h:85
AlignmentAlgorithmBase::EventInfo::EventInfo
EventInfo(const edm::EventID &theEventId, const ConstTrajTrackPairCollection &theTrajTrackPairs, const reco::BeamSpot &theBeamSpot, const AliClusterValueMap *theClusterValueMap)
Definition: AlignmentAlgorithmBase.h:75
AlignmentAlgorithmBase::beginLuminosityBlock
virtual void beginLuminosityBlock(const edm::EventSetup &setup)
called at begin of luminosity block (no lumi block info passed yet)
Definition: AlignmentAlgorithmBase.h:170
AlignmentAlgorithmBase::run
virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo)=0
Run the algorithm (must be implemented in derived class)
AlignmentAlgorithmBase::EventInfo::beamSpot_
const reco::BeamSpot & beamSpot_
Definition: AlignmentAlgorithmBase.h:92
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
AlignmentAlgorithmBase::EndRunInfo::tkLasBeamTsoses
const TsosVectorCollection * tkLasBeamTsoses() const
might be null!
Definition: AlignmentAlgorithmBase.h:106
AlignmentAlgorithmBase::EndRunInfo::runId_
const edm::RunID runId_
might be null!
Definition: AlignmentAlgorithmBase.h:109
AlignmentAlgorithmBase::EventInfo
define event information passed to algorithms
Definition: AlignmentAlgorithmBase.h:73
AlignmentAlgorithmBase::EndRunInfo::EndRunInfo
EndRunInfo(const edm::RunID &theRunId, const TkFittedLasBeamCollection *theTkLasBeams, const TsosVectorCollection *theTkLasBeamTsoses)
Definition: AlignmentAlgorithmBase.h:99