CMS 3D CMS Logo

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

#include <TauJetSelectorForHLTTrackSeeding.h>

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

Public Member Functions

 TauJetSelectorForHLTTrackSeeding (const edm::ParameterSet &)
 
 ~TauJetSelectorForHLTTrackSeeding () override
 
- 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 &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 beginJob () override
 
void endJob () override
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const double etaMaxCaloJet_
 
const double etaMinCaloJet_
 
const double fractionMaxChargedPUInCaloCone_
 
const double fractionMinCaloInTauCone_
 
edm::EDGetTokenT< reco::CaloJetCollectioninputCaloJetToken_
 
edm::EDGetTokenT< reco::TrackJetCollectioninputTrackJetToken_
 
edm::EDGetTokenT< reco::TrackCollectioninputTrackToken_
 
const double isolationConeSize_
 
const int nTrkMaxInCaloCone_
 
const double ptMinCaloJet_
 
const double ptTrkMaxInCaloCone_
 
const double tauConeSize_
 

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

Definition at line 27 of file TauJetSelectorForHLTTrackSeeding.h.

Constructor & Destructor Documentation

◆ TauJetSelectorForHLTTrackSeeding()

TauJetSelectorForHLTTrackSeeding::TauJetSelectorForHLTTrackSeeding ( const edm::ParameterSet iConfig)
explicit

Definition at line 5 of file TauJetSelectorForHLTTrackSeeding.cc.

References edm::ParameterSet::getParameter(), inputCaloJetToken_, inputTrackJetToken_, and inputTrackToken_.

6  : ptMinCaloJet_(iConfig.getParameter<double>("ptMinCaloJet")),
7  etaMinCaloJet_(iConfig.getParameter<double>("etaMinCaloJet")),
8  etaMaxCaloJet_(iConfig.getParameter<double>("etaMaxCaloJet")),
9  tauConeSize_(iConfig.getParameter<double>("tauConeSize")),
10  isolationConeSize_(iConfig.getParameter<double>("isolationConeSize")),
11  fractionMinCaloInTauCone_(iConfig.getParameter<double>("fractionMinCaloInTauCone")),
12  fractionMaxChargedPUInCaloCone_(iConfig.getParameter<double>("fractionMaxChargedPUInCaloCone")),
13  ptTrkMaxInCaloCone_(iConfig.getParameter<double>("ptTrkMaxInCaloCone")),
14  nTrkMaxInCaloCone_(iConfig.getParameter<int>("nTrkMaxInCaloCone")) {
15  //now do what ever initialization is needed
16  inputTrackJetToken_ = consumes<reco::TrackJetCollection>(iConfig.getParameter<edm::InputTag>("inputTrackJetTag"));
17  inputCaloJetToken_ = consumes<reco::CaloJetCollection>(iConfig.getParameter<edm::InputTag>("inputCaloJetTag"));
18  inputTrackToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("inputTrackTag"));
19 
20  produces<reco::TrackJetCollection>();
21 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::TrackJetCollection > inputTrackJetToken_
edm::EDGetTokenT< reco::TrackCollection > inputTrackToken_
edm::EDGetTokenT< reco::CaloJetCollection > inputCaloJetToken_

◆ ~TauJetSelectorForHLTTrackSeeding()

TauJetSelectorForHLTTrackSeeding::~TauJetSelectorForHLTTrackSeeding ( )
override

Definition at line 23 of file TauJetSelectorForHLTTrackSeeding.cc.

23  {
24  // do anything here that needs to be done at desctruction time
25  // (e.g. close files, deallocate resources etc.)
26 }

Member Function Documentation

◆ beginJob()

void TauJetSelectorForHLTTrackSeeding::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 138 of file TauJetSelectorForHLTTrackSeeding.cc.

138 {}

◆ endJob()

void TauJetSelectorForHLTTrackSeeding::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 141 of file TauJetSelectorForHLTTrackSeeding.cc.

141 {}

◆ fillDescriptions()

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

Definition at line 143 of file TauJetSelectorForHLTTrackSeeding.cc.

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

