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_
 

Detailed Description

Definition at line 23 of file AlignmentTrackSelector.h.

Member Typedef Documentation

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

Definition at line 25 of file AlignmentTrackSelector.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 33 of file AlignmentTrackSelector.cc.

References reco::TrackBase::algoByName(), applyBasicCuts_, applyIsolation_, applyIterStepCheck_, applyMultiplicityFilter_, applyNHighestPt_, applyPrescaledHitsFilter_, applyTrkQualityCheck_, chargeCheck_, chi2nMax_, clusterValueMapTag_, clusterValueMapToken_, edm::ConsumesCollector::consumes(), countStereoHitAs2D_, etaMax_, etaMin_, Exception, edm::ParameterSet::getParameter(), 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_, reco::TrackBase::qualityByName(), RorZofFirstHitMax_, RorZofFirstHitMin_, RorZofLastHitMax_, RorZofLastHitMin_, rphirecHitsToken_, AlCaHLTBitMon_QueryRunRegistry::string, trkQualities_, and trkSteps_.

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

destructor

Definition at line 225 of file AlignmentTrackSelector.cc.

225 {}

Member Function Documentation

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 269 of file AlignmentTrackSelector.cc.

References applyIterStepCheck_, applyTrkQualityCheck_, reco::TrackBase::charge(), chi2n, chi2nMax_, HLTMuonOfflineAnalyzer_cfi::d0, reco::TrackBase::d0(), d0Min_, detailedHitsCheck(), PVValHelper::dz, reco::TrackBase::dz(), dzMax_, dzMin_, PVValHelper::eta, reco::TrackBase::eta(), etaMin_, isOkTrkQuality(), 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_, data-class-funcs::q, mps_fire::result, and theCharge_.

Referenced by select().

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

Definition at line 672 of file AlignmentTrackSelector.cc.

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

Referenced by select().

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

References funct::abs(), applyIsolation_, chargeCheck_, edm::EventSetup::get(), 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(), edm::ESHandle< T >::product(), TrackerTopology::pxfSide(), reco::Track::recHits(), RorZofFirstHitMax_, RorZofFirstHitMin_, RorZofLastHitMax_, RorZofLastHitMin_, seedOnlyFromAbove_, DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecIsZMinusSide(), TrackerTopology::tecIsZPlusSide(), SiStripDetId::TIB, SiStripDetId::TID, TrackerTopology::tidIsZMinusSide(), TrackerTopology::tidIsZPlusSide(), SiStripDetId::TOB, and DetId::Tracker.

Referenced by basicCuts().

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

Definition at line 472 of file AlignmentTrackSelector.cc.

References countStereoHitAs2D_, TrackingRecHit::dimension(), TrackingRecHit::geographicalId(), TrackingRecHit::isValid(), kBPIX, kFPIX, ProjectedSiStripRecHit2D::originalHit(), SiStripDetId::stereo(), and DetId::Tracker.

Referenced by detailedHitsCheck().

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

Definition at line 603 of file AlignmentTrackSelector.cc.

References edmNew::DetSetVector< T >::data(), TrackingRecHit::geographicalId(), edm::Event::getByToken(), BaseTrackerRecHit::localPosition(), TrackingRecHit::localPosition(), mag(), AlignmentTrackSelector_cfi::matchedrecHits, matchedrecHitsToken_, minHitIsolation_, DetId::rawId(), AlignmentTrackSelector_cfi::rphirecHits, and rphirecHitsToken_.

Referenced by detailedHitsCheck().

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

References TrackingRecHit::geographicalId(), triggerObjects_cff::id, isOkChargeStripHit(), TrackingRecHit::isValid(), kBPIX, kFPIX, SiStripMatchedRecHit2D::monoHit(), ProjectedSiStripRecHit2D::originalHit(), SiStripMatchedRecHit2D::stereoHit(), and DetId::Tracker.

Referenced by detailedHitsCheck().

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

Definition at line 588 of file AlignmentTrackSelector.cc.

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

Referenced by isOkCharge().

588  {
589  double charge = 0.;
590 
591  SiStripRecHit1D::ClusterRef cluster(siStripRecHit1D.cluster());
592  const auto& amplitudes = cluster->amplitudes();
593 
594  for (size_t ia = 0; ia < amplitudes.size(); ++ia) {
595  charge += amplitudes[ia];
596  }
597 
598  return (charge >= minHitChargeStrip_);
599 }
ClusterRef cluster() const
bool AlignmentTrackSelector::isOkChargeStripHit ( const SiStripRecHit2D siStripRecHit2D) const
private

