Skip to content

Commit

Permalink
Merge pull request #140 from tannerbk/mcindex
Browse files Browse the repository at this point in the history
add mcid to ntuple
  • Loading branch information
tannerbk authored Jul 11, 2024
2 parents 07d87fa + da70cd5 commit a99058e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/io/include/RAT/OutNtupleProc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class OutNtupleProc : public Processor {
std::vector<double> mcpecharge;
// MCParticles
int mcpcount;
int mcid;
std::vector<Int_t> pdgcodes;
std::vector<double> mcKEnergies;
std::vector<double> mcPosx;
Expand Down
2 changes: 2 additions & 0 deletions src/io/src/OutNtupleProc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ bool OutNtupleProc::OpenFile(std::string filename) {
outputTree->Branch("nhits", &nhits);
outputTree->Branch("triggerTime", &triggerTime);
// MC Information
outputTree->Branch("mcid", &mcid);
outputTree->Branch("mcparticlecount", &mcpcount);
outputTree->Branch("mcpecount", &mcpecount);
outputTree->Branch("mcnhits", &mcnhits);
Expand Down Expand Up @@ -187,6 +188,7 @@ Processor::Result OutNtupleProc::DSEvent(DS::Root *ds) {
mcTime.clear();

DS::MC *mc = ds->GetMC();
mcid = mc->GetID();
mcpcount = mc->GetMCParticleCount();
for (int pid = 0; pid < mcpcount; pid++) {
DS::MCParticle *particle = mc->GetMCParticle(pid);
Expand Down

0 comments on commit a99058e

Please sign in to comment.