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;
29 
30 namespace edm { class EventSetup; class ParameterSet; }
31 namespace reco { class Track; class BeamSpot; }
32 
34 {
35 
36 public:
37 
38  typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
39  typedef std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection;
41  typedef std::pair<RunNumber,RunNumber> RunRange;
42 
44  class EventInfo {
45  public:
46  EventInfo(const edm::EventID &theEventId,
47  const ConstTrajTrackPairCollection &theTrajTrackPairs,
48  const reco::BeamSpot &theBeamSpot,
49  const AliClusterValueMap *theClusterValueMap)
50  : eventId_(theEventId), trajTrackPairs_(theTrajTrackPairs), beamSpot_(theBeamSpot), clusterValueMap_(theClusterValueMap) {}
51 
52  const edm::EventID eventId() const { return eventId_; }
54  const reco::BeamSpot& beamSpot() const { return beamSpot_; }
56 
57 
58  private:
63  };
64 
66  class EndRunInfo {
67  public:
68  EndRunInfo(const edm::RunID &theRunId, const TkFittedLasBeamCollection *theTkLasBeams,
69  const TsosVectorCollection *theTkLasBeamTsoses)
70  : runId_(theRunId), tkLasBeams_(theTkLasBeams), tkLasBeamTsoses_(theTkLasBeamTsoses) {}
71 
72  const edm::RunID runId() const { return runId_; }
73  const TkFittedLasBeamCollection* tkLasBeams() const { return tkLasBeams_; }
75 
76 
77  private:
81  };
82 
85 
88 
90  virtual void initialize( const edm::EventSetup& setup,
93  AlignableExtras* extras,
94  AlignmentParameterStore* store ) = 0;
97  virtual void startNewLoop() {}
98 
100  virtual void terminate() = 0;
101 
103  virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
104 
106  virtual void beginRun(const edm::EventSetup &setup) {};
107 
109  virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {};
110 
112  virtual void beginLuminosityBlock(const edm::EventSetup &setup) {};
113 
115  virtual void endLuminosityBlock(const edm::EventSetup &setup) {};
116 
119  virtual bool setParametersForRunRange(const RunRange& rr) { return false; };
120 };
121 
122 #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)
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)
AlignmentAlgorithmBase(const edm::ParameterSet &cfg)
Constructor.
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 setParametersForRunRange(const RunRange &rr)
virtual ~AlignmentAlgorithmBase()
Destructor.
const TkFittedLasBeamCollection * tkLasBeams() const
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_
const edm::RunID runId_
might be null!
const edm::EventID eventId_
might be null!
const AliClusterValueMap * clusterValueMap_
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
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
const ConstTrajTrackPairCollection & trajTrackPairs_
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection