Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
cd0c98e
update beta --> alpha on labels
ezradlesser Aug 6, 2021
9ee853a
beta --> alpha for angularities
ezradlesser Aug 6, 2021
c894a4d
New R_max dictionary structure
ezradlesser Aug 6, 2021
0dcfa20
Update scripts for new directory on rstorage
ezradlesser Aug 6, 2021
26a2f34
Ang data processing for Pb-Pb working
ezradlesser Aug 6, 2021
e06c7ea
Fixed wrong directory
ezradlesser Aug 6, 2021
9c63834
Pb-Pb data batch scripts
ezradlesser Sep 6, 2021
335051a
adding Rey's scripts
ezradlesser Sep 6, 2021
7f1e7e5
Folding and plotting for theta_g theory comps
ezradlesser Sep 21, 2021
20ced2a
diff run
ezradlesser Sep 21, 2021
a7c4fdb
Init some PbPb ang slurm scripts
ezradlesser Oct 29, 2021
2dc88cc
Rename processing ang directory to be inclusive to PbPb scripts
ezradlesser Oct 29, 2021
569ec05
Rename analysis ang directory, init PbPb ang analysis and config scripts
ezradlesser Oct 29, 2021
3f79e20
More helpful error message for THn finding
ezradlesser Oct 29, 2021
83f0c9e
Propogate dir change to processing scripts
ezradlesser Oct 29, 2021
fc9817d
Fix error output file
ezradlesser Oct 29, 2021
d6b10ff
Fix MC processing for multiple R_max / add more PbPb ang systematic s…
ezradlesser Oct 29, 2021
09328fd
Update angularity PbPb scripts // Update angularity processing code t…
ezradlesser Dec 15, 2021
d9da384
Fix Herwig gen bug for theta_g
ezradlesser Dec 16, 2021
ae2f129
Update Pb-Pb angularity scripts
ezradlesser Jan 20, 2022
671263d
Adapt to minbin changes
ezradlesser Jan 20, 2022
26a8f7c
Update & add Pb-Pb angularity slurm scripts
ezradlesser Jan 20, 2022
f352b1e
Theory plotting updates / fixes
ezradlesser Jan 20, 2022
04ed1f9
Add Pb-Pb vs pp angularity plot
ezradlesser Jan 20, 2022
7257a5b
Figure updates / Pb-Pb ang performance figures
ezradlesser Jan 27, 2022
4087c5f
Add angularity Pb-Pb fast simulation
ezradlesser Jan 27, 2022
d1cd450
JEWEL merging scripts
ezradlesser Feb 1, 2022
ac3f6dd
Plotting updates
ezradlesser Feb 1, 2022
08b8491
Adding Pythia8 embedded fastsim merge scripts
ezradlesser Feb 4, 2022
fb309a4
add option to vary reg_param_variation
ezradlesser Feb 4, 2022
693f774
Fix thermal closure test
ezradlesser Feb 4, 2022
c0c1b7c
Correct binning for MC ang TH2s
ezradlesser Feb 4, 2022
d4874c4
Update scripts / Add stat subtraction to thermal uncertainty
ezradlesser Feb 9, 2022
6994f7b
Fix for loops / add leading track functionality
ezradlesser Feb 13, 2022
f3aff2d
MC processing bug fix
ezradlesser Feb 13, 2022
bf0c9df
Add JEWEL parser for scale factors
ezradlesser Feb 13, 2022
56e6339
Update scripts // add pT cut scripts for PbPb
ezradlesser Feb 14, 2022
0985f25
Add simple remove-outliers functionality
ezradlesser Feb 14, 2022
d757f04
Faster outliers removal on C++ side
ezradlesser Feb 15, 2022
5609453
update scripts
ezradlesser Feb 18, 2022
81d37b4
fix reg_param typo bug
jdmulligan Jan 4, 2022
6b3b791
add base class for JEWEL calculations (from Rey)
jdmulligan Jan 5, 2022
93e6bbf
add first draft of subjet_z jewel calculation
jdmulligan Jan 5, 2022
79d9d7c
add protection to maxbin case
jdmulligan Dec 29, 2021
32a34c1
minor figure updates
jdmulligan Jan 4, 2022
1eee8d8
add remaining slurm scripts for jewel z_r calculation
jdmulligan Jan 6, 2022
e7403f3
add theta_g jewel calculation scripts
jdmulligan Jan 6, 2022
b1289f5
separate data and theory uncertainties in DyG pQCD ratio
jdmulligan Jan 6, 2022
1d82afe
add slurm for jewel recoil subtraction for zg/tg
jdmulligan Jan 7, 2022
51ae17b
Added missing function for recoil subtraction to RUtil.cxx
rey-lbl Jan 7, 2022
ed17d1e
Added function for recoil subtraction to RUtil.hh
rey-lbl Jan 7, 2022
5ea7cf8
allow to loop through thermal particles in user function for subjet z
jdmulligan Jan 10, 2022
cbefea4
add jewel curves to subjet zr
jdmulligan Jan 10, 2022
990a90c
some cleanup for jewel calculations
jdmulligan Jan 11, 2022
60aeac4
Update README.md
jdmulligan Jan 13, 2022
da01394
subjet plot edits
jdmulligan Jan 18, 2022
c5a7533
update theta_g plots to include jewel
jdmulligan Jan 18, 2022
c609cef
add constituent subtraction option for jewel
jdmulligan Jan 19, 2022
7a87169
label changes for SD/DG
jdmulligan Jan 21, 2022
07246b6
zloss
matplo Jan 22, 2022
a72318b
any;80-120
matplo Jan 22, 2022
39aae7a
add charged-full mapping machinery for pp subjet z_r
jdmulligan Jan 22, 2022
80bff27
trivial plotting updates
jdmulligan Jan 27, 2022
7750b0d
Update README.md
matplo Jan 30, 2022
e2fe3d7
Update README.md
matplo Jan 30, 2022
08d0861
Update README.md
matplo Jan 30, 2022
ff76fab
Update README.md
matplo Jan 30, 2022
968cf53
Update README.md
matplo Jan 30, 2022
5381019
Update README.md
matplo Jan 30, 2022
4228d9d
Update README.md
matplo Jan 30, 2022
ff16d6f
just update for view
matplo Feb 2, 2022
b418cc7
generate some lep events with alice data strut - parton and hadron le…
matplo Feb 9, 2022
24d7c18
Resolving merge conflict
ezradlesser Feb 18, 2022
f9b957e
Merge branch 'master' into master
ezradlesser Feb 18, 2022
ce57596
Remove duplicate line
ezradlesser Feb 18, 2022
a1c7656
Revert plotting utils
ezradlesser Feb 18, 2022
e72630d
Update scripts
ezradlesser Feb 24, 2022
4e36899
Update fastsim / JEWEL scripts for latest software
ezradlesser Feb 24, 2022
79bab71
Script updates
ezradlesser Feb 28, 2022
df48135
Update for multiple generators
ezradlesser Feb 28, 2022
cbd5aa1
HEPData change for generator
ezradlesser Feb 28, 2022
e32d475
Plotting updates
ezradlesser Feb 28, 2022
3720a23
Plotting / closure tests updates
ezradlesser Feb 28, 2022
00545c3
Fix thermal closure systematic
ezradlesser Feb 28, 2022
f7590f6
Merge branch 'master' into master
ezradlesser Feb 28, 2022
3615845
Config script updates
ezradlesser Feb 28, 2022
8b8b776
Fix groomed generator systematic
ezradlesser Mar 1, 2022
44875c5
Update yaml files
ezradlesser Mar 2, 2022
29b0edd
Fix maxbin for generator systematic
ezradlesser Mar 3, 2022
c83387e
Script updates
ezradlesser Mar 3, 2022
1a5fb67
Update scripts
ezradlesser Mar 5, 2022
f3140ec
Fix SD mass filling bug
ezradlesser Mar 5, 2022
7ffefb9
Started implementing JEWEL negative_pT subtraction
ezradlesser Mar 9, 2022
612d7ff
Update negative recombiner for JEWEL
ezradlesser Mar 9, 2022
fae2202
update scripts
ezradlesser Mar 9, 2022
5c1acce
Update analysis scripts for compatibility with mass
ezradlesser Mar 9, 2022
87b71b1
Negative pT --> recombiner
ezradlesser Mar 9, 2022
2623c3e
Check to make sure jet has positive pT
ezradlesser Mar 9, 2022
b019dc0
Update user scripts / Add mass
ezradlesser Mar 11, 2022
eab40ab
Remove holes_in_jet functionality
ezradlesser Mar 11, 2022
ddb5158
Update slurm scripts
ezradlesser Mar 11, 2022
0e927bb
Add ratio to single_result plots
ezradlesser Mar 11, 2022
cce9c9e
Mass code update
ezradlesser Aug 4, 2022
9e2eb21
Mass code update
ezradlesser Jan 26, 2023
d35eac6
Mass code updates
ezradlesser Mar 22, 2023
a0922dd
Adding late kT grooming recognition
ezradlesser Mar 31, 2023
1a95cf0
Add Lund data processing
ezradlesser Mar 31, 2023
1bf06cc
Late kT processing util
ezradlesser Mar 31, 2023
28edacc
update scripts
ezradlesser Mar 31, 2023
d0987b4
Updates to Pythia8 gen
ezradlesser May 9, 2023
e66fd1a
Updates
ezradlesser Nov 14, 2023
ec947b5
Ignore build dirs
ezradlesser Nov 14, 2023
dad23e2
Update run script
ezradlesser Feb 9, 2024
0460e87
Fix HEPData for Pb-Pb
ezradlesser Oct 31, 2024
13eea75
HF-jet code
ezradlesser Oct 31, 2024
09e4128
Testing old datafiles for angularities
ezradlesser Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ Pipfile.lock
*.run
*.DS_Store
.vscode/settings.json
*.save
*.tar.gz
cpptools/src/TGlauberMC/
cpptools/src/TennGen/
499 changes: 484 additions & 15 deletions cpptools/src/rutil/rutil.cxx

