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;
40 
41 namespace edm {
42  class EventSetup;
43  class ParameterSet;
44 } // namespace edm
45 namespace reco {
46  class Track;
47  class BeamSpot;
48 } // namespace reco
49 
50 /*** Global typedefs part I (see EOF for part II) ***/
51 typedef std::pair<const Trajectory *, const reco::Track *> ConstTrajTrackPair;
52 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairs;
53 
54 typedef std::vector<IntegratedCalibrationBase *> Calibrations;
55 typedef std::vector<std::unique_ptr<IntegratedCalibrationBase>> CalibrationsOwner;
56 
57 typedef std::vector<IntegratedCalibrationBase *> Calibrations;
58 
60 public:
61  // TODO: DEPRECATED: For not breaking the interface, used in serveral files.
62  // If possible use the global typedefs above.
63  // With global typedefs one does not have to typedef again like
64  // 'typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair;'
65  // in other files.
66  typedef std::pair<const Trajectory *, const reco::Track *> ConstTrajTrackPair;
67  typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
70 
72  class EventInfo {
73  public:
74  EventInfo(const edm::EventID &theEventId,
75  const ConstTrajTrackPairCollection &theTrajTrackPairs,
76  const reco::BeamSpot &theBeamSpot,
77  const AliClusterValueMap *theClusterValueMap)
78  : eventId_(theEventId),
79  trajTrackPairs_(theTrajTrackPairs),
80  beamSpot_(theBeamSpot),
81  clusterValueMap_(theClusterValueMap) {}
82 
83  const edm::EventID eventId() const { return eventId_; }
85  const reco::BeamSpot &beamSpot() const { return beamSpot_; }
87 
88  private:
93  };
94 
96  class EndRunInfo {
97  public:
98  EndRunInfo(const edm::RunID &theRunId,
99  const TkFittedLasBeamCollection *theTkLasBeams,
100  const TsosVectorCollection *theTkLasBeamTsoses)
101  : runId_(theRunId), tkLasBeams_(theTkLasBeams), tkLasBeamTsoses_(theTkLasBeamTsoses) {}
102 
103  const edm::RunID runId() const { return runId_; }
106 
107  private:
111  };
112 
115 
118 
120  virtual void initialize(const edm::EventSetup &setup,
123  AlignableExtras *extras,
124  AlignmentParameterStore *store) = 0;
125 
128  virtual bool supportsCalibrations() { return false; }
131  virtual bool addCalibrations(const Calibrations &) { return false; }
132  // Overloading for the owning vector
133  bool addCalibrations(const CalibrationsOwner &cals) {
135  tmp.reserve(cals.size());
136  for (const auto &ptr : cals) {
137  tmp.push_back(ptr.get());
138  }
139  return addCalibrations(tmp);
140  }
141 
143  virtual bool processesEvents() { return true; }
144 
146  virtual bool storeAlignments() { return true; }
147 
148  // TODO: DEPRECATED: Actually, there are no iterative algorithms, use
149  // initialze() and terminate()
152  virtual void startNewLoop() {}
153 
155  virtual void terminate(const edm::EventSetup &iSetup) = 0;
157  virtual void terminate() {}
158 
160  virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
161 
163  virtual void beginRun(const edm::Run &, const edm::EventSetup &, bool changed){};
164 
166  virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup){};
167 
170 
172  virtual void endLuminosityBlock(const edm::EventSetup &setup){};
173 
176  virtual bool setParametersForRunRange(const RunRange &rr) { return false; };
177 };
178 
179 /*** Global typedefs part II ***/
182 
183 #endif
AlignmentAlgorithmBase::EndRunInfo::runId
const edm::RunID runId() const
Definition: AlignmentAlgorithmBase.h:103
AlignmentAlgorithmBase::ConstTrajTrackPairCollection
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: AlignmentAlgorithmBase.h:67
TsosVectorCollection
std::vector< std::vector< TrajectoryStateOnSurface > > TsosVectorCollection
Definition: TsosVectorCollection.h:16
AlignmentAlgorithmBase::EventInfo::eventId
const edm::EventID eventId() const
Definition: AlignmentAlgorithmBase.h:83
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:131
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:163
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
AlignmentAlgorithmBase::AlignmentAlgorithmBase
AlignmentAlgorithmBase(const edm::ParameterSet &)
Constructor.
Definition: AlignmentAlgorithmBase.h:114
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:172
AlignmentAlgorithmBase
Definition: AlignmentAlgorithmBase.h:59
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
AlignmentAlgorithmBase::supportsCalibrations
virtual bool supportsCalibrations()
Definition: AlignmentAlgorithmBase.h:128
ConstTrajTrackPairs
std::vector< ConstTrajTrackPair > ConstTrajTrackPairs
Definition: AlignmentAlgorithmBase.h:52
TsosVectorCollection.h
AliClusterValueMapFwd.h
EndRunInfo
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
Definition: AlignmentAlgorithmBase.h:181
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
AlignmentAlgorithmBase::EndRunInfo::tkLasBeamTsoses_
const TsosVectorCollection * tkLasBeamTsoses_
might be null!
Definition: AlignmentAlgorithmBase.h:110
AlignableTracker
Definition: AlignableTracker.h:17
AlignableExtras
Definition: AlignableExtras.h:19
AlignmentAlgorithmBase::EndRunInfo
define run information passed to algorithms (in endRun)
Definition: AlignmentAlgorithmBase.h:96
AlignmentAlgorithmBase::EventInfo::beamSpot
const reco::BeamSpot & beamSpot() const
Definition: AlignmentAlgorithmBase.h:85
AlignmentAlgorithmBase::addCalibrations
bool addCalibrations(const CalibrationsOwner &cals)
Definition: AlignmentAlgorithmBase.h:133
CalibrationsOwner
std::vector< std::unique_ptr< IntegratedCalibrationBase > > CalibrationsOwner
Definition: AlignmentAlgorithmBase.h:55
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:166
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ZMuMuAnalysisNtupler_cff.eventInfo
eventInfo
Definition: ZMuMuAnalysisNtupler_cff.py:15
AlignmentAlgorithmBase::ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentAlgorithmBase.h:66
AlignmentAlgorithmBase::terminate
virtual void terminate()
Called at end of job (must be implemented in derived class)
Definition: AlignmentAlgorithmBase.h:157
edm::ParameterSet
Definition: ParameterSet.h:36
Calibrations
std::vector< IntegratedCalibrationBase * > Calibrations
Definition: AlignmentAlgorithmBase.h:54
Event.h
ParameterSet
Definition: Functions.h:16
AlignmentAlgorithmBase::RunNumber
align::RunNumber RunNumber
Definition: AlignmentAlgorithmBase.h:68
AlignmentAlgorithmBase::EndRunInfo::tkLasBeams
const TkFittedLasBeamCollection * tkLasBeams() const
Definition: AlignmentAlgorithmBase.h:104
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
EventInfo
AlignmentAlgorithmBase::EventInfo EventInfo
Definition: AlignmentAlgorithmBase.h:180
Utilities.h
edm::EventSetup
Definition: EventSetup.h:57
AlignmentAlgorithmBase::EventInfo::trajTrackPairs_
const ConstTrajTrackPairCollection & trajTrackPairs_
Definition: AlignmentAlgorithmBase.h:90
AlignmentAlgorithmBase::EventInfo::clusterValueMap
const AliClusterValueMap * clusterValueMap() const
Definition: AlignmentAlgorithmBase.h:86
AlignmentAlgorithmBase::processesEvents
virtual bool processesEvents()
Returns whether algorithm proccesses events in current configuration.
Definition: AlignmentAlgorithmBase.h:143
AlignmentParameterStore
Definition: AlignmentParameterStore.h:23
AlignmentAlgorithmBase::EndRunInfo::tkLasBeams_
const TkFittedLasBeamCollection * tkLasBeams_
Definition: AlignmentAlgorithmBase.h:109
Trajectory
Definition: Trajectory.h:38
edm::ValueMap
Definition: ValueMap.h:107
ConstTrajTrackPair
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Definition: AlignmentAlgorithmBase.h:51
AlignmentAlgorithmBase::EventInfo::eventId_
const edm::EventID eventId_
might be null!
Definition: AlignmentAlgorithmBase.h:89
TkFittedLasBeamCollection
std::vector< TkFittedLasBeam > TkFittedLasBeamCollection
Definition: TkFittedLasBeamCollectionFwd.h:3
AlignmentAlgorithmBase::EventInfo::clusterValueMap_
const AliClusterValueMap * clusterValueMap_
Definition: AlignmentAlgorithmBase.h:92
AlignmentAlgorithmBase::~AlignmentAlgorithmBase
virtual ~AlignmentAlgorithmBase()
Destructor.
Definition: AlignmentAlgorithmBase.h:117
AlignmentAlgorithmBase::RunRange
align::RunRange RunRange
Definition: AlignmentAlgorithmBase.h:69
AlignmentAlgorithmBase::setParametersForRunRange
virtual bool setParametersForRunRange(const RunRange &rr)
Definition: AlignmentAlgorithmBase.h:176
AlignmentAlgorithmBase::storeAlignments
virtual bool storeAlignments()
Returns whether algorithm produced results to be stored.
Definition: AlignmentAlgorithmBase.h:146
EventSetup
AlignmentAlgorithmBase::startNewLoop
virtual void startNewLoop()
Definition: AlignmentAlgorithmBase.h:152
edm::EventID
Definition: EventID.h:31
AlignmentAlgorithmBase::EventInfo::trajTrackPairs
const ConstTrajTrackPairCollection & trajTrackPairs() const
Definition: AlignmentAlgorithmBase.h:84
AlignmentAlgorithmBase::EventInfo::EventInfo
EventInfo(const edm::EventID &theEventId, const ConstTrajTrackPairCollection &theTrajTrackPairs, const reco::BeamSpot &theBeamSpot, const AliClusterValueMap *theClusterValueMap)
Definition: AlignmentAlgorithmBase.h:74
AlignmentAlgorithmBase::beginLuminosityBlock
virtual void beginLuminosityBlock(const edm::EventSetup &setup)
called at begin of luminosity block (no lumi block info passed yet)
Definition: AlignmentAlgorithmBase.h:169
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:91
AlignmentAlgorithmBase::EndRunInfo::tkLasBeamTsoses
const TsosVectorCollection * tkLasBeamTsoses() const
might be null!
Definition: AlignmentAlgorithmBase.h:105
AlignmentAlgorithmBase::EndRunInfo::runId_
const edm::RunID runId_
might be null!
Definition: AlignmentAlgorithmBase.h:108
AlignmentAlgorithmBase::EventInfo
define event information passed to algorithms
Definition: AlignmentAlgorithmBase.h:72
AlignmentAlgorithmBase::EndRunInfo::EndRunInfo
EndRunInfo(const edm::RunID &theRunId, const TkFittedLasBeamCollection *theTkLasBeams, const TsosVectorCollection *theTkLasBeamTsoses)
Definition: AlignmentAlgorithmBase.h:98