18 #define MYSQLPP_SSQLS_NO_STATICS
43 fHelicityBitPattern(kDefaultHelicityBitPattern),
44 fMinPatternPhase(1), fUsePredictor(kTRUE), fIgnoreHelicity(kFALSE),
45 fEventNumberFirst(-1),fPatternNumberFirst(-1),
46 fSuppressMPSErrorMsgs(kFALSE)
82 fHelicityBitPattern(kDefaultHelicityBitPattern),
83 fMinPatternPhase(1), fUsePredictor(kTRUE), fIgnoreHelicity(kFALSE),
84 fEventNumberFirst(-1),fPatternNumberFirst(-1),
85 fSuppressMPSErrorMsgs(kFALSE)
113 for(
size_t i=0;i<this->
fWord.size();i++)
115 this->
fWord[i].fWordName=source.
fWord[i].fWordName;
116 this->
fWord[i].fModuleType=source.
fWord[i].fModuleType;
117 this->
fWord[i].fWordType=source.
fWord[i].fWordType;
152 (
"helicity.seed", po::value<int>(),
153 "Number of bits in random seed");
155 (
"helicity.bitpattern", po::value<std::string>(),
156 "Helicity bit pattern: 0x1 (pair), 0x9 (quartet), 0x69 (octet), 0x666999 (hexo-quad), 0x66669999 (octo-quad)");
158 (
"helicity.patternoffset", po::value<int>(),
159 "Set 1 when pattern starts with 1 or 0 when starts with 0");
161 (
"helicity.patternphase", po::value<int>(),
162 "Maximum pattern phase");
164 (
"helicity.delay", po::value<int>(),
165 "Default delay is 2 patterns, set at the helicity map file.");
168 "Activates helicity toggle-mode, overriding the 'delay', 'patternphase', 'bitpattern', and 'seed' options.");
177 if (options.
HasValue(
"helicity.patternoffset")) {
178 if (options.
GetValue<
int>(
"helicity.patternoffset") == 1
179 || options.
GetValue<
int>(
"helicity.patternoffset") == 0) {
185 if (options.
HasValue(
"helicity.patternphase")) {
186 if (options.
GetValue<
int>(
"helicity.patternphase") % 2 == 0) {
192 if (options.
HasValue(
"helicity.seed")) {
193 if (options.
GetValue<
int>(
"helicity.seed") == 24
194 || options.
GetValue<
int>(
"helicity.seed") == 30) {
195 QwMessage <<
" Random Bits = " << options.
GetValue<
int>(
"helicity.seed") << QwLog::endl;
200 if (options.
HasValue(
"helicity.delay")) {
201 QwMessage <<
" Helicity Delay = " << options.
GetValue<
int>(
"helicity.delay") << QwLog::endl;
205 if (options.
HasValue(
"helicity.bitpattern")) {
207 << options.
GetValue<std::string>(
"helicity.bitpattern")
209 std::string hex = options.
GetValue<std::string>(
"helicity.bitpattern");
216 if (options.
GetValue<
bool>(
"helicity.toggle-mode")) {
241 Bool_t results=kFALSE;
276 QwWarning <<
"QwHelicity::IsGoodEventNumber: \n this is not a good event number indeed:" <<
QwLog::endl;
300 QwWarning <<
"QwHelicity::IsGoodPhaseNumber: not a good phase number \t"
324 QwError <<
"QwHelicity::IsGoodHelicity : The helicity reported in event "
326 <<
" is not what we expect from the randomseed. Not a good event nor pattern"
329 QwError <<
"QwHelicity::IsGoodHelicity - The helicity reported in event "
331 <<
" is not what we expect according to pattern structure. Not a good event nor pattern"
350 for (
size_t i=0;i<
fWord.size();i++)
410 QwMessage <<
"\n*********QwHelicity Error Summary****************"
412 QwMessage <<
"First helicity gate counter: "
414 <<
"; last helicity gate counter: "
419 <<
"; last pattern counter: "
425 QwMessage <<
"Number of multiplet-sync-bit errors: "
428 QwMessage <<
"Number of helicity prediction errors: "
431 QwMessage <<
"---------------------------------------------------\n"
448 Bool_t ldebug=kFALSE;
450 static UInt_t lastuserbits = 0xFF;
453 if(scaleroffset==1 || scaleroffset==0) {
459 lastuserbits = userbits;
461 if (lastuserbits==0xFF) {
464 if ((lastuserbits & 0x8) == 0x8) {
474 if ((lastuserbits & 0x4) == 0x4){
485 QwError <<
" QwHelicity::ProcessEvent finding a missed read event in the scaler" <<
QwLog::endl;
487 std::cout <<
" QwHelicity::ProcessEvent :" << scaleroffset <<
" events were missed \n";
488 std::cout <<
" before manipulation \n";
497 for (UInt_t i=0;i<scaleroffset;i++) {
510 std::cout <<
" after manipulation \n";
520 static Bool_t firstpattern = kTRUE;
521 Bool_t fake_the_counters=kFALSE;
540 firstpattern = kFALSE;
555 if (fake_the_counters){
570 QwError <<
"QwHelicity::ProcessEvent read event# ("
580 QwError <<
"QwHelicity::ProcessEvent: The Multiplet Sync bit is set, but the Pattern Phase is ("
595 QwError <<
"QwHelicity::ProcessEvent: Both the H+ and H- bits are set: thisinputregister=="
615 static Bool_t firstpattern = kTRUE;
618 firstpattern = kFALSE;
624 QwError <<
"QwHelicity::ProcessEvent read event# ("
660 Bool_t ldebug = kFALSE;
676 QwError <<
"QwHelicity::ProcessEvent no instructions on how to decode the helicity !!!!" <<
QwLog::endl;
716 std::vector<UInt_t> localbuffer;
722 UInt_t userbit = 0x0;
727 localbuffer.push_back(0x1);
728 localbuffer.push_back(0xa);
729 localbuffer.push_back(0xa);
730 localbuffer.push_back(0x0);
731 localbuffer.push_back(0x20);
732 localbuffer.push_back(userbit);
734 for (
int i = 0; i < 64; i++) localbuffer.push_back(0x0);
738 UInt_t input_register = 0x0;
744 localbuffer.push_back(input_register);
745 localbuffer.push_back(0x0);
750 for (
int i = 0; i < 17; i++) localbuffer.push_back(0x0);
759 std::vector<UInt_t> subbankheader;
760 std::vector<UInt_t> rocheader;
761 if (localbuffer.size() > 0) {
764 subbankheader.clear();
765 subbankheader.push_back(localbuffer.size() + 1);
766 subbankheader.push_back((
fCurrentBank_ID << 16) | (0x01 << 8) | (1 & 0xff));
771 rocheader.push_back(subbankheader.size() + localbuffer.size() + 1);
772 rocheader.push_back((
fCurrentROC_ID << 16) | (0x10 << 8) | (1 & 0xff));
776 buffer.insert(buffer.end(), rocheader.begin(), rocheader.end());
777 buffer.insert(buffer.end(), subbankheader.begin(), subbankheader.end());
778 buffer.insert(buffer.end(), localbuffer.begin(), localbuffer.end());
784 QwOut <<
"===========================\n"
785 <<
"This event: Event#, Pattern#, PatternPhase#="
789 QwOut <<
"Previous event: Event#, Pattern#, PatternPhase#="
793 QwOut <<
"delta = \n(fEventNumberOld)-(fMaxPatternPhase)x(fPatternNumberOld)-(fPatternPhaseNumberOld)= "
795 QwOut <<
"Helicity Reported, Delayed, Actual ="
806 Bool_t ldebug=kFALSE;
808 Int_t currentrocread=0;
809 Int_t currentbankread=0;
811 Int_t currentsubbankindex=-1;
823 while (mapstr.ReadNextLine()){
824 mapstr.TrimComment(
'!');
825 mapstr.TrimWhitespace();
826 if (mapstr.LineIsEmpty())
continue;
828 TString varname, varvalue;
829 if (mapstr.HasVariablePair(
"=",varname,varvalue)){
836 currentrocread=value;
840 else if (varname==
"bank")
842 currentbankread=value;
846 else if (varname==
"patternphase")
851 else if (varname==
"patternbits")
855 else if (varname==
"fakempsbit")
860 else if (varname==
"numberpatternsdelayed")
864 else if (varname==
"randseedbits")
866 if (value==24 || value==30)
869 else if (varname==
"patternphaseoffset")
873 else if(varname==
"helpluseventtype")
877 else if(varname==
"helminuseventtype")
881 else if (varname==
"helicitydecodingmode")
883 if (varvalue==
"InputRegisterMode") {
887 else if (varvalue==
"UserbitMode"){
891 else if (varvalue==
"HelLocalyMadeUp"){
895 else if (varvalue==
"InputMollerMode") {
900 QwError <<
"The helicity decoding mode read in file " << mapfile
901 <<
" is not recognized in function QwHelicity::LoadChannelMap \n"
907 TString modtype = mapstr.GetTypedNextToken<TString>();
908 Int_t modnum = mapstr.GetTypedNextToken<Int_t>();
909 mapstr.GetTypedNextToken<Int_t>();
910 TString dettype = mapstr.GetTypedNextToken<TString>();
912 TString namech = mapstr.GetTypedNextToken<TString>();
914 TString keyword = mapstr.GetTypedNextToken<TString>();
918 if(currentsubbankindex!=
GetSubbankIndex(currentrocread,currentbankread))
925 if (modnum<=0) wordsofar+=1;
926 else wordsofar+=modnum;
928 else if(modtype!=
"WORD"|| dettype!=
"helicitydata")
930 QwError <<
"QwHelicity::LoadChannelMap: Unknown detector type: "
931 << dettype <<
", the detector " << namech <<
" will not be decoded "
946 fWord.push_back(localword);
965 if(namech.Contains(
"mps_counter")) {
968 if(namech.Contains(
"pat_counter")) {
979 std::cout <<
"Done with Load map channel \n";
980 for(
size_t i=0;i<
fWord.size();i++)
982 std::cout <<
" kUserbit=" <<
kUserbit <<
"\n";
994 QwDebug <<
"QwHelicity::LoadChannelMap:"
995 <<
" We are in Moller Helicity Mode, with HelPlusEventType = "
1000 QwError <<
"QwHelicity::LoadChannelMap:"
1001 <<
" We are in Moller Helicity Mode, and the HelPlus and HelMinus event types are not set properly."
1004 <<
". Please correct the helicity map file!"
1021 Bool_t lkDEBUG = kFALSE;
1028 if (index >= 0 && num_words > 0) {
1031 QwDebug <<
"QwHelicity::ProcessEvBuffer: "
1032 <<
"Begin processing ROC" << roc_id
1033 <<
" and subbank " << bank_id
1034 <<
" number of words=" << num_words <<
QwLog::endl;
1037 if(
fWord[i].fWordInSubbank+1<= (Int_t) num_words) {
1038 fWord[i].fValue=buffer[
fWord[i].fWordInSubbank];
1040 QwWarning <<
"QwHelicity::ProcessEvBuffer: There is not enough word in the buffer to read data for "
1042 QwWarning <<
"QwHelicity::ProcessEvBuffer: Words in this buffer:" << num_words
1043 <<
" trying to read word number =" <<
fWord[i].fWordInSubbank <<
QwLog::endl;
1047 QwDebug <<
"QwHelicity::ProcessEvBuffer: Done with Processing this event" <<
QwLog::endl;
1048 for(
size_t i=0;i<
fWord.size();i++) {
1049 std::cout <<
" word number = " << i <<
" ";
1099 UShort_t firstbits[nbits];
1100 for (
unsigned int i = 0; i < nbits; i++) firstbits[i] = (seed >> i) & 0x1;
1111 if (prefix ==
"diff_"
1112 || TRegexp(
"asym[1-9]*_").Index(prefix,&len) == 0)
1114 else if (prefix ==
"yield_")
1123 if (folder != NULL) folder->cd();
1134 basename=
"pattern_polarity";
1137 for (
size_t i=0; i<
fWord.size(); i++){
1138 basename=
"hel_"+
fWord[i].fWordName;
1147 basename=prefix+
"delta_event_number";
1150 basename=prefix+
"delta_pattern_number";
1153 basename=prefix+
"pattern_phase";
1156 basename=prefix+
"helicity";
1159 for (
size_t i=0; i<
fWord.size(); i++){
1160 basename=prefix+
fWord[i].fWordName;
1166 QwError <<
"QwHelicity::ConstructHistograms this prefix--" << prefix <<
"-- is not unknown:: no histo created" <<
QwLog::endl;
1188 for (
size_t i=0; i<
fWord.size(); i++){
1210 for (
size_t i=0; i<
fWord.size(); i++){
1235 basename =
"actual_helicity";
1236 values.push_back(0.0);
1237 tree->Branch(basename, &(values.back()), basename+
"/D");
1239 basename =
"delayed_helicity";
1240 values.push_back(0.0);
1241 tree->Branch(basename, &(values.back()), basename+
"/D");
1243 basename =
"reported_helicity";
1244 values.push_back(0.0);
1245 tree->Branch(basename, &(values.back()), basename+
"/D");
1247 basename =
"pattern_phase";
1248 values.push_back(0.0);
1249 tree->Branch(basename, &(values.back()), basename+
"/D");
1251 basename =
"pattern_number";
1252 values.push_back(0.0);
1253 tree->Branch(basename, &(values.back()), basename+
"/D");
1255 basename =
"pattern_seed";
1256 values.push_back(0.0);
1257 tree->Branch(basename, &(values.back()), basename+
"/D");
1259 basename =
"event_number";
1260 values.push_back(0.0);
1261 tree->Branch(basename, &(values.back()), basename+
"/D");
1263 for (
size_t i=0; i<
fWord.size(); i++)
1265 basename =
fWord[i].fWordName;
1266 values.push_back(0.0);
1267 tree->Branch(basename, &(values.back()), basename+
"/D");
1272 basename =
"actual_pattern_polarity";
1273 values.push_back(0.0);
1274 tree->Branch(basename, &(values.back()), basename+
"/D");
1276 basename =
"actual_previous_pattern_polarity";
1277 values.push_back(0.0);
1278 tree->Branch(basename, &(values.back()), basename+
"/D");
1280 basename =
"delayed_pattern_polarity";
1281 values.push_back(0.0);
1282 tree->Branch(basename, &(values.back()), basename+
"/D");
1284 basename =
"pattern_number";
1285 values.push_back(0.0);
1286 tree->Branch(basename, &(values.back()), basename+
"/D");
1288 basename =
"pattern_seed";
1289 values.push_back(0.0);
1290 tree->Branch(basename, &(values.back()), basename+
"/D");
1292 for (
size_t i=0; i<
fWord.size(); i++)
1294 basename =
fWord[i].fWordName;
1295 values.push_back(0.0);
1296 tree->Branch(basename, &(values.back()), basename+
"/D");
1314 basename =
"actual_helicity";
1317 basename =
"delayed_helicity";
1320 basename =
"reported_helicity";
1323 basename =
"pattern_phase";
1326 basename =
"pattern_number";
1329 basename =
"pattern_seed";
1332 basename =
"event_number";
1337 basename =
"actual_pattern_polarity";
1340 basename =
"actual_previous_pattern_polarity";
1343 basename =
"delayed_pattern_polarity";
1346 basename =
"pattern_number";
1349 basename =
"pattern_seed";
1352 for (
size_t i=0; i<
fWord.size(); i++)
1354 basename =
fWord[i].fWordName;
1355 tree->Branch(basename, &
fWord[i].fValue, basename+
"/I");
1373 basename =
"actual_helicity";
1376 basename =
"delayed_helicity";
1379 basename =
"reported_helicity";
1382 basename =
"pattern_phase";
1385 basename =
"pattern_number";
1388 basename =
"pattern_seed";
1391 basename =
"event_number";
1396 basename =
"actual_pattern_polarity";
1399 basename =
"actual_previous_pattern_polarity";
1402 basename =
"delayed_pattern_polarity";
1405 basename =
"pattern_number";
1408 basename =
"pattern_seed";
1411 for (
size_t i=0; i<
fWord.size(); i++)
1413 basename =
fWord[i].fWordName;
1414 tree->Branch(basename,&
fWord[i].fValue, basename+
"/I");
1436 for (
size_t i=0; i<
fWord.size(); i++)
1437 values[index++] =
fWord[i].fValue;
1446 for (
size_t i=0; i<
fWord.size(); i++){
1447 values[index++] =
fWord[i].fValue;
1456 if (type==
"yield" || type==
"asymmetry")
1460 mysqlpp::Query query = db->
Query();
1474 Bool_t status =
false;
1512 const UInt_t IB1 = 1;
1513 const UInt_t IB3 = 4;
1514 const UInt_t IB4 = 8;
1515 const UInt_t IB24 = 8388608;
1516 const UInt_t MASK = IB1+IB3+IB4+IB24;
1528 ranseed = ((ranseed^MASK) << 1|IB1);
1545 UInt_t bit7 = (ranseed & 0x00000040) != 0;
1546 UInt_t bit28 = (ranseed & 0x08000000) != 0;
1547 UInt_t bit29 = (ranseed & 0x10000000) != 0;
1548 UInt_t bit30 = (ranseed & 0x20000000) != 0;
1550 UInt_t result = (bit30 ^ bit29 ^ bit28 ^ bit7) & 0x1;
1556 ranseed = ( (ranseed << 1) | result ) & 0x3FFFFFFF;
1565 QwDebug <<
" Entering QwHelicity::GetRandomSeed \n";
1582 for(
size_t i=0;i<25;i++)
1583 std::cout << i <<
" : " << first24randbits[i] <<
"\n";
1586 for(
size_t i=24;i>=5;i--) b[i]= first24randbits[24-i+1];
1589 b[4] = first24randbits[21]^b[24];
1590 b[3] = first24randbits[22]^b[24]^b[23];
1591 b[2] = first24randbits[23]^b[23]^b[22];
1592 b[1] = first24randbits[24]^b[21]^b[22]^b[24];
1595 for(
size_t i=24;i>=1;i--) ranseed=ranseed << 1|(b[i]&1);
1597 ranseed = ranseed&0xFFFFFF;
1600 QwDebug <<
" Exiting QwHelicity::GetRandomSeed \n";
1610 Int_t ldebug = kFALSE;
1612 if(ldebug) std::cout <<
"Entering QwHelicity::RunPredictor for fEventNumber, " <<
fEventNumber
1657 std::cout <<
"Predicted Polarity ::: Delayed ="
1660 std::cout <<
"Predicted Helicity ::: Delayed Helicity=" <<
fHelicityDelayed
1672 Bool_t status =
false;
1687 Bool_t ldebug = kFALSE;
1688 const UInt_t ranbit_goal = 24;
1693 if (
n_ranbits==ranbit_goal)
return kTRUE;
1702 static UShort_t first24bits[25];
1713 std::cout <<
" event number" <<
fEventNumber <<
", fPatternNumber"
1722 std::cout <<
"Collected 24 random bits. Get the random seed for the predictor." <<
"\n";
1723 for(UInt_t i=0;i<ranbit_goal;i++) std::cout <<
" i:bit =" << i <<
":" << first24bits[i] <<
"\n";
1748 QwError <<
"QwHelicity::CollectRandBits We cannot handle negative delay(prediction) in the reported helicity. Exiting." <<
QwLog::endl;
1759 QwError <<
"QwHelicity::CollectRandBits, while collecting the seed, we encountered non continuous events: need to reset the seed collecting " << QwLog::endl
1760 <<
" event number=" <<
fEventNumber <<
", fPatternNumber="
1781 const UInt_t ranbit_goal = 30;
1785 if (
n_ranbits == ranbit_goal)
return kTRUE;
1791 QwMessage <<
"Collecting information (";
1812 QwDebug <<
"QwHelicity:: CollectRandBits30: done Collecting 30 randbits" <<
QwLog::endl;
1832 QwError <<
"QwHelicity::CollectRandBits30: We cannot handle negative delay(prediction) in the reported helicity. Exiting." <<
QwLog::endl;
1842 QwWarning <<
"QwHelicity::CollectRandBits30: While collecting the seed, we encountered non continuous events: Need to reset the seed collecting " <<
QwLog::endl;
1851 Bool_t ldebug=kFALSE;
1853 if(ldebug) std::cout <<
"Entering QwHelicity::PredictHelicity \n";
1866 if(ldebug) std::cout <<
"QwHelicity::PredictHelicity=>Predicting the helicity \n";
1874 if(ldebug) std::cout <<
"n_ranbit exiting the function = " <<
n_ranbits <<
"\n";
1889 QwWarning <<
"QwHelicity : SetHelicityDelay :: helicity delay is set to 0."
1890 <<
" Disabling helicity predictor and using reported helicity information."
1898 QwError <<
"QwHelicity::SetHelicityDelay We cannot handle negative delay in the prediction of delayed helicity. Exiting.." <<
QwLog::endl;
1929 Bool_t ldebug = kFALSE;
1937 for(
size_t i=0;i<input->
fWord.size();i++)
1938 this->
fWord[i].fValue=input->
fWord[i].fValue;
1957 std::cout <<
"QwHelicity::operator = this->fPatternNumber=" << this->
fPatternNumber << std::endl;
1958 std::cout <<
"input->fPatternNumber=" << input->
fPatternNumber <<
"\n";
2016 if(
typeid(*value)!=
typeid(*
this)) {
2029 UInt_t bitpattern = 0;
2037 }
else if (patternsize%8==0){
2038 Int_t halfshift = patternsize/2;
2039 for (Int_t i=0; i<(patternsize/8); i++){
2040 bitpattern += (0x9<<(i*4));
2041 bitpattern += (0x6<<(halfshift+i*4));
2044 QwError <<
"QwHelicity::BuildHelicityBitPattern: "
2045 <<
"Unable to build standard bit pattern for pattern size of "
2046 << patternsize <<
". Try a pattern of 0x69."
2050 QwDebug <<
"QwHelicity::BuildHelicityBitPattern: "
2051 <<
"Built pattern 0x" << std::hex << bitpattern
2052 << std::dec <<
" for pattern size "
Int_t GetSubbankIndex() const
#define QwMessage
Predefined log drain for regular messages.
void ProcessEventInputRegisterMode()
std::map< TString, TString > fDetectorMaps
#define QwOut
Predefined log drain for explicit output.
UInt_t GetRandbit24(UInt_t &ranseed)
#define default_bool_value(b)
void SetFirstBits(UInt_t nbits, UInt_t firstbits)
void Difference(VQwSubsystem *value1, VQwSubsystem *value2)
void Ratio(VQwSubsystem *numer, VQwSubsystem *denom)
void FillErrDB(QwParityDB *db, TString datatype)
UInt_t GetRandbit30(UInt_t &ranseed)
Bool_t Connect()
Open a connection to the database using the predefined parameters.
Int_t ProcessEvBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
TODO: The non-event-type-aware ProcessEvBuffer routine should be replaced with the event-type-aware v...
virtual UInt_t GetRandbit(UInt_t &ranseed)
void Sum(VQwSubsystem *value1, VQwSubsystem *value2)
Int_t ProcessConfigurationBuffer(const UInt_t roc_id, const UInt_t bank_id, UInt_t *buffer, UInt_t num_words)
std::vector< std::pair< Int_t, Int_t > > fWordsPerSubbank
static UInt_t GetUInt(const TString &varvalue)
bool HasValue(const std::string &key)
Has this key been defined.
void ProcessOptions(QwOptions &options)
Process the command line options.
Bool_t IsGoodPhaseNumber()
void ProcessEventUserbitMode()
std::vector< TH1_ptr > fHistograms
Histograms associated with this data element.
virtual Bool_t CollectRandBits()
Bool_t HasDataLoaded() const
Long_t GetPatternNumber()
virtual Bool_t IsGoodHelicity()
Virtual base class for the parity subsystems.
static const UInt_t kInputReg_FakeMPS
Default mask for fake MPS latch bit.
void IncrementErrorCounters()
Increment the error counters.
void ClearErrorCounters()
unsigned int parity(unsigned int v)
UInt_t kEventTypeHelMinus
virtual void ConstructHistograms()
Construct the histograms for this subsystem.
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
void SetHelicityDelay(Int_t delay)
static const Int_t kUndefinedHelicity
UInt_t fHelicityBitPattern
void PrintErrorCounters() const
Report the number of events failed due to HW and event cut failures.
void FillDB(QwParityDB *db, TString type)
Fill the database.
T GetValue(const std::string &key)
Get a templated value.
Bool_t CollectRandBits30()
Int_t fPatternPhaseOffset
virtual VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
Bool_t IsGoodPatternNumber()
Int_t GetHelicityDelayed()
VQwSubsystem & operator+=(VQwSubsystem *value)
VQwSubsystem & operator=(VQwSubsystem *value)
Assignment Note: Must be called at the beginning of all subsystems routine call to operator=(VQwSubsy...
#define QwDebug
Predefined log drain for debugging output.
Int_t GetHelicityReported()
static void DefineOptions()
Define options function (note: no virtual static functions in C++)
Int_t fDelayedPatternPolarity
Reported polarity of the current pattern.
A logfile class, based on an identical class in the Hermes analyzer.
void EncodeEventData(std::vector< UInt_t > &buffer)
Int_t LoadEventCuts(TString filename)
Load the event cuts file.
Bool_t Compare(VQwSubsystem *source)
mysqlpp::Query Query(const char *qstr=0)
Int_t LoadChannelMap(TString mapfile)
Mandatory map file definition.
Int_t fActualPatternPolarity
True polarity of the current pattern.
virtual void ClearEventData()
UInt_t GetEventcutErrorFlag()
Return the error flag to the top level routines related to stability checks and ErrorFlag updates...
void SetHelicityBitPattern(UInt_t bits)
QwHelicity()
Private default constructor (not implemented, will throw linker error on use)
void FillHistograms()
Fill the histograms for this subsystem.
UInt_t BuildHelicityBitPattern(Int_t patternsize)
Int_t fPreviousPatternPolarity
True polarity of the previous pattern.
Int_t fNumMissedEventBlocks
QwHistogramHelper gQwHists
Globally defined instance of the QwHistogramHelper class.
The pure virtual base class of all subsystems.
Bool_t fSuppressMPSErrorMsgs
void SetEventPatternPhase(Int_t event, Int_t pattern, Int_t phase)
Int_t fCurrentROC_ID
ROC ID that is currently being processed.
Int_t RegisterSubbank(const UInt_t bank_id)
Tell the object that it will decode data from this sub-bank in the ROC currently open for registratio...
virtual Int_t RegisterROCNumber(const UInt_t roc_id, const UInt_t bank_id=0)
Tell the object that it will decode data from this ROC and sub-bank.
static std::ostream & endl(std::ostream &)
End of the line.
Int_t LoadInputParameters(TString pedestalfile)
Mandatory parameter file definition.
Bool_t CheckIORegisterMask(const UInt_t &ioregister, const UInt_t &mask) const
void FillTreeVector(std::vector< Double_t > &values) const
Fill the tree vector.
UInt_t GetRandomSeed(UShort_t *first24randbits)
std::vector< QwWord > fWord
Int_t fHelicityDecodingMode
void ProcessEventInputMollerMode()
#define QwWarning
Predefined log drain for warnings.
UInt_t GetEventTypeMask() const
Get event type mask.
Int_t fPatternPhaseNumber
void SetHistoTreeSave(const TString &prefix)
Int_t GetHelicityActual()
virtual void ProcessEvent()
TH1F * Construct1DHist(const TString &inputfile, const TString &name_title)
Int_t fCurrentBank_ID
Bank ID that is currently being processed.
static const UInt_t kDefaultHelicityBitPattern
Bool_t CollectRandBits24()
Bool_t ApplySingleEventCuts()
Apply the single event cuts.
void ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector< Double_t > &values)
Construct the branch and tree vector.
#define RegisterSubsystemFactory(A)
#define QwError
Predefined log drain for errors.
TString GetSubsystemName() const
Bool_t IsGoodEventNumber()
Int_t fPatternPhaseNumberOld
Int_t fPatternNumberFirst
void ConstructBranch(TTree *tree, TString &prefix)
Construct the branch and tree vector.
void SetDataLoaded(Bool_t flag)