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;
49 class SurveyErrors;
50 namespace edm {
51  class Run;
52  class LuminosityBlock;
53 }
54 
56 {
57 
58  public:
59  typedef std::vector<Alignable*> Alignables;
60  typedef std::pair<const Trajectory*, const reco::Track*> ConstTrajTrackPair;
61  typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
62 
65  typedef std::vector<RunRange> RunRanges;
66 
68  AlignmentProducer( const edm::ParameterSet& iConfig );
69 
72 
74  virtual boost::shared_ptr<TrackerGeometry> produceTracker( const TrackerDigiGeometryRecord& iRecord );
76  virtual boost::shared_ptr<DTGeometry> produceDT( const MuonGeometryRecord& iRecord );
78  virtual boost::shared_ptr<CSCGeometry> produceCSC( const MuonGeometryRecord& iRecord );
79 
81  virtual void beginOfJob(const edm::EventSetup&);
82 
84  virtual void endOfJob();
85 
87  virtual void startingNewLoop( unsigned int iLoop );
88 
90  virtual Status endOfLoop( const edm::EventSetup&, unsigned int iLoop );
91 
93  virtual void beginRun(const edm::Run &run, const edm::EventSetup &setup);
95  virtual void endRun(const edm::Run &run, const edm::EventSetup &setup);
96 
98  virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiBlock,
99  const edm::EventSetup &setup);
101  virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiBlock,
102  const edm::EventSetup &setup);
104  virtual Status duringLoop(const edm::Event &event, const edm::EventSetup &setup);
105 
106  private:
107 
108  // private member functions
109 
111  void simpleMisalignment_(const Alignables &alivec, const std::string &selection,
112  float shift, float rot, bool local);
113 
115  void createGeometries_( const edm::EventSetup& );
116 
119  template<class G, class Rcd, class ErrRcd>
120  void applyDB(G *geometry, const edm::EventSetup &iSetup,
121  const AlignTransform &globalPosition) const;
123  template<class G, class DeformationRcd>
124  void applyDB(G *geometry, const edm::EventSetup &iSetup) const;
125 
126  // write alignments and alignment errors for all sub detectors and
127  // the given run number
128  void writeForRunRange(cond::Time_t time);
129 
133  void writeDB(Alignments *alignments, const std::string &alignRcd,
134  AlignmentErrorsExtended *alignmentErrors, const std::string &errRcd,
135  const AlignTransform *globalCoordinates,
136  cond::Time_t time) const;
139  void writeDB(AlignmentSurfaceDeformations *alignmentSurfaceDeformations,
140  const std::string &surfaceDeformationRcd,
141  cond::Time_t time) const;
142 
144  void addSurveyInfo_(Alignable*);
145 
147  void readInSurveyRcds( const edm::EventSetup& );
148 
149  RunRanges makeNonOverlappingRunRanges(const edm::VParameterSet& RunRangeSelectionVPSet);
150 
151  // private data members
152 
153  unsigned int theSurveyIndex;
156 
159  std::vector<AlignmentMonitorBase*> theMonitors;
160  std::vector<IntegratedCalibrationBase*> theCalibrations;
161 
165 
166  boost::shared_ptr<TrackerGeometry> theTracker;
167  boost::shared_ptr<DTGeometry> theMuonDT;
168  boost::shared_ptr<CSCGeometry> theMuonCSC;
171 
172  int nevent_;
174 
175  // steering parameters
176 
177  const unsigned int theMaxLoops; // Number of loops to loop
178 
179  const int stNFixAlignables_;
185  const bool useSurvey_; // true to read survey info from DB
186 
187  // event input tags
188  const edm::InputTag tjTkAssociationMapTag_; // map with tracks/trajectories
189  const edm::InputTag beamSpotTag_; // beam spot
190  const edm::InputTag tkLasBeamTag_; // LAS beams in edm::Run (ignore if empty)
191  const edm::InputTag clusterValueMapTag_; // ValueMap containing associtaion cluster - flag
192 
193  // ESWatcher
200 
201 };
202 
203 #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.
Interface/Base class for alignment algorithms, each alignment algorithm has to be derived from this c...
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:43
std::vector< RunRange > RunRanges