CMS 3D CMS Logo

SeedingRegionByTracks.cc
Go to the documentation of this file.
1 // Author: Arabella Martelli, Felice Pantaleo, Marco Rovere
2 // arabella.martelli@cern.ch, felice.pantaleo@cern.ch, marco.rovere@cern.ch
3 // Date: 06/2019
4 #include <algorithm>
5 #include <set>
6 #include <vector>
7 
13 
14 using namespace ticl;
15 
17  : SeedingRegionAlgoBase(conf, sumes),
18  tracks_token_(sumes.consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("tracks"))),
19  cutTk_(conf.getParameter<std::string>("cutTk")),
20  detector_(conf.getParameter<std::string>("detector")),
21  propName_(conf.getParameter<std::string>("propagator")),
22  bfield_token_(sumes.esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>()),
23  propagator_token_(sumes.esConsumes<Propagator, TrackingComponentsRecord, edm::Transition::BeginRun>(
24  edm::ESInputTag("", propName_))) {
25  std::string detectorName_ = (detector_ == "HFNose") ? "HGCalHFNoseSensitive" : "HGCalEESensitive";
27  edm::ESInputTag("", detectorName_));
28 }
29 
31 
34  hgcons_ = hdc.product();
35 
37 
40 }
41 
43  const edm::EventSetup &es,
44  std::vector<TICLSeedingRegion> &result) {
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 }
70 
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 }
80 
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 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< float >
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
ticl::SeedingRegionByTracks::makeRegions
void makeRegions(const edm::Event &ev, const edm::EventSetup &es, std::vector< TICLSeedingRegion > &result) override
Definition: SeedingRegionByTracks.cc:42
MessageLogger.h
trajectoryStateTransform::outerFreeState
FreeTrajectoryState outerFreeState(const reco::Track &tk, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:98
SeedingRegionByTracks.h
ticl::SeedingRegionByTracks::buildFirstLayers
void buildFirstLayers()
Definition: SeedingRegionByTracks.cc:81
ESInputTag
ticl::SeedingRegionByTracks::hdc_token_
edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hdc_token_
Definition: SeedingRegionByTracks.h:54
BoundDisk.h
edm
HLT enums.
Definition: AlignableModifier.h:19
Disk::build
static DiskPointer build(Args &&... args)
Definition: BoundDisk.h:38
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1412
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ticl::SeedingRegionAlgoBase
Definition: SeedingRegionAlgoBase.h:22
ticl::SeedingRegionByTracks::bfield_
edm::ESHandle< MagneticField > bfield_
Definition: SeedingRegionByTracks.h:52
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
ticl::SeedingRegionByTracks::propagator_token_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagator_token_
Definition: SeedingRegionByTracks.h:56
BeamSpotPI::nTracks
Definition: BeamSpotPayloadInspectorHelper.h:42
ticl
Definition: Common.h:8
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::Handle< reco::TrackCollection >
HGCalDDDConstants
Definition: HGCalDDDConstants.h:27
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
Track.h
ticl::SeedingRegionByTracks::hgcons_
const HGCalDDDConstants * hgcons_
Definition: SeedingRegionByTracks.h:47
reco::Track
Definition: Track.h:27
edm::ESHandle< HGCalDDDConstants >
Point3DBase< float, GlobalTag >
ticl::SeedingRegionByTracks::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionByTracks.cc:71
b
double b
Definition: hdecay.h:118
HGCalDDDConstants::rangeR
std::pair< double, double > rangeR(double z, bool reco) const
Definition: HGCalDDDConstants.cc:966
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
a
double a
Definition: hdecay.h:119
ticl::SeedingRegionByTracks::bfield_token_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bfield_token_
Definition: SeedingRegionByTracks.h:55
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
ticl::SeedingRegionByTracks::SeedingRegionByTracks
SeedingRegionByTracks(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition: SeedingRegionByTracks.cc:16
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
createfilelist.int
int
Definition: createfilelist.py:10
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
edm::EventSetup
Definition: EventSetup.h:58
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
ticl::SeedingRegionByTracks::tracks_token_
edm::EDGetTokenT< reco::TrackCollection > tracks_token_
Definition: SeedingRegionByTracks.h:45
ticl::SeedingRegionByTracks::propagator_
edm::ESHandle< Propagator > propagator_
Definition: SeedingRegionByTracks.h:50
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TICLSeedingRegion
Definition: TICLSeedingRegion.h:14
ticl::SeedingRegionByTracks::firstDisk_
std::unique_ptr< GeomDet > firstDisk_[2]
Definition: SeedingRegionByTracks.h:53
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
ticl::SeedingRegionByTracks::cutTk_
const StringCutObjectSelector< reco::Track > cutTk_
Definition: SeedingRegionByTracks.h:48
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
ticl::SeedingRegionAlgoBase::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionAlgoBase.h:34
edm::Transition::BeginRun
ev
bool ev
Definition: Hydjet2Hadronizer.cc:97
TrajectoryStateTransform.h
mps_fire.result
result
Definition: mps_fire.py:311
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
MagneticField
Definition: MagneticField.h:19
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:29
ticl::SeedingRegionByTracks::initialize
void initialize(const edm::EventSetup &es) override
Definition: SeedingRegionByTracks.cc:32
ticl::SeedingRegionByTracks::~SeedingRegionByTracks
~SeedingRegionByTracks() override
Definition: SeedingRegionByTracks.cc:30
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ProductID
Definition: ProductID.h:27
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
ticl::SeedingRegionByTracks::detector_
const std::string detector_
Definition: SeedingRegionByTracks.h:49
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12