33 applyBasicCuts_( cfg.getParameter<bool>(
"applyBasicCuts" ) ),
34 applyNHighestPt_( cfg.getParameter<bool>(
"applyNHighestPt" ) ),
35 applyMultiplicityFilter_( cfg.getParameter<bool>(
"applyMultiplicityFilter" ) ),
36 seedOnlyFromAbove_( cfg.getParameter<int>(
"seedOnlyFrom" ) ),
37 applyIsolation_( cfg.getParameter<bool>(
"applyIsolationCut" ) ),
38 chargeCheck_( cfg.getParameter<bool>(
"applyChargeCheck" ) ),
39 nHighestPt_( cfg.getParameter<int>(
"nHighestPt" ) ),
40 minMultiplicity_ ( cfg.getParameter<int>(
"minMultiplicity" ) ),
41 maxMultiplicity_ ( cfg.getParameter<int>(
"maxMultiplicity" ) ),
42 multiplicityOnInput_ ( cfg.getParameter<bool>(
"multiplicityOnInput" ) ),
43 ptMin_( cfg.getParameter<double>(
"ptMin" ) ),
44 ptMax_( cfg.getParameter<double>(
"ptMax" ) ),
45 pMin_( cfg.getParameter<double>(
"pMin" ) ),
46 pMax_( cfg.getParameter<double>(
"pMax" ) ),
47 etaMin_( cfg.getParameter<double>(
"etaMin" ) ),
48 etaMax_( cfg.getParameter<double>(
"etaMax" ) ),
49 phiMin_( cfg.getParameter<double>(
"phiMin" ) ),
50 phiMax_( cfg.getParameter<double>(
"phiMax" ) ),
51 nHitMin_( cfg.getParameter<double>(
"nHitMin" ) ),
52 nHitMax_( cfg.getParameter<double>(
"nHitMax" ) ),
53 chi2nMax_( cfg.getParameter<double>(
"chi2nMax" ) ),
54 d0Min_( cfg.getParameter<double>(
"d0Min" ) ),
55 d0Max_( cfg.getParameter<double>(
"d0Max" ) ),
56 dzMin_( cfg.getParameter<double>(
"dzMin" ) ),
57 dzMax_( cfg.getParameter<double>(
"dzMax" ) ),
58 theCharge_( cfg.getParameter<int>(
"theCharge" ) ),
59 minHitChargeStrip_( cfg.getParameter<double>(
"minHitChargeStrip" ) ),
60 minHitIsolation_( cfg.getParameter<double>(
"minHitIsolation" ) ),
61 rphirecHitsTag_( cfg.getParameter<edm::InputTag>(
"rphirecHits") ),
62 matchedrecHitsTag_( cfg.getParameter<edm::InputTag>(
"matchedrecHits") ),
63 countStereoHitAs2D_( cfg.getParameter<bool>(
"countStereoHitAs2D" ) ),
64 nHitMin2D_( cfg.getParameter<unsigned int>(
"nHitMin2D" ) ),
66 minHitsinTIB_(cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTIB" ) ),
67 minHitsinTOB_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTOB" ) ),
68 minHitsinTID_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTID" ) ),
69 minHitsinTEC_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTEC" ) ),
70 minHitsinBPIX_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inBPIX" ) ),
71 minHitsinFPIX_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inFPIX" ) ),
72 minHitsinPIX_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inPIXEL" ) ),
73 minHitsinTIDplus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTIDplus" ) ),
74 minHitsinTIDminus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTIDminus" ) ),
75 minHitsinTECplus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTECplus" ) ),
76 minHitsinTECminus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTECminus" ) ),
77 minHitsinFPIXplus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inFPIXplus" ) ),
78 minHitsinFPIXminus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inFPIXminus" ) ),
79 minHitsinENDCAP_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inENDCAP" ) ),
80 minHitsinENDCAPplus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inENDCAPplus" ) ),
81 minHitsinENDCAPminus_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inENDCAPminus" ) ),
82 maxHitDiffEndcaps_( cfg.getParameter<double>(
"maxHitDiffEndcaps" ) ),
83 nLostHitMax_( cfg.getParameter<double>(
"nLostHitMax" ) ),
84 clusterValueMapTag_(cfg.getParameter<edm::InputTag>(
"hitPrescaleMapTag")),
85 minPrescaledHits_( cfg.getParameter<int>(
"minPrescaledHits")),
86 applyPrescaledHitsFilter_(clusterValueMapTag_.
encode().
size() && minPrescaledHits_ > 0)
90 std::vector<std::string> trkQualityStrings(cfg.
getParameter<std::vector<std::string> >(
"trackQualities"));
91 std::string qualities;
92 if(trkQualityStrings.size()>0){
94 for (
unsigned int i = 0;
i < trkQualityStrings.size(); ++
i) {
95 (qualities += trkQualityStrings[
i]) +=
", ";
101 std::vector<std::string> trkIterStrings(cfg.
getParameter<std::vector<std::string> >(
"iterativeTrackingSteps"));
102 if(trkIterStrings.size()>0){
104 std::string tracksteps;
105 for (
unsigned int i = 0;
i < trkIterStrings.size(); ++
i) {
106 (tracksteps += trkIterStrings[
i]) +=
", ";
114 <<
"applying basic track cuts ..."
122 << (
countStereoHitAs2D_ ?
"," :
", not") <<
" counting hits on SiStrip stereo modules as 2D"
128 " cm from other rechits";
133 " ADC counts of total cluster charge";
136 <<
"Minimum number of hits in TIB/TID/TOB/TEC/BPIX/FPIX/PIXEL = "
141 <<
"Minimum number of hits in TID+/TID-/TEC+/TEC-/FPIX+/FPIX- = "
147 <<
"Minimum number of hits in EndCap (TID+TEC)/EndCap+/EndCap- = "
151 <<
"Max value of |nHitsinENDCAPplus - nHitsinENDCAPminus| = "
154 if (trkQualityStrings.size()) {
156 <<
"Select tracks with these qualities: " << qualities;
162 <<
"filter N tracks with highest Pt N=" <<
nHighestPt_;
234 for (Tracks::const_iterator it=tracks.begin(); it != tracks.end(); ++it) {
236 float pt=trackp->
pt();
245 bool isChargeOk =
false;
247 else if (
theCharge_==1 && q>0) isChargeOk =
true;
250 float d0 = trackp->
d0();
251 float dz = trackp->
dz();
266 bool trkQualityOk=
false ;
272 if (trkQualityOk && hitsCheckOk ) result.push_back(trackp);
294 int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
295 int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0, nhitinPIXEL=0;
296 int nhitinENDCAP = 0, nhitinENDCAPplus = 0, nhitinENDCAPminus = 0;
297 int nhitinTIDplus = 0, nhitinTIDminus = 0;
298 int nhitinFPIXplus = 0, nhitinFPIXminus = 0;
299 int nhitinTECplus = 0, nhitinTECminus = 0;
300 unsigned int nHit2D = 0;
301 unsigned int thishit = 0;
305 const DetId detId((*iHit)->geographicalId());
306 const int subdetId = detId.
subdetId();
321 if (!(*iHit)->isValid())
continue;
323 edm::LogError(
"DetectorMismatch") <<
"@SUB=AlignmentTrackSelector::detailedHitsCheck"
325 <<
"), but " << detId.det() <<
".";
358 else if (
kBPIX == subdetId) {++nhitinBPIX;++nhitinPIXEL;}
359 else if (
kFPIX == subdetId) {
363 if (fpixId.
side()==1) ++nhitinFPIXminus;
364 else if (fpixId.
side()==2) ++nhitinFPIXplus;
367 if (nHit2D < nHitMin2D_ && this->
isHit2D(**iHit)) ++nHit2D;
398 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
403 else if (dynamic_cast<const SiStripRecHit1D*>(&hit)
406 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
return true;
407 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit)) {
411 edm::LogError(
"UnkownType") <<
"@SUB=AlignmentTrackSelector::isHit2D"
412 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
413 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
418 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=AlignmentTrackSelector::isHit2D"
419 <<
"Hit not in tracker with 'official' dimension >=2.";
430 if (!hit || !hit->
isValid())
return true;
435 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=isOkCharge" <<
"Hit not in tracker!";
438 if (
id.subdetId() ==
kFPIX ||
id.subdetId() ==
kBPIX) {
443 const std::type_info &
type =
typeid(*hit);
474 edm::LogError(
"AlignmentTrackSelector")<<
"@SUB=isOkCharge" <<
"Unknown type of a valid tracker hit in Strips "
475 <<
" SubDet = "<<
id.subdetId();
484 <<
"@SUB=isOkCharge" <<
"Unknown valid tracker hit not in pixel, subdet " <<
id.subdetId()
486 <<
", BaseTrackerRecHit " << dynamic_cast<const BaseTrackerRecHit*>(hit);
499 const std::vector<uint8_t> &litudes = cluster->amplitudes();
501 for (
size_t ia = 0; ia < amplitudes.size(); ++ia) {
502 charge += amplitudes[ia];
515 const std::vector<uint8_t> &litudes = cluster->amplitudes();
517 for (
size_t ia = 0; ia < amplitudes.size(); ++ia) {
518 charge += amplitudes[ia];
548 for( istripSt=stripcollSt.begin(); istripSt!=stripcollSt.end(); ++istripSt ) {
558 for( istripStm=stripcollStm.begin(); istripStm!=stripcollStm.end(); ++istripStm ) {
582 for (Tracks::const_iterator it=sortedTracks.begin();
583 it!=sortedTracks.end(); ++it) {
603 for (Tracks::const_iterator ittrk=tracks.begin(); ittrk != tracks.end(); ++ittrk) {
615 bool isPixelHit=(subDet ==
kFPIX || subDet ==
kBPIX);
618 const std::type_info &
type =
typeid(*hit);
624 flag = flagMap[stripclust];
631 flag = flagMap[stripclust];
635 edm::LogError(
"AlignmentTrackSelector")<<
"ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Strip RecHit failed!"
636 <<
" Skipping this hit.";
647 flag = flagMap[pixclust];
650 edm::LogError(
"AlignmentTrackSelector")<<
"ERROR in <AlignmentTrackSelector::checkPrescaledHits>: Dynamic cast of Pixel RecHit failed! ";
654 if(flag.
isTaken())ntakenhits++;
667 bool qualityOk=
false;
668 bool iterStepOk=
false;
678 else iterStepOk=
true;
690 return qualityOk&&iterStepOk;
ClusterRef cluster() const
bool detailedHitsCheck(const reco::Track *track, const edm::Event &evt) const
checking hit requirements beyond simple number of valid hits
double p() const
momentum vector magnitude
T getParameter(std::string const &) const
const int minHitsinFPIXminus_
const bool applyNHighestPt_
virtual int dimension() const =0
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const int minHitsinTECplus_
const double nLostHitMax_
const bool applyIsolation_
const int minHitsinFPIXplus_
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)
const int minHitsinTIDplus_
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const double maxHitDiffEndcaps_
Tracks basicCuts(const Tracks &tracks, const edm::Event &evt) const
apply basic cuts on pt,eta,phi,nhit
const double minHitIsolation_
std::vector< const reco::Track * > Tracks
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_
bool isOkChargeStripHit(const SiStripRecHit1D &siStripRecHit1D) const
const bool applyMultiplicityFilter_
const bool countStereoHitAs2D_
AlignmentTrackSelector(const edm::ParameterSet &cfg)
constructor
TrackAlgorithm algo() const
uint32_t rawId() const
get the raw id
bool isHit2D(const TrackingRecHit &hit) const
bool isZMinusSide() const
const int minHitsinENDCAPplus_
double eta() const
pseudorapidity of momentum vector
Tracks select(const Tracks &tracks, const edm::Event &evt) const
select tracks
const bool seedOnlyFromAbove_
double pt() const
track transverse momentum
const int minHitsinTECminus_
const int minHitsinENDCAPminus_
const double minHitChargeStrip_
ClusterRef cluster() const
unsigned short numberOfValidHits() const
number of valid hits found
const int minMultiplicity_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
const edm::InputTag matchedrecHitsTag_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool isOkTrkQuality(const reco::Track *track) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) 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...
Detector identifier class for the strip tracker.
const double ptMin_
if true, cut min/maxMultiplicity on input instead of on final result
bool isZMinusSide() const
const int minHitsinENDCAP_
static TrackQuality qualityByName(const std::string &name)
virtual LocalPoint localPosition() const
SiStripRecHit2D stereoHit() const
const int minPrescaledHits_
const edm::InputTag clusterValueMapTag_
ClusterRef cluster() const
bool quality(const TrackQuality) const
Track quality.
SiStripRecHit2D monoHit() const
const bool applyBasicCuts_
bool applyTrkQualityCheck_
const edm::InputTag rphirecHitsTag_
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 side() const
positive or negative id
const int maxMultiplicity_
int charge() const
track electric charge
const int minHitsinTIDminus_
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
const SiStripRecHit2D & originalHit() const
const bool applyPrescaledHitsFilter_
tuple size
Write out results.
const bool multiplicityOnInput_
bool useThisFilter()
returns if any of the Filters is used.
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.