CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
AlignmentTrackSelector Class Reference

#include <AlignmentTrackSelector.h>

Classes

struct  ComparePt
 compare two tracks in pt (used by theNHighestPtTracks) More...
 

Public Types

typedef std::vector< const reco::Track * > Tracks
 

Public Member Functions

 AlignmentTrackSelector (const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
 constructor More...
 
Tracks select (const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
 select tracks More...
 
bool useThisFilter ()
 returns if any of the Filters is used. More...
 
 ~AlignmentTrackSelector ()
 destructor More...
 

Private Member Functions

Tracks basicCuts (const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
 apply basic cuts on pt,eta,phi,nhit More...
 
Tracks checkPrescaledHits (const Tracks &tracks, const edm::Event &evt) const
 
bool detailedHitsCheck (const reco::Track *track, const edm::Event &evt, const edm::EventSetup &eSetup) const
 checking hit requirements beyond simple number of valid hits More...
 
bool isHit2D (const TrackingRecHit &hit) const
 
bool isIsolated (const TrackingRecHit *therechit, const edm::Event &evt) const
 
bool isOkCharge (const TrackingRecHit *therechit) const
 if valid, check for minimum charge (currently only in strip), if invalid give true More...
 
bool isOkChargeStripHit (const SiStripRecHit1D &siStripRecHit1D) const
 
bool isOkChargeStripHit (const SiStripRecHit2D &siStripRecHit2D) const
 
bool isOkTrkQuality (const reco::Track *track) const
 
Tracks theNHighestPtTracks (const Tracks &tracks) const
 filter the n highest pt tracks More...
 

Private Attributes

const bool applyBasicCuts_
 
const bool applyIsolation_
 
bool applyIterStepCheck_
 
const bool applyMultiplicityFilter_
 
const bool applyNHighestPt_
 
const bool applyPrescaledHitsFilter_
 
bool applyTrkQualityCheck_
 
const bool chargeCheck_
 
const double chi2nMax_
 
const edm::InputTag clusterValueMapTag_
 
edm::EDGetTokenT< AliClusterValueMapclusterValueMapToken_
 
const bool countStereoHitAs2D_
 
const double d0Max_
 
const double d0Min_
 
const double dzMax_
 
const double dzMin_
 
const double etaMax_
 
const double etaMin_
 
edm::EDGetTokenT< SiStripMatchedRecHit2DCollectionmatchedrecHitsToken_
 
const double maxHitDiffEndcaps_
 
const int maxMultiplicity_
 
const double minHitChargeStrip_
 
const double minHitIsolation_
 
const int minHitsinBPIX_
 
const int minHitsinENDCAP_
 
const int minHitsinENDCAPminus_
 
const int minHitsinENDCAPplus_
 
const int minHitsinFPIX_
 
const int minHitsinFPIXminus_
 
const int minHitsinFPIXplus_
 
const int minHitsinPIX_
 
const int minHitsinTEC_
 
const int minHitsinTECminus_
 
const int minHitsinTECplus_
 
const int minHitsinTIB_
 
const int minHitsinTID_
 
const int minHitsinTIDminus_
 
const int minHitsinTIDplus_
 
const int minHitsinTOB_
 
const int minMultiplicity_
 
const int minPrescaledHits_
 
const bool multiplicityOnInput_
 
const int nHighestPt_
 
const double nHitMax_
 
const unsigned int nHitMin2D_
 
const double nHitMin_
 
const double nLostHitMax_
 
const double phiMax_
 
const double phiMin_
 
const double pMax_
 
const double pMin_
 
ComparePt ptComparator
 
const double ptMax_
 
const double ptMin_
 if true, cut min/maxMultiplicity on input instead of on final result More...
 
std::vector< double > RorZofFirstHitMax_
 
std::vector< double > RorZofFirstHitMin_
 
std::vector< double > RorZofLastHitMax_
 
std::vector< double > RorZofLastHitMin_
 
edm::EDGetTokenT< SiStripRecHit2DCollectionrphirecHitsToken_
 
const int seedOnlyFromAbove_
 
const int theCharge_
 
std::vector< reco::TrackBase::TrackQualitytrkQualities_
 
std::vector< reco::TrackBase::TrackAlgorithmtrkSteps_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 

Detailed Description

Definition at line 25 of file AlignmentTrackSelector.h.

Member Typedef Documentation

◆ Tracks

typedef std::vector<const reco::Track*> AlignmentTrackSelector::Tracks

Definition at line 27 of file AlignmentTrackSelector.h.

Constructor & Destructor Documentation

◆ AlignmentTrackSelector()

AlignmentTrackSelector::AlignmentTrackSelector ( const edm::ParameterSet cfg,
edm::ConsumesCollector iC 
)

constructor

Definition at line 30 of file AlignmentTrackSelector.cc.

References reco::TrackBase::algoByName(), applyBasicCuts_, applyIsolation_, applyIterStepCheck_, applyMultiplicityFilter_, applyNHighestPt_, applyPrescaledHitsFilter_, applyTrkQualityCheck_, looper::cfg, chargeCheck_, chi2nMax_, clusterValueMapTag_, clusterValueMapToken_, edm::ConsumesCollector::consumes(), countStereoHitAs2D_, etaMax_, etaMin_, Exception, mps_fire::i, matchedrecHitsToken_, maxHitDiffEndcaps_, maxMultiplicity_, minHitChargeStrip_, minHitIsolation_, minHitsinBPIX_, minHitsinENDCAP_, minHitsinENDCAPminus_, minHitsinENDCAPplus_, minHitsinFPIX_, minHitsinFPIXminus_, minHitsinFPIXplus_, minHitsinPIX_, minHitsinTEC_, minHitsinTECminus_, minHitsinTECplus_, minHitsinTIB_, minHitsinTID_, minHitsinTIDminus_, minHitsinTIDplus_, minHitsinTOB_, minMultiplicity_, minPrescaledHits_, multiplicityOnInput_, nHighestPt_, nHitMax_, nHitMin2D_, nHitMin_, nLostHitMax_, phiMax_, phiMin_, pMax_, pMin_, ptMax_, ptMin_, qualities, reco::TrackBase::qualityByName(), RorZofFirstHitMax_, RorZofFirstHitMin_, RorZofLastHitMax_, RorZofLastHitMin_, rphirecHitsToken_, AlCaHLTBitMon_QueryRunRegistry::string, trkQualities_, and trkSteps_.

31  : tTopoToken_(iC.esConsumes()),
32  applyBasicCuts_(cfg.getParameter<bool>("applyBasicCuts")),
33  applyNHighestPt_(cfg.getParameter<bool>("applyNHighestPt")),
34  applyMultiplicityFilter_(cfg.getParameter<bool>("applyMultiplicityFilter")),
35  seedOnlyFromAbove_(cfg.getParameter<int>("seedOnlyFrom")),
36  applyIsolation_(cfg.getParameter<bool>("applyIsolationCut")),
37  chargeCheck_(cfg.getParameter<bool>("applyChargeCheck")),
38  nHighestPt_(cfg.getParameter<int>("nHighestPt")),
39  minMultiplicity_(cfg.getParameter<int>("minMultiplicity")),
40  maxMultiplicity_(cfg.getParameter<int>("maxMultiplicity")),
41  multiplicityOnInput_(cfg.getParameter<bool>("multiplicityOnInput")),
42  ptMin_(cfg.getParameter<double>("ptMin")),
43  ptMax_(cfg.getParameter<double>("ptMax")),
44  pMin_(cfg.getParameter<double>("pMin")),
45  pMax_(cfg.getParameter<double>("pMax")),
46  etaMin_(cfg.getParameter<double>("etaMin")),
47  etaMax_(cfg.getParameter<double>("etaMax")),
48  phiMin_(cfg.getParameter<double>("phiMin")),
49  phiMax_(cfg.getParameter<double>("phiMax")),
50  nHitMin_(cfg.getParameter<double>("nHitMin")),
51  nHitMax_(cfg.getParameter<double>("nHitMax")),
52  chi2nMax_(cfg.getParameter<double>("chi2nMax")),
53  d0Min_(cfg.getParameter<double>("d0Min")),
54  d0Max_(cfg.getParameter<double>("d0Max")),
55  dzMin_(cfg.getParameter<double>("dzMin")),
56  dzMax_(cfg.getParameter<double>("dzMax")),
57  theCharge_(cfg.getParameter<int>("theCharge")),
58  minHitChargeStrip_(cfg.getParameter<double>("minHitChargeStrip")),
59  minHitIsolation_(cfg.getParameter<double>("minHitIsolation")),
60  countStereoHitAs2D_(cfg.getParameter<bool>("countStereoHitAs2D")),
61  nHitMin2D_(cfg.getParameter<unsigned int>("nHitMin2D")),
62  // Ugly to use the same getParameter n times, but this allows const cut variables...
63  minHitsinTIB_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTIB")),
64  minHitsinTOB_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTOB")),
65  minHitsinTID_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTID")),
66  minHitsinTEC_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTEC")),
67  minHitsinBPIX_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inBPIX")),
68  minHitsinFPIX_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inFPIX")),
69  minHitsinPIX_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inPIXEL")),
70  minHitsinTIDplus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTIDplus")),
71  minHitsinTIDminus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTIDminus")),
72  minHitsinTECplus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTECplus")),
73  minHitsinTECminus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inTECminus")),
74  minHitsinFPIXplus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inFPIXplus")),
75  minHitsinFPIXminus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inFPIXminus")),
76  minHitsinENDCAP_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inENDCAP")),
77  minHitsinENDCAPplus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inENDCAPplus")),
78  minHitsinENDCAPminus_(cfg.getParameter<edm::ParameterSet>("minHitsPerSubDet").getParameter<int>("inENDCAPminus")),
79  maxHitDiffEndcaps_(cfg.getParameter<double>("maxHitDiffEndcaps")),
80  nLostHitMax_(cfg.getParameter<double>("nLostHitMax")),
81  RorZofFirstHitMin_(cfg.getParameter<std::vector<double> >("RorZofFirstHitMin")),
82  RorZofFirstHitMax_(cfg.getParameter<std::vector<double> >("RorZofFirstHitMax")),
83  RorZofLastHitMin_(cfg.getParameter<std::vector<double> >("RorZofLastHitMin")),
84  RorZofLastHitMax_(cfg.getParameter<std::vector<double> >("RorZofLastHitMax")),
85  clusterValueMapTag_(cfg.getParameter<edm::InputTag>("hitPrescaleMapTag")),
86  minPrescaledHits_(cfg.getParameter<int>("minPrescaledHits")),
88  if (applyIsolation_) {
89  rphirecHitsToken_ = iC.consumes<SiStripRecHit2DCollection>(cfg.getParameter<edm::InputTag>("rphirecHits"));
91  iC.consumes<SiStripMatchedRecHit2DCollection>(cfg.getParameter<edm::InputTag>("matchedrecHits"));
92  }
93 
96  }
97 
98  //convert track quality from string to enum
99  std::vector<std::string> trkQualityStrings(cfg.getParameter<std::vector<std::string> >("trackQualities"));
101  if (!trkQualityStrings.empty()) {
102  applyTrkQualityCheck_ = true;
103  for (unsigned int i = 0; i < trkQualityStrings.size(); ++i) {
104  (qualities += trkQualityStrings[i]) += ", ";
105  trkQualities_.push_back(reco::TrackBase::qualityByName(trkQualityStrings[i]));
106  }
107  } else
108  applyTrkQualityCheck_ = false;
109 
110  std::vector<std::string> trkIterStrings(cfg.getParameter<std::vector<std::string> >("iterativeTrackingSteps"));
111  if (!trkIterStrings.empty()) {
112  applyIterStepCheck_ = true;
113  std::string tracksteps;
114  for (unsigned int i = 0; i < trkIterStrings.size(); ++i) {
115  (tracksteps += trkIterStrings[i]) += ", ";
116  trkSteps_.push_back(reco::TrackBase::algoByName(trkIterStrings[i]));
117  }
118  } else
119  applyIterStepCheck_ = false;
120 
121  if (applyBasicCuts_) {
122  edm::LogInfo("AlignmentTrackSelector")
123  << "applying basic track cuts ..."
124  << "\nptmin,ptmax: " << ptMin_ << "," << ptMax_ << "\npmin,pmax: " << pMin_ << "," << pMax_
125  << "\netamin,etamax: " << etaMin_ << "," << etaMax_ << "\nphimin,phimax: " << phiMin_ << "," << phiMax_
126  << "\nnhitmin,nhitmax: " << nHitMin_ << "," << nHitMax_ << "\nnlosthitmax: " << nLostHitMax_
127  << "\nnhitmin2D: " << nHitMin2D_ << (countStereoHitAs2D_ ? "," : ", not")
128  << " counting hits on SiStrip stereo modules as 2D"
129  << "\nchi2nmax: " << chi2nMax_;
130 
131  if (applyIsolation_)
132  edm::LogInfo("AlignmentTrackSelector")
133  << "only retain tracks isolated at least by " << minHitIsolation_ << " cm from other rechits";
134 
135  if (chargeCheck_)
136  edm::LogInfo("AlignmentTrackSelector")
137  << "only retain hits with at least " << minHitChargeStrip_ << " ADC counts of total cluster charge";
138 
139  edm::LogInfo("AlignmentTrackSelector")
140  << "Minimum number of hits in TIB/TID/TOB/TEC/BPIX/FPIX/PIXEL = " << minHitsinTIB_ << "/" << minHitsinTID_
141  << "/" << minHitsinTOB_ << "/" << minHitsinTEC_ << "/" << minHitsinBPIX_ << "/" << minHitsinFPIX_ << "/"
142  << minHitsinPIX_;
143 
144  edm::LogInfo("AlignmentTrackSelector")
145  << "Minimum number of hits in TID+/TID-/TEC+/TEC-/FPIX+/FPIX- = " << minHitsinTIDplus_ << "/"
147  << "/" << minHitsinFPIXminus_;
148 
149  edm::LogInfo("AlignmentTrackSelector")
150  << "Minimum number of hits in EndCap (TID+TEC)/EndCap+/EndCap- = " << minHitsinENDCAP_ << "/"
152 
153  edm::LogInfo("AlignmentTrackSelector")
154  << "Max value of |nHitsinENDCAPplus - nHitsinENDCAPminus| = " << maxHitDiffEndcaps_;
155 
156  if (!trkQualityStrings.empty()) {
157  edm::LogInfo("AlignmentTrackSelector") << "Select tracks with these qualities: " << qualities;
158  }
159  }
160 
161  if (applyNHighestPt_)
162  edm::LogInfo("AlignmentTrackSelector") << "filter N tracks with highest Pt N=" << nHighestPt_;
163 
165  edm::LogInfo("AlignmentTrackSelector")
166  << "apply multiplicity filter N>= " << minMultiplicity_ << "and N<= " << maxMultiplicity_ << " on "
167  << (multiplicityOnInput_ ? "input" : "output");
168 
170  edm::LogInfo("AlignmentTrackSelector") << "apply cut on number of prescaled hits N>= " << minPrescaledHits_
171  << " (prescale info from " << clusterValueMapTag_ << ")";
172  }
173 
174  // Checking whether cuts on positions of first and last track hits are defined properly
175  if (RorZofFirstHitMin_.size() != 2) {
176  throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
177  << "Wrong configuration of 'RorZofFirstHitMin'."
178  << " Must have exactly 2 values instead of configured "
179  << RorZofFirstHitMin_.size() << ")";
180  } else {
181  RorZofFirstHitMin_.at(0) = std::fabs(RorZofFirstHitMin_.at(0));
182  RorZofFirstHitMin_.at(1) = std::fabs(RorZofFirstHitMin_.at(1));
183  }
184  if (RorZofFirstHitMax_.size() != 2) {
185  throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
186  << "Wrong configuration of 'RorZofFirstHitMax'."
187  << " Must have exactly 2 values instead of configured "
188  << RorZofFirstHitMax_.size() << ")";
189  } else {
190  RorZofFirstHitMax_.at(0) = std::fabs(RorZofFirstHitMax_.at(0));
191  RorZofFirstHitMax_.at(1) = std::fabs(RorZofFirstHitMax_.at(1));
192  }
193  if (RorZofLastHitMin_.size() != 2) {
194  throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
195  << "Wrong configuration of 'RorZofLastHitMin'."
196  << " Must have exactly 2 values instead of configured "
197  << RorZofLastHitMin_.size() << ")";
198  } else {
199  RorZofLastHitMin_.at(0) = std::fabs(RorZofLastHitMin_.at(0));
200  RorZofLastHitMin_.at(1) = std::fabs(RorZofLastHitMin_.at(1));
201  }
202  if (RorZofLastHitMax_.size() != 2) {
203  throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
204  << "Wrong configuration of 'RorZofLastHitMax'."
205  << " Must have exactly 2 values instead of configured "
206  << RorZofLastHitMax_.size() << ")";
207  } else {
208  RorZofLastHitMax_.at(0) = std::fabs(RorZofLastHitMax_.at(0));
209  RorZofLastHitMax_.at(1) = std::fabs(RorZofLastHitMax_.at(1));
210  }
211  // If first hit set to be at larger distance then the last hit
212  if (RorZofFirstHitMin_.at(0) > RorZofLastHitMax_.at(0) && RorZofFirstHitMin_.at(1) > RorZofLastHitMax_.at(1)) {
213  throw cms::Exception("BadConfig") << "@SUB=AlignmentTrackSelector::AlignmentTrackSelector"
214  << "Position of the first hit is set to larger distance than the last hit:."
215  << " First hit(min): [" << RorZofFirstHitMin_.at(0) << ", "
216  << RorZofFirstHitMin_.at(1) << "]; Last hit(max): [" << RorZofLastHitMax_.at(0)
217  << ", " << RorZofLastHitMax_.at(1) << "];";
218  }
219 }
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< double > RorZofFirstHitMax_
std::string encode() const
Definition: InputTag.cc:159
std::vector< reco::TrackBase::TrackAlgorithm > trkSteps_
std::vector< reco::TrackBase::TrackQuality > trkQualities_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const unsigned int nHitMin2D_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
std::vector< double > RorZofLastHitMin_
edm::EDGetTokenT< AliClusterValueMap > clusterValueMapToken_
const char * qualities[3]
std::vector< double > RorZofFirstHitMin_
Log< level::Info, false > LogInfo
const double ptMin_
if true, cut min/maxMultiplicity on input instead of on final result
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
const edm::InputTag clusterValueMapTag_
static TrackAlgorithm algoByName(const std::string &name)
Definition: TrackBase.cc:137
std::vector< double > RorZofLastHitMax_

