CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalTPGDBCopy Class Reference

#include <EcalTPGDBCopy.h>

Inheritance diagram for EcalTPGDBCopy:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup) override
 
 EcalTPGDBCopy (const edm::ParameterSet &iConfig)
 
 ~EcalTPGDBCopy () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void copyToDB (const edm::EventSetup &evtSetup, const std::string &container)
 
void setConsumes (edm::ConsumesCollector &cc, const std::string &container)
 
bool shouldCopy (const edm::EventSetup &evtSetup, const std::string &container)
 

Private Attributes

edm::ESGetToken< EcalTPGCrystalStatus, EcalTPGCrystalStatusRcdcrystalStatusToken_
 
edm::ESGetToken< EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcdfineGrainEBGroupToken_
 
edm::ESGetToken< EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcdfineGrainEBIdMapToken_
 
edm::ESGetToken< EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcdfineGrainStripEEToken_
 
edm::ESGetToken< EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcdfineGrainTowerEEToken_
 
edm::ESGetToken< EcalTPGLinearizationConst, EcalTPGLinearizationConstRcdlinearizationConstToken_
 
edm::ESGetToken< EcalTPGLutGroup, EcalTPGLutGroupRcdlutGroupToken_
 
edm::ESGetToken< EcalTPGLutIdMap, EcalTPGLutIdMapRcdlutIdMapToken_
 
std::map< std::string, unsigned long long > m_cacheIDs
 
std::map< std::string, std::string > m_records
 
std::string m_timetype
 
edm::ESGetToken< EcalTPGOddWeightGroup, EcalTPGOddWeightGroupRcdoddWeightGroupToken_
 
edm::ESGetToken< EcalTPGOddWeightIdMap, EcalTPGOddWeightIdMapRcdoddWeightIdMapToken_
 
edm::ESGetToken< EcalTPGPedestals, EcalTPGPedestalsRcdpedestalsToken_
 
edm::ESGetToken< EcalTPGPhysicsConst, EcalTPGPhysicsConstRcdphysicsConstToken_
 
edm::ESGetToken< EcalTPGSlidingWindow, EcalTPGSlidingWindowRcdslidingWindowToken_
 
edm::ESGetToken< EcalTPGSpike, EcalTPGSpikeRcdspikeToken_
 
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcdstripStatusToken_
 
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcdtowerStatusToken_
 
edm::ESGetToken< EcalTPGTPMode, EcalTPGTPModeRcdtpModeToken_
 
edm::ESGetToken< EcalTPGWeightGroup, EcalTPGWeightGroupRcdweightGroupToken_
 
edm::ESGetToken< EcalTPGWeightIdMap, EcalTPGWeightIdMapRcdweightIdMapToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 59 of file EcalTPGDBCopy.h.

Constructor & Destructor Documentation

◆ EcalTPGDBCopy()

EcalTPGDBCopy::EcalTPGDBCopy ( const edm::ParameterSet iConfig)
explicit

Definition at line 13 of file EcalTPGDBCopy.cc.

References gpuPixelDoublets::cc, edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), mps_fire::i, m_cacheIDs, m_records, AlCaHarvesting_cff::record, setConsumes(), AlCaHLTBitMon_QueryRunRegistry::string, and makeGlobalPositionRcd_cfg::tag.