Large diffs are not rendered by default.

127 changes: 104 additions & 23 deletions cpptools/src/rutil/rutil.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace RUtil
virtual ~Test() {;}
void setMember(Double_t v) {fMember = v;}
Double_t getMember() {return fMember;}

private:
Double_t fMember;

Expand All @@ -41,13 +41,15 @@ namespace RUtil
const double & prior_variation_parameter);
double prior_scale_func_4(const double & obs_true, const double & content,
const double & prior_variation_parameter);
double prior_scale_func_5(const double & obs_true, const double & content,
const double & prior_variation_parameter);
double prior_scale_func_def(const double & obs_true, const double & content,
const double & prior_variation_parameter);

void delete_h(TH2* h);
void delete_h(THn* h);
void delete_h(TH2* h);
void delete_h(THn* h);

bool* sorted_match(const int* a, const int a_len, const int* b, const int b_len);
bool* sorted_match(const int* a, const int a_len, const int* b, const int b_len);

//------------------------------------------------------
// Rebinning utilities
Expand All @@ -57,7 +59,7 @@ namespace RUtil
HistUtils() : TObject()
{;}
virtual ~HistUtils() {;}

// Rebin 2D histogram h with name hname using axes given by x_bins and y_bins
TH2F* rebin_th2(TH2F & h_to_rebin, char* hname, double* x_bins, int n_x_bins,
double* y_bins, int n_y_bins, bool move_y_underflow = false);
Expand Down Expand Up @@ -88,19 +90,71 @@ namespace RUtil
const bool use_miss_fake=false,
const bool do_roounfoldresponse=true);

