13 #include <boost/random.hpp>
52 int main(
int argc,
char* argv[])
95 for (UInt_t run = runnumber_min;
100 TString datafilename = TString(
"QwMock_") + Form(
"%d.log",run);
101 if (eventbuffer.
OpenDataFile(datafilename,
"R") != CODA_OK) {
102 std::cout <<
"Error: could not open file!" << std::endl;
108 TString rootfilename =
getenv_safe_TString(
"QW_ROOTFILES") + TString(
"/QwMock_") + Form(
"%d.root",run);
109 TFile rootfile(rootfilename,
"RECREATE",
"QWeak ROOT file");
123 std::vector <Double_t> mpsvector;
124 std::vector <Double_t> helvector;
127 mpstree =
new TTree(
"MPS_Tree",
"MPS event data tree");
128 mpsvector.reserve(6000);
129 mpstree->Branch(
"eventnumber",&eventnumber,
"eventnumber/F");
135 heltree =
new TTree(
"HEL_Tree",
"Helicity event data tree");
136 helvector.reserve(6000);
146 while (eventbuffer.
GetEvent() == CODA_OK) {
159 if (eventnumber < eventnumber_min)
continue;
160 else if (eventnumber > eventnumber_max)
break;
178 else std::cout <<
"?";
182 else std::cout <<
"(?) ";
218 std::cout <<
"Number of events processed so far: "
239 rootfile.Write(0,TObject::kOverwrite);
257 UInt_t run_id = qweak_database->
GetRunID(eventbuffer);
258 UInt_t analysis_id = qweak_database->
GetAnalysisID(eventbuffer);
267 helicitypattern.
FillDB(qweak_database);
269 delete qweak_database; qweak_database = NULL;
int GetIntValuePairFirst(const std::string &key)
Get the first of a pair of integer values.
#define QwMessage
Predefined log drain for regular messages.
void FillHistograms()
Fill the histograms for this subsystem.
UInt_t GetMonitorID(const string &name, Bool_t zero_id_is_error=kTRUE)
static void AppendToSearchPath(const TString &searchdir)
Add a directory to the search path.
Bool_t FillSubsystemConfigurationData(QwSubsystemArray &subsystems)
void ConstructHistograms()
Construct the histograms for this subsystem.
UInt_t GetMainDetectorID(const string &name, Bool_t zero_id_is_error=kTRUE)
void DefineOptionsParity(QwOptions &options)
void CalculateBurstAverage()
const TString getenv_safe_TString(const char *name)
void ConstructHistograms()
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.
void CalculateRunningBurstAverage()
UInt_t GetLumiDetectorID(const string &name, Bool_t zero_id_is_error=kTRUE)
void CalculateRunningAverage()
Calculate the average for all good events.
void CalculateAsymmetry()
Bool_t IsCompletePattern() const
void ProcessOptions(QwOptions &options)
Process configuration options (default behavior)
const string GetVersion()
UInt_t GetRandomSeedActual()
Int_t OpenDataFile(UInt_t current_run, Short_t seg)
Int_t GetHelicityDelayed()
Virtual base class for the parity subsystems.
void SetConfigFile(const std::string &configfile)
Set a configuration file.
void AccumulateRunningBurstSum()
void FillTreeVector(std::vector< Double_t > &values) const
Int_t GetRunNumber() const
Return CODA file run number.
Load the options for the parity subsystems.
void ProcessOptions(QwOptions &options)
Process the configuration options.
QwHistogramHelper gQwHists
Globally defined instance of the QwHistogramHelper class.
Bool_t FillSubsystemData(QwSubsystemArray &subsystems)
A color changing class for the output stream.
UInt_t GetRandomSeedDelayed()
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)
VQwSubsystemParity * GetSubsystemByName(const TString &name)
Get the subsystem with the specified name.
void IncrementErrorCounters()
Update the data elements' error counters based on their internal error flags.
static const int kMultiplet
void FillDB(QwParityDB *db)
Int_t GetHelicityActual()
int main(int argc, char **argv)
void LoadHistParamsFromFile(const std::string &filename)
int GetIntValuePairLast(const std::string &key)
Get the last of a pair of integer values.
void CalculateRunningAverage()
Bool_t IsROCConfigurationEvent()
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.