Skip to content

Commit

Permalink
Merge branch 'master' into inconSYStencies
Browse files Browse the repository at this point in the history
  • Loading branch information
andreab1997 authored Oct 18, 2023
2 parents e309d4a + e005a42 commit 7b3976e
Show file tree
Hide file tree
Showing 284 changed files with 9,966 additions and 4,421 deletions.
7 changes: 7 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@
fbfd77118d60306d4e0ea84b832088eafb8cb867
# CAll black and isort on the last commit
5d9b9e8da6805abd18910cf09314b29a564728a8
# running black in the root vp folder, closuretest, plotoptions and theorycovariance
b9084ce695c49b5645b82436b19ec6cc3bd30280
a5d7385a79ef242e7eb1b1bf7b3746b6ebd6a0d0
3e8cf70c2d3b36d19fcb764599f6dfa6eb924b77
27f25d037854caa7e15496e4c6fa9d520f365ac9
# Restyling of evolven3fit_new
07d8d315aff44f98cb546e09088aa981e9778466
2 changes: 1 addition & 1 deletion .github/workflows/fitbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
run: |
conda activate nnpdfenv
cd $RUNFOLDER
evolven3fit $RUNCARD $N3FIT_MAXNREP
evolven3fit_new evolve $RUNCARD
# running postfit
- name: Postfit and upload fit
shell: bash -l {0}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
shell: bash -l {0}
run: |
echo "$NETRC_FILE" | base64 --decode > ~/.netrc
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda config --append channels conda-forge
conda config --prepend channels https://packages.nnpdf.science/public
conda config --set show_channel_urls true
Expand Down
82 changes: 82 additions & 0 deletions buildmaster/filters/ATLASWRAP11.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
This file implements the W production subset of the ATLASWZRAP11CC data set.
This is required to separate CC DY from NC DY.
Implemented by ERN June 2023.
*/

#include "ATLASWRAP11CC.h"

// Central selection
void ATLASWRAP11CCFilter::ReadData()
{

// Opening files
fstream f1;

stringstream datafile("");
datafile << dataPath() << "rawdata/ATLASWZRAP11CC/wzrap11.dat";

f1.open(datafile.str().c_str(), ios::in);

if (f1.fail()) {
cerr << "Error opening data file " << datafile.str() << endl;
exit(-1);
}

// Dummy string
std::string dummy;

// Read the names of systematics
std::string *sysNames = new std::string[fNSys];
sysNames[0] = "UNCORR";
for (int i=0; i<5; i++) f1 >> dummy;
for (int i=0; i<fNSys; i++)
f1 >> sysNames[i];

const int nBins = 2;
const int ndataWZ[nBins] = {11,22}; // Data thresholds for W+ and W-
const double MWZ2[nBins]= {pow(MW,2.0), pow(MW,2.0)}; //Mass squared of W (+ and -)

int low_bin = 0;
for (int b = 0; b < nBins; b++)
{
for (int i = low_bin; i < ndataWZ[b]; i++)
{
double etamin, etamax;

// Kinematics
f1 >> dummy; f1 >> etamin; f1 >> etamax;
fKin1[i] = etamin + (etamax - etamin)/2.0;
fKin2[i] = MWZ2[b];
fKin3[i] = 7000;

// Observable
f1 >> fData[i];
fData[i] *= 1000; // pb -> fb

// Statistical errors - percentage with respect the observable
f1 >> fStat[i];
fStat[i] *= fData[i]*1e-2;

// Correlated systematic errors
for (int l = 0; l < fNSys; l++)
{
f1 >> fSys[i][l].mult;
fSys[i][l].type = MULT;
fSys[i][l].name = sysNames[l];
}

// Additive errors
for (int l = 0; l < fNSys; l++)
fSys[i][l].add = fSys[i][l].mult*fData[i]*1e-2;
}
// Update lowest point in bin
low_bin = ndataWZ[b];
}

delete[] sysNames;

f1.close();
}


130 changes: 130 additions & 0 deletions buildmaster/filters/ATLASWRAP36PB.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
This file implements the W production subset of the ATLASWZRAP36PB data set.
This is required to separate CC DY from NC DY.
Implemented by ERN June 2023.
*/

#include "ATLASWRAP36PB.h"

