00001 #ifndef Alignment_CommonAlignmentAlgorithm_TrackerAlignmentProducer_h
00002 #define Alignment_CommonAlignmentAlgorithm_TrackerAlignmentProducer_h
00003
00013
00014 #include <vector>
00015
00016
00017 #include "FWCore/Framework/interface/ESProducerLooper.h"
00018 #include "FWCore/Framework/interface/ESHandle.h"
00019
00020
00021 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00022
00023
00024 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentAlgorithmBase.h"
00025 #include "Alignment/CommonAlignmentMonitor/interface/AlignmentMonitorBase.h"
00026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00027 #include <Geometry/Records/interface/MuonGeometryRecord.h>
00028 #include "Alignment/TrackerAlignment/interface/AlignableTracker.h"
00029 #include "Alignment/MuonAlignment/interface/AlignableMuon.h"
00030 #include <FWCore/Framework/interface/Frameworkfwd.h>
00031 #include "CondFormats/Alignment/interface/Alignments.h"
00032
00033
00034 class Alignments;
00035 class SurveyErrors;
00036
00037 class AlignmentProducer : public edm::ESProducerLooper
00038 {
00039
00040 public:
00041 typedef std::vector<Alignable*> Alignables;
00042 typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
00043 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
00044
00046 AlignmentProducer( const edm::ParameterSet& iConfig );
00047
00049 ~AlignmentProducer();
00050
00052 virtual boost::shared_ptr<TrackerGeometry> produceTracker( const TrackerDigiGeometryRecord& iRecord );
00054 virtual boost::shared_ptr<DTGeometry> produceDT( const MuonGeometryRecord& iRecord );
00056 virtual boost::shared_ptr<CSCGeometry> produceCSC( const MuonGeometryRecord& iRecord );
00057
00059 virtual void beginOfJob(const edm::EventSetup&);
00060
00062 virtual void endOfJob();
00063
00065 virtual void startingNewLoop( unsigned int iLoop );
00066
00068 virtual Status endOfLoop( const edm::EventSetup&, unsigned int iLoop );
00069
00071 virtual Status duringLoop( const edm::Event&, const edm::EventSetup& );
00072
00073 private:
00074
00075
00076
00078 void simpleMisalignment_(const Alignables &alivec, const std::string &selection,
00079 float shift, float rot, bool local);
00080
00082 void createGeometries_( const edm::EventSetup& );
00083
00085 void addSurveyInfo_(
00086 Alignable*
00087 );
00088
00089
00090
00091 unsigned int theSurveyIndex;
00092 const Alignments* theSurveyValues;
00093 const SurveyErrors* theSurveyErrors;
00094
00095 AlignmentAlgorithmBase* theAlignmentAlgo;
00096 std::vector<AlignmentMonitorBase*> theMonitors;
00097 AlignmentParameterStore* theAlignmentParameterStore;
00098
00099 AlignableTracker* theAlignableTracker;
00100 AlignableMuon* theAlignableMuon;
00101
00102 boost::shared_ptr<TrackerGeometry> theTracker;
00103 boost::shared_ptr<DTGeometry> theMuonDT;
00104 boost::shared_ptr<CSCGeometry> theMuonCSC;
00105
00106 int nevent_;
00107
00108 edm::ParameterSet theParameterSet;
00109
00110
00111
00112 unsigned int theMaxLoops;
00113
00114 int stNFixAlignables_;
00115 double stRandomShift_,stRandomRotation_;
00116 bool applyDbAlignment_,doMisalignmentScenario_,saveToDB_;
00117 bool doTracker_,doMuon_;
00118 bool useSurvey_;
00119
00120 };
00121
00122 #endif