◆ ~AlignmentTrackSelector()

AlignmentTrackSelector::~AlignmentTrackSelector ( )
default

destructor

Member Function Documentation

◆ basicCuts()

AlignmentTrackSelector::Tracks AlignmentTrackSelector::basicCuts ( const Tracks tracks,
const edm::Event evt,
const edm::EventSetup eSetup 
) const
private

apply basic cuts on pt,eta,phi,nhit

Definition at line 267 of file AlignmentTrackSelector.cc.

References applyIterStepCheck_, applyTrkQualityCheck_, reco::TrackBase::charge(), chi2n, chi2nMax_, d0, reco::TrackBase::d0(), d0Min_, detailedHitsCheck(), PVValHelper::dz, reco::TrackBase::dz(), dzMax_, dzMin_, PVValHelper::eta, reco::TrackBase::eta(), etaMin_, isOkTrkQuality(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, nHitMax_, nHitMin_, nLostHitMax_, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfLostHits(), reco::TrackBase::numberOfValidHits(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), phi, reco::TrackBase::phi(), phiMin_, pMin_, DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::pt(), ptMin_, submitPVResolutionJobs::q, mps_fire::result, theCharge_, and DiMuonV_cfg::tracks.

Referenced by select().

269  {
270  Tracks result;
271 
272  for (Tracks::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
273  const reco::Track* trackp = *it;
274  float pt = trackp->pt();
275  float p = trackp->p();
276  float eta = trackp->eta();
277  float phi = trackp->phi();
278  int nhit = trackp->numberOfValidHits();
279  int nlosthit = trackp->numberOfLostHits();
280  float chi2n = trackp->normalizedChi2();
281 
282  int q = trackp->charge();
283  bool isChargeOk = false;
284  if (theCharge_ == -1 && q < 0)
285  isChargeOk = true;
286  else if (theCharge_ == 1 && q > 0)
287  isChargeOk = true;
288  else if (theCharge_ == 0)
289  isChargeOk = true;
290 
291  float d0 = trackp->d0();
292  float dz = trackp->dz();
293 
294  // edm::LogDebug("AlignmentTrackSelector") << " pt,eta,phi,nhit: "
295  // <<pt<<","<<eta<<","<<phi<<","<<nhit;
296 
297  if (pt > ptMin_ && pt < ptMax_ && p > pMin_ && p < pMax_ && eta > etaMin_ && eta < etaMax_ && phi > phiMin_ &&
298  phi < phiMax_ && nhit >= nHitMin_ && nhit <= nHitMax_ && nlosthit <= nLostHitMax_ && chi2n < chi2nMax_ &&
299  isChargeOk && d0 >= d0Min_ && d0 <= d0Max_ && dz >= dzMin_ && dz <= dzMax_) {
300  bool trkQualityOk = false;
302  trkQualityOk = true; // nothing required
303  else
304  trkQualityOk = this->isOkTrkQuality(trackp);
305 
306  bool hitsCheckOk = this->detailedHitsCheck(trackp, evt, eSetup);
307 
308  if (trkQualityOk && hitsCheckOk)
309  result.push_back(trackp);
310  }
311  }
312 
313  return result;
314 }
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
double p() const
momentum vector magnitude
Definition: TrackBase.h:631
std::vector< const reco::Track * > Tracks
double pt() const
track transverse momentum
Definition: TrackBase.h:637
int charge() const
track electric charge
Definition: TrackBase.h:596
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:622
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
bool detailedHitsCheck(const reco::Track *track, const edm::Event &evt, const edm::EventSetup &eSetup) const
checking hit requirements beyond simple number of valid hits
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:801
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
const double ptMin_
if true, cut min/maxMultiplicity on input instead of on final result
static constexpr float d0
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:611
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:593
bool isOkTrkQuality(const reco::Track *track) const

◆ checkPrescaledHits()

AlignmentTrackSelector::Tracks AlignmentTrackSelector::checkPrescaledHits ( const Tracks tracks,
const edm::Event evt 
) const
private

Definition at line 668 of file AlignmentTrackSelector.cc.

References SiStripRecHit1D::cluster(), SiStripRecHit2D::cluster(), clusterValueMapToken_, RemoveAddSevLevel::flag, edm::Event::getByToken(), kBPIX, kFPIX, minPrescaledHits_, pixelClusterTagInfos_cfi::pixelhit, mps_fire::result, DetId::subdetId(), and DiMuonV_cfg::tracks.

Referenced by select().

669  {
670  Tracks result;
671 
672  //take Cluster-Flag Assomap
675  const AliClusterValueMap& flagMap = *fMap;
676 
677  //for each track loop on hits and count the number of taken hits
678  for (auto const& trackp : tracks) {
679  int ntakenhits = 0;
680  // float pt=trackp->pt();
681 
682  for (auto const& hit : trackp->recHits()) {
683  if (!hit->isValid())
684  continue;
685  DetId detid = hit->geographicalId();
686  int subDet = detid.subdetId();
688 
689  bool isPixelHit = (subDet == kFPIX || subDet == kBPIX);
690 
691  if (!isPixelHit) {
692  const std::type_info& type = typeid(*hit);
693 
694  if (type == typeid(SiStripRecHit2D)) {
695  const SiStripRecHit2D* striphit = dynamic_cast<const SiStripRecHit2D*>(hit);
696  if (striphit != nullptr) {
697  SiStripRecHit2D::ClusterRef stripclust(striphit->cluster());
698  flag = flagMap[stripclust];
699  }
700  } else if (type == typeid(SiStripRecHit1D)) {
701  const SiStripRecHit1D* striphit = dynamic_cast<const SiStripRecHit1D*>(hit);
702  if (striphit != nullptr) {
703  SiStripRecHit1D::ClusterRef stripclust(striphit->cluster());
704  flag = flagMap[stripclust];
705  }
706  } else {
707  edm::LogError("AlignmentTrackSelector")
708  << "ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Strip RecHit failed!"
709  << " Skipping this hit.";
710  continue;
711  }
712 
713  } //end if hit in Strips
714  else { // test explicitely BPIX/FPIX
715  const SiPixelRecHit* pixelhit = dynamic_cast<const SiPixelRecHit*>(hit);
716  if (pixelhit != nullptr) {
717  SiPixelRecHit::ClusterRef pixclust(pixelhit->cluster());
718  flag = flagMap[pixclust];
719  } else {
720  edm::LogError("AlignmentTrackSelector")
721  << "ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Pixel RecHit failed! ";
722  }
723  } //end else hit is in Pixel
724 
725  if (flag.isTaken())
726  ntakenhits++;
727 
728  } //end loop on hits
729  if (ntakenhits >= minPrescaledHits_)
730  result.push_back(trackp);
731  } //end loop on tracks
732 
733  return result;
734 } //end checkPrescaledHits
std::vector< const reco::Track * > Tracks
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
Log< level::Error, false > LogError
ClusterRef cluster() const
const int kFPIX
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
edm::EDGetTokenT< AliClusterValueMap > clusterValueMapToken_
Definition: DetId.h:17
ClusterRef cluster() const
Our base class.
Definition: SiPixelRecHit.h:23
const int kBPIX

◆ detailedHitsCheck()

bool AlignmentTrackSelector::detailedHitsCheck ( const reco::Track track,
const edm::Event evt,
const edm::EventSetup eSetup 
) const
private

checking hit requirements beyond simple number of valid hits

Definition at line 318 of file AlignmentTrackSelector.cc.

References funct::abs(), applyIsolation_, chargeCheck_, hcalRecHitTable_cff::detId, edm::EventSetup::getData(), reco::Track::innerPosition(), isHit2D(), isIsolated(), isOkCharge(), kBPIX, kFPIX, maxHitDiffEndcaps_, minHitsinBPIX_, minHitsinENDCAP_, minHitsinENDCAPminus_, minHitsinENDCAPplus_, minHitsinFPIX_, minHitsinFPIXminus_, minHitsinFPIXplus_, minHitsinPIX_, minHitsinTEC_, minHitsinTECminus_, minHitsinTECplus_, minHitsinTIB_, minHitsinTID_, minHitsinTIDminus_, minHitsinTIDplus_, minHitsinTOB_, nHitMin2D_, reco::Track::outerPosition(), TrackerTopology::pxfSide(), reco::Track::recHits(), RorZofFirstHitMax_, RorZofFirstHitMin_, RorZofLastHitMax_, RorZofLastHitMin_, seedOnlyFromAbove_, SiStripDetId::TEC, TrackerTopology::tecIsZMinusSide(), TrackerTopology::tecIsZPlusSide(), SiStripDetId::TIB, SiStripDetId::TID, TrackerTopology::tidIsZMinusSide(), TrackerTopology::tidIsZPlusSide(), SiStripDetId::TOB, DetId::Tracker, and tTopoToken_.

Referenced by basicCuts().

320  {
321  //Retrieve tracker topology from geometry
322  const TrackerTopology* const tTopo = &eSetup.getData(tTopoToken_);
323 
324  // checking hit requirements beyond simple number of valid hits
325 
330  (seedOnlyFromAbove_ == 1 || seedOnlyFromAbove_ == 2) || !RorZofFirstHitMin_.empty() ||
331  !RorZofFirstHitMax_.empty() || !RorZofLastHitMin_.empty() || !RorZofLastHitMax_.empty()) {
332  // any detailed hit cut is active, so have to check
333 
334  int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
335  int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0, nhitinPIXEL = 0;
336  int nhitinENDCAP = 0, nhitinENDCAPplus = 0, nhitinENDCAPminus = 0;
337  int nhitinTIDplus = 0, nhitinTIDminus = 0;
338  int nhitinFPIXplus = 0, nhitinFPIXminus = 0;
339  int nhitinTECplus = 0, nhitinTECminus = 0;
340  unsigned int nHit2D = 0;
341  unsigned int thishit = 0;
342 
343  for (auto const& hit : trackp->recHits()) {
344  thishit++;
345  const DetId detId(hit->geographicalId());
346  const int subdetId = detId.subdetId();
347 
348  // *** thishit == 1 means last hit in CTF ***
349  // (FIXME: assumption might change or not be valid for all tracking algorthms)
350  // ==> for cosmics
351  // seedOnlyFrom = 1 is TIB-TOB-TEC tracks only
352  // seedOnlyFrom = 2 is TOB-TEC tracks only
353  if (seedOnlyFromAbove_ == 1 && thishit == 1 &&
354  (subdetId == int(SiStripDetId::TOB) || subdetId == int(SiStripDetId::TEC))) {
355  return false;
356  }
357  if (seedOnlyFromAbove_ == 2 && thishit == 1 && subdetId == int(SiStripDetId::TIB)) {
358  return false;
359  }
360 
361  if (!hit->isValid())
362  continue; // only real hits count as in trackp->numberOfValidHits()
363  if (detId.det() != DetId::Tracker) {
364  edm::LogError("DetectorMismatch")
365  << "@SUB=AlignmentTrackSelector::detailedHitsCheck"
366  << "DetId.det() != DetId::Tracker (=" << DetId::Tracker << "), but " << detId.det() << ".";
367  }
368  if (chargeCheck_ && !(this->isOkCharge(hit)))
369  return false;
370  if (applyIsolation_ && (!this->isIsolated(hit, evt)))
371  return false;
372  if (SiStripDetId::TIB == subdetId)
373  ++nhitinTIB;
374  else if (SiStripDetId::TOB == subdetId)
375  ++nhitinTOB;
376  else if (SiStripDetId::TID == subdetId) {
377  ++nhitinTID;
378  ++nhitinENDCAP;
379 
380  if (tTopo->tidIsZMinusSide(detId)) {
381  ++nhitinTIDminus;
382  ++nhitinENDCAPminus;
383  } else if (tTopo->tidIsZPlusSide(detId)) {
384  ++nhitinTIDplus;
385  ++nhitinENDCAPplus;
386  }
387  } else if (SiStripDetId::TEC == subdetId) {
388  ++nhitinTEC;
389  ++nhitinENDCAP;
390 
391  if (tTopo->tecIsZMinusSide(detId)) {
392  ++nhitinTECminus;
393  ++nhitinENDCAPminus;
394  } else if (tTopo->tecIsZPlusSide(detId)) {
395  ++nhitinTECplus;
396  ++nhitinENDCAPplus;
397  }
398  } else if (kBPIX == subdetId) {
399  ++nhitinBPIX;
400  ++nhitinPIXEL;
401  } else if (kFPIX == subdetId) {
402  ++nhitinFPIX;
403  ++nhitinPIXEL;
404 
405  if (tTopo->pxfSide(detId) == 1)
406  ++nhitinFPIXminus;
407  else if (tTopo->pxfSide(detId) == 2)
408  ++nhitinFPIXplus;
409  }
410  // Do not call isHit2D(..) if already enough 2D hits for performance reason:
411  if (nHit2D < nHitMin2D_ && this->isHit2D(*hit))
412  ++nHit2D;
413  } // end loop on hits
414 
415  // Checking whether the track satisfies requirement of the first and last hit positions
416  bool passedLastHitPositionR = true;
417  bool passedLastHitPositionZ = true;
418  bool passedFirstHitPositionR = true;
419  bool passedFirstHitPositionZ = true;
420 
421  if (RorZofFirstHitMin_.at(0) != 0.0 || RorZofFirstHitMin_.at(1) != 0.0 || RorZofFirstHitMax_.at(0) != 999.0 ||
422  RorZofFirstHitMax_.at(1) != 999.0) {
423  const reco::TrackBase::Point& firstPoint(trackp->innerPosition());
424 
425  if ((std::fabs(firstPoint.R()) < RorZofFirstHitMin_.at(0)))
426  passedFirstHitPositionR = false;
427  if ((std::fabs(firstPoint.R()) > RorZofFirstHitMax_.at(0)))
428  passedFirstHitPositionR = false;
429  if ((std::fabs(firstPoint.Z()) < RorZofFirstHitMin_.at(1)))
430  passedFirstHitPositionZ = false;
431  if ((std::fabs(firstPoint.Z()) > RorZofFirstHitMax_.at(1)))
432  passedFirstHitPositionZ = false;
433  }
434 
435  if (RorZofLastHitMin_.at(0) != 0.0 || RorZofLastHitMin_.at(1) != 0.0 || RorZofLastHitMax_.at(0) != 999.0 ||
436  RorZofLastHitMax_.at(1) != 999.0) {
437  const reco::TrackBase::Point& lastPoint(trackp->outerPosition());
438 
439  if ((std::fabs(lastPoint.R()) < RorZofLastHitMin_.at(0)))
440  passedLastHitPositionR = false;
441  if ((std::fabs(lastPoint.R()) > RorZofLastHitMax_.at(0)))
442  passedLastHitPositionR = false;
443  if ((std::fabs(lastPoint.Z()) < RorZofLastHitMin_.at(1)))
444  passedLastHitPositionZ = false;
445  if ((std::fabs(lastPoint.Z()) > RorZofLastHitMax_.at(1)))
446  passedLastHitPositionZ = false;
447  }
448 
449  bool passedFirstHitPosition = passedFirstHitPositionR || passedFirstHitPositionZ;
450  bool passedLastHitPosition = passedLastHitPositionR || passedLastHitPositionZ;
451 
452  return (nhitinTIB >= minHitsinTIB_ && nhitinTOB >= minHitsinTOB_ && nhitinTID >= minHitsinTID_ &&
453  nhitinTEC >= minHitsinTEC_ && nhitinENDCAP >= minHitsinENDCAP_ &&
454  nhitinENDCAPplus >= minHitsinENDCAPplus_ && nhitinENDCAPminus >= minHitsinENDCAPminus_ &&
455  std::abs(nhitinENDCAPplus - nhitinENDCAPminus) <= maxHitDiffEndcaps_ &&
456  nhitinTIDplus >= minHitsinTIDplus_ && nhitinTIDminus >= minHitsinTIDminus_ &&
457  nhitinFPIXplus >= minHitsinFPIXplus_ && nhitinFPIXminus >= minHitsinFPIXminus_ &&
458  nhitinTECplus >= minHitsinTECplus_ && nhitinTECminus >= minHitsinTECminus_ &&
459  nhitinBPIX >= minHitsinBPIX_ && nhitinFPIX >= minHitsinFPIX_ && nhitinPIXEL >= minHitsinPIX_ &&
460  nHit2D >= nHitMin2D_ && passedFirstHitPosition && passedLastHitPosition);
461  } else { // no cuts set, so we are just fine and can avoid loop on hits
462  return true;
463  }
464 }
bool isIsolated(const TrackingRecHit *therechit, const edm::Event &evt) const
bool tidIsZPlusSide(const DetId &id) const
std::vector< double > RorZofFirstHitMax_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
static constexpr auto TID
Definition: SiStripDetId.h:38
bool tecIsZMinusSide(const DetId &id) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
const unsigned int nHitMin2D_
Log< level::Error, false > LogError
bool tidIsZMinusSide(const DetId &id) const
const int kFPIX
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
std::vector< double > RorZofLastHitMin_
static constexpr auto TOB
Definition: SiStripDetId.h:39
std::vector< double > RorZofFirstHitMin_
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
bool isOkCharge(const TrackingRecHit *therechit) const
if valid, check for minimum charge (currently only in strip), if invalid give true ...
bool tecIsZPlusSide(const DetId &id) const
static constexpr auto TIB
Definition: SiStripDetId.h:37
bool isHit2D(const TrackingRecHit &hit) const
std::vector< double > RorZofLastHitMax_
static constexpr auto TEC
Definition: SiStripDetId.h:40
const int kBPIX

