File indexing completed on 2024-04-06 12:29:28
0001 #ifndef SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALFENIXLINEARIZER_H
0002 #define SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALFENIXLINEARIZER_H
0003
0004 #include <CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h>
0005 #include <CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h>
0006 #include <CondFormats/EcalObjects/interface/EcalTPGPedestals.h>
0007 #include <DataFormats/EcalDigi/interface/EcalMGPASample.h>
0008
0009 #include <vector>
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 class EcalFenixLinearizer {
0020 private:
0021 bool famos_;
0022 int uncorrectedSample_;
0023 int gainID_;
0024 int base_;
0025 int mult_;
0026 int shift_;
0027 int strip_;
0028 bool init_;
0029
0030 const EcalTPGLinearizationConstant *linConsts_;
0031 const EcalTPGPedestal *peds_;
0032 const EcalTPGCrystalStatusCode *badXStatus_;
0033
0034 std::vector<const EcalTPGCrystalStatusCode *> vectorbadXStatus_;
0035
0036 int setInput(const EcalMGPASample &RawSam);
0037 int process();
0038
0039 public:
0040 EcalFenixLinearizer(bool famos);
0041 virtual ~EcalFenixLinearizer();
0042
0043 template <class T>
0044 void process(const T &, std::vector<int> &);
0045 void setParameters(uint32_t raw,
0046 const EcalTPGPedestals *ecaltpPed,
0047 const EcalTPGLinearizationConst *ecaltpLin,
0048 const EcalTPGCrystalStatus *ecaltpBadX);
0049 };
0050
0051 template <class T>
0052 void EcalFenixLinearizer::process(const T &df, std::vector<int> &output_percry) {
0053
0054
0055
0056
0057
0058
0059
0060
0061 for (int i = 0; i < df.size(); i++) {
0062 setInput(df[i]);
0063 output_percry[i] = process();
0064 }
0065
0066 return;
0067 }
0068
0069 #endif