Skip to content
Snippets Groups Projects
Commit 2a317791 authored by Chao Peng's avatar Chao Peng
Browse files

add logger messages in helicity related classes and expose data in THcHelicityScaler

parent 1694ab37
Branches
Tags
No related merge requests found
......@@ -490,17 +490,15 @@ Int_t THcHelicity::Decode(const THaEvData& evdata) {
}
} else {
if (fNCycle - fFirstCycle > 4) { // Not at start of run. Reset
_logger->warn("Lost quarted sync at cycle {}", fNCycle);
cout << fQuartet[0] << " " << fQuartet[1] << " " << fQuartet[2] << " "
<< fQuartet[3] << endl;
_logger->warn("Lost quartet sync at cycle {}: {} {} {} {}", fNCycle,
fQuartet[0], fQuartet[1], fQuartet[2], fQuartet[3]);
fFirstCycle +=
4 * ((fNCycle - fFirstCycle) / 4); // Update, but don't change phase
}
fFoundQuartet = kFALSE;
fNBits = 0;
_logger->info("Searching for first of a quaret at cycle {}", fFirstCycle);
cout << fQuartet[0] << " " << fQuartet[1] << " " << fQuartet[2] << " "
<< fQuartet[3] << endl;
_logger->info("Searching for first of a quartet at cycle {}: {} {} {} {}", fFirstCycle,
fQuartet[0], fQuartet[1], fQuartet[2], fQuartet[3]);
fFirstCycle++;
}
} else {
......@@ -577,6 +575,7 @@ void THcHelicity::SetDebug(Int_t level) {
//_____________________________________________________________________________
void THcHelicity::LoadHelicity(Int_t reportedhelicity, Int_t cyclecount, Int_t missedcycles) {
// static const char* const here = "THcHelicity::LoadHelicity";
int quartetphase = (cyclecount - fFirstCycle) % 4;
fnQrt = quartetphase;
......@@ -619,13 +618,12 @@ void THcHelicity::LoadHelicity(Int_t reportedhelicity, Int_t cyclecount, Int_t m
fNBits = 0;
fRingSeed_reported = 0;
} else if (fNBits == fMAXBIT) {
cout << "Seed Found " << bitset<32>(fRingSeed_reported) << " at cycle " << cyclecount
<< " with first cycle " << fFirstCycle << endl;
_logger->info("Seed Found {:32b} at cycle {} with first cycle {}", fRingSeed_reported, cyclecount, fFirstCycle);
if (fglHelicityScaler) {
cout << "Scaler Seed " << bitset<32>(fScalerSeed) << endl;
_logger->info("Scaler Seed {:32b}", fScalerSeed);
}
Int_t backseed = GetSeed30(fRingSeed_reported);
cout << "Seed at cycle " << fFirstCycle << " should be " << hex << backseed << dec << endl;
_logger->info("Seed at cycle {} should be {:#x}", fFirstCycle, backseed);
// Create the "actual seed"
fRingSeed_actual = fRingSeed_reported;
for (Int_t i = 0; i < fHelDelay / 4; i++) {
......
......@@ -45,9 +45,10 @@ Int_t THcHelicityReader::ReadDatabase(const char* /*dbfilename*/, const char* /*
const TDatime& /*date*/, int /*debug_flag*/) {
// Eventually get these from the parameter file
const static char* const here = "THcHelicityReader::ReadDatabase";
// SHMS settings see https://logbooks.jlab.org/entry/3614445
cout << "THcHelicityReader: Helicity information from ROC 2 (SHMS)" << endl;
_logger->info("{}: Helicity information from ROC 2 (SHMS)", here);
SetROCinfo(kHel, 2, 14, 9);
SetROCinfo(kHelm, 2, 14, 8);
SetROCinfo(kMPS, 2, 14, 10);
......@@ -106,8 +107,7 @@ Int_t THcHelicityReader::ReadData(const THaEvData& evdata) {
// Check if ROC info is correct
if (!evdata.GetModule(fROCinfo[kTime].roc, fROCinfo[kTime].slot)) {
cout << "THcHelicityReader: ROC 2 not found" << endl;
cout << "Changing to ROC 1 (HMS)" << endl;
_logger->info("{}: ROC 2 not found, changing to ROC 1 (HMS)", here);
SetROCinfo(kHel, 1, 18, 9);
SetROCinfo(kHelm, 1, 18, 8);
SetROCinfo(kMPS, 1, 18, 10);
......@@ -122,8 +122,7 @@ Int_t THcHelicityReader::ReadData(const THaEvData& evdata) {
(UInt_t)evdata.GetData(fROCinfo[kTime].roc, fROCinfo[kTime].slot, fROCinfo[kTime].index, 0);
// Check again if ROC info is correct
if (titime == 0 && fTITime_last == 0) {
cout << "THcHelicityReader: ROC 2 not found" << endl;
cout << "Changing to ROC 1 (HMS)" << endl;
_logger->info("{}: ROC 2 not found, changing to ROC 1 (HMS)", here);
SetROCinfo(kHel, 1, 18, 9);
SetROCinfo(kHelm, 1, 18, 8);
SetROCinfo(kMPS, 1, 18, 10);
......
......@@ -49,6 +49,15 @@ public:
virtual Int_t GetReportedActual() {return fRingSeed_actual;}
virtual Bool_t IsSeedGood() {return fNBits>=30;}
const std::vector<Double_t> &GetScalerSums() const { return fScalerSums; }
const std::vector<Double_t> &GetAsymmetry() const { return fAsymmetry; }
const std::vector<Double_t> &GetAsymmetryError() const { return fAsymmetryError; }
const std::vector<Double_t> &GetCharge() const { return fCharge; }
const std::vector<Double_t> &GetChargeAsymmetry() const { return fChargeAsymmetry; }
Double_t GetTime() const { return fTime; }
Double_t GetTimeAsymmetry() const { return fTimeAsymmetry; }
Double_t GetTriggerAsymmetry() const { return fTriggerAsymmetry; }
private:
Int_t RanBit30(Int_t ranseed);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment