CMS 3D CMS Logo

TrackingRegionsFromBeamSpotAndL2Tau.h
Go to the documentation of this file.
1 #ifndef TrackingRegionsFromBeamSpotAndL2Tau_h
2 #define TrackingRegionsFromBeamSpotAndL2Tau_h
3 
4 //
5 // Class: TrackingRegionsFromBeamSpotAndL2Tau
6 //
7 
11 
21 
26 public:
28  edm::LogInfo("TrackingRegionsFromBeamSpotAndL2Tau") << "Enter the TrackingRegionsFromBeamSpotAndL2Tau";
29 
30  edm::ParameterSet regionPSet = conf.getParameter<edm::ParameterSet>("RegionPSet");
31 
32  m_ptMin = regionPSet.getParameter<double>("ptMin");
33  m_originRadius = regionPSet.getParameter<double>("originRadius");
34  m_originHalfLength = regionPSet.getParameter<double>("originHalfLength");
35  m_deltaEta = regionPSet.getParameter<double>("deltaEta");
36  m_deltaPhi = regionPSet.getParameter<double>("deltaPhi");
37  token_jet = iC.consumes<reco::CandidateView>(regionPSet.getParameter<edm::InputTag>("JetSrc"));
38  m_jetMinPt = regionPSet.getParameter<double>("JetMinPt");
39  m_jetMaxEta = regionPSet.getParameter<double>("JetMaxEta");
40  m_jetMaxN = regionPSet.getParameter<int>("JetMaxN");
41  token_beamSpot = iC.consumes<reco::BeamSpot>(regionPSet.getParameter<edm::InputTag>("beamSpot"));
42  m_precise = regionPSet.getParameter<bool>("precise");
43 
44  if (regionPSet.exists("searchOpt"))
45  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
46  else
47  m_searchOpt = false;
48 
50  regionPSet.getParameter<std::string>("whereToUseMeasurementTracker"));
53  iC.consumes<MeasurementTrackerEvent>(regionPSet.getParameter<edm::InputTag>("measurementTrackerName"));
54  }
55  }
56 
58 
59  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
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  }
82 
83  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& e, const edm::EventSetup& es) const override {
84  std::vector<std::unique_ptr<TrackingRegion> > result;
85 
86  // use beam spot to pick up the origin
88  e.getByToken(token_beamSpot, bsHandle);
89  if (!bsHandle.isValid())
90  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)
99  return result;
100 
104  e.getByToken(token_measurementTracker, hmte);
105  measurementTracker = hmte.product();
106  }
107 
108  // create maximum JetMaxN tracking regions in directions of
109  // highest pt jets that are above threshold and are within allowed eta
110  // (we expect that jet collection was sorted in decreasing pt order)
111  int n_regions = 0;
112  for (size_t i = 0; i < n_objects && n_regions < m_jetMaxN; ++i) {
113  const reco::Candidate& jet = (*objects)[i];
114  if (jet.pt() < m_jetMinPt || std::abs(jet.eta()) > m_jetMaxEta)
115  continue;
116 
117  GlobalVector direction(jet.momentum().x(), jet.momentum().y(), jet.momentum().z());
118 
119  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(direction,
120  origin,
121  m_ptMin,
124  m_deltaEta,
125  m_deltaPhi,
127  m_precise,
129  m_searchOpt));
130  ++n_regions;
131  }
132  //std::cout<<"nregions = "<<n_regions<<std::endl;
133  return result;
134  }
135 
136 private:
137  float m_ptMin;
140  float m_deltaEta;
141  float m_deltaPhi;
143  float m_jetMinPt;
144  float m_jetMaxEta;
150  bool m_precise;
151 };
152 
153 #endif
Vector3DBase
Definition: Vector3DBase.h:8
ConfigurationDescriptions.h
TrackingRegionsFromBeamSpotAndL2Tau::m_searchOpt
bool m_searchOpt
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:148
Handle.h
mps_fire.i
i
Definition: mps_fire.py:428
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MeasurementTrackerEvent.h
TrackingRegionsFromBeamSpotAndL2Tau::m_jetMinPt
float m_jetMinPt
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:143
TrackingRegionsFromBeamSpotAndL2Tau
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:25
edm::Handle::product
T const * product() const
Definition: Handle.h:70
TrackingRegionsFromBeamSpotAndL2Tau::m_originRadius
float m_originRadius
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:138
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
TrackingRegionsFromBeamSpotAndL2Tau::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:59
TrackingRegionsFromBeamSpotAndL2Tau::m_deltaPhi
float m_deltaPhi
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:141
edm::EDGetTokenT
Definition: EDGetToken.h:33
objects
Definition: __init__.py:1
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackingRegionsFromBeamSpotAndL2Tau::m_jetMaxN
int m_jetMaxN
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:145
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< reco::BeamSpot >
TrackingRegionsFromBeamSpotAndL2Tau::token_measurementTracker
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:146
TrackingRegionsFromBeamSpotAndL2Tau::m_originHalfLength
float m_originHalfLength
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:139
TrackingRegionsFromBeamSpotAndL2Tau::token_jet
edm::EDGetTokenT< reco::CandidateView > token_jet
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:142
TrackingRegionProducer.h
cms::cuda::bs
bs
Definition: HistoContainer.h:76
BeamSpot.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TrackingRegionsFromBeamSpotAndL2Tau::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const override
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:83
reco::BeamSpot
Definition: BeamSpot.h:21
Point3DBase< float, GlobalTag >
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
TrackingRegionsFromBeamSpotAndL2Tau::m_jetMaxEta
float m_jetMaxEta
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:144
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::View
Definition: CaloClusterFwd.h:14
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
TrackingRegionsFromBeamSpotAndL2Tau::m_precise
bool m_precise
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:150
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
RectangularEtaPhiTrackingRegion.h
edm::EventSetup
Definition: EventSetup.h:58
RectangularEtaPhiTrackingRegion::UseMeasurementTracker
UseMeasurementTracker
Definition: RectangularEtaPhiTrackingRegion.h:27
hgcalPerformanceValidation.objects
objects
Definition: hgcalPerformanceValidation.py:791
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
reco::Candidate
Definition: Candidate.h:27
TrackingRegionsFromBeamSpotAndL2Tau::~TrackingRegionsFromBeamSpotAndL2Tau
~TrackingRegionsFromBeamSpotAndL2Tau() override
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:57
TrackingRegionsFromBeamSpotAndL2Tau::m_ptMin
float m_ptMin
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:137
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
metsig::jet
Definition: SignAlgoResolutions.h:47
TrackingRegionsFromBeamSpotAndL2Tau::m_deltaEta
float m_deltaEta
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:140
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
TrackingRegionsFromBeamSpotAndL2Tau::TrackingRegionsFromBeamSpotAndL2Tau
TrackingRegionsFromBeamSpotAndL2Tau(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:27
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
Candidate.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
Definition: RectangularEtaPhiTrackingRegion.cc:82
TrackingRegionsFromBeamSpotAndL2Tau::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:149
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TrackingRegionsFromBeamSpotAndL2Tau::m_whereToUseMeasurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
Definition: TrackingRegionsFromBeamSpotAndL2Tau.h:147