14  : m_timetype(iConfig.getParameter<std::string>("timetype")), m_cacheIDs(), m_records() {
15  auto cc = consumesCollector();
16  std::string container;
19  typedef std::vector<edm::ParameterSet> Parameters;
20  Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
21  for (Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) {
22  container = i->getParameter<std::string>("container");
23  record = i->getParameter<std::string>("record");
24  m_cacheIDs.insert(std::make_pair(container, 0));
25  m_records.insert(std::make_pair(container, record));
26  setConsumes(cc, container);
27  }
28 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string m_timetype
Definition: EcalTPGDBCopy.h:71
std::map< std::string, unsigned long long > m_cacheIDs
Definition: EcalTPGDBCopy.h:72
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
std::map< std::string, std::string > m_records
Definition: EcalTPGDBCopy.h:73
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
void setConsumes(edm::ConsumesCollector &cc, const std::string &container)

◆ ~EcalTPGDBCopy()

EcalTPGDBCopy::~EcalTPGDBCopy ( )
override

Definition at line 30 of file EcalTPGDBCopy.cc.

30 {}

Member Function Documentation

◆ analyze()

void EcalTPGDBCopy::analyze ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 32 of file EcalTPGDBCopy.cc.

References copyToDB(), mps_fire::i, m_records, AlCaHarvesting_cff::record, shouldCopy(), and AlCaHLTBitMon_QueryRunRegistry::string.

32  {
33  std::string container;
35  typedef std::map<std::string, std::string>::const_iterator recordIter;
36  for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
37  container = (*i).first;
38  record = (*i).second;
39  if (shouldCopy(evtSetup, container)) {
40  copyToDB(evtSetup, container);
41  }
42  }
43 }
std::map< std::string, std::string > m_records
Definition: EcalTPGDBCopy.h:73
bool shouldCopy(const edm::EventSetup &evtSetup, const std::string &container)
void copyToDB(const edm::EventSetup &evtSetup, const std::string &container)

◆ copyToDB()

void EcalTPGDBCopy::copyToDB ( const edm::EventSetup evtSetup,
const std::string &  container 
)
private

Definition at line 142 of file EcalTPGDBCopy.cc.

References cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::createOneIOV(), crystalStatusToken_, Exception, fineGrainEBGroupToken_, fineGrainEBIdMapToken_, fineGrainStripEEToken_, fineGrainTowerEEToken_, edm::EventSetup::getData(), edm::Service< T >::isAvailable(), linearizationConstToken_, lutGroupToken_, lutIdMapToken_, m_records, getGTfromDQMFile::obj, oddWeightGroupToken_, oddWeightIdMapToken_, pedestalsToken_, physicsConstToken_, align_cfg::recordName, slidingWindowToken_, spikeToken_, AlCaHLTBitMon_QueryRunRegistry::string, stripStatusToken_, towerStatusToken_, tpModeToken_, weightGroupToken_, and weightIdMapToken_.

Referenced by analyze().

