CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
L2TauPixelTrackMatch Class Reference

#include <L2TauPixelTrackMatch.h>

Inheritance diagram for L2TauPixelTrackMatch:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  TinyTrack
 

Public Member Functions

 L2TauPixelTrackMatch (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~L2TauPixelTrackMatch () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotm_beamSpotTag
 
float m_deltaR
 
float m_jetMaxEta
 
float m_jetMinPt
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefsm_jetSrc
 
float m_trackMinPt
 
edm::EDGetTokenT< reco::TrackCollectionm_trackSrc
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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

class L2TauPixelTrackMatch this producer creates a new L2 tau jet collection with jets' vertices redefined from vertex z (relative to beamspot) of dr-matched pixel tracks that are above some pt threshold and beamline x & y.

Definition at line 21 of file L2TauPixelTrackMatch.h.

Constructor & Destructor Documentation

◆ L2TauPixelTrackMatch()

L2TauPixelTrackMatch::L2TauPixelTrackMatch ( const edm::ParameterSet conf)
explicit

Definition at line 15 of file L2TauPixelTrackMatch.cc.

15  {
16  m_jetSrc = consumes<trigger::TriggerFilterObjectWithRefs>(conf.getParameter<edm::InputTag>("JetSrc"));
17  m_jetMinPt = conf.getParameter<double>("JetMinPt");
18  m_jetMaxEta = conf.getParameter<double>("JetMaxEta");
19  //m_jetMinN = conf.getParameter<int>("JetMinN");
20  m_trackSrc = consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("TrackSrc"));
21  m_trackMinPt = conf.getParameter<double>("TrackMinPt");
22  m_deltaR = conf.getParameter<double>("deltaR");
23  m_beamSpotTag = consumes<reco::BeamSpot>(conf.getParameter<edm::InputTag>("BeamSpotSrc"));
24 
25  produces<reco::CaloJetCollection>();
26 }

References edm::ParameterSet::getParameter(), m_beamSpotTag, m_deltaR, m_jetMaxEta, m_jetMinPt, m_jetSrc, m_trackMinPt, and m_trackSrc.

◆ ~L2TauPixelTrackMatch()

L2TauPixelTrackMatch::~L2TauPixelTrackMatch ( )
override

Definition at line 28 of file L2TauPixelTrackMatch.cc.

28 {}

Member Function Documentation

◆ produce()

