Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-11 04:40:28

0001 #include <iostream>
0002 
0003 #include "CondFormats/L1TObjects/interface/CaloParams.h"
0004 
0005 #include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
0006 #include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
0007 #include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
0008 #include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
0009 #include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
0010 
0011 #ifndef CaloParamsHelperO2O_h
0012 #define CaloParamsHelperO2O_h
0013 
0014 namespace l1t {
0015 
0016   class CaloParamsHelperO2O : public CaloParams {
0017   public:
0018     // DO NOT ADD ENTRIES ANYWHERE BUT DIRECTLY BEFORE "NUM_CALOPARAMNODES"
0019     // DO NOT CHANGE NUMERICAL VALUES OF ANY ALREADY EXISTING FIELDS, YOU CAN ONLY EXTEND, AT THE END.
0020     enum {
0021       regionPUS = 0,
0022       egTrimming = 1,
0023       egMaxHOverE = 2,
0024       egCompressShapes = 3,
0025       egShapeId = 4,
0026       egCalibration = 5,
0027       egPUS = 6,
0028       egIsolation = 7,
0029       tauCalibration = 8,
0030       tauPUS = 9,
0031       tauIsolation = 10,
0032       jetPUS = 11,
0033       jetCalibration = 12,
0034       hiCentrality = 13,
0035       hiQ2 = 14,
0036       tauEtToHFRingEt = 15,
0037       tauCompress = 16,
0038       layer1ECal = 17,
0039       layer1HCal = 18,
0040       layer1HF = 19,
0041       jetCompressEta = 20,
0042       jetCompressPt = 21,
0043       metCalibration = 22,
0044       metHFCalibration = 23,
0045       etSumEttCalibration = 24,
0046       etSumEcalSumCalibration = 25,
0047       tauIsolation2 = 26,
0048       egBypassEGVetosFlag = 27,
0049       jetBypassPUSFlag = 28,
0050       egHOverEBarrel = 29,
0051       egHOverEEndcap = 30,
0052       etSumMetPUS = 31,
0053       etSumBypassMetPUSFlag = 32,
0054       egBypassExtHoE = 33,
0055       egIsolation2 = 34,
0056       etSumEttPUS = 35,
0057       etSumBypassEttPUSFlag = 36,
0058       etSumEcalSumPUS = 37,
0059       etSumBypassEcalSumPUSFlag = 38,
0060       layer1HOverE = 39,
0061       PUTowerThreshold = 40,
0062       tauTrimmingShapeVeto = 41,
0063       egBypassShapeFlag = 42,
0064       egBypassECALFGFlag = 43,
0065       egBypassHoEFlag = 44,
0066       etSumCentralityLower = 45,
0067       etSumCentralityUpper = 46,
0068       jetPUSUsePhiRingFlag = 47,
0069       metPhiCalibration = 48,
0070       metHFPhiCalibration = 49,
0071       NUM_CALOPARAMNODES = 50
0072     };
0073 
0074     CaloParamsHelperO2O() { pnode_.resize(NUM_CALOPARAMNODES); }
0075     CaloParamsHelperO2O(const CaloParams& p) : CaloParams(p) {
0076       if (pnode_.size() < NUM_CALOPARAMNODES) {
0077         pnode_.resize(NUM_CALOPARAMNODES);
0078         // at version 2, tauCompress was added, we can add a default version here if necessary...
0079       }
0080     };
0081     ~CaloParamsHelperO2O() {}
0082 
0083     bool isValidForStage1() { return true; }
0084     bool isValidForStage2() { return (version_ >= 2); }
0085 
0086     L1CaloEtScale emScale() { return emScale_; }
0087     void setEmScale(L1CaloEtScale emScale) { emScale_ = emScale; }
0088     L1CaloEtScale jetScale() { return jetScale_; }
0089     void setJetScale(L1CaloEtScale jetScale) { jetScale_ = jetScale; }
0090     L1CaloEtScale HtMissScale() { return HtMissScale_; }
0091     L1CaloEtScale HfRingScale() { return HfRingScale_; }
0092     void setHtMissScale(L1CaloEtScale HtMissScale) { HtMissScale_ = HtMissScale; }
0093     void setHfRingScale(L1CaloEtScale HfRingScale) { HfRingScale_ = HfRingScale; }
0094 
0095     // towers
0096     double towerLsbH() const { return towerp_.lsbH_; }
0097     double towerLsbE() const { return towerp_.lsbE_; }
0098     double towerLsbSum() const { return towerp_.lsbSum_; }
0099     int towerNBitsH() const { return towerp_.nBitsH_; }
0100     int towerNBitsE() const { return towerp_.nBitsE_; }
0101     int towerNBitsSum() const { return towerp_.nBitsSum_; }
0102     int towerNBitsRatio() const { return towerp_.nBitsRatio_; }
0103     int towerMaskE() const { return towerp_.maskE_; }
0104     int towerMaskH() const { return towerp_.maskH_; }
0105     int towerMaskSum() const { return towerp_.maskSum_; }
0106     int towerMaskRatio() const { return towerp_.maskRatio_; }
0107     bool doTowerEncoding() const { return towerp_.doEncoding_; }
0108 
0109     void setTowerLsbH(double lsb) { towerp_.lsbH_ = lsb; }
0110     void setTowerLsbE(double lsb) { towerp_.lsbE_ = lsb; }
0111     void setTowerLsbSum(double lsb) { towerp_.lsbSum_ = lsb; }
0112     void setTowerNBitsH(int n) {
0113       towerp_.nBitsH_ = n;
0114       towerp_.maskH_ = std::pow(2, n) - 1;
0115     }
0116     void setTowerNBitsE(int n) {
0117       towerp_.nBitsE_ = n;
0118       towerp_.maskE_ = std::pow(2, n) - 1;
0119     }
0120     void setTowerNBitsSum(int n) {
0121       towerp_.nBitsSum_ = n;
0122       towerp_.maskSum_ = std::pow(2, n) - 1;
0123     }
0124     void setTowerNBitsRatio(int n) {
0125       towerp_.nBitsRatio_ = n;
0126       towerp_.maskRatio_ = std::pow(2, n) - 1;
0127     }
0128     void setTowerEncoding(bool doit) { towerp_.doEncoding_ = doit; }
0129 
0130     // regions
0131     double regionLsb() const { return regionLsb_; }
0132     std::string regionPUSType() const { return pnode_[regionPUS].type_; }
0133     std::vector<double> regionPUSParams() { return pnode_[regionPUS].dparams_; }
0134     l1t::LUT* regionPUSLUT() { return &pnode_[regionPUS].LUT_; }
0135 
0136     int regionPUSValue(int PUM0, int eta) {
0137       int puSub = ceil(regionPUSParams()[18 * eta + PUM0] * 2);
0138       return puSub;
0139     }
0140 
0141     void setRegionLsb(double lsb) { regionLsb_ = lsb; }
0142     void setRegionPUSType(std::string type) { pnode_[regionPUS].type_ = type; }
0143     void setRegionPUSParams(const std::vector<double>& params) { pnode_[regionPUS].dparams_ = params; }
0144     void setRegionPUSLUT(const l1t::LUT& lut) { pnode_[regionPUS].LUT_ = lut; }
0145 
0146     int pileUpTowerThreshold() const { return pnode_[PUTowerThreshold].iparams_[0]; }
0147     void setPileUpTowerThreshold(int thresh) {
0148       pnode_[PUTowerThreshold].iparams_.resize(1);
0149       pnode_[PUTowerThreshold].iparams_[0] = thresh;
0150     }
0151 
0152     // EG
0153     int egEtaCut() const {
0154       if (pnode_[egPUS].version_ == 1)
0155         return pnode_[egPUS].iparams_[0];
0156       else
0157         return 0;
0158     }
0159     double egLsb() const { return egp_.lsb_; }
0160     double egSeedThreshold() const { return egp_.seedThreshold_; }
0161     double egNeighbourThreshold() const { return egp_.neighbourThreshold_; }
0162     double egHcalThreshold() const { return egp_.hcalThreshold_; }
0163     l1t::LUT* egTrimmingLUT() { return &pnode_[egTrimming].LUT_; }
0164     double egMaxHcalEt() const { return egp_.maxHcalEt_; }
0165     double egMaxPtHOverE() const { return egp_.maxPtHOverE_; }
0166     l1t::LUT* egMaxHOverELUT() { return &pnode_[egMaxHOverE].LUT_; }
0167     l1t::LUT* egCompressShapesLUT() { return &pnode_[egCompressShapes].LUT_; }
0168     l1t::LUT* egShapeIdLUT() { return &pnode_[egShapeId].LUT_; }
0169     int egMinPtJetIsolation() const { return egp_.minPtJetIsolation_; }
0170     int egMaxPtJetIsolation() const { return egp_.maxPtJetIsolation_; }
0171     int egMinPtHOverEIsolation() const { return egp_.minPtHOverEIsolation_; }
0172     int egMaxPtHOverEIsolation() const { return egp_.maxPtHOverEIsolation_; }
0173     unsigned egBypassEGVetos() { return pnode_[egBypassEGVetosFlag].uparams_[0]; }
0174     unsigned egBypassExtHOverE() { return pnode_[egBypassExtHoE].uparams_[0]; }
0175     unsigned egBypassShape() const {
0176       if (pnode_[egBypassShapeFlag].uparams_.empty())
0177         return 0;
0178       else
0179         return pnode_[egBypassShapeFlag].uparams_[0];
0180     }
0181     unsigned egBypassECALFG() const {
0182       if (pnode_[egBypassECALFGFlag].uparams_.empty())
0183         return 0;
0184       else
0185         return pnode_[egBypassECALFGFlag].uparams_[0];
0186     }
0187     unsigned egBypassHoE() const {
0188       if (pnode_[egBypassHoEFlag].uparams_.empty())
0189         return 0;
0190       else
0191         return pnode_[egBypassHoEFlag].uparams_[0];
0192     }
0193 
0194     int egHOverEcutBarrel() const { return pnode_[egHOverEBarrel].iparams_[0]; }
0195     int egHOverEcutEndcap() const { return pnode_[egHOverEEndcap].iparams_[0]; }
0196 
0197     unsigned egIsoAreaNrTowersEta() const { return egp_.isoAreaNrTowersEta_; }
0198     unsigned egIsoAreaNrTowersPhi() const { return egp_.isoAreaNrTowersPhi_; }
0199     unsigned egIsoVetoNrTowersPhi() const { return egp_.isoVetoNrTowersPhi_; }
0200     const std::string& egPUSType() const { return pnode_[egPUS].type_; }
0201     const std::vector<double>& egPUSParams() const { return pnode_[egPUS].dparams_; }
0202     double egPUSParam(int ipar) const { return pnode_[egPUS].dparams_.at(ipar); }
0203 
0204     std::string egIsolationType() const { return pnode_[egIsolation].type_; }
0205     l1t::LUT* egIsolationLUT() { return &pnode_[egIsolation].LUT_; }
0206     l1t::LUT* egIsolationLUT2() { return &pnode_[egIsolation2].LUT_; }
0207     std::string egCalibrationType() const { return pnode_[egCalibration].type_; }
0208     std::vector<double> egCalibrationParams() { return pnode_[egCalibration].dparams_; }
0209     l1t::LUT* egCalibrationLUT() { return &pnode_[egCalibration].LUT_; }
0210 
0211     void setEgEtaCut(int mask) {
0212       pnode_[egPUS].iparams_.resize(1);
0213       pnode_[egPUS].iparams_[0] = mask;
0214     }
0215     void setEgLsb(double lsb) { egp_.lsb_ = lsb; }
0216     void setEgSeedThreshold(double thresh) { egp_.seedThreshold_ = thresh; }
0217     void setEgNeighbourThreshold(double thresh) { egp_.neighbourThreshold_ = thresh; }
0218     void setEgHcalThreshold(double thresh) { egp_.hcalThreshold_ = thresh; }
0219     void setEgTrimmingLUT(const l1t::LUT& lut) { pnode_[egTrimming].LUT_ = lut; }
0220     void setEgMaxHcalEt(double cut) { egp_.maxHcalEt_ = cut; }
0221     void setEgMaxPtHOverE(double thresh) { egp_.maxPtHOverE_ = thresh; }
0222     void setEgMaxHOverELUT(const l1t::LUT& lut) { pnode_[egMaxHOverE].LUT_ = lut; }
0223     void setEgCompressShapesLUT(const l1t::LUT& lut) { pnode_[egCompressShapes].LUT_ = lut; }
0224     void setEgShapeIdLUT(const l1t::LUT& lut) { pnode_[egShapeId].LUT_ = lut; }
0225     void setEgMinPtJetIsolation(int cutValue) { egp_.minPtJetIsolation_ = cutValue; }
0226     void setEgMaxPtJetIsolation(int cutValue) { egp_.maxPtJetIsolation_ = cutValue; }
0227     void setEgMinPtHOverEIsolation(int cutValue) { egp_.minPtHOverEIsolation_ = cutValue; }
0228     void setEgMaxPtHOverEIsolation(int cutValue) { egp_.maxPtHOverEIsolation_ = cutValue; }
0229     void setEgBypassEGVetos(unsigned flag) {
0230       pnode_[egBypassEGVetosFlag].uparams_.resize(1);
0231       pnode_[egBypassEGVetosFlag].uparams_[0] = flag;
0232     }
0233     void setEgBypassShape(unsigned flag) {
0234       pnode_[egBypassShapeFlag].uparams_.resize(1);
0235       pnode_[egBypassShapeFlag].uparams_[0] = flag;
0236     }
0237     void setEgBypassECALFG(unsigned flag) {
0238       pnode_[egBypassECALFGFlag].uparams_.resize(1);
0239       pnode_[egBypassECALFGFlag].uparams_[0] = flag;
0240     }
0241     void setEgBypassExtHOverE(unsigned flag) {
0242       pnode_[egBypassExtHoE].uparams_.resize(1);
0243       pnode_[egBypassExtHoE].uparams_[0] = flag;
0244     }
0245     void setEgHOverEcutBarrel(int cut) {
0246       pnode_[egHOverEBarrel].iparams_.resize(1);
0247       pnode_[egHOverEBarrel].iparams_[0] = cut;
0248     }
0249     void setEgHOverEcutEndcap(int cut) {
0250       pnode_[egHOverEEndcap].iparams_.resize(1);
0251       pnode_[egHOverEEndcap].iparams_[0] = cut;
0252     }
0253 
0254     void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta) { egp_.isoAreaNrTowersEta_ = iEgIsoAreaNrTowersEta; }
0255     void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi) { egp_.isoAreaNrTowersPhi_ = iEgIsoAreaNrTowersPhi; }
0256     void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi) { egp_.isoVetoNrTowersPhi_ = iEgIsoVetoNrTowersPhi; }
0257     void setEgPUSType(std::string type) { pnode_[egPUS].type_ = type; }
0258     void setEgPUSParams(const std::vector<double>& params) { pnode_[egPUS].dparams_ = params; }
0259     void setEgIsolationType(std::string type) { pnode_[egIsolation].type_ = type; }
0260     void setEgIsolationLUT(const l1t::LUT& lut) { pnode_[egIsolation].LUT_ = lut; }
0261     void setEgIsolationLUT2(const l1t::LUT& lut) { pnode_[egIsolation2].LUT_ = lut; }
0262     void setEgCalibrationType(std::string type) { pnode_[egCalibration].type_ = type; }
0263     void setEgCalibrationParams(std::vector<double> params) { pnode_[egCalibration].dparams_ = params; }
0264     void setEgCalibrationLUT(const l1t::LUT& lut) { pnode_[egCalibration].LUT_ = lut; }
0265 
0266     // - recently imported:
0267     std::string egShapeIdType() const { return pnode_[egShapeId].type_; }
0268     void setEgShapeIdType(std::string type) { pnode_[egShapeId].type_ = type; }
0269     unsigned egShapeIdVersion() const { return pnode_[egShapeId].version_; }
0270     void setEgShapeIdVersion(unsigned version) { pnode_[egShapeId].version_ = version; }
0271     unsigned egCalibrationVersion() const { return pnode_[egCalibration].version_; }
0272     void setEgCalibrationVersion(unsigned version) { pnode_[egCalibration].version_ = version; }
0273 
0274     // tau
0275     int tauRegionMask() const {
0276       if (pnode_[tauPUS].version_ == 1)
0277         return pnode_[tauPUS].iparams_[0];
0278       else
0279         return 0;
0280     }
0281     double tauLsb() const { return taup_.lsb_; }
0282     double tauSeedThreshold() const { return taup_.seedThreshold_; }
0283     double tauNeighbourThreshold() const { return taup_.neighbourThreshold_; }
0284     double tauMaxPtTauVeto() const { return taup_.maxPtTauVeto_; }
0285     double tauMinPtJetIsolationB() const { return taup_.minPtJetIsolationB_; }
0286     double tauMaxJetIsolationB() const { return taup_.maxJetIsolationB_; }
0287     double tauMaxJetIsolationA() const { return taup_.maxJetIsolationA_; }
0288     int isoTauEtaMin() const { return taup_.isoEtaMin_; }
0289     int isoTauEtaMax() const { return taup_.isoEtaMax_; }
0290     std::string tauPUSType() const { return pnode_[tauPUS].type_; }
0291     const std::vector<double>& tauPUSParams() const { return pnode_[tauPUS].dparams_; }
0292     double tauPUSParam(int ipar) const { return pnode_[tauPUS].dparams_.at(ipar); }
0293 
0294     l1t::LUT* tauIsolationLUT() { return &pnode_[tauIsolation].LUT_; }
0295     l1t::LUT* tauIsolationLUT2() { return &pnode_[tauIsolation2].LUT_; }
0296     l1t::LUT* tauTrimmingShapeVetoLUT() { return &pnode_[tauTrimmingShapeVeto].LUT_; }
0297 
0298     std::string tauCalibrationType() const { return pnode_[tauCalibration].type_; }
0299     std::vector<double> tauCalibrationParams() { return pnode_[tauCalibration].dparams_; }
0300     l1t::LUT* tauCalibrationLUT() { return &pnode_[tauCalibration].LUT_; }
0301     l1t::LUT* tauCompressLUT() { return &pnode_[tauCompress].LUT_; }
0302 
0303     l1t::LUT* tauEtToHFRingEtLUT() { return &pnode_[tauEtToHFRingEt].LUT_; }
0304 
0305     unsigned tauIsoAreaNrTowersEta() const { return taup_.isoAreaNrTowersEta_; }
0306     unsigned tauIsoAreaNrTowersPhi() const { return taup_.isoAreaNrTowersPhi_; }
0307     unsigned tauIsoVetoNrTowersPhi() const { return taup_.isoVetoNrTowersPhi_; }
0308 
0309     void setTauRegionMask(int mask) {
0310       pnode_[tauPUS].iparams_.resize(1);
0311       pnode_[tauPUS].iparams_[0] = mask;
0312     }
0313     void setTauLsb(double lsb) { taup_.lsb_ = lsb; }
0314     void setTauSeedThreshold(double thresh) { taup_.seedThreshold_ = thresh; }
0315     void setTauNeighbourThreshold(double thresh) { taup_.neighbourThreshold_ = thresh; }
0316     void setTauMaxPtTauVeto(double limit) { taup_.maxPtTauVeto_ = limit; }
0317     void setTauMinPtJetIsolationB(double limit) { taup_.minPtJetIsolationB_ = limit; }
0318     void setTauMaxJetIsolationB(double limit) { taup_.maxJetIsolationB_ = limit; }
0319     void setTauMaxJetIsolationA(double cutValue) { taup_.maxJetIsolationA_ = cutValue; }
0320     void setIsoTauEtaMin(int value) { taup_.isoEtaMin_ = value; }
0321     void setIsoTauEtaMax(int value) { taup_.isoEtaMax_ = value; }
0322     void setTauPUSType(std::string type) { pnode_[tauPUS].type_ = type; }
0323     void setTauIsolationLUT(const l1t::LUT& lut) { pnode_[tauIsolation].LUT_ = lut; }
0324     void setTauIsolationLUT2(const l1t::LUT& lut) { pnode_[tauIsolation2].LUT_ = lut; }
0325     void setTauTrimmingShapeVetoLUT(const l1t::LUT& lut) { pnode_[tauTrimmingShapeVeto].LUT_ = lut; }
0326 
0327     void setTauCalibrationType(std::string type) { pnode_[tauCalibration].type_ = type; }
0328     void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta) {
0329       taup_.isoAreaNrTowersEta_ = iTauIsoAreaNrTowersEta;
0330     }
0331     void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi) {
0332       taup_.isoAreaNrTowersPhi_ = iTauIsoAreaNrTowersPhi;
0333     }
0334     void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi) {
0335       taup_.isoVetoNrTowersPhi_ = iTauIsoVetoNrTowersPhi;
0336     }
0337 
0338     void setTauCalibrationParams(std::vector<double> params) { pnode_[tauCalibration].dparams_ = params; }
0339     void setTauCalibrationLUT(const l1t::LUT& lut) { pnode_[tauCalibration].LUT_ = lut; }
0340     void setTauCompressLUT(const l1t::LUT& lut) { pnode_[tauCompress].LUT_ = lut; }
0341     void setTauPUSParams(const std::vector<double>& params) { pnode_[tauPUS].dparams_ = params; }
0342 
0343     void setTauEtToHFRingEtLUT(const l1t::LUT& lut) { pnode_[tauEtToHFRingEt].LUT_ = lut; }
0344 
0345     // jets
0346     double jetLsb() const { return jetp_.lsb_; }
0347     double jetSeedThreshold() const { return jetp_.seedThreshold_; }
0348     double jetNeighbourThreshold() const { return jetp_.neighbourThreshold_; }
0349     int jetRegionMask() const {
0350       if (pnode_[jetPUS].version_ == 1)
0351         return pnode_[jetPUS].iparams_[0];
0352       else
0353         return 0;
0354     }
0355 
0356     unsigned jetBypassPUS() const { return pnode_[jetBypassPUSFlag].uparams_[0]; }
0357     unsigned jetPUSUsePhiRing() const {
0358       if (pnode_[jetPUSUsePhiRingFlag].uparams_.empty())
0359         return 0;
0360       else
0361         return pnode_[jetPUSUsePhiRingFlag].uparams_[0];
0362     }
0363 
0364     std::string jetPUSType() const { return pnode_[jetPUS].type_; }
0365     std::vector<double> jetPUSParams() { return pnode_[jetPUS].dparams_; }
0366     std::string jetCalibrationType() const { return pnode_[jetCalibration].type_; }
0367     std::vector<double> jetCalibrationParams() { return pnode_[jetCalibration].dparams_; }
0368 
0369     l1t::LUT* jetCalibrationLUT() { return &pnode_[jetCalibration].LUT_; }
0370     l1t::LUT* jetCompressPtLUT() { return &pnode_[jetCompressPt].LUT_; }
0371     l1t::LUT* jetCompressEtaLUT() { return &pnode_[jetCompressEta].LUT_; }
0372 
0373     void setJetLsb(double lsb) { jetp_.lsb_ = lsb; }
0374     void setJetSeedThreshold(double thresh) { jetp_.seedThreshold_ = thresh; }
0375     void setJetNeighbourThreshold(double thresh) { jetp_.neighbourThreshold_ = thresh; }
0376     void setJetRegionMask(int mask) {
0377       pnode_[jetPUS].iparams_.resize(1);
0378       pnode_[jetPUS].iparams_[0] = mask;
0379     }
0380     void setJetPUSType(std::string type) { pnode_[jetPUS].type_ = type; }
0381     void setJetPUSParams(std::vector<double> params) { pnode_[jetPUS].dparams_ = params; }
0382     void setJetCalibrationType(std::string type) { pnode_[jetCalibration].type_ = type; }
0383     void setJetCalibrationParams(std::vector<double> params) { pnode_[jetCalibration].dparams_ = params; }
0384     void setJetCalibrationLUT(const l1t::LUT& lut) { pnode_[jetCalibration].LUT_ = lut; }
0385     void setJetCompressEtaLUT(const l1t::LUT& lut) { pnode_[jetCompressEta].LUT_ = lut; }
0386     void setJetCompressPtLUT(const l1t::LUT& lut) { pnode_[jetCompressPt].LUT_ = lut; }
0387     void setJetBypassPUS(unsigned flag) {
0388       pnode_[jetBypassPUSFlag].uparams_.resize(1);
0389       pnode_[jetBypassPUSFlag].uparams_[0] = flag;
0390     }
0391     void setJetPUSUsePhiRing(unsigned flag) {
0392       pnode_[jetPUSUsePhiRingFlag].uparams_.resize(1);
0393       pnode_[jetPUSUsePhiRingFlag].uparams_[0] = flag;
0394     }
0395     // sums
0396 
0397     double etSumLsb() const { return etSumLsb_; }
0398     int etSumEtaMin(unsigned isum) const {
0399       if (etSumEtaMin_.size() > isum)
0400         return etSumEtaMin_.at(isum);
0401       else
0402         return 0;
0403     }
0404     int etSumEtaMax(unsigned isum) const {
0405       if (etSumEtaMax_.size() > isum)
0406         return etSumEtaMax_.at(isum);
0407       else
0408         return 0;
0409     }
0410     double etSumEtThreshold(unsigned isum) const {
0411       if (etSumEtThreshold_.size() > isum)
0412         return etSumEtThreshold_.at(isum);
0413       else
0414         return 0.;
0415     }
0416     unsigned etSumBypassMetPUS() const { return pnode_[etSumBypassMetPUSFlag].uparams_[0]; }
0417     unsigned etSumBypassEttPUS() const { return pnode_[etSumBypassEttPUSFlag].uparams_[0]; }
0418     unsigned etSumBypassEcalSumPUS() const { return pnode_[etSumBypassEcalSumPUSFlag].uparams_[0]; }
0419     std::string etSumMetPUSType() const { return pnode_[etSumMetPUS].type_; }
0420     std::string etSumEttPUSType() const { return pnode_[etSumEttPUS].type_; }
0421     std::string etSumEcalSumPUSType() const { return pnode_[etSumEcalSumPUS].type_; }
0422     std::string metCalibrationType() const { return pnode_[metCalibration].type_; }
0423     std::string metHFCalibrationType() const { return pnode_[metHFCalibration].type_; }
0424     std::string etSumEttCalibrationType() const { return pnode_[etSumEttCalibration].type_; }
0425     std::string etSumEcalSumCalibrationType() const { return pnode_[etSumEcalSumCalibration].type_; }
0426 
0427     l1t::LUT* etSumMetPUSLUT() { return &pnode_[etSumMetPUS].LUT_; }
0428     l1t::LUT* etSumEttPUSLUT() { return &pnode_[etSumEttPUS].LUT_; }
0429     l1t::LUT* etSumEcalSumPUSLUT() { return &pnode_[etSumEcalSumPUS].LUT_; }
0430     l1t::LUT* metCalibrationLUT() { return &pnode_[metCalibration].LUT_; }
0431     l1t::LUT* metHFCalibrationLUT() { return &pnode_[metHFCalibration].LUT_; }
0432     l1t::LUT* etSumEttCalibrationLUT() { return &pnode_[etSumEttCalibration].LUT_; }
0433     l1t::LUT* etSumEcalSumCalibrationLUT() { return &pnode_[etSumEcalSumCalibration].LUT_; }
0434     l1t::LUT* metPhiCalibrationLUT() { return &pnode_[metPhiCalibration].LUT_; }
0435     l1t::LUT* metHFPhiCalibrationLUT() { return &pnode_[metHFPhiCalibration].LUT_; }
0436 
0437     void setEtSumLsb(double lsb) { etSumLsb_ = lsb; }
0438     void setEtSumEtaMin(unsigned isum, int eta) {
0439       if (etSumEtaMin_.size() <= isum)
0440         etSumEtaMin_.resize(isum + 1);
0441       etSumEtaMin_.at(isum) = eta;
0442     }
0443     void setEtSumEtaMax(unsigned isum, int eta) {
0444       if (etSumEtaMax_.size() <= isum)
0445         etSumEtaMax_.resize(isum + 1);
0446       etSumEtaMax_.at(isum) = eta;
0447     }
0448     void setEtSumEtThreshold(unsigned isum, double thresh) {
0449       if (etSumEtThreshold_.size() <= isum)
0450         etSumEtThreshold_.resize(isum + 1);
0451       etSumEtThreshold_.at(isum) = thresh;
0452     }
0453     void setEtSumMetPUSType(std::string type) { pnode_[etSumMetPUS].type_ = type; }
0454     void setEtSumEttPUSType(std::string type) { pnode_[etSumEttPUS].type_ = type; }
0455     void setEtSumEcalSumPUSType(std::string type) { pnode_[etSumEcalSumPUS].type_ = type; }
0456     void setMetCalibrationType(std::string type) { pnode_[metCalibration].type_ = type; }
0457     void setMetHFCalibrationType(std::string type) { pnode_[metHFCalibration].type_ = type; }
0458     void setEtSumEttCalibrationType(std::string type) { pnode_[etSumEttCalibration].type_ = type; }
0459     void setEtSumEcalSumCalibrationType(std::string type) { pnode_[etSumEcalSumCalibration].type_ = type; }
0460     void setEtSumBypassMetPUS(unsigned flag) {
0461       pnode_[etSumBypassMetPUSFlag].uparams_.resize(1);
0462       pnode_[etSumBypassMetPUSFlag].uparams_[0] = flag;
0463     }
0464     void setEtSumBypassEttPUS(unsigned flag) {
0465       pnode_[etSumBypassEttPUSFlag].uparams_.resize(1);
0466       pnode_[etSumBypassEttPUSFlag].uparams_[0] = flag;
0467     }
0468     void setEtSumBypassEcalSumPUS(unsigned flag) {
0469       pnode_[etSumBypassEcalSumPUSFlag].uparams_.resize(1);
0470       pnode_[etSumBypassEcalSumPUSFlag].uparams_[0] = flag;
0471     }
0472 
0473     void setEtSumMetPUSLUT(const l1t::LUT& lut) { pnode_[etSumMetPUS].LUT_ = lut; }
0474     void setEtSumEttPUSLUT(const l1t::LUT& lut) { pnode_[etSumEttPUS].LUT_ = lut; }
0475     void setEtSumEcalSumPUSLUT(const l1t::LUT& lut) { pnode_[etSumEcalSumPUS].LUT_ = lut; }
0476     void setMetCalibrationLUT(const l1t::LUT& lut) { pnode_[metCalibration].LUT_ = lut; }
0477     void setMetHFCalibrationLUT(const l1t::LUT& lut) { pnode_[metHFCalibration].LUT_ = lut; }
0478     void setEtSumEttCalibrationLUT(const l1t::LUT& lut) { pnode_[etSumEttCalibration].LUT_ = lut; }
0479     void setEtSumEcalSumCalibrationLUT(const l1t::LUT& lut) { pnode_[etSumEcalSumCalibration].LUT_ = lut; }
0480     void setMetPhiCalibrationLUT(const l1t::LUT& lut) { pnode_[metPhiCalibration].LUT_ = lut; }
0481     void setMetHFPhiCalibrationLUT(const l1t::LUT& lut) { pnode_[metHFPhiCalibration].LUT_ = lut; }
0482 
0483     double etSumCentLower(unsigned centClass) const {
0484       if (pnode_[etSumCentralityLower].dparams_.size() > centClass)
0485         return pnode_[etSumCentralityLower].dparams_.at(centClass);
0486       else
0487         return 0.;
0488     }
0489 
0490     double etSumCentUpper(unsigned centClass) const {
0491       if (pnode_[etSumCentralityUpper].dparams_.size() > centClass)
0492         return pnode_[etSumCentralityUpper].dparams_.at(centClass);
0493       else
0494         return 0.;
0495     }
0496 
0497     void setEtSumCentLower(unsigned centClass, double loBound) {
0498       if (pnode_[etSumCentralityLower].dparams_.size() <= centClass)
0499         pnode_[etSumCentralityLower].dparams_.resize(centClass + 1);
0500       pnode_[etSumCentralityLower].dparams_.at(centClass) = loBound;
0501     }
0502 
0503     void setEtSumCentUpper(unsigned centClass, double upBound) {
0504       if (pnode_[etSumCentralityUpper].dparams_.size() <= centClass)
0505         pnode_[etSumCentralityUpper].dparams_.resize(centClass + 1);
0506       pnode_[etSumCentralityUpper].dparams_.at(centClass) = upBound;
0507     }
0508 
0509     // HI centrality
0510     int centralityRegionMask() const {
0511       if (pnode_[hiCentrality].version_ == 1)
0512         return pnode_[hiCentrality].iparams_[0];
0513       else
0514         return 0;
0515     }
0516     std::vector<int> minimumBiasThresholds() const {
0517       if (pnode_[hiCentrality].version_ == 1 && pnode_[hiCentrality].iparams_.size() == 5) {
0518         std::vector<int> newVec;
0519         newVec.reserve(4);
0520         for (int i = 0; i < 4; i++) {
0521           newVec.push_back(pnode_[hiCentrality].iparams_.at(i + 1));
0522         }
0523         return newVec;
0524       } else {
0525         std::vector<int> newVec;
0526         return newVec;
0527       }
0528     }
0529     l1t::LUT* centralityLUT() { return &pnode_[hiCentrality].LUT_; }
0530     void setCentralityRegionMask(int mask) {
0531       pnode_[hiCentrality].iparams_.resize(5);
0532       pnode_[hiCentrality].iparams_[0] = mask;
0533     }
0534     void setMinimumBiasThresholds(std::vector<int> thresholds) {
0535       pnode_[hiCentrality].iparams_.resize(5);
0536       for (int i = 0; i < 4; i++) {
0537         pnode_[hiCentrality].iparams_[i + 1] = thresholds.at(i);
0538       }
0539     }
0540     void setCentralityLUT(const l1t::LUT& lut) { pnode_[hiCentrality].LUT_ = lut; }
0541 
0542     // HI Q2
0543     l1t::LUT* q2LUT() { return &pnode_[hiQ2].LUT_; }
0544     void setQ2LUT(const l1t::LUT& lut) { pnode_[hiQ2].LUT_ = lut; }
0545 
0546     // HI parameters
0547 
0548     // Layer 1 LUT specification
0549     std::vector<double> layer1ECalScaleFactors() { return pnode_[layer1ECal].dparams_; }
0550     std::vector<double> layer1HCalScaleFactors() { return pnode_[layer1HCal].dparams_; }
0551     std::vector<double> layer1HFScaleFactors() { return pnode_[layer1HF].dparams_; }
0552     std::vector<int> layer1ECalScaleETBins() { return pnode_[layer1ECal].iparams_; }
0553     std::vector<int> layer1HCalScaleETBins() { return pnode_[layer1HCal].iparams_; }
0554     std::vector<int> layer1HFScaleETBins() { return pnode_[layer1HF].iparams_; }
0555     std::vector<unsigned> layer1ECalScalePhiBins() { return pnode_[layer1ECal].uparams_; }
0556     std::vector<unsigned> layer1HCalScalePhiBins() { return pnode_[layer1HCal].uparams_; }
0557     std::vector<unsigned> layer1HFScalePhiBins() { return pnode_[layer1HF].uparams_; }
0558     void setLayer1ECalScaleFactors(const std::vector<double> params) { pnode_[layer1ECal].dparams_ = params; }
0559     void setLayer1HCalScaleFactors(const std::vector<double> params) { pnode_[layer1HCal].dparams_ = params; }
0560     void setLayer1HFScaleFactors(const std::vector<double> params) { pnode_[layer1HF].dparams_ = params; }
0561     void setLayer1ECalScaleETBins(const std::vector<int> params) { pnode_[layer1ECal].iparams_ = params; }
0562     void setLayer1HCalScaleETBins(const std::vector<int> params) { pnode_[layer1HCal].iparams_ = params; }
0563     void setLayer1HFScaleETBins(const std::vector<int> params) { pnode_[layer1HF].iparams_ = params; }
0564     void setLayer1ECalScalePhiBins(const std::vector<unsigned> params) { pnode_[layer1ECal].uparams_ = params; }
0565     void setLayer1HCalScalePhiBins(const std::vector<unsigned> params) { pnode_[layer1HCal].uparams_ = params; }
0566     void setLayer1HFScalePhiBins(const std::vector<unsigned> params) { pnode_[layer1HF].uparams_ = params; }
0567 
0568     std::vector<unsigned> layer1SecondStageLUT() { return pnode_[layer1HOverE].uparams_; }
0569     void setLayer1SecondStageLUT(const std::vector<unsigned>& lut) { pnode_[layer1HOverE].uparams_ = lut; }
0570 
0571   private:
0572     L1CaloEtScale emScale_;
0573     L1CaloEtScale jetScale_;
0574     L1CaloEtScale HtMissScale_;
0575     L1CaloEtScale HfRingScale_;
0576   };
0577 
0578 }  // namespace l1t
0579 
0580 #endif