26 applyBasicCuts_( cfg.getParameter<bool>(
"applyBasicCuts" ) ),
27 applyNHighestPt_( cfg.getParameter<bool>(
"applyNHighestPt" ) ),
28 applyMultiplicityFilter_( cfg.getParameter<bool>(
"applyMultiplicityFilter" ) ),
29 seedOnlyFromAbove_( cfg.getParameter<int>(
"seedOnlyFrom" ) ),
30 applyIsolation_( cfg.getParameter<bool>(
"applyIsolationCut" ) ),
31 chargeCheck_( cfg.getParameter<bool>(
"applyChargeCheck" ) ),
32 nHighestPt_( cfg.getParameter<int>(
"nHighestPt" ) ),
33 minMultiplicity_ ( cfg.getParameter<int>(
"minMultiplicity" ) ),
34 maxMultiplicity_ ( cfg.getParameter<int>(
"maxMultiplicity" ) ),
35 multiplicityOnInput_ ( cfg.getParameter<bool>(
"multiplicityOnInput" ) ),
36 ptMin_( cfg.getParameter<double>(
"ptMin" ) ),
37 ptMax_( cfg.getParameter<double>(
"ptMax" ) ),
38 etaMin_( cfg.getParameter<double>(
"etaMin" ) ),
39 etaMax_( cfg.getParameter<double>(
"etaMax" ) ),
40 phiMin_( cfg.getParameter<double>(
"phiMin" ) ),
41 phiMax_( cfg.getParameter<double>(
"phiMax" ) ),
42 nHitMin_( cfg.getParameter<double>(
"nHitMin" ) ),
43 nHitMax_( cfg.getParameter<double>(
"nHitMax" ) ),
44 chi2nMax_( cfg.getParameter<double>(
"chi2nMax" ) ),
45 minHitChargeStrip_( cfg.getParameter<double>(
"minHitChargeStrip" ) ),
46 minHitIsolation_( cfg.getParameter<double>(
"minHitIsolation" ) ),
47 rphirecHitsTag_( cfg.getParameter<edm::InputTag>(
"rphirecHits") ),
48 matchedrecHitsTag_( cfg.getParameter<edm::InputTag>(
"matchedrecHits") ),
49 nHitMin2D_( cfg.getParameter<unsigned int>(
"nHitMin2D" ) ),
51 minHitsinTIB_(cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTIB" ) ),
52 minHitsinTOB_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTOB" ) ),
53 minHitsinTID_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTID" ) ),
54 minHitsinTEC_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inTEC" ) ),
55 minHitsinBPIX_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inBPIX" ) ),
56 minHitsinFPIX_ (cfg.getParameter<edm::
ParameterSet>(
"minHitsPerSubDet" ).getParameter<int>(
"inFPIX" ) )
61 <<
"applying basic track cuts ..."
71 <<
"filter N tracks with highest Pt N=" <<
nHighestPt_;
81 " cm from other rechits";
86 " ADC counts of total cluster charge";
89 <<
"Minimum number of hits in TIB/TID/TOB/TEC/BPIX/FPIX = "
141 for (Tracks::const_iterator it=tracks.begin(); it != tracks.end(); ++it) {
143 float pt=trackp->
pt();
174 int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
175 int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0;
176 unsigned int nHit2D = 0;
177 unsigned int thishit = 0;
182 int type = (*iHit)->geographicalId().subdetId();
193 if (!(*iHit)->isValid())
continue;
194 const DetId detId((*iHit)->geographicalId());
196 edm::LogError(
"DetectorMismatch") <<
"@SUB=CalibrationTrackSelector::detailedHitsCheck"
198 <<
"), but " << detId.det() <<
".";
207 else if (
kBPIX == detId.subdetId()) ++nhitinBPIX;
208 else if (
kFPIX == detId.subdetId()) ++nhitinFPIX;
210 if (nHit2D < nHitMin2D_ && this->
isHit2D(**iHit)) ++nHit2D;
230 if (detId.subdetId() ==
kBPIX || detId.subdetId() ==
kFPIX) {
233 if (dynamic_cast<const SiStripRecHit2D*>(&hit))
return false;
234 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
return true;
235 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit))
return false;
237 edm::LogError(
"UnkownType") <<
"@SUB=CalibrationTrackSelector::isHit2D"
238 <<
"Tracker hit not in pixel and neither SiStripRecHit2D nor "
239 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
244 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=CalibrationTrackSelector::isHit2D"
245 <<
"Hit not in tracker with 'official' dimension >=2.";
259 const SiStripMatchedRecHit2D* matchedhit =
dynamic_cast<const SiStripMatchedRecHit2D*
>(therechit);
260 const SiStripRecHit2D*
hit =
dynamic_cast<const SiStripRecHit2D*
>(therechit);
265 const std::vector<uint16_t> amplitudesmono( monocluster.
amplitudes().begin(),
267 for(
size_t ia=0; ia<amplitudesmono.size();++ia)
268 { charge1+=amplitudesmono[ia];}
270 const SiStripCluster & stereocluster = matchedhit->stereoCluster();
271 const std::vector<uint16_t> amplitudesstereo( stereocluster.
amplitudes().begin(),
273 for(
size_t ia=0; ia<amplitudesstereo.size();++ia)
274 {charge2+=amplitudesstereo[ia];}
282 const std::vector<uint16_t> amplitudes( cluster->
amplitudes().begin(),
284 for(
size_t ia=0; ia<amplitudes.size();++ia)
285 {charge1+=amplitudes[ia];}
289 else if (unmatchedhit) {
291 const SiStripRecHit2D &orighit = unmatchedhit->
originalHit();
293 const std::vector<uint16_t> amplitudes( origcluster->
amplitudes().begin(),
295 for(
size_t ia=0; ia<amplitudes.size();++ia)
296 {charge1+=amplitudes[ia];}
325 for( istripSt=stripcollSt.
data().begin(); istripSt!=stripcollSt.
data().end(); ++istripSt ) {
326 const SiStripRecHit2D *aHit = &*(istripSt);
327 DetId mydet1 = aHit->geographicalId();
329 float theDistance = ( therechit->
localPosition() - aHit->localPosition() ).
mag();
335 for( istripStm=stripcollStm.
data().begin(); istripStm!=stripcollStm.
data().end(); ++istripStm ) {
336 const SiStripMatchedRecHit2D *aHit = &*(istripStm);
337 DetId mydet2 = aHit->geographicalId();
339 float theDistance = (therechit->
localPosition() - aHit->localPosition()).
mag();
358 for (Tracks::const_iterator it=sortedTracks.begin();
359 it!=sortedTracks.end(); ++it) {
const edm::InputTag matchedrecHitsTag_
virtual int dimension() const =0
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const bool multiplicityOnInput_
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)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Tracks select(const Tracks &tracks, const edm::Event &evt) const
select tracks
double phi() const
azimuthal angle of momentum vector
const double minHitChargeStrip_
const bool applyIsolation_
const bool seedOnlyFromAbove_
const int minMultiplicity_
uint32_t rawId() const
get the raw id
const bool applyMultiplicityFilter_
double eta() const
pseudorapidity of momentum vector
bool isIsolated(const TrackingRecHit *therechit, const edm::Event &evt) const
bool detailedHitsCheck(const reco::Track *track, const edm::Event &evt) const
checking hit requirements beyond simple number of valid hits
double pt() const
track transverse momentum
data_type const * data(size_t cell) const
const edm::InputTag rphirecHitsTag_
unsigned short numberOfValidHits() const
number of valid hits found
~CalibrationTrackSelector()
destructor
bool isOkCharge(const TrackingRecHit *therechit) const
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const double minHitIsolation_
const int maxMultiplicity_
const double ptMin_
if true, cut min/maxMultiplicity on input instead of on final result
const unsigned int nHitMin2D_
Tracks theNHighestPtTracks(const Tracks &tracks) const
filter the n highest pt tracks
const bool applyBasicCuts_
bool isHit2D(const TrackingRecHit &hit) const
CalibrationTrackSelector(const edm::ParameterSet &cfg)
constructor
Tracks basicCuts(const Tracks &tracks, const edm::Event &evt) const
apply basic cuts on pt,eta,phi,nhit
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
const SiStripRecHit2D & originalHit() const
const std::vector< uint8_t > & amplitudes() const
const bool applyNHighestPt_
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.