CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TrackingRegionsFromSuperClustersProducer Class Reference
Inheritance diagram for TrackingRegionsFromSuperClustersProducer:
TrackingRegionProducer

Public Types

enum  Charge { Charge::NEG = -1, Charge::POS = +1 }
 

Public Member Functions

std::vector< std::unique_ptr< TrackingRegion > > regions (const edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 
 TrackingRegionsFromSuperClustersProducer (const edm::ParameterSet &cfg, edm::ConsumesCollector &&cc)
 
 ~TrackingRegionsFromSuperClustersProducer () override
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

std::unique_ptr< TrackingRegioncreateTrackingRegion (const reco::SuperCluster &superCluster, const GlobalPoint &vtxPos, const double deltaZVertex, const Charge charge, const MeasurementTrackerEvent *measTrackerEvent, const MagneticField &magField) const
 
GlobalPoint getVtxPos (const edm::Event &iEvent, double &deltaZVertex) const
 
void validateConfigSettings () const
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
double defaultZ_
 
double deltaEtaRegion_
 
double deltaPhiRegion_
 
edm::EDGetTokenT< MeasurementTrackerEventmeasTrackerEventToken_
 
double minBSDeltaZ_
 
double nrSigmaForBSDeltaZ_
 
double originHalfLength_
 
double originRadius_
 
bool precise_
 
double ptMin_
 
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
 
bool useZInBeamspot_
 
bool useZInVertex_
 
edm::EDGetTokenT< reco::VertexCollectionverticesToken_
 
RectangularEtaPhiTrackingRegion::UseMeasurementTracker whereToUseMeasTracker_
 

Detailed Description

Definition at line 84 of file TrackingRegionsFromSuperClustersProducer.cc.

Member Enumeration Documentation

◆ Charge

Enumerator
NEG 
POS 

Definition at line 86 of file TrackingRegionsFromSuperClustersProducer.cc.

86 { NEG = -1, POS = +1 };

Constructor & Destructor Documentation

◆ TrackingRegionsFromSuperClustersProducer()

TrackingRegionsFromSuperClustersProducer::TrackingRegionsFromSuperClustersProducer ( const edm::ParameterSet cfg,
edm::ConsumesCollector &&  cc 
)

Definition at line 146 of file TrackingRegionsFromSuperClustersProducer.cc.

147  {
148  edm::ParameterSet regionPSet = cfg.getParameter<edm::ParameterSet>("RegionPSet");
149 
150  ptMin_ = regionPSet.getParameter<double>("ptMin");
151  originRadius_ = regionPSet.getParameter<double>("originRadius");
152  originHalfLength_ = regionPSet.getParameter<double>("originHalfLength");
153  deltaPhiRegion_ = regionPSet.getParameter<double>("deltaPhiRegion");
154  deltaEtaRegion_ = regionPSet.getParameter<double>("deltaEtaRegion");
155  useZInVertex_ = regionPSet.getParameter<bool>("useZInVertex");
156  useZInBeamspot_ = regionPSet.getParameter<bool>("useZInBeamspot");
157  nrSigmaForBSDeltaZ_ = regionPSet.getParameter<double>("nrSigmaForBSDeltaZ");
158  defaultZ_ = regionPSet.getParameter<double>("defaultZ");
159  minBSDeltaZ_ = regionPSet.getParameter<double>("minBSDeltaZ");
160  precise_ = regionPSet.getParameter<bool>("precise");
161  whereToUseMeasTracker_ = strToEnum<RectangularEtaPhiTrackingRegion::UseMeasurementTracker>(
162  regionPSet.getParameter<std::string>("whereToUseMeasTracker"));
163 
165 
166  auto verticesTag = regionPSet.getParameter<edm::InputTag>("vertices");
167  auto beamSpotTag = regionPSet.getParameter<edm::InputTag>("beamSpot");
168  auto superClustersTags = regionPSet.getParameter<std::vector<edm::InputTag>>("superClusters");
169  auto measTrackerEventTag = regionPSet.getParameter<edm::InputTag>("measurementTrackerEvent");
170 
171  if (useZInVertex_) {
172  verticesToken_ = iC.consumes<reco::VertexCollection>(verticesTag);
173  } else {
174  beamSpotToken_ = iC.consumes<reco::BeamSpot>(beamSpotTag);
175  }
177  measTrackerEventToken_ = iC.consumes<MeasurementTrackerEvent>(measTrackerEventTag);
178  }
179  for (const auto& tag : superClustersTags) {
180  superClustersTokens_.emplace_back(iC.consumes<std::vector<reco::SuperClusterRef>>(tag));
181  }
182 }

