Commit c548b181 authored by Shuo Jia's avatar Shuo Jia
Browse files

Merge branch 'master' into 'shuo'

# Conflicts:
#   slurm/grep_current.sh
parents f20525bc 49d63f2f
Pipeline #1957 passed with stages
in 8 minutes and 6 seconds
#image: eicweb.phy.anl.gov:4567/whit/image_recipes/root_base:latest
image: singularityware/singularity:gitlab-3.1-slim
stages:
- data_replays
- data_tests
elastic_replay:
tags:
- eic0 docker
stage: data_replays
script:
- mkdir -p testing && cd testing
- wget https://eicweb.phy.anl.gov/jlab/hcana/-/jobs/artifacts/master/raw/build/Singularity.hcana.simg?job=hcana_singularity -O Singularity.hcana.simg
- singularity exec Singularity.hcana.simg bash ../.gitlabci/replay_elastic_data.sh
artifacts:
paths:
- testing/ROOTfiles/*
- testing/Singularity.hcana.simg
elastic_test1:
tags:
- eic0 docker
stage: data_tests
dependencies:
- elastic_replay
script:
- cd testing
- singularity exec Singularity.hcana.simg bash ../.gitlabci/elastic_test.sh
elastic_test2:
tags:
- eic0 docker
stage: data_tests
dependencies:
- elastic_replay
script:
- bash .gitlabci/dummy_test.sh
#!/bin/bash
echo "This is a test that should always succeed"
hostname
df -h
ip a
singularity --version
echo "done"
#!/bin/bash
#echo "This is the elastic testing..."
#echo " "
#echo "There are currently 0 tests to run!"
#which hcana
#
#ls -lrth
#ls -lrth build
#
#git clone git@eicweb.phy.anl.gov:jlab/hallc/exp/CSV/hallc_replay_csv.git
#git clone git@eicweb.phy.anl.gov:jlab/hallc/exp/CSV/online_csv.git
#cd online_csv
#ln -s ../hallc_reaply_csv/PARAM
## and the reset
#
#mkdir raw
#pushd raw
# wget coin.dat
#popd
hcana .gitlabci/elastic_test.cxx || exit $?
#!/bin/bash
echo "This is the elastic testing..."
echo " "
echo "There are currently 0 tests to run!"
which hcana
ls -lrth
ls -lrth build
mkdir -p ROOTfiles
git clone https://eicweb.phy.anl.gov/whit/ci_test_data.git
git clone https://eicweb.phy.anl.gov/jlab/hallc/exp/CSV/hallc_replay_csv.git
git clone https://eicweb.phy.anl.gov/jlab/hallc/exp/CSV/offline_csv.git
cd offline_csv
mkdir -p logs
ln -s ../hallc_replay_csv/PARAM
ln -s ../hallc_replay_csv/DBASE
ln -s ../hallc_replay_csv/CALIBRATION
ln -s ../hallc_replay_csv/DEF-files
ln -s ../hallc_replay_csv/MAPS
ln -s ../hallc_replay_csv/SCRIPTS
ln -s ../hallc_replay_csv/DATFILES
ln -s ../ci_test_data/raw
ln -s ../ROOTfiles
# and the reset
ls -lrth
ls -lrth raw/
ls -lrth ROOTfiles/
pwd
# run replay script
df -h
hcana -b -q "scripts/replay_production_coin.cxx(6012,50000)"
echo "hcana calls... the coin replay script and outputs blah.root"
......@@ -6,6 +6,7 @@ function print_the_help {
echo " OPTIONS: "
echo " -r,--run Required run number"
echo " -n,--n-events Required number of events (appears in output rootfile name)"
echo " -j,--jlab Run on the JLab farm"
#echo " -o,--online-only Log online only"
#echo " -a,--all Log all plots (online, detectors, physics)"
#echo " -n,--no-log Do not submit any log entries"
......@@ -26,6 +27,7 @@ function yes_or_no {
run_number=
n_events=-1
container=
jlab_farm=
if [[ $# -eq 0 ]] ; then
print_the_help
......@@ -52,11 +54,11 @@ do
shift # past argument
shift # past value
;;
#-c|--container)
# container=1
# #shift # past argument
# shift # past value
# ;;
-j|--jlab)
jlab_farm=1
#shift # past argument
shift # past value
;;
#-a|--all)
# LOG_ALL_PLOTS=1
# shift # past argument
......@@ -89,24 +91,26 @@ fi
# exit
#fi
if [[ -n ${jlab_farm} ]] ; then
source /group/c-csv/local/setup.sh
# For some reason the module files need to put in a specific order.
# This is probably because we are using the old TCL version.
module unload csv/dev
module load csv/dev
module load tmux/latest
module load python/latest
module load python/2.7.15
module load python3/latest
module load vim/latest
module load git/latest
module load ruby/2.5.3
#module unload csv/dev
#module load csv/dev
#module load tmux/latest
#module load python/latest
#module load python/2.7.15
#module load python3/latest
#module load vim/latest
#module load git/latest
#module load ruby/2.5.3
fi
hcana -b -q "scripts/replay_production_coin.cxx(${run_number},${n_events})"
./bin/do_good_coin -I -r ${run_number}
#./bin/do_good_coin -I -r ${run_number}
#root -b -q "scripts/good_jpsi_counter.cxx(${run_number})"
#sleep 1
......
This diff is collapsed.
This diff is collapsed.
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
This diff is collapsed.
#include "ROOT/RDataFrame.hxx"
#include "ROOT/RVec.hxx"
#include "Math/Vector3D.h"
#include "Math/Vector4D.h"
#include "TCanvas.h"
R__LOAD_LIBRARY(libMathMore.so)
R__LOAD_LIBRARY(libGenVector.so)
#include "monitor/DetectorDisplay.h"
#include "monitor/DisplayPlots.h"
#include "monitor/MonitoringDisplay.h"
//#include "monitor/ExperimentMonitor.h"
//#include "scandalizer/PostProcessors.h"
R__LOAD_LIBRARY(libScandalizer.so)
#include <fmt/core.h>
R__LOAD_LIBRARY(libfmt.so)
using RDFNode = decltype(ROOT::RDataFrame{0}.Filter(""));
using Histo1DProxy =
decltype(ROOT::RDataFrame{0}.Histo1D(ROOT::RDF::TH1DModel{"", "", 128u, 0., 0.}, ""));
struct RDFInfo {
RDFNode& df;
const std::string title;
RDFInfo(RDFNode& df, std::string_view title) : df{df}, title{title} {}
};
// =================================================================================
// Cuts
// =================================================================================
std::string track_cut = "P_gtr_dp > -10 && P_gtr_dp < 22"
"&& H_gtr_dp > -8 && H_gtr_dp < 8 ";
std::string cal_cut = "P_cal_etottracknorm > .08 && P_cal_etottracknorm < 0.25 "
"&& H_cal_etottracknorm < 0.1 && P_cal_eprtracknorm < .07"
"&& H_cal_etottracknorm < 0.1 && P_cal_eprtracknorm < .07"
;
// No cut on HMS E/p for now
// std::string cher_cut = "P_ngcer_npeSum > .5 && H_cer_npeSum > -1.";
std::string cher_cut = "P_ngcer_npeSum > -1.5 && H_cer_npeSum > 0.01 "
" && H_cal_1pr_eplanenorm < 0.04 "
" && H_cal_2ta_eplanenorm < 0.04 "
" && H_cal_3ta_eplanenorm < 0.04 "
" && H_cal_4ta_eplanenorm < 0.04 ";
std::string jpsi_cut = "M_jpsi > 3.07 && M_jpsi < 3.105";
// =================================================================================
// Definitions
// =================================================================================
using Pvec4D = ROOT::Math::PxPyPzMVector;
void muons(const std::string& setting = "phase1") {
const std::string skim_file = fmt::format("results/skim/skim_coinmu_{}.root", setting);
std::cout << "Looking for mu+mu- coincidence event in: " << skim_file << "\n";
// ===============================================================================================
// Dataframe
// ===============================================================================================
ROOT::EnableImplicitMT(24);
//---------------------------------------------------------------------------
// Detector tree
ROOT::RDataFrame d0("Tjpsi", skim_file);
auto d = d0.Define("H_cal_1pr_eplanenorm", "H_cal_1pr_eplane/p_muplus.P()")
.Define("H_cal_2ta_eplanenorm", "H_cal_2ta_eplane/p_muplus.P()")
.Define("H_cal_3ta_eplanenorm", "H_cal_3ta_eplane/p_muplus.P()")
.Define("H_cal_4ta_eplanenorm", "H_cal_4ta_eplane/p_muplus.P()");
// cuts
auto d_track = d.Filter(track_cut);
auto d_cal = d_track.Filter(cal_cut);
auto d_cer = d_cal.Filter(cher_cut);
auto d_jpsi = d_cer.Filter(jpsi_cut);
// Data frame index
std::vector<std::pair<std::string, RDFInfo>> dfs = {{"1. delta", {d_track, "Cuts: + Delta"}},
{"2. cal", {d_cal, "Cuts: + E/P"}},
{"3. cer", {d_cer, "Cuts: + Cherenkov"}},
{"4. jpsi", {d_jpsi, "Cuts: + J/psi"}}};
// =========================================================================================
// Histograms
// =========================================================================================
using HistoMap = std::map<std::string, Histo1DProxy>;
using HistoMapMap = std::map<std::string, HistoMap>;
#if 0
HistoMap hP_dp;
HistoMap hH_dp;
HistoMap hP_ph;
HistoMap hH_ph;
HistoMap hP_th;
HistoMap hH_th;
HistoMap hP_y;
HistoMap hH_y;
HistoMap hP_cal_ep;
HistoMap hP_cal_pre;
HistoMap hH_cal_ep;