void ATLASWRAP36PBFilter::ReadData()
{
// Opening files
fstream fWZ[2];

stringstream datafile("");
datafile << dataPath() << "rawdata/ATLASWZRAP36PB/ATLAS-36pb-Wplrap.data";
fWZ[0].open(datafile.str().c_str(), ios::in);

if (fWZ[0].fail()) {
cerr << "Error opening data file " << datafile.str() << endl;
exit(-1);
}

stringstream datafile2("");
datafile2 << dataPath() << "rawdata/ATLASWZRAP36PB/ATLAS-36pb-Wmlrap.data";
fWZ[1].open(datafile2.str().c_str(), ios::in);

if (fWZ[1].fail()) {
cerr << "Error opening data file " << datafile2.str() << endl;
exit(-1);
}

// Starting filter
const double lcorr = 1.0187; // correction factor due to luminosity upgrade
const int ndataWZ[2] = {11,11}; //Number of data for W+, W-
const double convfac = lcorr*1000.; // Must multiply from pb to fb
const double MWZ2[2] = {pow(MW,2.0), pow(MW,2.0)}; //Mass squared of W (+ and -) and Z

string line;
int idat = 0;
double etamin,etamax,tmp;

for (int iWZ = 0; iWZ < 2; iWZ++)
{
// rapidity
getline(fWZ[iWZ],line);
istringstream lstream(line);
for (int i = 0; i < ndataWZ[iWZ]; i++)
{
lstream >> etamin >> etamax;
fKin1[idat+i] = etamin + (etamax-etamin)*0.5;
}

// M_W
for (int i = 0; i < ndataWZ[iWZ]; i++)
fKin2[idat+i] = MWZ2[iWZ];

// sqrt(s)
for (int i = 0; i < ndataWZ[iWZ]; i++)
fKin3[idat+i] = 7000;

// obs
getline(fWZ[iWZ],line);
istringstream lstream2(line);
for (int i = 0; i < ndataWZ[iWZ]; i++)
{
lstream2 >> fData[idat+i];
fData[idat+i] *= convfac;
}

// stat (%, converted later)
getline(fWZ[iWZ],line);
istringstream lstream3(line);
for (int i = 0; i < ndataWZ[iWZ]; i++)
lstream3 >> fStat[idat+i];

// uncorrelated sys
getline(fWZ[iWZ],line);
istringstream lstream4(line);
for (int i = 0; i < ndataWZ[iWZ]; i++)
{
lstream4 >> fSys[idat+i][0].mult;
fSys[idat+i][0].name = "UNCORR";
}

// total correlated sys (unused)
getline(fWZ[iWZ],line);

// total uncertainty (unused)
getline(fWZ[iWZ],line);

// correlated systematics
for (int isys = 2; isys < fNSys; isys++) //2 to skip uncorr and lumi
{
getline(fWZ[iWZ],line);
istringstream lstream(line);
lstream >> tmp;
for (int i = 0; i < ndataWZ[iWZ]; i++)
{
lstream >> fSys[idat+i][isys].mult;
ostringstream sysname;
sysname << "ATLASWZRAP36PB_" << isys-2;
fSys[idat+1][isys].name = sysname.str();
}
}

// luminosity: 3.4%
for (int i = 0; i < ndataWZ[iWZ]; i++)
{
fSys[idat+i][1].mult = 3.5;
fSys[idat+i][1].name = "ATLASLUMI10";
}

idat+=ndataWZ[iWZ];
}

// Convert additive uncertainties to absolute form
for (int i = 0; i < fNData; i++)
{
fStat[i] *= fData[i]*1e-2;
for(int l = 0; l < fNSys; l++)
{
fSys[i][l].type = MULT; // All systematics multiplicative
fSys[i][l].add = fSys[i][l].mult*fData[i]*1e-2;
}
}


fWZ[0].close();
fWZ[1].close();
}
84 changes: 84 additions & 0 deletions buildmaster/filters/ATLASZRAP11.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
This file implements the Z production subset of the ATLASWZRAP11CC data set.
This is required to separate NC DY from CC DY.
Implemented by ERN June 2023.
*/

#include "ATLASZRAP11CC.h"

// Central selection
void ATLASZRAP11CCFilter::ReadData()
{

// Opening files
fstream f1;

stringstream datafile("");
datafile << dataPath() << "rawdata/ATLASWZRAP11CC/wzrap11.dat";

f1.open(datafile.str().c_str(), ios::in);

if (f1.fail()) {
cerr << "Error opening data file " << datafile.str() << endl;
exit(-1);
}

// Dummy string
std::string dummy;

// Read the names of systematics
std::string *sysNames = new std::string[fNSys];
sysNames[0] = "UNCORR";
for (int i=0; i<5; i++) f1 >> dummy;
for (int i=0; i<fNSys; i++)
f1 >> sysNames[i];

const int nBins = 3;
const int ndataWZ[nBins] = {6,18,24}; // Data thresholds for (Z_low, Z_peak, Z_high) respectively
const double MWZ2[nBins]= {pow(56.0,2.0), pow(91.0,2.0), pow(133.0,2.0)}; //Mass squared of (Z_low, Z_peak, Z_high)

string line;
for(int iline=0; iline<23; iline++)
getline(f1,line);

int low_bin = 0;
for (int b = 0; b < nBins; b++)
{
for (int i = low_bin; i < ndataWZ[b]; i++)
{
double etamin, etamax;

// Kinematics
f1 >> dummy; f1 >> etamin; f1 >> etamax;
fKin1[i] = etamin + (etamax - etamin)/2.0;
fKin2[i] = MWZ2[b];
fKin3[i] = 7000;

// Observable
f1 >> fData[i];
fData[i] *= 1000; // pb -> fb

// Statistical errors - percentage with respect the observable
f1 >> fStat[i];
fStat[i] *= fData[i]*1e-2;

// Correlated systematic errors
for (int l = 0; l < fNSys; l++)
{
f1 >> fSys[i][l].mult;
fSys[i][l].type = MULT;
fSys[i][l].name = sysNames[l];
}

// Additive errors
for (int l = 0; l < fNSys; l++)
fSys[i][l].add = fSys[i][l].mult*fData[i]*1e-2;
}
// Update lowest point in bin
low_bin = ndataWZ[b];
}

delete[] sysNames;

f1.close();
}
Loading

0 comments on commit 7b3976e

Please sign in to comment.