Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-12 09:05:02

0001 // -*- C++ -*-
0002 #ifndef RIVET_DileptonFinder_HH
0003 #define RIVET_DileptonFinder_HH
0004 
0005 #include "Rivet/Projections/FinalState.hh"
0006 #include "Rivet/Projections/LeptonFinder.hh"
0007 #include "Rivet/Projections/VetoedFinalState.hh"
0008 
0009 namespace Rivet {
0010 
0011 
0012   /// @brief Convenience finder of leptonically decaying Zs
0013   ///
0014   /// A convenience method for finding l+l- pair resonances, including photon clustering.
0015   class DileptonFinder : public FinalState {
0016   public:
0017 
0018     /// @name Constructors
0019     /// @{
0020 
0021     /// Modern constructor with a default FS, explicit mass target and dressing dR up-front (PID and LL via cuts)
0022     DileptonFinder(double masstarget,
0023            double dRdress,
0024            const Cut& lcuts=Cuts::OPEN,
0025            const Cut& llcuts=Cuts::OPEN,
0026            LeptonOrigin leptonOrigin=LeptonOrigin::PROMPT,
0027            PhotonOrigin photonOrigin=PhotonOrigin::NODECAY,
0028                    TauDecaysAs tauDecays=TauDecaysAs::PROMPT,
0029                    MuDecaysAs muDecays=MuDecaysAs::PROMPT,
0030                    DressingType dressing=DressingType::CONE);
0031 
0032 
0033     /// Modern constructor with an explicit FS, explicit mass target and dressing dR up-front (PID and LL via cuts)
0034     DileptonFinder(const FinalState& allfs,
0035                    double masstarget,
0036            double dRdress,
0037            const Cut& lcuts=Cuts::OPEN,
0038            const Cut& llcuts=Cuts::OPEN,
0039                    DressingType dressing=DressingType::CONE);
0040 
0041 
0042     /// Modern constructor with two explicit FSes, explicit mass target and dressing dR up-front (PID and LL via cuts)
0043     DileptonFinder(const FinalState& leptonfs,
0044                    const FinalState& photonfs,
0045                    double masstarget,
0046                    double dRmax,
0047                    const Cut& lcuts=Cuts::OPEN,
0048                    const Cut& llcuts=Cuts::OPEN,
0049                    DressingType dressing=DressingType::CONE);
0050 
0051 
0052     /// @brief Old constructor taking min and max ll masses
0053     ///
0054     /// @deprecated Avoid!
0055     DileptonFinder(const FinalState& allfs,
0056            const Cut& lcuts,
0057            double masstarget,
0058                    PdgId pid,
0059            double minmass, double maxmass,
0060            double dRdress)
0061       : DileptonFinder(allfs, masstarget, dRdress,
0062                        lcuts && Cuts::abspid == pid,
0063                        Cuts::mass >= minmass && Cuts::mass < maxmass)
0064     {   }
0065 
0066 
0067     /// Ok constructor with an explicit mass target and dressing dR up-front
0068     ///
0069     /// @deprecated Avoid!
0070     DileptonFinder(const FinalState& allfs,
0071            PdgId pid,
0072            double masstarget,
0073            double dRdress,
0074            const Cut& lcuts=Cuts::OPEN,
0075            double minmass=-DBL_MAX, double maxmass=DBL_MAX)
0076       : DileptonFinder(allfs, masstarget, dRdress,
0077                        lcuts && Cuts::abspid == pid,
0078                        Cuts::mass >= minmass && Cuts::mass < maxmass)
0079     {   }
0080 
0081 
0082     /// Ok constructor with a default FS, explicit mass target and dressing dR up-front
0083     ///
0084     /// @deprecated Avoid!
0085     DileptonFinder(PdgId pid,
0086            double masstarget,
0087            double dRdress,
0088            const Cut& lcuts=Cuts::OPEN,
0089            double minmass=-DBL_MAX, double maxmass=DBL_MAX,
0090            LeptonOrigin whichleptons=LeptonOrigin::PROMPT,
0091            PhotonOrigin whichphotons=PhotonOrigin::NODECAY,
0092                    TauDecaysAs tauDecays=TauDecaysAs::PROMPT,
0093                    MuDecaysAs muDecays=MuDecaysAs::PROMPT,
0094                    DressingType dressing=DressingType::CONE)
0095       : DileptonFinder(masstarget, dRdress,
0096                        lcuts && Cuts::abspid == pid,
0097                        Cuts::mass >= minmass && Cuts::mass < maxmass,
0098                        whichleptons, whichphotons, tauDecays, muDecays, dressing)
0099     {   }
0100 
0101 
0102     /// Ok constructor with a default FS, explicit mass target and dressing dR up-front
0103     ///
0104     /// @deprecated Avoid!
0105     DileptonFinder(double masstarget,
0106            double dRdress,
0107            const Cut& lcuts=Cuts::OPEN,
0108            double minmass=-DBL_MAX, double maxmass=DBL_MAX,
0109            LeptonOrigin whichleptons=LeptonOrigin::PROMPT,
0110            PhotonOrigin whichphotons=PhotonOrigin::NODECAY,
0111                    TauDecaysAs tauDecays=TauDecaysAs::PROMPT,
0112                    MuDecaysAs muDecays=MuDecaysAs::PROMPT,
0113                    DressingType dressing=DressingType::CONE)
0114       : DileptonFinder(masstarget, dRdress, lcuts,
0115                        Cuts::mass >= minmass && Cuts::mass < maxmass,
0116                        whichleptons, whichphotons, tauDecays, muDecays, dressing)
0117     {   }
0118 
0119 
0120     /// Ok constructor with an explicit FS, explicit mass target and dressing dR up-front (PID via cuts)
0121     ///
0122     /// @deprecated Avoid!
0123     DileptonFinder(const FinalState& allfs,
0124                    double masstarget,
0125            double dRdress,
0126            const Cut& lcuts=Cuts::OPEN,
0127            double minmass=-DBL_MAX, double maxmass=DBL_MAX)
0128       : DileptonFinder(allfs, masstarget, dRdress, lcuts,
0129                        Cuts::mass >= minmass && Cuts::mass < maxmass)
0130     {   }
0131 
0132 
0133     /// Clone on the heap.
0134     RIVET_DEFAULT_PROJ_CLONE(DileptonFinder);
0135 
0136     /// @}
0137 
0138 
0139     /// @brief Access to the found bosons
0140     ///
0141     /// @note Currently either 0 or 1 boson can be found.
0142     const Particles& bosons() const { return particles(); }
0143     /// Access to the found boson (assuming it exists).
0144     const Particle& boson() const { return bosons().front(); }
0145 
0146 
0147     /// @brief Access to the constituent clustered leptons (and photons)
0148     ///
0149     /// The positive charge constituent is first in the list (if not empty), and
0150     /// the negative one second. Any included photons follow.
0151     const Particles& constituents() const;
0152 
0153     /// @brief Access to the constituent clustered leptons (and photons)
0154     ///
0155     ///
0156     /// The positive charge constituent is first in the list (if not empty), and
0157     /// the negative one second. Any included photons follow.
0158     Particles leptons() const {  return constituents(); }
0159 
0160 
0161     /// Access to the event-particles other than the Z leptons and clustered photons
0162     ///
0163     /// Useful for e.g. input to a jet finder
0164     const VetoedFinalState& remainingFinalState() const;
0165 
0166 
0167   protected:
0168 
0169     /// Apply the projection on the supplied event.
0170     void project(const Event& e);
0171 
0172     /// Compare projections.
0173     CmpState compare(const Projection& p) const;
0174 
0175 
0176   public:
0177 
0178     /// Clear the projection
0179     void clear() { _theParticles.clear(); }
0180 
0181     /// Import to avoid warnings about overload-hiding
0182     using Projection::operator =;
0183 
0184 
0185   protected:
0186 
0187     /// Mass target for identifying the best fit
0188     double _masstarget;
0189 
0190   };
0191 
0192 
0193   /// Aliases
0194   using ZFinder = DileptonFinder;
0195   using LLFinder = DileptonFinder;
0196 
0197 
0198 }
0199 
0200 #endif