◆ isHit2D()

bool AlignmentTrackSelector::isHit2D ( const TrackingRecHit hit) const
private

Definition at line 468 of file AlignmentTrackSelector.cc.

References countStereoHitAs2D_, hcalRecHitTable_cff::detId, kBPIX, kFPIX, ProjectedSiStripRecHit2D::originalHit(), SiStripDetId::stereo(), and DetId::Tracker.

Referenced by detailedHitsCheck().

468  {
469  // we count SiStrip stereo modules as 2D if selected via countStereoHitAs2D_
470  // (since they provide theta information)
471  if (!hit.isValid() || (hit.dimension() < 2 && !countStereoHitAs2D_ && !dynamic_cast<const SiStripRecHit1D*>(&hit))) {
472  return false; // real RecHit1D - but SiStripRecHit1D depends on countStereoHitAs2D_
473  } else {
474  const DetId detId(hit.geographicalId());
475  if (detId.det() == DetId::Tracker) {
476  if (detId.subdetId() == kBPIX || detId.subdetId() == kFPIX) {
477  return true; // pixel is always 2D
478  } else { // should be SiStrip now
479  const SiStripDetId stripId(detId);
480  if (stripId.stereo())
481  return countStereoHitAs2D_; // stereo modules
482  else if (dynamic_cast<const SiStripRecHit1D*>(&hit) || dynamic_cast<const SiStripRecHit2D*>(&hit))
483  return false; // rphi modules hit
484  //the following two are not used any more since ages...
485  else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
486  return true; // matched is 2D
487  else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit)) {
488  const ProjectedSiStripRecHit2D* pH = static_cast<const ProjectedSiStripRecHit2D*>(&hit);
489  return (countStereoHitAs2D_ && this->isHit2D(pH->originalHit())); // depends on original...
490  } else {
491  edm::LogError("UnknownType") << "@SUB=AlignmentTrackSelector::isHit2D"
492  << "Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
493  << "SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
494  return false;
495  }
496  }
497  } else { // not tracker??
498  edm::LogWarning("DetectorMismatch") << "@SUB=AlignmentTrackSelector::isHit2D"
499  << "Hit not in tracker with 'official' dimension >=2.";
500  return true; // dimension() >= 2 so accept that...
501  }
502  }
503  // never reached...
504 }
Log< level::Error, false > LogError
const int kFPIX
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
Definition: DetId.h:17
bool isHit2D(const TrackingRecHit &hit) const
SiStripRecHit2D originalHit() const
Log< level::Warning, false > LogWarning
const int kBPIX

