CMS 3D CMS Logo

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

#include <TrackingRegionsFromBeamSpotAndL2Tau.h>

Inheritance diagram for TrackingRegionsFromBeamSpotAndL2Tau:
TrackingRegionProducer

Public Member Functions

std::vector< std::unique_ptr< TrackingRegion > > regions (const edm::Event &e, const edm::EventSetup &es) const override
 
 TrackingRegionsFromBeamSpotAndL2Tau (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 
 ~TrackingRegionsFromBeamSpotAndL2Tau () override
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

float m_deltaEta
 
float m_deltaPhi
 
float m_jetMaxEta
 
int m_jetMaxN
 
float m_jetMinPt
 
float m_originHalfLength
 
float m_originRadius
 
bool m_precise
 
float m_ptMin
 
bool m_searchOpt
 
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT< reco::CandidateViewtoken_jet
 
edm::EDGetTokenT< MeasurementTrackerEventtoken_measurementTracker
 

Detailed Description

class TrackingRegionsFromBeamSpotAndL2Tau plugin for creating eta-phi TrackingRegions in directions of L2 taus

Definition at line 25 of file TrackingRegionsFromBeamSpotAndL2Tau.h.

Constructor & Destructor Documentation

TrackingRegionsFromBeamSpotAndL2Tau::TrackingRegionsFromBeamSpotAndL2Tau ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)
inlineexplicit

Definition at line 29 of file TrackingRegionsFromBeamSpotAndL2Tau.h.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), RectangularEtaPhiTrackingRegion::kNever, m_deltaEta, m_deltaPhi, m_jetMaxEta, m_jetMaxN, m_jetMinPt, m_originHalfLength, m_originRadius, m_precise, m_ptMin, m_searchOpt, m_whereToUseMeasurementTracker, AlCaHLTBitMon_QueryRunRegistry::string, RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker(), token_beamSpot, token_jet, and token_measurementTracker.

31  {
32  edm::LogInfo ("TrackingRegionsFromBeamSpotAndL2Tau") << "Enter the TrackingRegionsFromBeamSpotAndL2Tau";
33 
34  edm::ParameterSet regionPSet = conf.getParameter<edm::ParameterSet>("RegionPSet");
35 
36  m_ptMin = regionPSet.getParameter<double>("ptMin");
37  m_originRadius = regionPSet.getParameter<double>("originRadius");
38  m_originHalfLength = regionPSet.getParameter<double>("originHalfLength");
39  m_deltaEta = regionPSet.getParameter<double>("deltaEta");
40  m_deltaPhi = regionPSet.getParameter<double>("deltaPhi");
42  m_jetMinPt = regionPSet.getParameter<double>("JetMinPt");
43  m_jetMaxEta = regionPSet.getParameter<double>("JetMaxEta");
44  m_jetMaxN = regionPSet.getParameter<int>("JetMaxN");
45  token_beamSpot = iC.consumes<reco::BeamSpot>(regionPSet.getParameter<edm::InputTag>("beamSpot"));
46  m_precise = regionPSet.getParameter<bool>("precise");
47 
48  if (regionPSet.exists("searchOpt")) m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
49  else m_searchOpt = false;
50 
51  m_whereToUseMeasurementTracker = RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker(regionPSet.getParameter<std::string>("whereToUseMeasurementTracker"));
53  token_measurementTracker = iC.consumes<MeasurementTrackerEvent>(regionPSet.getParameter<edm::InputTag>("measurementTrackerName"));
54  }
55  }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
edm::EDGetTokenT< reco::CandidateView > token_jet
TrackingRegionsFromBeamSpotAndL2Tau::~TrackingRegionsFromBeamSpotAndL2Tau ( )
inlineoverride

Definition at line 57 of file TrackingRegionsFromBeamSpotAndL2Tau.h.

57 {}

Member Function Documentation

static void TrackingRegionsFromBeamSpotAndL2Tau::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 59 of file TrackingRegionsFromBeamSpotAndL2Tau.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

59  {
61 
62  desc.add<double>("ptMin", 5.0);
63  desc.add<double>("originRadius", 0.2);
64  desc.add<double>("originHalfLength", 24.0);
65  desc.add<double>("deltaEta", 0.3);
66  desc.add<double>("deltaPhi", 0.3);
67  desc.add<edm::InputTag>("JetSrc", edm::InputTag("hltFilterL2EtCutDoublePFIsoTau25Trk5"));
68  desc.add<double>("JetMinPt", 25.0);
69  desc.add<double>("JetMaxEta", 2.1);
70  desc.add<int>("JetMaxN", 10);
71  desc.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"));
72  desc.add<bool>("precise", true);
73  desc.add<std::string>("howToUseMeasurementTracker", "Never");
74  desc.add<edm::InputTag>("measurementTrackerName", edm::InputTag("MeasurementTrackerEvent"));
75 
76  // Only for backwards-compatibility
78  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
79 
80  descriptions.add("trackingRegionsFromBeamSpotAndL2Tau", descRegion);
81  }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector<std::unique_ptr<TrackingRegion> > TrackingRegionsFromBeamSpotAndL2Tau::regions ( const edm::Event e,
const edm::EventSetup es 
) const
inlineoverridevirtual

