Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:50:28

0001 #ifndef DataFormats_L1TParticleFlow_PFTau_h
0002 #define DataFormats_L1TParticleFlow_PFTau_h
0003 
0004 #include <algorithm>
0005 #include <vector>
0006 #include "DataFormats/L1Trigger/interface/L1Candidate.h"
0007 
0008 namespace l1t {
0009 
0010   static constexpr float PFTAU_NN_OFFSET = 0.1;
0011   static constexpr float PFTAU_NN_SLOPE = 0.2;
0012   static constexpr float PFTAU_NN_OVERALL_SCALE = 1. / 20.1;
0013 
0014   static constexpr float PFTAU_NN_LOOSE_CUT = 0.05;
0015   static constexpr float PFTAU_NN_TIGHT_CUT = 0.25;
0016 
0017   static constexpr float PFTAU_PF_LOOSE_CUT = 10.0;
0018   static constexpr float PFTAU_PF_TIGHT_CUT = 5.0;
0019 
0020   static constexpr float PTSCALING_MASSCUT = 40.0;
0021 
0022   static constexpr double PFTAU_NN_PT_CUTOFF = 100.0;
0023 
0024   class PFTau : public L1Candidate {
0025   public:
0026     PFTau() {}
0027     enum { unidentified = 0, oneprong = 1, oneprongpi0 = 2, threeprong = 3 };
0028     PFTau(const LorentzVector& p,
0029           float iso = -1,
0030           float fulliso = -1,
0031           int id = 0,
0032           int hwpt = 0,
0033           int hweta = 0,
0034           int hwphi = 0)
0035         : PFTau(PolarLorentzVector(p), iso, id, hwpt, hweta, hwphi) {}
0036     PFTau(const PolarLorentzVector& p,
0037           float iso = -1,
0038           float fulliso = -1,
0039           int id = 0,
0040           int hwpt = 0,
0041           int hweta = 0,
0042           int hwphi = 0);
0043     float chargedIso() const { return iso_; }
0044     float fullIso() const { return fullIso_; }
0045     int id() const { return id_; }
0046 
0047     void setZ0(float z0) { setVertex(reco::Particle::Point(0, 0, z0)); }
0048     void setDxy(float dxy) { dxy_ = dxy; }
0049 
0050     float z0() const { return vz(); }
0051     float dxy() const { return dxy_; }
0052 
0053     bool passMass() const { return (mass() < 2 + pt() / PTSCALING_MASSCUT); }
0054     bool passLooseNN() const {
0055       return iso_ * (PFTAU_NN_OFFSET + PFTAU_NN_SLOPE * (min(pt(), PFTAU_NN_PT_CUTOFF))) * PFTAU_NN_OVERALL_SCALE >
0056              PFTAU_NN_LOOSE_CUT;
0057     }
0058     bool passLooseNNMass() const {
0059       if (!passMass())
0060         return false;
0061       return passLooseNN();
0062     }
0063     bool passLoosePF() const { return fullIso_ < PFTAU_PF_LOOSE_CUT; }
0064     bool passTightNN() const {
0065       return iso_ * (PFTAU_NN_OFFSET + PFTAU_NN_SLOPE * (min(pt(), PFTAU_NN_PT_CUTOFF))) * PFTAU_NN_OVERALL_SCALE >
0066              PFTAU_NN_TIGHT_CUT;
0067     }
0068     bool passTightNNMass() const {
0069       if (!passMass())
0070         return false;
0071       return passTightNN();
0072     }
0073     bool passTightPF() const { return fullIso_ < PFTAU_PF_TIGHT_CUT; }
0074 
0075   private:
0076     float iso_;
0077     float fullIso_;
0078     int id_;
0079     float dxy_;
0080   };
0081 
0082   typedef std::vector<l1t::PFTau> PFTauCollection;
0083 
0084   typedef edm::Ref<l1t::PFTauCollection> PFTauRef;
0085   typedef edm::RefVector<l1t::PFTauCollection> PFTauRefVector;
0086   typedef std::vector<l1t::PFTauRef> PFTauVectorRef;
0087 }  // namespace l1t
0088 #endif