CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CosmicTrackSelector Class Referencefinal
Inheritance diagram for CosmicTrackSelector:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CosmicTrackSelector (const edm::ParameterSet &cfg)
 
 ~CosmicTrackSelector () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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::vector< ModuleDescription const * > &modules, 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 updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef math::XYZPoint Point
 

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es) override
 
bool select (const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamspot_
 
double chi2n_par_
 
bool copyExtras_
 
bool copyTrajectories_
 
bool keepAllTracks_
 
double max_d0_
 
double max_eta_
 
uint32_t max_lostLayers_
 
double max_z0_
 
uint32_t min_3Dlayers_
 
uint32_t min_layers_
 
uint32_t min_nHit_
 
uint32_t min_nPixelHit_
 
double min_pt_
 
TrackBase::TrackQuality qualityToSet_
 
std::vector< double > res_par_
 
TrackingRecHitRefProd rHits_
 
reco::TrackExtraRefProd rTrackExtras_
 
reco::TrackRefProd rTracks_
 
edm::RefProd< std::vector< Trajectory > > rTrajectories_
 
std::unique_ptr< TrackingRecHitCollectionselHits_
 
std::unique_ptr< reco::TrackExtraCollectionselTrackExtras_
 
std::unique_ptr< reco::TrackCollectionselTracks_
 
std::unique_ptr< std::vector< const Trajectory * > > selTrajPtrs_
 
std::unique_ptr< std::vector< Trajectory > > selTrajs_
 
std::unique_ptr< TrajTrackAssociationCollectionselTTAss_
 
bool setQualityBit_
 
edm::EDGetTokenT< reco::TrackCollectionsrc_
 
edm::EDGetTokenT< TrajTrackAssociationCollectionsrcTass_
 
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
 
std::vector< reco::TrackReftrackRefs_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

selects a subset of a track collection, copying extra information on demand

Author
Paolo Azzurri, Giovanni Petrucciani

Definition at line 32 of file CosmicTrackSelector.cc.

Member Typedef Documentation

Definition at line 41 of file CosmicTrackSelector.cc.

Constructor & Destructor Documentation

CosmicTrackSelector::CosmicTrackSelector ( const edm::ParameterSet cfg)
explicit

Definition at line 99 of file CosmicTrackSelector.cc.

References met_cff::alias, copyExtras_, copyTrajectories_, Exception, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), keepAllTracks_, qualityToSet_, setQualityBit_, srcTass_, srcTraj_, and AlCaHLTBitMon_QueryRunRegistry::string.

