Skip to content

Commit

Permalink
Merge pull request #82 from JeffersonLab/develop
Browse files Browse the repository at this point in the history
Bring master up to date with develop
  • Loading branch information
paulmking authored Mar 23, 2019
2 parents 4d495cb + 0042196 commit c1831af
Show file tree
Hide file tree
Showing 283 changed files with 5,216 additions and 843 deletions.
Empty file modified Analysis/include/MQwCodaControlEvent.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/MQwF1TDC.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/MQwHistograms.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/MQwMockable.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/MQwV775TDC.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwADC18_Channel.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwColor.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwDatabase.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwEPICSEvent.h
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions Analysis/include/QwEventBuffer.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ class QwEventBuffer: public MQwCodaControlEvent{
Int_t GetEvent();
Int_t WriteEvent(int* buffer);

Bool_t IsOnline(){return fOnline;};

Bool_t IsROCConfigurationEvent(){
return (fEvtType>=0x90 && fEvtType<=0xaf);
};
Expand Down
Empty file modified Analysis/include/QwF1TDContainer.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwF1TDContainerLinkDef.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwFactory.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwHistogramHelper.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwInterpolator.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwLog.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwObjectCounter.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwOmnivore.h
100755 → 100644
Empty file.
16 changes: 3 additions & 13 deletions Analysis/include/QwOptions.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -189,25 +189,15 @@ class QwOptions {
void SetCommandLine(int argc, char* argv[], bool default_config_file = true);

/// \brief Set a configuration file
void SetConfigFile(const std::string& configfile) {
fConfigFiles.clear();
fConfigFiles.push_back(configfile);
fParsed = false;
};
void SetConfigFile(const std::string& configfile);

/// \brief Add a configuration file
void AddConfigFile(const std::string& configfile) {
QwMessage << "Adding user-defined configuration file "
<< configfile << QwLog::endl;
fConfigFiles.push_back(configfile);
fParsed = false;
};
void AddConfigFile(const std::string& configfile);

/// \brief Add some configuration files
void AddConfigFile(std::vector<std::string> configfiles) {
for (size_t i = 0; i < configfiles.size(); i++)
fConfigFiles.push_back(configfiles.at(i));
fParsed = false;
AddConfigFile(configfiles.at(i));
};

/// \brief List the configuration files
Expand Down
Empty file modified Analysis/include/QwPMT_Channel.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwParameterFile.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwPromptSummary.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwPromptSummaryLinkDef.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwRint.h
100755 → 100644
Empty file.
27 changes: 24 additions & 3 deletions Analysis/include/QwRootFile.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class QwRootTree {
}
}

Long64_t AutoSave(Option_t *option){
return fTree->AutoSave(option);
}

/// Fill the tree
Int_t Fill() {
fCurrentEvent++;
Expand Down Expand Up @@ -330,7 +334,7 @@ class QwRootFile {
// Update regularly
static Int_t update_count = 0;
update_count++;
if (update_count % fUpdateInterval == 0) Update();
if ((fUpdateInterval > 0) && ( update_count % fUpdateInterval == 0)) Update();
if (! HasDirByType(object)) return;
// Fill histograms
object.FillHistograms();
Expand Down Expand Up @@ -409,7 +413,24 @@ class QwRootFile {


// Wrapped functionality
void Update() { if (fMapFile) fMapFile->Update(); } // not for TFile
void Update() {
if (fMapFile) {
QwMessage << "TMapFile memory resident size: "
<< ((int*)fMapFile->GetBreakval() - (int*)fMapFile->GetBaseAddr()) *
4 / sizeof(int32_t) / 1024 / 1024 << " MiB"
<< QwLog::endl;
fMapFile->Update();
}else{
// this option will allow for reading the tree during write
Long64_t nBytes(0);
for (auto iter = fTreeByName.begin(); iter != fTreeByName.end(); iter++)
nBytes += iter->second.front()->AutoSave("SaveSelf");

QwMessage << "TFile saved: "
<< nBytes/1000000 << "MB (innacurate number)" //FIXME this calculation is innacurate
<< QwLog::endl;
}
}
void Print() { if (fMapFile) fMapFile->Print(); if (fRootFile) fRootFile->Print(); }
void ls() { if (fMapFile) fMapFile->ls(); if (fRootFile) fRootFile->ls(); }
void Map() { if (fRootFile) fRootFile->Map(); }
Expand Down Expand Up @@ -632,7 +653,7 @@ void QwRootFile::ConstructTreeBranches(
tree->SetBasketSize(fBasketSize);
tree->SetMaxTreeSize(kMaxTreeSize);

if (fEnableMapFile && fCircularBufferSize > 0)
if (fCircularBufferSize > 0)
tree->SetCircular(fCircularBufferSize);

} else {
Expand Down
Empty file modified Analysis/include/QwRunCondition.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwSIS3320_Accumulator.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwSIS3320_LogicalAccumulator.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwSIS3320_Samples.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwSIS3320_SamplesLinkDef.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwScaler_Channel.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwSubsystemArray.h
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions Analysis/include/QwTypes.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class TString;
// Types for the ROC_ID and Bank_ID used in decoding and destributing data
typedef UInt_t ROCID_t;
typedef ULong64_t BankID_t; /// Bank ID will combine both bank and marker words
static const ROCID_t kNullROCID = kMaxUInt;
static const BankID_t kNullBankID = kMaxULong64;


// Enumerator types for regions and directions
Expand Down
Empty file modified Analysis/include/QwUnits.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwVQWK_Channel.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/QwWord.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/VQwAnalyzer.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/VQwDataElement.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/VQwDataserver.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/VQwHardwareChannel.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/VQwSubsystem.h
100755 → 100644
Empty file.
Empty file modified Analysis/include/VQwSystem.h
100755 → 100644
Empty file.
Empty file modified Analysis/main/QwRoot.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/MQwCodaControlEvent.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/MQwF1TDC.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/MQwMockable.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/MQwV775TDC.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwADC18_Channel.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwColor.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwDatabase.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwEPICSEvent.cc
100755 → 100644
Empty file.
25 changes: 21 additions & 4 deletions Analysis/src/QwEventBuffer.cc
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ const UInt_t QwEventBuffer::kNullDataWord = 0x4e554c4c;

/// Default constructor
QwEventBuffer::QwEventBuffer()
: fDataFileStem(fDefaultDataFileStem),
: fRunListFile(NULL),
fDataFileStem(fDefaultDataFileStem),
fDataFileExtension(fDefaultDataFileExtension),
fEvStreamMode(fEvStreamNull),
fEvStream(NULL),
fRunListFile(NULL),
fCurrentRun(-1),
fRunIsSegmented(kFALSE),
fPhysicsEventFlag(kFALSE),
Expand Down Expand Up @@ -90,7 +90,7 @@ void QwEventBuffer::DefineOptions(QwOptions &options)
"run range in format #[:#]");
options.AddDefaultOptions()
("runlist", po::value<string>()->default_value(""),
"run list file example \n[5253]\n 234\n 246\n 256\n 345:456\n 567:789\n [5259]\n [5260]\n 0:10000\n [5261:5270]\n 9000:10000\n- for run 5253 it will analyze three individual events, and two event ranges \n- for run 5259 it will analyze the entire run (all segments) \n- for run 5260 it will analyze the first 10000 events \n- for runs 5261 through 5270 it will analyze the events 9000 through 10000)");
"run list file name");
options.AddDefaultOptions()
("event,e", po::value<string>()->default_value("0:"),
"event range in format #[:#]");
Expand Down Expand Up @@ -177,6 +177,23 @@ void QwEventBuffer::ProcessOptions(QwOptions &options)
fAllowLowSubbankIDs = options.GetValue<bool>("allow-low-subbank-ids");

// Open run list file
/* runlist file format example:
[5253]
234
246
256
345:456
567:789
[5259]
[5260]
0:10000
[5261:5270]
9000:10000
- for run 5253 it will analyze three individual events, and two event ranges
- for run 5259 it will analyze the entire run (all segments)
- for run 5260 it will analyze the first 10000 events
- for runs 5261 through 5270 it will analyze the events 9000 through 10000)
*/
if (fRunListFileName.size() > 0) {
fRunListFile = new QwParameterFile(fRunListFileName);
fEventListFile = 0;
Expand Down Expand Up @@ -815,7 +832,7 @@ Bool_t QwEventBuffer::FillSubsystemData(QwSubsystemArray &subsystems)
for (size_t i=0; i<nmarkers; i++){
offset = FindMarkerWord(i,&localbuff[fWordsSoFar],fFragLength);
BankID_t tmpbank = GetMarkerWord(i);
tmpbank = (tmpbank)<<32 + fSubbankTag;
tmpbank = ((tmpbank)<<32) + fSubbankTag;
if (offset != -1){
offset++; // Skip the marker word
subsystems.ProcessEvBuffer(fEvtType, fROC, tmpbank,
Expand Down
Empty file modified Analysis/src/QwF1TDContainer.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwHistogramHelper.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwLog.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwOmnivore.cc
100755 → 100644
Empty file.
45 changes: 40 additions & 5 deletions Analysis/src/QwOptions.cc
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ QwOptions::QwOptions()
AddDefaultOptions()("help,h", "print this help message");
AddDefaultOptions()("version,V", "print the version string");
AddDefaultOptions()("config,c", po::value<std::string>(), "read ONLY this config file\n(will override default config files)");
AddDefaultOptions()("add-config,a", po::value<std::vector<std::string> >(), "read ALSO this config file\n(will keep the default config files)");
AddDefaultOptions()("add-config,a", po::value<std::vector<std::string> >()->composing(), "read ALSO this config file\n(will keep the default config files)");
}

/**
Expand Down Expand Up @@ -143,7 +143,41 @@ void QwOptions::SetCommandLine(int argc, char* argv[], bool default_config_file)
}
}

/**
* Set the named configuration file as the first (and initially only)
* one in the list.
* @param configfile Name of the config file, without path
*/
void QwOptions::SetConfigFile(const std::string& configfile)
{
QwWarning << "Overriding the default configuration files with "
<< "user-defined configuration file "
<< configfile.c_str() << QwLog::endl;
fConfigFiles.clear();
fConfigFiles.push_back(configfile);
fParsed = false;
};

/**
* Add the named configuration file to the list.
* @param configfile Name of the config file, without path
*/
void QwOptions::AddConfigFile(const std::string& configfile)
{
Bool_t notfound = kTRUE;
for (size_t i = 0; i < fConfigFiles.size(); i++){
if (fConfigFiles.at(i) == configfile){
notfound=kFALSE;
break;
}
}
if (notfound){
QwMessage << "Adding user-defined configuration file "
<< configfile.c_str() << QwLog::endl;
fConfigFiles.push_back(configfile);
fParsed = false;
}
};

/**
* Combine the options of the various option descriptions in one object for
Expand Down Expand Up @@ -215,14 +249,10 @@ void QwOptions::ParseCommandLine()

// If a configuration file is specified, load it.
if (fVariablesMap.count("config") > 0) {
QwWarning << "Overriding the default configuration files with "
<< "user-defined configuration file "
<< fVariablesMap["config"].as<std::string>() << QwLog::endl;
SetConfigFile(fVariablesMap["config"].as<std::string>());
}
// If a configuration file is specified, load it.
if (fVariablesMap.count("add-config") > 0) {
QwWarning << "Adding user-defined configuration file " << QwLog::endl;
AddConfigFile(fVariablesMap["add-config"].as<std::vector<std::string> >());
}
}
Expand Down Expand Up @@ -281,6 +311,11 @@ void QwOptions::ParseConfigFile()
}
// Notify of new options
po::notify(fVariablesMap);

// If a configuration file is specified, load it.
if (fVariablesMap.count("add-config") > 0) {
AddConfigFile(fVariablesMap["add-config"].as<std::vector<std::string> >());
}
}
}

Expand Down
Empty file modified Analysis/src/QwPMT_Channel.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwParameterFile.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwPromptSummary.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwRint.cc
100755 → 100644
Empty file.
11 changes: 5 additions & 6 deletions Analysis/src/QwRootFile.cc
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@
std::string QwRootFile::fDefaultRootFileStem = "Qweak_";

const Long64_t QwRootFile::kMaxTreeSize = 100000000000LL;
//const Int_t QwRootFile::kMaxMapFileSize = 0x20000000; // 512 MiB
const Int_t QwRootFile::kMaxMapFileSize = 0x10000000; // 256 MiB
const Int_t QwRootFile::kMaxMapFileSize = 0x3fffffff; // 1 GiB

/**
* Constructor with relative filename
*/
QwRootFile::QwRootFile(const TString& run_label)
: fRootFile(0), fMakePermanent(0),
fMapFile(0), fEnableMapFile(kFALSE),
fUpdateInterval(400)
fUpdateInterval(-1)
{
// Process the configuration options
ProcessOptions(gQwOptions);
Expand All @@ -36,7 +35,7 @@ QwRootFile::QwRootFile(const TString& run_label)

mapfilename += "/QwMemMapFile.map";

fMapFile = TMapFile::Create(mapfilename,"RECREATE", kMaxMapFileSize, "RealTime Producer File");
fMapFile = TMapFile::Create(mapfilename,"UPDATE", kMaxMapFileSize, "RealTime Producer File");

if (not fMapFile) {
QwError << "Memory-mapped file " << mapfilename
Expand Down Expand Up @@ -178,7 +177,7 @@ void QwRootFile::DefineOptions(QwOptions &options)
// Define the memory map option
options.AddOptions()
("enable-mapfile", po::value<bool>()->default_bool_value(false),
"enable output to memory-mapped file");
"enable output to memory-mapped file\n(likely requires circular-buffer too)");

// Define the histogram and tree options
options.AddOptions("ROOT output options")
Expand Down Expand Up @@ -216,7 +215,7 @@ void QwRootFile::DefineOptions(QwOptions &options)
("num-hel-discarded-events", po::value<int>()->default_value(0),
"number of discarded consecutive pattern events");
options.AddOptions("ROOT output options")
("mapfile-update-interval", po::value<int>()->default_value(400),
("mapfile-update-interval", po::value<int>()->default_value(-1),
"Events between a map file update");

// Define the autoflush and autosave option (default values by ROOT)
Expand Down
Empty file modified Analysis/src/QwRunCondition.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwSIS3320_Accumulator.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwSIS3320_LogicalAccumulator.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwSIS3320_Samples.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwScaler_Channel.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwSubsystemArray.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwTypes.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/QwVQWK_Channel.cc
100755 → 100644
Empty file.
Empty file modified Analysis/src/VQwHardwareChannel.cc
100755 → 100644
Empty file.
22 changes: 11 additions & 11 deletions Analysis/src/VQwSubsystem.cc
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ void VQwSubsystem::ClearAllBankRegistrations()
{
fBank_IDs.clear();
fROC_IDs.clear();
fCurrentROC_ID = -1;
fCurrentBank_ID = -1;
fCurrentROC_ID = kNullROCID;
fCurrentBank_ID = kNullBankID;
}

Int_t VQwSubsystem::GetSubbankIndex(const ROCID_t roc_id, const BankID_t bank_id) const
Expand Down Expand Up @@ -293,16 +293,16 @@ Int_t VQwSubsystem::RegisterROCNumber(const ROCID_t roc_id, const BankID_t bank_
fCurrentROC_ID = roc_id;
fCurrentBank_ID = bank_id;
} else {
fCurrentROC_ID = -1;
fCurrentBank_ID = -1;
fCurrentROC_ID = kNullROCID;
fCurrentBank_ID = kNullBankID;
}
return stat;
}

Int_t VQwSubsystem::RegisterSubbank(const BankID_t bank_id)
{
Int_t stat = 0;
if (fCurrentROC_ID != -1){
if (fCurrentROC_ID != kNullROCID){
stat = RegisterROCNumber(fCurrentROC_ID, bank_id);
fCurrentBank_ID = bank_id;
} else {
Expand All @@ -313,8 +313,8 @@ Int_t VQwSubsystem::RegisterSubbank(const BankID_t bank_id)
<< "Add a 'ROC=#' line to the map file."
<< std::dec << QwLog::endl;
stat = ERROR;
fCurrentROC_ID = -1;
fCurrentBank_ID = -1;
fCurrentROC_ID = kNullROCID;
fCurrentBank_ID = kNullBankID;
}
return stat;
}
Expand All @@ -324,12 +324,12 @@ Int_t VQwSubsystem::RegisterMarkerWord(const UInt_t markerword)
{
static BankID_t bankIDmask = 0xffffffff;
Int_t stat = 0;
if (fCurrentROC_ID != -1){
if (fCurrentROC_ID != kNullROCID){
Int_t roc_index = FindIndex(fROC_IDs, fCurrentROC_ID);
Int_t bank_index = FindIndex(fBank_IDs[roc_index],(fCurrentBank_ID&bankIDmask));
fMarkerWords.at(roc_index).at(bank_index).push_back(markerword);
BankID_t tmpbank = markerword;
tmpbank = (tmpbank)<<32 + (fCurrentBank_ID&bankIDmask);
tmpbank = ((tmpbank)<<32) + (fCurrentBank_ID&bankIDmask);
RegisterSubbank(tmpbank);
} else {
// There is not a ROC registered yet!
Expand All @@ -339,8 +339,8 @@ Int_t VQwSubsystem::RegisterMarkerWord(const UInt_t markerword)
<< "Add a 'ROC=#' line to the map file."
<< std::dec << QwLog::endl;
stat = ERROR;
fCurrentROC_ID = -1;
fCurrentBank_ID = -1;
fCurrentROC_ID = kNullROCID;
fCurrentBank_ID = kNullBankID;
}
return stat;
}
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ link_directories(${Boost_LIBRARY_DIR})
# ROOT
#
set(minimum_root_version 6.0)
find_package(ROOT ${minimum_root_version} REQUIRED)
find_package(ROOT ${minimum_root_version} REQUIRED New Gui)
config_add_dependency(ROOT ${minimum_root_version})


Expand Down Expand Up @@ -216,7 +216,7 @@ endforeach()

#----------------------------------------------------------------------------
# Build feedback library and executable
add_subdirectory(Feedback)
### add_subdirectory(Feedback)

#----------------------------------------------------------------------------
# uninstall
Expand Down
Empty file modified Doxygen/images/QwTrackingTreeMatch-1.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Doxygen/images/QwTrackingTreeMatch-2.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Doxygen/images/QwTrackingTreeMatch-3.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Doxygen/images/QwTrackingTreeMatch-4.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Doxygen/images/QwTrackingTreeMatch-5.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Feedback/FlipPCValues
100755 → 100644
Empty file.
Empty file modified Feedback/GetGoodPC
100755 → 100644
Empty file.
Empty file modified Feedback/SetLargeNegative_A_q
100755 → 100644
Empty file.
Empty file modified Feedback/SetLargePositive_A_q
100755 → 100644
Empty file.
Empty file modified Feedback/SetNominalPC
100755 → 100644
Empty file.
Loading

0 comments on commit c1831af

Please sign in to comment.