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 std::cout <<
"<PFRecoTauDiscriminationByHPSSelection::discriminate>:" << std::endl;
123 std::cout <<
" nCharged = " << tau->signalTauChargedHadronCandidates().size() << std::endl;
124 std::cout <<
" nPiZeros = " << tau->signalPiZeroCandidates().size() << std::endl;
128 if ( tau->pt() <
minPt_ ) {
130 std::cout <<
" fails minPt cut." << std::endl;
136 DecayModeCutMap::const_iterator massWindowIter =
137 decayModeCuts_.find(std::make_pair(tau->signalTauChargedHadronCandidates().size(),
138 tau->signalPiZeroCandidates().size()));
142 std::cout <<
" fails mass-window definition requirement." << std::endl;
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 ) {
158 std::cout <<
"nTracks = " << nTracks <<
" (min = " << massWindow.
nTracksMin_ <<
")" << std::endl;
162 std::cout <<
" fails nTracks requirement for mass-window." << std::endl;
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 std::cout <<
" fails nChargedPFCands requirement for mass-window." << std::endl;
189 std::cout <<
"tau: Pt = " << tauP4.pt() <<
", eta = " << tauP4.eta() <<
", phi = " << tauP4.phi() <<
", mass = " << tauP4.mass() << std::endl;
194 tau->signalPiZeroCandidates()){
202 tau->signalPiZeroCandidates()){
208 stripsP4 += correction;
212 std::cout <<
"strips: Pt = " << stripsP4.pt() <<
", eta = " << stripsP4.eta() <<
", phi = " << stripsP4.phi() <<
", mass = " << stripsP4.mass() << std::endl;
216 double maxMass_value = (*massWindow.
maxMass_)(*tau);
217 if ( tauP4.M() > maxMass_value || tauP4.M() < massWindow.
minMass_ ) {
219 std::cout <<
" fails tau mass-window cut." << std::endl;
228 std::cout <<
" fails strip mass-window cut." << std::endl;
237 std::cout <<
" fails matching-cone cut." << std::endl;
247 std::cout <<
"dR(tau, signalPFChargedHadr) = " <<
deltaR(cand.
p4(), tauP4) << std::endl;
249 if (
deltaR(cand.
p4(), tauP4) > cone_size ) {
251 std::cout <<
" fails signal-cone cut for charged hadron(s)." << std::endl;
259 std::cout <<
"dR(tau, signalPiZero) = " <<
deltaR(cand.
p4(), tauP4) << std::endl;
261 if (
deltaR(cand.
p4(), tauP4) > cone_size ) {
263 std::cout <<
" fails signal-cone cut for strip(s)." << std::endl;
276 else algo_string =
"Undefined";
277 std::cout <<
"algo(signalPFChargedHadr) = " << algo_string << std::endl;
281 std::cout <<
" fails cut on PFRecoTauChargedHadron algo." << std::endl;
290 std::cout <<
" passes all cuts." << std::endl;
~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 &)
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
#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.
double discriminate(const reco::PFTauRef &) override
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_