References AlignmentProducer_cff::beamSpotTag, beamSpotToken_, looper::cfg, defaultZ_, deltaEtaRegion_, deltaPhiRegion_, edm::ParameterSet::getParameter(), RectangularEtaPhiTrackingRegion::kNever, measTrackerEventToken_, minBSDeltaZ_, nrSigmaForBSDeltaZ_, originHalfLength_, originRadius_, precise_, ptMin_, AlCaHLTBitMon_QueryRunRegistry::string, superClustersTokens_, GlobalPosition_Frontier_DevDB_cff::tag, useZInBeamspot_, useZInVertex_, validateConfigSettings(), verticesToken_, and whereToUseMeasTracker_.

◆ ~TrackingRegionsFromSuperClustersProducer()

TrackingRegionsFromSuperClustersProducer::~TrackingRegionsFromSuperClustersProducer ( )
inlineoverride

Definition at line 91 of file TrackingRegionsFromSuperClustersProducer.cc.

91 {}

Member Function Documentation

◆ createTrackingRegion()

std::unique_ptr< TrackingRegion > TrackingRegionsFromSuperClustersProducer::createTrackingRegion ( const reco::SuperCluster superCluster,
const GlobalPoint vtxPos,
const double  deltaZVertex,
const Charge  charge,
const MeasurementTrackerEvent measTrackerEvent,
const MagneticField magField 
) const
private

Definition at line 278 of file TrackingRegionsFromSuperClustersProducer.cc.

284  {
285  const GlobalPoint clusterPos(superCluster.position().x(), superCluster.position().y(), superCluster.position().z());
286  const double energy = superCluster.energy();
287 
288  auto fts = trackingTools::ftsFromVertexToPoint(magField, clusterPos, vtxPos, energy, static_cast<int>(charge));
289  return std::make_unique<RectangularEtaPhiTrackingRegion>(fts.momentum(),
290  vtxPos,
291  ptMin_,
293  deltaZVertex,
297  precise_,
298  measTrackerEvent);
299 }

References ALCARECOTkAlJpsiMuMu_cff::charge, deltaEtaRegion_, deltaPhiRegion_, HCALHighEnergyHPDFilter_cfi::energy, reco::CaloCluster::energy(), trackingTools::ftsFromVertexToPoint(), originRadius_, reco::CaloCluster::position(), precise_, ptMin_, and whereToUseMeasTracker_.

Referenced by regions().

◆ fillDescriptions()

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

Definition at line 184 of file TrackingRegionsFromSuperClustersProducer.cc.

