Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:56

0001 #ifndef ATOOLS_Phys_Parton_Finder_H
0002 #define ATOOLS_Phys_Parton_Finder_H
0003 
0004 #include "ATOOLS/Phys/Particle_List.H"
0005 #include "ATOOLS/Phys/Blob.H"
0006 
0007 namespace ATOOLS {
0008 
0009   class Parton_Tester {
0010   public:
0011     
0012     // destructor
0013     virtual ~Parton_Tester();
0014 
0015     // member functions
0016     virtual void Turn();
0017     virtual bool Test(const Particle *parton) const;
0018 
0019   };// end of class Parton_Tester
0020 
0021   class Parton_Finder {
0022   private:
0023     
0024     const Particle *m_start, *m_end;
0025 
0026     std::set<btp::code> m_excludeblobs;
0027     std::set<kf_code>  m_excludeflavours;
0028 
0029     Parton_Tester *p_criterion;
0030     Particle_List  m_track;
0031 
0032     bool m_forward;
0033 
0034     void Turn();
0035     bool Test(const Particle *cur);
0036 
0037     const Particle *FindConstConnectedForward(const Particle *start);
0038     const Particle *FindConstConnectedBackward(const Particle *start);
0039 
0040     const Particle *FindConstConnected(const Particle *start,
0041                        bool forward=true);
0042 
0043   public:
0044 
0045     // constructor
0046     Parton_Finder(Parton_Tester &criterion);
0047 
0048     // member funnctions
0049     void Clear();
0050 
0051     Particle *FindConnected(const Particle *start,
0052                 bool forward=true);
0053 
0054     const Particle *FindConstConnected(); 
0055 
0056     // inline functions
0057     inline void SetStart(Particle *const start) { m_start=start; }
0058     inline void SetEnd(Particle *const end)     { m_end=end;     }
0059 
0060     inline void Exclude(const btp::code code) 
0061     { m_excludeblobs.insert(code); }
0062     inline void Exclude(const kf_code code)  
0063     { m_excludeflavours.insert(code); }
0064 
0065     inline Particle *Start() const { return (Particle*)m_start; }
0066     inline Particle *End() const   { return (Particle*)m_end;   }
0067 
0068     inline const Particle *ConstStart() const { return m_start; }
0069     inline const Particle *ConstEnd() const   { return m_end;   }
0070 
0071     inline const Particle_List &Track() { return m_track; }
0072 
0073   };// end of class Parton_Finder
0074 
0075 }
0076 
0077 #endif