CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

RecoTauMVATransform Class Reference

Inheritance diagram for RecoTauMVATransform:
TauDiscriminationProducerBase< TauType, TauDiscriminator > edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

List of all members.

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_

Detailed Description

Definition at line 45 of file RecoTauMVATransform.cc.


Member Typedef Documentation

typedef boost::ptr_map<reco::PFTau::hadronicDecayMode, TGraph> RecoTauMVATransform::TransformMap [private]

Definition at line 55 of file RecoTauMVATransform.cc.


Constructor & Destructor Documentation

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_, create_public_pileup_plots::transform, hpstanc_transforms::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.

{}

Member Function Documentation

void RecoTauMVATransform::beginEvent ( const edm::Event evt,
const edm::EventSetup  
) [virtual]
double RecoTauMVATransform::discriminate ( const reco::PFTauRef tau)

Definition at line 98 of file RecoTauMVATransform.cc.

References TauDiscriminationProducerBase< TauType, TauDiscriminator >::prediscriminantFailValue_, query::result, metsig::tau, create_public_pileup_plots::transform, 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;
}

Member Data Documentation

Definition at line 59 of file RecoTauMVATransform.cc.

Referenced by beginEvent().

Definition at line 58 of file RecoTauMVATransform.cc.

Referenced by beginEvent(), and RecoTauMVATransform().

Definition at line 56 of file RecoTauMVATransform.cc.

Referenced by discriminate(), and RecoTauMVATransform().