Definition at line 573 of file AlignmentTrackSelector.cc.

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

573  {
574  double charge = 0.;
575 
576  SiStripRecHit2D::ClusterRef cluster(siStripRecHit2D.cluster());
577  const auto& amplitudes = cluster->amplitudes();
578 
579  for (size_t ia = 0; ia < amplitudes.size(); ++ia) {
580  charge += amplitudes[ia];
581  }
582 
583  return (charge >= minHitChargeStrip_);
584 }
ClusterRef cluster() const
bool AlignmentTrackSelector::isOkTrkQuality ( const reco::Track track) const
private

Definition at line 742 of file AlignmentTrackSelector.cc.

References reco::TrackBase::algo(), applyIterStepCheck_, applyTrkQualityCheck_, mps_fire::i, reco::TrackBase::quality(), trkQualities_, and trkSteps_.

Referenced by basicCuts().

742  {
743  bool qualityOk = false;
744  bool iterStepOk = false;
745 
746  //check iterative step
747  if (applyIterStepCheck_) {
748  for (unsigned int i = 0; i < trkSteps_.size(); ++i) {
749  if (track->algo() == (trkSteps_[i])) {
750  iterStepOk = true;
751  }
752  }
753  } else
754  iterStepOk = true;
755 
756  //check track quality
757  if (applyTrkQualityCheck_) {
758  for (unsigned int i = 0; i < trkQualities_.size(); ++i) {
759  if (track->quality(trkQualities_[i])) {
760  qualityOk = true;
761  }
762  }
763  } else
764  qualityOk = true;
765 
766  return qualityOk && iterStepOk;
767 } //end check on track quality
std::vector< reco::TrackBase::TrackAlgorithm > trkSteps_
std::vector< reco::TrackBase::TrackQuality > trkQualities_
TrackAlgorithm algo() const
Definition: TrackBase.h:526
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:531
AlignmentTrackSelector::Tracks AlignmentTrackSelector::select ( const Tracks tracks,
const edm::Event evt,
const edm::EventSetup eSetup 
) const

select tracks

Definition at line 229 of file AlignmentTrackSelector.cc.

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

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), Vispa.Views.AbstractView.AbstractView::restoreSelection(), and TrackConfigSelector::select().

231  {
233  (tracks.size() < static_cast<unsigned int>(minMultiplicity_) ||
234  tracks.size() > static_cast<unsigned int>(maxMultiplicity_))) {
235  return Tracks(); // empty collection
236  }
237 
238  Tracks result = tracks;
239  // apply basic track cuts (if selected)
240  if (applyBasicCuts_)
241  result = this->basicCuts(result, evt, eSetup);
242 
243  // filter N tracks with highest Pt (if selected)
244  if (applyNHighestPt_)
245  result = this->theNHighestPtTracks(result);
246 
247  // apply minimum multiplicity requirement (if selected)
249  if (result.size() < static_cast<unsigned int>(minMultiplicity_) ||
250  result.size() > static_cast<unsigned int>(maxMultiplicity_)) {
251  result.clear();
252  }
253  }
254 
256  result = this->checkPrescaledHits(result, evt);
257  }
258 
259  return result;
260 }
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
Tracks checkPrescaledHits(const Tracks &tracks, const edm::Event &evt) const
Tracks theNHighestPtTracks(const Tracks &tracks) const
filter the n highest pt tracks
AlignmentTrackSelector::Tracks AlignmentTrackSelector::theNHighestPtTracks ( const Tracks tracks) const
private

filter the n highest pt tracks

Definition at line 651 of file AlignmentTrackSelector.cc.

References dqmiodumpmetadata::n, nHighestPt_, ptComparator, mps_fire::result, and PDWG_EXOHSCP_cff::tracks.

Referenced by select().

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

Member Data Documentation

const bool AlignmentTrackSelector::applyBasicCuts_
private

Definition at line 63 of file AlignmentTrackSelector.h.

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

const bool AlignmentTrackSelector::applyIsolation_
private

Definition at line 65 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

bool AlignmentTrackSelector::applyIterStepCheck_
private

Definition at line 97 of file AlignmentTrackSelector.h.

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

const bool AlignmentTrackSelector::applyMultiplicityFilter_
private

Definition at line 63 of file AlignmentTrackSelector.h.

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

const bool AlignmentTrackSelector::applyNHighestPt_
private

Definition at line 63 of file AlignmentTrackSelector.h.

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

const bool AlignmentTrackSelector::applyPrescaledHitsFilter_
private

Definition at line 91 of file AlignmentTrackSelector.h.

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

bool AlignmentTrackSelector::applyTrkQualityCheck_
private

Definition at line 96 of file AlignmentTrackSelector.h.

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

const bool AlignmentTrackSelector::chargeCheck_
private

Definition at line 65 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const double AlignmentTrackSelector::chi2nMax_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

const edm::InputTag AlignmentTrackSelector::clusterValueMapTag_
private

Definition at line 88 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

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

Definition at line 89 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and checkPrescaledHits().

const bool AlignmentTrackSelector::countStereoHitAs2D_
private

Definition at line 74 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isHit2D().

const double AlignmentTrackSelector::d0Max_
private

Definition at line 69 of file AlignmentTrackSelector.h.

const double AlignmentTrackSelector::d0Min_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

const double AlignmentTrackSelector::dzMax_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

const double AlignmentTrackSelector::dzMin_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

const double AlignmentTrackSelector::etaMax_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

const double AlignmentTrackSelector::etaMin_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

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

Definition at line 73 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isIsolated().

const double AlignmentTrackSelector::maxHitDiffEndcaps_
private

Definition at line 81 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::maxMultiplicity_
private

Definition at line 66 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and select().

const double AlignmentTrackSelector::minHitChargeStrip_
private

Definition at line 71 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isOkChargeStripHit().

const double AlignmentTrackSelector::minHitIsolation_
private

Definition at line 71 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isIsolated().

const int AlignmentTrackSelector::minHitsinBPIX_
private

Definition at line 77 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinENDCAP_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinENDCAPminus_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinENDCAPplus_
private

Definition at line 80 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinFPIX_
private

Definition at line 77 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinFPIXminus_
private

Definition at line 79 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinFPIXplus_
private

Definition at line 79 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinPIX_
private

Definition at line 77 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTEC_
private

Definition at line 76 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTECminus_
private

Definition at line 78 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTECplus_
private

Definition at line 78 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTIB_
private

Definition at line 76 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTID_
private

Definition at line 76 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTIDminus_
private

Definition at line 78 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTIDplus_
private

Definition at line 78 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minHitsinTOB_
private

Definition at line 76 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const int AlignmentTrackSelector::minMultiplicity_
private

Definition at line 66 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and select().

const int AlignmentTrackSelector::minPrescaledHits_
private

Definition at line 90 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and checkPrescaledHits().

const bool AlignmentTrackSelector::multiplicityOnInput_
private

Definition at line 67 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and select().

const int AlignmentTrackSelector::nHighestPt_
private

Definition at line 66 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and theNHighestPtTracks().

const double AlignmentTrackSelector::nHitMax_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

const unsigned int AlignmentTrackSelector::nHitMin2D_
private

Definition at line 75 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

const double AlignmentTrackSelector::nHitMin_
private

Definition at line 69 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

const double AlignmentTrackSelector::nLostHitMax_
private

Definition at line 82 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

const double AlignmentTrackSelector::phiMax_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

const double AlignmentTrackSelector::phiMin_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

const double AlignmentTrackSelector::pMax_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

const double AlignmentTrackSelector::pMin_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

ComparePt AlignmentTrackSelector::ptComparator
private

Definition at line 61 of file AlignmentTrackSelector.h.

Referenced by theNHighestPtTracks().

const double AlignmentTrackSelector::ptMax_
private

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector().

const double AlignmentTrackSelector::ptMin_
private

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

Definition at line 68 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and basicCuts().

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

Definition at line 84 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

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

Definition at line 83 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

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

Definition at line 86 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

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

Definition at line 85 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and detailedHitsCheck().

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

Definition at line 72 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isIsolated().

const int AlignmentTrackSelector::seedOnlyFromAbove_
private

Definition at line 64 of file AlignmentTrackSelector.h.

Referenced by detailedHitsCheck().

const int AlignmentTrackSelector::theCharge_
private

Definition at line 70 of file AlignmentTrackSelector.h.

Referenced by basicCuts().

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

Definition at line 93 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isOkTrkQuality().

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

Definition at line 95 of file AlignmentTrackSelector.h.

Referenced by AlignmentTrackSelector(), and isOkTrkQuality().