CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ticl::SeedingRegionByTracks Class Referencefinal

#include <SeedingRegionByTracks.h>

Inheritance diagram for ticl::SeedingRegionByTracks:
ticl::SeedingRegionAlgoBase

Public Member Functions

void initialize (const edm::EventSetup &es) override
 
void makeRegions (const edm::Event &ev, const edm::EventSetup &es, std::vector< TICLSeedingRegion > &result) override
 
 SeedingRegionByTracks (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
 ~SeedingRegionByTracks () override
 
- Public Member Functions inherited from ticl::SeedingRegionAlgoBase
 SeedingRegionAlgoBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
virtual ~SeedingRegionAlgoBase ()
 

Static Public Member Functions

static void fillPSetDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from ticl::SeedingRegionAlgoBase
static void fillPSetDescription (edm::ParameterSetDescription &desc)
 

Private Member Functions

void buildFirstLayers ()
 

Private Attributes

edm::ESHandle< MagneticFieldbfield_
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordbfield_token_
 
const StringCutObjectSelector< reco::TrackcutTk_
 
const std::string detector_
 
std::unique_ptr< GeomDetfirstDisk_ [2]
 
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecordhdc_token_
 
const HGCalDDDConstantshgcons_
 
std::once_flag initializeGeometry_
 
edm::ESHandle< Propagatorpropagator_
 
edm::ESGetToken< Propagator, TrackingComponentsRecordpropagator_token_
 
const std::string propName_
 
edm::EDGetTokenT< reco::TrackCollectiontracks_token_
 

Additional Inherited Members

- Protected Attributes inherited from ticl::SeedingRegionAlgoBase
int algo_verbosity_
 
int algoId_
 

Detailed Description

Definition at line 31 of file SeedingRegionByTracks.h.

Constructor & Destructor Documentation

◆ SeedingRegionByTracks()

SeedingRegionByTracks::SeedingRegionByTracks ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)

Definition at line 16 of file SeedingRegionByTracks.cc.

References edm::BeginRun, detector_, edm::ConsumesCollector::esConsumes(), hdc_token_, and AlCaHLTBitMon_QueryRunRegistry::string.

17  : SeedingRegionAlgoBase(conf, sumes),
19  cutTk_(conf.getParameter<std::string>("cutTk")),
20  detector_(conf.getParameter<std::string>("detector")),
21  propName_(conf.getParameter<std::string>("propagator")),
24  edm::ESInputTag("", propName_))) {
25  std::string detectorName_ = (detector_ == "HFNose") ? "HGCalHFNoseSensitive" : "HGCalEESensitive";
27  edm::ESInputTag("", detectorName_));
28 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hdc_token_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagator_token_
SeedingRegionAlgoBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::EDGetTokenT< reco::TrackCollection > tracks_token_
const StringCutObjectSelector< reco::Track > cutTk_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bfield_token_

◆ ~SeedingRegionByTracks()

SeedingRegionByTracks::~SeedingRegionByTracks ( )
override

Definition at line 30 of file SeedingRegionByTracks.cc.

30 {}

Member Function Documentation

◆ buildFirstLayers()

void SeedingRegionByTracks::buildFirstLayers ( )
private

Definition at line 81 of file SeedingRegionByTracks.cc.

References Disk::build(), firstDisk_, hgcons_, HGCalDDDConstants::rangeR(), and HGCalDDDConstants::waferZ().

Referenced by initialize().

81  {
82  float zVal = hgcons_->waferZ(1, true);
83  std::pair<double, double> rMinMax = hgcons_->rangeR(zVal, true);
84 
85  for (int iSide = 0; iSide < 2; ++iSide) {
86  float zSide = (iSide == 0) ? (-1. * zVal) : zVal;
87  firstDisk_[iSide] =
88  std::make_unique<GeomDet>(Disk::build(Disk::PositionType(0, 0, zSide),
90  SimpleDiskBounds(rMinMax.first, rMinMax.second, zSide - 0.5, zSide + 0.5))
91  .get());
92  }
93 }
double waferZ(int layer, bool reco) const
static DiskPointer build(Args &&... args)
Definition: BoundDisk.h:38
const HGCalDDDConstants * hgcons_
std::pair< double, double > rangeR(double z, bool reco) const
std::unique_ptr< GeomDet > firstDisk_[2]

◆ fillPSetDescription()

void SeedingRegionByTracks::fillPSetDescription ( edm::ParameterSetDescription desc)
static

Definition at line 71 of file SeedingRegionByTracks.cc.

References submitPVResolutionJobs::desc, ticl::SeedingRegionAlgoBase::fillPSetDescription(), ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

71  {
72  desc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
73  desc.add<std::string>("cutTk",
74  "1.48 < abs(eta) < 3.0 && pt > 1. && quality(\"highPurity\") && "
75  "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5");
76  desc.add<std::string>("propagator", "PropagatorWithMaterial");
77  desc.add<std::string>("detector", "HGCAL");
79 }
static void fillPSetDescription(edm::ParameterSetDescription &desc)

◆ initialize()

void SeedingRegionByTracks::initialize ( const edm::EventSetup es)
overridevirtual

