JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
QwHelicityCorrelatedFeedback Class Reference

#include <QwHelicityCorrelatedFeedback.h>

+ Inheritance diagram for QwHelicityCorrelatedFeedback:
+ Collaboration diagram for QwHelicityCorrelatedFeedback:

Public Member Functions

 QwHelicityCorrelatedFeedback (QwSubsystemArrayParity &event)
 
 ~QwHelicityCorrelatedFeedback ()
 
void CalculateAsymmetry ()
 inherited from QwHelicityPattern
 
void ClearRunningSum ()
 
void AccumulateRunningSum ()
 
void CalculateRunningAverage ()
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, std::vector< Double_t > &values)
 
void FillTreeVector (std::vector< Double_t > &values) const
 
void ProcessOptions (QwOptions &options)
 Process the configuration options.
 
void LoadParameterFile (TString filename)
 Load deltaA_q, no.of good patterns to accumulate and other neccessary feedback parameters.
 
void GetTargetChargeStat ()
 retrieves the target charge asymmetry,asymmetry error ,asymmetry width
 
void GetTargetChargeStat (Int_t mode)
 retrieves the target charge asymmetry,asymmetry error ,asymmetry width for given mode
 
void GetTargetPositionStat ()
 retrieves the target position angle parameters (X,XP,Y,YP) mean, error and width
 
void GetHAChargeStat (Int_t mode)
 retrieves the Hall A charge asymmetry,asymmetry error ,asymmetry width for given mode
 
void FeedIASetPoint (Int_t mode)
 Feed the Hall C IA set point based on the charge asymmetry.
 
void FeedHAIASetPoint (Int_t mode)
 Feed the Hall A IA set point based on the charge asymmetry.
 
void FeedPITASetPoints ()
 Feed the Hall C PITA set point based on the charge asymmetry.
 
void FeedPCPos ()
 Feed the IA set point based on the charge asymmetry.
 
void FeedPCNeg ()
 Feed the IA set point based on the charge asymmetry.
 
void LogParameters (Int_t mode)
 Log the last IA feedback information.
 
void LogParameters ()
 Log the last PITA feedback information.
 
void LogPFParameters ()
 Log the Pos/angle information.
 
void LogHAParameters (Int_t mode)
 Log the last Hall A IA feedback information.
 
void UpdateGMClean (Int_t state)
 Set Clean=0 or 1 in the GreenMonster.
 
void UpdateGMScanParameters ()
 Update last feedback setting into scan variables in the GreenMonster.
 
Bool_t ApplyPITAFeedback ()
 Initiates the PITA feedback if the charge asymmetry passed the quality cut.
 
Bool_t ApplyHAIAFeedback ()
 Initiates the Hall A IA feedback if the Hall A charge asymmetry passed the quality cut.
 
Bool_t ApplyIAFeedback (Int_t mode)
 Initiates the IA feedback if the Hall C charge asymmetry have passed the quality cut.
 
Bool_t ApplyHMFeedback ()
 Initiates the Helicity magnet feedback if the position differences and/or angle differences have passed the quality cut.
 
Bool_t IsPatternsAccumulated ()
 Check to see no.of good patterns accumulated after the last feedback is greater than a set value.
 
Bool_t IsPFPatternsAccumulated ()
 Check to see no.of good patterns accumulated after the last position/angle feedback correction.
 
Bool_t IsHAPatternsAccumulated ()
 Check to see no.of good patterns accumulated after the last position/angle feedback correction.
 
void ApplyFeedbackCorrections ()
 Check neccessary conditions and apply IA setponts based on the charge asym for all four modes.
 
Bool_t IsPatternsAccumulated (Int_t mode)
 Check to see no.of good patterns accumulated after the last feedback is greater than a set value for given mode.
 
Int_t GetLastGoodHelicityPatternType ()
 Returns the type of the last helicity pattern based on following pattern history.
 
void CalculateRunningAverage (Int_t mode)
 
void ClearRunningSum (Int_t mode)
 
- Public Member Functions inherited from QwHelicityPattern
 QwHelicityPattern (QwSubsystemArrayParity &event, const TString &run="0")
 Constructor with subsystem array.
 
 QwHelicityPattern (const QwHelicityPattern &source)
 Copy constructor by reference.
 
virtual ~QwHelicityPattern ()
 Virtual destructor.
 
void ProcessOptions (QwOptions &options)
 Process the configuration options.
 
void LoadEventData (QwSubsystemArrayParity &event)
 
Bool_t HasDataLoaded () const
 
Bool_t PairAsymmetryIsGood ()
 
Bool_t NextPairIsComplete ()
 
void CalculatePairAsymmetry ()
 
void ClearPairData ()
 
Bool_t IsCompletePattern () const
 
void PrintIndexMapFile (Int_t runNum)
 
Bool_t IsEndOfBurst ()
 
void CalculateAsymmetry ()
 
void GetTargetChargeStat (Double_t &asym, Double_t &error, Double_t &width)
 
void EnableAlternateAsymmetry (const Bool_t flag=kTRUE)
 Enable/disable alternate asymmetry calculation.
 
void DisableAlternateAsymmetry ()
 Disable alternate asymmetry calculation.
 
Bool_t IsAlternateAsymEnabled ()
 Status of alternate asymmetry calculation flag.
 
void EnableBurstSum (const Bool_t flag=kTRUE)
 Enable/disable burst sum calculation.
 
void DisableBurstSum ()
 Disable burst sum calculation.
 
Bool_t IsBurstSumEnabled ()
 Status of burst sum calculation flag.
 
void EnableRunningSum (const Bool_t flag=kTRUE)
 Enable/disable running sum calculation.
 
void DisableRunningSum ()
 Disable running sum calculation.
 
Bool_t IsRunningSumEnabled ()
 Status of running sum calculation flag.
 
void EnableDifference (const Bool_t flag=kTRUE)
 Enable/disable storing pattern differences.
 
void DisableDifference ()
 Disable storing pattern differences.
 
Bool_t IsDifferenceEnabled ()
 Status of storing pattern differences flag.
 
void EnablePairs (const Bool_t flag=kTRUE)
 Enable/disable storing pair differences.
 
void DisablePairs ()
 Disable storing pair differences.
 
Bool_t IsPairsEnabled ()
 Status of storing pair differences flag.
 
void UpdateBlinder ()
 Update the blinder status using a random number generator.
 
void UpdateBlinder (const QwSubsystemArrayParity &detectors)
 Update the blinder status with new external information.
 
void UpdateBlinder (const QwEPICSEvent &epics)
 Update the blinder status with new external information.
 
QwSubsystemArrayParityGetYield ()
 
QwSubsystemArrayParityGetDifference ()
 
QwSubsystemArrayParityGetAsymmetry ()
 
QwSubsystemArrayParityGetPairYield ()
 
QwSubsystemArrayParityGetPairDifference ()
 
QwSubsystemArrayParityGetPairAsymmetry ()
 
