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 //
29 SiPixelFakeLorentzAngleESSource::SiPixelFakeLorentzAngleESSource(const edm::ParameterSet& conf_) : fp_(conf_.getParameter<edm::FileInPath>("file"))
30 {
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 {
40 
41  // do anything here that needs to be done at desctruction time
42  // (e.g. close files, deallocate resources etc.)
43 
44 }
45 
46 std::unique_ptr<SiPixelLorentzAngle> SiPixelFakeLorentzAngleESSource::produce(const SiPixelLorentzAngleRcd & )
47 {
48 
49  using namespace edm::es;
50  unsigned int nmodules = 0;
53  const std::vector<uint32_t> DetIds = reader.getAllDetIds();
54 
55  // Loop over detectors
56  for(std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit!=DetIds.end(); detit++) {
57  nmodules++;
58  float langle = 0.106;
59  //std::cout << "detid " << (*detit) << std::endl;
60 
61  if( !obj->putLorentzAngle(*detit,langle) ) edm::LogError("SiPixelFakeLorentzAngleESSource")<<"[SiPixelFakeLorentzAngleESSource::produce] detid already exists"<<std::endl;
62  }
63 
64  //std::cout << "Modules = " << nmodules << std::endl;
65 
66  return std::unique_ptr<SiPixelLorentzAngle>(obj);
67 
68 
69 }
70 
72  const edm::IOVSyncValue& iosv,
73  edm::ValidityInterval& oValidity ) {
75  oValidity = infinity;
76 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
static const IOVSyncValue & beginOfTime()
virtual std::unique_ptr< SiPixelLorentzAngle > produce(const SiPixelLorentzAngleRcd &)
const double infinity
SiPixelFakeLorentzAngleESSource(const edm::ParameterSet &)
bool putLorentzAngle(const uint32_t &, float &)
HLT enums.
std::string fullPath() const
Definition: FileInPath.cc:184