Skip to content

Commit

Permalink
Add DeP trigger config. Allow -1 as a match depth
Browse files Browse the repository at this point in the history
  • Loading branch information
brownd1978 committed Nov 19, 2023
1 parent 1a6da4d commit 0d63d94
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
33 changes: 26 additions & 7 deletions fcl/prolog_trigger.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ BEGIN_PROLOG
TrkAnaTrigger : {
TrkAnaTT : {
@table::TrkAnaTreeMaker
candidate : {
@table::DeM
options : {
@table::AllOpt
fillHits : true
}
}
supplements : []
ExtraMCStepCollectionTags : []
diagLevel : 2
Expand All @@ -37,5 +30,31 @@ TrkAnaTrigger : {
}
}
}
TrkAnaTrigger : {
@table::TrkAnaTrigger
TrkAnaDeMTT : {
@table::TrkAnaTrigger.TrkAnaTT
candidate : {
@table::DeM
options : {
@table::AllOpt
fillHits : true
}
}
}

TrkAnaDePTT : {
@table::TrkAnaTrigger.TrkAnaTT
candidate : {
@table::DeP
options : {
@table::AllOpt
fillHits : true
}
}
}


}

END_PROLOG
4 changes: 2 additions & 2 deletions inc/SimInfo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace mu2e
// general info about the SimParticle which was simulated
struct SimInfo {
bool valid = false; // true/false as to whether the data is valid
Int_t nhits = 0; // number of matched hits in the track generated by this particle
Int_t nactive = 0; // number of active matched hits in the track generated by this particle
Int_t nhits = -1; // number of matched hits in the track generated by this particle
Int_t nactive = -1; // number of active matched hits in the track generated by this particle
Int_t rank = -1; // rank of this particle, by # of associated hits
Int_t pdg = -1; // true PDG code
Int_t proc = -1; // process code
Expand Down
19 changes: 12 additions & 7 deletions src/InfoMCStructHelper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,24 @@ namespace mu2e {
}

void InfoMCStructHelper::fillAllSimInfos(const KalSeedMC& kseedmc, const PrimaryParticle& primary, std::vector<SimInfo>& siminfos, int n_generations, int n_match) {
// interpret -1 as no llimit
if (n_generations == -1) {
n_generations = std::numeric_limits<int>::max();
}
if (n_match == -1 ) {
n_match = std::numeric_limits<int>::max();
}
for(int imatch = 0 ; imatch < std::min(n_match,static_cast<int>(kseedmc.simParticles().size())); ++imatch) {
auto trkprimaryptr = kseedmc.simParticle(imatch).simParticle(_spcH);
auto trkprimary = trkprimaryptr->originParticle();
auto current_sim_particle_ptr = trkprimaryptr;
auto current_sim_particle = trkprimary;
if (n_generations == -1) { // means do all generations
n_generations = std::numeric_limits<int>::max();
}

for (int i_generation = 0; i_generation < n_generations; ++i_generation) {
SimInfo sim_info;
fillSimInfo(current_sim_particle, sim_info);
sim_info.trkrel = MCRelationship(current_sim_particle_ptr, trkprimaryptr);
sim_info.rank = imatch;
if(i_generation == 0){
sim_info.nhits = kseedmc.simParticle(imatch)._nhits;
sim_info.nactive = kseedmc.simParticle(imatch)._nactive;
}

auto bestprimarysp = primary.primarySimParticles().front();
MCRelationship bestrel;
Expand All @@ -155,6 +155,11 @@ namespace mu2e {
}
}
sim_info.prirel = bestrel;
// only count hits for direct contributors
if(i_generation == 0){
sim_info.nhits = kseedmc.simParticle(imatch)._nhits;
sim_info.nactive = kseedmc.simParticle(imatch)._nactive;
}

siminfos.push_back(sim_info);
if (current_sim_particle.parent().isNonnull()) {
Expand Down

0 comments on commit 0d63d94

Please sign in to comment.