void AccumulateRunningSum (QwHelicityPattern &entry, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
 
void AccumulatePairRunningSum (QwHelicityPattern &entry)
 
void CalculateRunningAverage ()
 
void PrintValue () const
 
void ConstructObjects ()
 
void ConstructObjects (TDirectory *folder)
 
void ConstructHistograms ()
 
void ConstructHistograms (TDirectory *folder)
 
void FillHistograms ()
 
void ConstructBranchAndVector (TTree *tree, TString &prefix, QwRootTreeBranchVector &values)
 
void ConstructBranch (TTree *tree, TString &prefix)
 
void ConstructBranch (TTree *tree, TString &prefix, QwParameterFile &trim_tree)
 
void FillTreeVector (QwRootTreeBranchVector &values) const
 
void WritePromptSummary (QwPromptSummary *ps)
 
Bool_t IsGoodAsymmetry ()
 
UInt_t GetEventcutErrorFlag () const
 
const UInt_t * GetEventcutErrorFlagPointer () const
 
Bool_t HasBurstData ()
 
void IncrementBurstCounter ()
 
Short_t GetBurstCounter () const
 
void ClearEventData ()
 
void Print () const
 

Static Public Member Functions

static void DefineOptions (QwOptions &options)
 Define the configuration options.
 
- Static Public Member Functions inherited from QwHelicityPattern
static void DefineOptions (QwOptions &options)
 Define the configuration options.
 

Private Member Functions

Double_t GetChargeAsym ()
 Returns the charge asymmetry stats when required by feedback caluculations.
 
Double_t GetChargeAsymError ()
 
Double_t GetChargeAsymWidth ()
 
TString GetHalfWavePlateState ()
 The types of helicity patterns based on following pattern history.
 
UInt_t GetHalfWavePlate2State ()
 
void CheckFeedbackStatus ()
 

Private Attributes

std::vector< QwSubsystemArrayParityfFBRunningAsymmetry
 
Int_t fCurrentHelPat
 
Int_t fPreviousHelPat
 
Int_t fCurrentHelPatMode
 
Double_t fChargeAsymmetry
 
Double_t fChargeAsymmetryError
 
Double_t fChargeAsymmetryWidth
 
Double_t fTargetXDiff
 
Double_t fTargetXDiffError
 
Double_t fTargetXDiffWidth
 
Double_t fTargetXPDiff
 
Double_t fTargetXPDiffError
 
Double_t fTargetXPDiffWidth
 
Double_t fTargetYDiff
 
Double_t fTargetYDiffError
 
Double_t fTargetYDiffWidth
 
Double_t fTargetYPDiff
 
Double_t fTargetYPDiffError
 
Double_t fTargetYPDiffWidth
 
Double_t f3C12XDiff
 
Double_t f3C12XDiffError
 
Double_t f3C12XDiffWidth
 
Double_t f3C12YDiff
 
Double_t f3C12YDiffError
 
Double_t f3C12YDiffWidth
 
Double_t f3C12YQ
 
Double_t f3C12YQError
 
Double_t f3C12YQWidth
 
Double_t fAsymBCM78DD
 
Double_t fAsymBCM78DDError
 
Double_t fAsymBCM78DDWidth
 
Double_t fBCM8Yield
 
Double_t fAsymBCMUSLumiSum
 
Double_t fAsymBCMUSLumiSumError
 
Double_t fAsymBCMUSLumiSumWidth
 
Double_t fChargeAsym [kHelModes]
 
Double_t fChargeAsymError [kHelModes]
 
Double_t fChargeAsymWidth [kHelModes]
 
Double_t fHAChargeAsym [kHelModes]
 
Double_t fHAChargeAsymError [kHelModes]
 
Double_t fHAChargeAsymWidth [kHelModes]
 
Int_t fAccumulatePatternMax
 
Int_t fHAAccumulatePatternMax
 
Int_t fPFAccumulatePatternMax
 
Double_t fChargeAsymPrecision
 
Double_t fOptimalIA
 
Double_t fOptimalPCP
 
Double_t fOptimalPCN
 
Double_t fCurrentIA
 
Double_t fCurrentPCP
 
Double_t fCurrentPCN
 
Double_t fIASlopeA [kHelModes]
 
Double_t fDelta_IASlopeA [kHelModes]
 
Double_t fHAIASlopeA [kHelModes]
 
Double_t fHADelta_IASlopeA [kHelModes]
 
Double_t fIASetpoint [kHelModes]
 
Double_t fPrevIASetpoint [kHelModes]
 
Double_t fHAIASetpoint [kHelModes]
 
Double_t fPrevHAIASetpoint [kHelModes]
 
Double_t fIASetpointlow
 
Double_t fIASetpointup
 
Double_t fPITASlopeIN
 
Double_t fPITASlopeOUT
 
Double_t fPITASlopeOUT_IN
 
Double_t fPITASlope
 
Double_t fPITASetpointPOS
 
Double_t fPITASetpointNEG
 
Double_t fPITASetpointPOS_t0_IN
 
Double_t fPITASetpointNEG_t0_IN
 
Double_t fPITASetpointPOS_t0_OUT
 
Double_t fPITASetpointNEG_t0_OUT
 
Bool_t fInitialCorrection
 
Double_t fPrevPITASetpointPOS
 
Double_t fPrevPITASetpointNEG
 
Double_t fPITASetpointlow
 
Double_t fPITASetpointup
 
Double_t fPITA_MIN_Charge_asym
 
QwEPICSControl fEPICSCtrl
 Create an EPICS control event.
 
GreenMonster fScanCtrl
 
Int_t fGoodPatternCounter
 
Int_t fHAGoodPatternCounter
 
Int_t fPFGoodPatternCounter
 
Int_t fPatternCounter
 
std::vector< Int_t > fHelModeGoodPatternCounter
 
QwBeamCharge fTargetCharge
 
QwBeamCharge fRunningCharge
 
QwBeamCharge fChargeAsymmetry0
 
QwBeamCharge fPreviousChargeAsymmetry
 
QwBeamCharge fCurrentChargeAsymmetry
 
QwBeamCharge fIAAsymmetry0
 
QwBeamCharge fPreviousIAAsymmetry
 
QwBeamCharge fCurrentIAAsymmetry
 
QwSIS3801D24_Channel fScalerCharge
 
QwSIS3801D24_Channel fScalerChargeRunningSum
 
QwBeamCharge fTargetParameter
 
QwBeamCharge fTargetXDiffRunningSum
 
QwBeamCharge fTargetXPDiffRunningSum
 
QwBeamCharge fTargetYDiffRunningSum
 
QwBeamCharge fTargetYPDiffRunningSum
 
QwBeamCharge f3C12XDiffRunningSum
 
QwBeamCharge f3C12YDiffRunningSum
 
QwBeamCharge f3C12YQRunningSum
 
QwBeamCharge fAsymBCM7
 
QwBeamCharge fAsymBCM8
 
QwBeamCharge fAsymBCM78DDRunningSum
 
QwBeamCharge fYieldBCM8RunningSum
 
QwBeamCharge fAsymUSLumiSumRunningSum
 
FILE * out_file_PITA
 
FILE * out_file_IA
 
FILE * IHWP_State
 
FILE * out_file_HA_IA
 
FILE * out_file_PC_IN_pos
 
FILE * out_file_PC_IN_neg
 
FILE * out_file_PC_OUT_pos
 
FILE * out_file_PC_OUT_neg
 
Bool_t fHalfWaveIN
 
Bool_t fHalfWaveOUT
 
Int_t fIHWP
 
Bool_t fHalfWaveRevert
 
Bool_t fAutoIHWP
 
TString fHalfWavePlateStatus
 
UInt_t fDefaultHalfWavePlateStatus
 
UInt_t fPreviousHalfWavePlateStatus
 
Bool_t fPITAFB
 
Bool_t fHAIAFB
 
Bool_t fIAFB
 
Bool_t fFeedbackStatus
 
Bool_t fFeedbackDamping
 
time_t rawtime
 
struct tm * timeinfo
 

Static Private Attributes

static const Int_t kHelPat1 =1001
 
static const Int_t kHelPat2 =110
 
static const Int_t kHelModes =4
 

Additional Inherited Members

- Protected Member Functions inherited from QwHelicityPattern
void SetDataLoaded (Bool_t flag)
 
- Protected Attributes inherited from QwHelicityPattern
std::vector< QwSubsystemArrayParityfEvents
 
std::vector< Bool_t > fEventLoaded
 
std::vector< Int_t > fHelicity
 
std::vector< Int_t > fEventNumber
 
Int_t fCurrentPatternNumber
 
size_t fPatternSize
 
Int_t fQuartetNumber
 
QwBlinder fBlinder
 
Bool_t fHelicityIsMissing
 
Bool_t fIgnoreHelicity
 
QwSubsystemArrayParity fYield
 
QwSubsystemArrayParity fDifference
 
QwSubsystemArrayParity fAsymmetry
 
Bool_t fEnableAlternateAsym
 
QwSubsystemArrayParity fAsymmetry1
 
QwSubsystemArrayParity fAsymmetry2
 
Bool_t fEnablePairs
 
QwSubsystemArrayParity fPairYield
 
QwSubsystemArrayParity fPairDifference
 
QwSubsystemArrayParity fPairAsymmetry
 
Int_t fBurstLength
 
Int_t fMaxBurstIndex
 
Bool_t fPrintIndexFile
 
Int_t fBurstMinGoodPatterns
 
Int_t fGoodPatterns
 
Short_t fBurstCounter
 
Bool_t fEnableBurstSum
 
Bool_t fPrintBurstSum
 
Bool_t fEnableRunningSum
 
Bool_t fPrintRunningSum
 
Bool_t fEnableDifference
 
QwSubsystemArrayParity fAlternateDiff
 
QwSubsystemArrayParity fPositiveHelicitySum
 
QwSubsystemArrayParity fNegativeHelicitySum
 
Long_t fLastWindowNumber
 
Long_t fLastPatternNumber
 
Int_t fLastPhaseNumber
 
size_t fNextPair
 
Bool_t fPairIsGood
 
Bool_t fPatternIsGood
 
TString run_label
 
Bool_t fIsDataLoaded
 

Detailed Description

Definition at line 23 of file QwHelicityCorrelatedFeedback.h.

Constructor & Destructor Documentation

◆ QwHelicityCorrelatedFeedback()

QwHelicityCorrelatedFeedback::QwHelicityCorrelatedFeedback ( QwSubsystemArrayParity & event)
inline

Definition at line 31 of file QwHelicityCorrelatedFeedback.h.

31 :QwHelicityPattern(event){
32 //Currently pattern type based runningasymmetry accumulation works only with pattern size of 4
33 fFBRunningAsymmetry.resize(kHelModes,event);
35
36 fEnableBurstSum=kFALSE;
41
42
43/* fFeedbackStatus=kTRUE; */
44/* if (fEPICSCtrl.Get_FeedbackStatus()>0) */
45/* fEPICSCtrl.Set_FeedbackStatus(0); */
46/* if (fFeedbackStatus){ */
47/* fFeedbackStatus=kFALSE; */
48/* fEPICSCtrl.Set_FeedbackStatus(1.0); */
49/* } */
50
52
53 fPreviousHelPat=0;//at the beginning of the run this is non existing
54 fCurrentHelPatMode=-1;//at the beginning of the run this is non existing
55
60 fPITA_MIN_Charge_asym=1;//default value is 1ppm
61
62 //initialize setpoints to zero
63 //HA IA
64 for(Int_t i=0;i<4;i++){
66 fHAIASetpoint[i]=0;
67 }
68 //PITA
73
74
75 fTargetCharge.InitializeChannel("q_targ","derived");
76 fRunningCharge.InitializeChannel("q_targ","derived");
77 fAsymBCM7.InitializeChannel("bcm7","derived");
78 fAsymBCM8.InitializeChannel("bcm8","derived");
79
80 fChargeAsymmetry0.InitializeChannel("q_targ","derived");//this is the charge asym at the beginning of the feedback loop
81 fPreviousChargeAsymmetry.InitializeChannel("q_targ","derived");//charge asymmetry at the previous feedback loop
82 fCurrentChargeAsymmetry.InitializeChannel("q_targ","derived");//current charge asymmetry
83
84 fIAAsymmetry0.InitializeChannel("q_targ","derived");//this is the charge asymmetry of the IA at the beginning of the feedback loop
85 fPreviousIAAsymmetry.InitializeChannel("q_targ","derived");//this is the charge asymmetry of the IA at the previous feedback loop
86 fCurrentIAAsymmetry.InitializeChannel("q_targ","derived");//current charge asymmetry of the IA
87
88 fScalerChargeRunningSum.InitializeChannel("sca_bcm");
89 fScalerCharge.InitializeChannel("sca_bcm");
90
91 fTargetParameter.InitializeChannel("x_targ","derived");
92
93 fTargetXDiffRunningSum.InitializeChannel("x_targ","derived");//to access the published Target X diff
94 fTargetXPDiffRunningSum.InitializeChannel("xp_targ","derived");//to access the published Target XP diff
95 fTargetYDiffRunningSum.InitializeChannel("y_targ","derived");//to access the published Target Y diff
96 fTargetYPDiffRunningSum.InitializeChannel("yp_targ","derived");//to access the published Target YP diff
97
98 fAsymBCM78DDRunningSum.InitializeChannel("bcm78dd","derived");
99 fYieldBCM8RunningSum.InitializeChannel("q_targ","derived");
100 fAsymUSLumiSumRunningSum.InitializeChannel("uslumisum","derived");
101
102 time ( &rawtime );
103 timeinfo = localtime ( &rawtime );
104 out_file_IA = fopen("/local/scratch/qweak/Feedback_IA_log.txt", "a");
105 //out_file_IA = fopen("/dev/shm/Feedback_IA_log.txt", "a");
106
107 fprintf(out_file_IA,"%22s \n",asctime (timeinfo));
108 fprintf(out_file_IA,"Pat num. \t A_q[mode]\t IA Setpoint \t IA Previous Setpoint \n");
109 fclose(out_file_IA);
110 // out_file_PITA = fopen("Feedback_PITA_log.txt", "wt");
111
112 out_file_PITA = fopen("/local/scratch/qweak/Feedback_PITA_log.txt", "a");
113 out_file_HA_IA = fopen("/local/scratch/qweak/Feedback_HA_IA_log.txt", "a");
114 fprintf(out_file_PITA,"%22s \n",asctime (timeinfo));
115 fprintf(out_file_PITA,
116 "%10s %22s +- %16s %16s %26s %26s %26s %26s\n",
117 "Pat num.", "Charge Asym [ppm]", "Asym Error", "Correction",
118 "New PITA Setpoint[+]", "Old PITA Setpoint[+]",
119 "New PITA Setpoint[-]", "Old PITA Setpoint[-]");
120 fclose(out_file_PITA);
121
122 fprintf(out_file_HA_IA,"%22s \n",asctime (timeinfo));
123 fprintf(out_file_HA_IA,
124 "%10s %22s %16s %16s %26s %23s \n",
125 "Pat num.", "Charge Asym(ppm)", "Asym Error", "Correction",
126 "New IA Setpoint", "Old IA Setpoint");
127 fclose(out_file_HA_IA);
128
129
130
131 };
std::vector< QwSubsystemArrayParity > fFBRunningAsymmetry
QwHelicityPattern()
Private default constructor (not implemented, will throw linker error on use)

References CheckFeedbackStatus(), fAsymBCM7, fAsymBCM78DDRunningSum, fAsymBCM8, fAsymUSLumiSumRunningSum, fChargeAsymmetry0, fCurrentChargeAsymmetry, fCurrentHelPatMode, fCurrentIAAsymmetry, QwHelicityPattern::fEnableBurstSum, fFBRunningAsymmetry, fGoodPatternCounter, fHAGoodPatternCounter, fHAIASetpoint, fHelModeGoodPatternCounter, fIAAsymmetry0, fPatternCounter, fPFGoodPatternCounter, fPITA_MIN_Charge_asym, fPITASetpointNEG, fPITASetpointPOS, fPrevHAIASetpoint, fPreviousChargeAsymmetry, fPreviousHelPat, fPreviousIAAsymmetry, fPrevPITASetpointNEG, fPrevPITASetpointPOS, fRunningCharge, fScalerCharge, fScalerChargeRunningSum, fTargetCharge, fTargetParameter, fTargetXDiffRunningSum, fTargetXPDiffRunningSum, fTargetYDiffRunningSum, fTargetYPDiffRunningSum, fYieldBCM8RunningSum, kHelModes, out_file_HA_IA, out_file_IA, out_file_PITA, QwHelicityPattern::QwHelicityPattern(), rawtime, and timeinfo.

+ Here is the call graph for this function:

◆ ~QwHelicityCorrelatedFeedback()

QwHelicityCorrelatedFeedback::~QwHelicityCorrelatedFeedback ( )
inline

Definition at line 134 of file QwHelicityCorrelatedFeedback.h.

134 {
135 // if (!fFeedbackStatus){
136 // fFeedbackStatus=kFALSE;
137 fEPICSCtrl.Set_FeedbackStatus(0);
138 // }
139
140 };
QwEPICSControl fEPICSCtrl
Create an EPICS control event.

References fEPICSCtrl.

Member Function Documentation

◆ AccumulateRunningSum()

void QwHelicityCorrelatedFeedback::AccumulateRunningSum ( )

Definition at line 1033 of file QwHelicityCorrelatedFeedback.cc.

1033 {
1034 Bool_t bXDiff=kFALSE;
1035 Bool_t bXPDiff=kFALSE;
1036 Bool_t bYDiff=kFALSE;
1037 Bool_t bYPDiff=kFALSE;
1038 Bool_t b3C12XDiff=kFALSE;
1039 Bool_t b3C12YDiff=kFALSE;
1040 Bool_t b3C12YQ=kFALSE;
1041
1042
1043
1044
1046
1047 if(fAsymmetry.RequestExternalValue("sca_bcm", &fScalerCharge)){
1048 //fScalerChargeRunningSum.PrintValue();
1049 //fScalerChargeRunningSum.AccumulateRunningSum(fScalerCharge);
1050 if (fScalerCharge.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1051 fScalerChargeRunningSum.AccumulateRunningSum(fScalerCharge);
1052 fHAGoodPatternCounter++;//update the good HA asymmetry counter
1053 }
1054 }else{
1055 QwError << " Could not get external value setting parameters to sca_bcm" <<QwLog::endl;
1056 fHAIAFB=kFALSE;
1057 }
1058
1059 if(fAsymmetry.RequestExternalValue("x_targ", &fTargetParameter)){
1060 if (fTargetParameter.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1061 fTargetXDiffRunningSum.AccumulateRunningSum(fTargetParameter);
1062 bXDiff=kTRUE;
1063 }
1064 }
1065
1066 if(fAsymmetry.RequestExternalValue("xp_targ", &fTargetParameter)){
1067 if (fTargetParameter.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1068 fTargetXPDiffRunningSum.AccumulateRunningSum(fTargetParameter);
1069 bXPDiff=kTRUE;
1070 }
1071 }
1072
1073 if(fAsymmetry.RequestExternalValue("y_targ", &fTargetParameter)){
1074 if (fTargetParameter.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1075 fTargetYDiffRunningSum.AccumulateRunningSum(fTargetParameter);
1076 bYDiff=kTRUE;
1077 }
1078 }
1079
1080 if(fAsymmetry.RequestExternalValue("yp_targ", &fTargetParameter)){
1081 if (fTargetParameter.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1082 fTargetYPDiffRunningSum.AccumulateRunningSum(fTargetParameter);
1083 bYPDiff=kTRUE;
1084 }
1085 }
1086
1087 if(fAsymmetry.RequestExternalValue("3c12x", &fTargetParameter)){
1088 if (fTargetParameter.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1089 f3C12XDiffRunningSum.AccumulateRunningSum(fTargetParameter);
1090 b3C12XDiff=kTRUE;
1091 }
1092 }
1093
1094 if(fAsymmetry.RequestExternalValue("3c12y", &fTargetParameter)){
1095 if (fTargetParameter.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1096 f3C12YDiffRunningSum.AccumulateRunningSum(fTargetParameter);
1097 b3C12YDiff=kTRUE;
1098 }
1099 }
1100
1101 if(fAsymmetry.RequestExternalValue("bcm7", &fAsymBCM7) && fAsymmetry.RequestExternalValue("bcm8", &fAsymBCM8)){
1102 if (fAsymBCM7.GetEventcutErrorFlag()==0 && fAsymBCM8.GetEventcutErrorFlag()==0 && fAsymmetry.GetEventcutErrorFlag()==0){
1103 fAsymBCM78DDRunningSum.AccumulateRunningSum((fAsymBCM7-fAsymBCM8));
1104 }
1105 }
1106
1107 if(fAsymmetry.RequestExternalValue("uslumisum", &fTargetCharge)){
1108 if (fAsymmetry.GetEventcutErrorFlag()==0 && fTargetCharge.GetEventcutErrorFlag()==0){
1109 fAsymUSLumiSumRunningSum.AccumulateRunningSum(fTargetCharge);
1110 }
1111 }
1112 if(fYield.RequestExternalValue("3c12efc", &fTargetParameter)){
1113 if (fTargetParameter.GetEventcutErrorFlag()==0 && fYield.GetEventcutErrorFlag()==0){
1114 f3C12YQRunningSum.AccumulateRunningSum(fTargetParameter);
1115 b3C12YQ=kTRUE;
1116 }
1117 }
1118 if(fYield.RequestExternalValue("bcm8", &fTargetCharge)){
1119 if (fTargetCharge.GetEventcutErrorFlag()==0 && fYield.GetEventcutErrorFlag()==0){
1120 fYieldBCM8RunningSum.AccumulateRunningSum(fTargetCharge);
1121 }
1122 }
1123
1124
1125
1126
1127
1128
1129
1130
1131 if (bXDiff && bXPDiff && bYDiff && bYPDiff && b3C12YQ)//if all parameters are good
1132 fPFGoodPatternCounter++;//update the good position/angle asymmetry counter
1133
1134
1135
1136
1137
1138
1139 switch(fCurrentHelPatMode){
1140 case 0:
1141 fFBRunningAsymmetry[0].AccumulateRunningSum(fAsymmetry);
1143 break;
1144 case 1:
1145 fFBRunningAsymmetry[1].AccumulateRunningSum(fAsymmetry);
1147 break;
1148 case 2:
1149 fFBRunningAsymmetry[2].AccumulateRunningSum(fAsymmetry);
1151 break;
1152 case 3:
1153 fFBRunningAsymmetry[3].AccumulateRunningSum(fAsymmetry);
1155 break;
1156 }
1157
1158
1159};
#define QwError
Predefined log drain for errors.
Definition QwLog.h:39
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
void AccumulateRunningSum(QwHelicityPattern &entry, Int_t count=0, Int_t ErrorMask=0xFFFFFFF)
QwSubsystemArrayParity fYield
QwSubsystemArrayParity fAsymmetry

References QwHelicityPattern::AccumulateRunningSum(), QwLog::endl(), f3C12XDiffRunningSum, f3C12YDiffRunningSum, f3C12YQRunningSum, fAsymBCM7, fAsymBCM78DDRunningSum, fAsymBCM8, QwHelicityPattern::fAsymmetry, fAsymUSLumiSumRunningSum, fCurrentHelPatMode, fFBRunningAsymmetry, fHAGoodPatternCounter, fHAIAFB, fHelModeGoodPatternCounter, fPFGoodPatternCounter, fScalerCharge, fScalerChargeRunningSum, fTargetCharge, fTargetParameter, fTargetXDiffRunningSum, fTargetXPDiffRunningSum, fTargetYDiffRunningSum, fTargetYPDiffRunningSum, QwHelicityPattern::fYield, fYieldBCM8RunningSum, and QwError.

Referenced by CalculateAsymmetry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplyFeedbackCorrections()

void QwHelicityCorrelatedFeedback::ApplyFeedbackCorrections ( )

Check neccessary conditions and apply IA setponts based on the charge asym for all four modes.

Definition at line 713 of file QwHelicityCorrelatedFeedback.cc.

713 {
714 //Position Feedback
716 QwMessage<<"Initiating Position Feedback"<<QwLog::endl;
718 }
719 //End Position Feedback
720
721 //Hall C IA feedback
722 if (fIAFB){
723 for (Int_t i=0;i<kHelModes;i++){
724 if (IsPatternsAccumulated(i)){
725 QwMessage<<"IsPatternsAccumulated for Hall C IA "<<QwLog::endl;
726 ApplyIAFeedback(i);//Hall C IA is not set up properly
727 }
728 }
729 }
730 //Hall A IA feedback, the condition fHAIAFB is checked inside the IsHAPatternsAccumulated() routine. This is done to report charge Aq even HA feedback is disabled.
732 QwMessage<<"Initiating Hall A IA Feedback"<<QwLog::endl;
734 }
735 //End IA feedback
736
737 //PITA feedback
738 if (fPITAFB){
741 if(fHalfWavePlateStatus.Contains("IN")) {
742 if(fHalfWaveRevert) fHalfWaveIN = false;
743 else fHalfWaveIN = true;
744 }
745 else {
746 if(fHalfWaveRevert) fHalfWaveIN = true;
747 else fHalfWaveIN = false;
748 }
749
751
752 if (fHalfWaveIN)
753 printf("NOTICE \n Half-wave-plate-IN\n");
754 else
755 printf("NOTICE \n Half-wave-plate-OUT\n");
756
757 //Check to see the IHWP has changed if we are running is Auto IHWP mode
758 if (fAutoIHWP){
759 if((fDefaultHalfWavePlateStatus==1 && fHalfWaveOUT) || (fDefaultHalfWavePlateStatus==0 && fHalfWaveIN)){ //IHWP at the start of the feedback is different from current value
760 if (fHalfWaveOUT){
761 fDefaultHalfWavePlateStatus=0;//update the defalut IHWP state to OUT
763 fEPICSCtrl.Set_Pockels_Cell_plus(fPITASetpointPOS_t0_OUT);
764 fEPICSCtrl.Set_Pockels_Cell_minus(fPITASetpointNEG_t0_OUT);
765 }
766 }
767 else{
768 fDefaultHalfWavePlateStatus=1;//update the defalut IHWP state to IN
770 fEPICSCtrl.Set_Pockels_Cell_plus(fPITASetpointPOS_t0_IN);
771 fEPICSCtrl.Set_Pockels_Cell_minus(fPITASetpointNEG_t0_IN);
772 }
773 }
774 fGoodPatternCounter=0;//Reset after each feedback operation
775 ClearRunningSum();//Then reset the running sum
776
777 //Update the new IHWP state in the text file
778 if (IHWP_State!=NULL)
779 fclose(IHWP_State);
780 IHWP_State = fopen("/local/scratch/qweak/Feedback_IHWP.txt", "w");
781 printf("NOTICE \n Updating new IHWP %s \n",fHalfWavePlateStatus.Data());
782 if (IHWP_State!=NULL){
783 fprintf(IHWP_State,"%s",fHalfWavePlateStatus.Data());
784 fclose(IHWP_State);
785 }
786
787 return;//and start the correction loop all over
788 }
789
790 }
791
792 ApplyPITAFeedback();//PITA corrections initiate here
793 }
794 }
795 //End PITA feedback
796
797 return;
798
799};
#define QwMessage
Predefined log drain for regular messages.
Definition QwLog.h:49
Bool_t IsHAPatternsAccumulated()
Check to see no.of good patterns accumulated after the last position/angle feedback correction.
Bool_t ApplyIAFeedback(Int_t mode)
Initiates the IA feedback if the Hall C charge asymmetry have passed the quality cut.
Bool_t ApplyHMFeedback()
Initiates the Helicity magnet feedback if the position differences and/or angle differences have pass...
Bool_t IsPatternsAccumulated()
Check to see no.of good patterns accumulated after the last feedback is greater than a set value.
Bool_t ApplyHAIAFeedback()
Initiates the Hall A IA feedback if the Hall A charge asymmetry passed the quality cut.
Bool_t ApplyPITAFeedback()
Initiates the PITA feedback if the charge asymmetry passed the quality cut.
Bool_t IsPFPatternsAccumulated()
Check to see no.of good patterns accumulated after the last position/angle feedback correction.
TString GetHalfWavePlateState()
The types of helicity patterns based on following pattern history.