99  :
100  src_( consumes<reco::TrackCollection>( cfg.getParameter<edm::InputTag>( "src" ) ) ),
101  beamspot_( consumes<reco::BeamSpot>( cfg.getParameter<edm::InputTag>( "beamspot" ) ) ),
102  copyExtras_(cfg.getUntrackedParameter<bool>("copyExtras", false)),
103  copyTrajectories_(cfg.getUntrackedParameter<bool>("copyTrajectories", false)),
104  keepAllTracks_( cfg.exists("keepAllTracks") ?
105  cfg.getParameter<bool>("keepAllTracks") :
106  false ), // as this is what you expect from a well behaved selector
107  setQualityBit_( false ),
108  qualityToSet_( TrackBase::undefQuality ),
109  chi2n_par_( cfg.getParameter<double>("chi2n_par") ),
110  // Impact parameter absolute cuts.
111  max_d0_(cfg.getParameter<double>("max_d0")),
112  max_z0_(cfg.getParameter<double>("max_z0")),
113  // Track parameter cuts.
114  min_pt_(cfg.getParameter<double>("min_pt")),
115  max_eta_(cfg.getParameter<double>("max_eta")),
116  // Cut on number of valid hits
117  min_nHit_(cfg.getParameter<uint32_t>("min_nHit")),
118  // Cut on number of valid hits
119  min_nPixelHit_(cfg.getParameter<uint32_t>("min_nPixelHit")),
120  // Cuts on numbers of layers with hits/3D hits/lost hits.
121  min_layers_(cfg.getParameter<uint32_t>("minNumberLayers") ),
122  min_3Dlayers_(cfg.getParameter<uint32_t>("minNumber3DLayers") ),
123  max_lostLayers_(cfg.getParameter<uint32_t>("maxNumberLostLayers") )
124 {
125  if (cfg.exists("qualityBit")) {
126  std::string qualityStr = cfg.getParameter<std::string>("qualityBit");
127  if (qualityStr != "") {
128  setQualityBit_ = true;
129  qualityToSet_ = TrackBase::qualityByName(cfg.getParameter<std::string>("qualityBit"));
130  }
131  }
132  if (keepAllTracks_ && !setQualityBit_) throw cms::Exception("Configuration") <<
133  "If you set 'keepAllTracks' to true, you must specify which qualityBit to set.\n";
134  if (setQualityBit_ && (qualityToSet_ == TrackBase::undefQuality)) throw cms::Exception("Configuration") <<
135  "You can't set the quality bit " << cfg.getParameter<std::string>("qualityBit") << " as it is 'undefQuality' or unknown.\n";
136 
137  std::string alias( cfg.getParameter<std::string>( "@module_label" ) );
138  produces<reco::TrackCollection>().setBranchAlias( alias + "Tracks");
139  if (copyExtras_) {
140  produces<reco::TrackExtraCollection>().setBranchAlias( alias + "TrackExtras");
141  produces<TrackingRecHitCollection>().setBranchAlias( alias + "RecHits");
142  }
143  if (copyTrajectories_) {
144  srcTraj_ = consumes<std::vector<Trajectory> >(cfg.getParameter<edm::InputTag>( "src" ));
145  srcTass_ = consumes<TrajTrackAssociationCollection>(cfg.getParameter<edm::InputTag>( "src" ));
146  produces< std::vector<Trajectory> >().setBranchAlias( alias + "Trajectories");
147  produces< TrajTrackAssociationCollection >().setBranchAlias( alias + "TrajectoryTrackAssociations");
148  }
149 
150 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
TrackBase::TrackQuality qualityToSet_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
edm::EDGetTokenT< reco::TrackCollection > src_
CosmicTrackSelector::~CosmicTrackSelector ( )
override

Definition at line 152 of file CosmicTrackSelector.cc.

152  {
153 }

Member Function Documentation

void CosmicTrackSelector::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivate

Definition at line 155 of file CosmicTrackSelector.cc.

References beamspot_, edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, copyExtras_, copyTrajectories_, edm::friendlyname::emptyString(), edm::AssociationMap< Tag >::end(), reco::Track::extra(), edm::AssociationMap< Tag >::find(), edm::Event::getByToken(), edm::Event::getRefBeforePut(), mps_fire::i, reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerOk(), reco::Track::innerPosition(), reco::Track::innerStateCovariance(), keepAllTracks_, edm::Ref< C, T, F >::key(), match(), eostools::move(), gen::n, convertSQLiteXML::ok, reco::Track::outerDetId(), reco::Track::outerMomentum(), reco::Track::outerOk(), reco::Track::outerPosition(), reco::Track::outerStateCovariance(), edm::Event::productGetter(), edm::Event::put(), qualityToSet_, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::Track::residuals(), rHits_, rTrackExtras_, rTracks_, rTrajectories_, reco::Track::seedDirection(), reco::Track::seedRef(), select(), selHits_, selTrackExtras_, selTracks_, selTrajs_, selTTAss_, reco::TrackExtraBase::setHits(), setQualityBit_, reco::TrackExtra::setResiduals(), reco::TrackExtraBase::setTrajParams(), src_, srcTass_, srcTraj_, AlCaHLTBitMon_QueryRunRegistry::string, and trackRefs_.

156 {
157  using namespace std;
158  using namespace edm;
159  using namespace reco;
160 
161  Handle<TrackCollection> hSrcTrack;
165 
166  // looking for the beam spot
168  evt.getByToken(beamspot_, hBsp);
169  reco::BeamSpot vertexBeamSpot;
170  vertexBeamSpot = *hBsp;
171 
172  // Get tracks
173  evt.getByToken( src_, hSrcTrack );
174 
175  selTracks_ = std::make_unique<TrackCollection>();
177  if (copyExtras_) {
178  selTrackExtras_ = std::make_unique<TrackExtraCollection>();
179  selHits_ = std::make_unique<TrackingRecHitCollection>();
182  }
183 
184  if (copyTrajectories_) trackRefs_.resize(hSrcTrack->size());
185 
186  // Loop over tracks
187  size_t current = 0;
188  for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++current) {
189  const Track & trk = * it;
190  // Check if this track passes cuts
191  bool ok = select(vertexBeamSpot, trk);
192  if (!ok) {
193  if (copyTrajectories_) trackRefs_[current] = reco::TrackRef();
194  if (!keepAllTracks_) continue;
195  }
196  selTracks_->push_back( Track( trk ) ); // clone and store
197  if (ok && setQualityBit_) selTracks_->back().setQuality(qualityToSet_);
198  if (copyExtras_) {
199  // TrackExtras
200  selTrackExtras_->push_back( TrackExtra( trk.outerPosition(), trk.outerMomentum(), trk.outerOk(),
201  trk.innerPosition(), trk.innerMomentum(), trk.innerOk(),
202  trk.outerStateCovariance(), trk.outerDetId(),
203  trk.innerStateCovariance(), trk.innerDetId(),
204  trk.seedDirection(), trk.seedRef() ) );
205  selTracks_->back().setExtra( TrackExtraRef( rTrackExtras_, selTrackExtras_->size() - 1) );
206  TrackExtra & tx = selTrackExtras_->back();
207  tx.setResiduals(trk.residuals());
208  // TrackingRecHits
209  auto const firstHitIndex = selHits_->size();
210  for( trackingRecHit_iterator hit = trk.recHitsBegin(); hit != trk.recHitsEnd(); ++ hit ) {
211  selHits_->push_back( (*hit)->clone() );
212  }
213  tx.setHits( rHits_, firstHitIndex, selHits_->size() - firstHitIndex );
214  tx.setTrajParams(trk.extra()->trajParams(),trk.extra()->chi2sX5());
215  }
216  if (copyTrajectories_) {
217  trackRefs_[current] = TrackRef(rTracks_, selTracks_->size() - 1);
218  }
219  }
220  if ( copyTrajectories_ ) {
223  evt.getByToken(srcTass_, hTTAss);
224  evt.getByToken(srcTraj_, hTraj);
225  selTrajs_ = std::make_unique<std::vector<Trajectory>>();
226  rTrajectories_ = evt.getRefBeforePut< vector<Trajectory> >();
227  selTTAss_ = std::make_unique<TrajTrackAssociationCollection>(&evt.productGetter());
228  for (size_t i = 0, n = hTraj->size(); i < n; ++i) {
229  Ref< vector<Trajectory> > trajRef(hTraj, i);
231  if (match != hTTAss->end()) {
232  const Ref<TrackCollection> &trkRef = match->val;
233  short oldKey = static_cast<short>(trkRef.key());
234  if (trackRefs_[oldKey].isNonnull()) {
235  selTrajs_->push_back( Trajectory(*trajRef) );
236  selTTAss_->insert ( Ref< vector<Trajectory> >(rTrajectories_, selTrajs_->size() - 1), trackRefs_[oldKey] );
237  }
238  }
239  }
240  }
241 
242  static const std::string emptyString;
243  evt.put(std::move(selTracks_));
244  if (copyExtras_ ) {
246  evt.put(std::move(selHits_));
247  }
248  if ( copyTrajectories_ ) {
249  evt.put(std::move(selTrajs_));
250  evt.put(std::move(selTTAss_));
251  }
252 }
const edm::RefToBase< TrajectorySeed > & seedRef() const
Definition: Track.h:213
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:189
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
TrackBase::TrackQuality qualityToSet_
void setHits(TrackingRecHitRefProd const &prod, unsigned firstH, unsigned int nH)
std::unique_ptr< TrajTrackAssociationCollection > selTTAss_
EDProductGetter const & productGetter() const
Definition: Event.cc:81
const_iterator find(const key_type &k) const
find element with specified reference key
reco::TrackExtraRefProd rTrackExtras_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::EDGetTokenT< reco::BeamSpot > beamspot_
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:50
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:17
key_type key() const
Accessor for product key.
Definition: Ref.h:265
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
std::unique_ptr< TrackingRecHitCollection > selHits_
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
edm::RefProd< std::vector< Trajectory > > rTrajectories_
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Definition: Track.h:75
TrackingRecHitRefProd rHits_
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Definition: Track.h:94
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
RefProd< PROD > getRefBeforePut()
Definition: Event.h:147
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:11
std::unique_ptr< std::vector< Trajectory > > selTrajs_
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:70
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:45
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
Definition: Track.h:204
bool select(const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk)
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
Definition: Track.h:80
static std::string const emptyString("")
fixed size matrix
HLT enums.
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:60
const TrackResiduals & residuals() const
get the residuals
Definition: Track.h:218
edm::EDGetTokenT< reco::TrackCollection > src_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
Definition: Track.h:99
reco::TrackRefProd rTracks_
std::vector< reco::TrackRef > trackRefs_
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< reco::TrackCollection > selTracks_
void setTrajParams(TrajParams tmps, Chi2sFive chi2s)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
void setResiduals(const TrackResiduals &r)
set the residuals
Definition: TrackExtra.h:174
bool CosmicTrackSelector::select ( const reco::BeamSpot vertexBeamSpot,
const reco::Track tk 
)
private

