Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:11:34

0001 // ----------------------------------------------------------------------
0002 //
0003 // DecayChannel.hh
0004 // Author:  Lynn Garren
0005 //
0006 // ----------------------------------------------------------------------
0007 #ifndef DecayChannel_HH
0008 #define DecayChannel_HH
0009 
0010 #include <vector>
0011 #include <string>
0012 
0013 //#include "HepPDT/ParticleData.hh"
0014 #include "HepPDT/Measurement.hh"
0015 
0016 namespace HepPDT {
0017 
0018 class ParticleData;
0019 
0020 //! The DecayChannel class holds particle decay information
0021 
0022 ///
0023 /// \class DecayChannel
0024 /// \author Lynn Garren
0025 ///
0026 /// This class holds information about a single decay channel.
0027 ///
0028 class DecayChannel  {
0029 
0030 public:
0031   // --- useful typedef's
0032   //
0033 
0034   typedef std::vector< ParticleData* >    ProductMap;
0035 
0036   // ---  birth/death:
0037   //
0038   /// defaults 'cause we need vector<DecayChannel<> >
0039   inline DecayChannel( const std::string & name = "unknown", 
0040                  const Measurement & branchFrac = Measurement(), 
0041                  const std::vector<ParticleData*> & decaylist = ProductMap(), 
0042                  const std::vector<double> & dmparam = std::vector<double>() )
0043   : itsDecayName            ( name ),
0044   itsBranchingFraction    ( branchFrac ),
0045   itsDecayChannelProducts ( decaylist ),
0046   itsDecayModelParameters ( dmparam )
0047 { ; }
0048 
0049   virtual ~DecayChannel()
0050 { ; }
0051 
0052   // ---  copying:
0053   //
0054   inline DecayChannel( const DecayChannel & orig );
0055   inline DecayChannel & operator = ( const DecayChannel & rhs );
0056   inline void swap( DecayChannel & other );
0057 
0058   // ---  accessors:
0059   //
0060   /// get the name of this decay channel
0061   std::string                 decayName()         const { return itsDecayName; }
0062   /// return the branching fraction
0063   Measurement                 branchingFraction() const { return itsBranchingFraction; }
0064   /// how many decay products in this decay channel?
0065   int                         size()              const { return itsDecayChannelProducts.size(); }
0066   /// return this decay product
0067   ParticleData*                  decayProduct(int i) const { return itsDecayChannelProducts[i]; }
0068   
0069   /// output decay information
0070   void write( std::ostream & os ) const;
0071 
0072   // ---  mutators:
0073   //
0074   /// change the branching fraction
0075   void  setBranchingFraction( Measurement const & rate ) { itsBranchingFraction = rate; }
0076   /// append a new decay product
0077   void  appendDecayChannelProduct( ParticleData* const & dcp );
0078   
0079 private:
0080 
0081   // ---  class-specific data:
0082   //
0083   std::string              itsDecayName;
0084   Measurement              itsBranchingFraction;
0085   ProductMap               itsDecayChannelProducts;
0086   std::vector<double>      itsDecayModelParameters;
0087 
0088 };  // DecayChannel
0089 
0090 inline
0091 void  swap( DecayChannel & first, DecayChannel & second )  {
0092   first.swap( second );
0093 }
0094 
0095 }   // HepPDT
0096 
0097 #include "HepPDT/DecayChannel.icc"
0098 
0099 #endif // DecayChannel_HH
0100