References ApplyHAIAFeedback(), ApplyHMFeedback(), ApplyIAFeedback(), ApplyPITAFeedback(), ClearRunningSum(), QwLog::endl(), fAutoIHWP, fDefaultHalfWavePlateStatus, fEPICSCtrl, fGoodPatternCounter, fHalfWaveIN, fHalfWaveOUT, fHalfWavePlateStatus, fHalfWaveRevert, fIAFB, fPITAFB, fPITASetpointNEG_t0_IN, fPITASetpointNEG_t0_OUT, fPITASetpointPOS_t0_IN, fPITASetpointPOS_t0_OUT, GetHalfWavePlateState(), IHWP_State, IsHAPatternsAccumulated(), IsPatternsAccumulated(), IsPFPatternsAccumulated(), kHelModes, and QwMessage.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplyHAIAFeedback()

Bool_t QwHelicityCorrelatedFeedback::ApplyHAIAFeedback ( )

Initiates the Hall A IA feedback if the Hall A charge asymmetry passed the quality cut.

Definition at line 620 of file QwHelicityCorrelatedFeedback.cc.

620 {
621 Bool_t status=kFALSE;
622
624 if (fHAChargeAsym[0]==-1 && fHAChargeAsymError[0] == -1 && fHAChargeAsymWidth[0]==-1){//target asymmetry not published or accesible
625 QwError<<"Hall A asymmetry not published or accesible"<<QwLog::endl;
626 }else{
627 fHAChargeAsymError[0]=fHAChargeAsymError[0]*1.0e+6;//converts to ppm
628 fHAChargeAsym[0]=fHAChargeAsym[0]*1e+6;//converts to ppm
629 fHAChargeAsymWidth[0]=fHAChargeAsymWidth[0]*1e+6;//converts to ppm
631 QwError<<"Hall A Charge Asymmetry precision has not reached. Current value "<<fHAChargeAsymError[0]<<" Expected "<<fChargeAsymPrecision<<QwLog::endl;
632 QwError<<"--------------------------------------------------------------------------------------------------------------------------------"<<QwLog::endl;
634 }else{
635 //QwError<<"Hall A Charge Asymmetry precision, Current value "<<fHAChargeAsymError[0]<<" Expected "<<fChargeAsymPrecision<<QwLog::endl;
636 if (fHAIAFB){
637 //UpdateGMClean(0);//set to not clean - Diabled the cfsocket comm-rakithab 11-27-2011
639 //UpdateGMClean(1);//set back to clean
640 //fHAGoodPatternCounter=0;
641 }
643 LogHAParameters(0);
644 }
645 }
646
647 return status;
648};
void FeedHAIASetPoint(Int_t mode)
Feed the Hall A IA set point based on the charge asymmetry.
void GetHAChargeStat(Int_t mode)
retrieves the Hall A charge asymmetry,asymmetry error ,asymmetry width for given mode
void LogHAParameters(Int_t mode)
Log the last Hall A IA feedback information.

References QwLog::endl(), fChargeAsymPrecision, FeedHAIASetPoint(), fHAChargeAsym, fHAChargeAsymError, fHAChargeAsymWidth, fHAGoodPatternCounter, fHAIAFB, GetHAChargeStat(), LogHAParameters(), and QwError.

Referenced by ApplyFeedbackCorrections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplyHMFeedback()

Bool_t QwHelicityCorrelatedFeedback::ApplyHMFeedback ( )

Initiates the Helicity magnet feedback if the position differences and/or angle differences have passed the quality cut.

Definition at line 693 of file QwHelicityCorrelatedFeedback.cc.

693 {
694 GetTargetPositionStat();//read running averages for target
695
696 //for now the targer paremeters are simply published
698 fPFGoodPatternCounter=0;//reset good pattern counter
699 fTargetXDiffRunningSum.ClearEventData();//reset the running sums
700 fTargetXPDiffRunningSum.ClearEventData();//reset the running sums
701 fTargetYDiffRunningSum.ClearEventData();//reset the running sums
702 fTargetYPDiffRunningSum.ClearEventData();//reset the running sums
703 f3C12XDiffRunningSum.ClearEventData();//reset the running sums
704 f3C12YDiffRunningSum.ClearEventData();//reset the running sums
705 f3C12YQRunningSum.ClearEventData();//reset the running sums
706
707
708 return kTRUE;
709};
void GetTargetPositionStat()
retrieves the target position angle parameters (X,XP,Y,YP) mean, error and width
void LogPFParameters()
Log the Pos/angle information.

References f3C12XDiffRunningSum, f3C12YDiffRunningSum, f3C12YQRunningSum, fPFGoodPatternCounter, fTargetXDiffRunningSum, fTargetXPDiffRunningSum, fTargetYDiffRunningSum, fTargetYPDiffRunningSum, GetTargetPositionStat(), and LogPFParameters().

Referenced by ApplyFeedbackCorrections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplyIAFeedback()

Bool_t QwHelicityCorrelatedFeedback::ApplyIAFeedback ( Int_t mode)

Initiates the IA feedback if the Hall C charge asymmetry have passed the quality cut.

Definition at line 651 of file QwHelicityCorrelatedFeedback.cc.

651 {
652 Bool_t HCstatus=kFALSE;
653
654 if (mode<0 || mode>3){
655 QwError << " Could not get external value setting parameters to q_targ" <<QwLog::endl;
656 return kFALSE;
657 }
658 QwMessage<<"ApplyIAFeedback["<<mode<<"]\n";
659
661
662 if (fChargeAsym[mode]==-1 && fChargeAsymError[mode] == -1 && fChargeAsymWidth[mode]==-1){//target asymmetry not published or accesible
663 QwError<<"target asymmetry not published or accesible"<<QwLog::endl;
664 HCstatus=kFALSE;
665 }else{
666 fChargeAsymError[mode]=fChargeAsymError[mode]*1e+6;//converts to ppm
667 fChargeAsym[mode]=fChargeAsym[mode]*1e+6;//converts to ppm
668 fChargeAsymWidth[mode]=fChargeAsymWidth[mode]*1e+6;//converts to ppm
670 QwError<<"Charge Asymmetry["<<mode<<"] precision not reached current value "<<fChargeAsymError[mode]<<" Expected "<<fChargeAsymPrecision<<QwLog::endl;
671 QwError<<"--------------------------------------------------------------------------------------------------------------------------------"<<QwLog::endl;
672 HCstatus=kFALSE;
674 }else
675 HCstatus=kTRUE;
676 }
677
678
679 if (HCstatus && fIAFB){
680 QwError<<"Charge Asymmetry["<<mode<<"] precision current value "<<fChargeAsymError[mode]<<" Expected "<<fChargeAsymPrecision<<QwLog::endl;
681 //UpdateGMClean(0);//set to not clean - Diabled the cfsocket comm-rakithab 11-27-2011
682 FeedIASetPoint(mode);
683 LogParameters(mode);
684 //UpdateGMClean(1);//set back to clean
687 }
688
689
690 return HCstatus;
691};
void GetTargetChargeStat()
retrieves the target charge asymmetry,asymmetry error ,asymmetry width
void LogParameters()
Log the last PITA feedback information.
void FeedIASetPoint(Int_t mode)
Feed the Hall C IA set point based on the charge asymmetry.

References QwLog::endl(), fChargeAsym, fChargeAsymError, fChargeAsymPrecision, fChargeAsymWidth, FeedIASetPoint(), fHAGoodPatternCounter, fHelModeGoodPatternCounter, fIAFB, GetTargetChargeStat(), LogParameters(), QwError, and QwMessage.

Referenced by ApplyFeedbackCorrections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ApplyPITAFeedback()

Bool_t QwHelicityCorrelatedFeedback::ApplyPITAFeedback ( )

Initiates the PITA feedback if the charge asymmetry passed the quality cut.

Definition at line 590 of file QwHelicityCorrelatedFeedback.cc.

590 {
591 Bool_t status=kFALSE;
592 GetTargetChargeStat();//call the calculate running sum routine and access the q_targ published value
593 if (fChargeAsymmetry==-1 && fChargeAsymmetryError == -1 && fChargeAsymmetryWidth==-1){//target asymmetry not published or accesible
594 QwError<<"target asymmetry not published or accesible"<<QwLog::endl;
595 status=kFALSE;
596 }
597 fChargeAsymmetryError=fChargeAsymmetryError*1e+6;//converts to ppm
598 fChargeAsymmetry=fChargeAsymmetry*1e+6;//converts to ppm
599 fChargeAsymmetryWidth=fChargeAsymmetryWidth*1e+6;//converts to ppm
601 QwError<<"Charge Asymmetry precision has not reached. Current value "<<fChargeAsymmetryError<<" Expected "<<fChargeAsymPrecision<<QwLog::endl;
602 status=kFALSE;
604 }
605 else{
606 QwError<<"Charge Asymmetry precision, Current value "<<fChargeAsymmetryError<<" Expected "<<fChargeAsymPrecision<<QwLog::endl;
607 //UpdateGMClean(0);//set to not clean - Diabled the cfsocket comm-rakithab 11-27-2011
608 FeedPITASetPoints();//set the new PITA values
609 LogParameters();//Log PITA setting after feedback
610 //UpdateGMClean(1);//set back to clean
611 status=kTRUE;
612 fGoodPatternCounter=0;//Reset after each feedback operation
613 }
614
615
616 return status;
617};
void FeedPITASetPoints()
Feed the Hall C PITA set point based on the charge asymmetry.

References QwLog::endl(), fChargeAsymmetry, fChargeAsymmetryError, fChargeAsymmetryWidth, fChargeAsymPrecision, FeedPITASetPoints(), fGoodPatternCounter, GetTargetChargeStat(), LogParameters(), and QwError.

Referenced by ApplyFeedbackCorrections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateAsymmetry()

void QwHelicityCorrelatedFeedback::CalculateAsymmetry ( )

inherited from QwHelicityPattern

Calculate asymmetries for the current pattern.

Definition at line 820 of file QwHelicityCorrelatedFeedback.cc.