142  {
144  if (!dbOutput.isAvailable()) {
145  throw cms::Exception("PoolDBOutputService is not available");
146  }
147 
148  std::string recordName = m_records[container];
149 
150  if (container == "EcalTPGPedestals") {
151  const auto& obj = evtSetup.getData(pedestalsToken_);
152  dbOutput->createOneIOV<const EcalTPGPedestals>(obj, dbOutput->beginOfTime(), recordName);
153 
154  } else if (container == "EcalTPGLinearizationConst") {
155  const auto& obj = evtSetup.getData(linearizationConstToken_);
156  dbOutput->createOneIOV<const EcalTPGLinearizationConst>(obj, dbOutput->beginOfTime(), recordName);
157 
158  } else if (container == "EcalTPGSlidingWindow") {
159  const auto& obj = evtSetup.getData(slidingWindowToken_);
160  dbOutput->createOneIOV<const EcalTPGSlidingWindow>(obj, dbOutput->beginOfTime(), recordName);
161 
162  } else if (container == "EcalTPGFineGrainEBIdMap") {
163  const auto& obj = evtSetup.getData(fineGrainEBIdMapToken_);
164  dbOutput->createOneIOV<const EcalTPGFineGrainEBIdMap>(obj, dbOutput->beginOfTime(), recordName);
165 
166  } else if (container == "EcalTPGFineGrainStripEE") {
167  const auto& obj = evtSetup.getData(fineGrainStripEEToken_);
168  dbOutput->createOneIOV<const EcalTPGFineGrainStripEE>(obj, dbOutput->beginOfTime(), recordName);
169 
170  } else if (container == "EcalTPGFineGrainTowerEE") {
171  const auto& obj = evtSetup.getData(fineGrainTowerEEToken_);
172  dbOutput->createOneIOV<const EcalTPGFineGrainTowerEE>(obj, dbOutput->beginOfTime(), recordName);
173 
174  } else if (container == "EcalTPGLutIdMap") {
175  const auto& obj = evtSetup.getData(lutIdMapToken_);
176  dbOutput->createOneIOV<const EcalTPGLutIdMap>(obj, dbOutput->beginOfTime(), recordName);
177 
178  } else if (container == "EcalTPGWeightIdMap") {
179  const auto& obj = evtSetup.getData(weightIdMapToken_);
180  dbOutput->createOneIOV<const EcalTPGWeightIdMap>(obj, dbOutput->beginOfTime(), recordName);
181 
182  } else if (container == "EcalTPGWeightGroup") {
183  const auto& obj = evtSetup.getData(weightGroupToken_);
184  dbOutput->createOneIOV<const EcalTPGWeightGroup>(obj, dbOutput->beginOfTime(), recordName);
185 
186  } else if (container == "EcalTPGOddWeightIdMap") {
187  const auto& obj = evtSetup.getData(oddWeightIdMapToken_);
188  dbOutput->createOneIOV<const EcalTPGOddWeightIdMap>(obj, dbOutput->beginOfTime(), recordName);
189 
190  } else if (container == "EcalTPGOddWeightGroup") {
191  const auto& obj = evtSetup.getData(oddWeightGroupToken_);
192  dbOutput->createOneIOV<const EcalTPGOddWeightGroup>(obj, dbOutput->beginOfTime(), recordName);
193 
194  } else if (container == "EcalTPGTPMode") {
195  const auto& obj = evtSetup.getData(tpModeToken_);
196  dbOutput->createOneIOV<const EcalTPGTPMode>(obj, dbOutput->beginOfTime(), recordName);
197 
198  } else if (container == "EcalTPGLutGroup") {
199  const auto& obj = evtSetup.getData(lutGroupToken_);
200  dbOutput->createOneIOV<const EcalTPGLutGroup>(obj, dbOutput->beginOfTime(), recordName);
201 
202  } else if (container == "EcalTPGFineGrainEBGroup") {
203  const auto& obj = evtSetup.getData(fineGrainEBGroupToken_);
204  dbOutput->createOneIOV<const EcalTPGFineGrainEBGroup>(obj, dbOutput->beginOfTime(), recordName);
205 
206  } else if (container == "EcalTPGPhysicsConst") {
207  const auto& obj = evtSetup.getData(physicsConstToken_);
208  dbOutput->createOneIOV<const EcalTPGPhysicsConst>(obj, dbOutput->beginOfTime(), recordName);
209 
210  } else if (container == "EcalTPGCrystalStatus") {
211  const auto& obj = evtSetup.getData(crystalStatusToken_);
212  dbOutput->createOneIOV<const EcalTPGCrystalStatus>(obj, dbOutput->beginOfTime(), recordName);
213 
214  } else if (container == "EcalTPGTowerStatus") {
215  const auto& obj = evtSetup.getData(towerStatusToken_);
216  dbOutput->createOneIOV<const EcalTPGTowerStatus>(obj, dbOutput->beginOfTime(), recordName);
217 
218  } else if (container == "EcalTPGSpike") {
219  const auto& obj = evtSetup.getData(spikeToken_);
220  dbOutput->createOneIOV<const EcalTPGSpike>(obj, dbOutput->beginOfTime(), recordName);
221 
222  } else if (container == "EcalTPGStripStatus") {
223  const auto& obj = evtSetup.getData(stripStatusToken_);
224  dbOutput->createOneIOV<const EcalTPGStripStatus>(obj, dbOutput->beginOfTime(), recordName);
225 
226  } else {
227  throw cms::Exception("Unknown container");
228  }
229 
230  edm::LogInfo("EcalTPGDBCopy") << "EcalTPGDBCopy wrote " << recordName;
231 }
edm::ESGetToken< EcalTPGSpike, EcalTPGSpikeRcd > spikeToken_
Definition: EcalTPGDBCopy.h:92
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::map< std::string, std::string > m_records
Definition: EcalTPGDBCopy.h:73
edm::ESGetToken< EcalTPGOddWeightIdMap, EcalTPGOddWeightIdMapRcd > oddWeightIdMapToken_
Definition: EcalTPGDBCopy.h:84
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcd > towerStatusToken_
Definition: EcalTPGDBCopy.h:91
edm::ESGetToken< EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd > fineGrainStripEEToken_
Definition: EcalTPGDBCopy.h:79
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
edm::ESGetToken< EcalTPGPedestals, EcalTPGPedestalsRcd > pedestalsToken_
Definition: EcalTPGDBCopy.h:75
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcd > stripStatusToken_
Definition: EcalTPGDBCopy.h:93
edm::ESGetToken< EcalTPGWeightGroup, EcalTPGWeightGroupRcd > weightGroupToken_
Definition: EcalTPGDBCopy.h:83
Log< level::Info, false > LogInfo
edm::ESGetToken< EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd > crystalStatusToken_
Definition: EcalTPGDBCopy.h:90
edm::ESGetToken< EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd > weightIdMapToken_
Definition: EcalTPGDBCopy.h:82
edm::ESGetToken< EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd > slidingWindowToken_
Definition: EcalTPGDBCopy.h:77
edm::ESGetToken< EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd > fineGrainEBIdMapToken_
Definition: EcalTPGDBCopy.h:78
edm::ESGetToken< EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd > physicsConstToken_
Definition: EcalTPGDBCopy.h:89
edm::ESGetToken< EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd > fineGrainTowerEEToken_
Definition: EcalTPGDBCopy.h:80
bool isAvailable() const
Definition: Service.h:40
edm::ESGetToken< EcalTPGTPMode, EcalTPGTPModeRcd > tpModeToken_
Definition: EcalTPGDBCopy.h:86
edm::ESGetToken< EcalTPGLutIdMap, EcalTPGLutIdMapRcd > lutIdMapToken_
Definition: EcalTPGDBCopy.h:81
edm::ESGetToken< EcalTPGLutGroup, EcalTPGLutGroupRcd > lutGroupToken_
Definition: EcalTPGDBCopy.h:87
edm::ESGetToken< EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd > fineGrainEBGroupToken_
Definition: EcalTPGDBCopy.h:88
edm::ESGetToken< EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd > linearizationConstToken_
Definition: EcalTPGDBCopy.h:76
edm::ESGetToken< EcalTPGOddWeightGroup, EcalTPGOddWeightGroupRcd > oddWeightGroupToken_
Definition: EcalTPGDBCopy.h:85

