CMS 3D CMS Logo

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

Public Member Functions

 ECALRegFEDSelector (const edm::ParameterSet &)
 
 ~ECALRegFEDSelector () override=default
 
- Public Member Functions inherited from edm::one::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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
 
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::one::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::Event &, const edm::EventSetup &) override
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::one::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
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 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 ()
 
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 25 of file ECALRegFEDSelector.cc.

Constructor & Destructor Documentation

◆ ECALRegFEDSelector()

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

Definition at line 46 of file ECALRegFEDSelector.cc.

References ec_mapping, fedSaved, and AlCaHLTBitMon_ParallelJobs::p.

47  : delta_(iConfig.getParameter<double>("delta")),
48  tok_seed_(consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("regSeedLabel"))),
49  tok_raw_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"))) {
50  ec_mapping = std::make_unique<EcalElectronicsMapping>();
51 
52  produces<FEDRawDataCollection>();
53  produces<EcalListOfFEDS>();
54 
55  for (int p = 0; p < 1200; p++) {
56  fedSaved[p] = false;
57  }
58 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
std::unique_ptr< const EcalElectronicsMapping > ec_mapping
const edm::EDGetTokenT< FEDRawDataCollection > tok_raw_

◆ ~ECALRegFEDSelector()

ECALRegFEDSelector::~ECALRegFEDSelector ( )
overridedefault

Member Function Documentation

◆ beginJob()

void ECALRegFEDSelector::beginJob ( )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 33 of file ECALRegFEDSelector.cc.

33 {}

◆ endJob()

void ECALRegFEDSelector::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 35 of file ECALRegFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

35 {}

◆ fillDescriptions()

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

Definition at line 130 of file ECALRegFEDSelector.cc.

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

130  {
132  desc.add<edm::InputTag>("regSeedLabel", edm::InputTag("hltPixelIsolTrackFilter"));
133  desc.add<edm::InputTag>("rawInputLabel", edm::InputTag("rawDataCollector"));
134  desc.add<double>("delta", 1.0);
135  descriptions.add("ecalFED", desc);
136 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::one::EDProducerBase.

Definition at line 60 of file ECALRegFEDSelector.cc.

References FEDRawData::data(), data, delta_, ec_mapping, FEDRawDataCollection::FEDData(), EcalRegionCabling::fedIndex(), hcaldqm::constants::fedList, fedSaved, 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.

60  {
61  for (int p = 0; p < 1200; p++) {
62  fedSaved[p] = false;
63  }
64 
65  auto producedData = std::make_unique<FEDRawDataCollection>();
66 
67  auto fedList = std::make_unique<EcalListOfFEDS>();
68 
70 
71  std::vector<edm::Ref<reco::IsolatedPixelTrackCandidateCollection> > isoPixTrackRefs;
72  trigSeedTrks->getObjects(trigger::TriggerTrack, isoPixTrackRefs);
73 
74  const edm::Handle<FEDRawDataCollection>& rawIn = iEvent.getHandle(tok_raw_);
75 
76  // std::vector<int> EC_FED_IDs;
77 
78  for (uint32_t p = 0; p < isoPixTrackRefs.size(); p++) {
79  double etaObj_ = isoPixTrackRefs[p]->track()->eta();
80  double phiObj_ = isoPixTrackRefs[p]->track()->phi();
81 
82  RectangularEtaPhiRegion ecEtaPhi(etaObj_ - delta_, etaObj_ + delta_, phiObj_ - delta_, phiObj_ + delta_);
83 
84  const std::vector<int> EC_FED_IDs = ec_mapping->GetListofFEDs(ecEtaPhi);
85 
86  const FEDRawDataCollection* rdc = rawIn.product();
87 
88  for (int j = 0; j < FEDNumbering::MAXFEDID; j++) {
89  bool rightFED = false;
90  for (uint32_t k = 0; k < EC_FED_IDs.size(); k++) {
91  if (j == EcalRegionCabling::fedIndex(EC_FED_IDs[k])) {
92  if (!fedSaved[j]) {
93  fedList->AddFED(j);
94  rightFED = true;
95  fedSaved[j] = true;
96  }
97  }
98  }
100  fedSaved[j] = true;
101  rightFED = true;
102  }
103  if (!rightFED)
104  continue;
105  const FEDRawData& fedData = rdc->FEDData(j);
106  size_t size = fedData.size();
107 
108  if (size > 0) {
109  // this fed has data -- lets copy it
110  FEDRawData& fedDataProd = producedData->FEDData(j);
111  if (fedDataProd.size() != 0) {
112  // std::cout << " More than one FEDRawDataCollection with data in FED ";
113  // std::cout << j << " Skipping the 2nd\n";
114  continue;
115  }
116  fedDataProd.resize(size);
117  unsigned char* dataProd = fedDataProd.data();
118  const unsigned char* data = fedData.data();
119  for (unsigned int k = 0; k < size; ++k) {
120  dataProd[k] = data[k];
121  }
122  }
123  }
124  }
125 
126  iEvent.put(std::move(producedData));
127  iEvent.put(std::move(fedList));
128 }
size
Write out results.
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_seed_
T const * product() const
Definition: Handle.h:70
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
static int fedIndex(const uint32_t index)
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< const EcalElectronicsMapping > ec_mapping
void resize(size_t newsize)
Definition: FEDRawData.cc:28
std::vector< unsigned int > const fedList
Definition: Constants.h:63
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
const 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
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ delta_

const double ECALRegFEDSelector::delta_
private

Definition at line 39 of file ECALRegFEDSelector.cc.

Referenced by produce().

◆ ec_mapping

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

Definition at line 37 of file ECALRegFEDSelector.cc.

Referenced by ECALRegFEDSelector(), and produce().

◆ fedSaved

bool ECALRegFEDSelector::fedSaved[1200]
private

Definition at line 40 of file ECALRegFEDSelector.cc.

Referenced by ECALRegFEDSelector(), and produce().

◆ tok_raw_

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

Definition at line 43 of file ECALRegFEDSelector.cc.

Referenced by produce().

◆ tok_seed_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> ECALRegFEDSelector::tok_seed_
private

Definition at line 42 of file ECALRegFEDSelector.cc.

Referenced by produce().