821{
822
823 Bool_t localdebug=kFALSE;
824
825 if(localdebug) std::cout<<"Entering QwHelicityPattern::CalculateAsymmetry \n";
826
827 Int_t plushel = 1;
828 Int_t minushel = 0;
829 Int_t checkhel = 0;
830 Bool_t firstplushel=kTRUE;
831 Bool_t firstminushel=kTRUE;
832
833 fPositiveHelicitySum.ClearEventData();
834 fNegativeHelicitySum.ClearEventData();
835
836 if (fIgnoreHelicity){
837 // Don't check to see if we have equal numbers of even and odd helicity states in this pattern.
838 // Build an asymmetry with even-parity phases as "+" and odd-parity phases as "-"
839 for (size_t i = 0; i < (size_t) fPatternSize; i++) {
840 Int_t localhel = 1;
841 for (size_t j = 0; j < (size_t) fPatternSize/2; j++) {
842 localhel ^= ((i >> j)&0x1);
843 }
844 if (localhel == plushel) {
845 if (firstplushel) {
847 firstplushel = kFALSE;
848 } else {
850 }
851 } else if (localhel == minushel) {
852 if (firstminushel) {
854 firstminushel = kFALSE;
855 } else {
857 }
858 }
859 }
860 } else {
861 //
863 for (size_t i = 0; i < (size_t) fPatternSize; i++) {
864 if (fHelicity[i] == plushel) {
865 if (fPatternSize==4){//currently works only for pattern size of 4
866 switch(i){
867 case 0:
868 //fCurrentHelPat+=1;
869 fCurrentHelPat+=1000;
870 break;
871 case 1:
872 //fCurrentHelPat+=10;
873 fCurrentHelPat+=100;
874 break;
875 case 2:
876 //fCurrentHelPat+=100;
877 fCurrentHelPat+=10;
878 break;
879 case 3:
880 //fCurrentHelPat+=1000;
882 break;
883 }
884 }
885
886 if (localdebug)
887 std::cout<<"QwHelicityPattern::CalculateAsymmetry:: here filling fPositiveHelicitySum \n";
888 if (firstplushel) {
889 if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with = \n";
891 firstplushel = kFALSE;
892 } else {
893 if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with += \n";
895 }
896 checkhel += 1;
897 } else if (fHelicity[i] == minushel) {
898 if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: here filling fNegativeHelicitySum \n";
899 if (firstminushel) {
900 if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with = \n";
902 firstminushel = kFALSE;
903 } else {
904 if (localdebug) std::cout<<"QwHelicityPattern::CalculateAsymmetry:: with += \n";
906 }
907 checkhel -= 1;
908 } else {
909 QwError<< "QwHelicityPattern::CalculateAsymmetry =="
910 << "Helicity should be "<<plushel<<" or "<<minushel<<" but is"<< fHelicity[i]
911 << "; Asymmetry computation aborted!"<<QwLog::endl;
913 i = fPatternSize;
914 checkhel = -9999;
915 // This is an unknown helicity event.
916 }
917
918 }
919
920 }
921
922 if (checkhel == -9999) {
923 //do nothing the asymmetry computation has been aborted earlier in this function
924 fPatternIsGood = kFALSE;
925 } else if (checkhel!=0) {
926 fPatternIsGood = kFALSE;
927 // there is a different number of plus and minus helicity window.
928 QwError<<" QwHelicityPattern::CalculateAsymmetry == \n"
929 <<" you do not have the same number of positive and negative \n"
930 <<" impossible to compute assymetry \n"
931 <<" dropping every thing -- pattern number ="<<fCurrentPatternNumber<<QwLog::endl;
932 } else {
933 // This is a good pattern.
934 // Calculate the asymmetry.
935
936 //Now set the HelPatMode
937 if (fPreviousHelPat){
946 else
947 fCurrentHelPatMode=-1;//error
948 }
949 //save the current pattern size to previouspat
950 if (localdebug)
951 QwMessage<<"QwHelicityPattern::CalculateAsymmetry current helpat is "<<fCurrentHelPat<<" Prev pat "<<fPreviousHelPat<<" Mode "<<fCurrentHelPatMode<<" \n";
953
954 fPatternIsGood = kTRUE;
956 //std::cout<<" quartet count ="<<fQuartetNumber<<"\n";
957
959 fYield.Scale(1.0/fPatternSize);
961 fDifference.Scale(1.0/fPatternSize);
962 if (! fIgnoreHelicity){
963 // Only blind the difference if we're using the real helicity.
965 }
967
968 if (fAsymmetry.GetEventcutErrorFlag()==0){//good pattern
969 //fPatternIsGood = kTRUE;
970 fGoodPatternCounter++;//increment the quartet number - reset after each PITA feedback operation
971 fQuartetNumber++;//Then increment the quartet number - continously count
972 }
973
974 /*
975 With additional two asymmetry calculations
976 Don't blind them!
977
978 quartet pattern + - - +
979 1 2 3 4
980 fAsymmetry = (1+4)-(2+3)/(1+2+3+4)
981 fAsymmetry1 = (1+2)-(3+4)/(1+2+3+4)
982 fAsymmetry2 = (1+3)-(2+4)/(1+2+3+4)
983 */
985 // fAsymmetry1: (first 1/2 pattern - second 1/2 pattern)/fYield
986 fPositiveHelicitySum.ClearEventData();
987 fNegativeHelicitySum.ClearEventData();
990 if (fPatternSize/2 > 1){
991 for (size_t i = 1; i < (size_t) fPatternSize/2 ; i++){
994 }
995 }
996 fAlternateDiff.ClearEventData();
998 // Do not blind this helicity-uncorrelated difference.
1000 // fAsymmetry2: (even events - odd events)/fYield
1001 // Only build fAsymmetry2 if fPatternSize>2.
1002 if (fPatternSize > 2) {
1003 fPositiveHelicitySum.ClearEventData();
1004 fNegativeHelicitySum.ClearEventData();
1007 if (fPatternSize/2 > 1){
1008 for (size_t i = 1; i < (size_t) fPatternSize/2 ; i++){
1009 fPositiveHelicitySum += fEvents.at(2*i);
1010 fNegativeHelicitySum += fEvents.at(2*i + 1);
1011 }
1012 }
1013 fAlternateDiff.ClearEventData();
1015 // Do not blind this helicity-uncorrelated difference.
1017 }
1018 }
1019
1020 // Accumulate the burst and running sums
1021 if (fEnableBurstSum) AccumulateBurstSum();
1022 if (fEnableRunningSum) {
1024 }
1025
1026 if (localdebug) QwDebug << " pattern number =" << fQuartetNumber << QwLog::endl;
1027 }
1028
1029 return;
1030};
#define QwDebug
Predefined log drain for debugging output.
Definition QwLog.h:59
QwSubsystemArrayParity fAlternateDiff
QwSubsystemArrayParity fNegativeHelicitySum
QwSubsystemArrayParity fDifference
std::vector< QwSubsystemArrayParity > fEvents
std::vector< Int_t > fHelicity
QwSubsystemArrayParity fAsymmetry1
QwSubsystemArrayParity fPositiveHelicitySum
QwSubsystemArrayParity fAsymmetry2

References AccumulateRunningSum(), QwHelicityPattern::ClearEventData(), QwLog::endl(), QwHelicityPattern::fAlternateDiff, QwHelicityPattern::fAsymmetry, QwHelicityPattern::fAsymmetry1, QwHelicityPattern::fAsymmetry2, QwHelicityPattern::fBlinder, fCurrentHelPat, fCurrentHelPatMode, QwHelicityPattern::fCurrentPatternNumber, QwHelicityPattern::fDifference, QwHelicityPattern::fEnableAlternateAsym, QwHelicityPattern::fEnableBurstSum, QwHelicityPattern::fEnableRunningSum, QwHelicityPattern::fEvents, fGoodPatternCounter, QwHelicityPattern::fHelicity, QwHelicityPattern::fIgnoreHelicity, QwHelicityPattern::fNegativeHelicitySum, fPatternCounter, QwHelicityPattern::fPatternIsGood, QwHelicityPattern::fPatternSize, QwHelicityPattern::fPositiveHelicitySum, fPreviousHelPat, QwHelicityPattern::fQuartetNumber, QwHelicityPattern::fYield, kHelPat1, kHelPat2, QwDebug, QwError, and QwMessage.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CalculateRunningAverage() [1/2]

void QwHelicityCorrelatedFeedback::CalculateRunningAverage ( )

Definition at line 1163 of file QwHelicityCorrelatedFeedback.cc.

References QwHelicityPattern::CalculateRunningAverage().

+ Here is the call graph for this function:

◆ CalculateRunningAverage() [2/2]

void QwHelicityCorrelatedFeedback::CalculateRunningAverage ( Int_t mode)

Definition at line 1167 of file QwHelicityCorrelatedFeedback.cc.

1167 {
1168 fFBRunningAsymmetry[mode].CalculateRunningAverage();
1169};

References fFBRunningAsymmetry.

◆ CheckFeedbackStatus()

void QwHelicityCorrelatedFeedback::CheckFeedbackStatus ( )
private

Definition at line 1380 of file QwHelicityCorrelatedFeedback.cc.

1381{
1382 Double_t old_status = 0.0;
1383 old_status = fEPICSCtrl.Get_FeedbackStatus();
1384 if(old_status == 1.0) {
1385 // EPIC says, feedback is on, but we start it now.
1386 // qwfeedback was killed by "kill -9 option" or was ended improperly.
1387 fEPICSCtrl.Set_FeedbackStatus(0.0);
1388 fFeedbackStatus=kFALSE;
1389 gSystem->Sleep(4000); // wait 4 secs
1390 }
1391 fEPICSCtrl.Set_FeedbackStatus(1.0);
1392 fFeedbackStatus=kTRUE;
1393}

References fEPICSCtrl, and fFeedbackStatus.

Referenced by QwHelicityCorrelatedFeedback().

+ Here is the caller graph for this function:

◆ ClearRunningSum() [1/2]

void QwHelicityCorrelatedFeedback::ClearRunningSum ( )

Clear the running sums of yield, difference and asymmetry. Also clear the running burst sums if enabled.

Definition at line 1340 of file QwHelicityCorrelatedFeedback.cc.

1341{
1342 QwHelicityPattern::ClearRunningSum();
1343 //Clean bcm8 yield and bcm78 DD running sums
1344 fAsymBCM78DDRunningSum.ClearEventData();
1345 fYieldBCM8RunningSum.ClearEventData();
1346 //clear US lumi running sum
1347 fAsymUSLumiSumRunningSum.ClearEventData();
1348}

References fAsymBCM78DDRunningSum, fAsymUSLumiSumRunningSum, and fYieldBCM8RunningSum.

Referenced by ApplyFeedbackCorrections(), FeedPITASetPoints(), and main().

+ Here is the caller graph for this function:

◆ ClearRunningSum() [2/2]

void QwHelicityCorrelatedFeedback::ClearRunningSum ( Int_t mode)

Definition at line 1350 of file QwHelicityCorrelatedFeedback.cc.

1351{
1352 fFBRunningAsymmetry[mode].ClearEventData();
1353};

References fFBRunningAsymmetry.

◆ ConstructBranchAndVector()

void QwHelicityCorrelatedFeedback::ConstructBranchAndVector ( TTree * tree,
TString & prefix,
std::vector< Double_t > & values )

Definition at line 1355 of file QwHelicityCorrelatedFeedback.cc.

1355 {
1357};
void ConstructBranchAndVector(TTree *tree, TString &prefix, QwRootTreeBranchVector &values)

References QwHelicityPattern::ConstructBranchAndVector().

+ Here is the call graph for this function:

◆ DefineOptions()

void QwHelicityCorrelatedFeedback::DefineOptions ( QwOptions & options)
static

Define the configuration options.

Defines configuration options using QwOptions functionality.

Parameters
optionsOptions object

Definition at line 18 of file QwHelicityCorrelatedFeedback.cc.

19{
20
21 options.AddOptions("Helicity Correlated Feedback")("Auto-IHWP-Flip", po::value<bool>()->default_value(false)->zero_tokens(),"Set Half wave plate IN. The default is Half wave plate OUT");
22 options.AddOptions("Helicity Correlated Feedback")("Half-wave-plate-revert", po::value<bool>()->default_value(false)->zero_tokens(),"Revert half-wave plate status. The default is determined via EPIC");
23 //options.AddOptions("Helicity Correlated Feedback")("Half-wave-plate-OUT", po::value<bool>()->default_value(true)->zero_tokens(),"Half wave plate OUT");
24 options.AddOptions("Helicity Correlated Feedback")("PITA-Feedback", po::value<bool>()->default_value(false)->zero_tokens(),"Run the PITA charge feedback");
25 options.AddOptions("Helicity Correlated Feedback")("IA-Feedback", po::value<bool>()->default_value(false)->zero_tokens(),"Run the IA charge feedback");
26 options.AddOptions("Helicity Correlated Feedback")("HA-IA-Feedback", po::value<bool>()->default_value(false)->zero_tokens(),"Run the Hall A IA charge feedback");
27
28};
po::options_description_easy_init AddOptions(const std::string &blockname="Specialized options")
Add an option to a named block or create new block.
Definition QwOptions.h:170

References QwOptions::AddOptions().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FeedHAIASetPoint()

void QwHelicityCorrelatedFeedback::FeedHAIASetPoint ( Int_t mode)

Feed the Hall A IA set point based on the charge asymmetry.

Definition at line 387 of file QwHelicityCorrelatedFeedback.cc.

387 {
388 //calculate the new setpoint
389
390 fEPICSCtrl.Get_HallAIA(mode,fPrevHAIASetpoint[mode]);
391 if (fIASlopeA[mode]!=0){
392
393 if (fHalfWaveIN)
394 fHAIASetpoint[mode]=fPrevHAIASetpoint[mode] - fHAChargeAsym[mode]/fHAIASlopeA[0];//IHWP IN slope is stored at fHAIASlopeA[0]
395 else
396 fHAIASetpoint[mode]=fPrevHAIASetpoint[mode] - fHAChargeAsym[mode]/fHAIASlopeA[1];//IHWP OUT slope is stored at fHAIASlopeA[1]
397
398 } else
400
401 if ((fHAIASetpoint[mode]>fIASetpointup) || (fHAIASetpoint[mode]<fIASetpointlow)){//if correction is out-of bound no correction applied
402 QwMessage<<"Hall A FeedIASetPoint out-of-bounds "<<fHAChargeAsym[mode]<<" +/- "<<fHAChargeAsymError[mode]<<" new set point[+] "<<fHAIASetpoint[mode]<<" aborting correction for this time! "<<QwLog::endl;
403 return;
404 }
405
406 QwMessage<<"FeedIASetPoint("<<mode<<") "<<fHAChargeAsym[mode]<<"+/-"<<fHAChargeAsymError[mode]<<" new set point "<<fHAIASetpoint[mode]<<QwLog::endl;
407 //send the new IA setpoint
408
409 for (Int_t i=0;i<4;i++)
410 fEPICSCtrl.Set_HallAIA(i,fHAIASetpoint[mode]);//do the same correction to 4 DACs
411
412 fScalerChargeRunningSum.ClearEventData();//reset the running sums
413};

References QwLog::endl(), fEPICSCtrl, fHAChargeAsym, fHAChargeAsymError, fHAIASetpoint, fHAIASlopeA, fHalfWaveIN, fIASetpointlow, fIASetpointup, fIASlopeA, fPrevHAIASetpoint, fScalerChargeRunningSum, and QwMessage.

Referenced by ApplyHAIAFeedback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FeedIASetPoint()

void QwHelicityCorrelatedFeedback::FeedIASetPoint ( Int_t mode)

Feed the Hall C IA set point based on the charge asymmetry.

Definition at line 355 of file QwHelicityCorrelatedFeedback.cc.

355 {
356 //calculate the new setpoint
357 fEPICSCtrl.Get_HallCIA(mode,fPrevIASetpoint[mode]);
358 if (fIASlopeA[mode]!=0)
359 fIASetpoint[mode]=fPrevIASetpoint[mode] - fChargeAsym[mode]/fIASlopeA[mode];
360 else
361 fIASetpoint[mode]=fPrevIASetpoint[mode];
362
363 if (fIASetpoint[mode]>fIASetpointup)
365 else if (fIASetpoint[mode]<fIASetpointlow)
367
368 QwMessage<<"FeedIASetPoint("<<mode<<") "<<fChargeAsym[mode]<<"+/-"<<fChargeAsymError[mode]<<" new set point "<<fIASetpoint[mode]<<QwLog::endl;
369 //send the new IA setpoint
370
371 fEPICSCtrl.Set_HallCIA(mode,fIASetpoint[mode]);
372
373 //updating the standard asymmetry statistics
374 //commented out - rakithab 01-06-2011
375 //GetTargetChargeStat();
376 //fEPICSCtrl.Set_ChargeAsymmetry(fChargeAsymmetry,fChargeAsymmetryError,fChargeAsymmetryWidth);//updates the epics values
377
378 //Greenmonster stuffs
379 //fScanCtrl.SCNSetValue(1,0);
380 //fScanCtrl.SCNSetValue(2,0);
381 //fScanCtrl.CheckScan();
382 //fScanCtrl.PrintScanInfo();
383 //fScanCtrl.Close();
384};

References QwLog::endl(), fChargeAsym, fChargeAsymError, fEPICSCtrl, fIASetpoint, fIASetpointlow, fIASetpointup, fIASlopeA, fPrevIASetpoint, and QwMessage.

Referenced by ApplyIAFeedback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FeedPCNeg()

void QwHelicityCorrelatedFeedback::FeedPCNeg ( )

Feed the IA set point based on the charge asymmetry.

Definition at line 494 of file QwHelicityCorrelatedFeedback.cc.

494 {
495};

◆ FeedPCPos()