◆ isIsolated()

bool AlignmentTrackSelector::isIsolated ( const TrackingRecHit therechit,
const edm::Event evt 
) const
private

Definition at line 599 of file AlignmentTrackSelector.cc.

References TrackingRecHit::geographicalId(), edm::Event::getByToken(), BaseTrackerRecHit::localPosition(), mag(), AlignmentTrackSelector_cfi::matchedrecHits, matchedrecHitsToken_, minHitIsolation_, DetId::rawId(), AlignmentTrackSelector_cfi::rphirecHits, and rphirecHitsToken_.

Referenced by detailedHitsCheck().

599  {
600  // FIXME:
601  // adapt to changes after introduction of SiStripRecHit1D...
602  //
603  // edm::ESHandle<TrackerGeometry> tracker;
606  // es.get<TrackerDigiGeometryRecord>().get(tracker);
609 
612  const SiStripRecHit2DCollection::DataContainer& stripcollSt = rphirecHits->data();
614 
615  DetId idet = hit->geographicalId();
616 
617  // FIXME: instead of looping the full hit collection, we should explore the features of
618  // SiStripRecHit2DCollection::rangeRphi = rphirecHits.get(idet) and loop
619  // only from rangeRphi.first until rangeRphi.second
620  for (istripSt = stripcollSt.begin(); istripSt != stripcollSt.end(); ++istripSt) {
621  const SiStripRecHit2D* aHit = &*(istripSt);
622  DetId mydet1 = aHit->geographicalId();
623  if (idet.rawId() != mydet1.rawId())
624  continue;
625  float theDistance = (hit->localPosition() - aHit->localPosition()).mag();
626  // std::cout << "theDistance1 = " << theDistance << "\n";
627  if (theDistance > 0.001 && theDistance < minHitIsolation_)
628  return false;
629  }
630 
631  // FIXME: see above
632  for (istripStm = stripcollStm.begin(); istripStm != stripcollStm.end(); ++istripStm) {
633  const SiStripMatchedRecHit2D* aHit = &*(istripStm);
634  DetId mydet2 = aHit->geographicalId();
635  if (idet.rawId() != mydet2.rawId())
636  continue;
637  float theDistance = (hit->localPosition() - aHit->localPosition()).mag();
638  // std::cout << "theDistance1 = " << theDistance << "\n";
639  if (theDistance > 0.001 && theDistance < minHitIsolation_)
640  return false;
641  }
642  return true;
643 }
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
std::vector< data_type > DataContainer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
DetId geographicalId() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
LocalPoint localPosition() const override

