23 #include <boost/random.hpp>
54 int main(
int argc,
char* argv[])
57 std::cout << std::endl <<
" -= Moller Run Analyzer Started =-" << std::endl;
106 std::string fileName;
113 for (UInt_t run = 15; run <= 15; run++) {
119 fileName = TString(
"moller-moller_") + Form(
"%u.log.0",run);
126 if (eventbuffer.
OpenDataFile(fileName,
"R") != CODA_OK) {
133 + TString(
"/Moller_") + Form(
"%u.root",run);
134 TFile rootfile(rootfilename,
"RECREATE",
"QWeak ROOT file");
155 std::vector <Double_t> mpsvector;
156 std::vector <Double_t> helvector;
161 mpstree =
new TTree(
"MPS_Tree",
"MPS event data tree");
162 mpsvector.reserve(6000);
170 heltree =
new TTree(
"HEL_Tree",
"Helicity event data tree");
171 helvector.reserve(6000);
179 while (eventbuffer.
GetEvent() == CODA_OK) {
183 std::cout <<
"it is ROC CONFIG event\n";
242 std::cout <<
"Last event processed: " << eventbuffer.
GetEventNumber() << std::endl;
244 rootfile.Write(0,TObject::kOverwrite);
274 std::cout << std::endl <<
" -= Moller Run Analyzer Ended =-" << std::endl << std::endl;
281 gQwOptions.
AddOptions()(
"input_directory,d", po::value<std::string>(),
"Directory to be searched for input files, default is current");
282 gQwOptions.
AddOptions()(
"output_directory,o", po::value<std::string>(),
"Directory where output files are saved");
298 gQwOptions.
AddOptions()(
"helicity_pattern", po::value<int>()->default_value(4),
"Length of the helicity window, should be 4, 8, or 16");
#define QwMessage
Predefined log drain for regular messages.
void InitLogFile(const std::string name, const std::ios_base::openmode mode=kAppend)
Initialize the log file with name 'name'.
void FillHistograms()
Fill the histograms for this subsystem.
void PrintValue() const
Print value of all channels.
static void AppendToSearchPath(const TString &searchdir)
Add a directory to the search path.
void ConstructHistograms()
Construct the histograms for this subsystem.
float gscaler_old[scal_num]
void SetScreenThreshold(int thr)
Set the screen log level.
static const int scal_num
void DefineOptionsParity(QwOptions &options)
void CalculateBurstAverage()
void ConstructHistograms()
float gscaler_change[scal_num]
bool HasValue(const std::string &key)
Has this key been defined.
void AccumulateRunningSum(const QwSubsystemArrayParity &value)
Update the running sums for devices accumulated for the global error non-zero events/patterns.
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Construct a branch and vector for this subsystem with a prefix.
float gscaler_new[scal_num]
void CalculateRunningBurstAverage()
void CalculateRunningAverage()
Calculate the average for all good events.
Bool_t IsBurstSumEnabled()
Status of burst sum calculation flag.
void CalculateAsymmetry()
Bool_t IsCompletePattern() const
void ProcessOptions(QwOptions &options)
Process configuration options (default behavior)
Int_t OpenDataFile(UInt_t current_run, Short_t seg)
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
static const std::ios_base::openmode kTruncate
Log file open modes.
T GetValue(const std::string &key)
Get a templated value.
void SetFileThreshold(int thr)
Set the file log level.
Virtual base class for the parity subsystems.
void PrintRunningAverage() const
void ConstructTree()
Construct the tree for this subsystem.
const char * getenv_safe(const char *name)
void SetConfigFile(const std::string &configfile)
Set a configuration file.
A logfile class, based on an identical class in the Hermes analyzer.
void AccumulateRunningBurstSum()
void Parse(bool force=false)
Parse all sources of options.
Load the options for the parity subsystems.
QwHistogramHelper gQwHists
Globally defined instance of the QwHistogramHelper class.
Bool_t FillSubsystemData(QwSubsystemArray &subsystems)
Bool_t IsRunningSumEnabled()
Status of running sum calculation flag.
void FillTree()
Fill the tree for this subsystem.
static std::ostream & endl(std::ostream &)
End of the line.
void ProcessEvent()
Process the decoded data in this event.
const std::string getenv_safe_string(const char *name)
void LoadEventData(QwSubsystemArrayParity &event)
void PrintRunningBurstAverage() const
void IncrementErrorCounters()
Update the data elements' error counters based on their internal error flags.
int main(int argc, char **argv)
void LoadHistParamsFromFile(const std::string &filename)
void CalculateRunningAverage()
UInt_t UpdateEventTypeMask()
Update the event type mask from the subsystems.
Bool_t IsROCConfigurationEvent()
#define QwError
Predefined log drain for errors.
void SetCommandLine(int argc, char *argv[], bool default_config_file=true)
Set the command line arguments.
void FillTreeVector(std::vector< Double_t > &values) const
Fill the vector for this subsystem.