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.3 2010/11/23 13:24:32 mussgill 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<AlignmentErrors> produceTkAliErr(const TrackerAlignmentErrorRcd&) {
56  return std::auto_ptr<AlignmentErrors>(new AlignmentErrors);
57  }
58 
60  std::auto_ptr<Alignments> produceDTAli(const DTAlignmentRcd&) {
61  return std::auto_ptr<Alignments>(new Alignments);
62  }
63  std::auto_ptr<AlignmentErrors> produceDTAliErr(const DTAlignmentErrorRcd&) {
64  return std::auto_ptr<AlignmentErrors>(new AlignmentErrors);
65  }
66 
68  std::auto_ptr<Alignments> produceCSCAli(const CSCAlignmentRcd&) {
69  return std::auto_ptr<Alignments>(new Alignments);
70  }
71  std::auto_ptr<AlignmentErrors> produceCSCAliErr(const CSCAlignmentErrorRcd&) {
72  return std::auto_ptr<AlignmentErrors>(new AlignmentErrors);
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);
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<TrackerAlignmentErrorRcd>();
143  }
144  if (produceDT_) {
145  this->findingRecord<DTAlignmentRcd>();
146  this->findingRecord<DTAlignmentErrorRcd>();
147  }
148  if (produceCSC_) {
149  this->findingRecord<CSCAlignmentRcd>();
150  this->findingRecord<CSCAlignmentErrorRcd>();
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
std::auto_ptr< AlignmentErrors > produceDTAliErr(const DTAlignmentErrorRcd &)
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
std::auto_ptr< AlignmentErrors > produceTkAliErr(const TrackerAlignmentErrorRcd &)
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &ioSyncVal, edm::ValidityInterval &iov)
provide (dummy) IOV
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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< 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.
std::auto_ptr< AlignmentErrors > produceCSCAliErr(const CSCAlignmentErrorRcd &)