◆ isOkCharge()

bool AlignmentTrackSelector::isOkCharge ( const TrackingRecHit therechit) const
private

if valid, check for minimum charge (currently only in strip), if invalid give true

Definition at line 508 of file AlignmentTrackSelector.cc.

References l1ctLayer2EG_cff::id, isOkChargeStripHit(), kBPIX, kFPIX, SiStripMatchedRecHit2D::monoHit(), ProjectedSiStripRecHit2D::originalHit(), SiStripMatchedRecHit2D::stereoHit(), and DetId::Tracker.

Referenced by detailedHitsCheck().

508  {
509  if (!hit || !hit->isValid())
510  return true;
511 
512  // check det and subdet
513  const DetId id(hit->geographicalId());
514  if (id.det() != DetId::Tracker) {
515  edm::LogWarning("DetectorMismatch") << "@SUB=isOkCharge"
516  << "Hit not in tracker!";
517  return true;
518  }
519  if (id.subdetId() == kFPIX || id.subdetId() == kBPIX) {
520  return true; // might add some requirement...
521  }
522 
523  // We are in SiStrip now, so test normal hit:
524  const std::type_info& type = typeid(*hit);
525 
526  if (type == typeid(SiStripRecHit2D)) {
527  const SiStripRecHit2D* stripHit2D = dynamic_cast<const SiStripRecHit2D*>(hit);
528  if (stripHit2D) {
529  return this->isOkChargeStripHit(*stripHit2D);
530  }
531  } else if (type == typeid(SiStripRecHit1D)) {
532  const SiStripRecHit1D* stripHit1D = dynamic_cast<const SiStripRecHit1D*>(hit);
533  if (stripHit1D) {
534  return this->isOkChargeStripHit(*stripHit1D);
535  }
536  }
537 
538  else if (type ==
539  typeid(SiStripMatchedRecHit2D)) { // or matched (should not occur anymore due to hit splitting since 20X)
540  const SiStripMatchedRecHit2D* matchedHit = dynamic_cast<const SiStripMatchedRecHit2D*>(hit);
541  if (matchedHit) {
542  return (this->isOkChargeStripHit(matchedHit->monoHit()) && this->isOkChargeStripHit(matchedHit->stereoHit()));
543  }
544  } else if (type == typeid(ProjectedSiStripRecHit2D)) {
545  // or projected (should not occur anymore due to hit splitting since 20X):
546  const ProjectedSiStripRecHit2D* projHit = dynamic_cast<const ProjectedSiStripRecHit2D*>(hit);
547  if (projHit) {
548  return this->isOkChargeStripHit(projHit->originalHit());
549  }
550  } else {
551  edm::LogError("AlignmentTrackSelector") << "@SUB=isOkCharge"
552  << "Unknown type of a valid tracker hit in Strips "
553  << " SubDet = " << id.subdetId();
554  return false;
555  }
556 
557  // and now? SiTrackerMultiRecHit? Not here I guess!
558  // Should we throw instead?
559  edm::LogError("AlignmentTrackSelector") << "@SUB=isOkCharge"
560  << "Unknown valid tracker hit not in pixel, subdet " << id.subdetId()
561  << ", SiTrackerMultiRecHit " << dynamic_cast<const SiTrackerMultiRecHit*>(hit)
562  << ", BaseTrackerRecHit " << dynamic_cast<const BaseTrackerRecHit*>(hit);
563 
564  return true;
565 }
SiStripRecHit2D stereoHit() const
Log< level::Error, false > LogError
const int kFPIX
Definition: DetId.h:17
SiStripRecHit2D originalHit() const
SiStripRecHit2D monoHit() const
Log< level::Warning, false > LogWarning
bool isOkChargeStripHit(const SiStripRecHit1D &siStripRecHit1D) const
const int kBPIX

