Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:02

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #ifndef EVTDECAYTABLE_HH
0022 #define EVTDECAYTABLE_HH
0023 
0024 #include "EvtGenBase/EvtDecayBase.hh"
0025 #include "EvtGenBase/EvtParticleDecayList.hh"
0026 
0027 #include <vector>
0028 
0029 class EvtId;
0030 
0031 // Description: Class to read in and handle the decays available
0032 //              to EvtGen for each particle, and the model to be
0033 //              used for each one.
0034 
0035 class EvtDecayTable {
0036   public:
0037     static EvtDecayTable* getInstance();
0038 
0039     int getNMode( int ipar );
0040 
0041     EvtDecayBase* getDecay( int ipar, int imode );
0042 
0043     void readDecayFile( const std::string dec_name, bool verbose = true );
0044     void readXMLDecayFile( const std::string dec_name, bool verbose = true );
0045 
0046     bool stringToBoolean( std::string valStr );
0047     void checkParticle( std::string particle );
0048 
0049     int findChannel( EvtId parent, std::string model, int ndaug, EvtId* daugs,
0050                      int narg, std::string* args );
0051 
0052     int inChannelList( EvtId parent, int ndaug, EvtId* daugs );
0053 
0054     EvtDecayBase* getDecayFunc( EvtParticle* p );
0055 
0056     void printSummary();
0057 
0058     void checkConj();
0059 
0060     std::vector<EvtParticleDecayList> getDecayTable() { return _decaytable; };
0061 
0062     EvtDecayBase* findDecayModel( int aliasInt, int modeInt );
0063     EvtDecayBase* findDecayModel( EvtId id, int modeInt );
0064 
0065     bool hasPythia( int aliasInt );
0066     bool hasPythia( EvtId id );
0067 
0068     int getNModes( int aliasInt );
0069     int getNModes( EvtId id );
0070 
0071     std::vector<std::string> splitString( std::string& theString,
0072                                           std::string& splitter );
0073 
0074   protected:
0075     EvtDecayTable();
0076     ~EvtDecayTable();
0077 
0078   private:
0079     std::vector<EvtParticleDecayList> _decaytable;
0080 
0081     EvtDecayTable( const EvtDecayTable& ){};
0082     //EvtDecayTable& operator=(const EvtDecayTable&) {};
0083 };
0084 
0085 #endif