JAPAn
Just Another Parity Analyzer
Loading...
Searching...
No Matches
LRBCorrector.h
Go to the documentation of this file.
1/*!
2 * \file LRBCorrector.h
3 * \brief Linear regression blue corrector data handler class
4 * \author Michael Vallee
5 * \date 2018-08-01
6 */
7
8#pragma once
9
10// Parent Class
11#include "VQwDataHandler.h"
12
13
14/**
15 * \class LRBCorrector
16 * \ingroup QwAnalysis_BL
17 * \brief Linear-regression corrector applying per-burst slopes to data
18 *
19 * Loads cycle-dependent sensitivities and applies linear regression
20 * corrections to monitored channels, selecting the appropriate set
21 * based on the current burst counter.
22 */
23class LRBCorrector : public VQwDataHandler, public MQwDataHandlerCloneable<LRBCorrector>{
24 public:
25 /// \brief Constructor with name
26 LRBCorrector(const TString& name);
27
28 void ParseConfigFile(QwParameterFile& file) override;
29
30 Int_t LoadChannelMap(const std::string& mapfile) override;
31
33
34 void ProcessData() override;
35
36 void UpdateBurstCounter(Short_t burstcounter) override{
37 if (burstcounter<fLastCycle){
38 fBurstCounter=burstcounter;
39 } else if (fLastCycle==1){
40 // If we have a single cycle of slopes, don't throw a warning.
41 fBurstCounter = 0;
42 } else {
44 QwWarning << "LRBCorrector, " << GetName()
45 << ": Burst counter, " << burstcounter
46 << ", is greater than the stored number of sets of slopes. "
47 << "Using the last set of slopes (cycle=" << fLastCycle
48 << ")" << QwLog::endl;
49 }
50 };
51
52 protected:
54
55 std::string fAlphaFileBase;
56 std::string fAlphaFileSuff;
57 std::string fAlphaFilePath;
58
59 std::vector< EQwHandleType > fIndependentType;
60 std::vector< std::string > fIndependentName;
61 std::vector< std::string > fIndependentFull;
62
63 std::vector< const VQwHardwareChannel* > fIndependentVar;
64 std::vector< Double_t > fIndependentValues;
65
66 Short_t fLastCycle;
67 std::map<Short_t,std::vector<std::vector<Double_t>>> fSensitivity;
68
69};
#define QwWarning
Predefined log drain for warnings.
Definition QwLog.h:44
Virtual base class for data handlers accessing multiple subsystems.
static std::ostream & endl(std::ostream &)
End of the line.
Definition QwLog.cc:297
Configuration file parser with flexible tokenization and search capabilities.
std::map< Short_t, std::vector< std::vector< Double_t > > > fSensitivity
std::string fAlphaFilePath
Short_t fLastCycle
std::string fAlphaFileBase
void ParseConfigFile(QwParameterFile &file) override
std::vector< Double_t > fIndependentValues
std::vector< std::string > fIndependentName
void ProcessData() override
Int_t ConnectChannels(QwSubsystemArrayParity &asym, QwSubsystemArrayParity &diff) override
std::vector< EQwHandleType > fIndependentType
std::vector< const VQwHardwareChannel * > fIndependentVar
void UpdateBurstCounter(Short_t burstcounter) override
LRBCorrector(const TString &name)
Constructor with name.
std::string fAlphaFileSuff
std::vector< std::string > fIndependentFull
Subsystem array container specialized for parity analysis with asymmetry calculations.
TString GetName()
VQwDataHandler(const TString &name)
Short_t fBurstCounter
When a datahandler array is processed, handlers with lower priority will be processed before handlers...