File indexing completed on 2024-04-06 12:20:30
0001 #ifndef PRESCALESVETOSHELPERS_H__
0002 #define PRESCALESVETOSHELPERS_H__
0003
0004 #include <cassert>
0005 #include "CondFormats/L1TObjects/interface/L1TGlobalPrescalesVetos.h"
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 namespace l1t {
0031
0032 class PrescalesVetosHelper {
0033 public:
0034 enum { VERSION_ = 1 };
0035
0036 ~PrescalesVetosHelper();
0037
0038
0039 PrescalesVetosHelper(L1TGlobalPrescalesVetos* w);
0040
0041 static const PrescalesVetosHelper* readFromEventSetup(const L1TGlobalPrescalesVetos* es);
0042
0043 static PrescalesVetosHelper* readAndWriteFromEventSetup(const L1TGlobalPrescalesVetos* es);
0044
0045 int bxMaskDefault() const { return read_->bxmask_default_; };
0046 void setBxMaskDefault(int value) {
0047 check_write();
0048 write_->bxmask_default_ = value;
0049 };
0050
0051 inline const std::vector<std::vector<int> >& prescaleTable() const { return read_->prescale_table_; };
0052 void setPrescaleFactorTable(std::vector<std::vector<int> > value) {
0053 check_write();
0054 write_->prescale_table_ = value;
0055 };
0056 inline const std::vector<int>& triggerMaskVeto() const { return read_->veto_; };
0057 void setTriggerMaskVeto(std::vector<int> value) {
0058 check_write();
0059 write_->veto_ = value;
0060 };
0061
0062 inline const std::map<int, std::vector<int> >& triggerAlgoBxMask() const { return read_->bxmask_map_; };
0063 void setTriggerAlgoBxMask(std::map<int, std::vector<int> > value) {
0064 check_write();
0065 write_->bxmask_map_ = value;
0066 };
0067
0068
0069 const L1TGlobalPrescalesVetos* getReadInstance() const { return read_; }
0070 L1TGlobalPrescalesVetos* getWriteInstance() { return write_; }
0071
0072 private:
0073 PrescalesVetosHelper(const L1TGlobalPrescalesVetos* es);
0074 void useCopy();
0075 void check_write() { assert(write_); }
0076
0077 const L1TGlobalPrescalesVetos* read_;
0078 L1TGlobalPrescalesVetos* write_;
0079 bool we_own_write_;
0080 };
0081
0082 }
0083 #endif