Implements ticl::SeedingRegionAlgoBase.

Definition at line 32 of file SeedingRegionByTracks.cc.

References bfield_, bfield_token_, buildFirstLayers(), edm::EventSetup::getHandle(), hdc_token_, hgcons_, edm::ESHandle< T >::product(), propagator_, and propagator_token_.

32  {
34  hgcons_ = hdc.product();
35 
37 
40 }
edm::ESHandle< MagneticField > bfield_
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hdc_token_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagator_token_
T const * product() const
Definition: ESHandle.h:86
const HGCalDDDConstants * hgcons_
edm::ESHandle< Propagator > propagator_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bfield_token_

◆ makeRegions()

void SeedingRegionByTracks::makeRegions ( const edm::Event ev,
const edm::EventSetup es,
std::vector< TICLSeedingRegion > &  result 
)
overridevirtual

Implements ticl::SeedingRegionAlgoBase.

Definition at line 42 of file SeedingRegionByTracks.cc.

References a, b, bfield_, cutTk_, reco::TrackBase::eta(), makeMEIFBenchmarkPlots::ev, firstDisk_, mps_fire::i, edm::HandleBase::id(), createfilelist::int, beamSpotPI::nTracks, trajectoryStateTransform::outerFreeState(), edm::ESHandle< T >::product(), Propagator::propagate(), mps_fire::result, jetUpdater_cfi::sort, and tracks_token_.

44  {
46  ev.getByToken(tracks_token_, tracks_h);
47  edm::ProductID trkId = tracks_h.id();
48  auto bFieldProd = bfield_.product();
49  const Propagator &prop = (*propagator_);
50 
51  int nTracks = tracks_h->size();
52  for (int i = 0; i < nTracks; ++i) {
53  const reco::Track &tk = (*tracks_h)[i];
54  if (!cutTk_((tk))) {
55  continue;
56  }
57 
59  int iSide = int(tk.eta() > 0);
60  TrajectoryStateOnSurface tsos = prop.propagate(fts, firstDisk_[iSide]->surface());
61  if (tsos.isValid()) {
62  result.emplace_back(tsos.globalPosition(), tsos.globalMomentum(), iSide, i, trkId);
63  }
64  }
65  // sorting seeding region by descending momentum
66  std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) {
67  return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2();
68  });
69 }
edm::ESHandle< MagneticField > bfield_
ProductID id() const
Definition: HandleBase.cc:29
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< reco::TrackCollection > tracks_token_
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
const StringCutObjectSelector< reco::Track > cutTk_
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::unique_ptr< GeomDet > firstDisk_[2]
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)

Member Data Documentation

◆ bfield_

edm::ESHandle<MagneticField> ticl::SeedingRegionByTracks::bfield_
private

Definition at line 52 of file SeedingRegionByTracks.h.

Referenced by initialize(), and makeRegions().

◆ bfield_token_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> ticl::SeedingRegionByTracks::bfield_token_
private

Definition at line 55 of file SeedingRegionByTracks.h.

Referenced by initialize().

◆ cutTk_

const StringCutObjectSelector<reco::Track> ticl::SeedingRegionByTracks::cutTk_
private

Definition at line 48 of file SeedingRegionByTracks.h.

Referenced by makeRegions().

◆ detector_

const std::string ticl::SeedingRegionByTracks::detector_
private

Definition at line 49 of file SeedingRegionByTracks.h.

Referenced by SeedingRegionByTracks().

◆ firstDisk_

std::unique_ptr<GeomDet> ticl::SeedingRegionByTracks::firstDisk_[2]
private

Definition at line 53 of file SeedingRegionByTracks.h.

Referenced by buildFirstLayers(), and makeRegions().

◆ hdc_token_

edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> ticl::SeedingRegionByTracks::hdc_token_
private

Definition at line 54 of file SeedingRegionByTracks.h.

Referenced by initialize(), and SeedingRegionByTracks().

◆ hgcons_

const HGCalDDDConstants* ticl::SeedingRegionByTracks::hgcons_
private

Definition at line 47 of file SeedingRegionByTracks.h.

Referenced by buildFirstLayers(), and initialize().

◆ initializeGeometry_

std::once_flag ticl::SeedingRegionByTracks::initializeGeometry_
private

Definition at line 46 of file SeedingRegionByTracks.h.

◆ propagator_

edm::ESHandle<Propagator> ticl::SeedingRegionByTracks::propagator_
private

Definition at line 50 of file SeedingRegionByTracks.h.

Referenced by initialize().

◆ propagator_token_

edm::ESGetToken<Propagator, TrackingComponentsRecord> ticl::SeedingRegionByTracks::propagator_token_
private

Definition at line 56 of file SeedingRegionByTracks.h.

Referenced by initialize().

◆ propName_

const std::string ticl::SeedingRegionByTracks::propName_
private

Definition at line 51 of file SeedingRegionByTracks.h.

◆ tracks_token_

edm::EDGetTokenT<reco::TrackCollection> ticl::SeedingRegionByTracks::tracks_token_
private

Definition at line 45 of file SeedingRegionByTracks.h.

Referenced by makeRegions().