Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:38

0001 //
0002 //  Original Author:   Stilianos Kesisoglou - Institute of Nuclear and Particle
0003 // Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch)
0004 //          Created:   Wed Nov 21 11:24:39 EET 2012
0005 //
0006 //      Nov 21 2012:   First version of the code. Based on the old
0007 // "EcalDeadChannelRecoveryAlgos.cc" code
0008 //      Feb 14 2013:   Implementation of the criterion to select the "correct"
0009 // max. cont. crystal.
0010 //
0011 //modified by S.Taroni, N. Marinelli 11 June 2019
0012 
0013 #include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h"
0014 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0015 
0016 template <typename T>
0017 void EcalDeadChannelRecoveryAlgos<T>::setParameters(const edm::ParameterSet &ps) {
0018   bdtg_.setParameters(ps);
0019 }
0020 
0021 template <typename T>
0022 void EcalDeadChannelRecoveryAlgos<T>::setCaloTopology(const CaloTopology *topo) {
0023   bdtg_.setCaloTopology(topo);
0024 }
0025 
0026 template <typename T>
0027 float EcalDeadChannelRecoveryAlgos<T>::correct(const T id,
0028                                                const EcalRecHitCollection &hit_collection,
0029                                                std::string algo,
0030                                                double single8Cut,
0031                                                double sum8Cut,
0032                                                bool *acceptFlag) {
0033   // recover as single dead channel
0034   double newEnergy = 0.0;
0035   if (algo == "BDTG") {
0036     *acceptFlag = false;
0037     newEnergy = this->bdtg_.recover(id, hit_collection, single8Cut, sum8Cut, acceptFlag);  //ADD here
0038     if (newEnergy > 0.)
0039       *acceptFlag = true;  //bdtg set to 0 if there is more than one channel in the matrix that is not reponding
0040   } else {
0041     edm::LogError("EcalDeadChannelRecoveryAlgos") << "Invalid algorithm for dead channel recovery.";
0042     *acceptFlag = false;
0043   }
0044 
0045   return newEnergy;
0046 }
0047 
0048 template class EcalDeadChannelRecoveryAlgos<EBDetId>;
0049 template class EcalDeadChannelRecoveryAlgos<EEDetId>;