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
32 
33 // Alignment
45 
47 public:
50 
52  std::auto_ptr<Alignments> produceTkAli(const TrackerAlignmentRcd&) {
53  return std::auto_ptr<Alignments>(new Alignments);
54  }
55  std::auto_ptr<AlignmentErrorsExtended> produceTkAliErr(const TrackerAlignmentErrorExtendedRcd&) {
56  return std::auto_ptr<AlignmentErrorsExtended>(new AlignmentErrorsExtended);
57  }
58 
60  std::auto_ptr<Alignments> produceDTAli(const DTAlignmentRcd&) {
61  return std::auto_ptr<Alignments>(new Alignments);
62  }
63  std::auto_ptr<AlignmentErrorsExtended> produceDTAliErr(const DTAlignmentErrorExtendedRcd&) {
64  return std::auto_ptr<AlignmentErrorsExtended>(new AlignmentErrorsExtended);
65  }
66 
68  std::auto_ptr<Alignments> produceCSCAli(const CSCAlignmentRcd&) {
69  return std::auto_ptr<Alignments>(new Alignments);
70  }
71  std::auto_ptr<AlignmentErrorsExtended> produceCSCAliErr(const CSCAlignmentErrorExtendedRcd&) {
72  return std::auto_ptr<AlignmentErrorsExtended>(new AlignmentErrorsExtended);
73  }
74 
76  std::auto_ptr<Alignments> produceGlobals(const GlobalPositionRcd&) {
77  return std::auto_ptr<Alignments>(new Alignments);
78  }
79 
81  std::auto_ptr<AlignmentSurfaceDeformations>
83  return std::auto_ptr<AlignmentSurfaceDeformations>(new AlignmentSurfaceDeformations);
84  }
85 
86  protected:
88  virtual void setIntervalFor( const edm::eventsetup::EventSetupRecordKey& /*dummy*/,
89  const edm::IOVSyncValue& ioSyncVal, edm::ValidityInterval& iov) override;
90 
91  private:
92 
94  bool produceDT_;
98 };
99 
100 //________________________________________________________________________________________
101 //________________________________________________________________________________________
102 //________________________________________________________________________________________
103 
105  :produceTracker_(iConfig.getParameter<bool>("produceTracker")),
106  produceDT_(iConfig.getParameter<bool>("produceDT")),
107  produceCSC_(iConfig.getParameter<bool>("produceCSC")),
108  produceGlobalPosition_(iConfig.getParameter<bool>("produceGlobalPosition")),
109  produceTrackerSurfaceDeformation_(iConfig.getParameter<bool>("produceTrackerSurfaceDeformation"))
110 {
111  // This 'appendToDataLabel' is used by the framework to distinguish providers
112  // with different settings and to request a special one by e.g.
113  // iSetup.get<TrackerDigiGeometryRecord>().get("theLabel", tkGeomHandle);
114 
115  edm::LogInfo("Alignments")
116  << "@SUB=FakeAlignmentSource" << "Providing data with label '"
117  << iConfig.getParameter<std::string>("appendToDataLabel") << "'.";
118 
119  // Tell framework what data is produced by which method:
120  if (produceTracker_) {
123  }
124  if (produceDT_) {
127  }
128  if (produceCSC_) {
131  }
134  }
137  }
138 
139  // Tell framework to provide IOV for the above data:
140  if (produceTracker_) {
141  this->findingRecord<TrackerAlignmentRcd>();
142  this->findingRecord<TrackerAlignmentErrorExtendedRcd>();
143  }
144  if (produceDT_) {
145  this->findingRecord<DTAlignmentRcd>();
146  this->findingRecord<DTAlignmentErrorExtendedRcd>();
147  }
148  if (produceCSC_) {
149  this->findingRecord<CSCAlignmentRcd>();
150  this->findingRecord<CSCAlignmentErrorExtendedRcd>();
151  }
153  this->findingRecord<GlobalPositionRcd>();
154  }
156  this->findingRecord<TrackerSurfaceDeformationRcd>();
157  }
158 }
159 
161  const edm::IOVSyncValue& ioSyncVal,
162  edm::ValidityInterval& outValidity )
163 {
164  // Implementation copied from SiStripGainFakeESSource: unlimited IOV
165  outValidity = edm::ValidityInterval(ioSyncVal.beginOfTime(), ioSyncVal.endOfTime());
166 }
167 
168 //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.