122 edm::LogPrint(
"PFTauByHPSSelect") <<
"<PFRecoTauDiscriminationByHPSSelection::discriminate>:";
123 edm::LogPrint(
"PFTauByHPSSelect") <<
" nCharged = " << tau->signalTauChargedHadronCandidates().size();
124 edm::LogPrint(
"PFTauByHPSSelect") <<
" nPiZeros = " << tau->signalPiZeroCandidates().size();
136 DecayModeCutMap::const_iterator massWindowIter =
decayModeCuts_.find(
137 std::make_pair(tau->signalTauChargedHadronCandidates().size(), tau->signalPiZeroCandidates().size()));
141 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails mass-window definition requirement.";
145 const DecayModeCuts& massWindow = massWindowIter->second;
147 if (massWindow.nTracksMin_ > 0) {
149 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
150 for (std::vector<reco::PFRecoTauChargedHadron>::const_iterator chargedHadron = chargedHadrons.begin();
151 chargedHadron != chargedHadrons.end();
159 edm::LogPrint(
"PFTauByHPSSelect") <<
"nTracks = " << nTracks <<
" (min = " << massWindow.nTracksMin_ <<
")";
161 if (nTracks < massWindow.nTracksMin_) {
163 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nTracks requirement for mass-window.";
168 if (massWindow.nChargedPFCandsMin_ > 0) {
169 unsigned int nChargedPFCands = 0;
170 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
171 for (std::vector<reco::PFRecoTauChargedHadron>::const_iterator chargedHadron = chargedHadrons.begin();
172 chargedHadron != chargedHadrons.end();
179 edm::LogPrint(
"PFTauByHPSSelect") <<
"nChargedPFCands = " << nChargedPFCands
180 <<
" (min = " << massWindow.nChargedPFCandsMin_ <<
")";
182 if (nChargedPFCands < massWindow.nChargedPFCandsMin_) {
184 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nChargedPFCands requirement for mass-window.";
192 edm::LogPrint(
"PFTauByHPSSelect") <<
"tau: Pt = " << tauP4.pt() <<
", eta = " << tauP4.eta()
193 <<
", phi = " << tauP4.phi() <<
", mass = " << tauP4.mass();
197 for (
auto const& cand : tau->signalPiZeroCandidates()) {
203 if (massWindow.assumeStripMass_ >= 0) {
204 for (
auto const& cand : tau->signalPiZeroCandidates()) {
213 edm::LogPrint(
"PFTauByHPSSelect") <<
"strips: Pt = " << stripsP4.pt() <<
", eta = " << stripsP4.eta()
214 <<
", phi = " << stripsP4.phi() <<
", mass = " << stripsP4.mass();
218 double maxMass_value = (*massWindow.maxMass_)(*tau);
219 double bendCorrection_mass = (massWindow.applyBendCorrection_mass_) ? tau->bendCorrMass() : 0.;
220 if (!((tauP4.M() - bendCorrection_mass) < maxMass_value && (tauP4.M() + bendCorrection_mass) > massWindow.minMass_)) {
222 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut.";
229 const std::vector<reco::PFRecoTauChargedHadron>& signalChargedHadrons = tau->signalTauChargedHadronCandidates();
230 for (std::vector<reco::PFRecoTauChargedHadron>::const_iterator signalChargedHadron = signalChargedHadrons.begin();
231 signalChargedHadron != signalChargedHadrons.end();
232 ++signalChargedHadron) {
233 tauP4_charged += signalChargedHadron->p4();
235 if (!(tauP4_charged.mass() < maxMass_value)) {
237 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut.";
243 if (stripsP4.M() > massWindow.maxPi0Mass_ || stripsP4.M() < massWindow.minPi0Mass_) {
245 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails strip mass-window cut.";
254 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails matching-cone cut.";
260 double cone_size = tau->signalConeSize();
262 for (
auto const& cand : tau->signalTauChargedHadronCandidates()) {
264 edm::LogPrint(
"PFTauByHPSSelect") <<
"dR(tau, signalPFChargedHadr) = " <<
deltaR(cand.p4(), tauP4);
266 if (
deltaR(cand.p4(), tauP4) > cone_size) {
268 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for charged hadron(s).";
274 for (
auto const& cand : tau->signalPiZeroCandidates()) {
275 double bendCorrection_eta = (massWindow.applyBendCorrection_eta_) ? cand.bendCorrEta() : 0.;
276 double dEta =
std::max(0., fabs(cand.eta() - tauP4.eta()) - bendCorrection_eta);
277 double bendCorrection_phi = (massWindow.applyBendCorrection_phi_) ? cand.bendCorrPhi() : 0.;
279 double dR2 = dEta * dEta + dPhi * dPhi;
281 edm::LogPrint(
"PFTauByHPSSelect") <<
"dR2(tau, signalPiZero) = " << dR2;
283 if (dR2 > cone_size * cone_size) {
285 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for strip(s).";
292 for (
auto const& cand : tau->signalTauChargedHadronCandidates()) {
296 algo_string =
"ChargedPFCandidate";
298 algo_string =
"Track";
300 algo_string =
"PFNeutralHadron";
302 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 for (
const auto& chargedHadrCand : tau->signalChargedHadrCands()) {
318 if (track !=
nullptr) {
324 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails cut on sum of pixel hits.";
constexpr double deltaPhi(double phi1, double phi2)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool requireTauChargedHadronsToBeChargedPFCands_
Abs< T >::type abs(const T &t)
Log< level::Warning, true > LogPrint
static const TrackGhostTrackState * getTrack(const BasicGhostTrackState *basic)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
constexpr float correction(int sizeM1, int q_f, int q_l, uint16_t upper_edge_first_pix, uint16_t lower_edge_last_pix, float lorentz_shift, float theThickness, float cot_angle, float pitch, bool first_is_big, bool last_is_big)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
DecayModeCutMap decayModeCuts_
int numberOfValidPixelHits() const