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
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 20 of file SubdetFEDSelector.h.

Constructor & Destructor Documentation

◆ SubdetFEDSelector()

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

Definition at line 4 of file SubdetFEDSelector.cc.

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 }

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

◆ ~SubdetFEDSelector()

SubdetFEDSelector::~SubdetFEDSelector ( )
override

Definition at line 17 of file SubdetFEDSelector.cc.

17 {}

Member Function Documentation

◆ beginJob()

void SubdetFEDSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 175 of file SubdetFEDSelector.cc.

175 {}

◆ endJob()

void SubdetFEDSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 178 of file SubdetFEDSelector.cc.

178 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ produce()

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

Implements edm::EDProducer.

Definition at line 19 of file SubdetFEDSelector.cc.

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 }

References FEDRawData::data(), data, FEDRawDataCollection::FEDData(), getEcal_, getHcal_, getMuon_, getPixel_, getStrip_, getTrigger_, mps_fire::i, iEvent, dqmiolumiharvest::j, dqmdumpme::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::Handle< T >::product(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, and tok_raw_.

Member Data Documentation

◆ getEcal_

bool SubdetFEDSelector::getEcal_

Definition at line 25 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

◆ getHcal_

bool SubdetFEDSelector::getHcal_

Definition at line 26 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

◆ getMuon_

bool SubdetFEDSelector::getMuon_

Definition at line 29 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

◆ getPixel_

bool SubdetFEDSelector::getPixel_

Definition at line 28 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

◆ getStrip_

bool SubdetFEDSelector::getStrip_

Definition at line 27 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

◆ getTrigger_

bool SubdetFEDSelector::getTrigger_

Definition at line 30 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

◆ tok_raw_

edm::EDGetTokenT<FEDRawDataCollection> SubdetFEDSelector::tok_raw_

Definition at line 32 of file SubdetFEDSelector.h.

Referenced by produce(), and SubdetFEDSelector().

FEDNumbering::MINTriggerLTCHCALFEDID
Definition: FEDNumbering.h:73
FEDNumbering::MINECALFEDID
Definition: FEDNumbering.h:43
mps_fire.i
i
Definition: mps_fire.py:355
FEDNumbering::MINTriggerEGTPFEDID
Definition: FEDNumbering.h:63
FEDNumbering::MINTriggerLTCTotemCastorFEDID
Definition: FEDNumbering.h:79
FEDNumbering::MAXTriggerLTCSiStripFEDID
Definition: FEDNumbering.h:76
edm::Handle::product
T const * product() const
Definition: Handle.h:70
FEDNumbering::MINDAQeFEDFEDID
Definition: FEDNumbering.h:95
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
FEDNumbering::MAXCSCTFSPFEDID
Definition: FEDNumbering.h:94
FEDNumbering::MAXCSCFEDID
Definition: FEDNumbering.h:52
FEDNumbering::MINPreShowerFEDID
Definition: FEDNumbering.h:31
SubdetFEDSelector::getMuon_
bool getMuon_
Definition: SubdetFEDSelector.h:29
FEDNumbering::MINTriggerLTCDTFEDID
Definition: FEDNumbering.h:85
FEDNumbering::MAXCSCDDUFEDID
Definition: FEDNumbering.h:90
edm::Handle
Definition: AssociativeIterator.h:50
FEDNumbering::MINRPCFEDID
Definition: FEDNumbering.h:59
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
FEDRawData
Definition: FEDRawData.h:19
FEDNumbering::MINCSCContingencyFEDID
Definition: FEDNumbering.h:91
FEDNumbering::MAXSiPixelFEDID
Definition: FEDNumbering.h:28
FEDNumbering::MINTriggerGCTFEDID
Definition: FEDNumbering.h:65
SubdetFEDSelector::getTrigger_
bool getTrigger_
Definition: SubdetFEDSelector.h:30
FEDNumbering::MAXTriggerGTPFEDID
Definition: FEDNumbering.h:62
FEDNumbering::MAXCSCContingencyFEDID
Definition: FEDNumbering.h:92
SubdetFEDSelector::getStrip_
bool getStrip_
Definition: SubdetFEDSelector.h:27
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FEDNumbering::MAXTriggerEGTPFEDID
Definition: FEDNumbering.h:64
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
FEDNumbering::MAXDTFEDID
Definition: FEDNumbering.h:56
FEDNumbering::MINTriggerLTCRPCFEDID
Definition: FEDNumbering.h:81
FEDNumbering::MAXTriggerLTCCSCFEDID
Definition: FEDNumbering.h:84
FEDNumbering::MAXTriggerLTCHCALFEDID
Definition: FEDNumbering.h:74
FEDNumbering::MAXSiStripFEDID
Definition: FEDNumbering.h:30
FEDNumbering::MAXTriggerGCTFEDID
Definition: FEDNumbering.h:66
FEDNumbering::MINTriggerLTCSiStripFEDID
Definition: FEDNumbering.h:75
FEDNumbering::MAXDAQeFEDFEDID
Definition: FEDNumbering.h:96
FEDNumbering::MAXTriggerLTCTriggerFEDID
Definition: FEDNumbering.h:72
FEDNumbering::MAXTriggerLTCECALFEDID
Definition: FEDNumbering.h:78
SubdetFEDSelector::getPixel_
bool getPixel_
Definition: SubdetFEDSelector.h:28
iEvent
int iEvent
Definition: GenABIO.cc:224
FEDNumbering::MAXTriggerLTCSiPixelFEDID
Definition: FEDNumbering.h:88
SubdetFEDSelector::getEcal_
bool getEcal_
Definition: SubdetFEDSelector.h:25
FEDNumbering::MINTriggerLTCSiPixelFEDID
Definition: FEDNumbering.h:87
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
FEDNumbering::MAXPreShowerFEDID
Definition: FEDNumbering.h:32
FEDNumbering::MINDTFEDID
Definition: FEDNumbering.h:55
SubdetFEDSelector::tok_raw_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition: SubdetFEDSelector.h:32
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
FEDNumbering::MAXTriggerLTCRPCFEDID
Definition: FEDNumbering.h:82
FEDNumbering::MINSiPixelFEDID
Definition: FEDNumbering.h:27
FEDNumbering::MAXTriggerLTCmtccFEDID
Definition: FEDNumbering.h:70
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
FEDNumbering::MINDTTFFEDID
Definition: FEDNumbering.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
FEDNumbering::MAXCSCTFFEDID
Definition: FEDNumbering.h:54
FEDNumbering::MAXDTTFFEDID
Definition: FEDNumbering.h:58
FEDNumbering::MINHCALFEDID
Definition: FEDNumbering.h:47
FEDRawData::resize
void resize(size_t newsize)
Definition: FEDRawData.cc:28
FEDNumbering::MAXTriggerLTCDTFEDID
Definition: FEDNumbering.h:86
FEDNumbering::MINCSCDDUFEDID
Definition: FEDNumbering.h:89
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FEDNumbering::MAXTriggerLTCFEDID
Definition: FEDNumbering.h:68
FEDNumbering::MINTriggerLTCFEDID
Definition: FEDNumbering.h:67
FEDNumbering::MAXRPCFEDID
Definition: FEDNumbering.h:60
FEDNumbering::MINCSCTFFEDID
Definition: FEDNumbering.h:53
FEDNumbering::MINTriggerLTCCSCFEDID
Definition: FEDNumbering.h:83
FEDNumbering::MINTriggerLTCTriggerFEDID
Definition: FEDNumbering.h:71
FEDNumbering::MINTriggerLTCECALFEDID
Definition: FEDNumbering.h:77
FEDNumbering::MAXHCALFEDID
Definition: FEDNumbering.h:48
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
FEDNumbering::MAXTriggerLTCTotemCastorFEDID
Definition: FEDNumbering.h:80
edm::InputTag
Definition: InputTag.h:15
SubdetFEDSelector::getHcal_
bool getHcal_
Definition: SubdetFEDSelector.h:26
FEDNumbering::MAXECALFEDID
Definition: FEDNumbering.h:44
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
FEDNumbering::MINTriggerLTCmtccFEDID
Definition: FEDNumbering.h:69
FEDNumbering::MINCSCTFSPFEDID
Definition: FEDNumbering.h:93
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
FEDNumbering::MINTriggerGTPFEDID
Definition: FEDNumbering.h:61
FEDNumbering::MINSiStripFEDID
Definition: FEDNumbering.h:29