135 edm::LogPrint(
"PFTauByHPSSelect") <<
"<PFRecoTauDiscriminationByHPSSelection::discriminate>:" ;
136 edm::LogPrint(
"PFTauByHPSSelect") <<
" nCharged = " << tau->signalTauChargedHadronCandidates().size() ;
137 edm::LogPrint(
"PFTauByHPSSelect") <<
" nPiZeros = " << tau->signalPiZeroCandidates().size() ;
141 if ( tau->pt() <
minPt_ ) {
149 DecayModeCutMap::const_iterator massWindowIter =
150 decayModeCuts_.find(std::make_pair(tau->signalTauChargedHadronCandidates().size(),
151 tau->signalPiZeroCandidates().size()));
155 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails mass-window definition requirement." ;
159 const DecayModeCuts& massWindow = massWindowIter->second;
161 if ( massWindow.nTracksMin_ > 0 ) {
163 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
164 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator
chargedHadron = chargedHadrons.begin();
171 edm::LogPrint(
"PFTauByHPSSelect") <<
"nTracks = " << nTracks <<
" (min = " << massWindow.nTracksMin_ <<
")" ;
173 if ( nTracks < massWindow.nTracksMin_ ) {
175 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nTracks requirement for mass-window." ;
180 if ( massWindow.nChargedPFCandsMin_ > 0 ) {
181 unsigned int nChargedPFCands = 0;
182 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
183 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator
chargedHadron = chargedHadrons.begin();
190 edm::LogPrint(
"PFTauByHPSSelect") <<
"nChargedPFCands = " << nChargedPFCands <<
" (min = " << massWindow.nChargedPFCandsMin_ <<
")" ;
192 if ( nChargedPFCands < massWindow.nChargedPFCandsMin_ ) {
194 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nChargedPFCands requirement for mass-window." ;
202 edm::LogPrint(
"PFTauByHPSSelect") <<
"tau: Pt = " << tauP4.pt() <<
", eta = " << tauP4.eta() <<
", phi = " << tauP4.phi() <<
", mass = " << tauP4.mass() ;
206 for(
auto const&
cand : tau->signalPiZeroCandidates()){
212 if (massWindow.assumeStripMass_ >= 0) {
213 for(
auto const&
cand : tau->signalPiZeroCandidates()){
216 applyMassConstraint(uncorrected, massWindow.assumeStripMass_);
219 stripsP4 += correction;
223 edm::LogPrint(
"PFTauByHPSSelect") <<
"strips: Pt = " << stripsP4.pt() <<
", eta = " << stripsP4.eta() <<
", phi = " << stripsP4.phi() <<
", mass = " << stripsP4.mass() ;
227 double maxMass_value = (*massWindow.maxMass_)(*tau);
228 double bendCorrection_mass = ( massWindow.applyBendCorrection_mass_ ) ? tau->bendCorrMass() : 0.;
229 if ( !((tauP4.M() - bendCorrection_mass) < maxMass_value && (tauP4.M() + bendCorrection_mass) > massWindow.minMass_) ) {
231 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
238 const std::vector<reco::PFRecoTauChargedHadron>& signalChargedHadrons = tau->signalTauChargedHadronCandidates();
239 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator signalChargedHadron = signalChargedHadrons.begin();
240 signalChargedHadron != signalChargedHadrons.end(); ++signalChargedHadron ) {
241 tauP4_charged += signalChargedHadron->p4();
243 if ( !(tauP4_charged.mass() < maxMass_value) ) {
245 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
251 if ( stripsP4.M() > massWindow.maxPi0Mass_ ||
252 stripsP4.M() < massWindow.minPi0Mass_ ) {
254 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails strip mass-window cut." ;
263 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails matching-cone cut." ;
269 double cone_size = tau->signalConeSize();
271 for (
auto const&
cand : tau->signalTauChargedHadronCandidates()) {
277 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for charged hadron(s)." ;
283 for (
auto const&
cand : tau->signalPiZeroCandidates()) {
284 double bendCorrection_eta = ( massWindow.applyBendCorrection_eta_ ) ?
cand.bendCorrEta() : 0.;
285 double dEta =
std::max(0., fabs(
cand.eta() - tauP4.eta()) - bendCorrection_eta);
286 double bendCorrection_phi = ( massWindow.applyBendCorrection_phi_ ) ?
cand.bendCorrPhi() : 0.;
288 double dR2 = dEta*dEta + dPhi*
dPhi;
290 edm::LogPrint(
"PFTauByHPSSelect") <<
"dR2(tau, signalPiZero) = " << dR2 ;
292 if ( dR2 > cone_size*cone_size ) {
294 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for strip(s)." ;
301 for(
auto const&
cand : tau->signalTauChargedHadronCandidates()) {
307 else algo_string =
"Undefined";
308 edm::LogPrint(
"PFTauByHPSSelect") <<
"algo(signalPFChargedHadr) = " << algo_string ;
312 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails cut on PFRecoTauChargedHadron algo." ;
320 int numPixelHits = 0;
321 for (
const auto& chargedHadrCand : tau->signalChargedHadrCands()) {
323 if (track !=
nullptr) {
329 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)
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
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