CMS 3D CMS Logo

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

#include <SubdetFEDSelector.h>

Inheritance diagram for SubdetFEDSelector:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SubdetFEDSelector (const edm::ParameterSet &)
 
 ~SubdetFEDSelector () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

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

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

Definition at line 20 of file SubdetFEDSelector.h.

Constructor & Destructor Documentation

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

Definition at line 4 of file SubdetFEDSelector.cc.

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

4  {
5  getEcal_ = iConfig.getParameter<bool>("getECAL");
6  getStrip_ = iConfig.getParameter<bool>("getSiStrip");
7  getPixel_ = iConfig.getParameter<bool>("getSiPixel");
8  getHcal_ = iConfig.getParameter<bool>("getHCAL");
9  getMuon_ = iConfig.getParameter<bool>("getMuon");
10  getTrigger_ = iConfig.getParameter<bool>("getTrigger");
11 
12  tok_raw_ = consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"));
13 
14  produces<FEDRawDataCollection>();
15 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
SubdetFEDSelector::~SubdetFEDSelector ( )
override

Definition at line 17 of file SubdetFEDSelector.cc.

17 {}

Member Function Documentation

void SubdetFEDSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 175 of file SubdetFEDSelector.cc.

175 {}
void SubdetFEDSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 178 of file SubdetFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

178 {}
void SubdetFEDSelector::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 19 of file SubdetFEDSelector.cc.

References FEDRawData::data(), data, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), getEcal_, getHcal_, getMuon_, getPixel_, getStrip_, getTrigger_, mps_fire::i, gen::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_.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

19  {
20  auto producedData = std::make_unique<FEDRawDataCollection>();
21 
23  iEvent.getByToken(tok_raw_, rawIn);
24 
25  std::vector<int> selFEDs;
26 
27  if (getEcal_) {
29  selFEDs.push_back(i);
30  }
32  selFEDs.push_back(i);
33  }
34  }
35 
36  if (getMuon_) {
38  selFEDs.push_back(i);
39  }
41  selFEDs.push_back(i);
42  }
44  selFEDs.push_back(i);
45  }
47  selFEDs.push_back(i);
48  }
50  selFEDs.push_back(i);
51  }
53  selFEDs.push_back(i);
54  }
56  selFEDs.push_back(i);
57  }
59  selFEDs.push_back(i);
60  }
61  }
62 
63  if (getHcal_) {
65  selFEDs.push_back(i);
66  }
67  }
68 
69  if (getStrip_) {
71  selFEDs.push_back(i);
72  }
73  }
74 
75  if (getPixel_) {
77  selFEDs.push_back(i);
78  }
79  }
80 
81  if (getTrigger_) {
83  selFEDs.push_back(i);
84  }
86  selFEDs.push_back(i);
87  }
89  selFEDs.push_back(i);
90  }
92  selFEDs.push_back(i);
93  }
95  selFEDs.push_back(i);
96  }
97 
99  selFEDs.push_back(i);
100  }
101 
103  selFEDs.push_back(i);
104  }
105 
107  selFEDs.push_back(i);
108  }
109 
111  selFEDs.push_back(i);
112  }
113 
115  selFEDs.push_back(i);
116  }
118  selFEDs.push_back(i);
119  }
120 
122  selFEDs.push_back(i);
123  }
125  selFEDs.push_back(i);
126  }
128  selFEDs.push_back(i);
129  }
130  }
131 
133  selFEDs.push_back(i);
134  }
135 
136  // Copying:
137  const FEDRawDataCollection* rdc = rawIn.product();
138 
139  // if ( ( rawData[i].provenance()->processName() != e.processHistory().rbegin()->processName() ) )
140  // continue ; // skip all raw collections not produced by the current process
141 
142  for (int j = 0; j < FEDNumbering::MAXFEDID; ++j) {
143  bool rightFED = false;
144  for (uint32_t k = 0; k < selFEDs.size(); k++) {
145  if (j == selFEDs[k]) {
146  rightFED = true;
147  }
148  }
149  if (!rightFED)
150  continue;
151  const FEDRawData& fedData = rdc->FEDData(j);
152  size_t size = fedData.size();
153 
154  if (size > 0) {
155  // this fed has data -- lets copy it
156  FEDRawData& fedDataProd = producedData->FEDData(j);
157  if (fedDataProd.size() != 0) {
158  // std::cout << " More than one FEDRawDataCollection with data in FED ";
159  // std::cout << j << " Skipping the 2nd\n";
160  continue;
161  }
162  fedDataProd.resize(size);
163  unsigned char* dataProd = fedDataProd.data();
164  const unsigned char* data = fedData.data();
165  for (unsigned int k = 0; k < size; ++k) {
166  dataProd[k] = data[k];
167  }
168  }
169  }
170 
171  iEvent.put(std::move(producedData));
172 }
size
Write out results.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void resize(size_t newsize)
Definition: FEDRawData.cc:32
int k[5][pyjets_maxn]
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

bool SubdetFEDSelector::getEcal_

Definition at line 25 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getHcal_

Definition at line 26 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getMuon_

Definition at line 29 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getPixel_

Definition at line 28 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getStrip_

Definition at line 27 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

bool SubdetFEDSelector::getTrigger_

Definition at line 30 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

edm::EDGetTokenT<FEDRawDataCollection> SubdetFEDSelector::tok_raw_

Definition at line 32 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().