CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CaloTowerFromL1TCreatorForTauHLT Class Reference

#include <CaloTowerFromL1TCreatorForTauHLT.h>

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

Public Member Functions

 CaloTowerFromL1TCreatorForTauHLT (const edm::ParameterSet &)
 constructor from parameter set More...
 
 ~CaloTowerFromL1TCreatorForTauHLT () override=default
 destructor More...
 
- 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &desc)
 
- 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 sid, edm::Event &evt, const edm::EventSetup &stp) const override
 process one event More...
 

Private Attributes

const int mBX
 bunch crossing More...
 
const double mCone
 use only towers in cone mCone around L1 candidate for regional jet reco More...
 
const double mCone2
 
const double mEThreshold
 E threshold. More...
 
const double mEtThreshold
 ET threshold. More...
 
const int mTauId
 
const edm::EDGetTokenT< l1t::TauBxCollectionmTauTrigger_token
 label of tau trigger type analysis More...
 
const edm::EDGetTokenT< CaloTowerCollectionmtowers_token
 label of source collection More...
 
const int mVerbose
 verbosity More...
 

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

Framework module that produces a collection of calo towers in the region of interest for Tau HLT reconnstruction, depending on tau type trigger:
Tau1 - take location of 1st L1 Tau Tau2 - take location of 2nd L1 Tau; if does not exists, take location of 1st Calo Tower ETau - take L1 Tau candidate which is not collinear to HLT (or L1) electron candidate.

Author
A. Nikitenko. IC. based on L. Lista and J. Mans

Definition at line 31 of file CaloTowerFromL1TCreatorForTauHLT.h.

Constructor & Destructor Documentation

◆ CaloTowerFromL1TCreatorForTauHLT()

CaloTowerFromL1TCreatorForTauHLT::CaloTowerFromL1TCreatorForTauHLT ( const edm::ParameterSet p)

constructor from parameter set

Definition at line 20 of file CaloTowerFromL1TCreatorForTauHLT.cc.

21  : mBX(p.getParameter<int>("BX")),
22  mVerbose(p.getUntrackedParameter<int>("verbose", 0)),
23  mtowers_token(consumes<CaloTowerCollection>(p.getParameter<InputTag>("towers"))),
24  mCone(p.getParameter<double>("UseTowersInCone")),
25  mCone2(mCone * mCone),
26  mTauTrigger_token(consumes<l1t::TauBxCollection>(p.getParameter<InputTag>("TauTrigger"))),
27  mEtThreshold(p.getParameter<double>("minimumEt")),
28  mEThreshold(p.getParameter<double>("minimumE")),
29  mTauId(p.getParameter<int>("TauId")) {
30  produces<CaloTowerCollection>();
31 }
const edm::EDGetTokenT< l1t::TauBxCollection > mTauTrigger_token
label of tau trigger type analysis
const edm::EDGetTokenT< CaloTowerCollection > mtowers_token
label of source collection
const double mCone
use only towers in cone mCone around L1 candidate for regional jet reco

◆ ~CaloTowerFromL1TCreatorForTauHLT()

CaloTowerFromL1TCreatorForTauHLT::~CaloTowerFromL1TCreatorForTauHLT ( )
overridedefault

destructor

Member Function Documentation

◆ fillDescriptions()

void CaloTowerFromL1TCreatorForTauHLT::fillDescriptions ( edm::ConfigurationDescriptions desc)
static

Definition at line 87 of file CaloTowerFromL1TCreatorForTauHLT.cc.

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and edm::ParameterDescriptionNode::setComment().

87  {
89 
90  aDesc.add<edm::InputTag>("TauTrigger", edm::InputTag("caloStage2Digis"))->setComment("L1 Tau collection for seeding");
91  aDesc.add<edm::InputTag>("towers", edm::InputTag("towerMaker"))->setComment("Input tower collection");
92  aDesc.add<int>("TauId", 0)->setComment("Item from L1 Tau collection used for seeding. From 0 to 11");
93  aDesc.add<double>("UseTowersInCone", 0.8)->setComment("Radius of cone around seed");
94  aDesc.add<double>("minimumE", 0.8)->setComment("Minimum tower energy");
95  aDesc.add<double>("minimumEt", 0.5)->setComment("Minimum tower ET");
96  aDesc.add<int>("BX", 0)->setComment("Set bunch crossing; 0 = in time, -1 = previous, 1 = following");
97  aDesc.addUntracked<int>("verbose", 0)->setComment("Verbosity level; 0=silent");
98 
99  desc.add("CaloTowerFromL1TCreatorForTauHLT", aDesc);
100  desc.setComment("Produce tower collection around L1 particle seed.");
101 }
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

void CaloTowerFromL1TCreatorForTauHLT::produce ( edm::StreamID  sid,
edm::Event evt,
const edm::EventSetup stp 
) const
overrideprivatevirtual

process one event

Implements edm::global::EDProducerBase.

Definition at line 33 of file CaloTowerFromL1TCreatorForTauHLT.cc.

