CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentProducer.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignmentAlgorithm_TrackerAlignmentProducer_h
2 #define Alignment_CommonAlignmentAlgorithm_TrackerAlignmentProducer_h
3 
13 
14 #include <vector>
15 
16 // Framework
20 
22 
23 // Geometry
25 
26 // Alignment
37 
38 // for watcher
45 
46 
47 class Alignments;
48 class SurveyErrors;
49 namespace edm {
50  class Run;
51  class LuminosityBlock;
52 }
53 
55 {
56 
57  public:
58  typedef std::vector<Alignable*> Alignables;
59  typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
60  typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
61 
63  AlignmentProducer( const edm::ParameterSet& iConfig );
64 
67 
69  virtual boost::shared_ptr<TrackerGeometry> produceTracker( const TrackerDigiGeometryRecord& iRecord );
71  virtual boost::shared_ptr<DTGeometry> produceDT( const MuonGeometryRecord& iRecord );
73  virtual boost::shared_ptr<CSCGeometry> produceCSC( const MuonGeometryRecord& iRecord );
74 
76  virtual void beginOfJob(const edm::EventSetup&);
77 
79  virtual void endOfJob();
80 
82  virtual void startingNewLoop( unsigned int iLoop );
83 
85  virtual Status endOfLoop( const edm::EventSetup&, unsigned int iLoop );
86 
88  virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup);
90  virtual void endRun(const edm::Run &run, const edm::EventSetup &setup);
91 
93  virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock,
94  const edm::EventSetup &setup);
96  virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock,
97  const edm::EventSetup &setup);
99  virtual Status duringLoop(const edm::Event &event, const edm::EventSetup &setup);
100 
101  private:
102 
103  // private member functions
104 
106  void simpleMisalignment_(const Alignables &alivec, const std::string &selection,
107  float shift, float rot, bool local);
108 
110  void createGeometries_( const edm::EventSetup& );
111 
114  template<class G, class Rcd, class ErrRcd>
115  void applyDB(G *geometry, const edm::EventSetup &iSetup,
116  const AlignTransform &globalPosition) const;
118  template<class G, class DeformationRcd>
119  void applyDB(G *geometry, const edm::EventSetup &iSetup) const;
120 
124  void writeDB(Alignments *alignments, const std::string &alignRcd,
125  AlignmentErrors *alignmentErrors, const std::string &errRcd,
126  const AlignTransform *globalCoordinates) const;
129  void writeDB(AlignmentSurfaceDeformations *alignmentSurfaceDeformations,
130  const std::string &surfaceDeformationRcd) const;
131 
133  void addSurveyInfo_(Alignable*);
134 
136  void readInSurveyRcds( const edm::EventSetup& );
137 
138  // private data members
139 
140  unsigned int theSurveyIndex;
143 
145  std::vector<AlignmentMonitorBase*> theMonitors;
147 
151 
152  boost::shared_ptr<TrackerGeometry> theTracker;
153  boost::shared_ptr<DTGeometry> theMuonDT;
154  boost::shared_ptr<CSCGeometry> theMuonCSC;
157 
158  int nevent_;
160 
161  // steering parameters
162 
163  const unsigned int theMaxLoops; // Number of loops to loop
164 
165  const int stNFixAlignables_;
170  const bool useSurvey_; // true to read survey info from DB
171 
172  // event input tags
173  const edm::InputTag tjTkAssociationMapTag_; // map with tracks/trajectories
174  const edm::InputTag beamSpotTag_; // beam spot
175  const edm::InputTag tkLasBeamTag_; // LAS beams in edm::Run (ignore if empty)
176  const edm::InputTag clusterValueMapTag_; // ValueMap containing associtaion cluster - flag
177 
178 
179  // ESWatcher
186 
187 };
188 
189 #endif
std::vector< Alignable * > Alignables
AlignmentProducer(const edm::ParameterSet &iConfig)
Constructor.
const bool applyDbDeformations_
boost::shared_ptr< TrackerGeometry > theTracker
const bool doMisalignmentScenario_
AlignmentAlgorithmBase * theAlignmentAlgo
~AlignmentProducer()
Destructor.
virtual boost::shared_ptr< TrackerGeometry > produceTracker(const TrackerDigiGeometryRecord &iRecord)
Produce the tracker geometry.
void simpleMisalignment_(const Alignables &alivec, const std::string &selection, float shift, float rot, bool local)
Apply random shifts and rotations to selected alignables, according to configuration.
void readInSurveyRcds(const edm::EventSetup &)
read in survey records
virtual boost::shared_ptr< DTGeometry > produceDT(const MuonGeometryRecord &iRecord)
Produce the muon DT geometry.
virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup)
Called at run start and calling algorithms beginRun.
virtual Status endOfLoop(const edm::EventSetup &, unsigned int iLoop)
Called at end of loop.
edm::ParameterSet theParameterSet
const edm::InputTag tkLasBeamTag_
const Alignments * theSurveyValues
void addSurveyInfo_(Alignable *)
Add survey info to an alignable.
void createGeometries_(const edm::EventSetup &)
Create tracker and muon geometries.
const bool applyDbAlignment_
const unsigned int theMaxLoops
AlignableExtras * theAlignableExtras
boost::shared_ptr< CSCGeometry > theMuonCSC
const edm::InputTag clusterValueMapTag_
edm::ESWatcher< DTSurveyErrorRcd > watchDTSurveyErrRcd_
unsigned int theSurveyIndex
std::vector< AlignmentMonitorBase * > theMonitors
virtual void startingNewLoop(unsigned int iLoop)
Called at beginning of loop.
AlignmentParameterStore * theAlignmentParameterStore
boost::shared_ptr< DTGeometry > theMuonDT
edm::ESWatcher< CSCSurveyRcd > watchCSCSurveyRcd_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const edm::InputTag beamSpotTag_
virtual void endRun(const edm::Run &run, const edm::EventSetup &setup)
Called at run end - currently reading TkFittedLasBeam if an InpuTag is given for that.
const SurveyErrors * theSurveyErrors
edm::ESWatcher< CSCSurveyErrorRcd > watchCSCSurveyErrRcd_
const edm::InputTag tjTkAssociationMapTag_
edm::ESWatcher< TrackerSurveyErrorRcd > watchTkSurveyErrRcd_
virtual Status duringLoop(const edm::Event &event, const edm::EventSetup &setup)
Called at each event.
AlignableMuon * theAlignableMuon
const bool saveDeformationsToDB_
virtual void endOfJob()
Called at end of job.
const double stRandomShift_
virtual void beginOfJob()
Definition: EDLooperBase.cc:74
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &setup)
Called at lumi block end, calling algorithm&#39;s endLuminosityBlock.
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
edm::ESWatcher< DTSurveyRcd > watchDTSurveyRcd_
void writeDB(Alignments *alignments, const std::string &alignRcd, AlignmentErrors *alignmentErrors, const std::string &errRcd, const AlignTransform *globalCoordinates) const
ESHandle< TrackerGeometry > geometry
virtual boost::shared_ptr< CSCGeometry > produceCSC(const MuonGeometryRecord &iRecord)
Produce the muon CSC geometry.
edm::ESWatcher< TrackerSurveyRcd > watchTkSurveyRcd_
AlignableTracker * theAlignableTracker
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &setup)
Called at lumi block start, calling algorithm&#39;s beginLuminosityBlock.
static unsigned int const shift
void applyDB(G *geometry, const edm::EventSetup &iSetup, const AlignTransform &globalPosition) const
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Constructor of the full muon geometry.
Definition: AlignableMuon.h:39
const Alignments * globalPositions_
GlobalPositions that might be read from DB, NULL otherwise.
const double stRandomRotation_
Definition: Run.h:31