CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SubdetFEDSelector Class Reference
Inheritance diagram for SubdetFEDSelector:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SubdetFEDSelector (const edm::ParameterSet &)
 
 ~SubdetFEDSelector () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const bool getEcal_
 
const bool getHcal_
 
const bool getMuon_
 
const bool getPixel_
 
const bool getStrip_
 
const bool getTrigger_
 
const edm::EDGetTokenT< FEDRawDataCollectiontok_raw_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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 15 of file SubdetFEDSelector.cc.

Constructor & Destructor Documentation

◆ SubdetFEDSelector()

SubdetFEDSelector::SubdetFEDSelector ( const edm::ParameterSet iConfig)

Definition at line 37 of file SubdetFEDSelector.cc.

38  : getEcal_(iConfig.getParameter<bool>("getECAL")),
39  getHcal_(iConfig.getParameter<bool>("getHCAL")),
40  getStrip_(iConfig.getParameter<bool>("getSiStrip")),
41  getPixel_(iConfig.getParameter<bool>("getSiPixel")),
42  getMuon_(iConfig.getParameter<bool>("getMuon")),
43  getTrigger_(iConfig.getParameter<bool>("getTrigger")),
44  tok_raw_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"))) {
45  produces<FEDRawDataCollection>();
46 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_

◆ ~SubdetFEDSelector()

SubdetFEDSelector::~SubdetFEDSelector ( )
override

Definition at line 48 of file SubdetFEDSelector.cc.

48 {}

Member Function Documentation

◆ beginJob()

void SubdetFEDSelector::beginJob ( )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 22 of file SubdetFEDSelector.cc.

22 {}

◆ endJob()

void SubdetFEDSelector::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 24 of file SubdetFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

24 {}

◆ fillDescriptions()

void SubdetFEDSelector::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 204 of file SubdetFEDSelector.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

