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
38 
39 // for watcher
46 
47 
48 class Alignments;
50 class SurveyErrors;
51 namespace edm {
52  class Run;
53  class LuminosityBlock;
54 }
55 
57 {
58 
59  public:
60  typedef std::vector<Alignable*> Alignables;
61  typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
62  typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
63 
66  typedef std::vector<RunRange> RunRanges;
67 
69  AlignmentProducer( const edm::ParameterSet& iConfig );
70 
73 
75  virtual boost::shared_ptr<TrackerGeometry> produceTracker( const TrackerDigiGeometryRecord& iRecord );
77  virtual boost::shared_ptr<DTGeometry> produceDT( const MuonGeometryRecord& iRecord );
79  virtual boost::shared_ptr<CSCGeometry> produceCSC( const MuonGeometryRecord& iRecord );
80 
82  virtual void beginOfJob(const edm::EventSetup&);
83 
85  virtual void endOfJob();
86 
88  virtual void startingNewLoop( unsigned int iLoop );
89 
91  virtual Status endOfLoop( const edm::EventSetup&, unsigned int iLoop );
92 
94  virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup);
96  virtual void endRun(const edm::Run &run, const edm::EventSetup &setup);
97 
99  virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock,
100  const edm::EventSetup &setup);
102  virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock,
103  const edm::EventSetup &setup);
105  virtual Status duringLoop(const edm::Event &event, const edm::EventSetup &setup);
106 
107  private:
108 
109  // private member functions
110 
112  void simpleMisalignment_(const Alignables &alivec, const std::string &selection,
113  float shift, float rot, bool local);
114 
116  void createGeometries_( const edm::EventSetup& );
117 
120  template<class G, class Rcd, class ErrRcd>
121  void applyDB(G *geometry, const edm::EventSetup &iSetup,
122  const AlignTransform &globalPosition) const;
124  template<class G, class DeformationRcd>
125  void applyDB(G *geometry, const edm::EventSetup &iSetup) const;
126 
127  // write alignments and alignment errors for all sub detectors and
128  // the given run number
130 
134  void writeDB(Alignments *alignments, const std::string &alignRcd,
135  AlignmentErrorsExtended *alignmentErrors, const std::string &errRcd,
136  const AlignTransform *globalCoordinates,
137  cond::Time_t time) const;
140  void writeDB(AlignmentSurfaceDeformations *alignmentSurfaceDeformations,
141  const std::string &surfaceDeformationRcd,
142  cond::Time_t time) const;
143 
145  void addSurveyInfo_(Alignable*);
146 
148  void readInSurveyRcds( const edm::EventSetup& );
149 
150  RunRanges makeNonOverlappingRunRanges(const edm::VParameterSet& RunRangeSelectionVPSet);
151 
152  // private data members
153 
154  unsigned int theSurveyIndex;
157 
160  std::vector<AlignmentMonitorBase*> theMonitors;
161  std::vector<IntegratedCalibrationBase*> theCalibrations;
162 
166 
167  boost::shared_ptr<TrackerGeometry> theTracker;
168  boost::shared_ptr<DTGeometry> theMuonDT;
169  boost::shared_ptr<CSCGeometry> theMuonCSC;
172 
173  int nevent_;
175 
176  // steering parameters
177 
178  const unsigned int theMaxLoops; // Number of loops to loop
179 
180  const int stNFixAlignables_;
186  const bool useSurvey_; // true to read survey info from DB
187 
188  // event input tags
189  const edm::InputTag tjTkAssociationMapTag_; // map with tracks/trajectories
190  const edm::InputTag beamSpotTag_; // beam spot
191  const edm::InputTag tkLasBeamTag_; // LAS beams in edm::Run (ignore if empty)
192  const edm::InputTag clusterValueMapTag_; // ValueMap containing associtaion cluster - flag
193 
194  // ESWatcher
201 
202 };
203 
204 #endif
std::vector< Alignable * > Alignables
AlignmentProducer(const edm::ParameterSet &iConfig)
Constructor.
boost::shared_ptr< TrackerGeometry > theTracker
const bool doMisalignmentScenario_
cond::RealTimeType< cond::runnumber >::type RunNumber
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
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
void writeDB(Alignments *alignments, const std::string &alignRcd, AlignmentErrorsExtended *alignmentErrors, const std::string &errRcd, const AlignTransform *globalCoordinates, cond::Time_t time) const
virtual boost::shared_ptr< DTGeometry > produceDT(const MuonGeometryRecord &iRecord)
Produce the muon DT geometry.
selection
main part
Definition: corrVsCorr.py:98
virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup)
Called at run start and calling algorithms beginRun.
std::vector< IntegratedCalibrationBase * > theCalibrations
virtual Status endOfLoop(const edm::EventSetup &, unsigned int iLoop)
Called at end of loop.
edm::ParameterSet theParameterSet
const edm::InputTag tkLasBeamTag_
std::pair< RunNumber, RunNumber > RunRange
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_
AlignmentAlgorithmBase::RunNumber RunNumber
const unsigned int theMaxLoops
AlignableExtras * theAlignableExtras
unsigned long long Time_t
Definition: Time.h:16
const bool checkDbAlignmentValidity_
boost::shared_ptr< CSCGeometry > theMuonCSC
const edm::InputTag clusterValueMapTag_
unsigned int theSurveyIndex
std::vector< AlignmentMonitorBase * > theMonitors
virtual void startingNewLoop(unsigned int iLoop)
Called at beginning of loop.
RunRanges makeNonOverlappingRunRanges(const edm::VParameterSet &RunRangeSelectionVPSet)
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
tuple G
Definition: callgraph.py:12
const edm::InputTag tjTkAssociationMapTag_
virtual Status duringLoop(const edm::Event &event, const edm::EventSetup &setup)
Called at each event.
edm::ESWatcher< CSCSurveyErrorExtendedRcd > watchCSCSurveyErrRcd_
AlignableMuon * theAlignableMuon
const bool saveDeformationsToDB_
virtual void endOfJob()
Called at end of job.
const double stRandomShift_
virtual void beginOfJob()
Definition: EDLooperBase.cc:88
edm::ESWatcher< DTSurveyErrorExtendedRcd > watchDTSurveyErrRcd_
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_
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
edm::ESWatcher< TrackerSurveyErrorExtendedRcd > watchTkSurveyErrRcd_
void writeForRunRange(cond::Time_t time)
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
Constructor of the full muon geometry.
Definition: AlignableMuon.h:36
const Alignments * globalPositions_
GlobalPositions that might be read from DB, NULL otherwise.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
AlignmentAlgorithmBase::RunRange RunRange
const double stRandomRotation_
Definition: Run.h:41
std::vector< RunRange > RunRanges