Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:21:14

0001 ///////////////////////////////////////////////////////////////
0002 //
0003 // SpinDBContent class
0004 // Author      : D. Loomis, D. Neff (from Y. Fukao PHENIX class)
0005 // Description : Content of spin database
0006 // Created     : 2024-05-12
0007 //
0008 // runnum            : Run number
0009 // qa_level          : Level of QA for stored data.
0010 // fillnum           : Fill number
0011 // badrun            : Run QA by spin analysis, 1:bad 0:good
0012 // cross_shift       : Crossing sfhit, corrected=(raw+cross_shift)%NCROSS
0013 // bpol              : Blue beam polarization
0014 // bpolerr           : Blue beam polarization error
0015 // bpolsys           : Blue beam polarization systematic error
0016 // ypol              : Yellow beam polarization
0017 // ypolerr           : Yellow beam polarization error
0018 // ypolsys           : Yellow beam polarization systematic error
0019 // bpat              : Spin pattern at IP12. (NOT at sPHENIX)
0020 // ypat              : Spin pattern at IP12. (NOT at sPHENIX)
0021 // scaler_mbd_vtxcut : scaler (MBD VTX)
0022 // scaler_mbd_nocut  : scaler (MBD NS)
0023 // scaler_zdc_nocut  : scaler (ZDC NS)
0024 // bad_bunch         : Bad bunch QA, 0:good else:bad
0025 // cross_angle       : Average relative crossing angle between blue and yellow beams in mrad for run. Sign is dictated by CAD convention, can be + or -
0026 // cross_angle_std   : Standard deviation of relative crossing angle in mrad
0027 // cross_angle_min   : Minimum value of relative crossing angle in mrad
0028 // cross_angle_max   : Maximum value of relative crossing angle in mrad
0029 // asym_bf           : very forward neutron TSSA magnitude in blue beam
0030 // asym_bb           : very backward neutron TSSA magnitude in blue beam
0031 // asym_yf           : very forward neutron TSSA magnitude in yellow beam
0032 // asym_yb           : very backward neutron TSSA magnitude in yellow beam
0033 // asymerr_bf        : very forward neutron TSSA magnitude uncertainty in blue beam
0034 // asymerr_bb        : very backward neutron TSSA magnitude uncertainty in blue beam
0035 // asymerr_yf        : very forward neutron TSSA magnitude uncertainty in yellow beam
0036 // asymerr_yb        : very backward neutron TSSA magnitude uncertainty in yellow beam
0037 // phase_bf          : very forward neutron TSSA phase offset in blue beam
0038 // phase_bb          : very backward neutron TSSA phase offset in blue beam
0039 // phase_yf          : very forward neutron TSSA phase offset in yellow beam
0040 // phase_yb          : very backward neutron TSSA phase offset in yellow beam
0041 // phaseerr_bf       : very forward neutron TSSA phase offset uncertainty in blue beam
0042 // phaseerr_bb       : very backward neutron TSSA phase offset uncertainty in blue beam
0043 // phaseerr_yf       : very forward neutron TSSA phase offset uncertainty in yellow beam
0044 // phaseerr_yb       : very backward neutron TSSA phase offset uncertainty in yellow beam
0045 
0046 ////////////////////////////////////////////////////////////////
0047 
0048 #ifndef USPIN_SPINDBCONTENTV1_H
0049 #define USPIN_SPINDBCONTENTV1_H
0050 
0051 #include "SpinDBContent.h"
0052 
0053 // #include <stdio.h>
0054 // #include <iostream>
0055 
0056 class SpinDBContentv1 : public SpinDBContent
0057 {
0058  public:
0059   SpinDBContentv1() { InitializeV1(); }
0060   ~SpinDBContentv1() override = default;
0061 
0062   void identify(std::ostream& os = std::cout) const override;
0063   void InitializeV1();
0064 
0065   int CheckBunchNumber(int bunch) const override;
0066 
0067   int GetRunNumber() const override { return runnum; }
0068   int GetQALevel() const override { return qa_level; }
0069   int GetFillNumber() const override { return fillnum; }
0070   int GetBadRunFlag() const override { return badrun; }
0071   int GetCrossingShift() const override { return cross_shift; }
0072 
0073   int GetPolarizationBlue(int, float&, float&) const override;
0074   int GetPolarizationBlue(int, float&, float&, float&) const override;
0075   int GetPolarizationBlue(int, double&, double&) const override;
0076   int GetPolarizationBlue(int, double&, double&, double&) const override;
0077   int GetPolarizationYellow(int, float&, float&) const override;
0078   int GetPolarizationYellow(int, float&, float&, float&) const override;
0079   int GetPolarizationYellow(int, double&, double&) const override;
0080   int GetPolarizationYellow(int, double&, double&, double&) const override;
0081 
0082   int GetSpinPatternBlue(int) const override;
0083   int GetSpinPatternYellow(int) const override;
0084   long long GetScalerMbdVertexCut(int) const override;
0085   long long GetScalerMbdNoCut(int) const override;
0086   long long GetScalerZdcNoCut(int) const override;
0087   long long GetScaler(int, int) const override;
0088   int GetBadBunchFlag(int) const override;
0089 
0090   void GetAsymBlueForward(float&, float&) const override;
0091   void GetAsymBlueBackward(float&, float&) const override;
0092   void GetAsymYellowForward(float&, float&) const override;
0093   void GetAsymYellowBackward(float&, float&) const override;
0094   void GetPhaseBlueForward(float&, float&) const override;
0095   void GetPhaseBlueBackward(float&, float&) const override;
0096   void GetPhaseYellowForward(float&, float&) const override;
0097   void GetPhaseYellowBackward(float&, float&) const override;
0098 
0099   float GetCrossAngle() const override { return cross_angle; }
0100   float GetCrossAngleStd() const override { return cross_angle_std; }
0101   float GetCrossAngleMin() const override { return cross_angle_min; }
0102   float GetCrossAngleMax() const override { return cross_angle_max; }
0103 
0104   void SetRunNumber(int run) override { runnum = run; }
0105   void SetQALevel(int qa) override { qa_level = qa; }
0106   void SetFillNumber(int fill) override { fillnum = fill; }
0107   void SetBadRunFlag(int flag) override { badrun = flag; }
0108   void SetCrossingShift(int shift) override { cross_shift = shift; }
0109 
0110   int SetPolarizationBlue(int, float, float) override;
0111   int SetPolarizationYellow(int, float, float) override;
0112   int SetPolarizationBlue(int, float, float, float) override;
0113   int SetPolarizationYellow(int, float, float, float) override;
0114 
0115   int SetSpinPatternBlue(int, int) override;
0116   int SetSpinPatternYellow(int, int) override;
0117   int SetScalerMbdVertexCut(int, long long) override;
0118   int SetScalerMbdNoCut(int, long long) override;
0119   int SetScalerZdcNoCut(int, long long) override;
0120   int SetScaler(int, int, long long) override;
0121   int SetBadBunchFlag(int, int) override;
0122 
0123   void SetAsymBlueForward(float value, float error) override;
0124   void SetAsymBlueBackward(float value, float error) override;
0125   void SetAsymYellowForward(float value, float error) override;
0126   void SetAsymYellowBackward(float value, float error) override;
0127   void SetPhaseBlueForward(float value, float error) override;
0128   void SetPhaseBlueBackward(float value, float error) override;
0129   void SetPhaseYellowForward(float value, float error) override;
0130   void SetPhaseYellowBackward(float value, float error) override;
0131 
0132   void SetCrossAngle(float value) override { cross_angle = value; }
0133   void SetCrossAngleStd(float value) override { cross_angle_std = value; }
0134   void SetCrossAngleMin(float value) override { cross_angle_min = value; }
0135   void SetCrossAngleMax(float value) override { cross_angle_max = value; }
0136 
0137  private:
0138   int runnum;
0139   int qa_level;
0140   int fillnum;
0141   int badrun;
0142   int cross_shift;
0143   float bpol[120];
0144   float bpolerr[120];
0145   float bpolsys[120];
0146   float ypol[120];
0147   float ypolerr[120];
0148   float ypolsys[120];
0149   int bpat[120];
0150   int ypat[120];
0151   long long scaler_mbd_vtxcut[120];
0152   long long scaler_mbd_nocut[120];
0153   long long scaler_zdc_nocut[120];
0154   int bad_bunch[120];
0155   float cross_angle;
0156   float cross_angle_std;
0157   float cross_angle_min;
0158   float cross_angle_max;
0159   float asym_bf;
0160   float asym_bb;
0161   float asym_yf;
0162   float asym_yb;
0163   float asymerr_bf;
0164   float asymerr_bb;
0165   float asymerr_yf;
0166   float asymerr_yb;
0167   float phase_bf;
0168   float phase_bb;
0169   float phase_yf;
0170   float phase_yb;
0171   float phaseerr_bf;
0172   float phaseerr_bb;
0173   float phaseerr_yf;
0174   float phaseerr_yb;
0175 
0176  private:
0177   ClassDefOverride(SpinDBContentv1, 1);
0178 };
0179 
0180 #endif /* USPIN_SPINDBCONTENTV1_H */