void QwHelicityCorrelatedFeedback::FeedPCPos ( )

Feed the IA set point based on the charge asymmetry.

Definition at line 491 of file QwHelicityCorrelatedFeedback.cc.

491 {
492};

◆ FeedPITASetPoints()

void QwHelicityCorrelatedFeedback::FeedPITASetPoints ( )

Feed the Hall C PITA set point based on the charge asymmetry.

Definition at line 417 of file QwHelicityCorrelatedFeedback.cc.

417 {
418
419
420 //calculate the new setpoint
421 if (fHalfWaveIN)
423 else{
424 if (GetHalfWavePlate2State()==0)//IHWP2==OUT or No IHWP2 anymore
426 else
427 fPITASlope=fPITASlopeOUT_IN;//IHWP2==IN
428 }
429
430
431
432 fEPICSCtrl.Get_Pockels_Cell_plus(fPrevPITASetpointPOS);
433 fEPICSCtrl.Get_Pockels_Cell_minus(fPrevPITASetpointNEG);
434
435 if (fPITASlope!=0) {
436 Double_t correction = fChargeAsymmetry/fPITASlope;
437 //damp the correction when charge asymmetry is close to zero
438 if (fFeedbackDamping){
439 if (TMath::Abs(fChargeAsymmetry)<0.01)//ppm
440 correction*=0.01;
441 else if (TMath::Abs(fChargeAsymmetry)<0.1)//ppm
442 correction*=0.1;
443 else if (TMath::Abs(fChargeAsymmetry)<1)//ppm
444 correction*=0.25;
445 else if (TMath::Abs(fChargeAsymmetry)<2)//ppm
446 correction*=0.5;
447 else if (TMath::Abs(fChargeAsymmetry)<5)//ppm
448 correction*=0.75;
449 }
450
453
454
455 } else {
458 }
459
460
461
462
464 QwMessage<<"FeedPITASetPoint out-of-bounds "<<fChargeAsymmetry<<" +/- "<<fChargeAsymmetryError<<" new set point[+] "<<fPITASetpointPOS<<" [-] "<<fPITASetpointNEG<<" aborting correction for this time! "<<QwLog::endl;
465 return;//do nothing but can we reset to t_0 correction and start all over???????
466 }
467
468 QwMessage<<"FeedPITASetPoint "<<" "<<fChargeAsymmetry<<" +/- "<<fChargeAsymmetryError<<" new set point[+] "<<fPITASetpointPOS<<" [-] "<<fPITASetpointNEG<<QwLog::endl;
469
470 //send the new PITA setpoint
471 fEPICSCtrl.Set_Pockels_Cell_plus(fPITASetpointPOS);
472 fEPICSCtrl.Set_Pockels_Cell_minus(fPITASetpointNEG);
473
474 /*
475 if (fFeedbackStatus){
476 fFeedbackStatus=kFALSE;
477 fEPICSCtrl.Set_FeedbackStatus(2.0);//Setting to 2 seems to be not updating. Check back later
478 }
479 */
480
481 //Greenmonster stuffs are commented out - rakithab
482 //fScanCtrl.SCNSetValue(1,0);
483 //fScanCtrl.SCNSetValue(2,0);
484 //fScanCtrl.CheckScan();
485 //fScanCtrl.PrintScanInfo();
486 //fScanCtrl.Close();
487 ClearRunningSum();//reset the running sum only if PITA correction applied, the object fRunningAsymmetry is solely dedicated to PITA feedback
488};

References ClearRunningSum(), QwLog::endl(), fChargeAsymmetry, fChargeAsymmetryError, fEPICSCtrl, fFeedbackDamping, fHalfWaveIN, fPITASetpointlow, fPITASetpointNEG, fPITASetpointPOS, fPITASetpointup, fPITASlope, fPITASlopeIN, fPITASlopeOUT, fPITASlopeOUT_IN, fPrevPITASetpointNEG, fPrevPITASetpointPOS, GetHalfWavePlate2State(), and QwMessage.

Referenced by ApplyPITAFeedback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillTreeVector()

void QwHelicityCorrelatedFeedback::FillTreeVector ( std::vector< Double_t > & values) const

Definition at line 1359 of file QwHelicityCorrelatedFeedback.cc.

1359 {
1361};
void FillTreeVector(QwRootTreeBranchVector &values) const

References QwHelicityPattern::FillTreeVector().

+ Here is the call graph for this function:

◆ GetChargeAsym()

Double_t QwHelicityCorrelatedFeedback::GetChargeAsym ( )
inlineprivate

Returns the charge asymmetry stats when required by feedback caluculations.

Definition at line 259 of file QwHelicityCorrelatedFeedback.h.

259 {
260 return fChargeAsymmetry;
261 };

References fChargeAsymmetry.

◆ GetChargeAsymError()

Double_t QwHelicityCorrelatedFeedback::GetChargeAsymError ( )
inlineprivate

Definition at line 262 of file QwHelicityCorrelatedFeedback.h.

262 {
264 };

References fChargeAsymmetryError.

◆ GetChargeAsymWidth()

Double_t QwHelicityCorrelatedFeedback::GetChargeAsymWidth ( )
inlineprivate

Definition at line 265 of file QwHelicityCorrelatedFeedback.h.

265 {
267 };

References fChargeAsymmetryWidth.

◆ GetHAChargeStat()

void QwHelicityCorrelatedFeedback::GetHAChargeStat ( Int_t mode)

retrieves the Hall A charge asymmetry,asymmetry error ,asymmetry width for given mode

retrieves the Hall A charge asymmetry,asymmetry error ,asymmetry width

/

Definition at line 1320 of file QwHelicityCorrelatedFeedback.cc.

1320 {
1321 if (mode<0 || mode>3){
1322 QwError << " Hall A Mode is out of bound " << mode <<" mode<0 || mode>3 "<<QwLog::endl;
1323 return;
1324 }
1325 fScalerChargeRunningSum.CalculateRunningAverage();
1326 QwError<<"Reading published Hall A charge value stats "<<QwLog::endl;
1327 fScalerChargeRunningSum.PrintValue();
1328 fHAChargeAsym[mode]=fScalerChargeRunningSum.GetValue();
1329 fHAChargeAsymError[mode]=fScalerChargeRunningSum.GetValueError();
1330 fHAChargeAsymWidth[mode]=fScalerChargeRunningSum.GetValueWidth();
1331 QwError<<" Scaler asym "<<fHAChargeAsym[mode]<<" error "<<fHAChargeAsymError[mode]<<" width "<<fHAChargeAsymWidth[mode]<<QwLog::endl;
1332 return ;
1333};

References QwLog::endl(), fHAChargeAsym, fHAChargeAsymError, fHAChargeAsymWidth, fScalerChargeRunningSum, and QwError.

Referenced by ApplyHAIAFeedback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetHalfWavePlate2State()

UInt_t QwHelicityCorrelatedFeedback::GetHalfWavePlate2State ( )
private

Definition at line 1370 of file QwHelicityCorrelatedFeedback.cc.

1370 {
1371 TString ihwp2_value = gSystem->GetFromPipe("caget -tf0 -w 0.1 IGL1I00DIOFLRD");
1372 UInt_t ihwp2 =ihwp2_value.Atoi();
1373
1374 if (ihwp2>10000)
1375 return 1;//13056=IN
1376 else
1377 return 0; //8960=OUT
1378};

Referenced by FeedPITASetPoints(), LogParameters(), and ProcessOptions().

+ Here is the caller graph for this function:

◆ GetHalfWavePlateState()

TString QwHelicityCorrelatedFeedback::GetHalfWavePlateState ( )
private

The types of helicity patterns based on following pattern history.

  1. +–+ +–+
  2. +–+ -++-
  3. -++- +–+
  4. -++- -++-

Definition at line 1364 of file QwHelicityCorrelatedFeedback.cc.

1365{
1366 TString plate_status = gSystem->GetFromPipe("caget -t -w 0.1 IGL1I00DI24_24M");
1367 return plate_status;
1368};

Referenced by ApplyFeedbackCorrections(), and ProcessOptions().

+ Here is the caller graph for this function:

◆ GetLastGoodHelicityPatternType()

Int_t QwHelicityCorrelatedFeedback::GetLastGoodHelicityPatternType ( )

Returns the type of the last helicity pattern based on following pattern history.

  1. +–+ +–+
  2. +–+ -++-
  3. -++- +–+
  4. -++- -++-

Definition at line 811 of file QwHelicityCorrelatedFeedback.cc.

811 {
812 return fCurrentHelPatMode;
813};

References fCurrentHelPatMode.

◆ GetTargetChargeStat() [1/2]

void QwHelicityCorrelatedFeedback::GetTargetChargeStat ( )

retrieves the target charge asymmetry,asymmetry error ,asymmetry width

/

Definition at line 1176 of file QwHelicityCorrelatedFeedback.cc.

1176 {
1177 fRunningAsymmetry.CalculateRunningAverage();
1178
1179 if (fRunningAsymmetry.RequestExternalValue("q_targ",&fTargetCharge)){
1180 QwMessage<<"Reading published charge value stats"<<QwLog::endl;
1181 fTargetCharge.PrintInfo();
1183 fChargeAsymmetryError=fTargetCharge.GetValueError();
1184 fChargeAsymmetryWidth=fTargetCharge.GetValueWidth();
1185
1186 //calculate mean BCM78DD asymmetry and bcm8 yield and update parameters to be publised in EPICS
1187 fAsymBCM78DDRunningSum.CalculateRunningAverage();
1188 fYieldBCM8RunningSum.CalculateRunningAverage();
1189
1191
1192 fAsymBCM78DD=fAsymBCM78DDRunningSum.GetValue()*1.0e+6;
1193 fAsymBCM78DDError=fAsymBCM78DDRunningSum.GetValueError()*1.0e+6;
1194 fAsymBCM78DDWidth=fAsymBCM78DDRunningSum.GetValueWidth()*1.0e+6;
1195
1196 //calculate mean USLumi Sum asymmetry and update parameters to be publised in EPICS
1197 fAsymUSLumiSumRunningSum.CalculateRunningAverage();
1199 fAsymBCMUSLumiSumError=fAsymUSLumiSumRunningSum.GetValueError()*1.0e+6;
1200 fAsymBCMUSLumiSumWidth=fAsymUSLumiSumRunningSum.GetValueWidth()*1.0e+6;
1201 return ;
1202 }
1203 QwError << " Could not get external value setting parameters to q_targ" <<QwLog::endl;
1207
1208 fBCM8Yield=0;
1209 fAsymBCM78DD=0;
1212
1216 return;
1217};

References QwLog::endl(), fAsymBCM78DD, fAsymBCM78DDError, fAsymBCM78DDRunningSum, fAsymBCM78DDWidth, fAsymBCMUSLumiSum, fAsymBCMUSLumiSumError, fAsymBCMUSLumiSumWidth, fAsymUSLumiSumRunningSum, fBCM8Yield, fChargeAsymmetry, fChargeAsymmetryError, fChargeAsymmetryWidth, fTargetCharge, fYieldBCM8RunningSum, QwError, and QwMessage.

Referenced by ApplyIAFeedback(), and ApplyPITAFeedback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTargetChargeStat() [2/2]

void QwHelicityCorrelatedFeedback::GetTargetChargeStat ( Int_t mode)

retrieves the target charge asymmetry,asymmetry error ,asymmetry width for given mode

retrieves the target charge asymmetry,asymmetry error ,asymmetry width

/

Definition at line 1223 of file QwHelicityCorrelatedFeedback.cc.

1223 {
1224 if (!fIAFB){
1225 fChargeAsym[mode]=-1;
1226 fChargeAsymError[mode]=-1;
1227 fChargeAsymWidth[mode]=-1;
1228 }
1229
1230 if (mode<0 || mode>3){
1231 QwError << " Could not get external value setting parameters to q_targ" <<QwLog::endl;
1232 return;
1233 }
1234 /*
1235 fFBRunningAsymmetry[mode].CalculateRunningAverage();
1236 if (fFBRunningAsymmetry[mode].RequestExternalValue("q_targ",&fTargetCharge)){
1237 QwMessage<<"Reading published charge value stats"<<QwLog::endl;
1238 fTargetCharge.PrintInfo();
1239 fChargeAsym[mode]=fTargetCharge.GetHardwareSum();
1240 fChargeAsymError[mode]=fTargetCharge.GetHardwareSumError();
1241 fChargeAsymWidth[mode]=fTargetCharge.GetHardwareSumWidth();
1242 return ;
1243 }
1244 */
1245 //QwError << " Could not get external value setting parameters to q_targ" <<QwLog::endl;
1246 fChargeAsym[mode]=-1;
1247 fChargeAsymError[mode]=-1;
1248 fChargeAsymWidth[mode]=-1;
1249
1250 return;
1251};

References QwLog::endl(), fChargeAsym, fChargeAsymError, fChargeAsymWidth, fIAFB, and QwError.

+ Here is the call graph for this function:

◆ GetTargetPositionStat()

void QwHelicityCorrelatedFeedback::GetTargetPositionStat ( )

retrieves the target position angle parameters (X,XP,Y,YP) mean, error and width

Definition at line 1254 of file QwHelicityCorrelatedFeedback.cc.

1254 {
1255 //compute the running averages
1256 fTargetXDiffRunningSum.CalculateRunningAverage();
1257 fTargetXPDiffRunningSum.CalculateRunningAverage();
1258 fTargetYDiffRunningSum.CalculateRunningAverage();
1259 fTargetYPDiffRunningSum.CalculateRunningAverage();
1260 f3C12XDiffRunningSum.CalculateRunningAverage();
1261 f3C12YDiffRunningSum.CalculateRunningAverage();
1262 f3C12YQRunningSum.CalculateRunningAverage();
1263
1264
1265 //Update X stats
1266 fTargetXDiff=fTargetXDiffRunningSum.GetValue()*1.0e+3;
1267 fTargetXDiffError=fTargetXDiffRunningSum.GetValueError()*1.0e+3;
1268 fTargetXDiffWidth=fTargetXDiffRunningSum.GetValueWidth()*1.0e+3;
1269
1270 //Update XP stats in nrad
1271 fTargetXPDiff=fTargetXPDiffRunningSum.GetValue()*1.0e+9;
1272 fTargetXPDiffError=fTargetXPDiffRunningSum.GetValueError()*1.0e+9;
1273 fTargetXPDiffWidth=fTargetXPDiffRunningSum.GetValueWidth()*1.0e+9;
1274
1275 //Update Y stats
1276 fTargetYDiff=fTargetYDiffRunningSum.GetValue()*1.0e+3;
1277 fTargetYDiffError=fTargetYDiffRunningSum.GetValueError()*1.0e+3;
1278 fTargetYDiffWidth=fTargetYDiffRunningSum.GetValueWidth()*1.0e+3;
1279
1280 //Update YP stats in nrad
1281 fTargetYPDiff=fTargetYPDiffRunningSum.GetValue()*1.0e+9;
1282 fTargetYPDiffError=fTargetYPDiffRunningSum.GetValueError()*1.0e+9;
1283 fTargetYPDiffWidth=fTargetYPDiffRunningSum.GetValueWidth()*1.0e+9;
1284
1285
1286 //Update 3c12X stats
1287 f3C12XDiff=f3C12XDiffRunningSum.GetValue()*1.0e+3;
1288 f3C12XDiffError=f3C12XDiffRunningSum.GetValueError()*1.0e+3;
1289 f3C12XDiffWidth=f3C12XDiffRunningSum.GetValueWidth()*1.0e+3;
1290
1291 //Update 3c12Y stats
1292 f3C12YDiff=f3C12YDiffRunningSum.GetValue()*1.0e+3;
1293 f3C12YDiffError=f3C12YDiffRunningSum.GetValueError()*1.0e+3;
1294 f3C12YDiffWidth=f3C12YDiffRunningSum.GetValueWidth()*1.0e+3;
1295
1296 //Update 3c12YQ stats
1297 f3C12YQ=f3C12YQRunningSum.GetValue();
1298 f3C12YQError=f3C12YQRunningSum.GetValueError();
1299 f3C12YQWidth=f3C12YQRunningSum.GetValueWidth();
1300
1301
1302
1303
1304
1305 /*
1306 fTargetXDiffRunningSum.PrintInfo();
1307 fTargetXPDiffRunningSum.PrintInfo();
1308 fTargetYDiffRunningSum.PrintInfo();
1309 fTargetYPDiffRunningSum.PrintInfo();
1310 */
1311
1312 return;
1313
1314}