204  {
206  desc.add<edm::InputTag>("rawInputLabel", edm::InputTag("rawDataCollector"));
207  desc.add<bool>("getSiPixel", true);
208  desc.add<bool>("getHCAL", true);
209  desc.add<bool>("getECAL", false);
210  desc.add<bool>("getMuon", false);
211  desc.add<bool>("getTrigger", true);
212  desc.add<bool>("getSiStrip", false);
213  descriptions.add("subdetFED", desc);
214 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void SubdetFEDSelector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 50 of file SubdetFEDSelector.cc.

References FEDRawData::data(), data, FEDRawDataCollection::FEDData(), getEcal_, getHcal_, getMuon_, getPixel_, getStrip_, getTrigger_, mps_fire::i, iEvent, dqmiolumiharvest::j, isotrackApplyRegressor::k, FEDNumbering::MAXCSCContingencyFEDID, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MAXCSCFEDID, FEDNumbering::MAXCSCTFFEDID, FEDNumbering::MAXCSCTFSPFEDID, FEDNumbering::MAXDAQeFEDFEDID, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTTFFEDID, FEDNumbering::MAXECALFEDID, FEDNumbering::MAXFEDID, FEDNumbering::MAXHCALFEDID, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MAXRPCFEDID, FEDNumbering::MAXSiPixelFEDID, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MAXTriggerEGTPFEDID, FEDNumbering::MAXTriggerGCTFEDID, FEDNumbering::MAXTriggerGTPFEDID, FEDNumbering::MAXTriggerLTCCSCFEDID, FEDNumbering::MAXTriggerLTCDTFEDID, FEDNumbering::MAXTriggerLTCECALFEDID, FEDNumbering::MAXTriggerLTCFEDID, FEDNumbering::MAXTriggerLTCHCALFEDID, FEDNumbering::MAXTriggerLTCmtccFEDID, FEDNumbering::MAXTriggerLTCRPCFEDID, FEDNumbering::MAXTriggerLTCSiPixelFEDID, FEDNumbering::MAXTriggerLTCSiStripFEDID, FEDNumbering::MAXTriggerLTCTotemCastorFEDID, FEDNumbering::MAXTriggerLTCTriggerFEDID, FEDNumbering::MINCSCContingencyFEDID, FEDNumbering::MINCSCDDUFEDID, FEDNumbering::MINCSCFEDID, FEDNumbering::MINCSCTFFEDID, FEDNumbering::MINCSCTFSPFEDID, FEDNumbering::MINDAQeFEDFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTTFFEDID, FEDNumbering::MINECALFEDID, FEDNumbering::MINHCALFEDID, FEDNumbering::MINPreShowerFEDID, FEDNumbering::MINRPCFEDID, FEDNumbering::MINSiPixelFEDID, FEDNumbering::MINSiStripFEDID, FEDNumbering::MINTriggerEGTPFEDID, FEDNumbering::MINTriggerGCTFEDID, FEDNumbering::MINTriggerGTPFEDID, FEDNumbering::MINTriggerLTCCSCFEDID, FEDNumbering::MINTriggerLTCDTFEDID, FEDNumbering::MINTriggerLTCECALFEDID, FEDNumbering::MINTriggerLTCFEDID, FEDNumbering::MINTriggerLTCHCALFEDID, FEDNumbering::MINTriggerLTCmtccFEDID, FEDNumbering::MINTriggerLTCRPCFEDID, FEDNumbering::MINTriggerLTCSiPixelFEDID, FEDNumbering::MINTriggerLTCSiStripFEDID, FEDNumbering::MINTriggerLTCTotemCastorFEDID, FEDNumbering::MINTriggerLTCTriggerFEDID, eostools::move(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, and tok_raw_.

50  {
51  auto producedData = std::make_unique<FEDRawDataCollection>();
52 
53  const edm::Handle<FEDRawDataCollection>& rawIn = iEvent.getHandle(tok_raw_);
54 
55  std::vector<int> selFEDs;
56 
57  if (getEcal_) {
59  selFEDs.push_back(i);
60  }
62  selFEDs.push_back(i);
63  }
64  }
65 
66  if (getMuon_) {
68  selFEDs.push_back(i);
69  }
71  selFEDs.push_back(i);
72  }
74  selFEDs.push_back(i);
75  }
77  selFEDs.push_back(i);
78  }
80  selFEDs.push_back(i);
81  }
83  selFEDs.push_back(i);
84  }
86  selFEDs.push_back(i);
87  }
89  selFEDs.push_back(i);
90  }
91  }
92 
93  if (getHcal_) {
95  selFEDs.push_back(i);
96  }
97  }
98 
99  if (getStrip_) {
101  selFEDs.push_back(i);
102  }
103  }
104 
105  if (getPixel_) {
107  selFEDs.push_back(i);
108  }
109  }
110 
111  if (getTrigger_) {
113  selFEDs.push_back(i);
114  }
116  selFEDs.push_back(i);
117  }
119  selFEDs.push_back(i);
120  }
122  selFEDs.push_back(i);
123  }
125  selFEDs.push_back(i);
126  }
127 
129  selFEDs.push_back(i);
130  }
131 
133  selFEDs.push_back(i);
134  }
135 
137  selFEDs.push_back(i);
138  }
139 
141  selFEDs.push_back(i);
142  }
143 
145  selFEDs.push_back(i);
146  }
148  selFEDs.push_back(i);
149  }
150 
152  selFEDs.push_back(i);
153  }
155  selFEDs.push_back(i);
156  }
158  selFEDs.push_back(i);
159  }
160  }
161 
163  selFEDs.push_back(i);
164  }
165 
166  // Copying:
167  const FEDRawDataCollection* rdc = rawIn.product();
168 
169  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
170  // continue ; // skip all raw collections not produced by the current process
171 
172  for (int j = 0; j <= FEDNumbering::MAXFEDID; ++j) {
173  bool rightFED = false;
174  for (uint32_t k = 0; k < selFEDs.size(); k++) {
175  if (j == selFEDs[k]) {
176  rightFED = true;
177  }
178  }
179  if (!rightFED)
180  continue;
181  const FEDRawData& fedData = rdc->FEDData(j);
182  size_t size = fedData.size();
183 
184  if (size > 0) {
185  // this fed has data -- lets copy it
186  FEDRawData& fedDataProd = producedData->FEDData(j);
187  if (fedDataProd.size() != 0) {
188  edm::LogVerbatim("HcalCalib") << " More than one FEDRawDataCollection with data in FED " << j
189  << " Skipping the 2nd";
190  continue;
191  }
192  fedDataProd.resize(size);
193  unsigned char* dataProd = fedDataProd.data();
194  const unsigned char* data = fedData.data();
195  for (unsigned int k = 0; k < size; ++k) {
196  dataProd[k] = data[k];
197  }
198  }
199  }
200 
201  iEvent.put(std::move(producedData));
202 }
size
Write out results.
Log< level::Info, true > LogVerbatim
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
int iEvent
Definition: GenABIO.cc:224
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize, size_t wordsize=8)
Definition: FEDRawData.cc:28
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ getEcal_

const bool SubdetFEDSelector::getEcal_
private

Definition at line 27 of file SubdetFEDSelector.cc.

Referenced by produce().

◆ getHcal_

const bool SubdetFEDSelector::getHcal_
private

Definition at line 28 of file SubdetFEDSelector.cc.

Referenced by produce().

◆ getMuon_

const bool SubdetFEDSelector::getMuon_
private

Definition at line 31 of file SubdetFEDSelector.cc.

Referenced by produce().

◆ getPixel_

const bool SubdetFEDSelector::getPixel_
private

Definition at line 30 of file SubdetFEDSelector.cc.

Referenced by produce().

◆ getStrip_

const bool SubdetFEDSelector::getStrip_
private

Definition at line 29 of file SubdetFEDSelector.cc.

Referenced by produce().

◆ getTrigger_

const bool SubdetFEDSelector::getTrigger_
private

Definition at line 32 of file SubdetFEDSelector.cc.

Referenced by produce().

◆ tok_raw_

const edm::EDGetTokenT<FEDRawDataCollection> SubdetFEDSelector::tok_raw_
private

Definition at line 34 of file SubdetFEDSelector.cc.

Referenced by produce().