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 }
MessageLogger.h
TrackerGeometry.h
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ValidityInterval
Definition: ValidityInterval.h:28
infinity
const double infinity
Definition: CSCChamberFitter.cc:10
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
SiPixelFakeLorentzAngleESSource::~SiPixelFakeLorentzAngleESSource
~SiPixelFakeLorentzAngleESSource() override
Definition: SiPixelFakeLorentzAngleESSource.cc:38
SiPixelDetInfoFileReader
Definition: SiPixelDetInfoFileReader.h:28
DQM.reader
reader
Definition: DQM.py:105
SiPixelLorentzAngle
Definition: SiPixelLorentzAngle.h:11
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiPixelFakeLorentzAngleESSource::SiPixelFakeLorentzAngleESSource
SiPixelFakeLorentzAngleESSource(const edm::ParameterSet &)
Definition: SiPixelFakeLorentzAngleESSource.cc:29
SiPixelLorentzAngleRcd
Definition: SiPixelLorentzAngleRcd.h:24
SiPixelDetInfoFileReader.h
SiPixelFakeLorentzAngleESSource::produce
virtual std::unique_ptr< SiPixelLorentzAngle > produce(const SiPixelLorentzAngleRcd &)
Definition: SiPixelFakeLorentzAngleESSource.cc:43
SiPixelFakeLorentzAngleESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: SiPixelFakeLorentzAngleESSource.cc:66
edm::es
Definition: es_Label.h:33
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
SiPixelFakeLorentzAngleESSource::fp_
edm::FileInPath fp_
Definition: SiPixelFakeLorentzAngleESSource.h:50
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163
SiPixelFakeLorentzAngleESSource.h