//------------------------------------------------------
// Convolution of nonperturbative shape functions

// Create and return 2D histogram, convolving h with shape function
TH2D* convolve_F_np(const double & Omega, const double & R, const double & beta,
const double* ob_bins, const int & n_ob_bins, const double* obs,
const double* ob_bin_width,
const double* pT_bins, const int & n_pT_bins, const double* pTs,
const TH2D & h, const std::string & name, const bool groomed = false,
const double & sd_beta = 0, const double & sd_zcut = 0.2,
const std::string & option = "");

double find_cell(double val, const double * cell, const int range, bool phi);
// Rebin N-dimensional THn to a new histogram with name name_thn_rebinned using provided axes
// WARNING: currently requires n_dim = 4
// Alternate definition to take TH2 as prior variation
THnF* rebin_thn_th2prior(
const std::string & response_file_name,
const THnF* thn,
const std::string & name_thn_rebinned,
const std::string & name_roounfold,
const int & n_dim,
const int & n_pt_bins_det,
const double* det_pt_bin_array,
const int & n_obs_bins_det,
const double* det_bin_array,
const int & n_pt_bins_truth,
const double* truth_pt_bin_array,
const int & n_obs_bins_truth,
const double* truth_bin_array,
const std::string & label="",
const double & prior_variation_parameter=0.,
const TH2* prior_variation=nullptr,
const bool move_underflow=false,
const bool use_miss_fake=false,
const bool do_roounfoldresponse=true);

