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 &&)=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::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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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

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 = 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

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.

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>()} {}

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 150 of file L1TCaloRCTToUpgradeConverter.cc.

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

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

◆ 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.

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 }

References l1GtPatternGenerator_cfi::bx, emPutToken_, emToken_, iEvent, createfilelist::int, eostools::move(), p4, BXVector< T >::push_back(), HLT_FULL_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 59 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ emToken_

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

Definition at line 56 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ rgnPutToken_

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

Definition at line 58 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

◆ rgnToken_

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

Definition at line 55 of file L1TCaloRCTToUpgradeConverter.cc.

Referenced by produce().

l1t::L1TCaloRCTToUpgradeConverter::rgnToken_
const edm::EDGetTokenT< L1CaloRegionCollection > rgnToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:55
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
l1t::L1TCaloRCTToUpgradeConverter::emPutToken_
const edm::EDPutTokenT< CaloEmCandBxCollection > emPutToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:59
BXVector
Definition: BXVector.h:15
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
p4
double p4[4]
Definition: TauolaWrapper.h:92
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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
l1t::L1TCaloRCTToUpgradeConverter::emToken_
const edm::EDGetTokenT< L1CaloEmCollection > emToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:56
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:78
l1t::L1TCaloRCTToUpgradeConverter::rgnPutToken_
const edm::EDPutTokenT< CaloRegionBxCollection > rgnPutToken_
Definition: L1TCaloRCTToUpgradeConverter.cc:58
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