Definition at line 255 of file CosmicTrackSelector.cc.

References funct::abs(), chi2n, chi2n_par_, allConversions_cfi::d0, DEFINE_FWK_MODULE, reco::TrackBase::dxy(), PVValHelper::dz, reco::TrackBase::dz(), PVValHelper::eta, reco::TrackBase::eta(), reco::TrackBase::hitPattern(), triggerObjects_cff::id, createfilelist::int, max_d0_, max_eta_, max_lostLayers_, max_z0_, min_3Dlayers_, min_layers_, min_nHit_, min_nPixelHit_, min_pt_, nlayers, reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, reco::HitPattern::pixelLayersWithMeasurement(), reco::BeamSpot::position(), EnergyCorrector::pt, reco::TrackBase::pt(), rpcPointValidation_cfi::recHit, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::HitPattern::TRACK_HITS, reco::HitPattern::trackerLayersWithMeasurement(), and reco::HitPattern::trackerLayersWithoutMeasurement().

Referenced by produce().

255  {
256  // Decide if the given track passes selection cuts.
257 
258  using namespace std;
259 
260  // Cuts on numbers of layers with hits/3D hits/lost hits.
262  uint32_t nlayers3D = tk.hitPattern().pixelLayersWithMeasurement() +
265 
266  // Get the number of valid hits and PixelHits
267  uint32_t nHit = 0;
268  uint32_t nPixelHit = 0;
270  if ( !((*recHit)->isValid()) ) continue;
271  ++nHit;
272  DetId id((*recHit)->geographicalId());
273  if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelBarrel
274  || (unsigned int)id.subdetId() == PixelSubdetector::PixelEndcap )
275  ++nPixelHit;
276  }
277 
278  // Cut on the number of valid hits
279  if (nHit < min_nHit_) return false;
280  // Cut on the number of valid Pixel hits
281  if (nPixelHit < min_nPixelHit_) return false;
282  if (nlayers < min_layers_) return false;
283  if (nlayers3D < min_3Dlayers_) return false;
284  if (nlayersLost > max_lostLayers_) return false;
285 
286  // Get track parameters
287  double pt = tk.pt(),eta = tk.eta(), chi2n = tk.normalizedChi2();
288  double d0 = -tk.dxy(vertexBeamSpot.position()), dz = tk.dz();
289 
290  // Absolute cuts on all tracks impact parameters with respect to beam-spot.
291  if (abs(d0) > max_d0_) return false;
292  if (abs(dz) > max_z0_) return false;
293 
294  // optimized cuts adapted to the track eta, pt and chiquare/ndof
295  if (abs(eta) > max_eta_) return false;
296  if (pt < min_pt_) return false;
297  if (chi2n > chi2n_par_*nlayers) return false;
298 
299 
300  else
301  return true;
302 
303 }
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:561
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:499
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:518
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:341
double pt() const
track transverse momentum
Definition: TrackBase.h:621
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:609
Definition: DetId.h:18
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:535
const Point & position() const
position
Definition: BeamSpot.h:62
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> CosmicTrackSelector::beamspot_
private

