Public Member Functions | |
void | beginEvent (const edm::Event &, const edm::EventSetup &) |
double | discriminate (const reco::PFTauRef &) |
RecoTauMVATransform (const edm::ParameterSet &pset) | |
~RecoTauMVATransform () | |
Private Types | |
typedef boost::ptr_map < reco::PFTau::hadronicDecayMode, TGraph > | TransformMap |
Private Attributes | |
edm::Handle < reco::PFTauDiscriminator > | disc_ |
edm::InputTag | input_ |
TransformMap | transforms_ |
Definition at line 45 of file RecoTauMVATransform.cc.
typedef boost::ptr_map<reco::PFTau::hadronicDecayMode, TGraph> RecoTauMVATransform::TransformMap [private] |
Definition at line 55 of file RecoTauMVATransform.cc.
RecoTauMVATransform::RecoTauMVATransform | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 63 of file RecoTauMVATransform.cc.
References edm::ParameterSet::getParameter(), input_, reco::tau::helpers::nCharged(), TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, HPSTancTaus_cff::transforms, transforms_, and reco::tau::translateDecayMode().
:PFTauDiscriminationProducerBase(pset) { input_ = pset.getParameter<edm::InputTag>("toTransform"); typedef std::vector<edm::ParameterSet> VPSet; const VPSet& transforms = pset.getParameter<VPSet>("transforms"); prediscriminantFailValue_ = -2.0; BOOST_FOREACH(const edm::ParameterSet &transform, transforms) { unsigned int nCharged = transform.getParameter<unsigned int>("nCharged"); unsigned int nPiZeros = transform.getParameter<unsigned int>("nPiZeros"); // Get the transform const edm::ParameterSet &transformImpl = transform.getParameter<edm::ParameterSet>("transform"); // Get the acutal decay mode reco::PFTau::hadronicDecayMode decayMode = reco::tau::translateDecayMode(nCharged, nPiZeros); if (!transforms_.count(decayMode)) { // Add it transforms_.insert(decayMode, buildTransform(transformImpl)); } else { edm::LogError("DecayModeNotUnique") << "The tau decay mode with " "nCharged/nPiZero = " << nCharged << "/" << nPiZeros << " dm: " << decayMode << " is associated to multiple MVA transforms, " "the second instantiation is being ignored!!!"; } } }
RecoTauMVATransform::~RecoTauMVATransform | ( | ) | [inline] |
Definition at line 48 of file RecoTauMVATransform.cc.
{}
void RecoTauMVATransform::beginEvent | ( | const edm::Event & | evt, |
const edm::EventSetup & | |||
) | [virtual] |
Reimplemented from TauDiscriminationProducerBase< TauType, TauDiscriminator >.
Definition at line 94 of file RecoTauMVATransform.cc.
References disc_, edm::Event::getByLabel(), and input_.
{ evt.getByLabel(input_, disc_); }
double RecoTauMVATransform::discriminate | ( | const reco::PFTauRef & | tau | ) |
Definition at line 98 of file RecoTauMVATransform.cc.
References TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, query::result, metsig::tau, transforms_, and relativeConstraints::value.
{ // Check if we support this decay mode: TransformMap::const_iterator transformIter = transforms_.find(tau->decayMode()); // Unsupported DM if (transformIter == transforms_.end()) return prediscriminantFailValue_; const TGraph *transform = transformIter->second; // Get the discriminator output to transform double value = (*disc_)[tau]; double result = transform->Eval(value); return result; }
Definition at line 59 of file RecoTauMVATransform.cc.
Referenced by beginEvent().
edm::InputTag RecoTauMVATransform::input_ [private] |
Definition at line 58 of file RecoTauMVATransform.cc.
Referenced by beginEvent(), and RecoTauMVATransform().
TransformMap RecoTauMVATransform::transforms_ [private] |
Definition at line 56 of file RecoTauMVATransform.cc.
Referenced by discriminate(), and RecoTauMVATransform().