◆ setConsumes()

void EcalTPGDBCopy::setConsumes ( edm::ConsumesCollector cc,
const std::string &  container 
)
private

Definition at line 45 of file EcalTPGDBCopy.cc.

References gpuPixelDoublets::cc, crystalStatusToken_, Exception, fineGrainEBGroupToken_, fineGrainEBIdMapToken_, fineGrainStripEEToken_, fineGrainTowerEEToken_, linearizationConstToken_, lutGroupToken_, lutIdMapToken_, oddWeightGroupToken_, oddWeightIdMapToken_, pedestalsToken_, physicsConstToken_, slidingWindowToken_, spikeToken_, stripStatusToken_, towerStatusToken_, tpModeToken_, weightGroupToken_, and weightIdMapToken_.

Referenced by EcalTPGDBCopy().

45  {
46  if (container == "EcalTPGPedestals") {
47  pedestalsToken_ = cc.esConsumes();
48  } else if (container == "EcalTPGLinearizationConst") {
49  linearizationConstToken_ = cc.esConsumes();
50  } else if (container == "EcalTPGSlidingWindow") {
51  slidingWindowToken_ = cc.esConsumes();
52  } else if (container == "EcalTPGFineGrainEBIdMap") {
53  fineGrainEBIdMapToken_ = cc.esConsumes();
54  } else if (container == "EcalTPGFineGrainStripEE") {
55  fineGrainStripEEToken_ = cc.esConsumes();
56  } else if (container == "EcalTPGFineGrainTowerEE") {
57  fineGrainTowerEEToken_ = cc.esConsumes();
58  } else if (container == "EcalTPGLutIdMap") {
59  lutIdMapToken_ = cc.esConsumes();
60  } else if (container == "EcalTPGWeightIdMap") {
61  weightIdMapToken_ = cc.esConsumes();
62  } else if (container == "EcalTPGWeightGroup") {
63  weightGroupToken_ = cc.esConsumes();
64  } else if (container == "EcalTPGOddWeightIdMap") {
65  oddWeightIdMapToken_ = cc.esConsumes();
66  } else if (container == "EcalTPGOddWeightGroup") {
67  oddWeightGroupToken_ = cc.esConsumes();
68  } else if (container == "EcalTPGTPMode") {
69  tpModeToken_ = cc.esConsumes();
70  } else if (container == "EcalTPGLutGroup") {
71  lutGroupToken_ = cc.esConsumes();
72  } else if (container == "EcalTPGFineGrainEBGroup") {
73  fineGrainEBGroupToken_ = cc.esConsumes();
74  } else if (container == "EcalTPGPhysicsConst") {
75  physicsConstToken_ = cc.esConsumes();
76  } else if (container == "EcalTPGCrystalStatus") {
77  crystalStatusToken_ = cc.esConsumes();
78  } else if (container == "EcalTPGTowerStatus") {
79  towerStatusToken_ = cc.esConsumes();
80  } else if (container == "EcalTPGSpike") {
81  spikeToken_ = cc.esConsumes();
82  } else if (container == "EcalTPGStripStatus") {
83  stripStatusToken_ = cc.esConsumes();
84  } else {
85  throw cms::Exception("Unknown container");
86  }
87 }
edm::ESGetToken< EcalTPGSpike, EcalTPGSpikeRcd > spikeToken_
Definition: EcalTPGDBCopy.h:92
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< EcalTPGOddWeightIdMap, EcalTPGOddWeightIdMapRcd > oddWeightIdMapToken_
Definition: EcalTPGDBCopy.h:84
edm::ESGetToken< EcalTPGTowerStatus, EcalTPGTowerStatusRcd > towerStatusToken_
Definition: EcalTPGDBCopy.h:91
edm::ESGetToken< EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd > fineGrainStripEEToken_
Definition: EcalTPGDBCopy.h:79
edm::ESGetToken< EcalTPGPedestals, EcalTPGPedestalsRcd > pedestalsToken_
Definition: EcalTPGDBCopy.h:75
edm::ESGetToken< EcalTPGStripStatus, EcalTPGStripStatusRcd > stripStatusToken_
Definition: EcalTPGDBCopy.h:93
edm::ESGetToken< EcalTPGWeightGroup, EcalTPGWeightGroupRcd > weightGroupToken_
Definition: EcalTPGDBCopy.h:83
edm::ESGetToken< EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd > crystalStatusToken_
Definition: EcalTPGDBCopy.h:90
edm::ESGetToken< EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd > weightIdMapToken_
Definition: EcalTPGDBCopy.h:82
edm::ESGetToken< EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd > slidingWindowToken_
Definition: EcalTPGDBCopy.h:77
edm::ESGetToken< EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd > fineGrainEBIdMapToken_
Definition: EcalTPGDBCopy.h:78
edm::ESGetToken< EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd > physicsConstToken_
Definition: EcalTPGDBCopy.h:89
edm::ESGetToken< EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd > fineGrainTowerEEToken_
Definition: EcalTPGDBCopy.h:80
edm::ESGetToken< EcalTPGTPMode, EcalTPGTPModeRcd > tpModeToken_
Definition: EcalTPGDBCopy.h:86
edm::ESGetToken< EcalTPGLutIdMap, EcalTPGLutIdMapRcd > lutIdMapToken_
Definition: EcalTPGDBCopy.h:81
edm::ESGetToken< EcalTPGLutGroup, EcalTPGLutGroupRcd > lutGroupToken_
Definition: EcalTPGDBCopy.h:87
edm::ESGetToken< EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd > fineGrainEBGroupToken_
Definition: EcalTPGDBCopy.h:88
edm::ESGetToken< EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd > linearizationConstToken_
Definition: EcalTPGDBCopy.h:76
edm::ESGetToken< EcalTPGOddWeightGroup, EcalTPGOddWeightGroupRcd > oddWeightGroupToken_
Definition: EcalTPGDBCopy.h:85