Definition at line 48 of file CosmicTrackSelector.cc.

Referenced by produce().

double CosmicTrackSelector::chi2n_par_
private

Definition at line 64 of file CosmicTrackSelector.cc.

Referenced by select().

bool CosmicTrackSelector::copyExtras_
private

Definition at line 50 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

bool CosmicTrackSelector::copyTrajectories_
private

Definition at line 52 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

bool CosmicTrackSelector::keepAllTracks_
private

Definition at line 57 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

double CosmicTrackSelector::max_d0_
private

Definition at line 67 of file CosmicTrackSelector.cc.

Referenced by select().

double CosmicTrackSelector::max_eta_
private

Definition at line 71 of file CosmicTrackSelector.cc.

Referenced by select().

uint32_t CosmicTrackSelector::max_lostLayers_
private

Definition at line 79 of file CosmicTrackSelector.cc.

Referenced by select().

double CosmicTrackSelector::max_z0_
private

Definition at line 68 of file CosmicTrackSelector.cc.

Referenced by select().

uint32_t CosmicTrackSelector::min_3Dlayers_
private

Definition at line 78 of file CosmicTrackSelector.cc.

Referenced by select().

uint32_t CosmicTrackSelector::min_layers_
private

Definition at line 77 of file CosmicTrackSelector.cc.