184  {
186 
187  desc.add<double>("ptMin", 1.5);
188  desc.add<double>("originRadius", 0.2);
189  desc.add<double>("originHalfLength", 15.0)
190  ->setComment("z range is +/- this value except when using the beamspot (useZInBeamspot=true)");
191  desc.add<double>("deltaPhiRegion", 0.4);
192  desc.add<double>("deltaEtaRegion", 0.1);
193  desc.add<bool>("useZInVertex", false)
194  ->setComment("use the leading vertex position +/-orginHalfLength, mutually exclusive with useZInBeamspot");
195  desc.add<bool>("useZInBeamspot", true)
196  ->setComment(
197  "use the beamspot position +/- nrSigmaForBSDeltaZ* sigmaZ_{bs}, mutually exclusive with useZInVertex");
198  desc.add<double>("nrSigmaForBSDeltaZ", 3.0)
199  ->setComment("# of sigma to extend the z region when using the beamspot, only active if useZInBeamspot=true");
200  desc.add<double>("minBSDeltaZ", 0.0)
201  ->setComment("a minimum value of the beamspot sigma z to use, only active if useZInBeamspot=true");
202  desc.add<double>("defaultZ", 0.)
203  ->setComment("the default z position, only used if useZInVertex and useZInBeamspot are both false");
204  desc.add<bool>("precise", true);
205  desc.add<std::string>("whereToUseMeasTracker", "kNever");
206  desc.add<edm::InputTag>("beamSpot", edm::InputTag("hltOnlineBeamSpot"))
207  ->setComment("only used if useZInBeamspot is true");
208  desc.add<edm::InputTag>("vertices", edm::InputTag())->setComment("only used if useZInVertex is true");
209  desc.add<std::vector<edm::InputTag>>("superClusters",
210  std::vector<edm::InputTag>{edm::InputTag{"hltEgammaSuperClustersToPixelMatch"}});
211  desc.add<edm::InputTag>("measurementTrackerEvent", edm::InputTag());
212 
213  edm::ParameterSetDescription descRegion;
214  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
215 
216  descriptions.add("trackingRegionsFromSuperClusters", descRegion);
217 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, edm::ParameterDescriptionNode::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ getVtxPos()

GlobalPoint TrackingRegionsFromSuperClustersProducer::getVtxPos ( const edm::Event iEvent,
double &  deltaZVertex 
) const
private

Definition at line 246 of file TrackingRegionsFromSuperClustersProducer.cc.

246  {
247  if (useZInVertex_) {
248  auto verticesHandle = getHandle(iEvent, verticesToken_);
249  //we throw if the vertices are not there but if no vertex is
250  //recoed in the event, we default to 0,0,defaultZ as the vertex
251  if (!verticesHandle->empty()) {
252  deltaZVertex = originHalfLength_;
253  const auto& pv = verticesHandle->front();
254  return GlobalPoint(pv.x(), pv.y(), pv.z());
255  } else {
256  deltaZVertex = originHalfLength_;
257  return GlobalPoint(0, 0, defaultZ_);
258  }
259  } else {
260  auto beamSpotHandle = getHandle(iEvent, beamSpotToken_);
261  const reco::BeamSpot::Point& bsPos = beamSpotHandle->position();
262 
263  if (useZInBeamspot_) {
264  //as this is what has been done traditionally for e/gamma, others just use sigmaZ
265  const double bsSigmaZ = std::sqrt(beamSpotHandle->sigmaZ() * beamSpotHandle->sigmaZ() +
266  beamSpotHandle->sigmaZ0Error() * beamSpotHandle->sigmaZ0Error());
267  const double sigmaZ = std::max(bsSigmaZ, minBSDeltaZ_);
268  deltaZVertex = nrSigmaForBSDeltaZ_ * sigmaZ;
269 
270  return GlobalPoint(bsPos.x(), bsPos.y(), bsPos.z());
271  } else {
272  deltaZVertex = originHalfLength_;
273  return GlobalPoint(bsPos.x(), bsPos.y(), defaultZ_);
274  }
275  }
276 }

References beamSpotToken_, qcdUeDQM_cfi::bsPos, defaultZ_, iEvent, SiStripPI::max, minBSDeltaZ_, nrSigmaForBSDeltaZ_, originHalfLength_, MetAnalyzer::pv(), fftjetvertexadder_cfi::sigmaZ, mathSSE::sqrt(), useZInBeamspot_, useZInVertex_, and verticesToken_.

Referenced by regions().

◆ regions()

std::vector< std::unique_ptr< TrackingRegion > > TrackingRegionsFromSuperClustersProducer::regions ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements TrackingRegionProducer.

Definition at line 219 of file TrackingRegionsFromSuperClustersProducer.cc.

220  {
221  std::vector<std::unique_ptr<TrackingRegion>> trackingRegions;
222 
223  double deltaZVertex = 0;
224  GlobalPoint vtxPos = getVtxPos(iEvent, deltaZVertex);
225 
226  const MeasurementTrackerEvent* measTrackerEvent = nullptr;
228  measTrackerEvent = getHandle(iEvent, measTrackerEventToken_).product();
229  }
230  edm::ESHandle<MagneticField> magFieldHandle;
231  iSetup.get<IdealMagneticFieldRecord>().get(magFieldHandle);
232 
233  for (auto& superClustersToken : superClustersTokens_) {
234  auto superClustersHandle = getHandle(iEvent, superClustersToken);
235  for (auto& superClusterRef : *superClustersHandle) {
236  //do both charge hypothesises
237  trackingRegions.emplace_back(
238  createTrackingRegion(*superClusterRef, vtxPos, deltaZVertex, Charge::POS, measTrackerEvent, *magFieldHandle));
239  trackingRegions.emplace_back(
240  createTrackingRegion(*superClusterRef, vtxPos, deltaZVertex, Charge::NEG, measTrackerEvent, *magFieldHandle));
241  }
242  }
243  return trackingRegions;
244 }