//---------------------------------------------------------------
// Remove outliers from a TH1 via "simple" method:
// delete any bin contents with N counts < limit
// Modifies histogram in-place and returns its pointer
//---------------------------------------------------------------
TH1* simpleRemoveOutliers(TH1* hist, bool verbose, int limit);

//---------------------------------------------------------------
// Remove outliers from a TH1 via pT-hat method:
// delete any bin contents with pT > limit
// Modifies histogram in-place and returns its pointer
//---------------------------------------------------------------
TH1* pThatRemoveOutliers(TH1* hist, bool verbose, const double & limit);

//---------------------------------------------------------------
// Remove outliers from a THn via "simple" method:
// delete any bin contents with N counts < limit
// Modifies histogram in-place and returns its pointer
//---------------------------------------------------------------
THn* simpleRemoveOutliersTHn(THn* hist, bool verbose, int limit, int dim);

//---------------------------------------------------------------
// Remove outliers from a THn via pT-hat method:
// delete any bin contents with pT_truth > limit
// Modifies histogram in-place and returns its pointer
//---------------------------------------------------------------
THn* pThatRemoveOutliers(THn* hist, bool verbose, const double & limit, int dim, int pTdim);

//------------------------------------------------------
// Convolution of nonperturbative shape functions

// Create and return 2D histogram, convolving h with shape function
TH2D* convolve_F_np(const double & Omega, const double & R, const double & beta,
const double* ob_bins, const int & n_ob_bins, const double* obs,
const double* ob_bin_width,
const double* pT_bins, const int & n_pT_bins, const double* pTs,
const TH2D & h, const std::string & name, const bool groomed = false,
const double & sd_beta = 0, const double & sd_zcut = 0.2,
const std::string & option = "");

double find_cell(double val, const double * cell, const int range, bool phi);

private:
// Create empty THn using provided axes
Expand Down Expand Up @@ -131,18 +185,45 @@ namespace RUtil
const bool move_underflow=false,
const bool use_miss_fake=false);

// Fill empty thn_rebinned with data from thn
// Overloaded function to take TH2 as prior variation
void fill_rebinned_thn(const std::string & response_file_name, const THnF* thn,
THnF* thn_rebinned, const unsigned int & n_dim,
const bool do_roounfoldresponse=true,
RooUnfoldResponse* roounfold_response=nullptr,
const float min_det_pt=0.,
const float min_truth_pt=0.,
const float min_det=0.,
const float min_truth=0.,
const float max_det_pt=0.,
const float max_truth_pt=0.,
const float max_det=0.,
const float max_truth=0.,
const TH2* prior_variation=nullptr,
const double & prior_variation_parameter=0.,
const bool move_underflow=false,
const bool use_miss_fake=false);

// Set scaling of prior
prior_scale_func prior_scale_factor_obs(const int & option);

//------------------------------------------------------
// Convolution of nonperturbative shape functions
// Recursive helper function for simpleRemoveOutliersTHn()
void simpleRemoveOutliersTHn_recurse(
THn* hist, int limit, int dim, int* n_bins, int* x, int dim_to_update);
// Recursive helper function for pThatRemoveOutliersTHn()
//void pThatRemoveOutliersTHn_recurse(
// THn* hist, int limit, int dim, int pTdim, int max_bin_number,
// int* n_bins, int* x, int dim_to_update, bool verbose);

//------------------------------------------------------
// Convolution of nonperturbative shape functions

// Non-perturbative parameter with factored-out beta dependence
// Omega is Omega_{a=0} == Omega_{beta=2} (universal[?])
inline double Omega_beta(const double & Omega, const double & beta);
inline double Omega_beta(const double & Omega, const double & beta);

// Shape function for convolving nonperturbative effects
inline double F_np(const double & Omega, const double & k, const double & beta);
// Shape function for convolving nonperturbative effects
inline double F_np(const double & Omega, const double & k, const double & beta);

ClassDef(HistUtils, 1)
};
Expand Down
66 changes: 66 additions & 0 deletions pyjetty/alice_analysis/analysis/user/ang/PbPb/pT_cut_comp.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// ROOT Macro for comparing ROOT THn before and after pT-hat based cut
// Written by Ezra Lesser, August 2022
#include <string>
#include "THn.h"
#include "TH2.h"

int pT_cut_comp() {

// Open up trimmed and untrimmed ROOT files
std::string base_dir = "/rstorage/alice/AnalysisResults/ang/877553/";
std::string untrimmed_dir = base_dir + "Scaled_no_cut/";
std::string trimmed_dir = base_dir + "pt_trimmed_piecewise/";
std::string file_name = "AnalysisResults.root";

// Jet parameters
std::string obs = "ang";
std::string jetR = "0.2"; // "0.4";
std::string Rmax = "0.1"; // "0.25";
//std::vector<std::string> alphas = {"1", "1.5", "2", "3"};
std::vector<std::string> alphas = {"1"};

for (int pThatBin = 1; pThatBin <= 20; pThatBin++) { // loop over pT-hat bins
// Open ROOT files
TFile* file_untrimmed = new TFile((untrimmed_dir + std::to_string(pThatBin) + '/' + file_name).c_str(), "r");
TFile* file_trimmed = new TFile((trimmed_dir + std::to_string(pThatBin) + '/' + file_name).c_str(), "r");

for (const std::string & alpha : alphas) {
// Retrieve RM for making projections
std::string RM_name =
"hResponse_JetPt_" + obs + "_R" + jetR + '_' + alpha + "_Rmax" + Rmax + "Scaled";
THn* RM_untrimmed = (THn*) file_untrimmed->Get(RM_name.c_str());
RM_untrimmed->SetNameTitle("untrimmed", "untrimmed");
THn* RM_trimmed = (THn*) file_trimmed->Get(RM_name.c_str());

// Project out the x-y (pT) distributions
TH2D* pT_untrimmed = RM_untrimmed->Projection(1, 0);
TH2D* pT_trimmed = RM_trimmed->Projection(1, 0);

// Create ratio trimmed/untrimmed and write to file
TH2D* pT_ratio = (TH2D*) pT_trimmed->Clone((RM_name + "_ratio").c_str());
pT_ratio->Divide(pT_untrimmed);

const char canvas_name[] = "pT ratio trimmed/untrimmed";
TCanvas c(canvas_name, canvas_name, 700, 600);
c.Draw();

const char pad_name[] = "the pad";
TPad pad(pad_name, pad_name, 0, 0, 1, 1);
pad.SetTicks(1, 1);
pad.SetLeftMargin(0.1);
pad.SetRightMargin(0.05);
pad.Draw();

pT_ratio->Draw("colz");
gStyle->SetOptStat(0);
c.SaveAs((RM_name + "_ratio_pThat" + std::to_string(pThatBin) + ".pdf").c_str());
delete pT_untrimmed, pT_trimmed, pT_ratio;
}

file_untrimmed->Close();
file_trimmed->Close();
delete file_untrimmed, file_trimmed;
}

return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3

"""
Plotting utilities for jet substructure analysis with track dataframe.

Author: James Mulligan ([email protected])
"""

from __future__ import print_function

# General
import os
import sys
import math
import yaml

# Data analysis and plotting
import numpy as np
from array import *
import ROOT

# Base class
from pyjetty.alice_analysis.analysis.user.james import plotting_utils_base

################################################################
class PlottingUtils(plotting_utils_base.PlottingUtilsBase):

#---------------------------------------------------------------
# Constructor
#---------------------------------------------------------------
def __init__(self, output_dir = '.', config_file = '', R_max = None, thermal = False, groomer_studies = False, **kwargs):
super(PlottingUtils, self).__init__(output_dir, config_file, R_max, thermal, groomer_studies, **kwargs)

print(self)

Loading