References BXVector< T >::begin(), eleHcalExtractorBlocks_cff::caloTowers, HLT_2023v12_cff::cands, BXVector< T >::end(), reco::LeafCandidate::energy(), CaloTower::et(), reco::LeafCandidate::eta(), edm::Event::getByToken(), heavyIonCSV_trainingSettings::idx, edm::HandleBase::isValid(), mBX, mCone, mCone2, mEThreshold, mEtThreshold, eostools::move(), mTauId, mTauTrigger_token, mtowers_token, mVerbose, AlCaHLTBitMon_ParallelJobs::p, reco::LeafCandidate::phi(), and edm::Event::put().

33  {
36 
37  // imitate L1 seeds
39  evt.getByToken(mTauTrigger_token, jetsgen);
40 
41  std::unique_ptr<CaloTowerCollection> cands(new CaloTowerCollection);
42  cands->reserve(caloTowers->size());
43 
44  if (mCone < 0.) {
45  evt.put(std::move(cands));
46  return;
47  }
48 
49  int idTau = 0;
50  if (jetsgen.isValid()) {
51  for (auto myL1Jet = jetsgen->begin(mBX); myL1Jet != jetsgen->end(mBX); myL1Jet++) {
52  if (idTau == mTauId) {
53  unsigned idx = 0;
54  for (; idx < caloTowers->size(); idx++) {
55  const CaloTower* cal = &((*caloTowers)[idx]);
56  bool isAccepted = false;
57  if (mVerbose == 2) {
58  edm::LogInfo("JetDebugInfo") << "CaloTowerFromL1TCreatorForTauHLT::produce-> " << idx
59  << " tower et/eta/phi/e: " << cal->et() << '/' << cal->eta() << '/'
60  << cal->phi() << '/' << cal->energy() << " is...";
61  }
62  if (cal->et() >= mEtThreshold && cal->energy() >= mEThreshold) {
63  math::PtEtaPhiELorentzVector p(cal->et(), cal->eta(), cal->phi(), cal->energy());
64  double delta2 = ROOT::Math::VectorUtil::DeltaR2((*myL1Jet).p4().Vect(), p);
65  if (delta2 < mCone2) {
66  isAccepted = true;
67  cands->push_back(*cal);
68  }
69  }
70  if (mVerbose == 2) {
71  if (isAccepted)
72  edm::LogInfo("JetDebugInfo") << "accepted \n";
73  else
74  edm::LogInfo("JetDebugInfo") << "rejected \n";
75  }
76  }
77  }
78  idTau++;
79  }
80  } else {
81  edm::LogWarning("MissingProduct") << "L1Upgrade jet bx collection not found." << std::endl;
82  }
83 
84  evt.put(std::move(cands));
85 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:536
const_iterator begin(int bx) const
double et(double vtxZ) const
Definition: CaloTower.h:150
const edm::EDGetTokenT< l1t::TauBxCollection > mTauTrigger_token
label of tau trigger type analysis
Log< level::Info, false > LogInfo
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:27
bool isValid() const
Definition: HandleBase.h:70
const_iterator end(int bx) const
Log< level::Warning, false > LogWarning
const edm::EDGetTokenT< CaloTowerCollection > mtowers_token
label of source collection
double phi() const final
momentum azimuthal angle
const double mCone
use only towers in cone mCone around L1 candidate for regional jet reco
def move(src, dest)
Definition: eostools.py:511
double energy() const final
energy
double eta() const final
momentum pseudorapidity

Member Data Documentation

◆ mBX

const int CaloTowerFromL1TCreatorForTauHLT::mBX
private

bunch crossing

Definition at line 45 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mCone

const double CaloTowerFromL1TCreatorForTauHLT::mCone
private

use only towers in cone mCone around L1 candidate for regional jet reco

Definition at line 51 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mCone2

const double CaloTowerFromL1TCreatorForTauHLT::mCone2
private

Definition at line 51 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mEThreshold

const double CaloTowerFromL1TCreatorForTauHLT::mEThreshold
private

E threshold.

Definition at line 57 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mEtThreshold

const double CaloTowerFromL1TCreatorForTauHLT::mEtThreshold
private

ET threshold.

Definition at line 55 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mTauId

const int CaloTowerFromL1TCreatorForTauHLT::mTauId
private

Definition at line 59 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mTauTrigger_token

const edm::EDGetTokenT<l1t::TauBxCollection> CaloTowerFromL1TCreatorForTauHLT::mTauTrigger_token
private

label of tau trigger type analysis

Definition at line 53 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mtowers_token

const edm::EDGetTokenT<CaloTowerCollection> CaloTowerFromL1TCreatorForTauHLT::mtowers_token
private

label of source collection

Definition at line 49 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().

◆ mVerbose

const int CaloTowerFromL1TCreatorForTauHLT::mVerbose
private

verbosity

Definition at line 47 of file CaloTowerFromL1TCreatorForTauHLT.h.

Referenced by produce().