143  {
145  desc.add<edm::InputTag>("inputTrackJetTag", edm::InputTag("hltAntiKT5TrackJetsIter0"))
146  ->setComment("Oryginal TrackJet collection");
147  desc.add<edm::InputTag>("inputCaloJetTag", edm::InputTag("hltAntiKT5CaloJetsPFEt5"))
148  ->setComment("CaloJet collection");
149  desc.add<edm::InputTag>("inputTrackTag", edm::InputTag("hltPFlowTrackSelectionHighPurity"))
150  ->setComment("Track collection for track isolation");
151  desc.add<double>("ptMinCaloJet", 5.0)->setComment("Min. pT of CaloJet");
152  desc.add<double>("etaMinCaloJet", -2.7)->setComment("Min. eta of CaloJet");
153  desc.add<double>("etaMaxCaloJet", +2.7)->setComment("Max. eta of CaloJet");
154  desc.add<double>("tauConeSize", 0.2)->setComment("Radius of tau signal cone");
155  desc.add<double>("isolationConeSize", 0.5)->setComment("Radius of isolation cone");
156  desc.add<double>("fractionMinCaloInTauCone", 0.8)->setComment("Min. fraction of calo energy in tau signal cone");
157  desc.add<double>("fractionMaxChargedPUInCaloCone", 0.2)
158  ->setComment("Max. fraction of PU charged energy Sum(Pt_trks)/Pt_jet in signal cone");
159  desc.add<double>("ptTrkMaxInCaloCone", 1.0)->setComment("Max. sum of pT of tracks in isolation cone");
160  desc.add<int>("nTrkMaxInCaloCone", 0)->setComment("Max. no. of tracks in isolation cone");
161  descriptions.setComment(
162  "This module produces a collection of TrackJets to seed iterative tracking.\nIt is done by enriching the input "
163  "TrackJet collection with CaloJets passing isolation critera - tau candidates");
164  descriptions.add("tauJetSelectorForHLTTrackSeeding", desc);
165 }
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 33 of file TauJetSelectorForHLTTrackSeeding.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, HLTMuonOfflineAnalyzer_cfi::deltaR2, etaMaxCaloJet_, etaMinCaloJet_, fractionMaxChargedPUInCaloCone_, fractionMinCaloInTauCone_, iEvent, inputCaloJetToken_, inputTrackJetToken_, inputTrackToken_, isolationConeSize_, eostools::move(), nTrkMaxInCaloCone_, phi, ptMinCaloJet_, ptTrkMaxInCaloCone_, tauConeSize_, HLT_2023v12_cff::track, reco::btau::trackEta, reco::btau::trackPhi, pwdgSkimBPark_cfi::tracks, and bphysicsOniaDQM_cfi::vertex.

35  {
36  std::unique_ptr<reco::TrackJetCollection> augmentedTrackJets(new reco::TrackJetCollection);
37 
39  iEvent.getByToken(inputTrackJetToken_, trackjets);
40 
41  for (reco::TrackJetCollection::const_iterator trackjet = trackjets->begin(); trackjet != trackjets->end();
42  trackjet++) {
43  augmentedTrackJets->push_back(*trackjet);
44  }
45 
47  iEvent.getByToken(inputTrackToken_, tracks);
48 
50  iEvent.getByToken(inputCaloJetToken_, calojets);
51 
52  const double tauConeSize2 = tauConeSize_ * tauConeSize_;
53  const double isolationConeSize2 = isolationConeSize_ * isolationConeSize_;
54 
55  for (reco::CaloJetCollection::const_iterator calojet = calojets->begin(); calojet != calojets->end(); calojet++) {
56  if (calojet->pt() < ptMinCaloJet_)
57  continue;
58  double etaJet = calojet->eta();
59  double phiJet = calojet->phi();
60  if (etaJet < etaMinCaloJet_)
61  continue;
62  if (etaJet > etaMaxCaloJet_)
63  continue;
64 
65  std::vector<CaloTowerPtr> const& theTowers = calojet->getCaloConstituents();
66  double ptIn = 0.;
67  double ptOut = 0.;
68  for (unsigned int itwr = 0; itwr < theTowers.size(); ++itwr) {
69  double etaTwr = theTowers[itwr]->eta() - etaJet;
70  double phiTwr = deltaPhi(theTowers[itwr]->phi(), phiJet);
71  double deltaR2 = etaTwr * etaTwr + phiTwr * phiTwr;
72  //std::cout << "Tower eta/phi/et : " << etaTwr << " " << phiTwr << " " << theTowers[itwr]->pt() << std::endl;
73  if (deltaR2 < tauConeSize2) {
74  ptIn += theTowers[itwr]->pt();
75  } else if (deltaR2 < isolationConeSize2) {
76  ptOut += theTowers[itwr]->pt();
77  }
78  }
79  double ptTot = ptIn + ptOut;
80  double fracIn = ptIn / ptTot;
81 
82  // We are looking for isolated tracks
83  if (fracIn < fractionMinCaloInTauCone_)
84  continue;
85 
86  int ntrk = 0;
87  double ptTrk = 0.;
88 
89  for (reco::TrackJetCollection::const_iterator trackjet = trackjets->begin(); trackjet != trackjets->end();
90  trackjet++) {
91  for (unsigned itr = 0; itr < trackjet->numberOfTracks(); ++itr) {
92  edm::Ptr<reco::Track> track = trackjet->track(itr);
93  double trackEta = track->eta() - etaJet;
94  double trackPhi = deltaPhi(track->phi(), phiJet);
95  double deltaR2 = trackEta * trackEta + trackPhi * trackPhi;
96  if (deltaR2 < isolationConeSize2) {
97  ntrk++;
98  ptTrk += track->pt();
99  }
100  }
101  }
102  // We are looking for calojets without signal tracks already in
103  if (ntrk > nTrkMaxInCaloCone_)
104  continue;
105  if (ptTrk > ptTrkMaxInCaloCone_)
106  continue;
107 
108  double ptTrk2 = 0.;
109 
110  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); track++) {
111  double trackEta = track->eta() - etaJet;
112  double trackPhi = deltaPhi(track->phi(), phiJet);
113  double deltaR2 = trackEta * trackEta + trackPhi * trackPhi;
114  if (deltaR2 < isolationConeSize2) {
115  ptTrk2 += track->pt();
116  }
117  }
118  // We are looking for signal jets, not PU jets
119  double fractionChargedPU = ptTrk2 / calojet->pt();
120  if (fractionChargedPU > fractionMaxChargedPUInCaloCone_)
121  continue;
122  /*
123  std::cout << "Calo Jet " << calojet->pt() << " " << calojet->eta()
124  << " " << ptIn << " " << ptOut << " " << fracIn
125  << " " << ptTrk << " " << ntrk
126  << " " << fractionChargedPU
127  << std::endl;
128  */
129  math::XYZTLorentzVector p4(calojet->p4());
130  math::XYZPoint vertex(calojet->vertex());
131  augmentedTrackJets->push_back(reco::TrackJet(p4, vertex));
132  }
133 
134  iEvent.put(std::move(augmentedTrackJets));
135 }
edm::EDGetTokenT< reco::TrackJetCollection > inputTrackJetToken_
edm::EDGetTokenT< reco::TrackCollection > inputTrackToken_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
int iEvent
Definition: GenABIO.cc:224
Jets made out of tracks.
Definition: TrackJet.h:24
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< TrackJet > TrackJetCollection
collection of TrackJet objects
edm::EDGetTokenT< reco::CaloJetCollection > inputCaloJetToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ etaMaxCaloJet_