◆ isOkChargeStripHit() [1/2]

bool AlignmentTrackSelector::isOkChargeStripHit ( const SiStripRecHit1D siStripRecHit1D) const
private

Definition at line 584 of file AlignmentTrackSelector.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, SiStripRecHit1D::cluster(), and minHitChargeStrip_.

Referenced by isOkCharge().

584  {
585  double charge = 0.;
586 
587  SiStripRecHit1D::ClusterRef cluster(siStripRecHit1D.cluster());
588  const auto& amplitudes = cluster->amplitudes();
589 
590  for (size_t ia = 0; ia < amplitudes.size(); ++ia) {
591  charge += amplitudes[ia];
592  }
593 
594  return (charge >= minHitChargeStrip_);
595 }
ClusterRef cluster() const

◆ isOkChargeStripHit() [2/2]

bool AlignmentTrackSelector::isOkChargeStripHit ( const SiStripRecHit2D siStripRecHit2D) const
private

Definition at line 569 of file AlignmentTrackSelector.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, SiStripRecHit2D::cluster(), and minHitChargeStrip_.

569  {
570  double charge = 0.;
571 
572  SiStripRecHit2D::ClusterRef cluster(siStripRecHit2D.cluster());
573  const auto& amplitudes = cluster->amplitudes();
574 
575  for (size_t ia = 0; ia < amplitudes.size(); ++ia) {
576  charge += amplitudes[ia];
577  }
578 
579  return (charge >= minHitChargeStrip_);
580 }
ClusterRef cluster() const

