CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

reco::tau::RecoTauDiscriminantInvariantWidth Class Reference

Inheritance diagram for reco::tau::RecoTauDiscriminantInvariantWidth:
reco::tau::RecoTauDiscriminantPlugin reco::tau::RecoTauEventHolderPlugin reco::tau::RecoTauNamedPlugin

List of all members.

Public Member Functions

std::vector< double > operator() (const reco::PFTauRef &tau) const
 RecoTauDiscriminantInvariantWidth (const edm::ParameterSet &pset)

Private Types

typedef std::pair< TauFuncPtr,
TauFuncPtr
MeanAndWidthFuncs
typedef StringObjectFunction
< PFTau
TauFunc
typedef boost::shared_ptr
< TauFunc
TauFuncPtr

Private Attributes

MeanAndWidthFuncs defaultTransform_
std::map
< reco::PFTau::hadronicDecayMode,
MeanAndWidthFuncs
transforms_

Detailed Description

Definition at line 21 of file RecoTauDiscriminantInvariantWidth.cc.


Member Typedef Documentation

Definition at line 29 of file RecoTauDiscriminantInvariantWidth.cc.

Definition at line 27 of file RecoTauDiscriminantInvariantWidth.cc.

Definition at line 28 of file RecoTauDiscriminantInvariantWidth.cc.


Constructor & Destructor Documentation

reco::tau::RecoTauDiscriminantInvariantWidth::RecoTauDiscriminantInvariantWidth ( const edm::ParameterSet pset) [explicit]

Definition at line 35 of file RecoTauDiscriminantInvariantWidth.cc.

References defaultTransform_, edm::ParameterSet::getParameter(), reco::tau::helpers::nCharged(), AlCaHLTBitMon_QueryRunRegistry::string, transforms_, and reco::tau::translateDecayMode().

                                :RecoTauDiscriminantPlugin(pset) {
  typedef std::vector<edm::ParameterSet> VPSet;
  // Add each of the transformations
  BOOST_FOREACH(const edm::ParameterSet& dm,
      pset.getParameter<VPSet>("decayModes")) {
    uint32_t nCharged = dm.getParameter<uint32_t>("nCharged");
    uint32_t nPiZeros = dm.getParameter<uint32_t>("nPiZeros");
    MeanAndWidthFuncs functions;
    functions.first.reset(new TauFunc(dm.getParameter<std::string>("mean")));
    functions.second.reset(new TauFunc(dm.getParameter<std::string>("rms")));
    transforms_[translateDecayMode(nCharged, nPiZeros)] = functions;
  }
  defaultTransform_.first.reset(
      new TauFunc(pset.getParameter<std::string>("defaultMean")));
  defaultTransform_.second.reset(
      new TauFunc(pset.getParameter<std::string>("defaultRMS")));
}

Member Function Documentation

std::vector< double > reco::tau::RecoTauDiscriminantInvariantWidth::operator() ( const reco::PFTauRef tau) const [virtual]

Implements reco::tau::RecoTauDiscriminantPlugin.

Definition at line 54 of file RecoTauDiscriminantInvariantWidth.cc.

References defaultTransform_, timingPdfMaker::mean, reco::tau::disc::OpeningDeltaR(), query::result, plotscripts::rms(), and transforms_.

                                   {
  double weightedDeltaR = disc::OpeningDeltaR(*tau);

  std::map<reco::PFTau::hadronicDecayMode, MeanAndWidthFuncs>::const_iterator
    transform = transforms_.find(tau->decayMode());

  const TauFunc* meanFunc = defaultTransform_.first.get();
  const TauFunc* rmsFunc = defaultTransform_.second.get();

  if (transform != transforms_.end()) {
    meanFunc = transform->second.first.get();
    rmsFunc = transform->second.second.get();
  }

  double mean = (*meanFunc)(*tau);
  double rms = (*rmsFunc)(*tau);

  double result = (rms > 0) ? (weightedDeltaR - mean)/rms : -1.;

  return std::vector<double>(1, result);
}

Member Data Documentation