◆ shouldCopy()

bool EcalTPGDBCopy::shouldCopy ( const edm::EventSetup evtSetup,
const std::string &  container 
)
private

Definition at line 89 of file EcalTPGDBCopy.cc.

References Exception, edm::EventSetup::get(), and m_cacheIDs.

Referenced by analyze().

89  {
90  unsigned long long cacheID = 0;
91 
92  if (container == "EcalTPGPedestals") {
93  cacheID = evtSetup.get<EcalTPGPedestalsRcd>().cacheIdentifier();
94  } else if (container == "EcalTPGLinearizationConst") {
95  cacheID = evtSetup.get<EcalTPGLinearizationConstRcd>().cacheIdentifier();
96  } else if (container == "EcalTPGSlidingWindow") {
97  cacheID = evtSetup.get<EcalTPGSlidingWindowRcd>().cacheIdentifier();
98  } else if (container == "EcalTPGFineGrainEBIdMap") {
99  cacheID = evtSetup.get<EcalTPGFineGrainEBIdMapRcd>().cacheIdentifier();
100  } else if (container == "EcalTPGFineGrainStripEE") {
101  cacheID = evtSetup.get<EcalTPGFineGrainStripEERcd>().cacheIdentifier();
102  } else if (container == "EcalTPGFineGrainTowerEE") {
103  cacheID = evtSetup.get<EcalTPGFineGrainTowerEERcd>().cacheIdentifier();
104  } else if (container == "EcalTPGLutIdMap") {
105  cacheID = evtSetup.get<EcalTPGLutIdMapRcd>().cacheIdentifier();
106  } else if (container == "EcalTPGWeightIdMap") {
107  cacheID = evtSetup.get<EcalTPGWeightIdMapRcd>().cacheIdentifier();
108  } else if (container == "EcalTPGWeightGroup") {
109  cacheID = evtSetup.get<EcalTPGWeightGroupRcd>().cacheIdentifier();
110  } else if (container == "EcalTPGOddWeightIdMap") {
111  cacheID = evtSetup.get<EcalTPGOddWeightIdMapRcd>().cacheIdentifier();
112  } else if (container == "EcalTPGOddWeightGroup") {
113  cacheID = evtSetup.get<EcalTPGOddWeightGroupRcd>().cacheIdentifier();
114  } else if (container == "EcalTPGTPMode") {
115  cacheID = evtSetup.get<EcalTPGTPModeRcd>().cacheIdentifier();
116  } else if (container == "EcalTPGLutGroup") {
117  cacheID = evtSetup.get<EcalTPGLutGroupRcd>().cacheIdentifier();
118  } else if (container == "EcalTPGFineGrainEBGroup") {
119  cacheID = evtSetup.get<EcalTPGFineGrainEBGroupRcd>().cacheIdentifier();
120  } else if (container == "EcalTPGPhysicsConst") {
121  cacheID = evtSetup.get<EcalTPGPhysicsConstRcd>().cacheIdentifier();
122  } else if (container == "EcalTPGCrystalStatus") {
123  cacheID = evtSetup.get<EcalTPGCrystalStatusRcd>().cacheIdentifier();
124  } else if (container == "EcalTPGTowerStatus") {
125  cacheID = evtSetup.get<EcalTPGTowerStatusRcd>().cacheIdentifier();
126  } else if (container == "EcalTPGSpike") {
127  cacheID = evtSetup.get<EcalTPGSpikeRcd>().cacheIdentifier();
128  } else if (container == "EcalTPGStripStatus") {
129  cacheID = evtSetup.get<EcalTPGStripStatusRcd>().cacheIdentifier();
130  } else {
131  throw cms::Exception("Unknown container");
132  }
133 
134  if (m_cacheIDs[container] == cacheID) {
135  return false;
136  } else {
137  m_cacheIDs[container] = cacheID;
138  return true;
139  }
140 }
std::map< std::string, unsigned long long > m_cacheIDs
Definition: EcalTPGDBCopy.h:72
T get() const
Definition: EventSetup.h:79