References createTrackingRegion(), edm::EventSetup::get(), get, getVtxPos(), iEvent, edm::EDGetTokenT< T >::isUninitialized(), measTrackerEventToken_, NEG, POS, superClustersTokens_, and hltSeeds_cff::trackingRegions.

◆ validateConfigSettings()

void TrackingRegionsFromSuperClustersProducer::validateConfigSettings ( ) const
private

Definition at line 301 of file TrackingRegionsFromSuperClustersProducer.cc.

301  {
303  throw cms::Exception("InvalidConfiguration")
304  << " when constructing TrackingRegionsFromSuperClustersProducer both useZInVertex (" << useZInVertex_
305  << ") and useZInBeamspot (" << useZInBeamspot_ << ") can not be true as they are mutually exclusive options"
306  << std::endl;
307  }
308 }

References Exception, useZInBeamspot_, and useZInVertex_.

Referenced by TrackingRegionsFromSuperClustersProducer().

Member Data Documentation

◆ beamSpotToken_

edm::EDGetTokenT<reco::BeamSpot> TrackingRegionsFromSuperClustersProducer::beamSpotToken_
private

◆ defaultZ_

double TrackingRegionsFromSuperClustersProducer::defaultZ_
private

◆ deltaEtaRegion_

double TrackingRegionsFromSuperClustersProducer::deltaEtaRegion_
private

◆ deltaPhiRegion_

double TrackingRegionsFromSuperClustersProducer::deltaPhiRegion_
private

◆ measTrackerEventToken_

edm::EDGetTokenT<MeasurementTrackerEvent> TrackingRegionsFromSuperClustersProducer::measTrackerEventToken_
private

◆ minBSDeltaZ_

double TrackingRegionsFromSuperClustersProducer::minBSDeltaZ_
private

◆ nrSigmaForBSDeltaZ_

double TrackingRegionsFromSuperClustersProducer::nrSigmaForBSDeltaZ_
private

◆ originHalfLength_

double TrackingRegionsFromSuperClustersProducer::originHalfLength_
private

◆ originRadius_

double TrackingRegionsFromSuperClustersProducer::originRadius_
private

◆ precise_

bool TrackingRegionsFromSuperClustersProducer::precise_
private

◆ ptMin_

double TrackingRegionsFromSuperClustersProducer::ptMin_
private

◆ superClustersTokens_

std::vector<edm::EDGetTokenT<std::vector<reco::SuperClusterRef> > > TrackingRegionsFromSuperClustersProducer::superClustersTokens_
private

◆ useZInBeamspot_

bool TrackingRegionsFromSuperClustersProducer::useZInBeamspot_
private

◆ useZInVertex_

bool TrackingRegionsFromSuperClustersProducer::useZInVertex_
private

◆ verticesToken_

edm::EDGetTokenT<reco::VertexCollection> TrackingRegionsFromSuperClustersProducer::verticesToken_
private

◆ whereToUseMeasTracker_

