CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FakeAlignmentSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FakeAlignmentSource
4 // Class: FakeAlignmentSource
5 //
15 //
16 // Original Author: Gero Flucke (based on FakeAlignmentProducer written by Frederic Ronga)
17 // Created: June 24, 2007
18 // $Id: FakeAlignmentSource.cc,v 1.2 2008/06/26 17:52:29 flucke Exp $
19 //
20 //
21 
22 
23 // System
24 #include <memory>
25 #include <string>
26 
27 // Framework
33 
34 // Alignment
46 
48 public:
51 
53  std::auto_ptr<Alignments> produceTkAli(const TrackerAlignmentRcd&) {
54  return std::auto_ptr<Alignments>(new Alignments);
55  }
56  std::auto_ptr<AlignmentErrorsExtended> produceTkAliErr(const TrackerAlignmentErrorExtendedRcd&) {
57  return std::auto_ptr<AlignmentErrorsExtended>(new AlignmentErrorsExtended);
58  }
59 
61  std::auto_ptr<Alignments> produceDTAli(const DTAlignmentRcd&) {
62  return std::auto_ptr<Alignments>(new Alignments);
63  }
64  std::auto_ptr<AlignmentErrorsExtended> produceDTAliErr(const DTAlignmentErrorExtendedRcd&) {
65  return std::auto_ptr<AlignmentErrorsExtended>(new AlignmentErrorsExtended);
66  }
67 
69  std::auto_ptr<Alignments> produceCSCAli(const CSCAlignmentRcd&) {
70  return std::auto_ptr<Alignments>(new Alignments);
71  }
72  std::auto_ptr<AlignmentErrorsExtended> produceCSCAliErr(const CSCAlignmentErrorExtendedRcd&) {
73  return std::auto_ptr<AlignmentErrorsExtended>(new AlignmentErrorsExtended);
74  }
75 
77  std::auto_ptr<Alignments> produceGlobals(const GlobalPositionRcd&) {
78  return std::auto_ptr<Alignments>(new Alignments);
79  }
80 
82  std::auto_ptr<AlignmentSurfaceDeformations>
84  return std::auto_ptr<AlignmentSurfaceDeformations>(new AlignmentSurfaceDeformations);
85  }
86 
87  protected:
89  virtual void setIntervalFor( const edm::eventsetup::EventSetupRecordKey& /*dummy*/,
90  const edm::IOVSyncValue& ioSyncVal, edm::ValidityInterval& iov) override;
91 
92  private:
93 
95  bool produceDT_;
99 };
100 
101 //________________________________________________________________________________________
102 //________________________________________________________________________________________
103 //________________________________________________________________________________________
104 
106  :produceTracker_(iConfig.getParameter<bool>("produceTracker")),
107  produceDT_(iConfig.getParameter<bool>("produceDT")),
108  produceCSC_(iConfig.getParameter<bool>("produceCSC")),
109  produceGlobalPosition_(iConfig.getParameter<bool>("produceGlobalPosition")),
110  produceTrackerSurfaceDeformation_(iConfig.getParameter<bool>("produceTrackerSurfaceDeformation"))
111 {
112  // This 'appendToDataLabel' is used by the framework to distinguish providers
113  // with different settings and to request a special one by e.g.
114  // iSetup.get<TrackerDigiGeometryRecord>().get("theLabel", tkGeomHandle);
115 
116  edm::LogInfo("Alignments")
117  << "@SUB=FakeAlignmentSource" << "Providing data with label '"
118  << iConfig.getParameter<std::string>("appendToDataLabel") << "'.";
119 
120  // Tell framework what data is produced by which method:
121  if (produceTracker_) {
124  }
125  if (produceDT_) {
128  }
129  if (produceCSC_) {
132  }
135  }
138  }
139 
140  // Tell framework to provide IOV for the above data:
141  if (produceTracker_) {
142  this->findingRecord<TrackerAlignmentRcd>();
143  this->findingRecord<TrackerAlignmentErrorExtendedRcd>();
144  }
145  if (produceDT_) {
146  this->findingRecord<DTAlignmentRcd>();
147  this->findingRecord<DTAlignmentErrorExtendedRcd>();
148  }
149  if (produceCSC_) {
150  this->findingRecord<CSCAlignmentRcd>();
151  this->findingRecord<CSCAlignmentErrorExtendedRcd>();
152  }
154  this->findingRecord<GlobalPositionRcd>();
155  }
157  this->findingRecord<TrackerSurfaceDeformationRcd>();
158  }
159 }
160 
162  const edm::IOVSyncValue& ioSyncVal,
163  edm::ValidityInterval& outValidity )
164 {
165  // Implementation copied from SiStripGainFakeESSource: unlimited IOV
166  outValidity = edm::ValidityInterval(ioSyncVal.beginOfTime(), ioSyncVal.endOfTime());
167 }
168 
169 //define this as a plug-in
T getParameter(std::string const &) const
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::auto_ptr< AlignmentErrorsExtended > produceTkAliErr(const TrackerAlignmentErrorExtendedRcd &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &ioSyncVal, edm::ValidityInterval &iov) override
provide (dummy) IOV
std::auto_ptr< AlignmentErrorsExtended > produceDTAliErr(const DTAlignmentErrorExtendedRcd &)
tuple iov
Definition: o2o.py:307
static const IOVSyncValue & beginOfTime()
std::auto_ptr< Alignments > produceGlobals(const GlobalPositionRcd &)
GlobalPositions.
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
std::auto_ptr< AlignmentErrorsExtended > produceCSCAliErr(const CSCAlignmentErrorExtendedRcd &)
std::auto_ptr< AlignmentSurfaceDeformations > produceTrackerSurfaceDeformation(const TrackerSurfaceDeformationRcd &)
Tracker surface deformations.
std::auto_ptr< Alignments > produceTkAli(const TrackerAlignmentRcd &)
Tracker and its APE.
FakeAlignmentSource(const edm::ParameterSet &)
std::auto_ptr< Alignments > produceDTAli(const DTAlignmentRcd &)
DT and its APE.
std::auto_ptr< Alignments > produceCSCAli(const CSCAlignmentRcd &)
CSC and its APE.