1 #include <boost/foreach.hpp>
16 double factor =
sqrt(vec.energy()*vec.energy() - mass*mass)/vec.P();
46 typedef std::pair<unsigned int, unsigned int>
IntPair;
62 signalConeFun_(pset.getParameter<std::
string>(
"coneSizeFormula"))
68 typedef std::vector<edm::ParameterSet> VPSet;
69 const VPSet& decayModes = pset.
getParameter<VPSet>(
"decayModes");
73 if ( decayMode.
exists(
"nTracksMin") ) {
78 if ( decayMode.
exists(
"nChargedPFCandsMin") ) {
85 if ( decayMode.
exists(
"minPi0Mass") ) {
92 if ( decayMode.
exists(
"assumeStripMass") ) {
114 delete it->second.maxMass_;
122 edm::LogPrint(
"PFTauByHPSSelect") <<
"<PFRecoTauDiscriminationByHPSSelection::discriminate>:" ;
123 edm::LogPrint(
"PFTauByHPSSelect") <<
" nCharged = " << tau->signalTauChargedHadronCandidates().size() ;
124 edm::LogPrint(
"PFTauByHPSSelect") <<
" nPiZeros = " << tau->signalPiZeroCandidates().size() ;
128 if ( tau->pt() <
minPt_ ) {
136 DecayModeCutMap::const_iterator massWindowIter =
137 decayModeCuts_.find(std::make_pair(tau->signalTauChargedHadronCandidates().size(),
138 tau->signalPiZeroCandidates().size()));
142 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails mass-window definition requirement." ;
149 unsigned int nTracks = 0;
150 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
151 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator chargedHadron = chargedHadrons.begin();
152 chargedHadron != chargedHadrons.end(); ++chargedHadron ) {
162 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nTracks requirement for mass-window." ;
168 unsigned int nChargedPFCands = 0;
169 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons = tau->signalTauChargedHadronCandidates();
170 for ( std::vector<reco::PFRecoTauChargedHadron>::const_iterator chargedHadron = chargedHadrons.begin();
171 chargedHadron != chargedHadrons.end(); ++chargedHadron ) {
181 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails nChargedPFCands requirement for mass-window." ;
189 edm::LogPrint(
"PFTauByHPSSelect") <<
"tau: Pt = " << tauP4.pt() <<
", eta = " << tauP4.eta() <<
", phi = " << tauP4.phi() <<
", mass = " << tauP4.mass() ;
194 tau->signalPiZeroCandidates()){
202 tau->signalPiZeroCandidates()){
208 stripsP4 += correction;
212 edm::LogPrint(
"PFTauByHPSSelect") <<
"strips: Pt = " << stripsP4.pt() <<
", eta = " << stripsP4.eta() <<
", phi = " << stripsP4.phi() <<
", mass = " << stripsP4.mass() ;
216 double maxMass_value = (*massWindow.
maxMass_)(*tau);
217 if ( tauP4.M() > maxMass_value || tauP4.M() < massWindow.
minMass_ ) {
219 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails tau mass-window cut." ;
228 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails strip mass-window cut." ;
237 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails matching-cone cut." ;
249 if (
deltaR(cand.
p4(), tauP4) > cone_size ) {
251 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for charged hadron(s)." ;
261 if (
deltaR(cand.
p4(), tauP4) > cone_size ) {
263 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails signal-cone cut for strip(s)." ;
276 else algo_string =
"Undefined";
277 edm::LogPrint(
"PFTauByHPSSelect") <<
"algo(signalPFChargedHadr) = " << algo_string ;
281 edm::LogPrint(
"PFTauByHPSSelect") <<
" fails cut on PFRecoTauChargedHadron algo." ;
~PFRecoTauDiscriminationByHPSSelection()
T getParameter(std::string const &) const
std::map< IntPair, DecayModeCuts > DecayModeCutMap
PFRecoTauChargedHadronAlgorithm algo() const
Algorithm that built this charged hadron.
PFRecoTauDiscriminationByHPSSelection(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool requireTauChargedHadronsToBeChargedPFCands_
unsigned nChargedPFCandsMin_
std::pair< unsigned int, unsigned int > IntPair
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::pair< double, double > DoublePair
StringObjectFunction< reco::PFTau > TauFunc
math::XYZTLorentzVector LorentzVector
Lorentz vector.
DecayModeCutMap decayModeCuts_
double discriminate(const reco::PFTauRef &) const override
virtual const LorentzVector & p4() const
four-momentum Lorentz vector