File indexing completed on 2024-04-06 12:29:30
0001
0002 #include "EcalTrigPrimSpikeESProducer.h"
0003
0004 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006
0007
0008
0009
0010 EcalTrigPrimSpikeESProducer::EcalTrigPrimSpikeESProducer(const edm::ParameterSet &iConfig)
0011 : zeroThresh_(iConfig.getUntrackedParameter<uint32_t>("TCCZeroingThreshold", 0)) {
0012
0013 setWhatProduced(this, &EcalTrigPrimSpikeESProducer::produceSpike);
0014
0015
0016 for (unsigned int i = 1; i <= 17; ++i) {
0017 for (unsigned int j = 1; j <= 72; ++j) {
0018 EcalTrigTowerDetId posTT(1, EcalBarrel, i, j);
0019 EcalTrigTowerDetId negTT(-1, EcalBarrel, i, j);
0020 towerIDs_.push_back(posTT.rawId());
0021 towerIDs_.push_back(negTT.rawId());
0022 }
0023 }
0024 }
0025
0026 EcalTrigPrimSpikeESProducer::~EcalTrigPrimSpikeESProducer() {}
0027
0028
0029 std::unique_ptr<EcalTPGSpike> EcalTrigPrimSpikeESProducer::produceSpike(const EcalTPGSpikeRcd &iRecord) {
0030 auto prod = std::make_unique<EcalTPGSpike>();
0031 for (std::vector<uint32_t>::const_iterator it = towerIDs_.begin(); it != towerIDs_.end(); ++it) {
0032 prod->setValue(*it, zeroThresh_);
0033 }
0034 return prod;
0035 }