132 edm::LogPrint(
"PFTauByHPSSelect") <<
"<PFRecoTauDiscriminationByHPSSelection::discriminate>:" ;
133 edm::LogPrint(
"PFTauByHPSSelect") <<
" nCharged = " << tau->signalTauChargedHadronCandidates().size() ;
134 edm::LogPrint(
"PFTauByHPSSelect") <<
" nPiZeros = " << tau->signalPiZeroCandidates().size() ;
138 if ( tau->pt() <
minPt_ ) {
146 DecayModeCutMap::const_iterator massWindowIter =
147 decayModeCuts_.find(std::make_pair(tau->signalTauChargedHadronCandidates().size(),
148 tau->signalPiZeroCandidates().size()));
152 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails mass-window definition requirement." ;
156 const DecayModeCuts& massWindow = massWindowIter->second;
158 if ( massWindow.nTracksMin_ > 0 ) {
160 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
161 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator
chargedHadron = chargedHadrons.begin();
168 edm::LogPrint(
"PFTauByHPSSelect") <<
"nTracks = " << nTracks <<
" (min = " << massWindow.nTracksMin_ <<
")" ;
170 if ( nTracks < massWindow.nTracksMin_ ) {
172 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nTracks requirement for mass-window." ;
177 if ( massWindow.nChargedPFCandsMin_ > 0 ) {
178 unsigned int nChargedPFCands = 0;
179 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
180 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator
chargedHadron = chargedHadrons.begin();
187 edm::LogPrint(
"PFTauByHPSSelect") <<
"nChargedPFCands = " << nChargedPFCands <<
" (min = " << massWindow.nChargedPFCandsMin_ <<
")" ;
189 if ( nChargedPFCands < massWindow.nChargedPFCandsMin_ ) {
191 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nChargedPFCands requirement for mass-window." ;
199 edm::LogPrint(
"PFTauByHPSSelect") <<
"tau: Pt = " << tauP4.pt() <<
", eta = " << tauP4.eta() <<
", phi = " << tauP4.phi() <<
", mass = " << tauP4.mass() ;
204 tau->signalPiZeroCandidates()){
210 if (massWindow.assumeStripMass_ >= 0) {
212 tau->signalPiZeroCandidates()){
215 applyMassConstraint(uncorrected, massWindow.assumeStripMass_);
218 stripsP4 += correction;
222 edm::LogPrint(
"PFTauByHPSSelect") <<
"strips: Pt = " << stripsP4.pt() <<
", eta = " << stripsP4.eta() <<
", phi = " << stripsP4.phi() <<
", mass = " << stripsP4.mass() ;
226 double maxMass_value = (*massWindow.maxMass_)(*tau);
227 double bendCorrection_mass = ( massWindow.applyBendCorrection_mass_ ) ? tau->bendCorrMass() : 0.;
228 if ( !((tauP4.M() - bendCorrection_mass) < maxMass_value && (tauP4.M() + bendCorrection_mass) > massWindow.minMass_) ) {
230 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
237 const std::vector<reco::PFRecoTauChargedHadron>& signalChargedHadrons = tau->signalTauChargedHadronCandidates();
238 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator signalChargedHadron = signalChargedHadrons.begin();
239 signalChargedHadron != signalChargedHadrons.end(); ++signalChargedHadron ) {
240 tauP4_charged += signalChargedHadron->p4();
242 if ( !(tauP4_charged.mass() < maxMass_value) ) {
244 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
250 if ( stripsP4.M() > massWindow.maxPi0Mass_ ||
251 stripsP4.M() < massWindow.minPi0Mass_ ) {
253 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails strip mass-window cut." ;
262 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails matching-cone cut." ;
268 double cone_size = tau->signalConeSize();
270 for (
auto const& cand : tau->signalTauChargedHadronCandidates()) {
274 if (
deltaR(cand.
p4(), tauP4) > cone_size ) {
276 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for charged hadron(s)." ;
282 for (
auto const& cand : tau->signalPiZeroCandidates()) {
283 double bendCorrection_eta = ( massWindow.applyBendCorrection_eta_ ) ? cand.
bendCorrEta() : 0.;
284 double dEta =
std::max(0., fabs(cand.
eta() - tauP4.eta()) - bendCorrection_eta);
285 double bendCorrection_phi = ( massWindow.applyBendCorrection_phi_ ) ? cand.
bendCorrPhi() : 0.;
287 double dR2 = dEta*dEta + dPhi*
dPhi;
289 edm::LogPrint(
"PFTauByHPSSelect") <<
"dR2(tau, signalPiZero) = " << dR2 ;
291 if ( dR2 > cone_size*cone_size ) {
293 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for strip(s)." ;
306 else algo_string =
"Undefined";
307 edm::LogPrint(
"PFTauByHPSSelect") <<
"algo(signalPFChargedHadr) = " << algo_string ;
311 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails cut on PFRecoTauChargedHadron algo." ;
319 int numPixelHits = 0;
320 const std::vector<reco::PFCandidatePtr>& chargedHadrCands = tau->signalPFChargedHadrCands();
321 for ( std::vector<reco::PFCandidatePtr>::const_iterator chargedHadrCand = chargedHadrCands.begin();
322 chargedHadrCand != chargedHadrCands.end(); ++chargedHadrCand ) {
324 if ( (*chargedHadrCand)->trackRef().isNonnull() ) track = (*chargedHadrCand)->trackRef().get();
325 else if ( (*chargedHadrCand)->gsfTrackRef().isNonnull() ) track = (*chargedHadrCand)->gsfTrackRef().get();
332 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails cut on sum of pixel hits." ;
constexpr double deltaPhi(double phi1, double phi2)
const unsigned int nTracks(const reco::Vertex &sv)
PFRecoTauChargedHadronAlgorithm algo() const
Algorithm that built this charged hadron.
double eta() const final
momentum pseudorapidity
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool requireTauChargedHadronsToBeChargedPFCands_
Abs< T >::type abs(const T &t)
const LorentzVector & p4() const final
four-momentum Lorentz vector
double deltaR(double eta1, double eta2, double phi1, double phi2)
float bendCorrEta() const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
float bendCorrPhi() const
DecayModeCutMap decayModeCuts_
int numberOfValidPixelHits() const
double phi() const final
momentum azimuthal angle