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
AlignmentErrorsExtended.h
FakeAlignmentSource::produceGlobals
std::unique_ptr< Alignments > produceGlobals(const GlobalPositionRcd &)
GlobalPositions.
Definition: FakeAlignmentSource.cc:70
GlobalPositionRcd.h
electrons_cff.bool
bool
Definition: electrons_cff.py:393
MessageLogger.h
FakeAlignmentSource
Definition: FakeAlignmentSource.cc:46
DTAlignmentErrorExtendedRcd.h
FakeAlignmentSource::produceCSCAliErr
std::unique_ptr< AlignmentErrorsExtended > produceCSCAliErr(const CSCAlignmentErrorExtendedRcd &)
Definition: FakeAlignmentSource.cc:65
FakeAlignmentSource::produceDTAli
std::unique_ptr< Alignments > produceDTAli(const DTAlignmentRcd &)
DT and its APE.
Definition: FakeAlignmentSource.cc:58
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ValidityInterval
Definition: ValidityInterval.h:28
ESProducer.h
Alignments.h
TrackerAlignmentRcd
Definition: TrackerAlignmentRcd.h:6
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
TrackerSurfaceDeformationRcd.h
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
FakeAlignmentSource::produceGlobalPosition_
bool produceGlobalPosition_
Definition: FakeAlignmentSource.cc:87
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
TrackerAlignmentErrorExtendedRcd.h
FakeAlignmentSource::FakeAlignmentSource
FakeAlignmentSource(const edm::ParameterSet &)
Definition: FakeAlignmentSource.cc:95
TrackerSurfaceDeformationRcd
Definition: TrackerSurfaceDeformationRcd.h:6
DTAlignmentRcd
Definition: DTAlignmentRcd.h:6
CSCAlignmentErrorExtendedRcd.h
DTAlignmentErrorExtendedRcd
Definition: DTAlignmentErrorExtendedRcd.h:6
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
DEFINE_FWK_EVENTSETUP_SOURCE
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
EventSetupRecordIntervalFinder.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SourceFactory.h
CSCAlignmentErrorExtendedRcd
Definition: CSCAlignmentErrorExtendedRcd.h:6
edm::ParameterSet
Definition: ParameterSet.h:47
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
FakeAlignmentSource::produceTracker_
bool produceTracker_
Definition: FakeAlignmentSource.cc:84
FakeAlignmentSource::produceTrackerSurfaceDeformation_
bool produceTrackerSurfaceDeformation_
Definition: FakeAlignmentSource.cc:88
FakeAlignmentSource::produceCSC_
bool produceCSC_
Definition: FakeAlignmentSource.cc:86
FakeAlignmentSource::~FakeAlignmentSource
~FakeAlignmentSource() override
Definition: FakeAlignmentSource.cc:49
DTAlignmentRcd.h
FakeAlignmentSource::produceTkAliErr
std::unique_ptr< AlignmentErrorsExtended > produceTkAliErr(const TrackerAlignmentErrorExtendedRcd &)
Definition: FakeAlignmentSource.cc:53
TrackerAlignmentRcd.h
FakeAlignmentSource::produceDT_
bool produceDT_
Definition: FakeAlignmentSource.cc:85
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
AlignmentSurfaceDeformations.h
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESProducer
Definition: ESProducer.h:104
ParameterSet.h
FakeAlignmentSource::produceTrackerSurfaceDeformation
std::unique_ptr< AlignmentSurfaceDeformations > produceTrackerSurfaceDeformation(const TrackerSurfaceDeformationRcd &)
Tracker surface deformations.
Definition: FakeAlignmentSource.cc:73
FakeAlignmentSource::produceCSCAli
std::unique_ptr< Alignments > produceCSCAli(const CSCAlignmentRcd &)
CSC and its APE.
Definition: FakeAlignmentSource.cc:64
FakeAlignmentSource::produceTkAli
std::unique_ptr< Alignments > produceTkAli(const TrackerAlignmentRcd &)
Tracker and its APE.
Definition: FakeAlignmentSource.cc:52
TrackerAlignmentErrorExtendedRcd
Definition: TrackerAlignmentErrorExtendedRcd.h:6
FakeAlignmentSource::produceDTAliErr
std::unique_ptr< AlignmentErrorsExtended > produceDTAliErr(const DTAlignmentErrorExtendedRcd &)
Definition: FakeAlignmentSource.cc:59
FakeAlignmentSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &ioSyncVal, edm::ValidityInterval &iov) override
provide (dummy) IOV
Definition: FakeAlignmentSource.cc:150
CSCAlignmentRcd
Definition: CSCAlignmentRcd.h:6
CSCAlignmentRcd.h