CMS 3D CMS Logo

SeedGeneratorFromL1TTracksEDProducer.cc
Go to the documentation of this file.
8 
16 
21 
24 
30 
32 #include <vector>
33 
35 public:
37  ~SeedGeneratorFromL1TTracksEDProducer() override = default;
38 
39  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
40 
41  void findSeedsOnLayer(const GeometricSearchDet& layer,
42  const TrajectoryStateOnSurface& tsosAtIP,
46  unsigned int& numSeedsMade,
47  std::unique_ptr<std::vector<TrajectorySeed>>& out) const;
48 
49  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
50 
51 private:
54 
55  // Minimum eta value to activate searching in the TEC
56  const double theMinEtaForTEC_;
57 
58  // Maximum eta value to activate searching in the TOB
59  const double theMaxEtaForTOB_;
60 
61  const double theErrorSFHitless_;
62 
68 };
69 
71  : theInputCollectionTag_(
72  consumes<std::vector<TTTrack<Ref_Phase2TrackerDigi_>>>(cfg.getParameter<edm::InputTag>("InputCollection"))),
73  theMeasurementTrackerTag_(
74  consumes<MeasurementTrackerEvent>(cfg.getParameter<edm::InputTag>("MeasurementTrackerEvent"))),
75  theMinEtaForTEC_(cfg.getParameter<double>("minEtaForTEC")),
76  theMaxEtaForTOB_(cfg.getParameter<double>("maxEtaForTOB")),
77  theErrorSFHitless_(cfg.getParameter<double>("errorSFHitless")),
78  mfToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
79  geomToken_{esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()},
80  estToken_{esConsumes<Chi2MeasurementEstimatorBase, TrackingComponentsRecord>(
81  edm::ESInputTag("", cfg.getParameter<std::string>("estimator")))},
82  propagatorAlongToken_{esConsumes<Propagator, TrackingComponentsRecord>(
83  edm::ESInputTag("", cfg.getParameter<std::string>("propagator")))},
84  propagatorOppositeToken_{esConsumes<Propagator, TrackingComponentsRecord>(
85  edm::ESInputTag("", cfg.getParameter<std::string>("propagator")))} {
86  produces<TrajectorySeedCollection>();
87 }
88 
91  desc.add<edm::InputTag>("InputCollection", {"TTTracksFromTrackletEmulation", "Level1TTTracks"});
92  desc.add<std::string>("estimator", "");
93  desc.add<std::string>("propagator", "");
94  desc.add<edm::InputTag>("MeasurementTrackerEvent", {""});
95  desc.add<double>("minEtaForTEC", 0.9);
96  desc.add<double>("maxEtaForTOB", 1.2);
97  desc.add<double>("errorSFHitless", 1e-9);
98  descriptions.addWithDefaultLabel(desc);
99 }
100 
102  const TrajectoryStateOnSurface& tsosAtIP,
106  unsigned int& numSeedsMade,
107  std::unique_ptr<std::vector<TrajectorySeed>>& out) const {
108  std::vector<GeometricSearchDet::DetWithState> dets;
109  layer.compatibleDetsV(tsosAtIP, propagatorAlong, estimator, dets);
110 
111  if (!dets.empty()) {
112  auto const& detOnLayer = dets.front().first;
113  auto const& tsosOnLayer = dets.front().second;
114  if (!tsosOnLayer.isValid()) {
115  LogDebug("SeedGeneratorFromL1TTracks") << "Hitless TSOS is not valid!";
116  } else {
117  dets.front().second.rescaleError(theErrorSFHitless_);
118 
119  PTrajectoryStateOnDet const& ptsod =
120  trajectoryStateTransform::persistentState(tsosOnLayer, detOnLayer->geographicalId().rawId());
122  if (numSeedsMade < 1) { // only outermost seed
123  out->emplace_back(ptsod, rHC, oppositeToMomentum);
124  numSeedsMade++;
125  }
126  }
127  }
128 }
129 
131  std::unique_ptr<std::vector<TrajectorySeed>> result(new std::vector<TrajectorySeed>());
132 
133  // TTrack Collection
134  auto const& trks = ev.get(theInputCollectionTag_);
135 
136  // Trk Geometry
137  const auto& geom = es.getData(geomToken_);
138 
139  // Mag field
140  const auto& mag = es.getData(mfToken_);
141 
142  // Estimator
143  auto const& estimator = es.getData(estToken_);
144 
145  // Get Propagators
146  const auto& propagatorAlongH = es.getData(propagatorAlongToken_);
147  std::unique_ptr<Propagator> propagatorAlong = SetPropagationDirection(propagatorAlongH, alongMomentum);
148 
149  const auto& propagatorOppositeH = es.getData(propagatorOppositeToken_);
150  std::unique_ptr<Propagator> propagatorOpposite = SetPropagationDirection(propagatorOppositeH, oppositeToMomentum);
151 
152  // Get vector of Detector layers
154  std::vector<BarrelDetLayer const*> const& tob = measurementTracker.geometricSearchTracker()->tobLayers();
155 
156  std::vector<ForwardDetLayer const*> const& tecPositive =
157  geom.isThere(GeomDetEnumerators::P2OTEC) ? measurementTracker.geometricSearchTracker()->posTidLayers()
158  : measurementTracker.geometricSearchTracker()->posTecLayers();
159  std::vector<ForwardDetLayer const*> const& tecNegative =
160  geom.isThere(GeomDetEnumerators::P2OTEC) ? measurementTracker.geometricSearchTracker()->negTidLayers()
161  : measurementTracker.geometricSearchTracker()->negTecLayers();
162 
165 
166  // Loop over the L1's and make seeds for all of them:
167  for (auto const& l1 : trks) {
168  std::unique_ptr<std::vector<TrajectorySeed>> out(new std::vector<TrajectorySeed>());
170  dummyPlane->move(fts.position() - dummyPlane->position());
171  TrajectoryStateOnSurface tsosAtIP = TrajectoryStateOnSurface(fts, *dummyPlane);
172 
173  unsigned int numSeedsMade = 0;
174  //BARREL
175  if (std::abs(l1.momentum().eta()) < theMaxEtaForTOB_) {
176  for (auto it = tob.rbegin(); it != tob.rend(); ++it) { //This goes from outermost to innermost layer
177  findSeedsOnLayer(**it, tsosAtIP, *(propagatorAlong.get()), l1, estimator, numSeedsMade, out);
178  }
179  }
180  if (std::abs(l1.momentum().eta()) > theMinEtaForTEC_) {
181  numSeedsMade = 0; // reset num of seeds
182  }
183  //ENDCAP+
184  if (l1.momentum().eta() > theMinEtaForTEC_) {
185  for (auto it = tecPositive.rbegin(); it != tecPositive.rend(); ++it) {
186  findSeedsOnLayer(**it, tsosAtIP, *(propagatorAlong.get()), l1, estimator, numSeedsMade, out);
187  }
188  }
189  //ENDCAP-
190  if (l1.momentum().eta() < -theMinEtaForTEC_) {
191  for (auto it = tecNegative.rbegin(); it != tecNegative.rend(); ++it) {
192  findSeedsOnLayer(**it, tsosAtIP, *(propagatorAlong.get()), l1, estimator, numSeedsMade, out);
193  }
194  }
195  std::copy(out->begin(), out->end(), std::back_inserter(*result));
196  } // end loop over L1Tracks
197 
198  ev.put(std::move(result));
199 }
200 
SeedGeneratorFromL1TTracksEDProducer::estToken_
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:65
ConfigurationDescriptions.h
Chi2MeasurementEstimatorBase.h
SeedGeneratorFromL1TTracksEDProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:130
Propagator.h
edm::StreamID
Definition: StreamID.h:30
MeasurementEstimator
Definition: MeasurementEstimator.h:19
TkRotation< float >
TrajectoryStateOnSurface.h
edm::ESInputTag
Definition: ESInputTag.h:87
MeasurementTrackerEvent.h
MessageLogger.h
TrackerGeometry.h
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
HLTSiStripMonitoring_cff.measurementTracker
measurementTracker
Definition: HLTSiStripMonitoring_cff.py:178
TTTypes.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
SeedGeneratorFromL1TTracksEDProducer::theMaxEtaForTOB_
const double theMaxEtaForTOB_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:59
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GeomDetType.h
oppositeToMomentum
Definition: PropagationDirection.h:4
TTTrack
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
SetPropagationDirection
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
Definition: HelperPropagatorUtility.cc:5
edm::global::EDProducerBase::produce
virtual void produce(StreamID, Event &, EventSetup const &) const =0
ReferenceCountingPointer< Plane >
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
edm::global::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:300
SeedGeneratorFromL1TTracksEDProducer::theMeasurementTrackerTag_
const edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerTag_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:53
edm::Ref
Definition: AssociativeIterator.h:58
Propagator
Definition: Propagator.h:44
SeedGeneratorFromL1TTracksEDProducer::theErrorSFHitless_
const double theErrorSFHitless_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:61
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MakerMacros.h
Track.h
PVValHelper::estimator
estimator
Definition: PVValidationHelpers.h:45
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
GeomDetEnumerators::P2OTEC
Definition: GeomDetEnumerators.h:24
TTTrack.h
Point3DBase< float, GlobalTag >
ParameterSetDescription.h
dso_hidden
#define dso_hidden
Definition: Visibility.h:12
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
SeedGeneratorFromL1TTracksEDProducer::mfToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:63
SeedGeneratorFromL1TTracksEDProducer::SeedGeneratorFromL1TTracksEDProducer
SeedGeneratorFromL1TTracksEDProducer(const edm::ParameterSet &cfg)
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:70
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
TrackerDigiGeometryRecord.h
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MeasurementTrackerEvent
Definition: MeasurementTrackerEvent.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
HLT_FULL_cff.propagatorOpposite
propagatorOpposite
Definition: HLT_FULL_cff.py:116
Event.h
SeedGeneratorFromL1TTracksEDProducer
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:34
ModuleDef.h
trajectoryStateTransform::initialFreeStateL1TTrack
FreeTrajectoryState initialFreeStateL1TTrack(const TTTrack< Ref_Phase2TrackerDigi_ > &tk, const MagneticField *field, bool withErr=false)
Definition: TrajectoryStateTransform.cc:70
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:58
TrajectorySeedCollection.h
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
looper.cfg
cfg
Definition: looper.py:297
SeedGeneratorFromL1TTracksEDProducer::propagatorAlongToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAlongToken_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:66
cms::cuda::device::unique_ptr
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Definition: device_unique_ptr.h:33
VertexFwd.h
HLT_FULL_cff.propagatorAlong
propagatorAlong
Definition: HLT_FULL_cff.py:118
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
GeomDet.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
SeedGeneratorFromL1TTracksEDProducer::theInputCollectionTag_
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > theInputCollectionTag_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:52
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
TrackingComponentsRecord.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
SeedGeneratorFromL1TTracksEDProducer::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:64
EventSetup.h
TrajectoryStateTransform.h
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SeedGeneratorFromL1TTracksEDProducer::findSeedsOnLayer
void findSeedsOnLayer(const GeometricSearchDet &layer, const TrajectoryStateOnSurface &tsosAtIP, Propagator &propagatorAlong, const TTTrack< Ref_Phase2TrackerDigi_ > &l1, const MeasurementEstimator &estimator, unsigned int &numSeedsMade, std::unique_ptr< std::vector< TrajectorySeed >> &out) const
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:101
hltEgammaHLTExtra_cfi.trks
trks
Definition: hltEgammaHLTExtra_cfi.py:43
mps_fire.result
result
Definition: mps_fire.py:311
ConsumesCollector.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
ParameterSet.h
GeometricSearchDet
Definition: GeometricSearchDet.h:17
EDProducer.h
GlobalTrackingGeometry.h
edm::Event
Definition: Event.h:73
SeedGeneratorFromL1TTracksEDProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:89
SeedGeneratorFromL1TTracksEDProducer::propagatorOppositeToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:67
edm::InputTag
Definition: InputTag.h:15
alongMomentum
Definition: PropagationDirection.h:4
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
edm::OwnVector< TrackingRecHit >
SeedGeneratorFromL1TTracksEDProducer::theMinEtaForTEC_
const double theMinEtaForTEC_
Definition: SeedGeneratorFromL1TTracksEDProducer.cc:56
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37