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 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
2 #define Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
3 
4 //
5 // Base class for the alignment algorithm
6 //
7 // Any algorithm should derive from this class
8 //
9 
10 #include <vector>
11 #include <utility>
12 
13 class AlignableTracker;
14 class AlignableMuon;
15 class AlignableExtras;
17 class Trajectory;
18 // These data formats cannot be forward declared since they are typedef's,
19 // so include the headers that define the typedef's
20 // (no need to include in dependencies in BuildFile):
21 // class TsosVectorCollection;
22 // class TkFittedLasBeamCollection;
23 // class AliClusterValueMap;
28 
29 namespace edm { class EventID; class RunID; class EventSetup; class ParameterSet; }
30 namespace reco { class Track; class BeamSpot; }
31 
33 {
34 
35 public:
36 
37  typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
38  typedef std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection;
40  typedef std::pair<RunNumber,RunNumber> RunRange;
41 
43  struct EventInfo {
44  EventInfo(const edm::EventID &eventId,
45  const ConstTrajTrackPairCollection &trajTrackPairs,
46  const reco::BeamSpot &beamSpot,
47  const AliClusterValueMap *clusterValueMap)
48  : eventId_(eventId), trajTrackPairs_(trajTrackPairs), beamSpot_(beamSpot), clusterValueMap_(clusterValueMap) {}
49 
54  };
55 
57  struct EndRunInfo {
58  EndRunInfo(const edm::RunID &runId, const TkFittedLasBeamCollection *tkLasBeams,
59  const TsosVectorCollection *tkLasBeamTsoses)
60  : runId_(runId), tkLasBeams_(tkLasBeams), tkLasBeamTsoses_(tkLasBeamTsoses) {}
64  };
65 
68 
71 
73  virtual void initialize( const edm::EventSetup& setup,
76  AlignableExtras* extras,
77  AlignmentParameterStore* store ) = 0;
80  virtual void startNewLoop() {}
81 
83  virtual void terminate() = 0;
84 
86  virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
87 
89  virtual void beginRun(const edm::EventSetup &setup) {};
90 
92  virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {};
93 
95  virtual void beginLuminosityBlock(const edm::EventSetup &setup) {};
96 
98  virtual void endLuminosityBlock(const edm::EventSetup &setup) {};
99 
102  virtual bool setParametersForRunRange(const RunRange& rr) { return false; };
103 };
104 
105 #endif
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
virtual void terminate()=0
Call at end of job (must be implemented in derived class)
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)
virtual void endLuminosityBlock(const edm::EventSetup &setup)
called at end of luminosity block (no lumi block info passed yet)
AlignmentAlgorithmBase(const edm::ParameterSet &cfg)
Constructor.
std::pair< RunNumber, RunNumber > RunRange
const ConstTrajTrackPairCollection & trajTrackPairs_
const TsosVectorCollection * tkLasBeamTsoses_
might be null!
virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup)
called at end of run - order of arguments like in EDProducer etc.
virtual bool setParametersForRunRange(const RunRange &rr)
virtual ~AlignmentAlgorithmBase()
Destructor.
EndRunInfo(const edm::RunID &runId, const TkFittedLasBeamCollection *tkLasBeams, const TsosVectorCollection *tkLasBeamTsoses)
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 AliClusterValueMap * clusterValueMap_
EventInfo(const edm::EventID &eventId, const ConstTrajTrackPairCollection &trajTrackPairs, const reco::BeamSpot &beamSpot, const AliClusterValueMap *clusterValueMap)
const TkFittedLasBeamCollection * tkLasBeams_
define run information passed to algorithms (in endRun)
std::vector< TkFittedLasBeam > TkFittedLasBeamCollection
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
std::vector< std::vector< TrajectoryStateOnSurface > > TsosVectorCollection
Constructor of the full muon geometry.
Definition: AlignableMuon.h:36
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
define event information passed to algorithms