References f3C12XDiff, f3C12XDiffError, f3C12XDiffRunningSum, f3C12XDiffWidth, f3C12YDiff, f3C12YDiffError, f3C12YDiffRunningSum, f3C12YDiffWidth, f3C12YQ, f3C12YQError, f3C12YQRunningSum, f3C12YQWidth, fTargetXDiff, fTargetXDiffError, fTargetXDiffRunningSum, fTargetXDiffWidth, fTargetXPDiff, fTargetXPDiffError, fTargetXPDiffRunningSum, fTargetXPDiffWidth, fTargetYDiff, fTargetYDiffError, fTargetYDiffRunningSum, fTargetYDiffWidth, fTargetYPDiff, fTargetYPDiffError, fTargetYPDiffRunningSum, and fTargetYPDiffWidth.

Referenced by ApplyHMFeedback().

+ Here is the caller graph for this function:

◆ IsHAPatternsAccumulated()

Bool_t QwHelicityCorrelatedFeedback::IsHAPatternsAccumulated ( )
inline

Check to see no.of good patterns accumulated after the last position/angle feedback correction.

Definition at line 232 of file QwHelicityCorrelatedFeedback.h.

232 {
234 return kTRUE;
235
236 return kFALSE;
237 };

References fHAAccumulatePatternMax, and fHAGoodPatternCounter.

Referenced by ApplyFeedbackCorrections().

+ Here is the caller graph for this function:

◆ IsPatternsAccumulated() [1/2]

Bool_t QwHelicityCorrelatedFeedback::IsPatternsAccumulated ( )
inline

Check to see no.of good patterns accumulated after the last feedback is greater than a set value.

Definition at line 217 of file QwHelicityCorrelatedFeedback.h.

217 {
219 return kTRUE;
220
221 return kFALSE;
222 };

References fAccumulatePatternMax, and fGoodPatternCounter.

Referenced by ApplyFeedbackCorrections().

+ Here is the caller graph for this function:

◆ IsPatternsAccumulated() [2/2]

Bool_t QwHelicityCorrelatedFeedback::IsPatternsAccumulated ( Int_t mode)

Check to see no.of good patterns accumulated after the last feedback is greater than a set value for given mode.

Definition at line 802 of file QwHelicityCorrelatedFeedback.cc.

802 {
804 //QwMessage<<"fHelModeGoodPatternCounter["<<mode<<"]\n";
805 return kTRUE;
806 }
807
808 return kFALSE;
809};

References fHAAccumulatePatternMax, and fHelModeGoodPatternCounter.

◆ IsPFPatternsAccumulated()

Bool_t QwHelicityCorrelatedFeedback::IsPFPatternsAccumulated ( )
inline

Check to see no.of good patterns accumulated after the last position/angle feedback correction.

Definition at line 224 of file QwHelicityCorrelatedFeedback.h.

224 {
226 return kTRUE;
227
228 return kFALSE;
229 };

References fPFAccumulatePatternMax, and fPFGoodPatternCounter.

Referenced by ApplyFeedbackCorrections().

+ Here is the caller graph for this function:

◆ LoadParameterFile()

void QwHelicityCorrelatedFeedback::LoadParameterFile ( TString filename)

Load deltaA_q, no.of good patterns to accumulate and other neccessary feedback parameters.

Definition at line 102 of file QwHelicityCorrelatedFeedback.cc.

102 {
103 char buffer [10];
104 TString prev_IHWP_State;
105
106 QwParameterFile mapstr(filename.Data()); //Open the file
107 TString varname, varvalue;
108 UInt_t value;
109 Double_t dvalue;
110 fIASetpointlow=11000;
111 fIASetpointup=40000;
112 while (mapstr.ReadNextLine()){
113 mapstr.TrimComment('#'); // Remove everything after a '!' character.
114 mapstr.TrimWhitespace(); // Get rid of leading and trailing spaces.
115 if (mapstr.LineIsEmpty()) continue;
116
117 if (mapstr.HasVariablePair("=",varname,varvalue)){
118 //Decode it.
119 varname.ToLower();
120 if (varname=="patterns"){
121 value = QwParameterFile::GetUInt(varvalue);
123 }
124 else if (varname=="haf_patterns"){
125 value = QwParameterFile::GetUInt(varvalue);
127 }else if(varname=="pf_patterns"){
128 value = QwParameterFile::GetUInt(varvalue);
130 }else if (varname=="deltaaq"){
131 dvalue = atof(varvalue.Data());
133 }
134 else if (varname=="optimalia"){
135 dvalue = atof(varvalue.Data());
136 fOptimalIA = dvalue;
137 }
138 else if (varname=="optimalpcp"){
139 dvalue = atof(varvalue.Data());
140 fOptimalPCP = dvalue;
141 }
142 else if (varname=="optimalpcn"){
143 dvalue = atof(varvalue.Data());
144 fOptimalPCN = dvalue;
145 }
146 else if (varname=="a0"){
147 dvalue = atof(varvalue.Data());
148 fIASlopeA[0] = dvalue;
149 }
150 else if (varname=="deltaa0"){
151 dvalue = atof(varvalue.Data());
152 fDelta_IASlopeA[0] = dvalue;
153 }
154 else if (varname=="a1"){
155 dvalue = atof(varvalue.Data());
156 fIASlopeA[1] = dvalue;
157 }
158 else if (varname=="deltaa1"){
159 dvalue = atof(varvalue.Data());
160 fDelta_IASlopeA[1] = dvalue;
161 }
162 else if (varname=="a2"){
163 dvalue = atof(varvalue.Data());
164 fIASlopeA[2] = dvalue;
165 }
166 else if (varname=="deltaa2"){
167 dvalue = atof(varvalue.Data());
168 fDelta_IASlopeA[2] = dvalue;
169 }
170 else if (varname=="a3"){
171 dvalue = atof(varvalue.Data());
172 fIASlopeA[3] = dvalue;
173 }
174 else if (varname=="deltaa3"){
175 dvalue = atof(varvalue.Data());
176 fDelta_IASlopeA[3] = dvalue;
177 }
178 else if (varname=="haa0"){
179 dvalue = atof(varvalue.Data());
180 fHAIASlopeA[0] = dvalue;
181 }
182 else if (varname=="haa1"){
183 dvalue = atof(varvalue.Data());
184 fHAIASlopeA[1] = dvalue;
185 }
186 else if (varname=="haa2"){
187 dvalue = atof(varvalue.Data());
188 fHAIASlopeA[2] = dvalue;
189 }
190 else if (varname=="haa3"){
191 dvalue = atof(varvalue.Data());
192 fHAIASlopeA[3] = dvalue;
193 }
194 else if (varname=="ia_low"){
195 dvalue = atof(varvalue.Data());
196 if (dvalue>0)
197 fIASetpointlow = dvalue;
198 }
199 else if (varname=="ia_up"){
200 dvalue = atof(varvalue.Data());
201 if (dvalue>0)
202 fIASetpointup = dvalue;
203 }
204 else if (varname=="pitaslope_in"){//IHWP1 IN IHWP2 OUT
205 dvalue = atof(varvalue.Data());
206 fPITASlopeIN = dvalue;
207 }
208 else if (varname=="pitaslope_out"){//IHWP1 OUT IHWP2 OUT
209 dvalue = atof(varvalue.Data());
210 fPITASlopeOUT = dvalue;
211 }
212 else if (varname=="pitaslope_out_in"){//IHWP1 OUT IHWP2 IN
213 dvalue = atof(varvalue.Data());
214 fPITASlopeOUT_IN = dvalue;
215 }
216 else if (varname=="pc_pos_t0_in"){
217 dvalue = atof(varvalue.Data());
218 fPITASetpointPOS_t0_IN = dvalue;
219 }
220 else if (varname=="pc_neg_t0_in"){
221 dvalue = atof(varvalue.Data());
222 fPITASetpointNEG_t0_IN = dvalue;
223 }
224 else if (varname=="pc_pos_t0_out"){
225 dvalue = atof(varvalue.Data());
227 }
228 else if (varname=="pc_neg_t0_out"){
229 dvalue = atof(varvalue.Data());
231 }
232 else if (varname=="pc_up"){
233 dvalue = atof(varvalue.Data());
234 if (dvalue>0)
235 fPITASetpointup = dvalue;
236 }
237 else if (varname=="pc_low"){
238 dvalue = atof(varvalue.Data());
239 if (dvalue>0)
240 fPITASetpointlow = dvalue;
241 }else if (varname=="min_charge_asym"){
242 dvalue = atof(varvalue.Data());
243 if (dvalue>0)
244 fPITA_MIN_Charge_asym = dvalue;
245 } else if (varname=="damping"){
246 dvalue = atof(varvalue.Data());
247 if (dvalue>0)
248 fFeedbackDamping=kTRUE;
249 else
250 fFeedbackDamping=kFALSE;
251 }
252
253
254
255 }
256 }
257
258 //Read the last know good PC set points
259 out_file_PC_IN_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_IN", "r");//Open in read mode
260 out_file_PC_IN_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_IN", "r");//Open in read mode
261 out_file_PC_OUT_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_OUT", "r");//Open in read mode
262 out_file_PC_OUT_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_OUT", "r");//Open in read mode
263
265 UInt_t tmp;
266 fscanf(out_file_PC_IN_pos,"%d",&tmp);
268 fscanf(out_file_PC_IN_neg,"%d",&tmp);
270 fscanf(out_file_PC_OUT_pos,"%d",&tmp);
272 fscanf(out_file_PC_OUT_neg,"%d",&tmp);
274 fclose(out_file_PC_IN_pos);
275 fclose(out_file_PC_IN_neg);
276 fclose(out_file_PC_OUT_pos);
277 fclose(out_file_PC_OUT_neg);
278
279 }
280
281
282
283 QwMessage<<"Hall C patternMax = "<<fAccumulatePatternMax<<" Hall C patternMax = "<<fHAAccumulatePatternMax<<" deltaAq "<<fChargeAsymPrecision<<"ppm"<<QwLog::endl;
284 //QwMessage<<"Optimal values - IA ["<<fOptimalIA<<"] PC+["<<fOptimalPCP<<"] PC-["<<fOptimalPCN<<"]"<<QwLog::endl;
285 QwMessage<<"IA DAC counts limits "<<fIASetpointlow<<" to "<< fIASetpointup <<QwLog::endl;
286 for (Int_t i=0;i<kHelModes;i++)
287 QwMessage<<"Slope A["<<i<<"] "<<fIASlopeA[i]<<"+-"<<fDelta_IASlopeA[i]<<QwLog::endl;
288 QwMessage<<"PITA slopes: H-wave IN "<<fPITASlopeIN<<" H-wave OUT "<<fPITASlopeOUT<<" H-wave OUT IHWP2 IN"<<fPITASlopeOUT_IN<<QwLog::endl;
289 QwMessage<<"PC dac limits "<<fPITASetpointlow<<" to "<<fPITASetpointup<<QwLog::endl;
290
291 fInitialCorrection=kFALSE;
292 QwMessage<<"t_0 corrections for IN +["<<fPITASetpointPOS_t0_IN<<"] -["<<fPITASetpointNEG_t0_IN<<"]"<<QwLog::endl;
293 QwMessage<<"t_0 corrections for OUT +["<<fPITASetpointPOS_t0_OUT<<"] -["<<fPITASetpointNEG_t0_OUT<<"]"<<QwLog::endl;
294
295 if (fAutoIHWP){
296 IHWP_State = fopen("/local/scratch/qweak/Feedback_IHWP.txt", "r");//Open in read mode to get the previous IHWP state
297 if (IHWP_State!=NULL){
298 fgets(buffer , 10 ,IHWP_State);//read the previous IHWP mode
299 //printf("NOTICE \n %s \n",buffer);
300 prev_IHWP_State=buffer;
301 if (prev_IHWP_State.Contains("IN") || prev_IHWP_State.Contains("OUT")){
302 if (prev_IHWP_State.Contains("IN"))
304 else
306 if (fHalfWavePlateStatus.IsNull())//EPICS IHWP state is missing
307 fHalfWavePlateStatus=prev_IHWP_State;//in case EPICS IHWP state is not existing set the previous run IHWP state
308 }
309 }
310 else
311 prev_IHWP_State="";
312
313 if (!prev_IHWP_State.Contains("IN") && !prev_IHWP_State.Contains("OUT") ){//first time the file created
314 if (IHWP_State!=NULL)
315 fclose(IHWP_State);
316 IHWP_State = fopen("/local/scratch/qweak/Feedback_IHWP.txt", "w");
317 printf("NOTICE \n previous half-wave plate status not found. Writing current IHWP state %s \n",fHalfWavePlateStatus.Data());
318 if (IHWP_State!=NULL){
319 fprintf(IHWP_State,"%s",fHalfWavePlateStatus.Data());
320 fclose(IHWP_State);
321 }
322 }
323 else{
324 if (fDefaultHalfWavePlateStatus!=fPreviousHalfWavePlateStatus){//at the begging of the feedback, if the current IHWP is not the same as last known good IHWP state then reset the PC values
325 printf("NOTICE \n Half-wave plate status has changed from %s to %s \n",prev_IHWP_State.Data(),fHalfWavePlateStatus.Data());
326 if (fHalfWaveIN){
328 fEPICSCtrl.Set_Pockels_Cell_plus(fPITASetpointPOS_t0_IN);
329 fEPICSCtrl.Set_Pockels_Cell_minus(fPITASetpointNEG_t0_IN);
330 }
331 } else{
333 fEPICSCtrl.Set_Pockels_Cell_plus(fPITASetpointPOS_t0_OUT);
334 fEPICSCtrl.Set_Pockels_Cell_minus(fPITASetpointNEG_t0_OUT);
335 }
336 }
337 }
338 printf("NOTICE \n previous half-wave plate status %s\n",prev_IHWP_State.Data());
339 if (IHWP_State!=NULL)
340 fclose(IHWP_State);
341 IHWP_State = fopen("/local/scratch/qweak/Feedback_IHWP.txt", "w");
342 printf("NOTICE \n Updating new IHWP %s \n",fHalfWavePlateStatus.Data());
343 if (IHWP_State!=NULL){
344 fprintf(IHWP_State,"%s",fHalfWavePlateStatus.Data());
345 fclose(IHWP_State);
346 }
347
348 }
349 }
350
351};
static UInt_t GetUInt(const TString &varvalue)

References QwLog::endl(), fAccumulatePatternMax, fAutoIHWP, fChargeAsymPrecision, fDefaultHalfWavePlateStatus, fDelta_IASlopeA, fEPICSCtrl, fFeedbackDamping, fHAAccumulatePatternMax, fHAIASlopeA, fHalfWaveIN, fHalfWavePlateStatus, fIASetpointlow, fIASetpointup, fIASlopeA, fInitialCorrection, fOptimalIA, fOptimalPCN, fOptimalPCP, fPFAccumulatePatternMax, fPITA_MIN_Charge_asym, fPITASetpointlow, fPITASetpointNEG_t0_IN, fPITASetpointNEG_t0_OUT, fPITASetpointPOS_t0_IN, fPITASetpointPOS_t0_OUT, fPITASetpointup, fPITASlopeIN, fPITASlopeOUT, fPITASlopeOUT_IN, fPreviousHalfWavePlateStatus, QwParameterFile::GetUInt(), QwParameterFile::HasVariablePair(), IHWP_State, kHelModes, QwParameterFile::LineIsEmpty(), out_file_PC_IN_neg, out_file_PC_IN_pos, out_file_PC_OUT_neg, out_file_PC_OUT_pos, QwMessage, QwParameterFile::ReadNextLine(), QwParameterFile::TrimComment(), and QwParameterFile::TrimWhitespace().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LogHAParameters()

