CMS 3D CMS Logo

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

#include <ECALRegFEDSelector.h>

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

Public Member Functions

 ECALRegFEDSelector (const edm::ParameterSet &)
 
 ~ECALRegFEDSelector () 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
 
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::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

double delta_
 
std::unique_ptr< const EcalElectronicsMappingec_mapping
 
bool fedSaved [1200]
 
edm::EDGetTokenT< FEDRawDataCollectiontok_raw_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_seed_
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
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 30 of file ECALRegFEDSelector.h.

Constructor & Destructor Documentation

◆ ECALRegFEDSelector()

ECALRegFEDSelector::ECALRegFEDSelector ( const edm::ParameterSet iConfig)

Definition at line 8 of file ECALRegFEDSelector.cc.

8  {
9  tok_seed_ = consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("regSeedLabel"));
10  delta_ = iConfig.getParameter<double>("delta");
11 
12  tok_raw_ = consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"));
13 
14  ec_mapping = std::make_unique<EcalElectronicsMapping>();
15 
16  produces<FEDRawDataCollection>();
17  produces<EcalListOfFEDS>();
18 
19  for (int p = 0; p < 1200; p++) {
20  fedSaved[p] = false;
21  }
22 }

References delta_, ec_mapping, fedSaved, edm::ParameterSet::getParameter(), AlCaHLTBitMon_ParallelJobs::p, tok_raw_, and tok_seed_.

◆ ~ECALRegFEDSelector()

ECALRegFEDSelector::~ECALRegFEDSelector ( )
override

Definition at line 24 of file ECALRegFEDSelector.cc.

24 {}

Member Function Documentation

◆ beginJob()

void ECALRegFEDSelector::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 98 of file ECALRegFEDSelector.cc.

98 {}

◆ endJob()

void ECALRegFEDSelector::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 100 of file ECALRegFEDSelector.cc.

100 {}

Referenced by o2olib.O2ORunMgr::executeJob().

◆ produce()

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

Implements edm::EDProducer.

Definition at line 26 of file ECALRegFEDSelector.cc.

26  {
27  for (int p = 0; p < 1200; p++) {
28  fedSaved[p] = false;
29  }
30 
31  auto producedData = std::make_unique<FEDRawDataCollection>();
32 
33  auto fedList = std::make_unique<EcalListOfFEDS>();
34 
36  iEvent.getByToken(tok_seed_, trigSeedTrks);
37 
38  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
39  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
40 
42  iEvent.getByToken(tok_raw_, rawIn);
43 
44  // std::vector<int> EC_FED_IDs;
45 
46  for (uint32_t p = 0; p < isoPixTrackRefs.size(); p++) {
47  double etaObj_ = isoPixTrackRefs[p]->track()->eta();
48  double phiObj_ = isoPixTrackRefs[p]->track()->phi();
49 
50  RectangularEtaPhiRegion ecEtaPhi(etaObj_ - delta_, etaObj_ + delta_, phiObj_ - delta_, phiObj_ + delta_);
51 
52  const std::vector<int> EC_FED_IDs = ec_mapping->GetListofFEDs(ecEtaPhi);
53 
54  const FEDRawDataCollection* rdc = rawIn.product();
55 
56  for (int j = 0; j < FEDNumbering::MAXFEDID; j++) {
57  bool rightFED = false;
58  for (uint32_t k = 0; k < EC_FED_IDs.size(); k++) {
59  if (j == EcalRegionCabling::fedIndex(EC_FED_IDs[k])) {
60  if (!fedSaved[j]) {
61  fedList->AddFED(j);
62  rightFED = true;
63  fedSaved[j] = true;
64  }
65  }
66  }
68  fedSaved[j] = true;
69  rightFED = true;
70  }
71  if (!rightFED)
72  continue;
73  const FEDRawData& fedData = rdc->FEDData(j);
74  size_t size = fedData.size();
75 
76  if (size > 0) {
77  // this fed has data -- lets copy it
78  FEDRawData& fedDataProd = producedData->FEDData(j);
79  if (fedDataProd.size() != 0) {
80  // std::cout << " More than one FEDRawDataCollection with data in FED ";
81  // std::cout << j << " Skipping the 2nd\n";
82  continue;
83  }
84  fedDataProd.resize(size);
85  unsigned char* dataProd = fedDataProd.data();
86  const unsigned char* data = fedData.data();
87  for (unsigned int k = 0; k < size; ++k) {
88  dataProd[k] = data[k];
89  }
90  }
91  }
92  }
93 
94  iEvent.put(std::move(producedData));
95  iEvent.put(std::move(fedList));
96 }

References FEDRawData::data(), data, delta_, ec_mapping, FEDRawDataCollection::FEDData(), EcalRegionCabling::fedIndex(), hcaldqm::constants::fedList, fedSaved, trigger::TriggerRefsCollections::getObjects(), iEvent, dqmiolumiharvest::j, dqmdumpme::k, FEDNumbering::MAXFEDID, FEDNumbering::MAXPreShowerFEDID, FEDNumbering::MINPreShowerFEDID, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, edm::Handle< T >::product(), FEDRawData::resize(), FEDRawData::size(), findQualityFiles::size, tok_raw_, tok_seed_, and trigger::TriggerTrack.

Member Data Documentation

◆ delta_

double ECALRegFEDSelector::delta_

Definition at line 36 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

◆ ec_mapping

std::unique_ptr<const EcalElectronicsMapping> ECALRegFEDSelector::ec_mapping

Definition at line 34 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

◆ fedSaved

bool ECALRegFEDSelector::fedSaved[1200]

Definition at line 37 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

◆ tok_raw_

edm::EDGetTokenT<FEDRawDataCollection> ECALRegFEDSelector::tok_raw_

Definition at line 39 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

◆ tok_seed_

Definition at line 40 of file ECALRegFEDSelector.h.

Referenced by ECALRegFEDSelector(), and produce().

ECALRegFEDSelector::ec_mapping
std::unique_ptr< const EcalElectronicsMapping > ec_mapping
Definition: ECALRegFEDSelector.h:34
edm::Handle::product
T const * product() const
Definition: Handle.h:70
hcaldqm::constants::fedList
const std::vector< unsigned int > fedList
Definition: Constants.h:62
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FEDNumbering::MINPreShowerFEDID
Definition: FEDNumbering.h:31
trigger::TriggerTrack
Definition: TriggerTypeDefs.h:76
edm::Handle< trigger::TriggerFilterObjectWithRefs >
ECALRegFEDSelector::tok_raw_
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
Definition: ECALRegFEDSelector.h:39
RectangularEtaPhiRegion
Definition: RectangularEtaPhiRegion.h:6
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:452
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
EcalRegionCabling::fedIndex
static int fedIndex(const uint32_t index)
Definition: EcalRegionCabling.h:56
ECALRegFEDSelector::fedSaved
bool fedSaved[1200]
Definition: ECALRegFEDSelector.h:37
dqmdumpme.k
k
Definition: dqmdumpme.py:60
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
iEvent
int iEvent
Definition: GenABIO.cc:224
ECALRegFEDSelector::tok_seed_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
Definition: ECALRegFEDSelector.h:40
FEDNumbering::MAXPreShowerFEDID
Definition: FEDNumbering.h:32
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
eostools.move
def move(src, dest)
Definition: eostools.py:511
FEDRawData::resize
void resize(size_t newsize)
Definition: FEDRawData.cc:28
ECALRegFEDSelector::delta_
double delta_
Definition: ECALRegFEDSelector.h:36
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::InputTag
Definition: InputTag.h:15
FEDNumbering::MAXFEDID
Definition: FEDNumbering.h:26
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443