CMS 3D CMS Logo

TauRegionalPixelSeedGenerator.h
Go to the documentation of this file.
1 #ifndef TauRegionalPixelSeedGenerator_h
2 #define TauRegionalPixelSeedGenerator_h
3 
4 //
5 // Class: TauRegionalPixelSeedGenerator
6 
24 // Math
25 #include "Math/GenVector/VectorUtil.h"
26 #include "Math/GenVector/PxPyPzE4D.h"
27 
29 
32 
34 public:
36  edm::LogInfo("TauRegionalPixelSeedGenerator") << "Enter the TauRegionalPixelSeedGenerator";
37 
38  edm::ParameterSet regionPSet = conf_.getParameter<edm::ParameterSet>("RegionPSet");
39 
40  m_ptMin = regionPSet.getParameter<double>("ptMin");
41  m_originRadius = regionPSet.getParameter<double>("originRadius");
42  m_halfLength = regionPSet.getParameter<double>("originHalfLength");
43  m_deltaEta = regionPSet.getParameter<double>("deltaEtaRegion");
44  m_deltaPhi = regionPSet.getParameter<double>("deltaPhiRegion");
45  token_jet = iC.consumes<reco::CandidateView>(regionPSet.getParameter<edm::InputTag>("JetSrc"));
46  token_vertex = iC.consumes<reco::VertexCollection>(regionPSet.getParameter<edm::InputTag>("vertexSrc"));
47  if (regionPSet.exists("searchOpt")) {
48  m_searchOpt = regionPSet.getParameter<bool>("searchOpt");
49  } else {
50  m_searchOpt = false;
51  }
53  regionPSet.getParameter<std::string>("howToUseMeasurementTracker"));
55  // temporary until everything migrated to InputTag
57  if (regionPSet.existsAs<edm::InputTag>("measurementTrackerName")) {
58  tag = regionPSet.getParameter<edm::InputTag>("measurementTrackerName");
59  } else {
60  tag = edm::InputTag(regionPSet.getParameter<std::string>("measurementTrackerName"));
61  }
62 
64  }
65  }
66 
68 
69  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
71 
72  desc.add<double>("ptMin", 5.0);
73  desc.add<double>("originHalfLength", 0.2);
74  desc.add<double>("originRadius", 0.2);
75  desc.add<double>("deltaEtaRegion", 0.1);
76  desc.add<double>("deltaPhiRegion", 0.1);
77  desc.add<edm::InputTag>("JetSrc", edm::InputTag("icone5Tau1"));
78  desc.add<edm::InputTag>("vertexSrc", edm::InputTag("pixelVertices"));
79  desc.add<bool>("searchOpt", false);
80 
81  desc.add<std::string>("howToUseMeasurementTracker", "ForSiStrips");
82 
83  // allow both InputTag and string for the moment, use InputTag as the default
85  "measurementTrackerName", edm::InputTag("MeasurementTrackerEvent"), true) xor
86  edm::ParameterDescription<std::string>("measurementTrackerName", "MeasurementTrackerEvent", true));
87 
88  // Only for backwards-compatibility
90  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
91 
92  descriptions.add("tauRegionalPixelSeedTrackingRegions", descRegion);
93  }
94 
95  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& e, const edm::EventSetup& es) const override {
96  std::vector<std::unique_ptr<TrackingRegion> > result;
97 
98  // double originZ;
99  double deltaZVertex, deltaRho;
101  // get the primary vertex
103  e.getByToken(token_vertex, h_vertices);
104  const reco::VertexCollection& vertices = *h_vertices;
105  if (not vertices.empty()) {
106  // originZ = vertices.front().z();
107  GlobalPoint myTmp(vertices.at(0).position().x(), vertices.at(0).position().y(), vertices.at(0).position().z());
108  vertex = myTmp;
109  deltaZVertex = m_halfLength;
110  deltaRho = m_originRadius;
111  } else {
112  // originZ = 0.;
113  GlobalPoint myTmp(0., 0., 0.);
114  vertex = myTmp;
115  deltaRho = 1.;
116  deltaZVertex = 15.;
117  }
118 
119  // get the jet direction
121  e.getByToken(token_jet, h_jets);
122 
126  e.getByToken(token_measurementTracker, hmte);
127  measurementTracker = hmte.product();
128  }
129 
130  for (const reco::Candidate& myJet : *h_jets) {
131  GlobalVector jetVector(myJet.momentum().x(), myJet.momentum().y(), myJet.momentum().z());
132  // GlobalPoint vertex(0, 0, originZ);
133  result.push_back(std::make_unique<RectangularEtaPhiTrackingRegion>(jetVector,
134  vertex,
135  m_ptMin,
136  deltaRho,
137  deltaZVertex,
138  m_deltaEta,
139  m_deltaPhi,
141  true,
143  m_searchOpt));
144  }
145 
146  return result;
147  }
148 
149 private:
151 
152  float m_ptMin;
155  float m_deltaEta;
156  float m_deltaPhi;
162 };
163 
164 #endif
TauRegionalPixelSeedGenerator::m_halfLength
float m_halfLength
Definition: TauRegionalPixelSeedGenerator.h:154
Vector3DBase
Definition: Vector3DBase.h:8
ConfigurationDescriptions.h
CaloJetCollection.h
Handle.h
GlobalTrackingRegion.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MeasurementTrackerEvent.h
TauRegionalPixelSeedGenerator
Definition: TauRegionalPixelSeedGenerator.h:33
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EDProducer.h
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
edm::EDGetTokenT< reco::VertexCollection >
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
Jet.h
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
edm::Handle< reco::VertexCollection >
TauRegionalPixelSeedGenerator::m_ptMin
float m_ptMin
Definition: TauRegionalPixelSeedGenerator.h:152
TrackingRegionProducer.h
TauRegionalPixelSeedGenerator::conf_
edm::ParameterSet conf_
Definition: TauRegionalPixelSeedGenerator.h:150
TauRegionalPixelSeedGenerator::token_measurementTracker
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
Definition: TauRegionalPixelSeedGenerator.h:159
Track.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TauRegionalPixelSeedGenerator::TauRegionalPixelSeedGenerator
TauRegionalPixelSeedGenerator(const edm::ParameterSet &conf_, edm::ConsumesCollector &&iC)
Definition: TauRegionalPixelSeedGenerator.h:35
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
edm::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
TauRegionalPixelSeedGenerator::m_deltaPhi
float m_deltaPhi
Definition: TauRegionalPixelSeedGenerator.h:156
Point3DBase< float, GlobalTag >
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
edm::View
Definition: CaloClusterFwd.h:14
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
TauRegionalPixelSeedGenerator::token_vertex
edm::EDGetTokenT< reco::VertexCollection > token_vertex
Definition: TauRegionalPixelSeedGenerator.h:157
TauRegionalPixelSeedGenerator::m_originRadius
float m_originRadius
Definition: TauRegionalPixelSeedGenerator.h:153
RectangularEtaPhiTrackingRegion.h
TauRegionalPixelSeedGenerator::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TauRegionalPixelSeedGenerator.h:69
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSetDescription::addNode
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
Definition: ParameterSetDescription.cc:41
RectangularEtaPhiTrackingRegion::UseMeasurementTracker
UseMeasurementTracker
Definition: RectangularEtaPhiTrackingRegion.h:27
InputTag.h
reco::Candidate
Definition: Candidate.h:27
VertexFwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Ref.h
TauRegionalPixelSeedGenerator::m_howToUseMeasurementTracker
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_howToUseMeasurementTracker
Definition: TauRegionalPixelSeedGenerator.h:160
TrackingRegionProducer
Definition: TrackingRegionProducer.h:12
TauRegionalPixelSeedGenerator::regions
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const override
Definition: TauRegionalPixelSeedGenerator.h:95
TauRegionalPixelSeedGenerator::~TauRegionalPixelSeedGenerator
~TauRegionalPixelSeedGenerator() override
Definition: TauRegionalPixelSeedGenerator.h:67
EventSetup.h
mps_fire.result
result
Definition: mps_fire.py:303
ConsumesCollector.h
ParameterSet.h
TauRegionalPixelSeedGenerator::m_searchOpt
bool m_searchOpt
Definition: TauRegionalPixelSeedGenerator.h:161
edm::Event
Definition: Event.h:73
Vector3D.h
TauRegionalPixelSeedGenerator::token_jet
edm::EDGetTokenT< reco::CandidateView > token_jet
Definition: TauRegionalPixelSeedGenerator.h:158
edm::ParameterDescription
Definition: ParameterDescription.h:110
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
RectangularEtaPhiTrackingRegion::stringToUseMeasurementTracker
static UseMeasurementTracker stringToUseMeasurementTracker(const std::string &name)
Definition: RectangularEtaPhiTrackingRegion.cc:50
TauRegionalPixelSeedGenerator::m_deltaEta
float m_deltaEta
Definition: TauRegionalPixelSeedGenerator.h:155
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37