Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // ----------------------------------------------------------------------
0002 //
0003 // TempParticleData.hh
0004 // Author:  Lynn Garren
0005 //
0006 // temporary structure to hold particles while getting all the info
0007 // ----------------------------------------------------------------------
0008 #ifndef TEMPPARTICLEDATA_HH
0009 #define TEMPPARTICLEDATA_HH
0010 
0011 #include <string>
0012 #include <vector>
0013 
0014 #include "HepPDT/SpinState.hh"
0015 #include "HepPDT/ParticleID.hh"
0016 #include "HepPDT/Measurement.hh"
0017 
0018 namespace HepPDT {
0019 
0020 /// free function
0021 /// Given the lifetime, calculate the width.
0022 double calculateWidthFromLifetime( double );
0023 
0024 /// Temporary constituent (e.g., quark) information
0025 struct TempConstituent {
0026     TempConstituent( ParticleID p = ParticleID(0), int m = -1 )
0027       : tempConstituentPID(p), tempMultiplicity(m)  {}
0028     ParticleID tempConstituentPID;
0029     int                tempMultiplicity;
0030 };
0031 
0032 /// temporary holder for decay data
0033 struct TempDecayData  {
0034   /// Type of decay.
0035   /// Use string to hold int if necessary.
0036   std::string              tempDecayName;
0037   double                   tempBranchingFraction;
0038   /// list of decay particles
0039   std::vector<std::string> tempDaughterList;
0040   /// other decay parameters
0041   std::vector<double>      tempDecayParameters;
0042 };
0043 
0044 /// useful typedef
0045   typedef std::vector<TempDecayData>  TDDlist;
0046 
0047 /// Hold Alias information from EvtGen
0048 struct TempAliasData {
0049 
0050   // ---  birth/death:
0051   //
0052   TempAliasData();  //!< used in a map<>
0053 
0054   std::string    tempAlias;     //!< the alias
0055   std::string    tempAliasedParticle;   //!< the "real" particle
0056   std::string    tempChargeConj;    //!< set if there is a charge conjugate alias
0057   TDDlist        tempAliasDecayList;    //!< decay list for the alias
0058 };
0059 
0060 /// temporary holder for Particle Data information
0061 struct TempParticleData  {
0062 
0063   // ---  birth/death:
0064   //
0065   TempParticleData();   //!< used in a map<>
0066   /// construct a basic TempParticleData from just the particle ID
0067   explicit TempParticleData( int id );
0068   /// construct a basic TempParticleData from just the ParticleID
0069   explicit TempParticleData( ParticleID pid );
0070   /// given all the information, construct a TempParticleData
0071   TempParticleData( int id, std::string const & name, 
0072                     std::string const & source, int oid, double charge,
0073                     SpinState const & Spin, 
0074             Measurement const & mass, Measurement const & wid );
0075 
0076   // ---  copying:
0077   //
0078   TempParticleData( TempParticleData const & orig );
0079   TempParticleData & operator = ( TempParticleData const & rhs );
0080   void swap( TempParticleData & other );
0081   /// given a particle definition, create an antiparticle
0082   TempParticleData  antiparticle( std::string const & name );
0083  
0084   /// -- mutator - get spin state and constituent list from PID
0085   bool processPID();
0086 
0087   // -- data members (public by design)
0088   //
0089   ParticleID                   tempID;
0090   std::string                  tempParticleName;
0091   std::string                  tempSource;
0092   int                          tempOriginalID;
0093   double                       tempCharge;
0094   double                       tempColorCharge;
0095   SpinState                    tempSpin;
0096   Measurement                  tempMass;
0097   Measurement                  tempWidth;
0098   double                       tempLowCutoff;
0099   double                       tempHighCutoff;
0100   std::vector<TempConstituent> tempQuarks;
0101   TDDlist                      tempDecayList; 
0102 
0103 };  // TempParticleData
0104 
0105 inline
0106 void swap( TempParticleData & first, TempParticleData & second ) { first.swap( second ); }
0107 
0108 }   // HepPDT
0109 
0110 #endif // TEMPPARTICLEDATA_HH