Skip to content

Commit

Permalink
Merge pull request #229 from areinsvo/devel
Browse files Browse the repository at this point in the history
Add val option for mtv requiring sim tracks matched to seeds
  • Loading branch information
kmcdermo authored Jul 19, 2019
2 parents cb3538a + 6c24de4 commit 9afc251
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions Config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace Config
float minFracHitsShared = 0.75;

bool mtvLikeValidation = false;
bool mtvRequireSeeds = false;
int cmsSelMinLayers = 12;
int nMinFoundHits = 10;

Expand Down
1 change: 1 addition & 0 deletions Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ namespace Config
extern int maxCandsPerEtaBin;

extern bool mtvLikeValidation;
extern bool mtvRequireSeeds;
// Selection of simtracks from CMSSW. Used in Event::clean_cms_simtracks() and MkBuilder::prep_cmsswtracks()
extern int cmsSelMinLayers;

Expand Down
21 changes: 9 additions & 12 deletions mkFit/MkBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1174,16 +1174,6 @@ void MkBuilder::prep_simtracks()
// First prep sim tracks to have hits sorted, then mark unfindable if too short
prep_reftracks(m_event->simTracks_,m_event->simTracksExtra_,false);

if (Config::mtvLikeValidation) {
// Apply MTV selection criteria and then return
for (auto& simtrack : m_event->simTracks_)
{
if (simtrack.isNotFindable()) continue; // skip ones we already know are bad
if (simtrack.prodType()!=Track::ProdType::Signal || simtrack.charge()==0 || simtrack.posR()>3.5 || std::abs(simtrack.z())>30 || std::abs(simtrack.momEta())>2.5) simtrack.setNotFindable();
}
return;
}

// Now, make sure sim track shares at least four hits with a single cmssw seed.
// This ensures we factor out any weakness from CMSSW

Expand Down Expand Up @@ -1235,8 +1225,15 @@ void MkBuilder::prep_simtracks()
}
}

// set findability based on bool isSimSeed
if (!isSimSeed) simtrack.setNotFindable();
if (Config::mtvLikeValidation) {
// Apply MTV selection criteria and then return
if (simtrack.prodType()!=Track::ProdType::Signal || simtrack.charge()==0 || simtrack.posR()>3.5 || std::abs(simtrack.z())>30 || std::abs(simtrack.momEta())>2.5) simtrack.setNotFindable();
else if(Config::mtvRequireSeeds && !isSimSeed) simtrack.setNotFindable();
}
else{
// set findability based on bool isSimSeed
if (!isSimSeed) simtrack.setNotFindable();
}
}

}
Expand Down
9 changes: 9 additions & 0 deletions mkFit/mkFit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ int main(int argc, const char *argv[])
" must enable: --dump-for-plots\n"
" --dump-for-plots make shell printouts for plots (def: %s)\n"
" --mtv-like-val configure validation to emulate CMSSW MultiTrackValidator (MTV) (def: %s)\n"
" --mtv-require-seeds configure validation to emulate MTV but require sim tracks to be matched to seeds (def: %s)\n"
"\n"
" **ROOT based options\n"
" --sim-val-for-cmssw enable ROOT based validation for CMSSW tracks with simtracks as reference [eff, FR, DR] (def: %s)\n"
Expand Down Expand Up @@ -770,6 +771,7 @@ int main(int argc, const char *argv[])
b2a(Config::quality_val),
b2a(Config::dumpForPlots),
b2a(Config::mtvLikeValidation),
b2a(Config::mtvRequireSeeds),

b2a(Config::sim_val_for_cmssw),
b2a(Config::sim_val),
Expand Down Expand Up @@ -996,6 +998,13 @@ int main(int argc, const char *argv[])
Config::cmsSelMinLayers = 0;
Config::nMinFoundHits = 0;
}
else if (*i == "--mtv-require-seeds")
{
Config::mtvLikeValidation = true;
Config::cmsSelMinLayers = 0;
Config::nMinFoundHits = 0;
Config::mtvRequireSeeds = true;
}
else if (*i == "--sim-val-for-cmssw")
{
Config::sim_val_for_cmssw = true;
Expand Down

0 comments on commit 9afc251

Please sign in to comment.