3 #ifndef __fastNLOCreate__ 4 #define __fastNLOCreate__ 12 #include "fastNLOReader.h" 13 #include "fastNLOTable.h" 14 #include "fastNLOEvent.h" 15 #include "read_steer.h" 17 #include "fastNLOInterpolBase.h" 18 #include "fastNLOCoeffAddBase.h" 19 #include "fastNLOGeneratorConstants.h" 37 fastNLOCreate(
const std::string& steerfile, std::string warmupfile =
"",
bool shouldReadSteeringFile =
true);
51 inline void SetNumberOfEvents(
double n) {
67 void Fill(
int scalevar=0);
87 inline bool GetIsWarmup()
const {
return fIsWarmup; };
109 void PrintAllSteeringValues()
const { PRINTALL();};
123 inline void ApplyPDFWeight(std::vector<std::pair<int,double> >& nodes,
const double x,
const std::vector<double>* grid)
const;
124 inline double CalcPDFReweight(
double x)
const;
131 void ReadSteering(std::string steerfile, std::string steeringNameSpace =
"",
bool shouldReadSteeringFile =
true);
139 void SetBinning1D(std::vector<double> bgrid, std::string label,
unsigned int idiff);
140 void SetBinning1D(std::vector<double> bgrid, std::string label,
unsigned int idiff,
double norm);
141 void SetBinning1D(std::vector<double> bgrid, std::string label,
unsigned int idiff, std::vector<double> vnorm);
142 void SetBinning1D(std::vector<double> blow, std::vector<double> bupp, std::string label,
unsigned int idiff);
143 void SetBinning1D(std::vector<double> blow, std::vector<double> bupp, std::string label,
unsigned int idiff,
double norm);
144 void SetBinning1D(std::vector<double> blow, std::vector<double> bupp, std::string label,
unsigned int idiff, std::vector<double> vnorm);
145 void SetBinningND(std::vector<double> bgrid,
unsigned int ndim, std::vector<int> idiff);
146 void SetBinningND(std::vector<std::vector<double> > bgrid,
unsigned int ndim, std::vector<int> idiff);
148 void ReadCoefficientSpecificVariables();
150 void InitVariablesInCoefficientTable();
159 void RoundValues(std::vector<std::pair<double,double> >& wrmmu ,
int nth);
160 int GetNthRelevantDigit(
double val,
int n);
161 std::vector<std::vector<std::pair<int,int> > >
ReadPartonCombinations(
int ord,
const std::vector<std::vector<int> >& PartonCombinations);
164 inline int GetXIndex(
const int& Obsbin,
const int& x1bin,
const int& x2bin)
const;
165 int GetNxmax(
const std::vector<double>* xGrid1,
const std::vector<double>* xGrid2);
186 inline void HalfMatrixCheck(
double x1,
double x2,
int& xmin,
int& xmax,
int& subproc)
const;
195 std::vector<std::vector<fastNLOInterpolBase*> >
fKernMuS;
200 void OutWarmup(std::ostream& = std::cout);
201 std::vector<double>
GetColumnFromTable(
const std::vector<std::vector<double> >& table,
int iCol);
202 std::string GetWarmupHeader(
int iScale, std::string minmax);
203 std::vector<std::pair<double,double> >
fWMu1;
204 std::vector<std::pair<double,double> >
fWMu2;
205 std::vector<std::pair<double,double> >
fWx;
208 std::vector<std::pair<double,double> >
fWxRnd;
219 fnloStats() : _nProc(0), _nEvPS(0), _nEv(0) { _time = time(0);}
220 long long int _nProc, _nEvPS;
222 void PrintStats()
const {
223 time_t hour, min, time = std::time(0) -
_time;
228 std::cout<<std::endl;;
229 std::cout<<
" ------------------- fastNLOstats ------------------"<<std::endl;;
230 std::cout<<
" Time elapsed: " 231 << (hour < 10 ?
"0" :
"") << hour
232 << (min < 10 ?
":0" :
":") << min
233 << (time < 10 ?
":0" :
":") << time << std::endl;;
234 if (_nEv!=0) std::cout <<
" Total event weight (NEvt): " << _nEv << std::endl;;
235 if (_nEvPS!=0) std::cout <<
" Contributions in phase space: " << _nEvPS << std::endl;;
236 if (_nProc!=0) std::cout <<
" Number of calls: " << _nProc << std::endl;;
237 std::cout <<
" -------------------------------------------------" << std::endl;;
238 std::cout<<std::endl;;
void SetCacheSize(int MaxCache)
Set maximum number of events in cache. Set to 0 to deactivate caching.
Definition: fastNLOCreate.h:115
void SetGlobalVerbosity(std::string sverb)
Set GlobalVerbosity using std::string variable.
Definition: fastNLOCreate.cc:709
void SetWarmupXSafetyMargin(int margin=4)
Set margin for x-value: First digit in 'e' notation (e.g. margin=4: x=6.6e-3 -> 6.2e-3)
Definition: fastNLOCreate.h:89
void NormalizeCoefficients(double wgt=1)
Set number of events to wgt and adjust coefficients accordingly.
Definition: fastNLOCreate.cc:2720
void InitInterpolationKernels()
Definition: fastNLOCreate.cc:3558
std::vector< int > fSymProc
necessary for half-matrix notation
Definition: fastNLOCreate.h:187
void MultiplyCoefficientsByBinSize()
Multiply all coefficients by bin size.
Definition: fastNLOCreate.cc:2743
Definition: fastNLOGeneratorConstants.h:32
void SetWarmupTableFilename(std::string)
Set the filename, which is used for storage of the warmup-table (otherwise a default is used) ...
Definition: fastNLOCreate.cc:3286
fastNLOCoeffAddBase * GetTheCoeffTable() const
Getter for the one (and only) coefficient table.
Definition: fastNLOCreate.h:93
int fWarmupNDigitMu1
Digits of warmup values for scale 1.
Definition: fastNLOCreate.h:169
int fObsBin
ObsBin from 'last' 'Fill()'-call.
Definition: fastNLOCreate.h:175
bool fApplyPDFReweight
shall the PDF reweight be applied.
Definition: fastNLOCreate.h:173
void SetWarmupNDigitMu2(int rnd=2)
Round warmup values for scale 2.
Definition: fastNLOCreate.h:91
int GetCacheSize() const
Get max cache size.
Definition: fastNLOCreate.h:116
std::vector< fastNLOInterpolBase * > fKernX2
Interpolation kernel for x-interpolation.
Definition: fastNLOCreate.h:192
void FillContributionFlexDIS(fastNLOCoeffAddFlex *c, int ObsBin)
fill flexible scale contribution in DIS
Definition: fastNLOCreate.cc:2345
std::vector< double > fScaleFac
Scale factors. Needed for fixed-scale tables.
Definition: fastNLOCreate.h:188
bool CheckWarmupConsistency()
Check consistency of warmup bin-grid and variables with steering values.
Definition: fastNLOCreate.cc:1520
std::string GetWarmupTableFilename()
Get the filename, which is used for storage of the warmup-table.
Definition: fastNLOCreate.cc:3263
void SetOrderOfAlphasOfCalculation(unsigned int ord)
set absolute order of alpha_s
Definition: fastNLOCreate.cc:1665
int fIOrd
order of alpha_s of run
Definition: fastNLOCreate.h:171
void MultiplyCoefficientsByConstant(double c)
Multiply all coefficients with a constant factor c.
Definition: fastNLOCreate.cc:2837
void RoundValues(std::vector< std::pair< double, double > > &wrmmu, int nth)
Round values to closes value by at most 1%.
Definition: fastNLOCreate.cc:3340
std::vector< std::pair< double, double > > fWx
array of warmup-values
Definition: fastNLOCreate.h:205
void SetGenConstsDefaults()
set defaults for generator constants
Definition: fastNLOCreate.cc:221
void Instantiate()
Definition: fastNLOCreate.cc:397
fastNLO::ScenarioConstants fScenConsts
Scenario specific constants.
Definition: fastNLOCreate.h:182
int GetNSubprocesses() const
The number of subprocesses (channels)
Definition: fastNLOCreate.h:71
void FillOneSubprocess(const fnloEvent &event, const fnloScenario &scen, int scalevar=0)
same function as 'Fill()', but uses content of member fScenario and fEvent
Definition: fastNLOCreate.cc:1998
void ReadBinSize()
Definition: fastNLOCreate.cc:955
Definition: fastNLOGeneratorConstants.h:72
bool fIsFlexibleScale
is it a flexible scale table?
Definition: fastNLOCreate.h:172
void AdjustWarmupValues()
Round warmup values to more likely values.
Definition: fastNLOCreate.cc:3292
void SetLoOrder(int LOOrd)
set number of events. This is only mandatory, before calling WriteTable().
Definition: fastNLOCreate.cc:1772
fnloScenario fScenario
Structure, which holds perturbative (wilson) coefficients/weights and x-values.
Definition: fastNLOCreate.h:46
void ReadSteering(std::string steerfile, std::string steeringNameSpace="", bool shouldReadSteeringFile=true)
read steering file
Definition: fastNLOCreate.cc:477
std::vector< std::pair< double, double > > fWMu2
array of warmup-values
Definition: fastNLOCreate.h:204
std::vector< std::vector< std::pair< int, int > > > ReadPartonCombinations(int ord, const std::vector< std::vector< int > > &PartonCombinations)
Read PDFCoeff from steering.
Definition: fastNLOCreate.cc:600
void Clear()
Print all steering values obtained from steering files (of all fastNLOCreate instances);.
Definition: fastNLOCreate.h:111
Definition: fastNLOEvent.h:35
fastNLO::WgtStat fWgt
event and weight counts
Definition: fastNLOCoeffAddBase.h:160
fastNLOReader * fReader
PDF and alpha_s interface for reference tables.
Definition: fastNLOCreate.h:178
fastNLO::GeneratorConstants fGenConsts
Generator specific constants.
Definition: fastNLOCreate.h:180
void ReadGenAndProcConstsFromSteering()
Definition: fastNLOCreate.cc:310
bool GetIsFlexibleScale() const
Get flag for warmup table.
Definition: fastNLOCreate.h:88
void FlushCache()
Fill weights from cache into table.
Definition: fastNLOCreate.cc:2050
std::vector< std::vector< fastNLOInterpolBase * > > fKernMuS
Interpolation kernels for each scale var for fixed-scale tables.
Definition: fastNLOCreate.h:195
int GetNxmax(const std::vector< double > *xGrid1, const std::vector< double > *xGrid2)
get maximum x-index
Definition: fastNLOCreate.cc:2676
void InitCoeffTable()
Definition: fastNLOCreate.cc:787
bool CheckProcConsts()
check process constants to be different from defaults
Definition: fastNLOCreate.cc:246
void GetWarmupValues()
Definition: fastNLOCreate.cc:1392
int fWarmupNDigitMu2
Digits of warmup values for scale 2.
Definition: fastNLOCreate.h:170
Definition: fastNLOCreate.h:22
virtual void Clear()
Clear all coefficients and event counters.
Definition: fastNLOCoeffAddBase.cc:555
void UseBinGridFromWarmup()
Use bin grid as given in the warmup table.
Definition: fastNLOCreate.cc:1481
void ReadScenarioConstsFromSteering()
Read steering values into fScenConsts.
void WriteWarmupTable()
Write fastNLO table to disk and set number of events.
Definition: fastNLOCreate.cc:2958
fastNLOReader * SetIsReferenceTable(fastNLOReader *fnloread=NULL)
set this table/contribution to become a reference contribution
Definition: fastNLOCreate.cc:3763
bool fIsWarmup
is it a warmup run?
Definition: fastNLOCreate.h:167
bool GetParameterFromSteering(const std::string &label, bool &val) const
Get user-defined parameter from steering file.
int fWarmupXMargin
margin for x-value: First digit in 'e' notation (e.g. margin=4: x=6.6e-3 -> 6.2e-3) ...
Definition: fastNLOCreate.h:168
void InitWarmupArrays()
Definition: fastNLOCreate.cc:2882
void FillWeightCache(int scalevar)
Fill weight into cache, merge weights for identical phase space points.
Definition: fastNLOCreate.cc:2007
double WgtNevt
'number of events', i.e. normalisation as suggested by generator (identical to previously use 'Nevt')...
Definition: fastNLOCoeffAddBase.h:10
std::vector< std::pair< double, double > > fWMu1Rnd
copy of warm-up array for rounding
Definition: fastNLOCreate.h:206
fnloEvent fEvent
Structure, which holds all relevant variables related to event observables.
Definition: fastNLOCreate.h:45
Definition: fastNLOReader.h:17
void PrintStats() const
Clear coefficient table.
Definition: fastNLOCreate.h:112
fastNLO::WarmupConstants fWarmupConsts
Warmup specific constants.
Definition: fastNLOCreate.h:183
fnloScenario fLastScen
keep information of scenario from last 'Fill()'-call
Definition: fastNLOCreate.h:176
void SetScenario(const fnloScenario scen)
set the member fScenario, which will be used when calling Fill()
Definition: fastNLOCreate.h:49
void SetEvent(const fnloEvent ev)
set the member fEvent, which will be used when calling Fill()
Definition: fastNLOCreate.h:50
bool CheckWeightIsFinite()
Check if weight is reasonable.
Definition: fastNLOCreate.cc:2615
void SetWarmupNDigitMu1(int rnd=1)
Round warmup values for scale 1.
Definition: fastNLOCreate.h:90
bool TestParameterInSteering(const std::string &label) const
Test on existence of user-defined parameter name in steering card.
Definition: fastNLOCreate.cc:3799
void ReadScaleFactors()
Definition: fastNLOCreate.cc:728
int GetBin()
get bin number from 'scenario' observables
Definition: fastNLOCreate.cc:1863
void SetProcConstsDefaults()
set defaults for process constants
Definition: fastNLOCreate.cc:229
void WriteTable()
Write fastNLO table to disk.
Definition: fastNLOCreate.cc:2911
std::vector< fastNLOInterpolBase * > fKernMu2
Interpolation kernel for mu2-interpolation.
Definition: fastNLOCreate.h:194
void Fill(int scalevar=0)
fill event quantities in fastNLO table. Call it for every subprocess.
Definition: fastNLOCreate.cc:2066
const std::vector< double > & GetScaleVariations() const
Get list of scale variations.
Definition: fastNLOCreate.h:72
Definition: fastNLOCreate.h:216
time_t _time
structre to keep track of statisics. Just for fun and information.
Definition: fastNLOCreate.h:218
int CheckWarmupValuesIdenticalWithBinGrid(std::vector< std::pair< double, double > > &wrmmu)
Check if warmup values are possibly identical with bin grid.
Definition: fastNLOCreate.cc:3391
void FillContributionFixHHC(fastNLOCoeffAddFix *c, int ObsBin, int scalevar)
fill fixed scale table in pp/ppbar
Definition: fastNLOCreate.cc:2204
std::vector< std::pair< double, double > > fWMu1
array of warmup-up values
Definition: fastNLOCreate.h:203
std::vector< fastNLOInterpolBase * > fKernMu1
Interpolation kernel for mu1-interpolation.
Definition: fastNLOCreate.h:193
std::vector< fastNLOInterpolBase * > fKernX1
Interpolation kernel for x-interpolation.
Definition: fastNLOCreate.h:191
void HalfMatrixCheck(double x1, double x2, int &xmin, int &xmax, int &subproc) const
check x-values in case of half-matrix notation (pp,ppbar), and exchange if necessary.
Definition: fastNLOCreate.cc:2593
Definition: fastNLOInterpolBase.h:27
int CreateCoeffTable()
Create the one (and only) coefficient table.
Definition: fastNLOCreate.cc:802
Definition: fastNLOCoeffAddFlex.h:8
void FillAllSubprocesses(const std::vector< fnloEvent > &events, const fnloScenario &scen, int scalevar=0)
Fill a selection (std::vector) of events/processes/channels, which all have the identic scenario...
void FillRefContribution(int scalevar=0)
fill contribution if this is a reference table
Definition: fastNLOCreate.cc:2547
fastNLOInterpolBase * MakeInterpolationKernels(std::string KernelName, double xdn, double xup)
Definition: fastNLOCreate.cc:3740
std::vector< double > GetColumnFromTable(const std::vector< std::vector< double > > &table, int iCol)
Get a column from a table.
Definition: fastNLOCreate.cc:3724
Definition: fastNLOCoeffAddBase.h:57
std::vector< std::pair< double, double > > fWMu2Rnd
copy of warm-up array for rounding
Definition: fastNLOCreate.h:207
void DivideCoefficientsByBinSize()
Divide all coefficients by bin size.
Definition: fastNLOCreate.cc:2789
std::vector< std::pair< fnloScenario, fnloEvent > > fWeightCache
cache for fill-weights
Definition: fastNLOCreate.h:211
Definition: fastNLOCoeffAddFix.h:8
void UpdateWarmupArrays()
Definition: fastNLOCreate.cc:2851
void ReadBinningFromScenarioConsts()
Definition: fastNLOCreate.cc:816
Definition: fastNLOTable.h:20
fastNLOCreate()
don't use the default constructor. fastNLOCreate is only reasonable with input steering.
Definition: fastNLOCreate.cc:50
fastNLO::ProcessConstants fProcConsts
Process specific constants.
Definition: fastNLOCreate.h:181
void PrintWarmupValues()
Print the warmup values to the screen.
Definition: fastNLOCreate.cc:2978
int GetXIndex(const int &Obsbin, const int &x1bin, const int &x2bin) const
get x-index in case of two hadrons.
Definition: fastNLOCreate.cc:2655
Definition: fastNLOGeneratorConstants.h:10
std::vector< std::pair< double, double > > fWxRnd
copy of warm-up array for rounding
Definition: fastNLOCreate.h:208
std::string fWarmupFilename
File name of the warmup table.
Definition: fastNLOCreate.h:166
void FillContribution(int scalevar=0)
fill contribution into table
Definition: fastNLOCreate.cc:2140
void FillContributionFixDIS(fastNLOCoeffAddFix *c, int ObsBin, int scalevar)
fill fixed scale contribution in DIS
Definition: fastNLOCreate.cc:2489
Definition: fastNLOGeneratorConstants.h:188
void FillContributionFlexHHC(fastNLOCoeffAddFlex *c, int ObsBin)
fill flexible scale contribution in pp/ppbar
Definition: fastNLOCreate.cc:2260
std::string fSteerfile
filename of steering file.
Definition: fastNLOCreate.h:174
Definition: fastNLOEvent.h:8