CMS 3D CMS Logo

PixelFEDChannelCollectionProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/PixelFEDChannelCollectionProducer
4 // Class: PixelFEDChannelCollectionProducer
5 //
13 //
14 // Original Author: Marco Musich
15 // Created: Thu, 13 Dec 2018 08:48:22 GMT
16 //
17 //
18 
19 // system include files
20 #include <memory>
21 
22 // user include files
26 
30 
31 // Need to add #include statements for definitions of
32 // the data type and record type here
33 
34 //
35 // class declaration
36 //
37 
39 public:
42 
43  typedef std::unordered_map<std::string, PixelFEDChannelCollection> PixelFEDChannelCollectionMap;
44  using ReturnType = std::unique_ptr<PixelFEDChannelCollectionMap>;
45 
47 
48 private:
49  // ----------member data ---------------------------
51 };
52 
54  //the following line is needed to tell the framework what
55  // data is being produced
56  setWhatProduced(this).setConsumes(qualityToken_);
57 
58  //now do what ever other initialization is needed
59 }
60 
62  // do anything here that needs to be done at destruction time
63  // (e.g. close files, deallocate resources etc.)
64 }
65 
66 //
67 // member functions
68 //
69 
70 // ------------ method called to produce the data ------------
73  const auto& qualityCollection = iRecord.get(qualityToken_);
74 
75  auto out = std::make_unique<PixelFEDChannelCollectionMap>();
76 
77  for (const auto& it : qualityCollection.getScenarioMap()) {
78  const std::string& scenario = it.first;
79  // getScenarioMap() is an unordered_map<string, ...>, so each scenario appears exactly once
80  PixelFEDChannelCollection& disabled_channelcollection = (*out)[scenario];
81 
82  const auto& SiPixelBadFedChannels = it.second;
83  for (const auto& entry : SiPixelBadFedChannels) {
84  disabled_channelcollection.insert(entry.first, entry.second.data(), entry.second.size());
85  }
86  }
87 
88  return out;
89 }
90 
91 //define this as a plug-in
mps_splice.entry
entry
Definition: mps_splice.py:68
edmNew::DetSetVector::insert
DetSet insert(id_type iid, data_type const *idata, size_type isize)
Definition: DetSetVectorNew.h:493
PixelFEDChannelCollectionProducer::PixelFEDChannelCollectionMap
std::unordered_map< std::string, PixelFEDChannelCollection > PixelFEDChannelCollectionMap
Definition: PixelFEDChannelCollectionProducer.cc:43
SiPixelFEDChannelContainerESProducerRcd
Definition: SiPixelFEDChannelContainerESProducerRcd.h:9
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
SiPixelFEDChannelContainer.h
ESProducer.h
PixelFEDChannelCollectionProducer::~PixelFEDChannelCollectionProducer
~PixelFEDChannelCollectionProducer() override
Definition: PixelFEDChannelCollectionProducer.cc:61
PixelFEDChannelCollectionProducer::produce
ReturnType produce(const SiPixelFEDChannelContainerESProducerRcd &)
Definition: PixelFEDChannelCollectionProducer.cc:71
PixelFEDChannelCollectionProducer::qualityToken_
edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd > qualityToken_
Definition: PixelFEDChannelCollectionProducer.cc:50
cmsdt::scenario
scenario
Definition: constants.h:166
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelFEDChannelCollectionProducer::ReturnType
std::unique_ptr< PixelFEDChannelCollectionMap > ReturnType
Definition: PixelFEDChannelCollectionProducer.cc:44
edm::ParameterSet
Definition: ParameterSet.h:36
edm::ESGetToken< SiPixelFEDChannelContainer, SiPixelStatusScenariosRcd >
PixelFEDChannelCollectionProducer::PixelFEDChannelCollectionProducer
PixelFEDChannelCollectionProducer(const edm::ParameterSet &)
Definition: PixelFEDChannelCollectionProducer.cc:53
edmNew::DetSetVector
Definition: DetSetNew.h:13
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
SiPixelStatusScenariosRcd.h
PixelFEDChannelCollectionProducer
Definition: PixelFEDChannelCollectionProducer.cc:38
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:101
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SiPixelFEDChannelContainerESProducerRcd.h