Commit in projects/slic/branches/v04-01-00-pre on MAIN | |||
include/LcioManager.hh | +6 | -8 | 3231 -> 3232 |
src/LcioFileNamer.cc | +4 | -4 | 3231 -> 3232 |
/LcioManager.cc | +18 | -14 | 3231 -> 3232 |
+28 | -26 |
Fix for SLIC-240 where run number was not set correctly in autoname.
--- projects/slic/branches/v04-01-00-pre/include/LcioManager.hh 2014-08-05 22:57:40 UTC (rev 3231) +++ projects/slic/branches/v04-01-00-pre/include/LcioManager.hh 2014-08-05 23:33:23 UTC (rev 3232) @@ -50,14 +50,12 @@
* Enum for setting what action to take when an output LCIO file already exists. */ enum EFileExistsAction {
- eInvalid = -1, eFail = 0, eDelete = 1, eAppend = 2
+ eInvalid = -1, + eFail = 0, + eDelete = 1, + eAppend = 2
};
- /** - * Typedef for run number. - */ - typedef unsigned int RunNumberType; -
public: /**
@@ -110,7 +108,7 @@
* Set the current run number. * @param[in] runNumber The run number. */
- void setRunNumber(RunNumberType runNumber);
+ void setRunNumber(int runNumber);
/** * Begin of run hook.
@@ -316,7 +314,7 @@
EFileExistsAction m_fileExistsAction; // starting run number
- RunNumberType m_runNumber;
+ int m_runNumber;
LcioFileNamer* m_namer;
--- projects/slic/branches/v04-01-00-pre/src/LcioFileNamer.cc 2014-08-05 22:57:40 UTC (rev 3231) +++ projects/slic/branches/v04-01-00-pre/src/LcioFileNamer.cc 2014-08-05 23:33:23 UTC (rev 3232) @@ -44,17 +44,17 @@
static std::string sep("-");
- if (field == "application" || field == "app") {
+ if (field == "application") {
value = PackageInfo::getShortName() + "-v" + PackageInfo::getVersion(sep);
- } else if (field == "geometry" || field == "geo") {
+ } else if (field == "geometry") {
value = LCDDProcessor::instance()->getDetectorName(); } else if (field == "date") { value = TimeUtil::getDate(); } else if (field == "event" || field == "evt") { value = LcioFileNamer::makeEventName();
- } else if (field == "eventNumber" || field == "evtNum") {
+ } else if (field == "eventNumber") {
value = LcioFileNamer::makeEventNumberString();
- } else if (field == "run" || field == "runNumber" || field == "runNum") {
+ } else if (field == "run") {
value = LcioFileNamer::makeRunNumberString(); } else if (field == "binary") { value = SlicApplication::instance()->getBinaryBasename();
--- projects/slic/branches/v04-01-00-pre/src/LcioManager.cc 2014-08-05 22:57:40 UTC (rev 3231) +++ projects/slic/branches/v04-01-00-pre/src/LcioManager.cc 2014-08-05 23:33:23 UTC (rev 3232) @@ -52,8 +52,15 @@
string LcioManager::m_defaultFileName = "slicEvents"; LcioManager::LcioManager() :
- Module("LcioManager"), m_writer(0), m_runHdr(0), m_fileExistsAction(LcioManager::eFail), - m_runNumber(0), m_enableDumpEvent(false), m_writerIsOpen(false), m_usingAutoname(false) {
+ Module("LcioManager"), + m_writer(NULL), + m_runHdr(NULL), + m_fileExistsAction(LcioManager::eFail), + m_runNumber(0), + m_enableDumpEvent(false), + m_writerIsOpen(false), + m_usingAutoname(false) { +
// Initialize the Geant4 UI messenger for the LCIO. m_messenger = new LcioMessenger(this);
@@ -143,10 +150,9 @@
return fea; }
-void LcioManager::setRunNumber(RunNumberType rnt) { - m_runNumber = rnt; - - log().verbose("Set starting run number <" + StringUtil::toString((int) m_runNumber) + ">");
+void LcioManager::setRunNumber(int runNumber) { + m_runNumber = runNumber; + log().verbose("Set starting run number <" + StringUtil::toString((int) runNumber) + ">");
} void LcioManager::createWriter() {
@@ -191,19 +197,17 @@
void LcioManager::beginRun(const G4Run* aRun) {
- // Automatically create LCIO output file name if option was selected. - if (m_usingAutoname) { - makeAutoname(); - } -
// Set the G4Run counter.
- G4RunManager::GetRunManager()->SetRunIDCounter(m_runNumber);
+ G4RunManager::GetRunManager()->GetNonConstCurrentRun()->SetRunID(m_runNumber);
+ // Automatically create LCIO output file name if option was selected. + if (m_usingAutoname) { + makeAutoname(); + } +
// Open the LCIO output file for writing. openLcioFile();
- //std::cout << "abortCurrentRun = " << m_abortCurrentRun << std::endl; -
// Run aborted, because LCIO output file already exists. if (!RunManager::instance()->isRunAborted()) {
Use REPLY-ALL to reply to list
To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1