Skip to content

Commit c167813

Browse files
committed
Make SimpleAnalysis default; Robustness fixes
1 parent a3c7230 commit c167813

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

src/MCAnalysisManager.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ bool MCAnalysisManager::analyze(int nEvents, bool isDryrun)
156156
std::cout << "---> Event " << mCurrentEventNumber << " <---\n";
157157
std::cout << "#steps: " << mCurrentStepInfo->size() << "\n";
158158
std::cout << "#mag field calls: " << mCurrentMagCallInfo->size() << "\n";
159+
std::cout << "#vol IDs " << mCurrentLookups->volidtovolname.size() << "\n";
159160
if (!isDryrun) {
160161
std::cout << "\nStart..." << std::endl;
161162
for (auto& a : mAnalyses) {

src/MCStepLoggerImpl.cxx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ const char* getVolMapFile()
5858
}
5959
}
6060

61+
const char* getSensitiveVolFile()
62+
{
63+
if (const char* f = std::getenv("MCSTEPLOG_SENSVOLFILE")) {
64+
return f;
65+
} else {
66+
return "MCStepLoggerSenVol.dat";
67+
}
68+
}
69+
6170
// initializes a mapping from volumename to detector
6271
// used for step resolution to detectors
6372
void initVolumeMap()
@@ -76,7 +85,7 @@ void initVolumeMap()
7685
// split the line into key + value
7786
int counter = 0;
7887
std::string keyvalue[2] = { "NULL", "NULL" };
79-
while (counter < 2 && std::getline(ss, token, ' ')) {
88+
while (counter < 2 && std::getline(ss, token, ':')) {
8089
if (!token.empty()) {
8190
keyvalue[counter] = token;
8291
counter++;
@@ -216,6 +225,9 @@ class StepLogger
216225
}
217226
// try to load the volumename -> modulename mapping
218227
initVolumeMap();
228+
229+
// init the sensitive volume stuff
230+
StepInfo::lookupstructures.initSensitiveVolLookup(getSensitiveVolFile());
219231
}
220232

221233
void addStep(TVirtualMC* mc)
@@ -309,8 +321,7 @@ class StepLogger
309321
flushToTTree("Steps", &container);
310322
flushToTTree("Lookups", &StepInfo::lookupstructures);
311323
// we need to reset some parts of the lookupstructures for the next event
312-
StepInfo::lookupstructures.tracktoparent.clear();
313-
StepInfo::lookupstructures.tracktopdg.clear();
324+
StepInfo::lookupstructures.clearTrackLookups();
314325
}
315326
clear();
316327
}

src/analyseMCSteps.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "MCStepLogger/MCAnalysisManager.h"
2323
#include "MCStepLogger/MCAnalysisFileWrapper.h"
2424
#include "MCStepLogger/BasicMCAnalysis.h"
25+
#include "MCStepLogger/SimpleStepAnalysis.h"
2526

2627
using namespace o2::mcstepanalysis;
2728

@@ -89,8 +90,10 @@ int analyze(const bpo::variables_map& vm, std::string& errorMessage)
8990
const std::string analysisDir = vm["analysis-dir"].as<std::string>().c_str();
9091
registerAnalyses(analysisDir);
9192
}
92-
// create basic analysis by default, is registered automaticallyt to AnalysisManager
93-
new BasicMCAnalysis();
93+
// create simple analysis by default, is registered automatically to AnalysisManager
94+
new SimpleStepAnalysis();
95+
// new BasicMCAnalysis();
96+
9497
//////////////////////////////////////////////////////////////////////////////////////////////
9598
// List analyses and quit. This has to be done here after analyses are read from analysis-dir
9699
// the first time the AnalysisManager is needed

0 commit comments

Comments
 (0)