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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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 &&)=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)
 

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

const edm::EDPutTokenT< CaloEmCandBxCollectionemPutToken_
 
const edm::EDGetTokenT< L1CaloEmCollectionemToken_
 
const edm::EDPutTokenT< CaloRegionBxCollectionrgnPutToken_
 
const edm::EDGetTokenT< L1CaloRegionCollectionrgnToken_
 

Additional Inherited Members

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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 45 of file L1TCaloRCTToUpgradeConverter.cc.

Constructor & Destructor Documentation

◆ L1TCaloRCTToUpgradeConverter()

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

Definition at line 67 of file L1TCaloRCTToUpgradeConverter.cc.

68  : rgnToken_{consumes<L1CaloRegionCollection>(ps.getParameter<edm::InputTag>("regionTag"))},
69  emToken_{consumes<L1CaloEmCollection>(ps.getParameter<edm::InputTag>("emTag"))},
70  rgnPutToken_{produces<CaloRegionBxCollection>()},
71  emPutToken_{produces<CaloEmCandBxCollection>()} {}

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 151 of file L1TCaloRCTToUpgradeConverter.cc.

151  {
153  desc.add<edm::InputTag>("regionTag");
154  desc.add<edm::InputTag>("emTag");
155  descriptions.addDefault(desc);
156 }

References edm::ParameterSetDescription::add(), and edm::ConfigurationDescriptions::addDefault().

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 74 of file L1TCaloRCTToUpgradeConverter.cc.

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

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

Member Data Documentation

◆ emPutToken_

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

Definition at line 60 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ emToken_

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

Definition at line 57 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ rgnPutToken_

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

Definition at line 59 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ rgnToken_

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

Definition at line 56 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

l1t::L1TCaloRCTToUpgradeConverter::rgnToken_
const edm::EDGetTokenT< L1CaloRegionCollection > rgnToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:56
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1t::L1TCaloRCTToUpgradeConverter::emPutToken_
const edm::EDPutTokenT< CaloEmCandBxCollection > emPutToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:60
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
BXVector
Definition: BXVector.h:15
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
p4
double p4[4]
Definition: TauolaWrapper.h:92
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
l1t::CaloRegion
Definition: CaloRegion.h:9
l1t::L1Candidate::setHwIso
void setHwIso(int iso)
Definition: L1Candidate.h:32
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
l1t::L1TCaloRCTToUpgradeConverter::emToken_
const edm::EDGetTokenT< L1CaloEmCollection > emToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:57
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
l1t::L1TCaloRCTToUpgradeConverter::rgnPutToken_
const edm::EDPutTokenT< CaloRegionBxCollection > rgnPutToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:59
BXVector::setBXRange
void setBXRange(int bxFirst, int bxLast)
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
BXVector::push_back
void push_back(int bx, T object)
edm::InputTag
Definition: InputTag.h:15
l1t::CaloEmCand
Definition: CaloEmCand.h:8