CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h

Go to the documentation of this file.
00001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
00002 #define Alignment_CommonAlignmentAlgorithm_AlignmentAlgorithmBase_h
00003 
00004 //
00005 // Base class for the alignment algorithm
00006 //
00007 // Any algorithm should derive from this class
00008 //
00009 
00010 #include <vector>
00011 #include <utility>
00012 
00013 class AlignableTracker;
00014 class AlignableMuon;
00015 class AlignableExtras;
00016 class AlignmentParameterStore;
00017 class Trajectory;
00018 // These data formats cannot be forward declared since they are typedef's,
00019 // so include the headers that define the typedef's
00020 // (no need to include in dependencies in BuildFile):
00021 // class TsosVectorCollection;
00022 // class TkFittedLasBeamCollection;
00023 // class AliClusterValueMap;
00024 #include "CondCore/DBCommon/interface/Time.h"
00025 #include "Alignment/LaserAlignment/interface/TsosVectorCollection.h"
00026 #include "DataFormats/Alignment/interface/TkFittedLasBeamCollectionFwd.h"
00027 #include "DataFormats/Alignment/interface/AliClusterValueMapFwd.h"
00028 
00029 namespace edm { class EventID; class RunID; class EventSetup; class ParameterSet; }
00030 namespace reco { class Track; class BeamSpot; }
00031 
00032 class AlignmentAlgorithmBase
00033 {
00034 
00035 public:
00036 
00037   typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair; 
00038   typedef std::vector< ConstTrajTrackPair >  ConstTrajTrackPairCollection;
00039   typedef cond::RealTimeType<cond::runnumber>::type RunNumber;
00040   typedef std::pair<RunNumber,RunNumber> RunRange;
00041 
00043   struct EventInfo {
00044     EventInfo(const edm::EventID &eventId, 
00045               const ConstTrajTrackPairCollection &trajTrackPairs,
00046               const reco::BeamSpot &beamSpot,
00047               const AliClusterValueMap *clusterValueMap) 
00048       : eventId_(eventId), trajTrackPairs_(trajTrackPairs), beamSpot_(beamSpot), clusterValueMap_(clusterValueMap) {}
00049 
00050     const edm::EventID                 &eventId_;
00051     const ConstTrajTrackPairCollection &trajTrackPairs_;
00052     const reco::BeamSpot               &beamSpot_;
00053     const AliClusterValueMap           *clusterValueMap_;
00054   };
00055   
00057   struct EndRunInfo {
00058     EndRunInfo(const edm::RunID &runId, const TkFittedLasBeamCollection *tkLasBeams,
00059                const TsosVectorCollection *tkLasBeamTsoses)
00060       : runId_(runId), tkLasBeams_(tkLasBeams), tkLasBeamTsoses_(tkLasBeamTsoses) {}
00061     const edm::RunID &runId_;
00062     const TkFittedLasBeamCollection *tkLasBeams_; 
00063     const TsosVectorCollection *tkLasBeamTsoses_; 
00064   };
00065   
00067   AlignmentAlgorithmBase(const edm::ParameterSet& cfg);
00068   
00070   virtual ~AlignmentAlgorithmBase() {};
00071 
00073   virtual void initialize( const edm::EventSetup& setup, 
00074                            AlignableTracker* tracker,
00075                            AlignableMuon* muon,
00076                            AlignableExtras* extras,
00077                            AlignmentParameterStore* store ) = 0;
00080   virtual void startNewLoop() {}
00081 
00083   virtual void terminate() = 0;
00084 
00086   virtual void run( const edm::EventSetup &setup, const EventInfo &eventInfo) = 0;
00087 
00089   virtual void beginRun(const edm::EventSetup &setup) {};
00090 
00092   virtual void endRun(const EndRunInfo &runInfo, const edm::EventSetup &setup) {};
00093 
00095   virtual void beginLuminosityBlock(const edm::EventSetup &setup) {};
00096 
00098   virtual void endLuminosityBlock(const edm::EventSetup &setup) {};
00099 
00102   virtual bool setParametersForRunRange(const RunRange& rr) { return false; };
00103 };
00104 
00105 #endif