GENIEGenerator
Loading...
Searching...
No Matches
GFluxExposureI.cxx
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3 Copyright (c) 2003-2025, The GENIE Collaboration
4 For the full text of the license visit http://copyright.genie-mc.org
5
6 Robert Hatcher <rhatcher@fnal.gov>
7 Fermi National Accelerator Laboratory
8*/
9//____________________________________________________________________________
10
12
13#include "TMath.h"
14#include <cstring>
15
16namespace genie {
17namespace flux {
18
20 {
21 switch (etype) {
22 case kUnknown: return "UnknownExposureUnits"; break;
23 case kPOTs: return "POT"; break;
24 case kSeconds: return "Seconds"; break;
25 default: return "?UnknownExposureUnits?"; break;
26 }
27 }
28
30 GFluxExposureI::StringToEnum(const char* chars, int maxChar)
31 {
32 int len = strlen(chars);
33 if (maxChar == 0 ) maxChar = len;
34 if (maxChar > len) maxChar = len;
35 if (maxChar <= 0 ) return genie::flux::kUnknown;
36
37 char* lowchars = new char [maxChar];
38 for (int i=0; i<maxChar; ++i) lowchars[i] = tolower(chars[i]);
39
41 if ( 0 == strncmp(lowchars,"pot",TMath::Min(maxChar,3))) {
42 etype = genie::flux::kPOTs;
43 } else if ( 0 == strncmp(lowchars,"sec",TMath::Min(maxChar,3))) {
45 }
46 delete [] lowchars;
47 return etype;
48 }
49
52
54
57
60
61} // namespace flux
62} // namespace genie
const char * GetExposureUnits() const
what units are returned by GetTotalExposure?
static genie::flux::Exposure_t StringToEnum(const char *chars, int maxChar=0)
GFluxExposureI(genie::flux::Exposure_t etype)
static const char * AsString(genie::flux::Exposure_t etype)
genie::flux::Exposure_t GetExposureType() const
genie::flux::Exposure_t fEType
GENIE flux drivers.
enum genie::flux::EExposure Exposure_t
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25