CMS 3D CMS Logo

SiPixelFakeLorentzAngleESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelFakeLorentzAngleESSource
4 // Class: SiPixelFakeLorentzAngleESSource
5 //
13 //
14 // Original Author: Lotte Wilke
15 // Created: Jan 31 2008
16 //
17 //
18 
19 // user include files
20 
26 //
27 // constructors and destructor
28 //
30  : fp_(conf_.getParameter<edm::FileInPath>("file")) {
31  edm::LogInfo("SiPixelFakeLorentzAngleESSource::SiPixelFakeLorentzAngleESSource");
32  //the following line is needed to tell the framework what
33  // data is being produced
34  setWhatProduced(this);
35  findingRecord<SiPixelLorentzAngleRcd>();
36 }
37 
39  // do anything here that needs to be done at desctruction time
40  // (e.g. close files, deallocate resources etc.)
41 }
42 
43 std::unique_ptr<SiPixelLorentzAngle> SiPixelFakeLorentzAngleESSource::produce(const SiPixelLorentzAngleRcd&) {
44  using namespace edm::es;
45  unsigned int nmodules = 0;
48  const std::vector<uint32_t>& DetIds = reader.getAllDetIds();
49 
50  // Loop over detectors
51  for (std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit != DetIds.end(); detit++) {
52  nmodules++;
53  float langle = 0.106;
54  //std::cout << "detid " << (*detit) << std::endl;
55 
56  if (!obj->putLorentzAngle(*detit, langle))
57  edm::LogError("SiPixelFakeLorentzAngleESSource")
58  << "[SiPixelFakeLorentzAngleESSource::produce] detid already exists" << std::endl;
59  }
60 
61  //std::cout << "Modules = " << nmodules << std::endl;
62 
63  return std::unique_ptr<SiPixelLorentzAngle>(obj);
64 }
65 
67  const edm::IOVSyncValue& iosv,
68  edm::ValidityInterval& oValidity) {
70  oValidity = infinity;
71 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
reader
Definition: DQM.py:105
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
virtual std::unique_ptr< SiPixelLorentzAngle > produce(const SiPixelLorentzAngleRcd &)
const double infinity
SiPixelFakeLorentzAngleESSource(const edm::ParameterSet &)
bool putLorentzAngle(const uint32_t &, float &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
HLT enums.
std::string fullPath() const
Definition: FileInPath.cc:163