Referenced by select().

uint32_t CosmicTrackSelector::min_nHit_
private

Definition at line 73 of file CosmicTrackSelector.cc.

Referenced by select().

uint32_t CosmicTrackSelector::min_nPixelHit_
private

Definition at line 75 of file CosmicTrackSelector.cc.

Referenced by select().

double CosmicTrackSelector::min_pt_
private

Definition at line 70 of file CosmicTrackSelector.cc.

Referenced by select().

TrackBase::TrackQuality CosmicTrackSelector::qualityToSet_
private

Definition at line 60 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

std::vector<double> CosmicTrackSelector::res_par_
private

Definition at line 63 of file CosmicTrackSelector.cc.

TrackingRecHitRefProd CosmicTrackSelector::rHits_
private

Definition at line 90 of file CosmicTrackSelector.cc.

Referenced by produce().

reco::TrackExtraRefProd CosmicTrackSelector::rTrackExtras_
private

Definition at line 89 of file CosmicTrackSelector.cc.

Referenced by produce().

reco::TrackRefProd CosmicTrackSelector::rTracks_
private

Definition at line 88 of file CosmicTrackSelector.cc.

Referenced by produce().

edm::RefProd< std::vector<Trajectory> > CosmicTrackSelector::rTrajectories_
private

Definition at line 91 of file CosmicTrackSelector.cc.

Referenced by produce().

std::unique_ptr<TrackingRecHitCollection> CosmicTrackSelector::selHits_
private

Definition at line 84 of file CosmicTrackSelector.cc.

Referenced by produce().

std::unique_ptr<reco::TrackExtraCollection> CosmicTrackSelector::selTrackExtras_
private

Definition at line 83 of file CosmicTrackSelector.cc.

Referenced by produce().

std::unique_ptr<reco::TrackCollection> CosmicTrackSelector::selTracks_
private

Definition at line 82 of file CosmicTrackSelector.cc.

Referenced by produce().

std::unique_ptr<std::vector<const Trajectory *> > CosmicTrackSelector::selTrajPtrs_
private

Definition at line 86 of file CosmicTrackSelector.cc.

std::unique_ptr<std::vector<Trajectory> > CosmicTrackSelector::selTrajs_
private

Definition at line 85 of file CosmicTrackSelector.cc.

Referenced by produce().

std::unique_ptr<TrajTrackAssociationCollection > CosmicTrackSelector::selTTAss_
private

Definition at line 87 of file CosmicTrackSelector.cc.

Referenced by produce().

bool CosmicTrackSelector::setQualityBit_
private

Definition at line 59 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

edm::EDGetTokenT<reco::TrackCollection> CosmicTrackSelector::src_
private

Definition at line 47 of file CosmicTrackSelector.cc.

Referenced by produce().

edm::EDGetTokenT<TrajTrackAssociationCollection > CosmicTrackSelector::srcTass_
private

Definition at line 54 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

edm::EDGetTokenT<std::vector<Trajectory> > CosmicTrackSelector::srcTraj_
private

Definition at line 53 of file CosmicTrackSelector.cc.

Referenced by CosmicTrackSelector(), and produce().

std::vector<reco::TrackRef> CosmicTrackSelector::trackRefs_
private

Definition at line 92 of file CosmicTrackSelector.cc.

Referenced by produce().