CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const 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
 
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)
 
 ~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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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

bool getEcal_
 
bool getHcal_
 
bool getMuon_
 
bool getPixel_
 
bool getStrip_
 
bool getTrigger_
 
edm::EDGetTokenT
< FEDRawDataCollection
tok_raw_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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
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< B > consumes (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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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 14 of file SubdetFEDSelector.cc.

Constructor & Destructor Documentation

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

Definition at line 36 of file SubdetFEDSelector.cc.

References getEcal_, getHcal_, getMuon_, edm::ParameterSet::getParameter(), getPixel_, getStrip_, getTrigger_, and tok_raw_.

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

Definition at line 49 of file SubdetFEDSelector.cc.

49 {}

Member Function Documentation

void SubdetFEDSelector::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 21 of file SubdetFEDSelector.cc.

21 {}
void SubdetFEDSelector::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 23 of file SubdetFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

23 {}
void SubdetFEDSelector::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 206 of file SubdetFEDSelector.cc.

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

206  {
208  desc.add<edm::InputTag>("rawInputLabel", edm::InputTag("rawDataCollector"));
209  desc.add<bool>("getSiPixel", true);
210  desc.add<bool>("getHCAL", true);
211  desc.add<bool>("getECAL", false);
212  desc.add<bool>("getMuon", false);
213  desc.add<bool>("getTrigger", true);
214  desc.add<bool>("getSiStrip", false);
215  descriptions.add("subdetFED", desc);
216 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void SubdetFEDSelector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 51 of file SubdetFEDSelector.cc.

References FEDRawData::data(), data, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), getEcal_, getHcal_, getMuon_, getPixel_, getStrip_, getTrigger_, mps_fire::i, 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(), edm::Event::put(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, and tok_raw_.

51  {
52  auto producedData = std::make_unique<FEDRawDataCollection>();
53 
55  iEvent.getByToken(tok_raw_, rawIn);
56 
57  std::vector<int> selFEDs;
58 
59  if (getEcal_) {
61  selFEDs.push_back(i);
62  }
64  selFEDs.push_back(i);
65  }
66  }
67 
68  if (getMuon_) {
70  selFEDs.push_back(i);
71  }
73  selFEDs.push_back(i);
74  }
76  selFEDs.push_back(i);
77  }
79  selFEDs.push_back(i);
80  }
82  selFEDs.push_back(i);
83  }
85  selFEDs.push_back(i);
86  }
88  selFEDs.push_back(i);
89  }
91  selFEDs.push_back(i);
92  }
93  }
94 
95  if (getHcal_) {
97  selFEDs.push_back(i);
98  }
99  }
100 
101  if (getStrip_) {
103  selFEDs.push_back(i);
104  }
105  }
106 
107  if (getPixel_) {
109  selFEDs.push_back(i);
110  }
111  }
112 
113  if (getTrigger_) {
115  selFEDs.push_back(i);
116  }
118  selFEDs.push_back(i);
119  }
121  selFEDs.push_back(i);
122  }
124  selFEDs.push_back(i);
125  }
127  selFEDs.push_back(i);
128  }
129 
131  selFEDs.push_back(i);
132  }
133 
135  selFEDs.push_back(i);
136  }
137 
139  selFEDs.push_back(i);
140  }
141 
143  selFEDs.push_back(i);
144  }
145 
147  selFEDs.push_back(i);
148  }
150  selFEDs.push_back(i);
151  }
152 
154  selFEDs.push_back(i);
155  }
157  selFEDs.push_back(i);
158  }
160  selFEDs.push_back(i);
161  }
162  }
163 
165  selFEDs.push_back(i);
166  }
167 
168  // Copying:
169  const FEDRawDataCollection* rdc = rawIn.product();
170 
171  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
172  // continue ; // skip all raw collections not produced by the current process
173 
174  for (int j = 0; j < FEDNumbering::MAXFEDID; ++j) {
175  bool rightFED = false;
176  for (uint32_t k = 0; k < selFEDs.size(); k++) {
177  if (j == selFEDs[k]) {
178  rightFED = true;
179  }
180  }
181  if (!rightFED)
182  continue;
183  const FEDRawData& fedData = rdc->FEDData(j);
184  size_t size = fedData.size();
185 
186  if (size > 0) {
187  // this fed has data -- lets copy it
188  FEDRawData& fedDataProd = producedData->FEDData(j);
189  if (fedDataProd.size() != 0) {
190  // std::cout << " More than one FEDRawDataCollection with data in FED ";
191  // std::cout << j << " Skipping the 2nd\n";
192  continue;
193  }
194  fedDataProd.resize(size);
195  unsigned char* dataProd = fedDataProd.data();
196  const unsigned char* data = fedData.data();
197  for (unsigned int k = 0; k < size; ++k) {
198  dataProd[k] = data[k];
199  }
200  }
201  }
202 
203  iEvent.put(std::move(producedData));
204 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
Definition: FEDRawData.cc:28
def move
Definition: eostools.py:511
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
tuple size
Write out results.

Member Data Documentation

bool SubdetFEDSelector::getEcal_
private

Definition at line 26 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getHcal_
private

Definition at line 27 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getMuon_
private

Definition at line 30 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getPixel_
private

Definition at line 29 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getStrip_
private

Definition at line 28 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getTrigger_
private

Definition at line 31 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().

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

Definition at line 33 of file SubdetFEDSelector.cc.

Referenced by produce(), and SubdetFEDSelector().