CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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>

Public Member Functions

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

Private Attributes

Resolution resolution_
 The resolution. More...
 

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 50 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 202 of file CLHEPHitFitTranslator.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 209 of file CLHEPHitFitTranslator.cc.

References hitfit::Defaults_Text::get_string(), and AlCaHLTBitMon_QueryRunRegistry::string.

210 {
211  const Defaults_Text defs(ifile);
212  std::string resolution_string(defs.get_string("met_resolution"));
213  resolution_ = Resolution(resolution_string);
214 
215 } // METTranslatorBase<CLHEP::HepLorentzVector>::METTranslatorBase(const std::string& ifile)
Resolution resolution_
The resolution.
template<>
hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::~METTranslatorBase ( )

Definition at line 219 of file CLHEPHitFitTranslator.cc.

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

Definition at line 28 of file PatMETHitFitTranslator.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 35 of file PatMETHitFitTranslator.cc.

References hitfit::Defaults_Text::get_string(), and AlCaHLTBitMon_QueryRunRegistry::string.

36 {
37  const Defaults_Text defs(ifile);
38  std::string resolution_string(defs.get_string("met_resolution"));
39  resolution_ = Resolution(resolution_string);
40 
41 } // METTranslatorBase<pat::MET>::METTranslatorBase(const std::string& ifile)
Resolution resolution_
The resolution.

Definition at line 45 of file PatMETHitFitTranslator.cc.

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

Member Function Documentation

template<>
Resolution hitfit::METTranslatorBase< pat::MET >::KtResolution ( const pat::MET m,
bool  useObjEmbRes 
) const

Definition at line 66 of file PatMETHitFitTranslator.cc.

68 {
69  return resolution_;
70 } // Resolution METTranslatorBase<pat::MET>::KtResolution(const pat::MET& m)
Resolution resolution_
The resolution.
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 238 of file CLHEPHitFitTranslator.cc.

240 {
241  return resolution_;
242 } // Resolution METTranslatorBase<CLHEP::HepLorentzVector>::KtResolution(const CLHEP::HepLorentzVector& m)
Resolution resolution_
The resolution.
template<>
Resolution hitfit::METTranslatorBase< pat::MET >::METResolution ( const pat::MET m,
bool  useObjEmbRes 
) const

Definition at line 76 of file PatMETHitFitTranslator.cc.

78 {
79  return KtResolution(m,useObjEmbRes);
80 } // Resolution METTranslatorBase<pat::MET>::METResolution(const pat::MET& m)
Resolution KtResolution(const AMet &met, bool useObjEmbRes=false) const
Return the resolution corresponding to an instance of missing transverse energy object.
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<>
Resolution hitfit::METTranslatorBase< CLHEP::HepLorentzVector >::METResolution ( const CLHEP::HepLorentzVector &  m,
bool  useObjEmbRes 
) const

Definition at line 248 of file CLHEPHitFitTranslator.cc.

250 {
251  return KtResolution(m,useObjEmbRes);
252 } // Resolution METTranslatorBase<CLHEP::HepLorentzVector>::METResolution(const CLHEP::HepLorentzVector& m)
Resolution KtResolution(const AMet &met, bool useObjEmbRes=false) const
Return the resolution corresponding to an instance of missing transverse energy object.
template<>
Fourvec hitfit::METTranslatorBase< pat::MET >::operator() ( const pat::MET m,
bool  useObjEmbRes 
)

Definition at line 52 of file PatMETHitFitTranslator.cc.

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

54 {
55  double px = m.px();
56  double py = m.py();
57 
58  return Fourvec (px,py,0.0,sqrt(px*px + py*py));
59 
60 } // Fourvec METTranslatorBase<pat::MET>::operator()(const pat::MET& m)
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
T sqrt(T t)
Definition: SSEVec.h:48
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:57
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< CLHEP::HepLorentzVector >::operator() ( const CLHEP::HepLorentzVector &  m,
bool  useObjEmbRes 
)

Definition at line 226 of file CLHEPHitFitTranslator.cc.

228 {
229 
230  return Fourvec (m.px(),m.py(),0.0,m.e());
231 
232 } // Fourvec METTranslatorBase<CLHEP::HepLorentzVector>::operator()(const CLHEP::HepLorentzVector& m)
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:57

Member Data Documentation

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

The resolution.

Definition at line 118 of file METTranslatorBase.h.