CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentAlgorithmBase.h
Go to the documentation of this file.
1 
2 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
3 #define Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
4 
21 #include <vector>
22 #include <utility>
23 
24 class AlignableTracker;
25 class AlignableMuon;
26 class AlignableExtras;
29 class Trajectory;
30 // These data formats cannot be forward declared since they are typedef's,
31 // so include the headers that define the typedef's
32 // (no need to include in dependencies in BuildFile):
33 // class TsosVectorCollection;
34 // class TkFittedLasBeamCollection;
35 // class AliClusterValueMap;
41 
42 namespace edm { class EventSetup; class ParameterSet; }
43 namespace reco { class Track; class BeamSpot; }
44 
45 /*** Global typedefs part I (see EOF for part II) ***/
46 typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
47 typedef std::vector< ConstTrajTrackPair > ConstTrajTrackPairs;
48 
49 typedef std::vector<IntegratedCalibrationBase*> Calibrations;
50 
52 typedef std::pair<RunNumber,RunNumber> RunRange;
53 typedef std::vector<RunRange> RunRanges;
54 
55 
56 
58 {
59 
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;
69  typedef std::pair<RunNumber,RunNumber> RunRange;
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), trajTrackPairs_(theTrajTrackPairs), beamSpot_(theBeamSpot), clusterValueMap_(theClusterValueMap) {}
79 
80  const edm::EventID eventId() const { return eventId_; }
82  const reco::BeamSpot& beamSpot() const { return beamSpot_; }
84 
85 
86  private:
91  };
92 
94  class EndRunInfo {
95  public:
96  EndRunInfo(const edm::RunID &theRunId, const TkFittedLasBeamCollection *theTkLasBeams,
97  const TsosVectorCollection *theTkLasBeamTsoses)
98  : runId_(theRunId), tkLasBeams_(theTkLasBeams), tkLasBeamTsoses_(theTkLasBeamTsoses) {}
99 
100  const edm::RunID runId() const { return runId_; }
103 
104 
105  private:
109  };
110 
113 
116 
118  virtual void initialize( const edm::EventSetup& setup,
121  AlignableExtras* extras,
122  AlignmentParameterStore* store ) = 0;
123 
126  virtual bool supportsCalibrations() { return false; }
129  virtual bool addCalibrations(const Calibrations&) { return false; }
130 
132  virtual bool processesEvents() { return true; }
133 
134  // TODO: DEPRECATED: Actually, there are no iterative algorithms, use
135  // initialze() and terminate()
138  virtual void startNewLoop() {}
139 
141  virtual void terminate(const edm::EventSetup& iSetup) = 0;
143  virtual void terminate() {}
144 
146  virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
147 
149  virtual void beginRun(const edm::EventSetup &setup) {};
150 
152  virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {};
153 
155  virtual void beginLuminosityBlock(const edm::EventSetup &setup) {};
156 
158  virtual void endLuminosityBlock(const edm::EventSetup &setup) {};
159 
162  virtual bool setParametersForRunRange(const RunRange& rr) { return false; };
163 };
164 
165 /*** Global typedefs part II ***/
168 
169 #endif
virtual bool processesEvents()
Returns whether algorithm proccesses events in current configuration.
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
cond::RealTimeType< cond::runnumber >::type RunNumber
virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo)=0
Run the algorithm (must be implemented in derived class)
const TsosVectorCollection * tkLasBeamTsoses_
might be null!
virtual void endLuminosityBlock(const edm::EventSetup &setup)
called at end of luminosity block (no lumi block info passed yet)
std::pair< RunNumber, RunNumber > RunRange
EndRunInfo(const edm::RunID &theRunId, const TkFittedLasBeamCollection *theTkLasBeams, const TsosVectorCollection *theTkLasBeamTsoses)
const edm::EventID eventId() const
const ConstTrajTrackPairCollection & trajTrackPairs() const
define event information passed to algorithms
virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup)
called at end of run - order of arguments like in EDProducer etc.
virtual bool addCalibrations(const Calibrations &)
std::vector< ConstTrajTrackPair > ConstTrajTrackPairs
virtual bool setParametersForRunRange(const RunRange &rr)
std::pair< RunNumber, RunNumber > RunRange
virtual ~AlignmentAlgorithmBase()
Destructor.
std::vector< IntegratedCalibrationBase * > Calibrations
AlignmentAlgorithmBase(const edm::ParameterSet &)
Constructor.
const TkFittedLasBeamCollection * tkLasBeams() const
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
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)
const TkFittedLasBeamCollection * tkLasBeams_
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
const edm::RunID runId_
might be null!
const edm::EventID eventId_
might be null!
std::vector< RunRange > RunRanges
const AliClusterValueMap * clusterValueMap_
AlignmentAlgorithmBase::EventInfo EventInfo
virtual void terminate()
Called at end of job (must be implemented in derived class)
const AliClusterValueMap * clusterValueMap() const
std::vector< TkFittedLasBeam > TkFittedLasBeamCollection
const reco::BeamSpot & beamSpot() const
EventInfo(const edm::EventID &theEventId, const ConstTrajTrackPairCollection &theTrajTrackPairs, const reco::BeamSpot &theBeamSpot, const AliClusterValueMap *theClusterValueMap)
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
std::vector< std::vector< TrajectoryStateOnSurface > > TsosVectorCollection
define run information passed to algorithms (in endRun)
const TsosVectorCollection * tkLasBeamTsoses() const
might be null!
Constructor of the full muon geometry.
Definition: AlignableMuon.h:36
const ConstTrajTrackPairCollection & trajTrackPairs_
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
cond::RealTimeType< cond::runnumber >::type RunNumber