Implements TrackingRegionProducer.

Definition at line 83 of file TrackingRegionsFromBeamSpotAndL2Tau.h.

References funct::abs(), reco::Candidate::eta(), edm::Event::getByToken(), mps_fire::i, edm::EDGetTokenT< T >::isUninitialized(), edm::HandleBase::isValid(), metsig::jet, m_deltaEta, m_deltaPhi, m_jetMaxEta, m_jetMaxN, m_jetMinPt, m_originHalfLength, m_originRadius, m_precise, m_ptMin, m_searchOpt, m_whereToUseMeasurementTracker, reco::Candidate::momentum(), edm::Handle< T >::product(), reco::Candidate::pt(), mps_fire::result, token_beamSpot, token_jet, token_measurementTracker, reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().

84  {
85  std::vector<std::unique_ptr<TrackingRegion> > result;
86 
87  // use beam spot to pick up the origin
89  e.getByToken( token_beamSpot, bsHandle);
90  if(!bsHandle.isValid()) return result;
91  const reco::BeamSpot & bs = *bsHandle;
92  GlobalPoint origin(bs.x0(), bs.y0(), bs.z0());
93 
94  // pick up the candidate objects of interest
96  e.getByToken( token_jet, objects );
97  size_t n_objects = objects->size();
98  if (n_objects == 0) return result;
99 
100  const MeasurementTrackerEvent *measurementTracker = nullptr;
104  measurementTracker = hmte.product();
105  }
106 
107  // create maximum JetMaxN tracking regions in directions of
108  // highest pt jets that are above threshold and are within allowed eta
109  // (we expect that jet collection was sorted in decreasing pt order)
110  int n_regions = 0;
111  for (size_t i =0; i < n_objects && n_regions < m_jetMaxN; ++i)
112  {
113  const reco::Candidate & jet = (*objects)[i];
114  if ( jet.pt() < m_jetMinPt || std::abs(jet.eta()) > m_jetMaxEta ) continue;
115 
116  GlobalVector direction(jet.momentum().x(), jet.momentum().y(), jet.momentum().z());
117 
118  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(
119  direction,
120  origin,
121  m_ptMin,
124  m_deltaEta,
125  m_deltaPhi,
127  m_precise,
128  measurementTracker,
130  ));
131  ++n_regions;
132  }
133  //std::cout<<"nregions = "<<n_regions<<std::endl;
134  return result;
135  }
double z0() const
z coordinate
Definition: BeamSpot.h:68
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
edm::EDGetTokenT< reco::CandidateView > token_jet
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
virtual double eta() const =0
momentum pseudorapidity
T const * product() const
Definition: Handle.h:81
virtual double pt() const =0
transverse momentum
virtual Vector momentum() const =0
spatial momentum vector
double y0() const
y coordinate
Definition: BeamSpot.h:66
bool isUninitialized() const
Definition: EDGetToken.h:73
double x0() const
x coordinate
Definition: BeamSpot.h:64

Member Data Documentation

float TrackingRegionsFromBeamSpotAndL2Tau::m_deltaEta
private
float TrackingRegionsFromBeamSpotAndL2Tau::m_deltaPhi
private
float TrackingRegionsFromBeamSpotAndL2Tau::m_jetMaxEta
private
int TrackingRegionsFromBeamSpotAndL2Tau::m_jetMaxN
private
float TrackingRegionsFromBeamSpotAndL2Tau::m_jetMinPt
private
float TrackingRegionsFromBeamSpotAndL2Tau::m_originHalfLength
private
float TrackingRegionsFromBeamSpotAndL2Tau::m_originRadius
private
bool TrackingRegionsFromBeamSpotAndL2Tau::m_precise
private
float TrackingRegionsFromBeamSpotAndL2Tau::m_ptMin
private
bool TrackingRegionsFromBeamSpotAndL2Tau::m_searchOpt
private
RectangularEtaPhiTrackingRegion::UseMeasurementTracker TrackingRegionsFromBeamSpotAndL2Tau::m_whereToUseMeasurementTracker
private
edm::EDGetTokenT<reco::BeamSpot> TrackingRegionsFromBeamSpotAndL2Tau::token_beamSpot
private
edm::EDGetTokenT<reco::CandidateView> TrackingRegionsFromBeamSpotAndL2Tau::token_jet
private
edm::EDGetTokenT<MeasurementTrackerEvent> TrackingRegionsFromBeamSpotAndL2Tau::token_measurementTracker
private