16 #include <boost/shared_ptr.hpp>
51 Int_t
main(Int_t argc, Char_t* argv[])
112 epicsevent.LoadChannelMap(
"EpicsTable.map");
156 burstrootfile = historootfile = treerootfile;
162 treerootfile =
new QwRootFile(run_label +
".trees");
163 burstrootfile =
new QwRootFile(run_label +
".bursts");
164 historootfile =
new QwRootFile(run_label +
".histos");
185 treerootfile->
ConstructTreeBranches(
"Hel_Tree_Reg",
"Helicity event data tree (regressed)", regression);
212 if (epicsevent.HasDataLoaded()) {
219 epicsevent.ResetCounters();
236 if (epicsevent.HasDataLoaded()){
237 epicsevent.CalculateRunningValues();
241 treerootfile->
FillTree(
"Slow_Tree");
266 eventring.
push(detectors);
270 ringoutput = eventring.
pop();
313 burstrootfile->
FillTree(
"Burst_Tree");
325 treerootfile->
FillTree(
"Hel_Tree_Reg");
345 QwMessage <<
"Number of events processed at end of run: "
378 if (treerootfile == historootfile) {
379 treerootfile->
Write(0,TObject::kOverwrite);
380 delete treerootfile; treerootfile = 0; burstrootfile = 0; historootfile = 0;
382 treerootfile->
Write(0,TObject::kOverwrite);
383 burstrootfile->
Write(0,TObject::kOverwrite);
384 historootfile->
Write(0,TObject::kOverwrite);
385 delete treerootfile; treerootfile = 0;
386 delete burstrootfile; burstrootfile = 0;
387 delete historootfile; historootfile = 0;
401 promptsummary.PrintCSV();
408 helicitypattern.
FillDB(&database);
410 epicsevent.FillDB(&database);
411 running_regression.
FillDB(&database,
"asymmetry");
void ProcessOptions(QwOptions &options)
Process the configuration options.
#define QwMessage
Predefined log drain for regular messages.
QwSubsystemArrayParity & pop()
Return the last subsystem in the ring.
void PrintValue() const
Print value of all channels.
static void AppendToSearchPath(const TString &searchdir)
Add a directory to the search path.
Bool_t FillSubsystemConfigurationData(QwSubsystemArray &subsystems)
#define default_bool_value(b)
Bool_t ApplySingleEventCuts()
Apply the single event cuts.
Int_t GetSegmentNumber() const
Return CODA file segment number.
Int_t WriteParamFileList(const TString &name, T &object)
void ConstructHistograms(const std::string &name, T &object)
Construct the histograms of a generic object.
void DefineOptionsParity(QwOptions &options)
void CalculateBurstAverage()
void ProcessOptions(QwOptions &options)
Sets internal flags based on the QwOptions.
Int_t OpenNextStream()
Opens the event stream (file or ET) based on the internal flags.
void AccumulateRunningSum(const QwSubsystemArrayParity &value)
Update the running sums for devices accumulated for the global error non-zero events/patterns.
void AccumulateRunningSum(QwRegression value)
static void SetCurrentRunNumber(const UInt_t runnumber)
Set the current run number for looking up the appropriate parameter file.
Int_t CloseStream()
Closes a currently open event stream.
void WritePromptSummary(QwPromptSummary *ps)
void CalculateRunningBurstAverage()
void PrintParamFileList() const
Print list of parameter files.
void CalculateRunningAverage()
Calculate the average for all good events.
void ProcessOptions(QwOptions *options)
Process class options for QwOptions.
void UpdateBlinder(QwParityDB *db)
Update the blinder status with new external information.
Bool_t IsBurstSumEnabled()
Status of burst sum calculation flag.
void CalculateAsymmetry()
Bool_t IsCompletePattern() const
void ProcessOptions(QwOptions &options)
Process configuration options (default behavior)
QwSubsystemArrayParity & GetBurstDifference()
void LinearRegression(EQwRegType type)
Linear regression.
Int_t FillTree(const std::string &name)
Fill the tree with name.
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
void FillDB_MPS(QwParityDB *db, TString type)
Fill the database with MPS-based variables Note that most subsystems don't need to do this...
void push(QwSubsystemArrayParity &event)
Add the subsystem to the ring.
Bool_t AllowsWriteAccess()
void CalculateRunningAverage()
void ProcessOptions(QwOptions &options)
Process the configuration options.
T GetValue(const std::string &key)
Get a templated value.
void Usage()
Print usage information.
void ListConfigFiles()
List the configuration files.
Virtual base class for the parity subsystems.
void FillDB(QwParityDB *db, TString datatype)
A wrapper class for a ROOT file or memory mapped file.
Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
QwSubsystemArrayParity & GetBurstYield()
void PrintErrorCounters() const
Report the number of events failed due to HW and event cut failures.
A logfile class, based on an identical class in the Hermes analyzer.
void AccumulateRunningBurstSum()
void AddConfigFile(const std::string &configfile)
Add a configuration file.
void ConstructTreeBranches(const std::string &name, const std::string &desc, T &object, const std::string &prefix="")
Construct the tree branches of a generic object.
Int_t GetRunNumber() const
Return CODA file run number.
void AtEndOfEventLoop()
Perform actions at the end of the event loop.
Load the options for the parity subsystems.
void ProcessOptions(QwOptions &options)
Process the configuration options.
void ListPublishedValues() const
List the published values and description in this subsystem array.
QwHistogramHelper gQwHists
Globally defined instance of the QwHistogramHelper class.
Bool_t FillSubsystemData(QwSubsystemArray &subsystems)
Bool_t IsRunningSumEnabled()
Status of running sum calculation flag.
void FillParameterFiles(QwSubsystemArrayParity &subsys)
void SetupOneRun(QwEventBuffer &qwevt)
void ShareHistograms(const QwSubsystemArray &source)
Share the histograms with another subsystem.
QwSubsystemArrayParity & GetBurstAsymmetry()
static std::ostream & endl(std::ostream &)
End of the line.
void FillTreeBranches(const std::string &name, const T &object)
Fill the tree branches of a generic object by tree name.
void ProcessEvent()
Process the decoded data in this event.
const std::string getenv_safe_string(const char *name)
void FillHistograms(T &object)
Fill histograms of the subsystem array.
void LoadEventData(QwSubsystemArrayParity &event)
void FillErrDB(QwParityDB *db)
TString GetRunLabel() const
Returns a string like <run#> or <run#>.<file#>
Bool_t FillEPICSData(QwEPICSEvent &epics)
void IncrementErrorCounters()
Update the data elements' error counters based on their internal error flags.
void FillDB(QwParityDB *db)
int main(int argc, char **argv)
void CalculateRunningAverage()
Bool_t IsROCConfigurationEvent()
Bool_t IsReady()
Return the read status of the ring.
void SetCommandLine(int argc, char *argv[], bool default_config_file=true)
Set the command line arguments.