Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include cluster information in AnalysisEpic #288

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
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
14 changes: 11 additions & 3 deletions s3tools/s3tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
require 'fileutils'

# default versions
VersionLatest = 'epic.23.06.1'
VersionPrevious = 'epic.23.05.2'
VersionLatest = 'epic.23.07.1'
VersionPrevious = 'epic.23.06.1'

# default CLI options
options = OpenStruct.new
Expand All @@ -19,7 +19,7 @@
options.mode = 's'
options.limit = 2
options.configFile = ''
options.detector = 'arches'
options.detector = 'brycecanyon'
options.radCor = false
options.minQ2 = -1
options.maxQ2 = -1
Expand Down Expand Up @@ -50,6 +50,13 @@ def ecceQ2range(minQ2,maxQ2) # return file path suffix, for ECCE Q2 ranges
# :fileExtension => File extension (optional, defaults to 'root')
# }
prodSettings = {
'epic.23.07.1' => {
:comment => 'Pythia 8: high-stats July 2023 production',
:crossSectionID => Proc.new { |minQ2| "pythia8:#{options.energy}/minQ2=#{minQ2}" },
:releaseSubDir => Proc.new { "S3/eictest/EPIC/RECO/#{versionNum(options.version)}/epic_#{options.detector}/DIS/NC" },
:energySubDir => Proc.new { "#{options.energy}" },
:dataSubDir => Proc.new { |minQ2| "minQ2=#{minQ2}" },
},
'epic.23.06.1' => {
:comment => 'Pythia 8: high-stats June 2023 production',
:crossSectionID => Proc.new { |minQ2| "pythia8:#{options.energy}/minQ2=#{minQ2}" },
Expand Down Expand Up @@ -388,6 +395,7 @@ def mc_cp(srcfile,tgtdir)

# pattern: "#{energy}/minQ2=#{minQ2}/"
elsif [
'epic.23.07.1',
'epic.23.06.1',
'epic.23.05.2',
'epic.23.05.1',
Expand Down
26 changes: 13 additions & 13 deletions src/AnalysisEpic.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ void AnalysisEpic::Execute()
TTreeReaderArray<Float_t> mcpart_psx(tr, "MCParticles.momentum.x");
TTreeReaderArray<Float_t> mcpart_psy(tr, "MCParticles.momentum.y");
TTreeReaderArray<Float_t> mcpart_psz(tr, "MCParticles.momentum.z");


// Reco tracks
TTreeReaderArray<Int_t> recparts_type(tr, "ReconstructedChargedParticles.type"); // needs to be made an int eventually in actual EE code
TTreeReaderArray<Float_t> recparts_e(tr, "ReconstructedChargedParticles.energy");
TTreeReaderArray<Float_t> recparts_p_x(tr, "ReconstructedChargedParticles.momentum.x");
TTreeReaderArray<Float_t> recparts_p_y(tr, "ReconstructedChargedParticles.momentum.y");
TTreeReaderArray<Float_t> recparts_p_z(tr, "ReconstructedChargedParticles.momentum.z");
TTreeReaderArray<Int_t> recparts_PDG(tr, "ReconstructedChargedParticles.PDG");
TTreeReaderArray<Float_t> recparts_CHI2PID(tr, "ReconstructedChargedParticles.goodnessOfPID");
TTreeReaderArray<Int_t> recparts_type(tr, "ReconstructedParticles.type"); // needs to be made an int eventually in actual EE code
TTreeReaderArray<Float_t> recparts_e(tr, "ReconstructedParticles.energy");
TTreeReaderArray<Float_t> recparts_p_x(tr, "ReconstructedParticles.momentum.x");
TTreeReaderArray<Float_t> recparts_p_y(tr, "ReconstructedParticles.momentum.y");
TTreeReaderArray<Float_t> recparts_p_z(tr, "ReconstructedParticles.momentum.z");
TTreeReaderArray<Int_t> recparts_PDG(tr, "ReconstructedParticles.PDG");
TTreeReaderArray<Float_t> recparts_CHI2PID(tr, "ReconstructedParticles.goodnessOfPID");

// RecoAssociations
std::string assoc_branch_name = "ReconstructedChargedParticleAssociations";
std::string assoc_branch_name = "ReconstructedParticleAssociations";
if(listOfBranches->FindObject(assoc_branch_name.c_str()) == nullptr)
assoc_branch_name = "ReconstructedChargedParticlesAssociations"; // productions before 23.5
assoc_branch_name = "ReconstructedParticlesAssociations"; // productions before 23.5
TTreeReaderArray<UInt_t> assoc_simID(tr, (assoc_branch_name+".simID").c_str());
TTreeReaderArray<UInt_t> assoc_recID(tr, (assoc_branch_name+".recID").c_str());
TTreeReaderArray<Float_t> assoc_weight(tr, (assoc_branch_name+".weight").c_str());

// calculate Q2 weights
CalculateEventQ2Weights();

Expand Down Expand Up @@ -301,8 +301,8 @@ void AnalysisEpic::Execute()
};

// calculate DIS kinematics
if(!(kin->CalculateDIS(reconMethod))) continue; // reconstructed
if(!(kinTrue->CalculateDIS(reconMethod))) continue; // generated (truth)
if(!(kin->CalculateDIS(reconMethod))) continue; // reconstructed
if(!(kinTrue->CalculateDIS("ele"))) continue; // generated (truth)

// Get the weight for this event's Q2
auto Q2weightFactor = GetEventQ2Weight(kinTrue->Q2, inLookup[chain->GetTreeNumber()]);
Expand Down