Member Data Documentation

◆ crystalStatusToken_

edm::ESGetToken<EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd> EcalTPGDBCopy::crystalStatusToken_
private

Definition at line 90 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ fineGrainEBGroupToken_

edm::ESGetToken<EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd> EcalTPGDBCopy::fineGrainEBGroupToken_
private

Definition at line 88 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ fineGrainEBIdMapToken_

edm::ESGetToken<EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd> EcalTPGDBCopy::fineGrainEBIdMapToken_
private

Definition at line 78 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ fineGrainStripEEToken_

edm::ESGetToken<EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd> EcalTPGDBCopy::fineGrainStripEEToken_
private

Definition at line 79 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ fineGrainTowerEEToken_

edm::ESGetToken<EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd> EcalTPGDBCopy::fineGrainTowerEEToken_
private

Definition at line 80 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ linearizationConstToken_

edm::ESGetToken<EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd> EcalTPGDBCopy::linearizationConstToken_
private

Definition at line 76 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ lutGroupToken_

edm::ESGetToken<EcalTPGLutGroup, EcalTPGLutGroupRcd> EcalTPGDBCopy::lutGroupToken_
private

Definition at line 87 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ lutIdMapToken_

edm::ESGetToken<EcalTPGLutIdMap, EcalTPGLutIdMapRcd> EcalTPGDBCopy::lutIdMapToken_
private

Definition at line 81 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ m_cacheIDs

std::map<std::string, unsigned long long> EcalTPGDBCopy::m_cacheIDs
private

Definition at line 72 of file EcalTPGDBCopy.h.

Referenced by EcalTPGDBCopy(), and shouldCopy().

◆ m_records

std::map<std::string, std::string> EcalTPGDBCopy::m_records
private

Definition at line 73 of file EcalTPGDBCopy.h.

Referenced by analyze(), copyToDB(), and EcalTPGDBCopy().

◆ m_timetype

std::string EcalTPGDBCopy::m_timetype
private

Definition at line 71 of file EcalTPGDBCopy.h.

◆ oddWeightGroupToken_

edm::ESGetToken<EcalTPGOddWeightGroup, EcalTPGOddWeightGroupRcd> EcalTPGDBCopy::oddWeightGroupToken_
private

Definition at line 85 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ oddWeightIdMapToken_

edm::ESGetToken<EcalTPGOddWeightIdMap, EcalTPGOddWeightIdMapRcd> EcalTPGDBCopy::oddWeightIdMapToken_
private

Definition at line 84 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ pedestalsToken_

edm::ESGetToken<EcalTPGPedestals, EcalTPGPedestalsRcd> EcalTPGDBCopy::pedestalsToken_
private

Definition at line 75 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ physicsConstToken_

edm::ESGetToken<EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd> EcalTPGDBCopy::physicsConstToken_
private

Definition at line 89 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ slidingWindowToken_

edm::ESGetToken<EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd> EcalTPGDBCopy::slidingWindowToken_
private

Definition at line 77 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ spikeToken_

edm::ESGetToken<EcalTPGSpike, EcalTPGSpikeRcd> EcalTPGDBCopy::spikeToken_
private

Definition at line 92 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ stripStatusToken_

edm::ESGetToken<EcalTPGStripStatus, EcalTPGStripStatusRcd> EcalTPGDBCopy::stripStatusToken_
private

Definition at line 93 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ towerStatusToken_

edm::ESGetToken<EcalTPGTowerStatus, EcalTPGTowerStatusRcd> EcalTPGDBCopy::towerStatusToken_
private

Definition at line 91 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ tpModeToken_

edm::ESGetToken<EcalTPGTPMode, EcalTPGTPModeRcd> EcalTPGDBCopy::tpModeToken_
private

Definition at line 86 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ weightGroupToken_

edm::ESGetToken<EcalTPGWeightGroup, EcalTPGWeightGroupRcd> EcalTPGDBCopy::weightGroupToken_
private

Definition at line 83 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().

◆ weightIdMapToken_

edm::ESGetToken<EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd> EcalTPGDBCopy::weightIdMapToken_
private

Definition at line 82 of file EcalTPGDBCopy.h.

Referenced by copyToDB(), and setConsumes().