◆ isOkTrkQuality()

bool AlignmentTrackSelector::isOkTrkQuality ( const reco::Track track) const
private

Definition at line 738 of file AlignmentTrackSelector.cc.

References applyIterStepCheck_, applyTrkQualityCheck_, mps_fire::i, HLT_2024v12_cff::track, trkQualities_, and trkSteps_.

Referenced by basicCuts().

738  {
739  bool qualityOk = false;
740  bool iterStepOk = false;
741 
742  //check iterative step
743  if (applyIterStepCheck_) {
744  for (unsigned int i = 0; i < trkSteps_.size(); ++i) {
745  if (track->algo() == (trkSteps_[i])) {
746  iterStepOk = true;
747  }
748  }
749  } else
750  iterStepOk = true;
751 
752  //check track quality
753  if (applyTrkQualityCheck_) {
754  for (unsigned int i = 0; i < trkQualities_.size(); ++i) {
755  if (track->quality(trkQualities_[i])) {
756  qualityOk = true;
757  }
758  }
759  } else
760  qualityOk = true;
761 
762  return qualityOk && iterStepOk;
763 } //end check on track quality
std::vector< reco::TrackBase::TrackAlgorithm > trkSteps_
std::vector< reco::TrackBase::TrackQuality > trkQualities_

◆ select()

AlignmentTrackSelector::Tracks AlignmentTrackSelector::select ( const Tracks tracks,
const edm::Event evt,
const edm::EventSetup eSetup 
) const

select tracks

Definition at line 227 of file AlignmentTrackSelector.cc.

References applyBasicCuts_, applyMultiplicityFilter_, applyNHighestPt_, applyPrescaledHitsFilter_, basicCuts(), checkPrescaledHits(), maxMultiplicity_, minMultiplicity_, multiplicityOnInput_, mps_fire::result, theNHighestPtTracks(), and DiMuonV_cfg::tracks.

Referenced by TrackConfigSelector::select().

229  {
231  (tracks.size() < static_cast<unsigned int>(minMultiplicity_) ||
232  tracks.size() > static_cast<unsigned int>(maxMultiplicity_))) {
233  return Tracks(); // empty collection
234  }
235 
236  Tracks result = tracks;
237  // apply basic track cuts (if selected)
238  if (applyBasicCuts_)
239  result = this->basicCuts(result, evt, eSetup);
240 
241  // filter N tracks with highest Pt (if selected)
242  if (applyNHighestPt_)
243  result = this->theNHighestPtTracks(result);
244 
245  // apply minimum multiplicity requirement (if selected)
247  if (result.size() < static_cast<unsigned int>(minMultiplicity_) ||
248  result.size() > static_cast<unsigned int>(maxMultiplicity_)) {
249  result.clear();
250  }
251  }
252 
254  result = this->checkPrescaledHits(result, evt);
255  }
256 
257  return result;
258 }
Tracks checkPrescaledHits(const Tracks &tracks, const edm::Event &evt) const
Tracks theNHighestPtTracks(const Tracks &tracks) const
filter the n highest pt tracks
Tracks basicCuts(const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
apply basic cuts on pt,eta,phi,nhit
std::vector< const reco::Track * > Tracks

◆ theNHighestPtTracks()

AlignmentTrackSelector::Tracks AlignmentTrackSelector::theNHighestPtTracks ( const Tracks tracks) const
private

filter the n highest pt tracks

Definition at line 647 of file AlignmentTrackSelector.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiodumpmetadata::n, nHighestPt_, ptComparator, mps_fire::result, jetUpdater_cfi::sort, and DiMuonV_cfg::tracks.

Referenced by select().

647  {
648  Tracks sortedTracks = tracks;
649  Tracks result;
650 
651  // sort in pt
652  std::sort(sortedTracks.begin(), sortedTracks.end(), ptComparator);
653 
654  // copy theTrackMult highest pt tracks to result vector
655  int n = 0;
656  for (Tracks::const_iterator it = sortedTracks.begin(); it != sortedTracks.end(); ++it) {
657  if (n < nHighestPt_) {
658  result.push_back(*it);
659  n++;
660  }
661  }
662 
663  return result;
664 }
std::vector< const reco::Track * > Tracks

◆ useThisFilter()

bool AlignmentTrackSelector::useThisFilter ( )

Member Data Documentation

◆ applyBasicCuts_

const bool AlignmentTrackSelector::applyBasicCuts_
private

Definition at line 67 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), select(), and useThisFilter().

◆ applyIsolation_

const bool AlignmentTrackSelector::applyIsolation_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ applyIterStepCheck_

bool AlignmentTrackSelector::applyIterStepCheck_
private

Definition at line 101 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), basicCuts(), and isOkTrkQuality().

