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  propName_(conf.getParameter<std::string>("propagator")),
21  hdc_token_(sumes.esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
22  edm::ESInputTag("", detectorName_))),
23  bfield_token_(sumes.esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>()),
24  propagator_token_(sumes.esConsumes<Propagator, TrackingComponentsRecord, edm::Transition::BeginRun>(
25  edm::ESInputTag("", propName_))) {}
26 
28 
31  hgcons_ = hdc.product();
32 
34 
37 }
38 
40  const edm::EventSetup &es,
41  std::vector<TICLSeedingRegion> &result) {
43  ev.getByToken(tracks_token_, tracks_h);
44  edm::ProductID trkId = tracks_h.id();
45  auto bFieldProd = bfield_.product();
46  const Propagator &prop = (*propagator_);
47 
48  int nTracks = tracks_h->size();
49  for (int i = 0; i < nTracks; ++i) {
50  const reco::Track &tk = (*tracks_h)[i];
51  if (!cutTk_((tk))) {
52  continue;
53  }
54 
56  int iSide = int(tk.eta() > 0);
57  TrajectoryStateOnSurface tsos = prop.propagate(fts, firstDisk_[iSide]->surface());
58  if (tsos.isValid()) {
59  result.emplace_back(tsos.globalPosition(), tsos.globalMomentum(), iSide, i, trkId);
60  }
61  }
62  // sorting seeding region by descending momentum
63  std::sort(result.begin(), result.end(), [](const TICLSeedingRegion &a, const TICLSeedingRegion &b) {
64  return a.directionAtOrigin.perp2() > b.directionAtOrigin.perp2();
65  });
66 }
67 
69  desc.add<edm::InputTag>("tracks", edm::InputTag("generalTracks"));
70  desc.add<std::string>("cutTk",
71  "1.48 < abs(eta) < 3.0 && pt > 1. && quality(\"highPurity\") && "
72  "hitPattern().numberOfLostHits(\"MISSING_OUTER_HITS\") < 5");
73  desc.add<std::string>("propagator", "PropagatorWithMaterial");
75 }
76 
78  float zVal = hgcons_->waferZ(1, true);
79  std::pair<double, double> rMinMax = hgcons_->rangeR(zVal, true);
80 
81  for (int iSide = 0; iSide < 2; ++iSide) {
82  float zSide = (iSide == 0) ? (-1. * zVal) : zVal;
83  firstDisk_[iSide] =
84  std::make_unique<GeomDet>(Disk::build(Disk::PositionType(0, 0, zSide),
86  SimpleDiskBounds(rMinMax.first, rMinMax.second, zSide - 0.5, zSide + 0.5))
87  .get());
88  }
89 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TkRotation< float >
nTracks
const unsigned int nTracks(const reco::Vertex &sv)
Definition: TemplatedVertexArbitrator.h:44
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
ticl::SeedingRegionByTracks::makeRegions
void makeRegions(const edm::Event &ev, const edm::EventSetup &es, std::vector< TICLSeedingRegion > &result) override
Definition: SeedingRegionByTracks.cc:39
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:77
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:1367
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:45
ticl::SeedingRegionByTracks::propagator_token_
edm::ESGetToken< Propagator, TrackingComponentsRecord > propagator_token_
Definition: SeedingRegionByTracks.h:56
ticl
Definition: Common.h:8
edm::Handle< reco::TrackCollection >
HGCalDDDConstants
Definition: HGCalDDDConstants.h:25
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
Definition: DTSurvey.h:22
Point3DBase< float, GlobalTag >
ticl::SeedingRegionByTracks::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: SeedingRegionByTracks.cc:68
b
double b
Definition: hdecay.h:118
HGCalDDDConstants::rangeR
std::pair< double, double > rangeR(double z, bool reco) const
Definition: HGCalDDDConstants.cc:934
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
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
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:623
createfilelist.int
int
Definition: createfilelist.py:10
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:141
edm::EventSetup
Definition: EventSetup.h:57
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
TICLSeedingRegion
Definition: TICLSeedingRegion.h:14
ticl::SeedingRegionByTracks::firstDisk_
std::unique_ptr< GeomDet > firstDisk_[2]
Definition: SeedingRegionByTracks.h:53
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
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
TrajectoryStateTransform.h
mps_fire.result
result
Definition: mps_fire.py:303
edm::Event
Definition: Event.h:73
MagneticField
Definition: MagneticField.h:19
edm::HandleBase::id
ProductID id() const
Definition: HandleBase.cc:13
ticl::SeedingRegionByTracks::initialize
void initialize(const edm::EventSetup &es) override
Definition: SeedingRegionByTracks.cc:29
ticl::SeedingRegionByTracks::~SeedingRegionByTracks
~SeedingRegionByTracks() override
Definition: SeedingRegionByTracks.cc:27
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
edm::ProductID
Definition: ProductID.h:27
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12