CMS 3D CMS Logo

Public Member Functions | Private Attributes

hitfit::METTranslatorBase< AMet > Class Template Reference

Template class of function object to translate missing transverse energy physics object to HitFit's Fourvec object. Users need to write an implementation of a template specialization of this class for their missing transverse energy physics object class, Then users combine this header file and their implementation for their analysis code. With this approach, it is possible to use HitFit for different missing transverse energy physics object class indifferent experiments. More...

#include <METTranslatorBase.h>

List of all members.

Public Member Functions

Resolution KtResolution (const AMet &met, bool useObjEmbRes=false) const
 Return the $ k_{T} $ resolution corresponding to an instance of missing transverse energy object.
template<>
Resolution KtResolution (const CLHEP::HepLorentzVector &m, bool useObjEmbRes) const
template<>
Resolution KtResolution (const pat::MET &m, bool useObjEmbRes) const
template<>
Resolution METResolution (const pat::MET &m, bool useObjEmbRes) const
Resolution METResolution (const AMet &met, bool useObjEmbRes=false) const
 Alias for KtResolution(AMet& met)
template<>
Resolution METResolution (const CLHEP::HepLorentzVector &m, bool useObjEmbRes) const
template<>
 METTranslatorBase (const std::string &ifile)
 METTranslatorBase ()
 Default constructor.
 METTranslatorBase (const std::string &ifile)
 Constructor, instantiate a METTranslatorBase object using the name of and input file in std::string format.
template<>
 METTranslatorBase (const std::string &ifile)
template<>
 METTranslatorBase ()
template<>
 METTranslatorBase ()
template<>
Fourvec operator() (const pat::MET &m, bool useObjEmbRes)
Fourvec operator() (const AMet &met, bool useObjEmbRes=false)
 Convert a missing transverse energy object of type AMet into HitFit four-momentum object of type Fourvec.
template<>
Fourvec operator() (const CLHEP::HepLorentzVector &m, bool useObjEmbRes)
template<>
 ~METTranslatorBase ()
template<>
 ~METTranslatorBase ()
 ~METTranslatorBase ()
 Destructor.

Private Attributes

Resolution resolution_
 The resolution.

Detailed Description

template<class AMet>
class hitfit::METTranslatorBase< AMet >

Template class of function object to translate missing transverse energy physics object to HitFit's Fourvec object. Users need to write an implementation of a template specialization of this class for their missing transverse energy physics object class, Then users combine this header file and their implementation for their analysis code. With this approach, it is possible to use HitFit for different missing transverse energy physics object class indifferent experiments.

Parameters:
AMetThe typename of the missing transverse energy physics object class be translated into HitFit's Fourvec.

Definition at line 51 of file METTranslatorBase.h.


Constructor & Destructor Documentation

template<class AMet>
hitfit::METTranslatorBase< AMet >::METTranslatorBase ( )

Default constructor.

template<class AMet>
hitfit::METTranslatorBase< AMet >::METTranslatorBase ( const std::string &  ifile)

Constructor, instantiate a METTranslatorBase object using the name of and input file in std::string format.

Parameters:
ifileThe path of the input file.
template<class AMet>
hitfit::METTranslatorBase< AMet >::~METTranslatorBase ( )

Destructor.

template<>
hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::METTranslatorBase ( )

Definition at line 203 of file CLHEPHitFitTranslator.cc.

{
    resolution_ = Resolution(std::string("0,0,12"));
} // METTranslatorBase<CLHEP::HepLorentzVector>::METTranslatorBase()
template<>
hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::METTranslatorBase ( const std::string &  ifile)

Definition at line 210 of file CLHEPHitFitTranslator.cc.

References hitfit::Defaults_Text::get_string().

{
    const Defaults_Text defs(ifile);
    std::string resolution_string(defs.get_string("met_resolution"));
    resolution_ = Resolution(resolution_string);

} // METTranslatorBase<CLHEP::HepLorentzVector>::METTranslatorBase(const std::string& ifile)
template<>
hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::~METTranslatorBase ( )

Definition at line 220 of file CLHEPHitFitTranslator.cc.

{
} // METTranslatorBase<CLHEP::HepLorentzVector>::~METTranslatorBase()

Definition at line 29 of file PatMETHitFitTranslator.cc.

{
    resolution_ = Resolution(std::string("0,0,12"));
} // METTranslatorBase<pat::MET>::METTranslatorBase()
template<>
hitfit::METTranslatorBase< pat::MET >::METTranslatorBase ( const std::string &  ifile)