◆ applyMultiplicityFilter_

const bool AlignmentTrackSelector::applyMultiplicityFilter_
private

Definition at line 67 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), select(), and useThisFilter().

◆ applyNHighestPt_

const bool AlignmentTrackSelector::applyNHighestPt_
private

Definition at line 67 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), select(), and useThisFilter().

◆ applyPrescaledHitsFilter_

const bool AlignmentTrackSelector::applyPrescaledHitsFilter_
private

Definition at line 95 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), select(), and useThisFilter().

◆ applyTrkQualityCheck_

bool AlignmentTrackSelector::applyTrkQualityCheck_
private

Definition at line 100 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), basicCuts(), and isOkTrkQuality().

◆ chargeCheck_

const bool AlignmentTrackSelector::chargeCheck_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ chi2nMax_

const double AlignmentTrackSelector::chi2nMax_
private

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ clusterValueMapTag_

const edm::InputTag AlignmentTrackSelector::clusterValueMapTag_
private

Definition at line 92 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

◆ clusterValueMapToken_

edm::EDGetTokenT<AliClusterValueMap> AlignmentTrackSelector::clusterValueMapToken_
private

Definition at line 93 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and checkPrescaledHits().

◆ countStereoHitAs2D_

const bool AlignmentTrackSelector::countStereoHitAs2D_
private

Definition at line 78 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isHit2D().

◆ d0Max_

const double AlignmentTrackSelector::d0Max_
private

Definition at line 73 of file AlignmentTrackSelector.h.

◆ d0Min_

const double AlignmentTrackSelector::d0Min_
private

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

◆ dzMax_

const double AlignmentTrackSelector::dzMax_
private

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

◆ dzMin_

const double AlignmentTrackSelector::dzMin_
private

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

◆ etaMax_

const double AlignmentTrackSelector::etaMax_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

◆ etaMin_

const double AlignmentTrackSelector::etaMin_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ matchedrecHitsToken_

edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> AlignmentTrackSelector::matchedrecHitsToken_
private

Definition at line 77 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isIsolated().

◆ maxHitDiffEndcaps_

const double AlignmentTrackSelector::maxHitDiffEndcaps_
private

Definition at line 85 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ maxMultiplicity_

const int AlignmentTrackSelector::maxMultiplicity_
private

Definition at line 70 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and select().

◆ minHitChargeStrip_

const double AlignmentTrackSelector::minHitChargeStrip_
private

Definition at line 75 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isOkChargeStripHit().

◆ minHitIsolation_

const double AlignmentTrackSelector::minHitIsolation_
private

Definition at line 75 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isIsolated().

◆ minHitsinBPIX_

const int AlignmentTrackSelector::minHitsinBPIX_
private

Definition at line 81 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinENDCAP_

const int AlignmentTrackSelector::minHitsinENDCAP_
private

Definition at line 84 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinENDCAPminus_

const int AlignmentTrackSelector::minHitsinENDCAPminus_
private

Definition at line 84 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinENDCAPplus_

const int AlignmentTrackSelector::minHitsinENDCAPplus_
private

Definition at line 84 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinFPIX_

const int AlignmentTrackSelector::minHitsinFPIX_
private

Definition at line 81 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinFPIXminus_

const int AlignmentTrackSelector::minHitsinFPIXminus_
private

Definition at line 83 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinFPIXplus_

const int AlignmentTrackSelector::minHitsinFPIXplus_
private

Definition at line 83 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinPIX_

const int AlignmentTrackSelector::minHitsinPIX_
private

Definition at line 81 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTEC_

const int AlignmentTrackSelector::minHitsinTEC_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTECminus_

const int AlignmentTrackSelector::minHitsinTECminus_
private

Definition at line 82 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTECplus_

const int AlignmentTrackSelector::minHitsinTECplus_
private

Definition at line 82 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTIB_

const int AlignmentTrackSelector::minHitsinTIB_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTID_

const int AlignmentTrackSelector::minHitsinTID_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTIDminus_

const int AlignmentTrackSelector::minHitsinTIDminus_
private

Definition at line 82 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTIDplus_

const int AlignmentTrackSelector::minHitsinTIDplus_
private

Definition at line 82 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minHitsinTOB_

const int AlignmentTrackSelector::minHitsinTOB_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ minMultiplicity_

const int AlignmentTrackSelector::minMultiplicity_
private

Definition at line 70 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and select().

◆ minPrescaledHits_

const int AlignmentTrackSelector::minPrescaledHits_
private

Definition at line 94 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and checkPrescaledHits().

◆ multiplicityOnInput_

const bool AlignmentTrackSelector::multiplicityOnInput_
private

Definition at line 71 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and select().

◆ nHighestPt_

const int AlignmentTrackSelector::nHighestPt_
private

Definition at line 70 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and theNHighestPtTracks().

◆ nHitMax_

const double AlignmentTrackSelector::nHitMax_
private

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ nHitMin2D_

const unsigned int AlignmentTrackSelector::nHitMin2D_
private

Definition at line 79 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ nHitMin_

const double AlignmentTrackSelector::nHitMin_
private

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ nLostHitMax_

const double AlignmentTrackSelector::nLostHitMax_
private

Definition at line 86 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ phiMax_

const double AlignmentTrackSelector::phiMax_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

◆ phiMin_

const double AlignmentTrackSelector::phiMin_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ pMax_

const double AlignmentTrackSelector::pMax_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

◆ pMin_

const double AlignmentTrackSelector::pMin_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ ptComparator

ComparePt AlignmentTrackSelector::ptComparator
private

Definition at line 63 of file AlignmentTrackSelector.h.

Referenced by theNHighestPtTracks().

◆ ptMax_

const double AlignmentTrackSelector::ptMax_
private

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

◆ ptMin_

const double AlignmentTrackSelector::ptMin_
private

if true, cut min/maxMultiplicity on input instead of on final result

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

◆ RorZofFirstHitMax_

std::vector<double> AlignmentTrackSelector::RorZofFirstHitMax_
private

Definition at line 88 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ RorZofFirstHitMin_

std::vector<double> AlignmentTrackSelector::RorZofFirstHitMin_
private

Definition at line 87 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ RorZofLastHitMax_

std::vector<double> AlignmentTrackSelector::RorZofLastHitMax_
private

Definition at line 90 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ RorZofLastHitMin_

std::vector<double> AlignmentTrackSelector::RorZofLastHitMin_
private

Definition at line 89 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

◆ rphirecHitsToken_

edm::EDGetTokenT<SiStripRecHit2DCollection> AlignmentTrackSelector::rphirecHitsToken_
private

Definition at line 76 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isIsolated().

◆ seedOnlyFromAbove_

const int AlignmentTrackSelector::seedOnlyFromAbove_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by detailedHitsCheck().

◆ theCharge_

const int AlignmentTrackSelector::theCharge_
private

Definition at line 74 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

◆ trkQualities_

std::vector<reco::TrackBase::TrackQuality> AlignmentTrackSelector::trkQualities_
private

Definition at line 97 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isOkTrkQuality().

◆ trkSteps_

std::vector<reco::TrackBase::TrackAlgorithm> AlignmentTrackSelector::trkSteps_
private

Definition at line 99 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isOkTrkQuality().

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> AlignmentTrackSelector::tTopoToken_
private

Definition at line 65 of file AlignmentTrackSelector.h.

Referenced by detailedHitsCheck().