CMS 3D CMS Logo

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 // System
23 #include <memory>
24 #include <string>
25 
26 // Framework
32 
33 // Alignment
45 
47 public:
49  ~FakeAlignmentSource() override {}
50 
52  std::unique_ptr<Alignments> produceTkAli(const TrackerAlignmentRcd&) { return std::make_unique<Alignments>(); }
53  std::unique_ptr<AlignmentErrorsExtended> produceTkAliErr(const TrackerAlignmentErrorExtendedRcd&) {
54  return std::make_unique<AlignmentErrorsExtended>();
55  }
56 
58  std::unique_ptr<Alignments> produceDTAli(const DTAlignmentRcd&) { return std::make_unique<Alignments>(); }
59  std::unique_ptr<AlignmentErrorsExtended> produceDTAliErr(const DTAlignmentErrorExtendedRcd&) {
60  return std::make_unique<AlignmentErrorsExtended>();
61  }
62 
64  std::unique_ptr<Alignments> produceCSCAli(const CSCAlignmentRcd&) { return std::make_unique<Alignments>(); }
65  std::unique_ptr<AlignmentErrorsExtended> produceCSCAliErr(const CSCAlignmentErrorExtendedRcd&) {
66  return std::make_unique<AlignmentErrorsExtended>();
67  }
68 
70  std::unique_ptr<Alignments> produceGlobals(const GlobalPositionRcd&) { return std::make_unique<Alignments>(); }
71 
73  std::unique_ptr<AlignmentSurfaceDeformations> produceTrackerSurfaceDeformation(const TrackerSurfaceDeformationRcd&) {
74  return std::make_unique<AlignmentSurfaceDeformations>();
75  }
76 
77 protected:
80  const edm::IOVSyncValue& ioSyncVal,
81  edm::ValidityInterval& iov) override;
82 
83 private:
85  bool produceDT_;
89 };
90 
91 //________________________________________________________________________________________
92 //________________________________________________________________________________________
93 //________________________________________________________________________________________
94 
96  : produceTracker_(iConfig.getParameter<bool>("produceTracker")),
97  produceDT_(iConfig.getParameter<bool>("produceDT")),
98  produceCSC_(iConfig.getParameter<bool>("produceCSC")),
99  produceGlobalPosition_(iConfig.getParameter<bool>("produceGlobalPosition")),
100  produceTrackerSurfaceDeformation_(iConfig.getParameter<bool>("produceTrackerSurfaceDeformation")) {
101  // This 'appendToDataLabel' is used by the framework to distinguish providers
102  // with different settings and to request a special one by e.g.
103  // iSetup.get<TrackerDigiGeometryRecord>().get("theLabel", tkGeomHandle);
104 
105  edm::LogInfo("Alignments") << "@SUB=FakeAlignmentSource"
106  << "Providing data with label '" << iConfig.getParameter<std::string>("appendToDataLabel")
107  << "'.";
108 
109  // Tell framework what data is produced by which method:
110  if (produceTracker_) {
113  }
114  if (produceDT_) {
117  }
118  if (produceCSC_) {
121  }
124  }
127  }
128 
129  // Tell framework to provide IOV for the above data:
130  if (produceTracker_) {
131  this->findingRecord<TrackerAlignmentRcd>();
132  this->findingRecord<TrackerAlignmentErrorExtendedRcd>();
133  }
134  if (produceDT_) {
135  this->findingRecord<DTAlignmentRcd>();
136  this->findingRecord<DTAlignmentErrorExtendedRcd>();
137  }
138  if (produceCSC_) {
139  this->findingRecord<CSCAlignmentRcd>();
140  this->findingRecord<CSCAlignmentErrorExtendedRcd>();
141  }
143  this->findingRecord<GlobalPositionRcd>();
144  }
146  this->findingRecord<TrackerSurfaceDeformationRcd>();
147  }
148 }
149 
151  const edm::IOVSyncValue& ioSyncVal,
152  edm::ValidityInterval& outValidity) {
153  // Implementation copied from SiStripGainFakeESSource: unlimited IOV
154  outValidity = edm::ValidityInterval(ioSyncVal.beginOfTime(), ioSyncVal.endOfTime());
155 }
156 
157 //define this as a plug-in
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr< Alignments > produceGlobals(const GlobalPositionRcd &)
GlobalPositions.
std::unique_ptr< AlignmentErrorsExtended > produceCSCAliErr(const CSCAlignmentErrorExtendedRcd &)
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
std::unique_ptr< Alignments > produceCSCAli(const CSCAlignmentRcd &)
CSC and its APE.
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &ioSyncVal, edm::ValidityInterval &iov) override
provide (dummy) IOV
std::unique_ptr< Alignments > produceDTAli(const DTAlignmentRcd &)
DT and its APE.
std::unique_ptr< AlignmentErrorsExtended > produceTkAliErr(const TrackerAlignmentErrorExtendedRcd &)
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
std::unique_ptr< AlignmentSurfaceDeformations > produceTrackerSurfaceDeformation(const TrackerSurfaceDeformationRcd &)
Tracker surface deformations.
std::unique_ptr< Alignments > produceTkAli(const TrackerAlignmentRcd &)
Tracker and its APE.
Log< level::Info, false > LogInfo
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
std::unique_ptr< AlignmentErrorsExtended > produceDTAliErr(const DTAlignmentErrorExtendedRcd &)
FakeAlignmentSource(const edm::ParameterSet &)