const double TauJetSelectorForHLTTrackSeeding::etaMaxCaloJet_
private

Definition at line 45 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ etaMinCaloJet_

const double TauJetSelectorForHLTTrackSeeding::etaMinCaloJet_
private

Definition at line 44 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ fractionMaxChargedPUInCaloCone_

const double TauJetSelectorForHLTTrackSeeding::fractionMaxChargedPUInCaloCone_
private

Definition at line 49 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ fractionMinCaloInTauCone_

const double TauJetSelectorForHLTTrackSeeding::fractionMinCaloInTauCone_
private

Definition at line 48 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ inputCaloJetToken_

edm::EDGetTokenT<reco::CaloJetCollection> TauJetSelectorForHLTTrackSeeding::inputCaloJetToken_
private

Definition at line 41 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce(), and TauJetSelectorForHLTTrackSeeding().

◆ inputTrackJetToken_

edm::EDGetTokenT<reco::TrackJetCollection> TauJetSelectorForHLTTrackSeeding::inputTrackJetToken_
private

Definition at line 40 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce(), and TauJetSelectorForHLTTrackSeeding().

◆ inputTrackToken_

edm::EDGetTokenT<reco::TrackCollection> TauJetSelectorForHLTTrackSeeding::inputTrackToken_
private

Definition at line 42 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce(), and TauJetSelectorForHLTTrackSeeding().

◆ isolationConeSize_

const double TauJetSelectorForHLTTrackSeeding::isolationConeSize_
private

Definition at line 47 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ nTrkMaxInCaloCone_

const int TauJetSelectorForHLTTrackSeeding::nTrkMaxInCaloCone_
private

Definition at line 51 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ ptMinCaloJet_

const double TauJetSelectorForHLTTrackSeeding::ptMinCaloJet_
private

Definition at line 43 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ ptTrkMaxInCaloCone_

const double TauJetSelectorForHLTTrackSeeding::ptTrkMaxInCaloCone_
private

Definition at line 50 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().

◆ tauConeSize_

const double TauJetSelectorForHLTTrackSeeding::tauConeSize_
private

Definition at line 46 of file TauJetSelectorForHLTTrackSeeding.h.

Referenced by produce().