-
Notifications
You must be signed in to change notification settings - Fork 0
/
LHC-FASER_Light.cpp
executable file
·165 lines (155 loc) · 5.89 KB
/
LHC-FASER_Light.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
* LHC-FASER_Light.cpp
*
* Created on: 31 Aug 2012
* Authors: Ben O'Leary (benjamin.oleary@gmail.com)
* Jonas Lindert (jonas.lindert@googlemail.com)
* Carsten Robens (carsten.robens@gmx.de)
* Copyright 2010 Ben O'Leary, Jonas Lindert, Carsten Robens
*
* This file is part of LHC-FASER.
*
* LHC-FASER is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LHC-FASER is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LHC-FASER. If not, see <http://www.gnu.org/licenses/>.
*
* The GNU General Public License should be in GNU_public_license.txt
* the files of LHC-FASER are:
* LHC-FASER.hpp
* LHC-FASER.cpp
* LHC-FASER_Light.cpp
* LHC-FASER_base_electroweak_cascade_stuff.hpp
* LHC-FASER_base_electroweak_cascade_stuff.cpp
* LHC-FASER_base_kinematics_stuff.hpp
* LHC-FASER_base_kinematics_stuff.cpp
* LHC-FASER_base_lepton_distribution_stuff.hpp
* LHC-FASER_base_lepton_distribution_stuff.cpp
* LHC-FASER_charged_electroweak_cascade_stuff.hpp
* LHC-FASER_charged_electroweak_cascade_stuff.cpp
* LHC-FASER_cross-section_stuff.hpp
* LHC-FASER_cross-section_stuff.cpp
* LHC-FASER_derived_lepton_distributions.hpp
* LHC-FASER_derived_lepton_distributions.cpp
* LHC-FASER_electroweak_cascade_collection_stuff.hpp
* LHC-FASER_electroweak_cascade_collection_stuff.cpp
* LHC-FASER_full_cascade_stuff.hpp
* LHC-FASER_full_cascade_stuff.cpp
* LHC-FASER_global_stuff.hpp
* LHC-FASER_global_stuff.cpp
* LHC-FASER_input_handling_stuff.hpp
* LHC-FASER_input_handling_stuff.cpp
* LHC-FASER_jet_kinematics_stuff.hpp
* LHC-FASER_jet_kinematics_stuff.cpp
* LHC-FASER_lepton_kinematics_stuff.hpp
* LHC-FASER_lepton_kinematics_stuff.cpp
* LHC-FASER_neutral_electroweak_cascade_stuff.hpp
* LHC-FASER_neutral_electroweak_cascade_stuff.cpp
* LHC-FASER_signal_calculator_stuff.hpp
* LHC-FASER_signal_calculator_stuff.cpp
* LHC-FASER_signal_data_collection_stuff.hpp
* LHC-FASER_signal_data_collection_stuff.cpp
* LHC-FASER_sparticle_decay_stuff.hpp
* LHC-FASER_sparticle_decay_stuff.cpp
* LHC-FASER_template_classes.hpp
* and README.LHC-FASER.txt which describes the package.
*
* LHC-FASER also requires CppSLHA. It should be found in a subdirectory
* included with this package.
*
* LHC-FASER also requires grids of lookup values. These should also be
* found in a subdirectory included with this package.
*/
/* this program is to print out the cross-sections for a given SLHA spectrum on
* a channel-by-channel basis, in fb. it takes a single argument, which is the
* name of the SLHA file.
*/
// includes:
#include <fstream>
#include "LHC-FASER.hpp"
// the main program:
int main( int argumentCount,
char* argumentStrings[] )
{
LHC_FASER::lhcFaserLight onceOffLhcFaserLight( "./grids/",
"fb",
true );
std::string slhaFilename( "" );
std::string appendArgument( "" );
if( 3 == argumentCount )
// if the arguments should have been the SLHA filename & "--append"...
{
appendArgument.assign( argumentStrings[ 1 ] );
if( 0 != appendArgument.compare( "--append" ) )
{
slhaFilename.assign( appendArgument );
appendArgument.assign( argumentStrings[ 2 ] );
}
if( 0 != appendArgument.compare( "--append" ) )
{
std::cout
<< std::endl
<< "error! if 2 arguments are given, 1 of them should be the name of"
<< " the SLHA file and the other should be --append (which tells"
<< " LHC-FASER_Light to append its results to the SLHA file instead of"
<< " printing to the console)!";
std::cout << std::endl; // let the user know the format.
return EXIT_FAILURE;
}
}
else if( 2 == argumentCount )
// if the argument should have been just the SLHA filename...
{
slhaFilename.assign( argumentStrings[ 1 ] );
}
else
{
std::cout
<< std::endl
<< "error! at least 1 argument must be given (the name of the SLHA file"
<< " with the spectrum)! if 2 arguments are given, 1 of them should be the"
<< " name of the SLHA file and the other should be --append (which tells"
<< " LHC-FASER_Light to append its results to the SLHA file instead of"
<< " printing to the console)!";
std::cout << std::endl; // let the user know the format.
return EXIT_FAILURE;
}
if( appendArgument.empty() )
{
std::cout
<< std::endl
<< onceOffLhcFaserLight.fullResultsForNewSlha( slhaFilename );
std::cout
<< "# in the format [particle 1 PDG code] [particle 2 PDG code]"
<< " [7 TeV cross-section in fb] [14 TeV cross-section in fb]";
std::cout << std::endl;
std::cout << std::endl;
}
else
{
std::string
resultsString( onceOffLhcFaserLight.fullResultsForNewSlha( slhaFilename,
" " ) );
std::ofstream slhaFile( slhaFilename.c_str(),
std::ios::app );
slhaFile
<< std::endl
<< "BLOCK LHCFASERLIGHT"
<< std::endl
<< "# particle 1 particle 2 7 TeV sigma/fb 14 TeV sigma/fb"
<< std::endl
<< resultsString
<< std::endl;
slhaFile.close();
}
// this was a triumph! I'm making a note here:
return EXIT_SUCCESS;
}