Skip to content

Commit

Permalink
Merge pull request #315 from trackreco/json-save-and-load
Browse files Browse the repository at this point in the history
Implement saving of configuration to a set of JSON files, one per iteration.
  • Loading branch information
osschar authored May 16, 2021
2 parents 257d037 + 77861c5 commit 8ac7fe2
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 74 deletions.
11 changes: 7 additions & 4 deletions Config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ namespace Config
bool backwardFit = false;
bool includePCA = false;

bool json_patch_dump_before = false;
bool json_patch_dump_after = false;
bool json_patch_verbose = false;
std::string json_patch_filename;
bool json_dump_before = false;
bool json_dump_after = false;
bool json_verbose = false;
std::vector<std::string> json_patch_filenames;
std::vector<std::string> json_load_filenames;
std::string json_save_iters_fname_fmt;
bool json_save_iters_include_iter_info_preamble = false;

void RecalculateDependentConstants()
{
Expand Down
11 changes: 7 additions & 4 deletions Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,13 @@ namespace Config

// ================================================================

extern bool json_patch_dump_before;
extern bool json_patch_dump_after;
extern bool json_patch_verbose;
extern std::string json_patch_filename;
extern bool json_dump_before;
extern bool json_dump_after;
extern bool json_verbose;
extern std::vector<std::string> json_patch_filenames;
extern std::vector<std::string> json_load_filenames;
extern std::string json_save_iters_fname_fmt;
extern bool json_save_iters_include_iter_info_preamble;

// ================================================================

Expand Down
19 changes: 19 additions & 0 deletions Track.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@ bool TrackBase::hasSillyValues(bool dump, bool fix, const char* pref)
return is_silly;
}

const char* TrackBase::algoint_to_cstr(int algo)
{
static const char* names[] = { "undefAlgorithm", "ctf", "duplicateMerge",
"cosmics", "initialStep", "lowPtTripletStep", "pixelPairStep", "detachedTripletStep",
"mixedTripletStep", "pixelLessStep", "tobTecStep", "jetCoreRegionalStep", "conversionStep",
"muonSeededStepInOut", "muonSeededStepOutIn", "outInEcalSeededConv", "inOutEcalSeededConv",
"nuclInter", "standAloneMuon", "globalMuon", "cosmicStandAloneMuon", "cosmicGlobalMuon",
"highPtTripletStep", "lowPtQuadStep", "detachedQuadStep", "reservedForUpgrades1",
"reservedForUpgrades2", "bTagGhostTracks", "beamhalo", "gsf", "hltPixel", "hltIter0",
"hltIter1", "hltIter2", "hltIter3", "hltIter4", "hltIterX", "hiRegitMuInitialStep",
"hiRegitMuLowPtTripletStep", "hiRegitMuPixelPairStep", "hiRegitMuDetachedTripletStep",
"hiRegitMuMixedTripletStep", "hiRegitMuPixelLessStep", "hiRegitMuTobTecStep",
"hiRegitMuMuonSeededStepInOut", "hiRegitMuMuonSeededStepOutIn", "algoSize" };

if (algo < 0 || algo >= (int) TrackAlgorithm::algoSize) return names[0];
return names[algo];
}


//==============================================================================
// Track
//==============================================================================
Expand Down
2 changes: 2 additions & 0 deletions Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ class TrackBase
// bool isStopped() const { return status_.stopped; }
// void setStopped() { status_.stopped = true; }

static const char* algoint_to_cstr(int algo);

// ------------------------------------------------------------------------

protected:
Expand Down
Loading

0 comments on commit 8ac7fe2

Please sign in to comment.