CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
l1t::L1TCaloRCTToUpgradeConverter Class Reference

#include <L1Trigger/L1TCalorimeter/plugins/L1TCaloRCTToUpgradeConverter.cc>

Inheritance diagram for l1t::L1TCaloRCTToUpgradeConverter:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TCaloRCTToUpgradeConverter (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () 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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

edm::EDPutTokenT< CaloEmCandBxCollection > const emPutToken_
 
edm::EDGetTokenT< L1CaloEmCollection > const emToken_
 
edm::EDPutTokenT< CaloRegionBxCollection > const rgnPutToken_
 
edm::EDGetTokenT< L1CaloRegionCollection > const rgnToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 44 of file L1TCaloRCTToUpgradeConverter.cc.

Constructor & Destructor Documentation

◆ L1TCaloRCTToUpgradeConverter()

L1TCaloRCTToUpgradeConverter::L1TCaloRCTToUpgradeConverter ( const edm::ParameterSet ps)
explicit

Definition at line 66 of file L1TCaloRCTToUpgradeConverter.cc.

References edm::ParameterSet::getParameter().

67  : rgnToken_{consumes<L1CaloRegionCollection>(ps.getParameter<edm::InputTag>("regionTag"))},
68  emToken_{consumes<L1CaloEmCollection>(ps.getParameter<edm::InputTag>("emTag"))},
69  rgnPutToken_{produces<CaloRegionBxCollection>()},
70  emPutToken_{produces<CaloEmCandBxCollection>()} {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< L1CaloRegionCollection > const rgnToken_
edm::EDPutTokenT< CaloRegionBxCollection > const rgnPutToken_
edm::EDGetTokenT< L1CaloEmCollection > const emToken_
edm::EDPutTokenT< CaloEmCandBxCollection > const emPutToken_

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 150 of file L1TCaloRCTToUpgradeConverter.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

150  {
152  desc.add<edm::InputTag>("regionTag");
153  desc.add<edm::InputTag>("emTag");
154  descriptions.addDefault(desc);
155 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 73 of file L1TCaloRCTToUpgradeConverter.cc.

References simKBmtfDigis_cfi::bx, emPutToken_, emToken_, l1trig_cff::hwQual, iEvent, createfilelist::int, eostools::move(), BXVector< T >::push_back(), HLT_2022v15_cff::region, rgnPutToken_, rgnToken_, BXVector< T >::setBXRange(), and l1t::L1Candidate::setHwIso().

73  {
74  // check status of RCT conditions & renew if needed
75 
76  // store new formats
77  BXVector<CaloEmCand> emcands;
79 
80  // get old formats
81  auto const& ems = iEvent.get(emToken_);
82  auto const& rgns = iEvent.get(rgnToken_);
83 
84  // get the firstBx_ and lastBx_ from the input datatypes (assume bx for em same as rgn)
85  int firstBx = 0;
86  int lastBx = 0;
87  for (auto const& em : ems) {
88  int bx = em.bx();
89  if (bx < firstBx)
90  firstBx = bx;
91  if (bx > lastBx)
92  lastBx = bx;
93  }
94 
95  emcands.setBXRange(firstBx, lastBx);
96  regions.setBXRange(firstBx, lastBx);
97 
98  const ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > p4(0, 0, 0, 0);
99 
100  // loop over EM
101  for (auto const& em : ems) {
102  // get physical units
103  // double pt = 0.;
104  // double eta = 0.;
105  // double phi = 0.;
106  //math::PtEtaPhiMLorentzVector p4( pt+1.e-6, eta, phi, 0. );
107 
108  //CaloStage1Cluster cluster;
109  CaloEmCand EmCand(p4, (int)em.rank(), (int)em.regionId().ieta(), (int)em.regionId().iphi(), (int)em.index());
110 
111  EmCand.setHwIso((int)em.isolated());
112  //std::cout<<"ISO: "<<EmCand.hwIso()<<" "<<em.isolated()<<std::endl;
113 
114  // create new format
115  emcands.push_back(em.bx(), EmCand);
116  }
117 
118  // loop over regions
119  for (auto const& rgn : rgns) {
120  // get physical units
121  // double pt = 0.;
122  // double eta = 0.;
123  // double phi = 0.;
124  //math::PtEtaPhiMLorentzVector p4( pt+1.e-6, eta, phi, 0 );
125 
126  bool tauVeto = rgn.fineGrain(); //equivalent to tauVeto for HB/HE, includes extra info for HF
127  int hwQual = (int)tauVeto;
128 
129  // create new format
130  // several values here are stage 2 only, leave empty
131  CaloRegion region(p4, // LorentzVector& p4,
132  0., // etEm,
133  0., // etHad,
134  (int)rgn.et(), // pt,
135  (int)rgn.id().ieta(), // eta,
136  (int)rgn.id().iphi(), // phi,
137  hwQual, // qual,
138  0, // hwEtEm,
139  0); // hwEtHad
140 
141  // add to output
142  regions.push_back(rgn.bx(), region);
143  }
144 
145  iEvent.emplace(emPutToken_, std::move(emcands));
147 }
edm::EDGetTokenT< L1CaloRegionCollection > const rgnToken_
int iEvent
Definition: GenABIO.cc:224
edm::EDPutTokenT< CaloRegionBxCollection > const rgnPutToken_
edm::EDGetTokenT< L1CaloEmCollection > const emToken_
void setHwIso(int iso)
Definition: L1Candidate.h:32
void setBXRange(int bxFirst, int bxLast)
edm::EDPutTokenT< CaloEmCandBxCollection > const emPutToken_
def move(src, dest)
Definition: eostools.py:511
void push_back(int bx, T object)

Member Data Documentation

◆ emPutToken_

edm::EDPutTokenT<CaloEmCandBxCollection> const l1t::L1TCaloRCTToUpgradeConverter::emPutToken_
private

Definition at line 59 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ emToken_

edm::EDGetTokenT<L1CaloEmCollection> const l1t::L1TCaloRCTToUpgradeConverter::emToken_
private

Definition at line 56 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ rgnPutToken_

edm::EDPutTokenT<CaloRegionBxCollection> const l1t::L1TCaloRCTToUpgradeConverter::rgnPutToken_
private

Definition at line 58 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ rgnToken_

edm::EDGetTokenT<L1CaloRegionCollection> const l1t::L1TCaloRCTToUpgradeConverter::rgnToken_
private

Definition at line 55 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().