CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SeedGeneratorFromL1TTracksEDProducer Class Reference
Inheritance diagram for SeedGeneratorFromL1TTracksEDProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

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
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 SeedGeneratorFromL1TTracksEDProducer (const edm::ParameterSet &cfg)
 
 ~SeedGeneratorFromL1TTracksEDProducer () override=default
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector
< edm::ProductResolverIndex >
const & 
indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector
< edm::ProductResolverIndex >
const & 
putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::ESGetToken
< Chi2MeasurementEstimatorBase,
TrackingComponentsRecord
estToken_
 
const edm::ESGetToken
< TrackerGeometry,
TrackerDigiGeometryRecord
geomToken_
 
const edm::ESGetToken
< MagneticField,
IdealMagneticFieldRecord
mfToken_
 
const edm::ESGetToken
< Propagator,
TrackingComponentsRecord
propagatorAlongToken_
 
const edm::ESGetToken
< Propagator,
TrackingComponentsRecord
propagatorOppositeToken_
 
const double theErrorSFHitless_
 
const edm::EDGetTokenT
< std::vector< TTTrack
< Ref_Phase2TrackerDigi_ > > > 
theInputCollectionTag_
 
const double theMaxEtaForTOB_
 
const edm::EDGetTokenT
< MeasurementTrackerEvent
theMeasurementTrackerTag_
 
const double theMinEtaForTEC_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 34 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Constructor & Destructor Documentation

SeedGeneratorFromL1TTracksEDProducer::SeedGeneratorFromL1TTracksEDProducer ( const edm::ParameterSet cfg)

Definition at line 70 of file SeedGeneratorFromL1TTracksEDProducer.cc.

References estToken_, geomToken_, edm::ParameterSet::getParameter(), propagatorAlongToken_, propagatorOppositeToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

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 }
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > theInputCollectionTag_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
Class to store the L1 Track Trigger tracks.
Definition: TTTrack.h:29
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAlongToken_
const edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerTag_
SeedGeneratorFromL1TTracksEDProducer::~SeedGeneratorFromL1TTracksEDProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 89 of file SeedGeneratorFromL1TTracksEDProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, alignCSCRings::e, and AlCaHLTBitMon_QueryRunRegistry::string.

89  {
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 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void SeedGeneratorFromL1TTracksEDProducer::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 at line 101 of file SeedGeneratorFromL1TTracksEDProducer.cc.

References GeometricSearchDet::compatibleDetsV(), LogDebug, oppositeToMomentum, submitPVResolutionJobs::out, trajectoryStateTransform::persistentState(), and theErrorSFHitless_.

Referenced by produce().

107  {
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 }
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
virtual void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
#define LogDebug(id)
void SeedGeneratorFromL1TTracksEDProducer::produce ( edm::StreamID  ,
edm::Event ev,
const edm::EventSetup es 
) const
overridevirtual

Surface used to make a TSOS at the PCA to the beamline

Implements edm::global::EDProducerBase.

Definition at line 130 of file SeedGeneratorFromL1TTracksEDProducer.cc.

References funct::abs(), alongMomentum, Plane::build(), filterCSVwithJSON::copy, estToken_, findSeedsOnLayer(), relativeConstraints::geom, geomToken_, edm::Event::get(), edm::EventSetup::getData(), trajectoryStateTransform::initialFreeStateL1TTrack(), mag(), HLT_FULL_cff::measurementTracker, mfToken_, eostools::move(), oppositeToMomentum, submitPVResolutionJobs::out, GeomDetEnumerators::P2OTEC, FreeTrajectoryState::position(), HLT_FULL_cff::propagatorAlong, propagatorAlongToken_, HLT_FULL_cff::propagatorOpposite, propagatorOppositeToken_, edm::Event::put(), mps_fire::result, SetPropagationDirection(), theInputCollectionTag_, theMaxEtaForTOB_, theMeasurementTrackerTag_, and theMinEtaForTEC_.

130  {
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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
const edm::EDGetTokenT< std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > > theInputCollectionTag_
tuple propagatorAlong
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
tuple measurementTracker
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
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
tuple result
Definition: mps_fire.py:311
bool getData(T &iHolder) const
Definition: EventSetup.h:128
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
def move
Definition: eostools.py:511
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
GlobalPoint position() const
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > estToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorOppositeToken_
FreeTrajectoryState initialFreeStateL1TTrack(const TTTrack< Ref_Phase2TrackerDigi_ > &tk, const MagneticField *field, bool withErr=false)
tuple propagatorOpposite
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorAlongToken_
const edm::EDGetTokenT< MeasurementTrackerEvent > theMeasurementTrackerTag_

Member Data Documentation

const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> SeedGeneratorFromL1TTracksEDProducer::estToken_
private
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SeedGeneratorFromL1TTracksEDProducer::geomToken_
private
const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SeedGeneratorFromL1TTracksEDProducer::mfToken_
private

Definition at line 63 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Referenced by produce().

const edm::ESGetToken<Propagator, TrackingComponentsRecord> SeedGeneratorFromL1TTracksEDProducer::propagatorAlongToken_
private
const edm::ESGetToken<Propagator, TrackingComponentsRecord> SeedGeneratorFromL1TTracksEDProducer::propagatorOppositeToken_
private
const double SeedGeneratorFromL1TTracksEDProducer::theErrorSFHitless_
private

Definition at line 61 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Referenced by findSeedsOnLayer().

const edm::EDGetTokenT<std::vector<TTTrack<Ref_Phase2TrackerDigi_> > > SeedGeneratorFromL1TTracksEDProducer::theInputCollectionTag_
private

Definition at line 52 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Referenced by produce().

const double SeedGeneratorFromL1TTracksEDProducer::theMaxEtaForTOB_
private

Definition at line 59 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Referenced by produce().

const edm::EDGetTokenT<MeasurementTrackerEvent> SeedGeneratorFromL1TTracksEDProducer::theMeasurementTrackerTag_
private

Definition at line 53 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Referenced by produce().

const double SeedGeneratorFromL1TTracksEDProducer::theMinEtaForTEC_
private

Definition at line 56 of file SeedGeneratorFromL1TTracksEDProducer.cc.

Referenced by produce().