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 
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 
51 
52 
54 {
55 
56 public:
57  // TODO: DEPRECATED: For not breaking the interface, used in serveral files.
58  // If possible use the global typedefs above.
59  // With global typedefs one does not have to typedef again like
60  // 'typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair;'
61  // in other files.
62  typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
63  typedef std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection;
66 
68  class EventInfo {
69  public:
70  EventInfo(const edm::EventID &theEventId,
71  const ConstTrajTrackPairCollection &theTrajTrackPairs,
72  const reco::BeamSpot &theBeamSpot,
73  const AliClusterValueMap *theClusterValueMap)
74  : eventId_(theEventId), trajTrackPairs_(theTrajTrackPairs), beamSpot_(theBeamSpot), clusterValueMap_(theClusterValueMap) {}
75 
76  const edm::EventID eventId() const { return eventId_; }
77  const ConstTrajTrackPairCollection& trajTrackPairs() const { return trajTrackPairs_; }
78  const reco::BeamSpot& beamSpot() const { return beamSpot_; }
79  const AliClusterValueMap* clusterValueMap() const { return clusterValueMap_; }
80 
81 
82  private:
84  const ConstTrajTrackPairCollection &trajTrackPairs_;
87  };
88 
90  class EndRunInfo {
91  public:
92  EndRunInfo(const edm::RunID &theRunId, const TkFittedLasBeamCollection *theTkLasBeams,
93  const TsosVectorCollection *theTkLasBeamTsoses)
94  : runId_(theRunId), tkLasBeams_(theTkLasBeams), tkLasBeamTsoses_(theTkLasBeamTsoses) {}
95 
96  const edm::RunID runId() const { return runId_; }
97  const TkFittedLasBeamCollection* tkLasBeams() const { return tkLasBeams_; }
98  const TsosVectorCollection* tkLasBeamTsoses() const { return tkLasBeamTsoses_; }
99 
100 
101  private:
105  };
106 
109 
112 
114  virtual void initialize( const edm::EventSetup& setup,
117  AlignableExtras* extras,
118  AlignmentParameterStore* store ) = 0;
119 
122  virtual bool supportsCalibrations() { return false; }
125  virtual bool addCalibrations(const Calibrations&) { return false; }
126 
128  virtual bool processesEvents() { return true; }
129 
131  virtual bool storeAlignments() { return true; }
132 
133  // TODO: DEPRECATED: Actually, there are no iterative algorithms, use
134  // initialze() and terminate()
137  virtual void startNewLoop() {}
138 
140  virtual void terminate(const edm::EventSetup& iSetup) = 0;
142  virtual void terminate() {}
143 
145  virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
146 
148  virtual void beginRun(const edm::Run&, const edm::EventSetup&, bool changed) {};
149 
151  virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {};
152 
154  virtual void beginLuminosityBlock(const edm::EventSetup &setup) {};
155 
157  virtual void endLuminosityBlock(const edm::EventSetup &setup) {};
158 
161  virtual bool setParametersForRunRange(const RunRange& rr) { return false; };
162 };
163 
164 /*** Global typedefs part II ***/
167 
168 #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)
static AlgebraicMatrix initialize()
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)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
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)
virtual ~AlignmentAlgorithmBase()
Destructor.
std::vector< IntegratedCalibrationBase * > Calibrations
virtual void beginRun(const edm::Run &, const edm::EventSetup &, bool changed)
called at begin of run
AlignmentAlgorithmBase(const edm::ParameterSet &)
Constructor.
const TkFittedLasBeamCollection * tkLasBeams() const
AlignmentAlgorithmBase::EndRunInfo EndRunInfo
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::pair< RunNumber, RunNumber > RunRange
Definition: Utilities.h:38
const AliClusterValueMap * clusterValueMap_
AlignmentAlgorithmBase::EventInfo EventInfo
fixed size matrix
virtual void terminate()
Called at end of job (must be implemented in derived class)
HLT enums.
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)
virtual bool storeAlignments()
Returns whether algorithm produced results to be stored.
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
eventInfo
add run, event number and lumi section
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:37
const ConstTrajTrackPairCollection & trajTrackPairs_
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
Definition: Run.h:43
cond::RealTimeType< cond::runnumber >::type RunNumber
Definition: Utilities.h:37