Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:46

0001 #ifndef RecoTauTag_RecoTau_PFRecoTauClusterVariables_h
0002 #define RecoTauTag_RecoTau_PFRecoTauClusterVariables_h
0003 
0004 /** \class PFRecoTauClusterVariables
0005  *                                                                                                                                                                                   
0006  * A bunch of functions to return cluster variables used for the MVA based tau ID discrimation.
0007  * To allow the MVA based tau discrimination to be aplicable on miniAOD in addition to AOD 
0008  * several of these functions need to be overloaded.  
0009  *                                                                                                                                                                                   
0010  * \author Aruna Nayak, DESY
0011  *                                                                                                                                                                                   
0012  */
0013 
0014 #include "DataFormats/TauReco/interface/PFTau.h"
0015 #include "DataFormats/PatCandidates/interface/Tau.h"
0016 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0017 #include "DataFormats/PatCandidates/interface/PackedCandidate.h"
0018 
0019 namespace reco {
0020   namespace tau {
0021     /// return chi2 of the leading track ==> deprecated? <==
0022     float lead_track_chi2(const reco::PFTau& tau);
0023     /// return ratio of energy in ECAL over sum of energy in ECAL and HCAL
0024     float eratio(const reco::PFTau& tau);
0025     float eratio(const pat::Tau& tau);
0026     /// return sum of pt weighted values of distance to tau candidate for all pf photon candidates,
0027     /// which are associated to signal; depending on var the distance is in 0=:dr, 1=:deta, 2=:dphi
0028     float pt_weighted_dx(const reco::PFTau& tau, int mode = 0, int var = 0, int decaymode = -1);
0029     float pt_weighted_dx(const pat::Tau& tau, int mode = 0, int var = 0, int decaymode = -1);
0030     /// return sum of pt weighted values of dr relative to tau candidate for all pf photon candidates,
0031     /// which are associated to signal
0032     inline float pt_weighted_dr_signal(const reco::PFTau& tau, int dm) { return pt_weighted_dx(tau, 0, 0, dm); }
0033     inline float pt_weighted_dr_signal(const pat::Tau& tau, int dm) { return pt_weighted_dx(tau, 0, 0, dm); }
0034     /// return sum of pt weighted values of deta relative to tau candidate for all pf photon candidates,
0035     /// which are associated to signal
0036     inline float pt_weighted_deta_strip(const reco::PFTau& tau, int dm) {
0037       return pt_weighted_dx(tau, dm == 10 ? 2 : 1, 1, dm);
0038     }
0039     inline float pt_weighted_deta_strip(const pat::Tau& tau, int dm) {
0040       return pt_weighted_dx(tau, dm == 10 ? 2 : 1, 1, dm);
0041     }
0042     /// return sum of pt weighted values of dphi relative to tau candidate for all pf photon candidates,
0043     /// which are associated to signal
0044     inline float pt_weighted_dphi_strip(const reco::PFTau& tau, int dm) {
0045       return pt_weighted_dx(tau, dm == 10 ? 2 : 1, 2, dm);
0046     }
0047     inline float pt_weighted_dphi_strip(const pat::Tau& tau, int dm) {
0048       return pt_weighted_dx(tau, dm == 10 ? 2 : 1, 2, dm);
0049     }
0050     /// return sum of pt weighted values of dr relative to tau candidate for all pf photon candidates,
0051     /// which are inside an isolation conde but not associated to signal
0052     inline float pt_weighted_dr_iso(const reco::PFTau& tau, int dm) { return pt_weighted_dx(tau, 2, 0, dm); }
0053     inline float pt_weighted_dr_iso(const pat::Tau& tau, int dm) { return pt_weighted_dx(tau, 2, 0, dm); }
0054     /// return total number of pf photon candidates with pT>500 MeV, which are associated to signal
0055     unsigned int n_photons_total(const reco::PFTau& tau);
0056     unsigned int n_photons_total(const pat::Tau& tau);
0057 
0058     enum {
0059       kOldDMwoLT,
0060       kOldDMwLT,
0061       kNewDMwoLT,
0062       kNewDMwLT,
0063       kDBoldDMwLT,
0064       kDBnewDMwLT,
0065       kPWoldDMwLT,
0066       kPWnewDMwLT,
0067       kDBoldDMwLTwGJ,
0068       kDBnewDMwLTwGJ,
0069       kDBnewDMwLTwGJPhase2
0070     };
0071     bool fillIsoMVARun2Inputs(float* mvaInput,
0072                               const pat::Tau& tau,
0073                               int mvaOpt,
0074                               const std::string& nameCharged,
0075                               const std::string& nameNeutral,
0076                               const std::string& namePu,
0077                               const std::string& nameOutside,
0078                               const std::string& nameFootprint);
0079   }  // namespace tau
0080 }  // namespace reco
0081 
0082 #endif