◆ CalibrationTrackSelectorFromDetIdList()
CalibrationTrackSelectorFromDetIdList::CalibrationTrackSelectorFromDetIdList |
( |
const edm::ParameterSet & |
iConfig | ) |
|
|
explicit |
Definition at line 67 of file CalibrationTrackSelectorFromDetIdList.cc.
References detidsels_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_label, m_verbose, and corrVsCorr::selection.
68 :
geometryToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
69 magFieldToken_(esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>()),
71 std::vector<edm::ParameterSet> selconfigs = iConfig.
getParameter<std::vector<edm::ParameterSet>>(
"selections");
73 for (std::vector<edm::ParameterSet>::const_iterator selconfig = selconfigs.begin(); selconfig != selconfigs.end();
81 produces<TrackCandidateCollection>();
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > m_label
std::vector< DetIdSelector > detidsels_
T getUntrackedParameter(std::string const &, T const &) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
◆ ~CalibrationTrackSelectorFromDetIdList()
CalibrationTrackSelectorFromDetIdList::~CalibrationTrackSelectorFromDetIdList |
( |
| ) |
|
|
override |
◆ beginRun()
Definition at line 161 of file CalibrationTrackSelectorFromDetIdList.cc.
References TrackerGeometry::detIds(), detidsels_, geometryToken_, edm::EventSetup::getHandle(), LogDebug, m_verbose, magFieldToken_, edm::ESHandle< T >::product(), theGeometry, and theMagField.
168 for (
const auto &theDet : theDetIds) {
169 if (detidsel.isSelected(theDet)) {
170 LogDebug(
"CalibrationTrackSelectorFromDetIdList") <<
"detid: " << theDet.rawId() <<
" is taken" << std::endl;
edm::ESHandle< MagneticField > theMagField
edm::ESHandle< TrackerGeometry > theGeometry
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::vector< DetIdSelector > detidsels_
T const * product() const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
◆ makeCandidate()
Definition at line 129 of file CalibrationTrackSelectorFromDetIdList.cc.
References alongMomentum, anyDirection, Exception, reco::Track::innerDetId(), reco::Track::innerPosition(), trajectoryStateTransform::innerStateOnSurface(), reco::TrackBase::momentum(), reco::Track::outerDetId(), reco::Track::outerPosition(), trajectoryStateTransform::outerStateOnSurface(), trajectoryStateTransform::persistentState(), edm::OwnVector< T, P >::push_back(), edm::OwnVector< T, P >::reserve(), fileCollector::seed, reco::Track::seedDirection(), reco::Track::seedRef(), theGeometry, and theMagField.
Referenced by produce().
136 throw cms::Exception(
"UnimplementedFeature") <<
"Cannot work with tracks that have 'anyDirecton' \n";
151 ownHits.
reserve(hitsEnd - hitsBegin);
152 for (; hitsBegin != hitsEnd; ++hitsBegin) {
153 ownHits.
push_back((*hitsBegin)->clone());
edm::ESHandle< MagneticField > theMagField
const math::XYZPoint & outerPosition() const
position of the outermost hit
edm::ESHandle< TrackerGeometry > theGeometry
const edm::RefToBase< TrajectorySeed > & seedRef() const
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
const Vector & momentum() const
track momentum vector
const math::XYZPoint & innerPosition() const
position of the innermost hit
◆ produce()
Definition at line 91 of file CalibrationTrackSelectorFromDetIdList.cc.
References detidsels_, hfClusterShapes_cfi::hits, iEvent, LogDebug, m_label, makeCandidate(), eostools::move(), DetId::rawId(), and pwdgSkimBPark_cfi::tracks.
97 auto const &
tracks = *trackCollectionHandle;
99 auto output = std::make_unique<TrackCandidateCollection>();
102 for (
auto &trk :
tracks) {
103 std::vector<const TrackingRecHit *>
hits;
105 bool saveTrack(
false);
107 for (
auto const &
hit : trk.recHits()) {
108 DetId detid =
hit->geographicalId();
111 if (detidsel.isSelected(detid)) {
112 LogDebug(
"CalibrationTrackSelectorFromDetIdList") <<
"Selected by selection " << detid.
rawId();
TrackCandidate makeCandidate(const reco::Track &tk, std::vector< const TrackingRecHit *>::iterator hitsBegin, std::vector< const TrackingRecHit *>::iterator hitsEnd)
edm::EDGetTokenT< reco::TrackCollection > m_label
std::vector< DetIdSelector > detidsels_
constexpr uint32_t rawId() const
get the raw id
◆ detidsels_
std::vector<DetIdSelector> CalibrationTrackSelectorFromDetIdList::detidsels_ |
|
private |
◆ geometryToken_
◆ m_label
◆ m_verbose
bool CalibrationTrackSelectorFromDetIdList::m_verbose |
|
private |
◆ magFieldToken_
◆ theGeometry
◆ theMagField