|
|
Go to the documentation of this file.
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")),
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:."
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)
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);
478 const DetId detId(
hit.geographicalId());
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(
"UnknownType") <<
"@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.";
513 if (!
hit || !
hit->isValid())
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()
565 <<
", SiTrackerMultiRecHit " << dynamic_cast<const SiTrackerMultiRecHit*>(
hit)
566 <<
", BaseTrackerRecHit " << dynamic_cast<const BaseTrackerRecHit*>(
hit);
577 const auto& amplitudes = cluster->amplitudes();
579 for (
size_t ia = 0; ia < amplitudes.size(); ++ia) {
592 const auto& amplitudes = cluster->amplitudes();
594 for (
size_t ia = 0; ia < amplitudes.size(); ++ia) {
624 for (istripSt = stripcollSt.begin(); istripSt != stripcollSt.end(); ++istripSt) {
636 for (istripStm = stripcollStm.begin(); istripStm != stripcollStm.end(); ++istripStm) {
660 for (Tracks::const_iterator it = sortedTracks.begin(); it != sortedTracks.end(); ++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.";
722 flag = flagMap[pixclust];
725 <<
"ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Pixel RecHit failed! ";
743 bool qualityOk =
false;
744 bool iterStepOk =
false;
766 return qualityOk && iterStepOk;
const math::XYZPoint & outerPosition() const
position of the outermost hit
const int minMultiplicity_
T const * product() const
std::vector< double > RorZofLastHitMin_
bool tidIsZMinusSide(const DetId &id) const
edm::EDGetTokenT< AliClusterValueMap > clusterValueMapToken_
ClusterRef cluster() const
const int minHitsinENDCAPminus_
const double minHitChargeStrip_
const double ptMin_
if true, cut min/maxMultiplicity on input instead of on final result
unsigned int pxfSide(const DetId &id) 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
double p() const
momentum vector magnitude
bool tecIsZMinusSide(const DetId &id) const
const int minPrescaledHits_
bool isOkCharge(const TrackingRecHit *therechit) const
if valid, check for minimum charge (currently only in strip), if invalid give true
const edm::InputTag clusterValueMapTag_
std::vector< double > RorZofFirstHitMin_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const int minHitsinENDCAP_
const bool applyBasicCuts_
bool applyTrkQualityCheck_
Log< level::Info, false > LogInfo
unsigned short numberOfValidHits() const
number of valid hits found
Log< level::Warning, false > LogWarning
DetId geographicalId() const
const int maxMultiplicity_
bool isOkTrkQuality(const reco::Track *track) const
bool isHit2D(const TrackingRecHit &hit) const
double pt() const
track transverse momentum
AlignmentTrackSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)
constructor
const int minHitsinTIDminus_
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
std::vector< double > RorZofLastHitMax_
SiStripRecHit2D stereoHit() const
SiStripRecHit2D originalHit() const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
auto recHits() const
Access to reconstructed hits on the track.
int charge() const
track electric charge
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...
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static constexpr auto TEC
const bool applyNHighestPt_
double phi() const
azimuthal angle of momentum vector
const bool applyPrescaledHitsFilter_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
const bool multiplicityOnInput_
const int minHitsinTECplus_
const double nLostHitMax_
bool useThisFilter()
returns if any of the Filters is used.
const bool applyIsolation_
bool isOkChargeStripHit(const SiStripRecHit1D &siStripRecHit1D) const
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
bool isIsolated(const TrackingRecHit *therechit, const edm::Event &evt) const
const int minHitsinFPIXminus_
double eta() const
pseudorapidity of momentum vector
std::vector< double > RorZofFirstHitMax_
bool tidIsZPlusSide(const DetId &id) const
SiStripRecHit2D monoHit() const
const math::XYZPoint & innerPosition() const
position of the innermost hit
Tracks theNHighestPtTracks(const Tracks &tracks) const
filter the n highest pt tracks
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
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
static constexpr auto TOB
ClusterRef cluster() const
Tracks checkPrescaledHits(const Tracks &tracks, const edm::Event &evt) const
~AlignmentTrackSelector()
destructor
std::vector< data_type > DataContainer
std::vector< const reco::Track * > Tracks
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Log< level::Error, false > LogError
const int minHitsinTIDplus_
math::XYZPoint Point
point in the space
Tracks select(const Tracks &tracks, const edm::Event &evt, const edm::EventSetup &eSetup) const
select tracks
static TrackQuality qualityByName(const std::string &name)
const double maxHitDiffEndcaps_
static constexpr auto TID
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const double minHitIsolation_
constexpr uint32_t rawId() const
get the raw id
LocalPoint localPosition() const override
std::vector< reco::TrackBase::TrackAlgorithm > trkSteps_
const bool countStereoHitAs2D_
std::vector< reco::TrackBase::TrackQuality > trkQualities_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
const unsigned int nHitMin2D_
static constexpr auto TIB
const int seedOnlyFromAbove_
bool tecIsZPlusSide(const DetId &id) const
const bool applyMultiplicityFilter_
static TrackAlgorithm algoByName(const std::string &name)
Abs< T >::type abs(const T &t)
Detector identifier class for the strip tracker.
const int minHitsinTECminus_
static constexpr float d0
const int minHitsinENDCAPplus_