void QwHelicityCorrelatedFeedback::LogHAParameters ( Int_t mode)

Log the last Hall A IA feedback information.

Definition at line 562 of file QwHelicityCorrelatedFeedback.cc.

562 {
563 fEPICSCtrl.Set_HAChargeAsymmetry(fHAChargeAsym[mode],fHAChargeAsymError[mode],fHAChargeAsymWidth[mode]);//updates the epics values
564 out_file_HA_IA = fopen("/local/scratch/qweak/Feedback_HA_IA_log.txt", "a");
565 //fQuartetNumber only available when we have good stable Hall C beam
566 fprintf(out_file_HA_IA," %10.0d %20.2f %15.2f %15.0f %20.0f %20.0f \n",fQuartetNumber,fHAChargeAsym[mode],fHAChargeAsymError[mode],TMath::Abs(fHAIASetpoint[mode]-fPrevHAIASetpoint[mode]),fHAIASetpoint[mode],fPrevHAIASetpoint[mode]);
567 fclose(out_file_HA_IA);
568
569};

References fEPICSCtrl, fHAChargeAsym, fHAChargeAsymError, fHAChargeAsymWidth, fHAIASetpoint, fPrevHAIASetpoint, QwHelicityPattern::fQuartetNumber, and out_file_HA_IA.

Referenced by ApplyHAIAFeedback().

+ Here is the caller graph for this function:

◆ LogParameters() [1/2]

void QwHelicityCorrelatedFeedback::LogParameters ( )

Log the last PITA feedback information.

Definition at line 506 of file QwHelicityCorrelatedFeedback.cc.

506 {
507 fEPICSCtrl.Set_ChargeAsymmetry(fChargeAsymmetry,fChargeAsymmetryError,fChargeAsymmetryWidth);//updates the epics values
508 fEPICSCtrl.Set_BCM78DDAsymmetry(fAsymBCM78DD,fAsymBCM78DDError,fAsymBCM78DDWidth);//update BCM78DD
509 fEPICSCtrl.Set_BCM8Yield(fBCM8Yield);//Update BCM8 Yield
510 fEPICSCtrl.Set_USLumiSumAsymmetry(fAsymBCMUSLumiSum,fAsymBCMUSLumiSumError,fAsymBCMUSLumiSumWidth);//update the EPICS
511 out_file_PITA = fopen("/local/scratch/qweak/Feedback_PITA_log.txt", "a");
512 // out_file_PITA = fopen("/dev/shm/Feedback_PITA_log.txt", "a");
514 fclose(out_file_PITA);
515
516 if(TMath::Abs(fChargeAsymmetry)<5){
517 //These files save the last good PC hw count value for IHWP IN and OUT
518 if (fHalfWaveIN){
519 if (GetHalfWavePlate2State()==0){//IHWP2==OUT or No IHWP2 anymore
520 out_file_PC_IN_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_IN", "w");//Open in write mode
521 out_file_PC_IN_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_IN", "w");//Open in write mode
522 fprintf(out_file_PC_IN_pos,"%5.0f \n",fPrevPITASetpointPOS);
523 fprintf(out_file_PC_IN_neg,"%5.0f \n",fPrevPITASetpointNEG);
524 fclose(out_file_PC_IN_pos);
525 fclose(out_file_PC_IN_neg);
526 }else{//IHWP2==IN
527 out_file_PC_IN_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_IN_IHWP2_IN", "w");//Open in write mode
528 out_file_PC_IN_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_IN_IHWP2_IN", "w");//Open in write mode
529 fprintf(out_file_PC_IN_pos,"%5.0f \n",fPrevPITASetpointPOS);
530 fprintf(out_file_PC_IN_neg,"%5.0f \n",fPrevPITASetpointNEG);
531 fclose(out_file_PC_IN_pos);
532 fclose(out_file_PC_IN_neg);
533 }
534 }else{
535 if (GetHalfWavePlate2State()==0){//IHWP2==OUT or No IHWP2 anymore
536 out_file_PC_OUT_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_OUT", "w");//Open in write mode
537 out_file_PC_OUT_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_OUT", "w");//Open in write mode
538 fprintf(out_file_PC_OUT_pos,"%5.0f \n",fPrevPITASetpointPOS);
539 fprintf(out_file_PC_OUT_neg,"%5.0f \n",fPrevPITASetpointNEG);
540 fclose(out_file_PC_OUT_pos);
541 fclose(out_file_PC_OUT_neg);
542 }else{//IHWP2==IN
543 out_file_PC_OUT_pos = fopen("/local/scratch/qweak/Last_good_PC_pos_OUT_IHWP2_IN", "w");//Open in write mode
544 out_file_PC_OUT_neg = fopen("/local/scratch/qweak/Last_good_PC_neg_OUT_IHWP2_IN", "w");//Open in write mode
545 fprintf(out_file_PC_OUT_pos,"%5.0f \n",fPrevPITASetpointPOS);
546 fprintf(out_file_PC_OUT_neg,"%5.0f \n",fPrevPITASetpointNEG);
547 fclose(out_file_PC_OUT_pos);
548 fclose(out_file_PC_OUT_neg);
549 }
550 }
551 }
552
553};

References fAsymBCM78DD, fAsymBCM78DDError, fAsymBCM78DDWidth, fAsymBCMUSLumiSum, fAsymBCMUSLumiSumError, fAsymBCMUSLumiSumWidth, fBCM8Yield, fChargeAsymmetry, fChargeAsymmetryError, fChargeAsymmetryWidth, fEPICSCtrl, fHalfWaveIN, fPITASetpointNEG, fPITASetpointPOS, fPrevPITASetpointNEG, fPrevPITASetpointPOS, QwHelicityPattern::fQuartetNumber, GetHalfWavePlate2State(), out_file_PC_IN_neg, out_file_PC_IN_pos, out_file_PC_OUT_neg, out_file_PC_OUT_pos, and out_file_PITA.

Referenced by ApplyIAFeedback(), and ApplyPITAFeedback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LogParameters() [2/2]

void QwHelicityCorrelatedFeedback::LogParameters ( Int_t mode)

Log the last IA feedback information.

Definition at line 498 of file QwHelicityCorrelatedFeedback.cc.

498 {
499 out_file_IA = fopen("/local/scratch/qweak/Feedback_IA_log.txt", "a");
500 // fprintf(out_file," Feedback at %d current A_q[%d]:%5.8f+/-%5.8f IA Setpoint:%5.3f IA Previous Setpoint:%5.3f\n",fQuartetNumber,mode,fChargeAsym[mode],fChargeAsymError[mode],fIASetpoint[mode],fPrevIASetpoint[mode]);
501 fprintf(out_file_IA," %10.0d A_q[%1.0d] %20.4f +/- %20.4f %20.2f %20.2f\n",fQuartetNumber,mode,fChargeAsym[mode],fChargeAsymError[mode],fIASetpoint[mode],fPrevIASetpoint[mode]);
502 fclose(out_file_IA);
503};

References fChargeAsym, fChargeAsymError, fIASetpoint, fPrevIASetpoint, QwHelicityPattern::fQuartetNumber, and out_file_IA.

◆ LogPFParameters()

◆ ProcessOptions()

void QwHelicityCorrelatedFeedback::ProcessOptions ( QwOptions & options)

Process the configuration options.

Definition at line 31 of file QwHelicityCorrelatedFeedback.cc.

32{
34
35 fHalfWaveRevert = options.GetValue<bool>("Half-wave-plate-revert");
36 fHalfWavePlateStatus = GetHalfWavePlateState();//read the IHWP for the first time when the feedback is starting.
37 fAutoIHWP = options.GetValue<bool>("Auto-IHWP-Flip");
38
39
40
41 printf("NOTICE \n QwFeedback got the half-wave plate status %s\n", fHalfWavePlateStatus.Data());
42
43 if(fHalfWavePlateStatus.Contains("IN")) {
44 if(fHalfWaveRevert) fHalfWaveIN = false;
45 else fHalfWaveIN = true;
47 }
48 else {
50 else fHalfWaveIN = false;
52 }
53
55
56 if (fHalfWaveIN)
57 printf("NOTICE \n Half-wave-plate-IN\n");
58 else
59 printf("NOTICE \n Half-wave-plate-OUT\n");
60
62 printf("NOTICE \n Half-wave-plate-2 is IN \n");
63 else if (GetHalfWavePlate2State()==0)
64 printf("NOTICE \n Half-wave-plate-2 is OUT \n");
65
66
67
68
69 fPITAFB = options.GetValue<bool>("PITA-Feedback");
70 fHAIAFB = options.GetValue<bool>("HA-IA-Feedback");
71 fIAFB = options.GetValue<bool>("IA-Feedback");
72
73 if (fPITAFB)
74 printf("NOTICE \n PITA-Feedback is running.\n");
75 else
76 printf("NOTICE \n PITA-Feedback is not running.\n");
77 if (fIAFB)
78 printf("NOTICE \n IA-Feedback is running.\n");
79 else
80 printf("NOTICE \n IA-Feedback is not running.\n");
81 if (fHAIAFB)
82 printf("NOTICE \n Hall A IA-Feedback is running.\n");
83 else
84 printf("NOTICE \n Hall A IA-Feedback is not running.\n");
85
86 if (!fPITAFB && !fIAFB && !fHAIAFB){//no correction applied.
87 fEPICSCtrl.Set_FeedbackStatus(0);
88 exit(1);
89 }
90
91 if (fAutoIHWP){
92 printf("NOTICE \n AUTO IHWP Flip is ON \n");
93 //exit(1);
94 }else{
95 printf("NOTICE \n AUTO IHWP Flip is OFF \n");
96 //exit(1);
97 }
98 //exit(1);
99};
T GetValue(const std::string &key)
Get a templated value.
Definition QwOptions.h:236
void ProcessOptions(QwOptions &options)
Process the configuration options.

References fAutoIHWP, fDefaultHalfWavePlateStatus, fEPICSCtrl, fHAIAFB, fHalfWaveIN, fHalfWaveOUT, fHalfWavePlateStatus, fHalfWaveRevert, fIAFB, fPITAFB, GetHalfWavePlate2State(), GetHalfWavePlateState(), QwOptions::GetValue(), and QwHelicityPattern::ProcessOptions().

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateGMClean()

void QwHelicityCorrelatedFeedback::UpdateGMClean ( Int_t state)

Set Clean=0 or 1 in the GreenMonster.

Definition at line 573 of file QwHelicityCorrelatedFeedback.cc.

573 {
574 //fScanCtrl.Open();
575
576 if (state==0)
577 fScanCtrl.SCNSetStatus(SCN_INT_NOT);
578 if (state)
579 fScanCtrl.SCNSetStatus(SCN_INT_CLN);
580 fScanCtrl.CheckScan();
581 fScanCtrl.PrintScanInfo();
582 fScanCtrl.Close();
583
584};
#define SCN_INT_NOT
#define SCN_INT_CLN

References fScanCtrl, SCN_INT_CLN, and SCN_INT_NOT.

◆ UpdateGMScanParameters()

void QwHelicityCorrelatedFeedback::UpdateGMScanParameters ( )

Update last feedback setting into scan variables in the GreenMonster.

Definition at line 586 of file QwHelicityCorrelatedFeedback.cc.

586 {
587};

Field Documentation

◆ f3C12XDiff

Double_t QwHelicityCorrelatedFeedback::f3C12XDiff
private

Definition at line 312 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12XDiffError

Double_t QwHelicityCorrelatedFeedback::f3C12XDiffError
private

Definition at line 313 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12XDiffRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::f3C12XDiffRunningSum
private

◆ f3C12XDiffWidth

Double_t QwHelicityCorrelatedFeedback::f3C12XDiffWidth
private

Definition at line 314 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12YDiff

Double_t QwHelicityCorrelatedFeedback::f3C12YDiff
private

Definition at line 316 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12YDiffError

Double_t QwHelicityCorrelatedFeedback::f3C12YDiffError
private

Definition at line 317 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12YDiffRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::f3C12YDiffRunningSum
private

◆ f3C12YDiffWidth

Double_t QwHelicityCorrelatedFeedback::f3C12YDiffWidth
private

Definition at line 318 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12YQ

Double_t QwHelicityCorrelatedFeedback::f3C12YQ
private

Definition at line 320 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12YQError

Double_t QwHelicityCorrelatedFeedback::f3C12YQError
private

Definition at line 321 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ f3C12YQRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::f3C12YQRunningSum
private

◆ f3C12YQWidth

Double_t QwHelicityCorrelatedFeedback::f3C12YQWidth
private

Definition at line 322 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fAccumulatePatternMax

Int_t QwHelicityCorrelatedFeedback::fAccumulatePatternMax
private

Definition at line 343 of file QwHelicityCorrelatedFeedback.h.

Referenced by IsPatternsAccumulated(), and LoadParameterFile().

◆ fAsymBCM7

QwBeamCharge QwHelicityCorrelatedFeedback::fAsymBCM7
private

◆ fAsymBCM78DD

Double_t QwHelicityCorrelatedFeedback::fAsymBCM78DD
private

Definition at line 324 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fAsymBCM78DDError

Double_t QwHelicityCorrelatedFeedback::fAsymBCM78DDError
private

Definition at line 325 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fAsymBCM78DDRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fAsymBCM78DDRunningSum
private

◆ fAsymBCM78DDWidth

Double_t QwHelicityCorrelatedFeedback::fAsymBCM78DDWidth
private

Definition at line 326 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fAsymBCM8

QwBeamCharge QwHelicityCorrelatedFeedback::fAsymBCM8
private

◆ fAsymBCMUSLumiSum

Double_t QwHelicityCorrelatedFeedback::fAsymBCMUSLumiSum
private

Definition at line 331 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fAsymBCMUSLumiSumError

Double_t QwHelicityCorrelatedFeedback::fAsymBCMUSLumiSumError
private

Definition at line 332 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fAsymBCMUSLumiSumWidth

Double_t QwHelicityCorrelatedFeedback::fAsymBCMUSLumiSumWidth
private

Definition at line 333 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fAsymUSLumiSumRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fAsymUSLumiSumRunningSum
private

◆ fAutoIHWP

Bool_t QwHelicityCorrelatedFeedback::fAutoIHWP
private

◆ fBCM8Yield

Double_t QwHelicityCorrelatedFeedback::fBCM8Yield
private

Definition at line 328 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetChargeStat(), and LogParameters().

◆ fChargeAsym

Double_t QwHelicityCorrelatedFeedback::fChargeAsym[kHelModes]
private

◆ fChargeAsymError

Double_t QwHelicityCorrelatedFeedback::fChargeAsymError[kHelModes]
private

◆ fChargeAsymmetry

Double_t QwHelicityCorrelatedFeedback::fChargeAsymmetry
private

◆ fChargeAsymmetry0

QwBeamCharge QwHelicityCorrelatedFeedback::fChargeAsymmetry0
private

Definition at line 421 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fChargeAsymmetryError

Double_t QwHelicityCorrelatedFeedback::fChargeAsymmetryError
private

◆ fChargeAsymmetryWidth

Double_t QwHelicityCorrelatedFeedback::fChargeAsymmetryWidth
private

