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")),
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")),
89 applyPrescaledHitsFilter_(!clusterValueMapTag_.
encode().
empty() && minPrescaledHits_ > 0) {
101 std::vector<std::string> trkQualityStrings(cfg.
getParameter<std::vector<std::string> >(
"trackQualities"));
103 if (!trkQualityStrings.empty()) {
105 for (
unsigned int i = 0;
i < trkQualityStrings.size(); ++
i) {
106 (qualities += trkQualityStrings[
i]) +=
", ";
112 std::vector<std::string> trkIterStrings(cfg.
getParameter<std::vector<std::string> >(
"iterativeTrackingSteps"));
113 if (!trkIterStrings.empty()) {
116 for (
unsigned int i = 0;
i < trkIterStrings.size(); ++
i) {
117 (tracksteps += trkIterStrings[
i]) +=
", ";
125 <<
"applying basic track cuts ..." 130 <<
" counting hits on SiStrip stereo modules as 2D" 135 <<
"only retain tracks isolated at least by " <<
minHitIsolation_ <<
" cm from other rechits";
139 <<
"only retain hits with at least " <<
minHitChargeStrip_ <<
" ADC counts of total cluster charge";
147 <<
"Minimum number of hits in TID+/TID-/TEC+/TEC-/FPIX+/FPIX- = " <<
minHitsinTIDplus_ <<
"/" 152 <<
"Minimum number of hits in EndCap (TID+TEC)/EndCap+/EndCap- = " <<
minHitsinENDCAP_ <<
"/" 158 if (!trkQualityStrings.empty()) {
159 edm::LogInfo(
"AlignmentTrackSelector") <<
"Select tracks with these qualities: " << qualities;
178 throw cms::Exception(
"BadConfig") <<
"@SUB=AlignmentTrackSelector::AlignmentTrackSelector" 179 <<
"Wrong configuration of 'RorZofFirstHitMin'." 180 <<
" Must have exactly 2 values instead of configured " 187 throw cms::Exception(
"BadConfig") <<
"@SUB=AlignmentTrackSelector::AlignmentTrackSelector" 188 <<
"Wrong configuration of 'RorZofFirstHitMax'." 189 <<
" Must have exactly 2 values instead of configured " 196 throw cms::Exception(
"BadConfig") <<
"@SUB=AlignmentTrackSelector::AlignmentTrackSelector" 197 <<
"Wrong configuration of 'RorZofLastHitMin'." 198 <<
" Must have exactly 2 values instead of configured " 205 throw cms::Exception(
"BadConfig") <<
"@SUB=AlignmentTrackSelector::AlignmentTrackSelector" 206 <<
"Wrong configuration of 'RorZofLastHitMax'." 207 <<
" Must have exactly 2 values instead of configured " 215 throw cms::Exception(
"BadConfig") <<
"@SUB=AlignmentTrackSelector::AlignmentTrackSelector" 216 <<
"Position of the first hit is set to larger distance than the last hit:." 241 result = this->
basicCuts(result, evt, eSetup);
274 for (Tracks::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
276 float pt = trackp->
pt();
277 float p = trackp->
p();
278 float eta = trackp->
eta();
279 float phi = trackp->
phi();
285 bool isChargeOk =
false;
293 float d0 = trackp->
d0();
294 float dz = trackp->
dz();
302 bool trkQualityOk =
false;
310 if (trkQualityOk && hitsCheckOk)
311 result.push_back(trackp);
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;
349 const DetId detId(
hit->geographicalId());
350 const int subdetId = detId.
subdetId();
369 <<
"@SUB=AlignmentTrackSelector::detailedHitsCheck" 370 <<
"DetId.det() != DetId::Tracker (=" <<
DetId::Tracker <<
"), but " << detId.det() <<
".";
402 }
else if (
kBPIX == subdetId) {
405 }
else if (
kFPIX == subdetId) {
409 if (tTopo->
pxfSide(detId) == 1)
411 else if (tTopo->
pxfSide(detId) == 2)
415 if (nHit2D < nHitMin2D_ && this->
isHit2D(*
hit))
420 bool passedLastHitPositionR =
true;
421 bool passedLastHitPositionZ =
true;
422 bool passedFirstHitPositionR =
true;
423 bool passedFirstHitPositionZ =
true;
430 passedFirstHitPositionR =
false;
432 passedFirstHitPositionR =
false;
434 passedFirstHitPositionZ =
false;
436 passedFirstHitPositionZ =
false;
444 passedLastHitPositionR =
false;
446 passedLastHitPositionR =
false;
448 passedLastHitPositionZ =
false;
450 passedLastHitPositionZ =
false;
453 bool passedFirstHitPosition = passedFirstHitPositionR || passedFirstHitPositionZ;
454 bool passedLastHitPosition = passedLastHitPositionR || passedLastHitPositionZ;
464 nHit2D >=
nHitMin2D_ && passedFirstHitPosition && passedLastHitPosition);
480 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
486 else if (dynamic_cast<const SiStripRecHit1D*>(&hit) ||
dynamic_cast<const SiStripRecHit2D*
>(&hit))
489 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
491 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit)) {
495 edm::LogError(
"UnkownType") <<
"@SUB=AlignmentTrackSelector::isHit2D" 496 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor " 497 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
502 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=AlignmentTrackSelector::isHit2D" 503 <<
"Hit not in tracker with 'official' dimension >=2.";
520 <<
"Hit not in tracker!";
523 if (
id.subdetId() ==
kFPIX ||
id.subdetId() ==
kBPIX) {
528 const std::type_info&
type =
typeid(*hit);
556 <<
"Unknown type of a valid tracker hit in Strips " 557 <<
" SubDet = " <<
id.subdetId();
564 <<
"Unknown valid tracker hit not in pixel, subdet " <<
id.subdetId()
566 <<
", BaseTrackerRecHit " << dynamic_cast<const BaseTrackerRecHit*>(hit);
577 const auto& amplitudes = cluster->amplitudes();
579 for (
size_t ia = 0; ia < amplitudes.size(); ++ia) {
580 charge += amplitudes[ia];
592 const auto& amplitudes = cluster->amplitudes();
594 for (
size_t ia = 0; ia < amplitudes.size(); ++ia) {
595 charge += amplitudes[ia];
624 for (istripSt = stripcollSt.begin(); istripSt != stripcollSt.end(); ++istripSt) {
636 for (istripStm = stripcollStm.begin(); istripStm != stripcollStm.end(); ++istripStm) {
656 std::sort(sortedTracks.begin(), sortedTracks.end(),
ptComparator);
660 for (Tracks::const_iterator it = sortedTracks.begin(); it != sortedTracks.end(); ++it) {
662 result.push_back(*it);
682 for (
auto const& trackp : tracks) {
686 for (
auto const&
hit : trackp->recHits()) {
689 DetId detid =
hit->geographicalId();
693 bool isPixelHit = (subDet ==
kFPIX || subDet ==
kBPIX);
696 const std::type_info&
type =
typeid(*hit);
700 if (striphit !=
nullptr) {
702 flag = flagMap[stripclust];
706 if (striphit !=
nullptr) {
708 flag = flagMap[stripclust];
712 <<
"ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Strip RecHit failed!" 713 <<
" Skipping this hit.";
720 if (pixelhit !=
nullptr) {
722 flag = flagMap[pixclust];
725 <<
"ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Pixel RecHit failed! ";
734 result.push_back(trackp);
743 bool qualityOk =
false;
744 bool iterStepOk =
false;
766 return qualityOk && iterStepOk;
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
ClusterRef cluster() const
double p() const
momentum vector magnitude
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
const int minHitsinFPIXminus_
const bool applyNHighestPt_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::vector< double > RorZofFirstHitMax_
const int minHitsinTECplus_
const double nLostHitMax_
const bool applyIsolation_
const int minHitsinFPIXplus_
Tracks basicCuts(const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
apply basic cuts on pt,eta,phi,nhit
bool isIsolated(const TrackingRecHit *therechit, const edm::Event &evt) const
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
std::vector< data_type > DataContainer
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const int minHitsinTIDplus_
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const double maxHitDiffEndcaps_
const double minHitIsolation_
std::vector< const reco::Track * > Tracks
constexpr uint32_t rawId() const
get the raw id
Tracks checkPrescaledHits(const Tracks &tracks, const edm::Event &evt) const
~AlignmentTrackSelector()
destructor
std::vector< reco::TrackBase::TrackAlgorithm > trkSteps_
Tracks theNHighestPtTracks(const Tracks &tracks) const
filter the n highest pt tracks
double phi() const
azimuthal angle of momentum vector
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
std::vector< reco::TrackBase::TrackQuality > trkQualities_
const unsigned int nHitMin2D_
const math::XYZPoint & outerPosition() const
position of the outermost hit
bool isOkChargeStripHit(const SiStripRecHit1D &siStripRecHit1D) const
const bool applyMultiplicityFilter_
bool tecIsZMinusSide(const DetId &id) const
const bool countStereoHitAs2D_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
bool tidIsZMinusSide(const DetId &id) const
const math::XYZPoint & innerPosition() const
position of the innermost hit
TrackAlgorithm algo() const
const int seedOnlyFromAbove_
bool isHit2D(const TrackingRecHit &hit) const
const int minHitsinENDCAPplus_
double eta() const
pseudorapidity of momentum vector
virtual int dimension() const =0
double pt() const
track transverse momentum
const int minHitsinTECminus_
const int minHitsinENDCAPminus_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
data_type const * data(size_t cell) const
const double minHitChargeStrip_
auto recHits() const
Access to reconstructed hits on the track.
Abs< T >::type abs(const T &t)
ClusterRef cluster() const
unsigned short numberOfValidHits() const
number of valid hits found
const int minMultiplicity_
math::XYZPoint Point
point in the space
virtual LocalPoint localPosition() const =0
std::vector< double > RorZofLastHitMin_
bool isOkTrkQuality(const reco::Track *track) const
edm::EDGetTokenT< AliClusterValueMap > clusterValueMapToken_
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...
std::vector< double > RorZofFirstHitMin_
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
const double ptMin_
if true, cut min/maxMultiplicity on input instead of on final result
const int minHitsinENDCAP_
static TrackQuality qualityByName(const std::string &name)
SiStripRecHit2D stereoHit() const
bool tidIsZPlusSide(const DetId &id) const
const int minPrescaledHits_
const edm::InputTag clusterValueMapTag_
ClusterRef cluster() const
bool quality(const TrackQuality) const
Track quality.
bool detailedHitsCheck(const reco::Track *track, const edm::Event &evt, const edm::EventSetup &eSetup) const
checking hit requirements beyond simple number of valid hits
SiStripRecHit2D monoHit() const
const bool applyBasicCuts_
bool tecIsZPlusSide(const DetId &id) const
Tracks select(const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
select tracks
bool applyTrkQualityCheck_
bool isOkCharge(const TrackingRecHit *therechit) const
if valid, check for minimum charge (currently only in strip), if invalid give true ...
static TrackAlgorithm algoByName(const std::string &name)
unsigned int pxfSide(const DetId &id) const
LocalPoint localPosition() const final
const int maxMultiplicity_
int charge() const
track electric charge
std::vector< double > RorZofLastHitMax_
const int minHitsinTIDminus_
DetId geographicalId() const
AlignmentTrackSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
constructor
T const * product() const
const bool applyPrescaledHitsFilter_
const bool multiplicityOnInput_
bool useThisFilter()
returns if any of the Filters is used.