CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/SimCalorimetry/EcalTrigPrimProducers/plugins/EcalTrigPrimSpikeESProducer.cc

Go to the documentation of this file.
00001 // user include files
00002 #include "EcalTrigPrimSpikeESProducer.h"
00003 
00004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00005 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
00006 
00007 //
00008 // constructors and destructor
00009 //
00010 EcalTrigPrimSpikeESProducer::EcalTrigPrimSpikeESProducer(const edm::ParameterSet& iConfig) :
00011   zeroThresh_(iConfig.getUntrackedParameter<uint32_t>("TCCZeroingThreshold", 0))
00012 {
00013   // Indicate we produce the spike record
00014   setWhatProduced(this, &EcalTrigPrimSpikeESProducer::produceSpike) ;
00015 
00016   // Cache all EB TT raw DetIDs
00017   for(unsigned int i = 1; i <= 17; ++i)
00018   {
00019     for(unsigned int j = 1; j <= 72; ++j)
00020     {
00021       EcalTrigTowerDetId posTT(1, EcalBarrel, i, j);
00022       EcalTrigTowerDetId negTT(-1, EcalBarrel, i, j);
00023       towerIDs_.push_back(posTT.rawId());
00024       towerIDs_.push_back(negTT.rawId());
00025     }
00026   }
00027 }
00028 
00029 EcalTrigPrimSpikeESProducer::~EcalTrigPrimSpikeESProducer()
00030 { 
00031 }
00032 
00033 
00034 // ------------ method called to produce the data  ------------
00035 std::auto_ptr<EcalTPGSpike> EcalTrigPrimSpikeESProducer::produceSpike(const EcalTPGSpikeRcd &iRecord)
00036 {
00037   std::auto_ptr<EcalTPGSpike> prod(new EcalTPGSpike());
00038   for(std::vector<uint32_t>::const_iterator it = towerIDs_.begin(); it != towerIDs_.end(); ++it)
00039   {
00040     prod->setValue(*it, zeroThresh_);
00041   }
00042   return prod;
00043 }
00044