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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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 26 of file ECALRegFEDSelector.cc.

Constructor & Destructor Documentation

◆ ECALRegFEDSelector()

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

Definition at line 47 of file ECALRegFEDSelector.cc.

References ec_mapping, fedSaved, and AlCaHLTBitMon_ParallelJobs::p.

48  : delta_(iConfig.getParameter<double>("delta")),
49  tok_seed_(consumes<trigger::TriggerFilterObjectWithRefs>(iConfig.getParameter<edm::InputTag>("regSeedLabel"))),
50  tok_raw_(consumes<FEDRawDataCollection>(iConfig.getParameter<edm::InputTag>("rawInputLabel"))) {
51  ec_mapping = std::make_unique<EcalElectronicsMapping>();
52 
53  produces<FEDRawDataCollection>();
54  produces<EcalListOfFEDS>();
55 
56  for (int p = 0; p < 1200; p++) {
57  fedSaved[p] = false;
58  }
59 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 34 of file ECALRegFEDSelector.cc.

34 {}

◆ endJob()

void ECALRegFEDSelector::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 36 of file ECALRegFEDSelector.cc.

Referenced by o2olib.O2ORunMgr::executeJob().

36 {}

◆ fillDescriptions()

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

Definition at line 131 of file ECALRegFEDSelector.cc.

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

131  {
133  desc.add<edm::InputTag>("regSeedLabel", edm::InputTag("hltPixelIsolTrackFilter"));
134  desc.add<edm::InputTag>("rawInputLabel", edm::InputTag("rawDataCollector"));
135  desc.add<double>("delta", 1.0);
136  descriptions.add("ecalFED", desc);
137 }
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 61 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.

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

Referenced by produce().

◆ ec_mapping

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

Definition at line 38 of file ECALRegFEDSelector.cc.

Referenced by ECALRegFEDSelector(), and produce().

◆ fedSaved

bool ECALRegFEDSelector::fedSaved[1200]
private

Definition at line 41 of file ECALRegFEDSelector.cc.

Referenced by ECALRegFEDSelector(), and produce().

◆ tok_raw_

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

Definition at line 44 of file ECALRegFEDSelector.cc.

Referenced by produce().

◆ tok_seed_

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

Definition at line 43 of file ECALRegFEDSelector.cc.

Referenced by produce().