Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:22

0001 #include <SimCalorimetry/EcalEBTrigPrimAlgos/interface/EcalEBPhase2SpikeTagger.h>
0002 
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 
0005 EcalEBPhase2SpikeTagger::EcalEBPhase2SpikeTagger(bool debug) : debug_(debug) {}
0006 
0007 EcalEBPhase2SpikeTagger::~EcalEBPhase2SpikeTagger() {}
0008 
0009 void EcalEBPhase2SpikeTagger::setParameters(EBDetId detId,
0010                                             const EcalLiteDTUPedestalsMap* ecaltpPed,
0011                                             const EcalEBPhase2TPGLinearizationConstMap* ecaltpLin,
0012                                             const EcalTPGCrystalStatus* ecaltpBadX)
0013 
0014 {
0015   if (debug_)
0016     LogDebug("") << " EcalEBPhase2SpikeTagger::setParameters " << std::endl;
0017 
0018   EcalLiteDTUPedestalsMap::const_iterator itped = ecaltpPed->getMap().find(detId);
0019   if (itped != ecaltpPed->end()) {
0020     peds_ = &(*itped);
0021   } else {
0022     edm::LogError("EcalEBPhase2SpikeTagger::setParameters")
0023         << " could not find EcalLiteDTUPedestal entry for " << detId;
0024     throw cms::Exception("EcalEBPhase2SpikeTagger::setParameters could not find pedestals");
0025   }
0026 
0027   const EcalEBPhase2TPGLinearizationConstMap& linMap = ecaltpLin->getMap();
0028   EcalEBPhase2TPGLinearizationConstMapIterator it = linMap.find(detId.rawId());
0029   if (it != linMap.end()) {
0030     linConsts_ = &(*it);
0031   } else {
0032     edm::LogError("EcalEBPhase2SpikeTagger::setParameters")
0033         << " could not find EcalEBPhase2TPGLinearizationConstMap  entry for " << detId.rawId();
0034     throw cms::Exception("EcalEBPhase2SpikeTagger::setParameters could not find pedestals");
0035   }
0036 }
0037 
0038 bool EcalEBPhase2SpikeTagger::process(const std::vector<int>& linInput) {
0039   bool isASpike;
0040   isASpike = false;
0041 
0042   if (debug_) {
0043     LogDebug("") << "EcalEBPhase2SpikeTagger::process  linearized digis " << std::endl;
0044     for (unsigned int i = 0; i < linInput.size(); i++) {
0045       LogDebug("") << " " << std::dec << linInput[i];
0046     }
0047     LogDebug("") << std::endl;
0048   }
0049 
0050   // dummy for now. It needs the algorythm to be implememted/plugged in here
0051 
0052   return isASpike;
0053 }