void L2TauPixelTrackMatch::produce ( edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

if (jet_with_vertices.size()) new_tau_jets->push_back(jet_with_vertices);

Implements edm::EDProducer.

Definition at line 30 of file L2TauPixelTrackMatch.cc.

30  {
31  using namespace std;
32  using namespace reco;
33 
34  // *** Pick up beam spot ***
35 
36  // use beam spot for vertex x,y
37  edm::Handle<BeamSpot> bsHandle;
38  ev.getByToken(m_beamSpotTag, bsHandle);
39  const reco::BeamSpot& bs = *bsHandle;
40  math::XYZPoint beam_spot(bs.x0(), bs.y0(), bs.z0());
41  DBG_PRINT(cout << endl << "beamspot " << beam_spot << endl);
42 
43  // *** Pick up pixel tracks ***
44 
45  edm::Handle<TrackCollection> tracksHandle;
46  ev.getByToken(m_trackSrc, tracksHandle);
47 
48  // *** Pick up L2 tau jets that were previously selected by some other filter ***
49 
50  // first, get L2 object refs by the label
52  ev.getByToken(m_jetSrc, jetsHandle);
53 
54  // now we can get pre-selected L2 tau jets
55  std::vector<CaloJetRef> tau_jets;
56  jetsHandle->getObjects(trigger::TriggerTau, tau_jets);
57  const size_t n_jets = tau_jets.size();
58 
59  // *** Selects interesting tracks ***
60 
61  vector<TinyTrack> good_tracks;
62  for (TrackCollection::const_iterator itrk = tracksHandle->begin(); itrk != tracksHandle->end(); ++itrk) {
63  if (itrk->pt() < m_trackMinPt)
64  continue;
65  if (std::abs(itrk->eta()) > m_jetMaxEta + m_deltaR)
66  continue;
67 
68  TinyTrack trk;
69  trk.pt = itrk->pt();
70  trk.phi = itrk->phi();
71  trk.eta = itrk->eta();
72  double dz = itrk->dz(beam_spot);
73  trk.vtx = math::XYZPoint(bs.x(dz), bs.y(dz), dz);
74  good_tracks.push_back(trk);
75  }
76  DBG_PRINT(cout << "got " << good_tracks.size() << " good tracks; " << n_jets << " tau jets" << endl);
77 
78  // *** Match tau jets to intertesting tracks and assign them new vertices ***
79 
80  // the new product
81  std::unique_ptr<CaloJetCollection> new_tau_jets(new CaloJetCollection);
82  int n_uniq = 0;
83  if (!good_tracks.empty())
84  for (size_t i = 0; i < n_jets; ++i) {
85  reco::CaloJetRef jet = tau_jets[i];
86  if (jet->pt() < m_jetMinPt || std::abs(jet->eta()) > m_jetMaxEta)
87  continue;
88 
89  DBG_PRINT(cout << i << " :" << endl);
90 
91  size_t n0 = new_tau_jets->size();
92 
93  for (vector<TinyTrack>::const_iterator itrk = good_tracks.begin(); itrk != good_tracks.end(); ++itrk) {
94  DBG_PRINT(cout << " trk pt,eta,phi,z: " << itrk->pt << " " << itrk->eta << " " << itrk->phi << " "
95  << itrk->vtx.z() << " \t\t ");
96 
97  math::XYZTLorentzVector new_jet_dir = Jet::physicsP4(itrk->vtx, *jet, itrk->vtx);
98  float dphi = reco::deltaPhi(new_jet_dir.phi(), itrk->phi);
99  float deta = new_jet_dir.eta() - itrk->eta;
100 
101  DBG_PRINT(cout << " jet pt,deta,dphi,dr: " << jet->pt() << " " << deta << " " << dphi << " "
102  << sqrt(dphi * dphi + deta * deta) << endl);
103 
104  if (dphi * dphi + deta * deta > m_deltaR * m_deltaR)
105  continue;
106 
107  DBG_PRINT(cout << " jet-trk match!" << endl);
108 
109  // create a jet copy and assign a new vertex to it
110  CaloJet new_jet = *jet;
111  new_jet.setVertex(itrk->vtx);
112 
113  new_tau_jets->push_back(new_jet);
114  }
115  DBG_PRINT(cout << " nmatchedjets " << new_tau_jets->size() - n0 << endl);
116  if (new_tau_jets->size() - n0 > 0)
117  n_uniq++;
118 
120  }
121  DBG_PRINT(cout << "n_uniq_matched_jets " << n_uniq << endl << "storing njets " << new_tau_jets->size() << endl);
122 
123  // store the result
124  ev.put(std::move(new_tau_jets));
125 }

References funct::abs(), cms::cuda::bs, gather_cfg::cout, DBG_PRINT, reco::deltaPhi(), PVValHelper::dz, L2TauPixelTrackMatch::TinyTrack::eta, ev, trigger::TriggerRefsCollections::getObjects(), mps_fire::i, metsig::jet, m_beamSpotTag, m_deltaR, m_jetMaxEta, m_jetMinPt, m_jetSrc, m_trackMinPt, m_trackSrc, eostools::move(), n0, L2TauPixelTrackMatch::TinyTrack::phi, L2TauPixelTrackMatch::TinyTrack::pt, reco::LeafCandidate::setVertex(), mathSSE::sqrt(), trigger::TriggerTau, and L2TauPixelTrackMatch::TinyTrack::vtx.

Member Data Documentation

◆ m_beamSpotTag

edm::EDGetTokenT<reco::BeamSpot> L2TauPixelTrackMatch::m_beamSpotTag
private

Definition at line 39 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

◆ m_deltaR

float L2TauPixelTrackMatch::m_deltaR
private

Definition at line 38 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

◆ m_jetMaxEta

float L2TauPixelTrackMatch::m_jetMaxEta
private

Definition at line 35 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

◆ m_jetMinPt

float L2TauPixelTrackMatch::m_jetMinPt
private

Definition at line 34 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

◆ m_jetSrc

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> L2TauPixelTrackMatch::m_jetSrc
private

Definition at line 33 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

◆ m_trackMinPt

float L2TauPixelTrackMatch::m_trackMinPt
private

Definition at line 37 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

◆ m_trackSrc

edm::EDGetTokenT<reco::TrackCollection> L2TauPixelTrackMatch::m_trackSrc
private

Definition at line 36 of file L2TauPixelTrackMatch.h.

Referenced by L2TauPixelTrackMatch(), and produce().

reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
mps_fire.i
i
Definition: mps_fire.py:355
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
gather_cfg.cout
cout
Definition: gather_cfg.py:144
trigger::TriggerTau
Definition: TriggerTypeDefs.h:80
n0
int n0
Definition: AMPTWrapper.h:44
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:593
edm::Ref< CaloJetCollection >
cms::cuda::bs
bs
Definition: HistoContainer.h:127
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
reco::LeafCandidate::setVertex
void setVertex(const Point &vertex) override
set vertex
Definition: LeafCandidate.h:173
L2TauPixelTrackMatch::m_trackMinPt
float m_trackMinPt
Definition: L2TauPixelTrackMatch.h:37
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
L2TauPixelTrackMatch::m_jetMaxEta
float m_jetMaxEta
Definition: L2TauPixelTrackMatch.h:35
L2TauPixelTrackMatch::m_deltaR
float m_deltaR
Definition: L2TauPixelTrackMatch.h:38
reco::CaloJetCollection
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
Definition: CaloJetCollection.h:15
L2TauPixelTrackMatch::m_jetMinPt
float m_jetMinPt
Definition: L2TauPixelTrackMatch.h:34
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L2TauPixelTrackMatch::m_trackSrc
edm::EDGetTokenT< reco::TrackCollection > m_trackSrc
Definition: L2TauPixelTrackMatch.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
PVValHelper::dz
Definition: PVValidationHelpers.h:50
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
metsig::jet
Definition: SignAlgoResolutions.h:47
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
L2TauPixelTrackMatch::m_jetSrc
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_jetSrc
Definition: L2TauPixelTrackMatch.h:33
DBG_PRINT
#define DBG_PRINT(arg)
Definition: L2TauPixelTrackMatch.cc:13
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
L2TauPixelTrackMatch::m_beamSpotTag
edm::EDGetTokenT< reco::BeamSpot > m_beamSpotTag
Definition: L2TauPixelTrackMatch.h:39
edm::InputTag
Definition: InputTag.h:15