◆ fChargeAsymPrecision

Double_t QwHelicityCorrelatedFeedback::fChargeAsymPrecision
private

◆ fChargeAsymWidth

Double_t QwHelicityCorrelatedFeedback::fChargeAsymWidth[kHelModes]
private

Definition at line 337 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyIAFeedback(), and GetTargetChargeStat().

◆ fCurrentChargeAsymmetry

QwBeamCharge QwHelicityCorrelatedFeedback::fCurrentChargeAsymmetry
private

Definition at line 423 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fCurrentHelPat

Int_t QwHelicityCorrelatedFeedback::fCurrentHelPat
private

Definition at line 286 of file QwHelicityCorrelatedFeedback.h.

Referenced by CalculateAsymmetry().

◆ fCurrentHelPatMode

Int_t QwHelicityCorrelatedFeedback::fCurrentHelPatMode
private

◆ fCurrentIA

Double_t QwHelicityCorrelatedFeedback::fCurrentIA
private

Definition at line 354 of file QwHelicityCorrelatedFeedback.h.

◆ fCurrentIAAsymmetry

QwBeamCharge QwHelicityCorrelatedFeedback::fCurrentIAAsymmetry
private

Definition at line 427 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fCurrentPCN

Double_t QwHelicityCorrelatedFeedback::fCurrentPCN
private

Definition at line 356 of file QwHelicityCorrelatedFeedback.h.

◆ fCurrentPCP

Double_t QwHelicityCorrelatedFeedback::fCurrentPCP
private

Definition at line 355 of file QwHelicityCorrelatedFeedback.h.

◆ fDefaultHalfWavePlateStatus

UInt_t QwHelicityCorrelatedFeedback::fDefaultHalfWavePlateStatus
private

◆ fDelta_IASlopeA

Double_t QwHelicityCorrelatedFeedback::fDelta_IASlopeA[kHelModes]
private

Definition at line 360 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile().

◆ fEPICSCtrl

◆ fFBRunningAsymmetry

std::vector<QwSubsystemArrayParity> QwHelicityCorrelatedFeedback::fFBRunningAsymmetry
private

◆ fFeedbackDamping

Bool_t QwHelicityCorrelatedFeedback::fFeedbackDamping
private

Definition at line 475 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints(), and LoadParameterFile().

◆ fFeedbackStatus

Bool_t QwHelicityCorrelatedFeedback::fFeedbackStatus
private

Definition at line 474 of file QwHelicityCorrelatedFeedback.h.

Referenced by CheckFeedbackStatus().

◆ fGoodPatternCounter

Int_t QwHelicityCorrelatedFeedback::fGoodPatternCounter
private

◆ fHAAccumulatePatternMax

Int_t QwHelicityCorrelatedFeedback::fHAAccumulatePatternMax
private

◆ fHAChargeAsym

Double_t QwHelicityCorrelatedFeedback::fHAChargeAsym[kHelModes]
private

◆ fHAChargeAsymError

Double_t QwHelicityCorrelatedFeedback::fHAChargeAsymError[kHelModes]
private

◆ fHAChargeAsymWidth

Double_t QwHelicityCorrelatedFeedback::fHAChargeAsymWidth[kHelModes]
private

◆ fHADelta_IASlopeA

Double_t QwHelicityCorrelatedFeedback::fHADelta_IASlopeA[kHelModes]
private

Definition at line 364 of file QwHelicityCorrelatedFeedback.h.

◆ fHAGoodPatternCounter

Int_t QwHelicityCorrelatedFeedback::fHAGoodPatternCounter
private

◆ fHAIAFB

Bool_t QwHelicityCorrelatedFeedback::fHAIAFB
private

◆ fHAIASetpoint

Double_t QwHelicityCorrelatedFeedback::fHAIASetpoint[kHelModes]
private

◆ fHAIASlopeA

Double_t QwHelicityCorrelatedFeedback::fHAIASlopeA[kHelModes]
private

Definition at line 363 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedHAIASetPoint(), and LoadParameterFile().

◆ fHalfWaveIN

Bool_t QwHelicityCorrelatedFeedback::fHalfWaveIN
private

◆ fHalfWaveOUT

Bool_t QwHelicityCorrelatedFeedback::fHalfWaveOUT
private

Definition at line 461 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and ProcessOptions().

◆ fHalfWavePlateStatus

TString QwHelicityCorrelatedFeedback::fHalfWavePlateStatus
private

◆ fHalfWaveRevert

Bool_t QwHelicityCorrelatedFeedback::fHalfWaveRevert
private

Definition at line 464 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and ProcessOptions().

◆ fHelModeGoodPatternCounter

std::vector<Int_t> QwHelicityCorrelatedFeedback::fHelModeGoodPatternCounter
private

◆ fIAAsymmetry0

QwBeamCharge QwHelicityCorrelatedFeedback::fIAAsymmetry0
private

Definition at line 425 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fIAFB

Bool_t QwHelicityCorrelatedFeedback::fIAFB
private

◆ fIASetpoint

Double_t QwHelicityCorrelatedFeedback::fIASetpoint[kHelModes]
private

Definition at line 367 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedIASetPoint(), and LogParameters().

◆ fIASetpointlow

Double_t QwHelicityCorrelatedFeedback::fIASetpointlow
private

◆ fIASetpointup

Double_t QwHelicityCorrelatedFeedback::fIASetpointup
private

◆ fIASlopeA

Double_t QwHelicityCorrelatedFeedback::fIASlopeA[kHelModes]
private

◆ fIHWP

Int_t QwHelicityCorrelatedFeedback::fIHWP
private

Definition at line 462 of file QwHelicityCorrelatedFeedback.h.

◆ fInitialCorrection

Bool_t QwHelicityCorrelatedFeedback::fInitialCorrection
private

Definition at line 390 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile().

◆ fOptimalIA

Double_t QwHelicityCorrelatedFeedback::fOptimalIA
private

Definition at line 350 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile().

◆ fOptimalPCN

Double_t QwHelicityCorrelatedFeedback::fOptimalPCN
private

Definition at line 352 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile().

◆ fOptimalPCP

Double_t QwHelicityCorrelatedFeedback::fOptimalPCP
private

Definition at line 351 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile().

◆ fPatternCounter

Int_t QwHelicityCorrelatedFeedback::fPatternCounter
private

◆ fPFAccumulatePatternMax

Int_t QwHelicityCorrelatedFeedback::fPFAccumulatePatternMax
private

Definition at line 345 of file QwHelicityCorrelatedFeedback.h.

Referenced by IsPFPatternsAccumulated(), and LoadParameterFile().

◆ fPFGoodPatternCounter

Int_t QwHelicityCorrelatedFeedback::fPFGoodPatternCounter
private

◆ fPITA_MIN_Charge_asym

Double_t QwHelicityCorrelatedFeedback::fPITA_MIN_Charge_asym
private

◆ fPITAFB

Bool_t QwHelicityCorrelatedFeedback::fPITAFB
private

Definition at line 471 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and ProcessOptions().

◆ fPITASetpointlow

Double_t QwHelicityCorrelatedFeedback::fPITASetpointlow
private

Definition at line 395 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints(), and LoadParameterFile().

◆ fPITASetpointNEG

Double_t QwHelicityCorrelatedFeedback::fPITASetpointNEG
private

◆ fPITASetpointNEG_t0_IN

Double_t QwHelicityCorrelatedFeedback::fPITASetpointNEG_t0_IN
private

Definition at line 387 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and LoadParameterFile().

◆ fPITASetpointNEG_t0_OUT

Double_t QwHelicityCorrelatedFeedback::fPITASetpointNEG_t0_OUT
private

Definition at line 389 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and LoadParameterFile().

◆ fPITASetpointPOS

Double_t QwHelicityCorrelatedFeedback::fPITASetpointPOS
private

◆ fPITASetpointPOS_t0_IN

Double_t QwHelicityCorrelatedFeedback::fPITASetpointPOS_t0_IN
private

Definition at line 386 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and LoadParameterFile().

◆ fPITASetpointPOS_t0_OUT

Double_t QwHelicityCorrelatedFeedback::fPITASetpointPOS_t0_OUT
private

Definition at line 388 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and LoadParameterFile().

◆ fPITASetpointup

Double_t QwHelicityCorrelatedFeedback::fPITASetpointup
private

Definition at line 396 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints(), and LoadParameterFile().

◆ fPITASlope

Double_t QwHelicityCorrelatedFeedback::fPITASlope
private

Definition at line 381 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints().

◆ fPITASlopeIN

Double_t QwHelicityCorrelatedFeedback::fPITASlopeIN
private

Definition at line 378 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints(), and LoadParameterFile().

◆ fPITASlopeOUT

Double_t QwHelicityCorrelatedFeedback::fPITASlopeOUT
private

Definition at line 379 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints(), and LoadParameterFile().

◆ fPITASlopeOUT_IN

Double_t QwHelicityCorrelatedFeedback::fPITASlopeOUT_IN
private

Definition at line 380 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedPITASetPoints(), and LoadParameterFile().

◆ fPrevHAIASetpoint

Double_t QwHelicityCorrelatedFeedback::fPrevHAIASetpoint[kHelModes]
private

◆ fPrevIASetpoint

Double_t QwHelicityCorrelatedFeedback::fPrevIASetpoint[kHelModes]
private

Definition at line 368 of file QwHelicityCorrelatedFeedback.h.

Referenced by FeedIASetPoint(), and LogParameters().

◆ fPreviousChargeAsymmetry

QwBeamCharge QwHelicityCorrelatedFeedback::fPreviousChargeAsymmetry
private

Definition at line 422 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fPreviousHalfWavePlateStatus

UInt_t QwHelicityCorrelatedFeedback::fPreviousHalfWavePlateStatus
private

Definition at line 469 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile().

◆ fPreviousHelPat

Int_t QwHelicityCorrelatedFeedback::fPreviousHelPat
private

◆ fPreviousIAAsymmetry

QwBeamCharge QwHelicityCorrelatedFeedback::fPreviousIAAsymmetry
private

Definition at line 426 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fPrevPITASetpointNEG

Double_t QwHelicityCorrelatedFeedback::fPrevPITASetpointNEG
private

◆ fPrevPITASetpointPOS

Double_t QwHelicityCorrelatedFeedback::fPrevPITASetpointPOS
private

◆ fRunningCharge

QwBeamCharge QwHelicityCorrelatedFeedback::fRunningCharge
private

Definition at line 420 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ fScalerCharge

QwSIS3801D24_Channel QwHelicityCorrelatedFeedback::fScalerCharge
private

◆ fScalerChargeRunningSum

QwSIS3801D24_Channel QwHelicityCorrelatedFeedback::fScalerChargeRunningSum
private

◆ fScanCtrl

GreenMonster QwHelicityCorrelatedFeedback::fScanCtrl
private

Definition at line 403 of file QwHelicityCorrelatedFeedback.h.

Referenced by UpdateGMClean().

◆ fTargetCharge

QwBeamCharge QwHelicityCorrelatedFeedback::fTargetCharge
private

◆ fTargetParameter

QwBeamCharge QwHelicityCorrelatedFeedback::fTargetParameter
private

◆ fTargetXDiff

Double_t QwHelicityCorrelatedFeedback::fTargetXDiff
private

Definition at line 296 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetXDiffError

Double_t QwHelicityCorrelatedFeedback::fTargetXDiffError
private

Definition at line 297 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetXDiffRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fTargetXDiffRunningSum
private

◆ fTargetXDiffWidth

Double_t QwHelicityCorrelatedFeedback::fTargetXDiffWidth
private

Definition at line 298 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetXPDiff

Double_t QwHelicityCorrelatedFeedback::fTargetXPDiff
private

Definition at line 300 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetXPDiffError

Double_t QwHelicityCorrelatedFeedback::fTargetXPDiffError
private

Definition at line 301 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetXPDiffRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fTargetXPDiffRunningSum
private

◆ fTargetXPDiffWidth

Double_t QwHelicityCorrelatedFeedback::fTargetXPDiffWidth
private

Definition at line 302 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetYDiff

Double_t QwHelicityCorrelatedFeedback::fTargetYDiff
private

Definition at line 304 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetYDiffError

Double_t QwHelicityCorrelatedFeedback::fTargetYDiffError
private

Definition at line 305 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetYDiffRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fTargetYDiffRunningSum
private

◆ fTargetYDiffWidth

Double_t QwHelicityCorrelatedFeedback::fTargetYDiffWidth
private

Definition at line 306 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetYPDiff

Double_t QwHelicityCorrelatedFeedback::fTargetYPDiff
private

Definition at line 308 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetYPDiffError

Double_t QwHelicityCorrelatedFeedback::fTargetYPDiffError
private

Definition at line 309 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fTargetYPDiffRunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fTargetYPDiffRunningSum
private

◆ fTargetYPDiffWidth

Double_t QwHelicityCorrelatedFeedback::fTargetYPDiffWidth
private

Definition at line 310 of file QwHelicityCorrelatedFeedback.h.

Referenced by GetTargetPositionStat(), and LogPFParameters().

◆ fYieldBCM8RunningSum

QwBeamCharge QwHelicityCorrelatedFeedback::fYieldBCM8RunningSum
private

◆ IHWP_State

FILE* QwHelicityCorrelatedFeedback::IHWP_State
private

Definition at line 453 of file QwHelicityCorrelatedFeedback.h.

Referenced by ApplyFeedbackCorrections(), and LoadParameterFile().

◆ kHelModes

const Int_t QwHelicityCorrelatedFeedback::kHelModes =4
staticprivate

◆ kHelPat1

const Int_t QwHelicityCorrelatedFeedback::kHelPat1 =1001
staticprivate

Definition at line 281 of file QwHelicityCorrelatedFeedback.h.

Referenced by CalculateAsymmetry().

◆ kHelPat2

const Int_t QwHelicityCorrelatedFeedback::kHelPat2 =110
staticprivate

Definition at line 282 of file QwHelicityCorrelatedFeedback.h.

Referenced by CalculateAsymmetry().

◆ out_file_HA_IA

FILE* QwHelicityCorrelatedFeedback::out_file_HA_IA
private

◆ out_file_IA

FILE* QwHelicityCorrelatedFeedback::out_file_IA
private

Definition at line 452 of file QwHelicityCorrelatedFeedback.h.

Referenced by LogParameters(), and QwHelicityCorrelatedFeedback().

◆ out_file_PC_IN_neg

FILE* QwHelicityCorrelatedFeedback::out_file_PC_IN_neg
private

Definition at line 456 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile(), and LogParameters().

◆ out_file_PC_IN_pos

FILE* QwHelicityCorrelatedFeedback::out_file_PC_IN_pos
private

Definition at line 455 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile(), and LogParameters().

◆ out_file_PC_OUT_neg

FILE* QwHelicityCorrelatedFeedback::out_file_PC_OUT_neg
private

Definition at line 458 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile(), and LogParameters().

◆ out_file_PC_OUT_pos

FILE* QwHelicityCorrelatedFeedback::out_file_PC_OUT_pos
private

Definition at line 457 of file QwHelicityCorrelatedFeedback.h.

Referenced by LoadParameterFile(), and LogParameters().

◆ out_file_PITA

FILE* QwHelicityCorrelatedFeedback::out_file_PITA
private

Definition at line 451 of file QwHelicityCorrelatedFeedback.h.

Referenced by LogParameters(), and QwHelicityCorrelatedFeedback().

◆ rawtime

time_t QwHelicityCorrelatedFeedback::rawtime
private

Definition at line 478 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().

◆ timeinfo

struct tm* QwHelicityCorrelatedFeedback::timeinfo
private

Definition at line 479 of file QwHelicityCorrelatedFeedback.h.

Referenced by QwHelicityCorrelatedFeedback().


The documentation for this class was generated from the following files: