Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ defaults:
shell: bash

env:
ebeam_en: 18
pbeam_en: 275
ebeam_en: 10
pbeam_en: 100
root: root -b -q
root_no_delphes: root -b -q macro/ci/define_exclude_delphes.C

Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ DEP_LIBRARIES = $(shell root-config --glibs)
#DEP_LIBRARIES += -lMinuit -lRooFitCore -lRooFit -lRooStats -lProof -lMathMore

# Data Model (PODIO + EDM4hep + EDM4eic)
DEP_LIBRARIES += -L/usr/local/lib -ledm4hep -ledm4eic
ifdef INCLUDE_PODIO
DEP_LIBRARIES += -L/usr/local/lib -lpodio -lpodioRootIO
FLAGS += -DINCLUDE_PODIO
endif
DEP_LIBRARIES += -L/usr/local/lib -ledm4hep -ledm4eic -lpodio -lpodioRootIO

# Miscellaneous
DEP_LIBRARIES += -lfmt
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ Additional build options are available:
```bash
INCLUDE_CENTAURO=1 make # build with fastjet plugin Centauro (not included in Delphes by default!)
EXCLUDE_DELPHES=1 make # build without Delphes support; primarily used to expedite CI workflows
INCLUDE_PODIO=1 make # build with support for reading data with PODIO
```

## Quick Start: Tutorial Macros
Expand Down
2 changes: 1 addition & 1 deletion macro/ci/analysis_p_eta.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void analysis_p_eta(

// setup analysis ========================================
Analysis *A;
if (outfilePrefix.Contains("epic")) A = new AnalysisEpic( configFile, outfilePrefix );
if (outfilePrefix.Contains("epic")) A = new AnalysisEpicPodio( configFile, outfilePrefix );
else if(outfilePrefix.Contains("athena")) A = new AnalysisAthena( configFile, outfilePrefix );
else if(outfilePrefix.Contains("ecce")) A = new AnalysisEcce( configFile, outfilePrefix );
#ifndef EXCLUDE_DELPHES
Expand Down
2 changes: 1 addition & 1 deletion macro/ci/analysis_single_bin.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void analysis_single_bin(

// setup analysis ========================================
Analysis *A;
if (outfilePrefix.Contains("epic")) A = new AnalysisEpic( configFile, outfilePrefix );
if (outfilePrefix.Contains("epic")) A = new AnalysisEpicPodio( configFile, outfilePrefix );
else if(outfilePrefix.Contains("athena")) A = new AnalysisAthena( configFile, outfilePrefix );
else if(outfilePrefix.Contains("ecce")) A = new AnalysisEcce( configFile, outfilePrefix );
#ifndef EXCLUDE_DELPHES
Expand Down
2 changes: 1 addition & 1 deletion macro/ci/analysis_x_q2.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void analysis_x_q2(

// setup analysis ========================================
Analysis *A;
if (outfilePrefix.Contains("epic")) A = new AnalysisEpic( configFile, outfilePrefix );
if (outfilePrefix.Contains("epic")) A = new AnalysisEpicPodio( configFile, outfilePrefix );
else if(outfilePrefix.Contains("athena")) A = new AnalysisAthena( configFile, outfilePrefix );
else if(outfilePrefix.Contains("ecce")) A = new AnalysisEcce( configFile, outfilePrefix );
#ifndef EXCLUDE_DELPHES
Expand Down
2 changes: 1 addition & 1 deletion macro/ci/analysis_yRatio.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void analysis_yRatio(

// setup analysis ========================================
Analysis *A;
if (outfilePrefix.Contains("epic")) A = new AnalysisEpic( configFile, outfilePrefix );
if (outfilePrefix.Contains("epic")) A = new AnalysisEpicPodio( configFile, outfilePrefix );
else if(outfilePrefix.Contains("athena")) A = new AnalysisAthena( configFile, outfilePrefix );
else if(outfilePrefix.Contains("ecce")) A = new AnalysisEcce( configFile, outfilePrefix );
#ifndef EXCLUDE_DELPHES
Expand Down
31 changes: 25 additions & 6 deletions src/Analysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Analysis::Analysis(
infiles.clear();
entriesTot = 0;
errorCnt = 0;
inputTreeName = "";
};


Expand Down Expand Up @@ -205,13 +206,31 @@ void Analysis::Prepare() {
fmt::print(stderr,"ERROR: Couldn't open input file '{}'\n",fileName);
return;
}
TTree *tree = file->Get<TTree>("Delphes"); // fastsim
if (tree == nullptr) tree = file->Get<TTree>("events"); // ATHENA, ePIC
if (tree == nullptr) tree = file->Get<TTree>("event_tree"); // ECCE
if (tree == nullptr) {
fmt::print(stderr,"ERROR: Couldn't find tree in file '{}'\n",fileName);
TTree *tree = nullptr;
if(inputTreeName == "") {
// figure out which tree we are analyzing
std::vector<std::string> inputTreeNameOpts = {
"Delphes", // fastsim
"events", // ePIC, ATHENA
"event_tree" // ECCE
};
for (auto inputTreeNameOpt : inputTreeNameOpts) {
tree = file->Get<TTree>(inputTreeNameOpt.c_str());
if (tree != nullptr) {
inputTreeName = inputTreeNameOpt;
break;
}
}
if (tree == nullptr)
fmt::print(stderr,"ERROR: Couldn't find any known tree in file '{}'\n",fileName);
}
else entries += tree->GetEntries();
else {
tree = file->Get<TTree>(inputTreeName.c_str());
if (tree == nullptr)
fmt::print(stderr,"ERROR: Couldn't find tree '{}' in file '{}'\n",inputTreeName,fileName);
}
if (tree != nullptr)
entries += tree->GetEntries();
file->Close();
delete file;
}
Expand Down
1 change: 1 addition & 0 deletions src/Analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class Analysis
Long64_t entriesTot;
Long64_t errorCnt;
const TString sep = "--------------------------------------------";
std::string inputTreeName;

// setup / common settings
std::vector<std::vector<std::string> > infiles;
Expand Down
Loading