CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DataFormats/PatCandidates/interface/ParametrizationHelper.h

Go to the documentation of this file.
00001 #ifndef DataFormats_PatCandidates_interface_ParametrizationHelper_h
00002 #define DataFormats_PatCandidates_interface_ParametrizationHelper_h
00003 
00004 #include "DataFormats/PatCandidates/interface/CandKinResolution.h"
00005 #include <string>
00006 
00007 namespace pat { namespace helper {
00008 namespace ParametrizationHelper {
00009 
00011     inline uint32_t dimension(pat::CandKinResolution::Parametrization parametrization) {
00012         return (static_cast<uint32_t>(parametrization) & 0x0F);
00013     }
00014 
00016     pat::CandKinResolution::Parametrization fromString(const std::string &name) ;
00017 
00019     const char * name(pat::CandKinResolution::Parametrization param) ;   
00020 
00024     math::PtEtaPhiMLorentzVector polarP4fromParameters( pat::CandKinResolution::Parametrization parametrization, 
00025                                                         const AlgebraicVector4 &parameters, 
00026                                                         const math::PtEtaPhiMLorentzVector &initialP4) ;
00027 
00031     math::XYZTLorentzVector p4fromParameters(pat::CandKinResolution::Parametrization parametrization, 
00032                                             const AlgebraicVector4 &parameters,
00033                                             const math::XYZTLorentzVector &initialP4) ;
00034 
00036     AlgebraicVector4 parametersFromP4(pat::CandKinResolution::Parametrization parametrization, const math::XYZTLorentzVector &p4) ;
00037 
00039     AlgebraicVector4 parametersFromP4(pat::CandKinResolution::Parametrization parametrization, const math::PtEtaPhiMLorentzVector &p4) ;
00040 
00042     void setParametersFromP4(pat::CandKinResolution::Parametrization parametrization, AlgebraicVector4 &pars, const math::XYZTLorentzVector &p4) ;
00043 
00045     void setParametersFromP4(pat::CandKinResolution::Parametrization parametrization, AlgebraicVector4 &pars, const math::PtEtaPhiMLorentzVector &p4) ;
00046 
00048     template <typename T>
00049     void setParametersFromAnyVector(pat::CandKinResolution::Parametrization parametrization, AlgebraicVector4 &pars, const T &p4) ;
00050 
00052 
00060     AlgebraicVector4 diffToParameters(pat::CandKinResolution::Parametrization parametrization, 
00061                 const math::XYZTLorentzVector &p4ini, const math::XYZTLorentzVector &p4fin) ;
00062 
00064 
00072     AlgebraicVector4 diffToParameters(pat::CandKinResolution::Parametrization parametrization, 
00073                 const math::PtEtaPhiMLorentzVector &p4ini, const math::PtEtaPhiMLorentzVector &p4fin) ;
00074 
00075  
00077     bool isAlwaysMassless(pat::CandKinResolution::Parametrization parametrization) ;
00078 
00080     bool isAlwaysMassive(pat::CandKinResolution::Parametrization parametrization) ;
00081 
00083     bool isMassConstrained(pat::CandKinResolution::Parametrization parametrization) ;
00084 
00090     bool isPhysical(pat::CandKinResolution::Parametrization parametrization, const AlgebraicVector4 &v4, const math::PtEtaPhiMLorentzVector &initialP4) ;
00091 } } }
00092 
00093 #endif