RectangularEtaPhiTrackingRegion::UseMeasurementTracker TrackingRegionsFromSuperClustersProducer::whereToUseMeasTracker_
private
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
TrackingRegionsFromSuperClustersProducer::originHalfLength_
double originHalfLength_
Definition: TrackingRegionsFromSuperClustersProducer.cc:120
TrackingRegionsFromSuperClustersProducer::deltaPhiRegion_
double deltaPhiRegion_
Definition: TrackingRegionsFromSuperClustersProducer.cc:122
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackingRegionsFromSuperClustersProducer::getVtxPos
GlobalPoint getVtxPos(const edm::Event &iEvent, double &deltaZVertex) const
Definition: TrackingRegionsFromSuperClustersProducer.cc:246
TrackingRegionsFromSuperClustersProducer::nrSigmaForBSDeltaZ_
double nrSigmaForBSDeltaZ_
Definition: TrackingRegionsFromSuperClustersProducer.cc:125
TrackingRegionsFromSuperClustersProducer::Charge::NEG
TrackingRegionsFromSuperClustersProducer::precise_
bool precise_
Definition: TrackingRegionsFromSuperClustersProducer.cc:128
TrackingRegionsFromSuperClustersProducer::verticesToken_
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
Definition: TrackingRegionsFromSuperClustersProducer.cc:131
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TrackingRegionsFromSuperClustersProducer::useZInVertex_
bool useZInVertex_
Definition: TrackingRegionsFromSuperClustersProducer.cc:123
TrackingRegionsFromSuperClustersProducer::ptMin_
double ptMin_
Definition: TrackingRegionsFromSuperClustersProducer.cc:118
trackingTools::ftsFromVertexToPoint
FreeTrajectoryState ftsFromVertexToPoint(MagneticField const &magField, GlobalPoint const &xmeas, GlobalPoint const &xvert, float momentum, TrackCharge charge)
Definition: ftsFromVertexToPoint.cc:17
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
edm::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TrackingRegionsFromSuperClustersProducer::createTrackingRegion
std::unique_ptr< TrackingRegion > createTrackingRegion(const reco::SuperCluster &superCluster, const GlobalPoint &vtxPos, const double deltaZVertex, const Charge charge, const MeasurementTrackerEvent *measTrackerEvent, const MagneticField &magField) const
Definition: TrackingRegionsFromSuperClustersProducer.cc:278
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ESHandle< MagneticField >
TrackingRegionsFromSuperClustersProducer::beamSpotToken_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackingRegionsFromSuperClustersProducer.cc:132
TrackingRegionsFromSuperClustersProducer::Charge::POS
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
AlignmentProducer_cff.beamSpotTag
beamSpotTag
Definition: AlignmentProducer_cff.py:50
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
qcdUeDQM_cfi.bsPos
bsPos
Definition: qcdUeDQM_cfi.py:39
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackingRegionsFromSuperClustersProducer::superClustersTokens_
std::vector< edm::EDGetTokenT< std::vector< reco::SuperClusterRef > > > superClustersTokens_
Definition: TrackingRegionsFromSuperClustersProducer.cc:134
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
RectangularEtaPhiTrackingRegion::UseMeasurementTracker::kNever
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
TrackingRegionsFromSuperClustersProducer::useZInBeamspot_
bool useZInBeamspot_
Definition: TrackingRegionsFromSuperClustersProducer.cc:124
TrackingRegionsFromSuperClustersProducer::originRadius_
double originRadius_
Definition: TrackingRegionsFromSuperClustersProducer.cc:119
TrackingRegionsFromSuperClustersProducer::whereToUseMeasTracker_
RectangularEtaPhiTrackingRegion::UseMeasurementTracker whereToUseMeasTracker_
Definition: TrackingRegionsFromSuperClustersProducer.cc:129
get
#define get
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
looper.cfg
cfg
Definition: looper.py:297
TrackingRegionsFromSuperClustersProducer::minBSDeltaZ_
double minBSDeltaZ_
Definition: TrackingRegionsFromSuperClustersProducer.cc:127
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Exception
Definition: hltDiff.cc:246
TrackingRegionsFromSuperClustersProducer::validateConfigSettings
void validateConfigSettings() const
Definition: TrackingRegionsFromSuperClustersProducer.cc:301
TrackingRegionsFromSuperClustersProducer::measTrackerEventToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measTrackerEventToken_
Definition: TrackingRegionsFromSuperClustersProducer.cc:133
TrackingRegionsFromSuperClustersProducer::defaultZ_
double defaultZ_
Definition: TrackingRegionsFromSuperClustersProducer.cc:126
TrackingRegionsFromSuperClustersProducer::deltaEtaRegion_
double deltaEtaRegion_
Definition: TrackingRegionsFromSuperClustersProducer.cc:121
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
hltSeeds_cff.trackingRegions
trackingRegions
Definition: hltSeeds_cff.py:12
fftjetvertexadder_cfi.sigmaZ
sigmaZ
Definition: fftjetvertexadder_cfi.py:32
reco::CaloCluster::energy
double energy() const
cluster energy
Definition: CaloCluster.h:149
edm::InputTag
Definition: InputTag.h:15