Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:47

0001 #ifndef PhysicsTools_PatAlgos_StringResolutionProvider_H
0002 #define PhysicsTools_PatAlgos_StringResolutionProvider_H
0003 #include "DataFormats/PatCandidates/interface/CandKinResolution.h"
0004 #include "PhysicsTools/PatAlgos/interface/KinematicResolutionProvider.h"
0005 #include "DataFormats/Candidate/interface/Candidate.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 
0008 #include "CommonTools/Utils/interface/StringObjectFunction.h"
0009 
0010 /**
0011    \class   StringResolutionProvider StringResolutionProvider.h "PhysicsTools/PatAlgos/interface/StringResolutionProvider.h"
0012 
0013    \brief   Class to provide resolution factors for PAT candidates
0014 
0015    A class to provide resolution functions for PAT candidates. The class is derived from the 
0016    KinematicResolutionProvider class. It expects the following parameters:
0017 
0018    * parametrization :   indicates the used representation (e.g. EtEtaPhi). This parameter 
0019                          is MANDATORY.
0020    * resolutions     :   a vector of edm::ParameterSets, that contain the resolutions func-
0021                          tionspotentially in multiple bins of a cetain parameter. For the 
0022              default implementeation we have bins of reco::Candidate's eta in 
0023              mind, though might be any kind of variable that is accessible as 
0024              memeber function of reco::Candidate. This parameter is MANDATORY.
0025 
0026    The edm::ParameterSets of the _resolutions_ parameter are expected to be of form: 
0027 
0028    * bin             :   Indicated the binning compatible with the StringCutObjectSelector. 
0029                          If omitted no binning is applied and the obtained resolution func-
0030                          tions are assumed to be valid for all candidates. This parameter 
0031              is OPTIONAL.
0032    * et/eta/phi      :   Contain the parametrization in et if working in the EtEtaPhi pa-
0033                          rametrization. These parameters are OPTIONAL. They are expected to 
0034              be present in the et/eta/phi representation though. 
0035    * constraint      :   adding further information on constraints. It needs to investigated 
0036                          further what the meaning of this parameter exactly is before we can 
0037              decide about its future. This parameter is OPTIONAL.
0038    
0039    We expect that cfi files of this form will be generated automatically. edm::ParameterSets 
0040    for other represenations will be implemented on request.
0041 */
0042 
0043 class StringResolutionProvider : public KinematicResolutionProvider {
0044 public:
0045   /// short cut within the common namespace
0046   typedef StringObjectFunction<reco::Candidate> Function;
0047 
0048   /// default constructor
0049   StringResolutionProvider(const edm::ParameterSet& cfg);
0050   /// default destructor
0051   ~StringResolutionProvider() override;
0052   /// get a CandKinResolution object from the service
0053   pat::CandKinResolution getResolution(const reco::Candidate& cand) const override;
0054 
0055 private:
0056   /// a vector of constrtaints for the CanKinResolution
0057   /// object
0058   std::vector<pat::CandKinResolution::Scalar> constraints_;
0059   /// a parametrization for the CanKinResolution object
0060   /// (this needs an extension)
0061   pat::CandKinResolution::Parametrization parametrization_;
0062   /// a vector of strings for the binning
0063   std::vector<std::string> bins_;
0064   /// vectors for the resolution functions
0065   std::vector<std::string> funcEt_, funcEta_, funcPhi_;
0066 };
0067 
0068 #endif