CMS 3D CMS Logo

HcalDbProducer.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalDbProducer
4 // Class: HcalDbProducer
5 //
13 //
14 // Original Author: Fedor Ratnikov
15 // Created: Tue Aug 9 19:10:10 CDT 2005
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
31 
36 
38 public:
40  ~HcalDbProducer() override;
41 
42  std::shared_ptr<HcalDbService> produce( const HcalDbRecord& );
43 
44  std::unique_ptr<HcalPedestals> producePedestalsWithTopo(const HcalPedestalsRcd&);
45  std::unique_ptr<HcalPedestalWidths> producePedestalWidthsWithTopo(const HcalPedestalWidthsRcd&);
46  std::unique_ptr<HcalPedestals> produceEffectivePedestalsWithTopo(const HcalPedestalsRcd&);
47  std::unique_ptr<HcalPedestalWidths> produceEffectivePedestalWidthsWithTopo(const HcalPedestalWidthsRcd&);
48  std::unique_ptr<HcalGains> produceGainsWithTopo(const HcalGainsRcd&);
49  std::unique_ptr<HcalGainWidths> produceGainWidthsWithTopo(const HcalGainWidthsRcd&);
50  std::unique_ptr<HcalQIEData> produceQIEDataWithTopo(const HcalQIEDataRcd&);
51  std::unique_ptr<HcalQIETypes> produceQIETypesWithTopo(const HcalQIETypesRcd&);
52  std::unique_ptr<HcalChannelQuality> produceChannelQualityWithTopo( const HcalChannelQualityRcd&);
53  std::unique_ptr<HcalZSThresholds> produceZSThresholdsWithTopo(const HcalZSThresholdsRcd&);
54  std::unique_ptr<HcalRespCorrs> produceRespCorrsWithTopo(const HcalRespCorrsRcd&);
55  std::unique_ptr<HcalL1TriggerObjects> produceL1triggerObjectsWithTopo(const HcalL1TriggerObjectsRcd&);
56  std::unique_ptr<HcalTimeCorrs> produceTimeCorrsWithTopo(const HcalTimeCorrsRcd&);
57  std::unique_ptr<HcalLUTCorrs> produceLUTCorrsWithTopo(const HcalLUTCorrsRcd&);
58  std::unique_ptr<HcalPFCorrs> producePFCorrsWithTopo(const HcalPFCorrsRcd&);
59  std::unique_ptr<HcalLutMetadata> produceLUTMetadataWithTopo(const HcalLutMetadataRcd&);
60  std::unique_ptr<HcalSiPMParameters> produceSiPMParametersWithTopo(const HcalSiPMParametersRcd&);
61  std::unique_ptr<HcalTPChannelParameters> produceTPChannelParametersWithTopo(const HcalTPChannelParametersRcd&);
62  std::unique_ptr<HcalMCParams> produceMCParamsWithTopo(const HcalMCParamsRcd&);
63  std::unique_ptr<HcalRecoParams> produceRecoParamsWithTopo(const HcalRecoParamsRcd&);
64 
69 
70 private:
71 
95 
96  template <typename ProductType, typename RecordType>
97  static std::unique_ptr<ProductType> produceWithTopology(RecordType const& record) {
98 
100  record.get(item);
101 
102  auto productWithTopology = std::make_unique<ProductType>(*item);
103 
105  record. template getRecord<HcalRecNumberingRecord>().get(htopo);
106  const HcalTopology* topo=&(*htopo);
107  productWithTopology->setTopo(topo);
108 
109  return productWithTopology;
110  }
111 
112  template <typename ProductType, typename RecordType>
114  const HcalDbRecord& record,
115  const char* label,
116  const char* dumpName,
117  const char* dumpHeader) {
118 
119  host.ifRecordChanges<RecordType>(record,
120  [this, &host, label, dumpName, dumpHeader](auto const& rec) {
122  rec.get(label, item);
123  host.setData(item.product());
124 
125  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string (dumpName)) != mDumpRequest.end()) {
126  *mDumpStream << dumpHeader << std::endl;
128  }
129  });
130  }
131 
132  // ----------member data ---------------------------
134 
135  std::vector<std::string> mDumpRequest;
136  std::ostream* mDumpStream;
137 };
host
Definition: query.py:115
std::unique_ptr< HcalLutMetadata > produceLUTMetadataWithTopo(const HcalLutMetadataRcd &)
void setupPedestals(const HcalPedestalsRcd &, HcalDbService &)
std::unique_ptr< HcalQIETypes > produceQIETypesWithTopo(const HcalQIETypesRcd &)
std::unique_ptr< HcalTimeCorrs > produceTimeCorrsWithTopo(const HcalTimeCorrsRcd &)
JetCorrectorParameters::Record record
Definition: classes.h:7
std::unique_ptr< HcalPedestalWidths > producePedestalWidthsWithTopo(const HcalPedestalWidthsRcd &)
std::unique_ptr< HcalRespCorrs > produceRespCorrsWithTopo(const HcalRespCorrsRcd &)
HcalDbProducer(const edm::ParameterSet &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::unique_ptr< HcalSiPMParameters > produceSiPMParametersWithTopo(const HcalSiPMParametersRcd &)
std::unique_ptr< HcalTPChannelParameters > produceTPChannelParametersWithTopo(const HcalTPChannelParametersRcd &)
std::unique_ptr< HcalChannelQuality > produceChannelQualityWithTopo(const HcalChannelQualityRcd &)
char const * label
void ifRecordChanges(ContainingRecordType const &containingRecord, FUNC func)
std::vector< std::string > mDumpRequest
void setupHcalDbService(HostType &host, const HcalDbRecord &record, const char *label, const char *dumpName, const char *dumpHeader)
std::unique_ptr< HcalPedestals > produceEffectivePedestalsWithTopo(const HcalPedestalsRcd &)
std::unique_ptr< HcalPFCorrs > producePFCorrsWithTopo(const HcalPFCorrsRcd &)
std::unique_ptr< HcalLUTCorrs > produceLUTCorrsWithTopo(const HcalLUTCorrsRcd &)
std::unique_ptr< HcalGains > produceGainsWithTopo(const HcalGainsRcd &)
void setupEffectivePedestalWidths(const HcalPedestalWidthsRcd &, HcalDbService &)
std::unique_ptr< HcalZSThresholds > produceZSThresholdsWithTopo(const HcalZSThresholdsRcd &)
std::unique_ptr< HcalRecoParams > produceRecoParamsWithTopo(const HcalRecoParamsRcd &)
std::unique_ptr< HcalL1TriggerObjects > produceL1triggerObjectsWithTopo(const HcalL1TriggerObjectsRcd &)
~HcalDbProducer() override
std::unique_ptr< HcalMCParams > produceMCParamsWithTopo(const HcalMCParamsRcd &)
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
std::unique_ptr< HcalGainWidths > produceGainWidthsWithTopo(const HcalGainWidthsRcd &)
void setupPedestalWidths(const HcalPedestalWidthsRcd &, HcalDbService &)
static std::unique_ptr< ProductType > produceWithTopology(RecordType const &record)
std::ostream * mDumpStream
std::shared_ptr< HcalDbService > produce(const HcalDbRecord &)
std::unique_ptr< HcalQIEData > produceQIEDataWithTopo(const HcalQIEDataRcd &)
std::unique_ptr< HcalPedestals > producePedestalsWithTopo(const HcalPedestalsRcd &)
edm::ReusableObjectHolder< HostType > holder_
std::unique_ptr< HcalPedestalWidths > produceEffectivePedestalWidthsWithTopo(const HcalPedestalWidthsRcd &)
T const * product() const
Definition: ESHandle.h:86
void setupEffectivePedestals(const HcalPedestalsRcd &, HcalDbService &)