15 using namespace genie::hnl;
24 std::map< HNLDecayMode_t, double > allChannels;
28 if( fDecayGammas[0] < 0.0 ){
30 if( IsMajorana ) GINV *= 2.0;
31 fDecayGammas[0] = GINV;
33 <<
" Invisible decay gamma = " << fDecayGammas[0];
34 }
else GINV = fDecayGammas[0];
35 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyNuNuNu, GINV ) );
37 assert( GINV >= 0.0 );
43 if( fDecayGammas[1] < 0.0 ){
45 if( IsMajorana ) GNEE *= 2.0;
46 fDecayGammas[1] = GNEE;
48 <<
" Nu-e-e gamma = " << fDecayGammas[1];
49 }
else GNEE = fDecayGammas[1];
50 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyNuEE, GNEE ) );
52 assert( GNEE >= 0.0 );
58 if( fDecayGammas[2] < 0.0 ){
60 if( IsMajorana ) GNEM *= 2.0;
61 fDecayGammas[2] = GNEM;
63 <<
" Nu-e-mu gamma = " << fDecayGammas[2];
64 }
else GNEM = fDecayGammas[2];
65 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyNuMuE, GNEM ) );
67 assert( GNEM >= 0.0 );
73 if( fDecayGammas[3] < 0.0 ){
75 if( IsMajorana ) GP0N *= 2.0;
76 fDecayGammas[3] = GP0N;
78 <<
" Pi0-nu gamma = " << fDecayGammas[3];
79 }
else GP0N = fDecayGammas[3];
80 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyPi0Nu, GP0N ) );
82 assert( GP0N >= 0.0 );
88 if( fDecayGammas[4] < 0.0 ){
90 if( IsMajorana ) GPIE *= 2.0;
91 fDecayGammas[4] = GPIE;
93 <<
" Pi-e gamma = " << fDecayGammas[4];
94 }
else GPIE = fDecayGammas[4];
95 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyPiE, GPIE) );
97 assert( GPIE >= 0.0 );
103 if( fDecayGammas[5] < 0.0 ){
105 if( IsMajorana ) GNMM *= 2.0;
106 fDecayGammas[5] = GNMM;
108 <<
" Nu-mu-mu gamma = " << fDecayGammas[5];
109 }
else GNMM = fDecayGammas[5];
110 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyNuMuMu, GNMM ) );
112 assert( GNMM >= 0.0 );
118 if( fDecayGammas[6] < 0.0 ){
120 if( IsMajorana ) GPIM *= 2.0;
121 fDecayGammas[6] = GPIM;
123 <<
" Pi-mu gamma = " << fDecayGammas[6];
124 }
else GPIM = fDecayGammas[6];
125 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyPiMu, GPIM ) );
127 assert( GPIM >= 0.0 );
133 if( fDecayGammas[7] < 0.0 ){
135 if( IsMajorana ) GP02 *= 2.0;
136 fDecayGammas[7] = GP02;
138 <<
" Pi0-pi0-nu gamma = " << fDecayGammas[7];
139 }
else fDecayGammas[7] = GP02;
140 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyPi0Pi0Nu, GP02 ) );
142 assert( GP02 >= 0.0 );
148 if( fDecayGammas[8] < 0.0 ){
150 if( IsMajorana ) GP0E *= 2.0;
151 fDecayGammas[8] = GP0E;
153 <<
" Pi-pi0-e gamma = " << fDecayGammas[8];
154 }
else GP0E = fDecayGammas[8];
155 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyPiPi0E, GP0E ) );
157 assert( GP0E >= 0.0 );
163 if( fDecayGammas[9] < 0.0 ){
165 if( IsMajorana ) GP0M *= 2.0;
166 fDecayGammas[9] = GP0M;
168 <<
" Pi-pi0-mu gamma = " << fDecayGammas[9];
169 }
else GP0M = fDecayGammas[9];
170 allChannels.insert( allChannels.begin(), std::pair< HNLDecayMode_t, double >(
kHNLDcyPiPi0Mu, GP0M ) );
172 assert( GP0M >= 0.0 );
181 double totGamma = 0.0;
183 for( std::map< HNLDecayMode_t, double >::iterator it = gammaMap.begin(); it != gammaMap.end(); ++it ){ totGamma += (*it).second; }
186 <<
" Total gamma from N_channels = " << gammaMap.size()
187 <<
" is = " << totGamma <<
" [GeV]"
198 return 1.0 / totGamma;
202 std::map< HNLDecayMode_t, double >
selector::SetInterestingChannels( std::vector< HNLDecayMode_t > intChannels, std::map< HNLDecayMode_t, double > gammaMap ){
204 std::map< HNLDecayMode_t, double > interestingMap;
206 for( std::vector< HNLDecayMode_t >::iterator it = intChannels.begin(); it != intChannels.end(); ++it ){
208 double gamma = gammaMap.find( (*it) )->second;
209 interestingMap.insert( std::pair< HNLDecayMode_t, double >( decType, gamma ) );
211 return interestingMap;
218 std::map< HNLDecayMode_t, double > Pmap;
221 for( std::map< HNLDecayMode_t, double >::iterator it = gammaMap.begin(); it != gammaMap.end(); ++it ){
222 Pmap.insert( std::pair< HNLDecayMode_t, double >( (*it).first, (*it).second / totGamma ) );
237 double PInt = 0.0, all_before = 0.0;
240 for( std::map< HNLDecayMode_t, double >::iterator it = Pmap.begin(); it != Pmap.end(); ++it ){ PInt += (*it).second; }
245 for( std::map< HNLDecayMode_t, double >::iterator it = Pmap.begin(); it != Pmap.end(); ++it ){
246 double modP = (*it).second / PInt;
247 if( all_before < ranThrow &&
248 all_before + modP >= ranThrow ) selectedChannel = (*it).first;
252 return selectedChannel;
Manages HNL BR (prod and decay)
double GetTotalDecayWidth(std::map< genie::hnl::HNLDecayMode_t, double > gammaMap)
static const double kPi0Mass
Algorithm abstract base class.
static constexpr double ns
static const double kElectronMass
std::map< genie::hnl::HNLDecayMode_t, double > SetInterestingChannels(std::vector< genie::hnl::HNLDecayMode_t > intChannels, std::map< genie::hnl::HNLDecayMode_t, double > gammaMap)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double GeV
const Algorithm * GetAlgorithm(const AlgId &algid)
enum genie::hnl::EHNLDecayMode HNLDecayMode_t
static const double kMuonMass
static AlgFactory * Instance()
static const double kPionMass
double DecayWidth(genie::hnl::HNLDecayMode_t hnldm) const
std::map< genie::hnl::HNLDecayMode_t, double > GetProbabilities(std::map< genie::hnl::HNLDecayMode_t, double > gammaMap)
double CalcCoMLifetime(const double M, const double Ue42, const double Umu42, const double Ut42, const bool IsMajorana=false)
genie::hnl::HNLDecayMode_t SelectChannelInclusive(std::map< genie::hnl::HNLDecayMode_t, double > Pmap, double ranThrow)
std::map< genie::hnl::HNLDecayMode_t, double > GetValidChannelWidths(const double M, const double Ue42, const double Umu42, const double Ut42, const bool IsMajorana=false)