130 edm::LogPrint(
"PFTauByHPSSelect") <<
"<PFRecoTauDiscriminationByHPSSelection::discriminate>:" ;
131 edm::LogPrint(
"PFTauByHPSSelect") <<
" nCharged = " << tau->signalTauChargedHadronCandidates().size() ;
132 edm::LogPrint(
"PFTauByHPSSelect") <<
" nPiZeros = " << tau->signalPiZeroCandidates().size() ;
136 if ( tau->pt() <
minPt_ ) {
144 DecayModeCutMap::const_iterator massWindowIter =
145 decayModeCuts_.find(std::make_pair(tau->signalTauChargedHadronCandidates().size(),
146 tau->signalPiZeroCandidates().size()));
150 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails mass-window definition requirement." ;
154 const DecayModeCuts& massWindow = massWindowIter->second;
156 if ( massWindow.nTracksMin_ > 0 ) {
158 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
159 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator
chargedHadron = chargedHadrons.begin();
166 edm::LogPrint(
"PFTauByHPSSelect") <<
"nTracks = " << nTracks <<
" (min = " << massWindow.nTracksMin_ <<
")" ;
168 if ( nTracks < massWindow.nTracksMin_ ) {
170 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nTracks requirement for mass-window." ;
175 if ( massWindow.nChargedPFCandsMin_ > 0 ) {
176 unsigned int nChargedPFCands = 0;
177 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
178 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator
chargedHadron = chargedHadrons.begin();
185 edm::LogPrint(
"PFTauByHPSSelect") <<
"nChargedPFCands = " << nChargedPFCands <<
" (min = " << massWindow.nChargedPFCandsMin_ <<
")" ;
187 if ( nChargedPFCands < massWindow.nChargedPFCandsMin_ ) {
189 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nChargedPFCands requirement for mass-window." ;
197 edm::LogPrint(
"PFTauByHPSSelect") <<
"tau: Pt = " << tauP4.pt() <<
", eta = " << tauP4.eta() <<
", phi = " << tauP4.phi() <<
", mass = " << tauP4.mass() ;
201 for(
auto const&
cand : tau->signalPiZeroCandidates()){
207 if (massWindow.assumeStripMass_ >= 0) {
208 for(
auto const&
cand : tau->signalPiZeroCandidates()){
211 applyMassConstraint(uncorrected, massWindow.assumeStripMass_);
214 stripsP4 += correction;
218 edm::LogPrint(
"PFTauByHPSSelect") <<
"strips: Pt = " << stripsP4.pt() <<
", eta = " << stripsP4.eta() <<
", phi = " << stripsP4.phi() <<
", mass = " << stripsP4.mass() ;
222 double maxMass_value = (*massWindow.maxMass_)(*tau);
223 double bendCorrection_mass = ( massWindow.applyBendCorrection_mass_ ) ? tau->bendCorrMass() : 0.;
224 if ( !((tauP4.M() - bendCorrection_mass) < maxMass_value && (tauP4.M() + bendCorrection_mass) > massWindow.minMass_) ) {
226 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
233 const std::vector<reco::PFRecoTauChargedHadron>& signalChargedHadrons = tau->signalTauChargedHadronCandidates();
234 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator signalChargedHadron = signalChargedHadrons.begin();
235 signalChargedHadron != signalChargedHadrons.end(); ++signalChargedHadron ) {
236 tauP4_charged += signalChargedHadron->p4();
238 if ( !(tauP4_charged.mass() < maxMass_value) ) {
240 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
246 if ( stripsP4.M() > massWindow.maxPi0Mass_ ||
247 stripsP4.M() < massWindow.minPi0Mass_ ) {
249 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails strip mass-window cut." ;
258 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails matching-cone cut." ;
264 double cone_size = tau->signalConeSize();
266 for (
auto const&
cand : tau->signalTauChargedHadronCandidates()) {
272 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for charged hadron(s)." ;
278 for (
auto const&
cand : tau->signalPiZeroCandidates()) {
279 double bendCorrection_eta = ( massWindow.applyBendCorrection_eta_ ) ?
cand.bendCorrEta() : 0.;
280 double dEta =
std::max(0., fabs(
cand.eta() - tauP4.eta()) - bendCorrection_eta);
281 double bendCorrection_phi = ( massWindow.applyBendCorrection_phi_ ) ?
cand.bendCorrPhi() : 0.;
283 double dR2 = dEta*dEta + dPhi*
dPhi;
285 edm::LogPrint(
"PFTauByHPSSelect") <<
"dR2(tau, signalPiZero) = " << dR2 ;
287 if ( dR2 > cone_size*cone_size ) {
289 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for strip(s)." ;
296 for(
auto const&
cand : tau->signalTauChargedHadronCandidates()) {
302 else algo_string =
"Undefined";
303 edm::LogPrint(
"PFTauByHPSSelect") <<
"algo(signalPFChargedHadr) = " << algo_string ;
307 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails cut on PFRecoTauChargedHadron algo." ;
315 int numPixelHits = 0;
316 const std::vector<reco::PFCandidatePtr>& chargedHadrCands = tau->signalPFChargedHadrCands();
317 for ( std::vector<reco::PFCandidatePtr>::const_iterator chargedHadrCand = chargedHadrCands.begin();
318 chargedHadrCand != chargedHadrCands.end(); ++chargedHadrCand ) {
320 if ( (*chargedHadrCand)->trackRef().isNonnull() ) track = (*chargedHadrCand)->trackRef().get();
321 else if ( (*chargedHadrCand)->gsfTrackRef().isNonnull() ) track = (*chargedHadrCand)->gsfTrackRef().get();
328 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)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool requireTauChargedHadronsToBeChargedPFCands_
Abs< T >::type abs(const T &t)
double deltaR(double eta1, double eta2, double phi1, double phi2)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
DecayModeCutMap decayModeCuts_
int numberOfValidPixelHits() const