Definition at line 36 of file PatMETHitFitTranslator.cc.

References hitfit::Defaults_Text::get_string().

{
    const Defaults_Text defs(ifile);
    std::string resolution_string(defs.get_string("met_resolution"));
    resolution_ = Resolution(resolution_string);

} // METTranslatorBase<pat::MET>::METTranslatorBase(const std::string& ifile)

Definition at line 46 of file PatMETHitFitTranslator.cc.

{
} // METTranslatorBase<pat::MET>::~METTranslatorBase()

Member Function Documentation

template<class AMet>
Resolution hitfit::METTranslatorBase< AMet >::KtResolution ( const AMet &  met,
bool  useObjEmbRes = false 
) const

Return the $ k_{T} $ resolution corresponding to an instance of missing transverse energy object.

Parameters:
metThe missing transverse energy object whose resolution is wished to be known.
useObjEmbResBoolean parameter to indicate if the user would like to use the resolution embedded in the object, and not the resolution read when instantiating the class.
template<>
Resolution hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::KtResolution ( const CLHEP::HepLorentzVector &  m,
bool  useObjEmbRes 
) const

Definition at line 239 of file CLHEPHitFitTranslator.cc.

{
    return resolution_;
} // Resolution METTranslatorBase<CLHEP::HepLorentzVector>::KtResolution(const CLHEP::HepLorentzVector& m)
template<>
Resolution hitfit::METTranslatorBase< pat::MET >::KtResolution ( const pat::MET m,
bool  useObjEmbRes 
) const

Definition at line 67 of file PatMETHitFitTranslator.cc.

{
    return resolution_;
} // Resolution METTranslatorBase<pat::MET>::KtResolution(const pat::MET& m)
template<>
Resolution hitfit::METTranslatorBase< pat::MET >::METResolution ( const pat::MET m,
bool  useObjEmbRes 
) const

Definition at line 77 of file PatMETHitFitTranslator.cc.

{
    return KtResolution(m,useObjEmbRes);
} // Resolution METTranslatorBase<pat::MET>::METResolution(const pat::MET& m)
template<>
Resolution hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::METResolution ( const CLHEP::HepLorentzVector &  m,
bool  useObjEmbRes 
) const

Definition at line 249 of file CLHEPHitFitTranslator.cc.

{
    return KtResolution(m,useObjEmbRes);
} // Resolution METTranslatorBase<CLHEP::HepLorentzVector>::METResolution(const CLHEP::HepLorentzVector& m)
template<class AMet>
Resolution hitfit::METTranslatorBase< AMet >::METResolution ( const AMet &  met,
bool  useObjEmbRes = false 
) const

Alias for KtResolution(AMet& met)

Parameters:
metThe missing transverse energy object whose resolution is wished to be known.
useObjEmbResBoolean parameter to indicate if the user would like to use the resolution embedded in the object, and not the resolution read when instantiating the class.
template<>
Fourvec hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::operator() ( const CLHEP::HepLorentzVector &  m,
bool  useObjEmbRes 
)

Definition at line 227 of file CLHEPHitFitTranslator.cc.

{

    return Fourvec (m.px(),m.py(),0.0,m.e());

} // Fourvec METTranslatorBase<CLHEP::HepLorentzVector>::operator()(const CLHEP::HepLorentzVector& m)
template<class AMet>
Fourvec hitfit::METTranslatorBase< AMet >::operator() ( const AMet &  met,
bool  useObjEmbRes = false 
)

Convert a missing transverse energy object of type AMet into HitFit four-momentum object of type Fourvec.

Parameters:
metThe missing transverse energy object to be translated.
useObjEmbResBoolean parameter to indicate if the user would like to use the resolution embedded in the object, and not the resolution read when instantiating the class.
template<>
Fourvec hitfit::METTranslatorBase< pat::MET >::operator() ( const pat::MET m,
bool  useObjEmbRes 
)

Definition at line 53 of file PatMETHitFitTranslator.cc.

References reco::LeafCandidate::px(), reco::LeafCandidate::py(), and mathSSE::sqrt().

{
    double px = m.px();
    double py = m.py();

    return Fourvec (px,py,0.0,sqrt(px*px + py*py));

} // Fourvec METTranslatorBase<pat::MET>::operator()(const pat::MET& m)

Member Data Documentation

template<class AMet>
Resolution hitfit::METTranslatorBase< AMet >::resolution_ [private]

The resolution.

Definition at line 119 of file METTranslatorBase.h.