diff --git a/RecoCaloTools/EcalChannelKiller/BuildFile.xml b/RecoCaloTools/EcalChannelKiller/BuildFile.xml deleted file mode 100644 index cbdf3a28fe04c..0000000000000 --- a/RecoCaloTools/EcalChannelKiller/BuildFile.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/RecoCaloTools/EcalChannelKiller/src/EcalChannelKiller.cc b/RecoCaloTools/EcalChannelKiller/src/EcalChannelKiller.cc deleted file mode 100644 index 852f3bc576669..0000000000000 --- a/RecoCaloTools/EcalChannelKiller/src/EcalChannelKiller.cc +++ /dev/null @@ -1,163 +0,0 @@ -// -*- C++ -*- -// -// Package: EcalChannelKiller -// Class: EcalChannelKiller -// -/**\class EcalChannelKiller EcalChannelKiller.cc RecoCaloTools/EcalChannelKiller/src/EcalChannelKiller.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Georgios Daskalakis -// Created: Tue Apr 24 17:21:31 CEST 2007 -// -// - - - - -// Geometry -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h" - -// Reconstruction Classes -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" - - -#include "RecoCaloTools/EcalChannelKiller/interface/EcalChannelKiller.h" - -#include -#include -using namespace cms; -using namespace std; - - -// -// constructors and destructor -// -EcalChannelKiller::EcalChannelKiller(const edm::ParameterSet& ps) -{ - - hitProducer_ = ps.getParameter("hitProducer"); - hitCollection_ = ps.getParameter("hitCollection"); - reducedHitCollection_ = ps.getParameter("reducedHitCollection"); - DeadChannelFileName_ = ps.getParameter("DeadChannelsFile"); - - produces< EcalRecHitCollection >(reducedHitCollection_); - - -} - - -EcalChannelKiller::~EcalChannelKiller() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - -// ------------ method called to produce the data ------------ -void -EcalChannelKiller::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - // get the hit collection from the event: - edm::Handle rhcHandle; - iEvent.getByLabel(hitProducer_, hitCollection_, rhcHandle); - if (!(rhcHandle.isValid())) - { - // std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; - return; - } - const EcalRecHitCollection* hit_collection = rhcHandle.product(); - - int nRed = 0; - - // create an auto_ptr to a EcalRecHitCollection, copy the RecHits into it and put in the Event: - std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); - - - for(EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { - - double NewEnergy =it->energy(); - bool ItIsDead=false; - //Dead Cells are read from text files - std::vector::const_iterator DeadCell; - for(DeadCell=ChannelsDeadID.begin();DeadCelldetid()==*DeadCell){ - ItIsDead=true; - NewEnergy =0.; - nRed++; - - } - }//End looping on vector of Dead Cells - - // Make a new RecHit - // - // TODO what will be the it->time() for D.C. ? - // Could we use it for "correction" identification? - // - if(!ItIsDead){ - EcalRecHit NewHit(it->id(),NewEnergy,it->time()); - redCollection->push_back( NewHit ); - } - } - // std::cout << "total # hits: " << nTot << " #hits with E = " << 0 << " GeV : " << nRed << std::endl; - - iEvent.put(redCollection, reducedHitCollection_); - -} - - - - -// ------------ method called once each job just before starting event loop ------------ -void -EcalChannelKiller::beginJob() -{ - - //Open the DeadChannel file, read it. - FILE* DeadCha; - printf("Dead Channels FILE: %s\n",DeadChannelFileName_.c_str()); - DeadCha = fopen(DeadChannelFileName_.c_str(),"r"); - - int fileStatus=0; - int ieta=-10000; - int iphi=-10000; - while(fileStatus != EOF) { - fileStatus = fscanf(DeadCha,"%d %d\n",&ieta,&iphi); - // std::cout<<" ieta "< + + + + diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/CorrectDeadChannelsClassic.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/CorrectDeadChannelsClassic.cc deleted file mode 100644 index 9833f2f97be07..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/CorrectDeadChannelsClassic.cc +++ /dev/null @@ -1,367 +0,0 @@ -// -// Original Author: Georgios Daskalakis , Georgios.Daskalakis@cern.ch -// Created: Fri Mar 30 18:15:12 CET 2007 -// -// -// -// -#include "TMultiLayerPerceptron.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "getopt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "PositionCorrector.cxx" -#include "SplineCorrector.cxx" -#include "ExponCorrector.cxx" - - - -using namespace std; - -double CorrectDeadChannelsClassic(double *M11x11Input, const int DCeta){ - - //std::cout<<"Inside Correction Function ...."<< std::endl; - - PositionCorrector *PosCorr = new PositionCorrector(); - SplineCorrector *SplCorr = new SplineCorrector(); - ExponCorrector *ExpCorr = new ExponCorrector(); - - - - - double epsilon = 0.0000001; - float NEWx,NEWy; - float estimX,estimY,SUMlogFR; - float SUM24; - float crE[25]; - - - - crE[0]=M11x11Input[40]; - crE[1]=M11x11Input[51]; - crE[2]=M11x11Input[62]; - crE[3]=M11x11Input[73]; - crE[4]=M11x11Input[84]; - - crE[5]=M11x11Input[39]; - crE[6]=M11x11Input[50]; - crE[7]=M11x11Input[61]; - crE[8]=M11x11Input[72]; - crE[9]=M11x11Input[83]; - - crE[10]=M11x11Input[38]; - crE[11]=M11x11Input[49]; - crE[12]=M11x11Input[60]; - crE[13]=M11x11Input[71]; - crE[14]=M11x11Input[82]; - - crE[15]=M11x11Input[37]; - crE[16]=M11x11Input[48]; - crE[17]=M11x11Input[59]; - crE[18]=M11x11Input[70]; - crE[19]=M11x11Input[81]; - - crE[20]=M11x11Input[36]; - crE[21]=M11x11Input[47]; - crE[22]=M11x11Input[58]; - crE[23]=M11x11Input[69]; - crE[24]=M11x11Input[80]; - - - std::cout<<"Inside Correction Function : Dead Channel ETA" << DCeta << std::endl; - //revert crystal matrix because of negative eta - if(DCeta<0){ - - crE[0]=M11x11Input[36]; - crE[1]=M11x11Input[47]; - crE[2]=M11x11Input[58]; - crE[3]=M11x11Input[69]; - crE[4]=M11x11Input[80]; - - crE[5]=M11x11Input[37]; - crE[6]=M11x11Input[48]; - crE[7]=M11x11Input[59]; - crE[8]=M11x11Input[70]; - crE[9]=M11x11Input[81]; - - crE[10]=M11x11Input[38]; - crE[11]=M11x11Input[49]; - crE[12]=M11x11Input[60]; - crE[13]=M11x11Input[71]; - crE[14]=M11x11Input[82]; - - crE[15]=M11x11Input[39]; - crE[16]=M11x11Input[50]; - crE[17]=M11x11Input[61]; - crE[18]=M11x11Input[72]; - crE[19]=M11x11Input[83]; - - crE[20]=M11x11Input[40]; - crE[21]=M11x11Input[51]; - crE[22]=M11x11Input[62]; - crE[23]=M11x11Input[73]; - crE[24]=M11x11Input[84]; - - - } - - - - - - float SUMuu = 0.0; - float SUMu = 0.0; - float SUMdd = 0.0; - float SUMd = 0.0; - float SUMll = 0.0; - float SUMl = 0.0; - float SUMrr = 0.0; - float SUMr = 0.0; - - SUMuu = crE[4] + crE[9] + crE[14] + crE[19] + crE[24]; - SUMu = crE[3] + crE[8] + crE[13] + crE[18] + crE[23]; - SUMd = crE[1] + crE[6] + crE[11] + crE[16] + crE[21]; - SUMdd = crE[0] + crE[5] + crE[10] + crE[15] + crE[20]; - - SUMll = crE[0] + crE[1] + crE[2] + crE[3] + crE[4]; - SUMl = crE[5] + crE[6] + crE[7] + crE[8] + crE[9]; - SUMr = crE[15] + crE[16] + crE[17] + crE[18] + crE[19]; - SUMrr = crE[20] + crE[21] + crE[22] + crE[23] + crE[24]; - - /* - std::cout<<"================================================================="<0){std::cout<<" Problem 2 dead channels in sum9! Can not correct ... I return 0.0"< Central has NOT the MAX energy in 5x5 ... I return 0.0"<SUMd || SUMrr>SUMr || SUMll>3.0*SUMr || SUMuu>3.0*SUMd)){std::cout<<"Unusual Pattern in 8 I return 0.0"<SUMu || SUMll>SUMl || SUMrr>3.0*SUMl || SUMdd>3.0*SUMu)){std::cout<<"Unusual Pattern in 16 I return 0.0"<SUMd || SUMll>SUMl || SUMrr>3.0*SUMl || SUMuu>3.0*SUMd)){std::cout<<"Unusual Pattern in 18 I return 0.0"<SUMu || SUMdd>SUMd || SUMrr>SUMr)){std::cout<<"Unusual Pattern in 7 I return 0.0"<SUMu || SUMdd>SUMd || SUMll>SUMl)){std::cout<<"Unusual Pattern in 17 I return 0.0"<SUMl || SUMrr>SUMr || SUMuu>SUMu)){std::cout<<"Unusual Pattern in 11 I return 0.0"<SUMl || SUMrr>SUMr || SUMdd>SUMd)){std::cout<<"Unusual Pattern in 13 I return 0.0"<CORRX(DeadCR,0,50,estimX); - NEWy = PosCorr->CORRY(DeadCR,0,50,estimY); - - - //std::cout<<" FINAL X,Y calculation: DC , estimX, estimY, NEWx, NEWy : "<7.0 || estimX< -2.0 || estimY>10.0 || estimY<-9.0) ){std::cout<<"DC=7 Position OUT of LIMIT I return 0.0"<2.5 || estimX< -8.0 || estimY>10.0 || estimY<-8.0) ){std::cout<<"DC=17 Position OUT of LIMIT I return 0.0"<8.0 || estimX<-10.0 || estimY> 9.0 || estimY<-4.0) ){std::cout<<"DC=11 Position OUT of LIMIT I return 0.0"<8.0 || estimX<-10.0 || estimY> 4.5 || estimY<-8.0) ){std::cout<<"DC=13 Position OUT of LIMIT I return 0.0"<18.0 || estimX<-18.0 || estimY> 17.0 || estimY<-17.0) ){std::cout<<"DC=12 Position OUT of LIMIT I return 0.0"<8.0 || estimX< -9.0 || estimY>10.0 || estimY<-8.0) ){std::cout<<"DC=6 Position OUT of LIMIT I return 0.0"<8.0 || estimX< -9.0 || estimY> 9.0 || estimY<-8.5) ){std::cout<<"DC=8 Position OUT of LIMIT I return 0.0"<7.0 || estimX<-10.0 || estimY> 9.0 || estimY<-8.0) ){std::cout<<"DC=16 Position OUT of LIMIT I return 0.0"<8.0 || estimX< -9.0 || estimY> 9.0 || estimY<-8.0) ){std::cout<<"DC=18 Position OUT of LIMIT I return 0.0"<value(DeadCR,0,50,NEWx,NEWy); - - - - // RESOLUTIONS PER AREA - for (int isub=0 ; isubXLOW[isub] && NEWxYLOW[isub] && NEWyvalue(DeadCR,0,50,isub,NEWx,NEWy); - } - if(DeadCR==8 && (isub==4 || isub ==3 || isub==9) ){ - RECOfrDcr = ExpCorr->value(DeadCR,0,50,isub,NEWx,NEWy); - } - if(DeadCR==16 && (isub==15 || isub ==21 || isub==20) ){ - RECOfrDcr = ExpCorr->value(DeadCR,0,50,isub,NEWx,NEWy); - } - if(DeadCR==18 && (isub==19 || isub ==23 || isub==24) ){ - RECOfrDcr = ExpCorr->value(DeadCR,0,50,isub,NEWx,NEWy); - } - if(DeadCR==7 || DeadCR==11 || DeadCR==12 || DeadCR==13 || DeadCR==17 ){ - RECOfrDcr = ExpCorr->value(DeadCR,0,50,isub,NEWx,NEWy); - } - - - } - } - - - double ESTIMATED_ENERGY = RECOfrDcr*SUM24; - std::cout<<" THE ESTIMATED RECOfrDcr is : "<< RECOfrDcr <0.20){std::cout<<"Fraction OUT of LIMIT I return 0.0"<1.00){std::cout<<"Fraction OUT of LIMIT I return 0.0"<5.00){std::cout<<"Fraction OUT of LIMIT I return 0.0"< -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "getopt.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "Test_Central_1500.cxx" -#include "Test_Side_1500.cxx" -#include "Test_Corner_1500.cxx" -#include "TestPos_100.cxx" - -//M5x5 must be ordered as : - //Using Patrick Matrix: - //22|10|09|11|17 - //21|04|01|07|16 - //20|03|00|06|15 - //23|05|02|08|18 - //24|13|12|14|19 - -using namespace std; - -double CorrectDeadChannelsNN(double *M5x5Input){ - - - //From 07 May 07 we have as input a vector of : - //So now, we have a vector which is ordered around the Maximum containement and which contains a dead channel as: - //Filling of the vector : NxNaroundDC with N==11 Typo are possible... - // 060 is Maximum containement which is in +/- 2 from DC - // - // 120 119 118 117 116 115 114 113 112 111 110 - // 109 108 107 106 105 104 103 102 101 100 099 - // 098 097 096 095 094 093 092 091 090 089 088 - // 087 086 085 084 083 082 081 080 079 078 077 - // 076 075 074 073 072 071 070 069 068 067 066 - // 065 064 063 062 061 060 059 058 057 056 055 - // 054 053 052 051 050 049 048 047 046 045 044 - // 043 042 041 040 039 038 037 036 035 034 033 - // 032 031 030 029 028 027 026 025 024 023 022 - // 021 020 019 018 017 016 015 014 013 012 011 - // 010 009 008 007 006 005 004 003 002 001 000 - ////////////////////////////////////////////// - - //Conversion between input and input need by NN: - double M5x5[25]; - M5x5[0]=M5x5Input[60]; - M5x5[1]=M5x5Input[71]; - M5x5[2]=M5x5Input[49]; - M5x5[3]=M5x5Input[61]; - M5x5[4]=M5x5Input[72]; - M5x5[5]=M5x5Input[50]; - M5x5[6]=M5x5Input[59]; - M5x5[7]=M5x5Input[70]; - M5x5[8]=M5x5Input[48]; - M5x5[9]=M5x5Input[82]; - M5x5[10]=M5x5Input[83]; - M5x5[11]=M5x5Input[81]; - M5x5[12]=M5x5Input[38]; - M5x5[13]=M5x5Input[39]; - M5x5[14]=M5x5Input[37]; - M5x5[15]=M5x5Input[58]; - M5x5[16]=M5x5Input[69]; - M5x5[17]=M5x5Input[80]; - M5x5[18]=M5x5Input[47]; - M5x5[19]=M5x5Input[36]; - M5x5[20]=M5x5Input[62]; - M5x5[21]=M5x5Input[73]; - M5x5[22]=M5x5Input[84]; - M5x5[23]=M5x5Input[51]; - M5x5[24]=M5x5Input[40]; - - - Test_Central_1500 *NNCentral =new Test_Central_1500(); - Test_Side_1500 *NNAdj =new Test_Side_1500(); - Test_Corner_1500 *NNCorner =new Test_Corner_1500(); - - double in[6]; //Input of neurals networks - double NN1=-1;//Output Neural Net - - double epsilon = 0.0000001; - - //variables - bool Adjacent=false; - bool Corner=false; - bool Central=false; - double SUM8=-1; - double logX8=-1; - double logY8=-1; - double SUM24=-1; - - //First Find the position of the Dead Channel in 3x3 matrix - int IndDeadCha=-1; - for(int i =0 ; i< 9;i++){ - if(fabs(M5x5[i])0){/*cout<<" Problem 2 dead channels in sum9! Can not correct "< 0 && XL8>0 && YL8 >0 && YR8>0 && SUM8>0 && XR24>0 &&YR24>0){ - logX8=TMath::Log(XL8/XR8); - logY8=TMath::Log(YL8/YR8); - SUM24=sum24; - //Added 15 Janvier 2007 to get ride of energy dependance! - SUM24 = SUM8/SUM24; - - Adjacent=false; - Corner=false; - Central=false; - - //Il faut trouver le canal d'energie maximal, et par rapport a ce canal regarde l'energie dans les adjacent pour voir si nous sommes sur le central. - float maxi; - int IndMax; - if(IndDeadCha!=0){ - maxi=M5x5[0]; - IndMax=0; - }else{ - maxi=M5x5[1]; - IndMax=1; - } - for(int j=IndMax;j<9;j++){ - if(j!=IndDeadCha){ - if(M5x5[j] > maxi){IndMax=j;maxi=M5x5[j];} - } - } - float Secmaxi=0; - int IndSecMax=0; - for(int j=IndSecMax;j<9;j++){ - if(j!=IndDeadCha && j!=IndMax){ - if(M5x5[j] > Secmaxi){IndSecMax=j;Secmaxi=M5x5[j];} - } - } - - in[0]=logX8; - in[1]=logY8; - in[2]=SUM24; - - //Define Adjacent/Central/Side with a Neural Net - TestPos_100 *position=new TestPos_100(); - float indpos = position->value(0,in[0],in[1],in[2],(SUM8-maxi)/sum24,(maxi-Secmaxi)/maxi,M5x5[voisin1]/SUM8,M5x5[voisin2]/SUM8,M5x5[voisin3]/SUM8,M5x5[voisin4]/SUM8); - if( indpos < 1.5){ - Central=true; - Adjacent=false; - Corner=false; - }else{ - if(indpos <2.5){ - Central=false; - Adjacent=true; - Corner=false; - }else{ - Central=false; - Adjacent=false; - Corner=true; - } - } - delete position; - - - if(logX8!=-50 && logY8!=-50 && SUM8>0 && XR24>0 &&YR24>0){ - if(Adjacent)NN1 =NNAdj->value(0,in[0],in[1],in[2]); - if(Central)NN1 =NNCentral->value(0,in[0],in[1],in[2]); - if(Corner)NN1 =NNCorner->value(0,in[0],in[1],in[2]); - }else{ - NN1=0; - } - } - - return NN1*SUM8; -} diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalCrystalMatrixProbality.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalCrystalMatrixProbality.h new file mode 100644 index 0000000000000..eae7d655f81e0 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalCrystalMatrixProbality.h @@ -0,0 +1,20 @@ +#ifndef RecoLocalCalo_EcalDeadChannelRecoveryAlgos_EcalCrystalMatrixProbability_CC +#define RecoLocalCalo_EcalDeadChannelRecoveryAlgos_EcalCrystalMatrixProbability_CC + +// +// Original Author: Stilianos Kesisoglou - Institute of Nuclear and Particle +// Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) +// Created: Mon Feb 04 10:45:16 EET 2013 +// + +#include "TMath.h" + +template class EcalCrystalMatrixProbality { + public: + static double Central(double x); + static double Diagonal(double x); + static double UpDown(double x); + static double ReftRight(double x); +}; + +#endif diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h index 646ec6a6a86ba..e7d6e375afb6f 100644 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h @@ -1,51 +1,22 @@ #ifndef RecoLocalCalo_EcalDeadChannelRecoveryAlgos_EcalDeadChannelRecoveryAlgos_HH -#define RecoLocalCalo_EcalDeadChannelRecoveryAlgos_EcalDeadChannelRecoveryAlgos_HH - -/** \class EcalDeadChannelRecoveryAlgos - * - */ - - -// Geometry -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" -#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" -//#include "Geometry/Vector/interface/GlobalPoint.h" +#define RecoLocalCalo_EcalDeadChannelRecoveryAlgos_ECalDeadChannelRecoveryAlgos_HH // Reconstruction Classes #include "DataFormats/EcalRecHit/interface/EcalRecHit.h" #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" #include "DataFormats/EcalDetId/interface/EBDetId.h" - #include +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryNN.h" +template class EcalDeadChannelRecoveryAlgos { + public: + void setCaloTopology(const CaloTopology *topology); + EcalRecHit correct(const DetIdT id, + const EcalRecHitCollection &hit_collection, + std::string algo, double Sum8Cut, bool *AccFlag); - -class EcalDeadChannelRecoveryAlgos { - public: - EcalDeadChannelRecoveryAlgos(const CaloTopology * theCaloTopology); - EcalDeadChannelRecoveryAlgos(); - ~EcalDeadChannelRecoveryAlgos(); - - EcalRecHit Correct(const EBDetId Id, const EcalRecHitCollection* hit_collection, std::string algo_, double Sum8Cut); - EcalRecHit correct(const EBDetId Id, const EcalRecHitCollection* hit_collection, std::string algo_, double Sum8Cut); - private: - - - const CaloTopology * calotopo; - double MakeNxNMatrice(EBDetId itID,const EcalRecHitCollection* hit_collection, int *IndDeadChannel, double *MNxN); - - // ----------member data --------------------------- - + EcalDeadChannelRecoveryNN nn; }; #endif diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryNN.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryNN.h new file mode 100644 index 0000000000000..d438367bde833 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryNN.h @@ -0,0 +1,88 @@ +#ifndef RecoLocalCalo_EcalDeadChannelRecoveryAlgos_EcalDeadChannelRecoveryNN_H +#define RecoLocalCalo_EcalDeadChannelRecoveryAlgos_EcalDeadChannelRecoveryNN_H + +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" + +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" + +#include "Geometry/CaloTopology/interface/CaloTopology.h" +#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" + +#include +#include + +#include +#include + +template class EcalDeadChannelRecoveryNN { + public: + EcalDeadChannelRecoveryNN(); + ~EcalDeadChannelRecoveryNN(); + + // Arrangement within the M3x3Input matrix + // + // M3x3 + // ----------------------------------- + // + // + // LU UU RU 04 01 07 + // LL CC RR or 03 00 06 + // LD DD RD 05 02 08 + + // Enumeration to switch from custom names within the 3x3 matrix. + enum CellID { + CC = 0, + UU = 1, + DD = 2, + LL = 3, + LU = 4, + LD = 5, + RR = 6, + RU = 7, + RD = 8 + }; + + // Mapping custom names in the 3x3 to (x,y) or (ieta, iphi) + // ex: x=+1, y=-1 (ix() == ixP && iy() == iyN -> RD) + // ex: x=-1, y=+1 (ieta() == ietaN && iphi() == iphiP -> LU) + + const int CellX[9] = { 0, 0, 0 /* CC, UU, DD */, -1, -1, -1 /* LL, LU, LD */, + 1, 1, 1 /* RR, RU, RD */ }; + + const int CellY[9] = { 0, -1, 1 /* CC, UU, DD */, 0, -1, 1 /* LL, LU, LD */, + 0, -1, 1 /* RR, RU, RD */ }; + + void setCaloTopology(const CaloTopology *topo); + double recover(const DetIdT id, const EcalRecHitCollection &hit_collection, + double Sum8Cut, bool *AcceptFlag); + + private: + struct MultiLayerPerceptronContext { + Double_t tmp[9]; + TTree *tree; + TMultiLayerPerceptron *mlp; + }; + + const CaloSubdetectorTopology* topology_; + MultiLayerPerceptronContext ctx_[9]; + + void load(); + void load_file(MultiLayerPerceptronContext &ctx, std::string fn); + + public: + double estimateEnergy(double *M3x3Input, double epsilon = 0.0000001); + + double makeNxNMatrice_RelMC(DetIdT itID, + const EcalRecHitCollection &hit_collection, + double *MNxN_RelMC, bool *AccFlag); + double makeNxNMatrice_RelDC(DetIdT itID, + const EcalRecHitCollection &hit_collection, + double *MNxN_RelDC, bool *AccFlag); + + double reorderMxNMatrix(EBDetId it, const std::vector& window, + const EcalRecHitCollection& hit_collection, double *MNxN, bool* AcceptFlag); +}; + +#endif diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/ExponCorrector.cxx b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/ExponCorrector.cxx deleted file mode 100644 index 64b510a32634c..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/ExponCorrector.cxx +++ /dev/null @@ -1,327 +0,0 @@ -// -// Original Author: Georgios Daskalakis , Georgios.Daskalakis@cern.ch -// Created: Fri Mar 30 18:15:12 CET 2007 -// -// -// -// - - -#include "ExponCorrector.h" -#include - - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -double ExponCorrector::value(int DeadCrystal, int DeadCrystalEta, int estimE, int subRegion, double estimX, double estimY) { - - double result=0.0; - theCrystal = DeadCrystal; - theSubR = subRegion; - - switch(estimE) - { - case 50: - ExpE_50(); break; - default: - ExpE_50(); break; - } - - float X0[25],Y0[25]; - int idx; idx=0; - for(int ix=-2;ix<3;ix++){ - for(int iy=-2;iy<3;iy++){ - X0[idx]=float(ix)*20.0; - Y0[idx]=float(iy)*20.0; - idx++; - } - } - - //================== - double d = sqrt(pow((estimX-X0[theCrystal]),2)+pow((estimY-Y0[theCrystal]),2)); - if(dHIGLIM)d=HIGLIM; - result = EXPAN[0]+EXPAN[1]*d+EXPAN[2]*d*d+EXPAN[3]*d*d*d; - //================== - - return result; - -} - - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - -void ExponCorrector::ExpE_50(){ - - double DC_6__SUB_0[6]={6.988035e-01, -5.241955e-02, 5.094553e-04, 2.249889e-05, 1.562500e+01, 1.962500e+01}; - double DC_6__SUB_1[6]={1.147163e+00, -1.403141e-01, 5.994774e-03, -8.805192e-05, 1.787500e+01, 2.237500e+01}; - double DC_6__SUB_5[6]={7.122391e-01, -7.160745e-02, 2.432065e-03, -2.719902e-05, 1.812500e+01, 2.237500e+01}; - if(theCrystal==6){ - if(theSubR==0){ - for(int j=0;j<4;j++)EXPAN[j]=DC_6__SUB_0[j]; - LOWLIM = DC_6__SUB_0[4]; - HIGLIM = DC_6__SUB_0[5]; - } - if(theSubR==1){ - for(int j=0;j<4;j++)EXPAN[j]=DC_6__SUB_1[j]; - LOWLIM = DC_6__SUB_1[4]; - HIGLIM = DC_6__SUB_1[5]; - } - if(theSubR==5){ - for(int j=0;j<4;j++)EXPAN[j]=DC_6__SUB_5[j]; - LOWLIM = DC_6__SUB_5[4]; - HIGLIM = DC_6__SUB_5[5]; - } - } - - - double DC_8__SUB_3[6]={7.661651e-01, -7.084843e-02, 1.970247e-03, -1.305198e-05, 1.787500e+01, 2.237500e+01}; - double DC_8__SUB_4[6]={7.880124e+00, -1.170639e+00, 5.895264e-02, -1.002098e-03, 1.687500e+01, 1.962500e+01}; - double DC_8__SUB_9[6]={2.847308e+00, -3.780883e-01, 1.710198e-02, -2.615451e-04, 1.812500e+01, 2.212500e+01}; - if(theCrystal==8){ - if(theSubR==3){ - for(int j=0;j<4;j++)EXPAN[j]=DC_8__SUB_3[j]; - LOWLIM = DC_8__SUB_3[4]; - HIGLIM = DC_8__SUB_3[5]; - } - if(theSubR==4){ - for(int j=0;j<4;j++)EXPAN[j]=DC_8__SUB_4[j]; - LOWLIM = DC_8__SUB_4[4]; - HIGLIM = DC_8__SUB_4[5]; - } - if(theSubR==9){ - for(int j=0;j<4;j++)EXPAN[j]=DC_8__SUB_9[j]; - LOWLIM = DC_8__SUB_9[4]; - HIGLIM = DC_8__SUB_9[5]; - } - } - - - double DC_16__SUB_15[6]={1.488620e+00, -1.783270e-01, 7.412517e-03, -1.055881e-04, 1.837500e+01, 2.237500e+01}; - double DC_16__SUB_20[6]={2.954570e+00, -4.018463e-01, 1.888242e-02, -3.039138e-04, 1.612500e+01, 1.937500e+01}; - double DC_16__SUB_21[6]={8.015163e-01, -7.552633e-02, 2.308837e-03, -2.145060e-05, 1.787500e+01, 2.262500e+01}; - if(theCrystal==16){ - if(theSubR==15){ - for(int j=0;j<4;j++)EXPAN[j]=DC_16__SUB_15[j]; - LOWLIM = DC_16__SUB_15[4]; - HIGLIM = DC_16__SUB_15[5]; - } - if(theSubR==20){ - for(int j=0;j<4;j++)EXPAN[j]=DC_16__SUB_20[j]; - LOWLIM = DC_16__SUB_20[4]; - HIGLIM = DC_16__SUB_20[5]; - } - if(theSubR==21){ - for(int j=0;j<4;j++)EXPAN[j]=DC_16__SUB_21[j]; - LOWLIM = DC_16__SUB_21[4]; - HIGLIM = DC_16__SUB_21[5]; - } - } - - double DC_18__SUB_19[6]={1.416402e+00, -1.806420e-01, 7.972462e-03, -1.199993e-04, 1.787500e+01, 2.262500e+01}; - double DC_18__SUB_23[6]={4.194251e+00, -5.835595e-01, 2.741645e-02, -4.322421e-04, 1.812500e+01, 2.237500e+01}; - double DC_18__SUB_24[6]={2.681779e+00, -3.893816e-01, 1.947832e-02, -3.319258e-04, 1.562500e+01, 1.937500e+01}; - if(theCrystal==18){ - if(theSubR==19){ - for(int j=0;j<4;j++)EXPAN[j]=DC_18__SUB_19[j]; - LOWLIM = DC_18__SUB_19[4]; - HIGLIM = DC_18__SUB_19[5]; - } - if(theSubR==23){ - for(int j=0;j<4;j++)EXPAN[j]=DC_18__SUB_23[j]; - LOWLIM = DC_18__SUB_23[4]; - HIGLIM = DC_18__SUB_23[5]; - } - if(theSubR==24){ - for(int j=0;j<4;j++)EXPAN[j]=DC_18__SUB_24[j]; - LOWLIM = DC_18__SUB_24[4]; - HIGLIM = DC_18__SUB_24[5]; - } - } - - - double DC_7[150]={ --2.254192e+00,8.773615e-01,-8.104879e-02,2.204202e-03,1.237500e+01,1.662500e+01, --8.492041e+00,2.447796e+00,-2.122152e-01,5.812223e-03,1.162500e+01,1.487500e+01, --1.088208e+01,2.992327e+00,-2.562457e-01,7.044847e-03,1.112500e+01,1.412500e+01, --1.301579e+00,8.800398e-01,-9.837782e-02,3.058346e-03,1.137500e+01,1.512500e+01, -3.626007e+01,-6.877452e+00,4.367576e-01,-9.268701e-03,1.262500e+01,1.662500e+01, -3.949840e+00,-6.127214e-01,3.226193e-02,-5.715623e-04,1.562500e+01,1.987500e+01, -4.219998e+00,-6.962436e-01,3.912757e-02,-7.414084e-04,1.462500e+01,1.862500e+01, -2.969170e+00,-4.834242e-01,2.709822e-02,-5.155613e-04,1.412500e+01,1.812500e+01, -1.679327e+00,-2.394863e-01,1.182912e-02,-1.988521e-04,1.437500e+01,1.862500e+01, -1.477710e+00,-2.043778e-01,9.799566e-03,-1.599286e-04,1.537500e+01,1.987500e+01, -1.273003e+00,-1.604834e-01,6.960934e-03,-1.023872e-04,1.937500e+01,2.337500e+01, --4.721569e-01,9.059029e-02,-5.074381e-03,8.975521e-05,1.837500e+01,2.262500e+01, -4.344981e-01,-4.276521e-02,1.444304e-03,-1.615800e-05,1.812500e+01,2.212500e+01, -5.088271e-01,-5.384739e-02,1.997008e-03,-2.531495e-05,1.837500e+01,2.262500e+01, --2.075691e-01,4.620214e-02,-2.641805e-03,4.620105e-05,1.912500e+01,2.362500e+01, - 2.741705e-02,6.743106e-03,-5.401191e-04,1.000053e-05,2.312500e+01,2.737500e+01, --2.564791e-01,4.004509e-02,-1.841141e-03,2.690698e-05,2.237500e+01,2.637500e+01, -1.941751e-01,-1.434651e-02,3.411754e-04,-2.193993e-06,2.212500e+01,2.587500e+01, --2.863949e-01,4.371159e-02,-1.989210e-03,2.890197e-05,2.212500e+01,2.637500e+01, --5.984808e-01,7.831724e-02,-3.257370e-03,4.427852e-05,2.312500e+01,2.737500e+01, -3.242949e+00,-3.312085e-01,1.133701e-02,-1.296594e-04,2.687500e+01,3.037500e+01, --8.831326e-01,9.888605e-02,-3.596903e-03,4.305765e-05,2.637500e+01,2.987500e+01, -1.510231e+00,-1.597930e-01,5.713092e-03,-6.851978e-05,2.637500e+01,2.937500e+01, -1.159944e+00,-1.231407e-01,4.435157e-03,-5.366391e-05,2.612500e+01,3.012500e+01, -3.476164e-01,-3.352644e-02,1.141654e-03,-1.331732e-05,2.687500e+01,3.062500e+01}; - - if(theCrystal==7 ){ - int idx = theSubR*6; - for(int j=0;j<4;j++)EXPAN[j]=DC_7[idx+j]; - LOWLIM = DC_7[idx+4]; - HIGLIM = DC_7[idx+5]; - } - - double DC_17[150]={ -4.217161e+00,-4.389886e-01,1.529779e-02,-1.779082e-04,2.687500e+01,3.062500e+01, --4.415793e-02,7.069231e-03,-2.445950e-04,2.358776e-06,2.612500e+01,3.012500e+01, -1.612653e+00,-1.739475e-01,6.346927e-03,-7.763128e-05,2.612500e+01,2.987500e+01, -4.170846e+00,-4.432786e-01,1.578580e-02,-1.877211e-04,2.637500e+01,3.012500e+01, --1.079075e+00,1.130099e-01,-3.858799e-03,4.349966e-05,2.687500e+01,3.087500e+01, --4.063348e-01,5.717392e-02,-2.470266e-03,3.445237e-05,2.312500e+01,2.737500e+01, -1.338731e+00,-1.582056e-01,6.380606e-03,-8.664104e-05,2.212500e+01,2.637500e+01, --2.421845e-02,1.270422e-02,-7.522113e-04,1.244266e-05,2.212500e+01,2.587500e+01, --4.021835e-01,5.935190e-02,-2.659277e-03,3.830565e-05,2.237500e+01,2.662500e+01, --8.196117e-01,1.097254e-01,-4.681045e-03,6.533124e-05,2.312500e+01,2.737500e+01, --1.526123e-01,3.885482e-02,-2.295584e-03,4.070329e-05,1.912500e+01,2.362500e+01, -5.311694e-01,-5.426867e-02,1.918688e-03,-2.266857e-05,1.862500e+01,2.262500e+01, --6.813745e-01,1.217903e-01,-6.579330e-03,1.137562e-04,1.812500e+01,2.187500e+01, --5.009189e-01,9.204942e-02,-4.959804e-03,8.470321e-05,1.837500e+01,2.262500e+01, --5.073070e-01,8.915138e-02,-4.632168e-03,7.654229e-05,1.912500e+01,2.362500e+01, -3.418404e+00,-5.297480e-01,2.794652e-02,-4.963118e-04,1.537500e+01,1.987500e+01, -1.659555e+00,-2.468708e-01,1.292932e-02,-2.331323e-04,1.437500e+01,1.862500e+01, -8.423056e-01,-9.808645e-02,3.962777e-03,-5.382368e-05,1.412500e+01,1.787500e+01, -1.469667e+00,-2.059879e-01,1.016120e-02,-1.724070e-04,1.462500e+01,1.887500e+01, -1.176922e+00,-1.515387e-01,6.875561e-03,-1.074350e-04,1.562500e+01,1.987500e+01, -5.720176e+00,-8.530840e-01,4.098870e-02,-6.115276e-04,1.287500e+01,1.637500e+01, - 4.841712e-01,1.913165e-01,-3.039104e-02,1.057621e-03,1.137500e+01,1.487500e+01, -6.498010e+00,-1.207127e+00,7.688244e-02,-1.660935e-03,1.112500e+01,1.387500e+01, --5.872777e+00,1.578269e+00,-1.307714e-01,3.472470e-03,1.162500e+01,1.487500e+01, --1.895147e+00,6.493533e-01,-5.698996e-02,1.506239e-03,1.262500e+01,1.662500e+01}; - - if(theCrystal==17 ){ - int idx = theSubR*6; - for(int j=0;j<4;j++)EXPAN[j]=DC_17[idx+j]; - LOWLIM = DC_17[idx+4]; - HIGLIM = DC_17[idx+5]; - } - - double DC_11[150]={ --7.841682e+00,1.823860e+00,-1.334697e-01,3.150600e-03,1.312500e+01,1.662500e+01, -8.018543e-01,-8.658559e-02,3.149128e-03,-3.654744e-05,1.537500e+01,1.987500e+01, --4.133606e-01,7.704605e-02,-4.101209e-03,6.866478e-05,1.937500e+01,2.387500e+01, --5.934164e-01,8.104380e-02,-3.460635e-03,4.795556e-05,2.312500e+01,2.737500e+01, --9.928602e-01,1.044207e-01,-3.569758e-03,4.018672e-05,2.687500e+01,3.037500e+01, --1.029552e+01,2.685724e+00,-2.204416e-01,5.841658e-03,1.187500e+01,1.487500e+01, -9.180374e-01,-1.052881e-01,4.064508e-03,-4.967248e-05,1.437500e+01,1.862500e+01, --1.418941e-01,4.179488e-02,-2.607750e-03,4.796817e-05,1.837500e+01,2.262500e+01, --1.056954e+00,1.409367e-01,-6.036432e-03,8.476716e-05,2.237500e+01,2.637500e+01, -4.350209e-01,-4.266503e-02,1.486051e-03,-1.785385e-05,2.662500e+01,2.987500e+01, - 3.455594e+00,-4.364698e-01,1.321818e-02,6.719265e-05,1.162500e+01,1.412500e+01, - 4.301526e-02,6.098664e-02,-6.465994e-03,1.720728e-04,1.412500e+01,1.787500e+01, --4.069651e-01,8.051603e-02,-4.498530e-03,7.871984e-05,1.837500e+01,2.212500e+01, --2.809479e-01,4.495355e-02,-2.087645e-03,3.068962e-05,2.212500e+01,2.612500e+01, -2.075194e+00,-2.261375e-01,8.316833e-03,-1.025206e-04,2.612500e+01,2.912500e+01, -1.378091e+01,-2.613367e+00,1.675564e-01,-3.613074e-03,1.187500e+01,1.512500e+01, -2.132854e+00,-3.269693e-01,1.746902e-02,-3.189777e-04,1.437500e+01,1.862500e+01, - 2.292343e-02,1.849124e-02,-1.524583e-03,3.130647e-05,1.837500e+01,2.262500e+01, -1.293551e-01,-5.126469e-03,-5.540647e-05,3.265263e-06,2.237500e+01,2.637500e+01, -9.596848e-01,-9.858289e-02,3.466541e-03,-4.118061e-05,2.612500e+01,2.987500e+01, -3.097831e+00,-3.674073e-01,1.202461e-02,-5.622977e-05,1.312500e+01,1.662500e+01, -2.897233e+00,-4.418207e-01,2.304895e-02,-4.059865e-04,1.537500e+01,1.987500e+01, -9.321359e-01,-1.104539e-01,4.572031e-03,-6.476785e-05,1.937500e+01,2.387500e+01, -5.252174e-01,-5.379442e-02,1.934598e-03,-2.379672e-05,2.312500e+01,2.737500e+01, -8.398420e-02,-4.740480e-03,1.085812e-04,-1.047917e-06,2.712500e+01,3.062500e+01}; - - if(theCrystal==11 ){ - int idx = theSubR*6; - for(int j=0;j<4;j++)EXPAN[j]=DC_11[idx+j]; - LOWLIM = DC_11[idx+4]; - HIGLIM = DC_11[idx+5]; - } - - double DC_12[150]={ --2.683156e+02,8.379351e+01,-8.574764e+00,2.894498e-01,9.050000e+00,1.075000e+01, --2.633331e+01,1.092268e+01,-1.292598e+00,4.755764e-02,6.550000e+00,1.035000e+01, -1.298892e+01,-3.890416e+00,5.668730e-01,-3.049368e-02,6.150000e+00,9.650000e+00, --2.060104e+01,8.805762e+00,-1.033988e+00,3.720978e-02,6.750000e+00,1.035000e+01, --1.435412e+01,6.805584e+00,-8.083018e-01,2.889051e-02,8.950000e+00,1.175000e+01, --3.833305e+00,2.751720e+00,-3.176925e-01,9.607317e-03,6.750000e+00,1.045000e+01, -4.728438e+00,-2.525736e-01,2.442477e-02,-2.816163e-03,3.750000e+00,8.150000e+00, -4.288562e+00,-1.554985e-02,-2.635850e-02,1.261286e-03,2.250000e+00,5.950000e+00, - 3.686623e+00,3.032598e-01,-6.954155e-02,2.280268e-03,3.650000e+00,7.750000e+00, --2.662604e+01,1.074988e+01,-1.242449e+00,4.460082e-02,6.950000e+00,1.025000e+01, -1.766374e+01,-5.546134e+00,7.526374e-01,-3.663364e-02,6.150000e+00,9.650000e+00, -4.038846e+00,9.220826e-02,-2.985477e-02,-1.532897e-04,2.550000e+00,6.050000e+00, -4.249283e+00,-1.329959e-01,6.910265e-02,-1.731542e-02,4.500000e-01,2.550000e+00, - 3.261831e+00,6.685430e-01,-1.667045e-01,1.010852e-02,2.450000e+00,5.950000e+00, -5.532059e+00,-9.222027e-01,1.754193e-01,-1.345344e-02,6.150000e+00,9.750000e+00, --2.055600e+00,2.167494e+00,-2.521345e-01,7.175688e-03,6.650000e+00,1.015000e+01, -5.174107e+00,-5.126735e-01,7.574543e-02,-5.924821e-03,3.650000e+00,8.050000e+00, - 4.010604e+00,1.421902e-01,-4.961370e-02,2.240491e-03,2.250000e+00,6.150000e+00, -4.916210e+00,-3.532186e-01,4.486601e-02,-4.190666e-03,3.550000e+00,8.050000e+00, --2.613829e+01,1.079982e+01,-1.267882e+00,4.601785e-02,6.750000e+00,1.035000e+01, --4.515550e+01,1.533485e+01,-1.592294e+00,5.292917e-02,8.850000e+00,1.125000e+01, --4.781856e+00,3.219430e+00,-3.851064e-01,1.279027e-02,6.650000e+00,1.055000e+01, -1.578993e+01,-4.741117e+00,6.368575e-01,-3.092251e-02,6.050000e+00,9.750000e+00, --3.026564e-01,1.669273e+00,-2.082128e-01,6.105978e-03,6.750000e+00,1.055000e+01, --8.954002e+01,2.883563e+01,-2.949398e+00,9.773130e-02,8.850000e+00,1.085000e+01}; - - if(theCrystal==12 ){ - int idx = theSubR*6; - for(int j=0;j<4;j++)EXPAN[j]=DC_12[idx+j]; - LOWLIM = DC_12[idx+4]; - HIGLIM = DC_12[idx+5]; - } - - double DC_13[150]={ - 5.823157e-02,8.400130e-03,-7.188907e-04,1.284352e-05,2.762500e+01,2.987500e+01, --9.805682e-01,1.246907e-01,-5.121338e-03,6.911245e-05,2.312500e+01,2.687500e+01, --7.683050e-01,1.241994e-01,-6.228905e-03,1.008285e-04,1.937500e+01,2.362500e+01, -1.323685e+00,-1.796862e-01,8.574237e-03,-1.410417e-04,1.562500e+01,2.012500e+01, -3.842282e+01,-7.223355e+00,4.554104e-01,-9.610130e-03,1.312500e+01,1.662500e+01, --1.799641e+00,1.999533e-01,-7.304839e-03,8.831979e-05,2.637500e+01,2.937500e+01, --1.224227e-01,2.381588e-02,-1.175947e-03,1.772012e-05,2.212500e+01,2.612500e+01, -1.595430e-01,-1.716654e-03,-5.677470e-04,1.641045e-05,1.837500e+01,2.262500e+01, --4.989548e-01,1.477504e-01,-1.091511e-02,2.433065e-04,1.437500e+01,1.862500e+01, -1.119539e+01,-1.692326e+00,7.848095e-02,-1.002662e-03,1.187500e+01,1.487500e+01, -3.947799e+00,-4.347167e-01,1.604157e-02,-1.977770e-04,2.612500e+01,2.887500e+01, -2.737905e-01,-2.446521e-02,7.749894e-04,-8.447286e-06,2.212500e+01,2.587500e+01, - 3.026276e-02,2.014191e-02,-1.780413e-03,3.846147e-05,1.812500e+01,2.212500e+01, --1.783688e-01,8.619931e-02,-6.949675e-03,1.578522e-04,1.412500e+01,1.812500e+01, --7.611232e-01,9.620214e-01,-1.215449e-01,4.094543e-03,1.187500e+01,1.412500e+01, --6.230283e-01,6.955968e-02,-2.494942e-03,2.924737e-05,2.637500e+01,2.937500e+01, -3.913277e-01,-3.816143e-02,1.305127e-03,-1.525915e-05,2.212500e+01,2.662500e+01, --5.825958e-02,2.959953e-02,-2.055292e-03,3.970729e-05,1.837500e+01,2.237500e+01, --8.518330e-01,2.124466e-01,-1.478244e-02,3.191030e-04,1.437500e+01,1.887500e+01, --1.286301e+01,3.628803e+00,-3.126392e-01,8.556526e-03,1.187500e+01,1.487500e+01, --3.598106e+00,3.811311e-01,-1.337326e-02,1.558978e-04,2.712500e+01,3.012500e+01, -5.432891e-01,-5.538775e-02,1.960782e-03,-2.363140e-05,2.312500e+01,2.737500e+01, --2.203707e-01,5.129646e-02,-3.001136e-03,5.319389e-05,1.912500e+01,2.387500e+01, -1.654851e+00,-2.281407e-01,1.095303e-02,-1.803335e-04,1.537500e+01,2.012500e+01, --2.960648e+00,1.079644e+00,-9.709813e-02,2.591611e-03,1.312500e+01,1.662500e+01}; - - - if(theCrystal==13 ){ - int idx = theSubR*6; - for(int j=0;j<4;j++)EXPAN[j]=DC_13[idx+j]; - LOWLIM = DC_13[idx+4]; - HIGLIM = DC_13[idx+5]; - } - - - - -} - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/ExponCorrector.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/ExponCorrector.h deleted file mode 100644 index 3de8b144f865a..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/ExponCorrector.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// Original Author: Georgios Daskalakis , Georgios.Daskalakis@cern.ch -// Created: Fri Mar 30 18:15:12 CET 2007 -// -// -// -// - - -#ifndef ExponCorrector_h -#define ExponCorrector_h - -class ExponCorrector { -public: - ExponCorrector() {} - ~ExponCorrector() {} - double value(int DeadCrystal, int DeadCrystalEta, int estimE, int subRegion, double estimX, double estimY); -private: - double EXPAN[4]; - double LOWLIM,HIGLIM; - int theCrystal; - int theSubR; - - void ExpE_50(); -}; - -#endif // ExponCorrector_h - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/PositionCorrector.cxx b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/PositionCorrector.cxx deleted file mode 100644 index 353e695574392..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/PositionCorrector.cxx +++ /dev/null @@ -1,189 +0,0 @@ -// -// Original Author: Georgios Daskalakis , Georgios.Daskalakis@cern.ch -// Created: Fri Mar 30 18:15:12 CET 2007 -// -// -// -// - - -#include "PositionCorrector.h" -#include - - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -double PositionCorrector::CORRX(int DeadCrystal, int DeadCrystalEta, int estimE, double estimX) { - - float pos=0.0; - index=-1; - - int CR; CR = DeadCrystal; - - //=================================================================================== - if(CR<5 || CR>19 || CR==5 || CR==10 || CR==15 || CR==9 || CR==14 || CR==19 || CR==11 || CR==13){ - if(estimX<=1.0)index=0; - if(estimX> 1.0)index=1; - } - //================================================================================== - if( CR==6 || CR==8 ){ - if(estimX<=1.0)index=2; - if(estimX> 1.0)index=3; - } - //================================================================================== - if( CR==16 || CR==18 ){ - if(estimX<=0.5)index=4; - if(estimX >0.5)index=5; - } - //================================================================================== - if( CR==7 ){ - if(estimX<=0.1)index=6; - if(estimX >0.1)index=7; - } - //================================================================================== - if( CR==17 ){ - if(estimX<=0.5)index=8; - if(estimX >0.5)index=9; - } - //================================================================================== - if( CR==12 ){ - if(estimX<=0.0)index=10; - if(estimX >0.0)index=11; - } - //================================================================================== - - - switch(estimE) { - case 50: - correction_50(); break; - default: - correction_50(); break; - }//end switch - - - pos = estimX - ( a0+a1*estimX+a2*pow(estimX,2)+a3*pow(estimX,3) ); - return pos; - -} - - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -double PositionCorrector::CORRY(int DeadCrystal, int DeadCrystalEta, int estimE, double estimY) { - - float pos=0.0; - index=-1; - - int CR; CR = DeadCrystal; - - //=================================================================================== - if(CR<5 || CR>19 || CR==5 || CR==10 || CR==15 || CR==9 || CR==14 || CR==19 || CR==7 || CR==17){ - if(estimY<=1.0)index=12; - if(estimY>1.0)index=13; - } - //================================================================================== - if( CR==6 || CR==16 ){ - if(estimY<=1.0)index=14; - if(estimY>1.0)index=15; - } - //================================================================================== - if( CR==8 || CR==18 ){ - if(estimY<=1.0)index=16; - if(estimY>1.0)index=17; - } - //================================================================================== - if( CR==11 ){ - if(estimY<=0.1)index=18; - if(estimY>0.1)index=19; - } - //================================================================================== - if( CR==13 ){ - if(estimY<=0.5)index=20; - if(estimY>0.5)index=21; - } - //================================================================================== - if( CR==12 ){ - if(estimY<=0.0)index=22; - if(estimY>0.0)index=23; - } - //================================================================================== - - - - switch(estimE) { - case 50: - correction_50(); break; - default: - correction_50(); break; - }//end switch - - pos = estimY - ( a0+a1*estimY+a2*pow(estimY,2)+a3*pow(estimY,3) ); - return pos; -} - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -void PositionCorrector::correction_50(){ - switch(index) { -case 0: -a0=0.742593 ; a1=-2.443654 ; a2=-0.465629 ; a3=-0.021076; break; -case 1: -a0=0.723622 ; a1=-2.985130 ; a2=0.499481 ; a3=-0.019927; break; -case 2: -a0=1.523233 ; a1=-2.403963 ; a2=-0.509061 ; a3=-0.025730; break; -case 3: -a0=1.664726 ; a1=-3.356694 ; a2=0.549796 ; a3=-0.022267; break; -case 4: -a0=-0.159428; a1=-2.913839 ; a2=-0.553717 ; a3=-0.026586; break; -case 5: -a0=-0.243322; a1=-2.982453; a2=0.562717 ; a3=-0.025937; break; -case 6: -a0=4.041620 ; a1=-4.430074; a2=-1.810173; a3=-0.195484; break; -case 7: -a0=3.865189 ; a1=-4.704274; a2=0.821256 ; a3=-0.039980; break; -case 8: -a0=-2.149538; a1=-4.287159; a2=-0.860018; a3=-0.049002; break; -case 9: -a0=-1.212509; a1=-7.920839; a2=3.424293 ; a3=-0.450545; break; -case 10: -a0=0.613761 ; a1=0.135842 ; a2=-0.013459; a3=0.000387 ; break; -case 11: -a0=0.583244 ; a1=0.118751 ; a2=0.002993 ; a3=0.000765 ; break; -case 12: -a0=-0.667742; a1=-2.345453; a2=-0.207485; a3=0.015167 ; break; -case 13: -a0=-0.802945; a1=-2.473333; a2=0.509882 ; a3=-0.025977; break; -case 14: -a0=0.176678 ; a1=-2.515074; a2=-0.316820; a3=0.006614 ; break; -case 15: -a0=0.053470 ; a1=-2.847765; a2=0.569733 ; a3=-0.029271; break; -case 16: -a0=-1.523717; a1=-2.677881; a2=-0.263621; a3=0.010810 ; break; -case 17: -a0=-1.728052; a1=-2.304793; a2=0.518835 ; a3=-0.028141; break; -case 18: -a0=1.726925 ; a1=-5.905270; a2=-2.038082; a3=-0.151892; break; -case 19: -a0=1.886734 ; a1=-3.997667; a2=0.822161 ; a3=-0.046878; break; -case 20: -a0=-3.924581; a1=-4.341018; a2=-0.671026; a3=-0.021481; break; -case 21: -a0=-4.464453; a1=-4.115324; a2=1.873425 ; a3=-0.152978; break; -case 22: -a0=-0.806418; a1=0.143467 ; a2=-0.001304; a3=0.000772 ; break; -case 23: -a0=-0.835848; a1=0.154018 ; a2=0.017631 ; a3=0.000075 ; break; -default: - std::cout<<" Error, not valid Dead Channel Number, Abort"< - - - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - -double SplineCorrector::value(int DeadCrystal, int DeadCrystalEta, int estimE, double estimX, double estimY) { - - double result=0.0; - index = DeadCrystal; - - switch(estimE) - { - case 50: - SplE_50(); break; - default: - SplE_50(); break; - }//end switch - - //================== - int PDIM = 5; - for (int iy=0 ; iy - -double TestPos_100::value(int index,double in0,double in1,double in2,double in3,double in4,double in5,double in6,double in7,double in8) { - input0 = (in0 - 0)/1; - input1 = (in1 - 0)/1; - input2 = (in2 - 0)/1; - input3 = (in3 - 0)/1; - input4 = (in4 - 0)/1; - input5 = (in5 - 0)/1; - input6 = (in6 - 0)/1; - input7 = (in7 - 0)/1; - input8 = (in8 - 0)/1; - switch(index) { - case 0: - return ((neuron0xa5d6850()*1)+0); - default: - return 0.; - } -} - -double TestPos_100::neuron0xa5c5530() { - return input0; -} - -double TestPos_100::neuron0xa5d3b10() { - return input1; -} - -double TestPos_100::neuron0xa5d3c10() { - return input2; -} - -double TestPos_100::neuron0xa5d3d58() { - return input3; -} - -double TestPos_100::neuron0xa5d3f30() { - return input4; -} - -double TestPos_100::neuron0xa5d4108() { - return input5; -} - -double TestPos_100::neuron0xa5d42e0() { - return input6; -} - -double TestPos_100::neuron0xa5d44b8() { - return input7; -} - -double TestPos_100::neuron0xa5d46b0() { - return input8; -} - -double TestPos_100::input0xa5d49c8() { - double input = 0.531303; - input += synapse0xa5c18e8(); - input += synapse0xa5d4b58(); - input += synapse0xa5d4b80(); - input += synapse0xa5d4ba8(); - input += synapse0xa5d4bd0(); - input += synapse0xa5d4bf8(); - input += synapse0xa5d4c20(); - input += synapse0xa5d4c48(); - input += synapse0xa5d4c70(); - return input; -} - -double TestPos_100::neuron0xa5d49c8() { - double input = input0xa5d49c8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d4c98() { - double input = 0.00858638; - input += synapse0xa5d4e70(); - input += synapse0xa5d4e98(); - input += synapse0xa5d4ec0(); - input += synapse0xa5d4ee8(); - input += synapse0xa5d4f10(); - input += synapse0xa5d4f38(); - input += synapse0xa5d4f60(); - input += synapse0xa5d4f88(); - input += synapse0xa5d5038(); - return input; -} - -double TestPos_100::neuron0xa5d4c98() { - double input = input0xa5d4c98(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d5060() { - double input = 0.540891; - input += synapse0xa5d51f0(); - input += synapse0xa5d5218(); - input += synapse0xa5d5240(); - input += synapse0xa5d5268(); - input += synapse0xa5d5290(); - input += synapse0xa5d52b8(); - input += synapse0xa5d52e0(); - input += synapse0xa5d5308(); - input += synapse0xa5d5330(); - return input; -} - -double TestPos_100::neuron0xa5d5060() { - double input = input0xa5d5060(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d5358() { - double input = 0.31223; - input += synapse0xa5d5530(); - input += synapse0xa5d5558(); - input += synapse0xa5d5580(); - input += synapse0xa5d55a8(); - input += synapse0xa5d55d0(); - input += synapse0xa5d55f8(); - input += synapse0xa5d4fb0(); - input += synapse0xa5d4fd8(); - input += synapse0xa5d5000(); - return input; -} - -double TestPos_100::neuron0xa5d5358() { - double input = input0xa5d5358(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d5728() { - double input = -0.709237; - input += synapse0xa5d5900(); - input += synapse0xa5d5928(); - input += synapse0xa5d5950(); - input += synapse0xa5d5978(); - input += synapse0xa5d59a0(); - input += synapse0xa5d59c8(); - input += synapse0xa5d59f0(); - input += synapse0xa5d5a18(); - input += synapse0xa5d5a40(); - return input; -} - -double TestPos_100::neuron0xa5d5728() { - double input = input0xa5d5728(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d5a68() { - double input = -1.13743; - input += synapse0xa5d5c40(); - input += synapse0xa5d5c68(); - input += synapse0xa5d5c90(); - input += synapse0xa5d5cb8(); - input += synapse0xa5d5ce0(); - input += synapse0xa5d5d08(); - input += synapse0xa5d5d30(); - input += synapse0xa5d5d58(); - input += synapse0xa5d5d80(); - return input; -} - -double TestPos_100::neuron0xa5d5a68() { - double input = input0xa5d5a68(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d5da8() { - double input = -0.396006; - input += synapse0xa5d5f80(); - input += synapse0xa5d5fa8(); - input += synapse0xa5d5fd0(); - input += synapse0xa5d5ff8(); - input += synapse0xa5d6020(); - input += synapse0xa5d6048(); - input += synapse0xa5d6070(); - input += synapse0xa5d6098(); - input += synapse0xa5d60c0(); - return input; -} - -double TestPos_100::neuron0xa5d5da8() { - double input = input0xa5d5da8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d60e8() { - double input = -1.31206; - input += synapse0xa5d6348(); - input += synapse0xa5d6370(); - input += synapse0xa521c20(); - input += synapse0xa521ba8(); - input += synapse0xa521dc0(); - input += synapse0xa34c098(); - input += synapse0xa5d5620(); - input += synapse0xa5d5648(); - input += synapse0xa5d5670(); - return input; -} - -double TestPos_100::neuron0xa5d60e8() { - double input = input0xa5d60e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d65a0() { - double input = 0.768949; - input += synapse0xa5d66e8(); - input += synapse0xa5d6710(); - input += synapse0xa5d6738(); - input += synapse0xa5d6760(); - input += synapse0xa5d6788(); - input += synapse0xa5d67b0(); - input += synapse0xa5d67d8(); - input += synapse0xa5d6800(); - input += synapse0xa5d6828(); - return input; -} - -double TestPos_100::neuron0xa5d65a0() { - double input = input0xa5d65a0(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double TestPos_100::input0xa5d6850() { - double input = 1.4245; - input += synapse0xa5d6950(); - input += synapse0xa5d6978(); - input += synapse0xa5d69a0(); - input += synapse0xa5d69c8(); - input += synapse0xa5d69f0(); - input += synapse0xa5d6a18(); - input += synapse0xa5d6a40(); - input += synapse0xa5d6a68(); - input += synapse0xa5d6a90(); - return input; -} - -double TestPos_100::neuron0xa5d6850() { - double input = input0xa5d6850(); - return (input * 1)+0; -} - -double TestPos_100::synapse0xa5c18e8() { - return (neuron0xa5c5530()*-1.4618); -} - -double TestPos_100::synapse0xa5d4b58() { - return (neuron0xa5d3b10()*0.087325); -} - -double TestPos_100::synapse0xa5d4b80() { - return (neuron0xa5d3c10()*-0.728406); -} - -double TestPos_100::synapse0xa5d4ba8() { - return (neuron0xa5d3d58()*0.339684); -} - -double TestPos_100::synapse0xa5d4bd0() { - return (neuron0xa5d3f30()*-0.450042); -} - -double TestPos_100::synapse0xa5d4bf8() { - return (neuron0xa5d4108()*0.589395); -} - -double TestPos_100::synapse0xa5d4c20() { - return (neuron0xa5d42e0()*-0.405287); -} - -double TestPos_100::synapse0xa5d4c48() { - return (neuron0xa5d44b8()*0.0336332); -} - -double TestPos_100::synapse0xa5d4c70() { - return (neuron0xa5d46b0()*-1.21001); -} - -double TestPos_100::synapse0xa5d4e70() { - return (neuron0xa5c5530()*-0.17238); -} - -double TestPos_100::synapse0xa5d4e98() { - return (neuron0xa5d3b10()*0.263866); -} - -double TestPos_100::synapse0xa5d4ec0() { - return (neuron0xa5d3c10()*-0.231923); -} - -double TestPos_100::synapse0xa5d4ee8() { - return (neuron0xa5d3d58()*-0.534989); -} - -double TestPos_100::synapse0xa5d4f10() { - return (neuron0xa5d3f30()*-0.632176); -} - -double TestPos_100::synapse0xa5d4f38() { - return (neuron0xa5d4108()*0.128704); -} - -double TestPos_100::synapse0xa5d4f60() { - return (neuron0xa5d42e0()*-0.280789); -} - -double TestPos_100::synapse0xa5d4f88() { - return (neuron0xa5d44b8()*-0.792244); -} - -double TestPos_100::synapse0xa5d5038() { - return (neuron0xa5d46b0()*-0.927055); -} - -double TestPos_100::synapse0xa5d51f0() { - return (neuron0xa5c5530()*0.630397); -} - -double TestPos_100::synapse0xa5d5218() { - return (neuron0xa5d3b10()*0.0402529); -} - -double TestPos_100::synapse0xa5d5240() { - return (neuron0xa5d3c10()*-0.802947); -} - -double TestPos_100::synapse0xa5d5268() { - return (neuron0xa5d3d58()*0.463431); -} - -double TestPos_100::synapse0xa5d5290() { - return (neuron0xa5d3f30()*0.0615201); -} - -double TestPos_100::synapse0xa5d52b8() { - return (neuron0xa5d4108()*-1.43815); -} - -double TestPos_100::synapse0xa5d52e0() { - return (neuron0xa5d42e0()*-1.01121); -} - -double TestPos_100::synapse0xa5d5308() { - return (neuron0xa5d44b8()*-1.62751); -} - -double TestPos_100::synapse0xa5d5330() { - return (neuron0xa5d46b0()*-2.93597); -} - -double TestPos_100::synapse0xa5d5530() { - return (neuron0xa5c5530()*0.809439); -} - -double TestPos_100::synapse0xa5d5558() { - return (neuron0xa5d3b10()*0.201994); -} - -double TestPos_100::synapse0xa5d5580() { - return (neuron0xa5d3c10()*-0.0247191); -} - -double TestPos_100::synapse0xa5d55a8() { - return (neuron0xa5d3d58()*1.62191); -} - -double TestPos_100::synapse0xa5d55d0() { - return (neuron0xa5d3f30()*0.340893); -} - -double TestPos_100::synapse0xa5d55f8() { - return (neuron0xa5d4108()*-0.126776); -} - -double TestPos_100::synapse0xa5d4fb0() { - return (neuron0xa5d42e0()*0.848585); -} - -double TestPos_100::synapse0xa5d4fd8() { - return (neuron0xa5d44b8()*1.17485); -} - -double TestPos_100::synapse0xa5d5000() { - return (neuron0xa5d46b0()*3.12906); -} - -double TestPos_100::synapse0xa5d5900() { - return (neuron0xa5c5530()*1.39657); -} - -double TestPos_100::synapse0xa5d5928() { - return (neuron0xa5d3b10()*1.60718); -} - -double TestPos_100::synapse0xa5d5950() { - return (neuron0xa5d3c10()*-0.630117); -} - -double TestPos_100::synapse0xa5d5978() { - return (neuron0xa5d3d58()*-0.595902); -} - -double TestPos_100::synapse0xa5d59a0() { - return (neuron0xa5d3f30()*-1.4292); -} - -double TestPos_100::synapse0xa5d59c8() { - return (neuron0xa5d4108()*-2.37143); -} - -double TestPos_100::synapse0xa5d59f0() { - return (neuron0xa5d42e0()*-1.04322); -} - -double TestPos_100::synapse0xa5d5a18() { - return (neuron0xa5d44b8()*-2.12608); -} - -double TestPos_100::synapse0xa5d5a40() { - return (neuron0xa5d46b0()*-0.833842); -} - -double TestPos_100::synapse0xa5d5c40() { - return (neuron0xa5c5530()*1.54503); -} - -double TestPos_100::synapse0xa5d5c68() { - return (neuron0xa5d3b10()*1.37067); -} - -double TestPos_100::synapse0xa5d5c90() { - return (neuron0xa5d3c10()*-1.19252); -} - -double TestPos_100::synapse0xa5d5cb8() { - return (neuron0xa5d3d58()*-0.769953); -} - -double TestPos_100::synapse0xa5d5ce0() { - return (neuron0xa5d3f30()*-0.993863); -} - -double TestPos_100::synapse0xa5d5d08() { - return (neuron0xa5d4108()*1.03303); -} - -double TestPos_100::synapse0xa5d5d30() { - return (neuron0xa5d42e0()*-0.0630523); -} - -double TestPos_100::synapse0xa5d5d58() { - return (neuron0xa5d44b8()*0.216776); -} - -double TestPos_100::synapse0xa5d5d80() { - return (neuron0xa5d46b0()*0.255905); -} - -double TestPos_100::synapse0xa5d5f80() { - return (neuron0xa5c5530()*-0.361551); -} - -double TestPos_100::synapse0xa5d5fa8() { - return (neuron0xa5d3b10()*-0.207123); -} - -double TestPos_100::synapse0xa5d5fd0() { - return (neuron0xa5d3c10()*-1.4357); -} - -double TestPos_100::synapse0xa5d5ff8() { - return (neuron0xa5d3d58()*0.872323); -} - -double TestPos_100::synapse0xa5d6020() { - return (neuron0xa5d3f30()*-0.168812); -} - -double TestPos_100::synapse0xa5d6048() { - return (neuron0xa5d4108()*1.20287); -} - -double TestPos_100::synapse0xa5d6070() { - return (neuron0xa5d42e0()*0.654947); -} - -double TestPos_100::synapse0xa5d6098() { - return (neuron0xa5d44b8()*1.24797); -} - -double TestPos_100::synapse0xa5d60c0() { - return (neuron0xa5d46b0()*1.35056); -} - -double TestPos_100::synapse0xa5d6348() { - return (neuron0xa5c5530()*1.42169); -} - -double TestPos_100::synapse0xa5d6370() { - return (neuron0xa5d3b10()*0.782071); -} - -double TestPos_100::synapse0xa521c20() { - return (neuron0xa5d3c10()*-1.5144); -} - -double TestPos_100::synapse0xa521ba8() { - return (neuron0xa5d3d58()*-0.21864); -} - -double TestPos_100::synapse0xa521dc0() { - return (neuron0xa5d3f30()*-1.20186); -} - -double TestPos_100::synapse0xa34c098() { - return (neuron0xa5d4108()*-1.79633); -} - -double TestPos_100::synapse0xa5d5620() { - return (neuron0xa5d42e0()*-0.529529); -} - -double TestPos_100::synapse0xa5d5648() { - return (neuron0xa5d44b8()*-1.67783); -} - -double TestPos_100::synapse0xa5d5670() { - return (neuron0xa5d46b0()*-0.595233); -} - -double TestPos_100::synapse0xa5d66e8() { - return (neuron0xa5c5530()*-1.18159); -} - -double TestPos_100::synapse0xa5d6710() { - return (neuron0xa5d3b10()*0.143654); -} - -double TestPos_100::synapse0xa5d6738() { - return (neuron0xa5d3c10()*1.14203); -} - -double TestPos_100::synapse0xa5d6760() { - return (neuron0xa5d3d58()*1.1597); -} - -double TestPos_100::synapse0xa5d6788() { - return (neuron0xa5d3f30()*-0.68027); -} - -double TestPos_100::synapse0xa5d67b0() { - return (neuron0xa5d4108()*-0.704502); -} - -double TestPos_100::synapse0xa5d67d8() { - return (neuron0xa5d42e0()*-1.44991); -} - -double TestPos_100::synapse0xa5d6800() { - return (neuron0xa5d44b8()*-0.00746011); -} - -double TestPos_100::synapse0xa5d6828() { - return (neuron0xa5d46b0()*-2.01778); -} - -double TestPos_100::synapse0xa5d6950() { - return (neuron0xa5d49c8()*0.515968); -} - -double TestPos_100::synapse0xa5d6978() { - return (neuron0xa5d4c98()*-0.439706); -} - -double TestPos_100::synapse0xa5d69a0() { - return (neuron0xa5d5060()*3.41467); -} - -double TestPos_100::synapse0xa5d69c8() { - return (neuron0xa5d5358()*-1.85878); -} - -double TestPos_100::synapse0xa5d69f0() { - return (neuron0xa5d5728()*1.15939); -} - -double TestPos_100::synapse0xa5d6a18() { - return (neuron0xa5d5a68()*-1.46626); -} - -double TestPos_100::synapse0xa5d6a40() { - return (neuron0xa5d5da8()*-1.70389); -} - -double TestPos_100::synapse0xa5d6a68() { - return (neuron0xa5d60e8()*0.802298); -} - -double TestPos_100::synapse0xa5d6a90() { - return (neuron0xa5d65a0()*1.49076); -} - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/TestPos_100.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/TestPos_100.h deleted file mode 100644 index ea675b152f356..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/TestPos_100.h +++ /dev/null @@ -1,141 +0,0 @@ -#ifndef TestPos_100_h -#define TestPos_100_h - -class TestPos_100 { -public: - TestPos_100() {} - ~TestPos_100() {} - double value(int index,double in0,double in1,double in2,double in3,double in4,double in5,double in6,double in7,double in8); -private: - double input0; - double input1; - double input2; - double input3; - double input4; - double input5; - double input6; - double input7; - double input8; - double neuron0xa5c5530(); - double neuron0xa5d3b10(); - double neuron0xa5d3c10(); - double neuron0xa5d3d58(); - double neuron0xa5d3f30(); - double neuron0xa5d4108(); - double neuron0xa5d42e0(); - double neuron0xa5d44b8(); - double neuron0xa5d46b0(); - double input0xa5d49c8(); - double neuron0xa5d49c8(); - double input0xa5d4c98(); - double neuron0xa5d4c98(); - double input0xa5d5060(); - double neuron0xa5d5060(); - double input0xa5d5358(); - double neuron0xa5d5358(); - double input0xa5d5728(); - double neuron0xa5d5728(); - double input0xa5d5a68(); - double neuron0xa5d5a68(); - double input0xa5d5da8(); - double neuron0xa5d5da8(); - double input0xa5d60e8(); - double neuron0xa5d60e8(); - double input0xa5d65a0(); - double neuron0xa5d65a0(); - double input0xa5d6850(); - double neuron0xa5d6850(); - double synapse0xa5c18e8(); - double synapse0xa5d4b58(); - double synapse0xa5d4b80(); - double synapse0xa5d4ba8(); - double synapse0xa5d4bd0(); - double synapse0xa5d4bf8(); - double synapse0xa5d4c20(); - double synapse0xa5d4c48(); - double synapse0xa5d4c70(); - double synapse0xa5d4e70(); - double synapse0xa5d4e98(); - double synapse0xa5d4ec0(); - double synapse0xa5d4ee8(); - double synapse0xa5d4f10(); - double synapse0xa5d4f38(); - double synapse0xa5d4f60(); - double synapse0xa5d4f88(); - double synapse0xa5d5038(); - double synapse0xa5d51f0(); - double synapse0xa5d5218(); - double synapse0xa5d5240(); - double synapse0xa5d5268(); - double synapse0xa5d5290(); - double synapse0xa5d52b8(); - double synapse0xa5d52e0(); - double synapse0xa5d5308(); - double synapse0xa5d5330(); - double synapse0xa5d5530(); - double synapse0xa5d5558(); - double synapse0xa5d5580(); - double synapse0xa5d55a8(); - double synapse0xa5d55d0(); - double synapse0xa5d55f8(); - double synapse0xa5d4fb0(); - double synapse0xa5d4fd8(); - double synapse0xa5d5000(); - double synapse0xa5d5900(); - double synapse0xa5d5928(); - double synapse0xa5d5950(); - double synapse0xa5d5978(); - double synapse0xa5d59a0(); - double synapse0xa5d59c8(); - double synapse0xa5d59f0(); - double synapse0xa5d5a18(); - double synapse0xa5d5a40(); - double synapse0xa5d5c40(); - double synapse0xa5d5c68(); - double synapse0xa5d5c90(); - double synapse0xa5d5cb8(); - double synapse0xa5d5ce0(); - double synapse0xa5d5d08(); - double synapse0xa5d5d30(); - double synapse0xa5d5d58(); - double synapse0xa5d5d80(); - double synapse0xa5d5f80(); - double synapse0xa5d5fa8(); - double synapse0xa5d5fd0(); - double synapse0xa5d5ff8(); - double synapse0xa5d6020(); - double synapse0xa5d6048(); - double synapse0xa5d6070(); - double synapse0xa5d6098(); - double synapse0xa5d60c0(); - double synapse0xa5d6348(); - double synapse0xa5d6370(); - double synapse0xa521c20(); - double synapse0xa521ba8(); - double synapse0xa521dc0(); - double synapse0xa34c098(); - double synapse0xa5d5620(); - double synapse0xa5d5648(); - double synapse0xa5d5670(); - double synapse0xa5d66e8(); - double synapse0xa5d6710(); - double synapse0xa5d6738(); - double synapse0xa5d6760(); - double synapse0xa5d6788(); - double synapse0xa5d67b0(); - double synapse0xa5d67d8(); - double synapse0xa5d6800(); - double synapse0xa5d6828(); - double synapse0xa5d6950(); - double synapse0xa5d6978(); - double synapse0xa5d69a0(); - double synapse0xa5d69c8(); - double synapse0xa5d69f0(); - double synapse0xa5d6a18(); - double synapse0xa5d6a40(); - double synapse0xa5d6a68(); - double synapse0xa5d6a90(); -}; - -#endif // TestPos_100_h - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Central_1500.cxx b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Central_1500.cxx deleted file mode 100644 index 5c6778e4af6ef..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Central_1500.cxx +++ /dev/null @@ -1,397 +0,0 @@ -#include "Test_Central_1500.h" -#include - -double Test_Central_1500::value(int index,double in0,double in1,double in2) { - input0 = (in0 - 0)/1; - input1 = (in1 - 0)/1; - input2 = (in2 - 0)/1; - switch(index) { - case 0: - return ((neuron0xa7ed248()*1)+0); - default: - return 0.; - } -} - -double Test_Central_1500::neuron0xa7ecce8() { - return input0; -} - -double Test_Central_1500::neuron0xa7ece78() { - return input1; -} - -double Test_Central_1500::neuron0xa7ed050() { - return input2; -} - -double Test_Central_1500::input0xa7ed368() { - double input = -0.491512; - input += synapse0xa7f1b18(); - input += synapse0xa7ed4f8(); - input += synapse0xa7ed520(); - return input; -} - -double Test_Central_1500::neuron0xa7ed368() { - double input = input0xa7ed368(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ed548() { - double input = 11.262; - input += synapse0xa7ed720(); - input += synapse0xa7ed748(); - input += synapse0xa7ed770(); - return input; -} - -double Test_Central_1500::neuron0xa7ed548() { - double input = input0xa7ed548(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ed798() { - double input = -18.9111; - input += synapse0xa7ed970(); - input += synapse0xa7ed998(); - input += synapse0xa7ed9c0(); - return input; -} - -double Test_Central_1500::neuron0xa7ed798() { - double input = input0xa7ed798(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ed9e8() { - double input = -9.84302; - input += synapse0xa7edbe0(); - input += synapse0xa7edc08(); - input += synapse0xa7edc30(); - return input; -} - -double Test_Central_1500::neuron0xa7ed9e8() { - double input = input0xa7ed9e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7edc58() { - double input = -2.9443; - input += synapse0xa7ede50(); - input += synapse0xa7ede78(); - input += synapse0xa7edea0(); - return input; -} - -double Test_Central_1500::neuron0xa7edc58() { - double input = input0xa7edc58(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7edec8() { - double input = 12.1114; - input += synapse0xa7ee0c0(); - input += synapse0xa7ee0e8(); - input += synapse0xa7ee198(); - return input; -} - -double Test_Central_1500::neuron0xa7edec8() { - double input = input0xa7edec8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ee1c0() { - double input = 0.103132; - input += synapse0xa7ee370(); - input += synapse0xa7ee398(); - input += synapse0xa7ee3c0(); - return input; -} - -double Test_Central_1500::neuron0xa7ee1c0() { - double input = input0xa7ee1c0(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ee3e8() { - double input = -0.145439; - input += synapse0xa7ee5e0(); - input += synapse0xa7ee608(); - input += synapse0xa7ee630(); - return input; -} - -double Test_Central_1500::neuron0xa7ee3e8() { - double input = input0xa7ee3e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ee658() { - double input = -11.7324; - input += synapse0xa7ee850(); - input += synapse0xa7ee878(); - input += synapse0xa7ee8a0(); - return input; -} - -double Test_Central_1500::neuron0xa7ee658() { - double input = input0xa7ee658(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ee8c8() { - double input = 1.27801; - input += synapse0xa7eeac0(); - input += synapse0xa7eeae8(); - input += synapse0xa7eeb10(); - return input; -} - -double Test_Central_1500::neuron0xa7ee8c8() { - double input = input0xa7ee8c8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7eeb38() { - double input = 17.2662; - input += synapse0xa7eed38(); - input += synapse0xa7eed60(); - input += synapse0xa7eed88(); - return input; -} - -double Test_Central_1500::neuron0xa7eeb38() { - double input = input0xa7eeb38(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7eeeb8() { - double input = 15.4448; - input += synapse0xa7ef0b8(); - input += synapse0xa7ef0e0(); - input += synapse0xa7ef108(); - return input; -} - -double Test_Central_1500::neuron0xa7eeeb8() { - double input = input0xa7eeeb8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Central_1500::input0xa7ed248() { - double input = -1.09658; - input += synapse0xa7ef1c0(); - input += synapse0xa7ef1e8(); - input += synapse0xa7ef210(); - input += synapse0xa7ef238(); - input += synapse0xa7ef260(); - input += synapse0xa7ef288(); - input += synapse0xa7ef2b0(); - input += synapse0xa7ef2d8(); - input += synapse0xa7ef300(); - input += synapse0xa7ef328(); - input += synapse0xa7ef350(); - input += synapse0xa7ef378(); - return input; -} - -double Test_Central_1500::neuron0xa7ed248() { - double input = input0xa7ed248(); - return (input * 1)+0; -} - -double Test_Central_1500::synapse0xa7f1b18() { - return (neuron0xa7ecce8()*1.27225); -} - -double Test_Central_1500::synapse0xa7ed4f8() { - return (neuron0xa7ece78()*-0.318157); -} - -double Test_Central_1500::synapse0xa7ed520() { - return (neuron0xa7ed050()*-4.69136); -} - -double Test_Central_1500::synapse0xa7ed720() { - return (neuron0xa7ecce8()*-0.218843); -} - -double Test_Central_1500::synapse0xa7ed748() { - return (neuron0xa7ece78()*-0.991067); -} - -double Test_Central_1500::synapse0xa7ed770() { - return (neuron0xa7ed050()*-13.33); -} - -double Test_Central_1500::synapse0xa7ed970() { - return (neuron0xa7ecce8()*0.563781); -} - -double Test_Central_1500::synapse0xa7ed998() { - return (neuron0xa7ece78()*0.373979); -} - -double Test_Central_1500::synapse0xa7ed9c0() { - return (neuron0xa7ed050()*21.4407); -} - -double Test_Central_1500::synapse0xa7edbe0() { - return (neuron0xa7ecce8()*-0.612953); -} - -double Test_Central_1500::synapse0xa7edc08() { - return (neuron0xa7ece78()*-0.492245); -} - -double Test_Central_1500::synapse0xa7edc30() { - return (neuron0xa7ed050()*11.5594); -} - -double Test_Central_1500::synapse0xa7ede50() { - return (neuron0xa7ecce8()*-0.541166); -} - -double Test_Central_1500::synapse0xa7ede78() { - return (neuron0xa7ece78()*2.38148); -} - -double Test_Central_1500::synapse0xa7edea0() { - return (neuron0xa7ed050()*-3.85006); -} - -double Test_Central_1500::synapse0xa7ee0c0() { - return (neuron0xa7ecce8()*-0.359131); -} - -double Test_Central_1500::synapse0xa7ee0e8() { - return (neuron0xa7ece78()*0.504872); -} - -double Test_Central_1500::synapse0xa7ee198() { - return (neuron0xa7ed050()*-13.4148); -} - -double Test_Central_1500::synapse0xa7ee370() { - return (neuron0xa7ecce8()*0.966356); -} - -double Test_Central_1500::synapse0xa7ee398() { - return (neuron0xa7ece78()*0.606441); -} - -double Test_Central_1500::synapse0xa7ee3c0() { - return (neuron0xa7ed050()*2.92563); -} - -double Test_Central_1500::synapse0xa7ee5e0() { - return (neuron0xa7ecce8()*1.03962); -} - -double Test_Central_1500::synapse0xa7ee608() { - return (neuron0xa7ece78()*-0.0568441); -} - -double Test_Central_1500::synapse0xa7ee630() { - return (neuron0xa7ed050()*1.46231); -} - -double Test_Central_1500::synapse0xa7ee850() { - return (neuron0xa7ecce8()*-0.492515); -} - -double Test_Central_1500::synapse0xa7ee878() { - return (neuron0xa7ece78()*-0.425518); -} - -double Test_Central_1500::synapse0xa7ee8a0() { - return (neuron0xa7ed050()*14.739); -} - -double Test_Central_1500::synapse0xa7eeac0() { - return (neuron0xa7ecce8()*-1.02258); -} - -double Test_Central_1500::synapse0xa7eeae8() { - return (neuron0xa7ece78()*0.717172); -} - -double Test_Central_1500::synapse0xa7eeb10() { - return (neuron0xa7ed050()*-4.48672); -} - -double Test_Central_1500::synapse0xa7eed38() { - return (neuron0xa7ecce8()*-0.0556568); -} - -double Test_Central_1500::synapse0xa7eed60() { - return (neuron0xa7ece78()*-0.142405); -} - -double Test_Central_1500::synapse0xa7eed88() { - return (neuron0xa7ed050()*-20.6336); -} - -double Test_Central_1500::synapse0xa7ef0b8() { - return (neuron0xa7ecce8()*0.590757); -} - -double Test_Central_1500::synapse0xa7ef0e0() { - return (neuron0xa7ece78()*-0.539049); -} - -double Test_Central_1500::synapse0xa7ef108() { - return (neuron0xa7ed050()*-17.3757); -} - -double Test_Central_1500::synapse0xa7ef1c0() { - return (neuron0xa7ed368()*-3.52295); -} - -double Test_Central_1500::synapse0xa7ef1e8() { - return (neuron0xa7ed548()*3.53713); -} - -double Test_Central_1500::synapse0xa7ef210() { - return (neuron0xa7ed798()*-7.23512); -} - -double Test_Central_1500::synapse0xa7ef238() { - return (neuron0xa7ed9e8()*-13.0572); -} - -double Test_Central_1500::synapse0xa7ef260() { - return (neuron0xa7edc58()*-1.39761); -} - -double Test_Central_1500::synapse0xa7ef288() { - return (neuron0xa7edec8()*9.81101); -} - -double Test_Central_1500::synapse0xa7ef2b0() { - return (neuron0xa7ee1c0()*4.08124); -} - -double Test_Central_1500::synapse0xa7ef2d8() { - return (neuron0xa7ee3e8()*-4.0037); -} - -double Test_Central_1500::synapse0xa7ef300() { - return (neuron0xa7ee658()*10.8453); -} - -double Test_Central_1500::synapse0xa7ef328() { - return (neuron0xa7ee8c8()*-2.65147); -} - -double Test_Central_1500::synapse0xa7ef350() { - return (neuron0xa7eeb38()*-16.3778); -} - -double Test_Central_1500::synapse0xa7ef378() { - return (neuron0xa7eeeb8()*8.23048); -} - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Central_1500.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Central_1500.h deleted file mode 100644 index 710b65b4d55c2..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Central_1500.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef Test_Central_1500_h -#define Test_Central_1500_h - -class Test_Central_1500 { -public: - Test_Central_1500() {} - ~Test_Central_1500() {} - double value(int index,double in0,double in1,double in2); -private: - double input0; - double input1; - double input2; - double neuron0xa7ecce8(); - double neuron0xa7ece78(); - double neuron0xa7ed050(); - double input0xa7ed368(); - double neuron0xa7ed368(); - double input0xa7ed548(); - double neuron0xa7ed548(); - double input0xa7ed798(); - double neuron0xa7ed798(); - double input0xa7ed9e8(); - double neuron0xa7ed9e8(); - double input0xa7edc58(); - double neuron0xa7edc58(); - double input0xa7edec8(); - double neuron0xa7edec8(); - double input0xa7ee1c0(); - double neuron0xa7ee1c0(); - double input0xa7ee3e8(); - double neuron0xa7ee3e8(); - double input0xa7ee658(); - double neuron0xa7ee658(); - double input0xa7ee8c8(); - double neuron0xa7ee8c8(); - double input0xa7eeb38(); - double neuron0xa7eeb38(); - double input0xa7eeeb8(); - double neuron0xa7eeeb8(); - double input0xa7ed248(); - double neuron0xa7ed248(); - double synapse0xa7f1b18(); - double synapse0xa7ed4f8(); - double synapse0xa7ed520(); - double synapse0xa7ed720(); - double synapse0xa7ed748(); - double synapse0xa7ed770(); - double synapse0xa7ed970(); - double synapse0xa7ed998(); - double synapse0xa7ed9c0(); - double synapse0xa7edbe0(); - double synapse0xa7edc08(); - double synapse0xa7edc30(); - double synapse0xa7ede50(); - double synapse0xa7ede78(); - double synapse0xa7edea0(); - double synapse0xa7ee0c0(); - double synapse0xa7ee0e8(); - double synapse0xa7ee198(); - double synapse0xa7ee370(); - double synapse0xa7ee398(); - double synapse0xa7ee3c0(); - double synapse0xa7ee5e0(); - double synapse0xa7ee608(); - double synapse0xa7ee630(); - double synapse0xa7ee850(); - double synapse0xa7ee878(); - double synapse0xa7ee8a0(); - double synapse0xa7eeac0(); - double synapse0xa7eeae8(); - double synapse0xa7eeb10(); - double synapse0xa7eed38(); - double synapse0xa7eed60(); - double synapse0xa7eed88(); - double synapse0xa7ef0b8(); - double synapse0xa7ef0e0(); - double synapse0xa7ef108(); - double synapse0xa7ef1c0(); - double synapse0xa7ef1e8(); - double synapse0xa7ef210(); - double synapse0xa7ef238(); - double synapse0xa7ef260(); - double synapse0xa7ef288(); - double synapse0xa7ef2b0(); - double synapse0xa7ef2d8(); - double synapse0xa7ef300(); - double synapse0xa7ef328(); - double synapse0xa7ef350(); - double synapse0xa7ef378(); -}; - -#endif // Test_Central_1500_h - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Corner_1500.cxx b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Corner_1500.cxx deleted file mode 100644 index 02008a69426d4..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Corner_1500.cxx +++ /dev/null @@ -1,397 +0,0 @@ -#include "Test_Corner_1500.h" -#include - -double Test_Corner_1500::value(int index,double in0,double in1,double in2) { - input0 = (in0 - 0)/1; - input1 = (in1 - 0)/1; - input2 = (in2 - 0)/1; - switch(index) { - case 0: - return ((neuron0xa841248()*1)+0); - default: - return 0.; - } -} - -double Test_Corner_1500::neuron0xa840ce8() { - return input0; -} - -double Test_Corner_1500::neuron0xa840e78() { - return input1; -} - -double Test_Corner_1500::neuron0xa841050() { - return input2; -} - -double Test_Corner_1500::input0xa841368() { - double input = 0.95298; - input += synapse0xa845b18(); - input += synapse0xa8414f8(); - input += synapse0xa841520(); - return input; -} - -double Test_Corner_1500::neuron0xa841368() { - double input = input0xa841368(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa841548() { - double input = 0.796275; - input += synapse0xa841720(); - input += synapse0xa841748(); - input += synapse0xa841770(); - return input; -} - -double Test_Corner_1500::neuron0xa841548() { - double input = input0xa841548(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa841798() { - double input = 1.7544; - input += synapse0xa841970(); - input += synapse0xa841998(); - input += synapse0xa8419c0(); - return input; -} - -double Test_Corner_1500::neuron0xa841798() { - double input = input0xa841798(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa8419e8() { - double input = 0.131702; - input += synapse0xa841be0(); - input += synapse0xa841c08(); - input += synapse0xa841c30(); - return input; -} - -double Test_Corner_1500::neuron0xa8419e8() { - double input = input0xa8419e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa841c58() { - double input = -0.203393; - input += synapse0xa841e50(); - input += synapse0xa841e78(); - input += synapse0xa841ea0(); - return input; -} - -double Test_Corner_1500::neuron0xa841c58() { - double input = input0xa841c58(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa841ec8() { - double input = -0.640446; - input += synapse0xa8420c0(); - input += synapse0xa8420e8(); - input += synapse0xa842198(); - return input; -} - -double Test_Corner_1500::neuron0xa841ec8() { - double input = input0xa841ec8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa8421c0() { - double input = 0.0571014; - input += synapse0xa842370(); - input += synapse0xa842398(); - input += synapse0xa8423c0(); - return input; -} - -double Test_Corner_1500::neuron0xa8421c0() { - double input = input0xa8421c0(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa8423e8() { - double input = 0.63165; - input += synapse0xa8425e0(); - input += synapse0xa842608(); - input += synapse0xa842630(); - return input; -} - -double Test_Corner_1500::neuron0xa8423e8() { - double input = input0xa8423e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa842658() { - double input = 3.09874; - input += synapse0xa842850(); - input += synapse0xa842878(); - input += synapse0xa8428a0(); - return input; -} - -double Test_Corner_1500::neuron0xa842658() { - double input = input0xa842658(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa8428c8() { - double input = -0.445403; - input += synapse0xa842ac0(); - input += synapse0xa842ae8(); - input += synapse0xa842b10(); - return input; -} - -double Test_Corner_1500::neuron0xa8428c8() { - double input = input0xa8428c8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa842b38() { - double input = 0.278495; - input += synapse0xa842d38(); - input += synapse0xa842d60(); - input += synapse0xa842d88(); - return input; -} - -double Test_Corner_1500::neuron0xa842b38() { - double input = input0xa842b38(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa842eb8() { - double input = -0.612154; - input += synapse0xa8430b8(); - input += synapse0xa8430e0(); - input += synapse0xa843108(); - return input; -} - -double Test_Corner_1500::neuron0xa842eb8() { - double input = input0xa842eb8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Corner_1500::input0xa841248() { - double input = -0.0572088; - input += synapse0xa8431c0(); - input += synapse0xa8431e8(); - input += synapse0xa843210(); - input += synapse0xa843238(); - input += synapse0xa843260(); - input += synapse0xa843288(); - input += synapse0xa8432b0(); - input += synapse0xa8432d8(); - input += synapse0xa843300(); - input += synapse0xa843328(); - input += synapse0xa843350(); - input += synapse0xa843378(); - return input; -} - -double Test_Corner_1500::neuron0xa841248() { - double input = input0xa841248(); - return (input * 1)+0; -} - -double Test_Corner_1500::synapse0xa845b18() { - return (neuron0xa840ce8()*0.276886); -} - -double Test_Corner_1500::synapse0xa8414f8() { - return (neuron0xa840e78()*-0.0309585); -} - -double Test_Corner_1500::synapse0xa841520() { - return (neuron0xa841050()*-1.51021); -} - -double Test_Corner_1500::synapse0xa841720() { - return (neuron0xa840ce8()*0.02515); -} - -double Test_Corner_1500::synapse0xa841748() { - return (neuron0xa840e78()*0.147998); -} - -double Test_Corner_1500::synapse0xa841770() { - return (neuron0xa841050()*-3.11258); -} - -double Test_Corner_1500::synapse0xa841970() { - return (neuron0xa840ce8()*-0.440272); -} - -double Test_Corner_1500::synapse0xa841998() { - return (neuron0xa840e78()*-0.620079); -} - -double Test_Corner_1500::synapse0xa8419c0() { - return (neuron0xa841050()*2.33571); -} - -double Test_Corner_1500::synapse0xa841be0() { - return (neuron0xa840ce8()*0.0060958); -} - -double Test_Corner_1500::synapse0xa841c08() { - return (neuron0xa840e78()*0.0247543); -} - -double Test_Corner_1500::synapse0xa841c30() { - return (neuron0xa841050()*0.000122817); -} - -double Test_Corner_1500::synapse0xa841e50() { - return (neuron0xa840ce8()*-0.257473); -} - -double Test_Corner_1500::synapse0xa841e78() { - return (neuron0xa840e78()*0.678953); -} - -double Test_Corner_1500::synapse0xa841ea0() { - return (neuron0xa841050()*-0.884389); -} - -double Test_Corner_1500::synapse0xa8420c0() { - return (neuron0xa840ce8()*-0.224937); -} - -double Test_Corner_1500::synapse0xa8420e8() { - return (neuron0xa840e78()*0.354063); -} - -double Test_Corner_1500::synapse0xa842198() { - return (neuron0xa841050()*-0.516678); -} - -double Test_Corner_1500::synapse0xa842370() { - return (neuron0xa840ce8()*-0.0579972); -} - -double Test_Corner_1500::synapse0xa842398() { - return (neuron0xa840e78()*0.342624); -} - -double Test_Corner_1500::synapse0xa8423c0() { - return (neuron0xa841050()*-0.925181); -} - -double Test_Corner_1500::synapse0xa8425e0() { - return (neuron0xa840ce8()*0.301493); -} - -double Test_Corner_1500::synapse0xa842608() { - return (neuron0xa840e78()*-1.05591); -} - -double Test_Corner_1500::synapse0xa842630() { - return (neuron0xa841050()*0.865177); -} - -double Test_Corner_1500::synapse0xa842850() { - return (neuron0xa840ce8()*-0.957436); -} - -double Test_Corner_1500::synapse0xa842878() { - return (neuron0xa840e78()*-0.997926); -} - -double Test_Corner_1500::synapse0xa8428a0() { - return (neuron0xa841050()*3.08568); -} - -double Test_Corner_1500::synapse0xa842ac0() { - return (neuron0xa840ce8()*0.0641783); -} - -double Test_Corner_1500::synapse0xa842ae8() { - return (neuron0xa840e78()*0.377656); -} - -double Test_Corner_1500::synapse0xa842b10() { - return (neuron0xa841050()*1.17774); -} - -double Test_Corner_1500::synapse0xa842d38() { - return (neuron0xa840ce8()*0.80131); -} - -double Test_Corner_1500::synapse0xa842d60() { - return (neuron0xa840e78()*0.1294); -} - -double Test_Corner_1500::synapse0xa842d88() { - return (neuron0xa841050()*-0.424347); -} - -double Test_Corner_1500::synapse0xa8430b8() { - return (neuron0xa840ce8()*0.53206); -} - -double Test_Corner_1500::synapse0xa8430e0() { - return (neuron0xa840e78()*0.314745); -} - -double Test_Corner_1500::synapse0xa843108() { - return (neuron0xa841050()*-0.859277); -} - -double Test_Corner_1500::synapse0xa8431c0() { - return (neuron0xa841368()*2.5844); -} - -double Test_Corner_1500::synapse0xa8431e8() { - return (neuron0xa841548()*-2.15982); -} - -double Test_Corner_1500::synapse0xa843210() { - return (neuron0xa841798()*-2.09542); -} - -double Test_Corner_1500::synapse0xa843238() { - return (neuron0xa8419e8()*-0.00693921); -} - -double Test_Corner_1500::synapse0xa843260() { - return (neuron0xa841c58()*1.09624); -} - -double Test_Corner_1500::synapse0xa843288() { - return (neuron0xa841ec8()*-1.23607); -} - -double Test_Corner_1500::synapse0xa8432b0() { - return (neuron0xa8421c0()*0.726722); -} - -double Test_Corner_1500::synapse0xa8432d8() { - return (neuron0xa8423e8()*0.33204); -} - -double Test_Corner_1500::synapse0xa843300() { - return (neuron0xa842658()*0.835795); -} - -double Test_Corner_1500::synapse0xa843328() { - return (neuron0xa8428c8()*0.652662); -} - -double Test_Corner_1500::synapse0xa843350() { - return (neuron0xa842b38()*-0.263563); -} - -double Test_Corner_1500::synapse0xa843378() { - return (neuron0xa842eb8()*-1.38574); -} - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Corner_1500.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Corner_1500.h deleted file mode 100644 index d8dcda625cfd5..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Corner_1500.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef Test_Corner_1500_h -#define Test_Corner_1500_h - -class Test_Corner_1500 { -public: - Test_Corner_1500() {} - ~Test_Corner_1500() {} - double value(int index,double in0,double in1,double in2); -private: - double input0; - double input1; - double input2; - double neuron0xa840ce8(); - double neuron0xa840e78(); - double neuron0xa841050(); - double input0xa841368(); - double neuron0xa841368(); - double input0xa841548(); - double neuron0xa841548(); - double input0xa841798(); - double neuron0xa841798(); - double input0xa8419e8(); - double neuron0xa8419e8(); - double input0xa841c58(); - double neuron0xa841c58(); - double input0xa841ec8(); - double neuron0xa841ec8(); - double input0xa8421c0(); - double neuron0xa8421c0(); - double input0xa8423e8(); - double neuron0xa8423e8(); - double input0xa842658(); - double neuron0xa842658(); - double input0xa8428c8(); - double neuron0xa8428c8(); - double input0xa842b38(); - double neuron0xa842b38(); - double input0xa842eb8(); - double neuron0xa842eb8(); - double input0xa841248(); - double neuron0xa841248(); - double synapse0xa845b18(); - double synapse0xa8414f8(); - double synapse0xa841520(); - double synapse0xa841720(); - double synapse0xa841748(); - double synapse0xa841770(); - double synapse0xa841970(); - double synapse0xa841998(); - double synapse0xa8419c0(); - double synapse0xa841be0(); - double synapse0xa841c08(); - double synapse0xa841c30(); - double synapse0xa841e50(); - double synapse0xa841e78(); - double synapse0xa841ea0(); - double synapse0xa8420c0(); - double synapse0xa8420e8(); - double synapse0xa842198(); - double synapse0xa842370(); - double synapse0xa842398(); - double synapse0xa8423c0(); - double synapse0xa8425e0(); - double synapse0xa842608(); - double synapse0xa842630(); - double synapse0xa842850(); - double synapse0xa842878(); - double synapse0xa8428a0(); - double synapse0xa842ac0(); - double synapse0xa842ae8(); - double synapse0xa842b10(); - double synapse0xa842d38(); - double synapse0xa842d60(); - double synapse0xa842d88(); - double synapse0xa8430b8(); - double synapse0xa8430e0(); - double synapse0xa843108(); - double synapse0xa8431c0(); - double synapse0xa8431e8(); - double synapse0xa843210(); - double synapse0xa843238(); - double synapse0xa843260(); - double synapse0xa843288(); - double synapse0xa8432b0(); - double synapse0xa8432d8(); - double synapse0xa843300(); - double synapse0xa843328(); - double synapse0xa843350(); - double synapse0xa843378(); -}; - -#endif // Test_Corner_1500_h - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Side_1500.cxx b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Side_1500.cxx deleted file mode 100644 index 7f55267adf490..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Side_1500.cxx +++ /dev/null @@ -1,397 +0,0 @@ -#include "Test_Side_1500.h" -#include - -double Test_Side_1500::value(int index,double in0,double in1,double in2) { - input0 = (in0 - 0)/1; - input1 = (in1 - 0)/1; - input2 = (in2 - 0)/1; - switch(index) { - case 0: - return ((neuron0xa9de248()*1)+0); - default: - return 0.; - } -} - -double Test_Side_1500::neuron0xa9ddce8() { - return input0; -} - -double Test_Side_1500::neuron0xa9dde78() { - return input1; -} - -double Test_Side_1500::neuron0xa9de050() { - return input2; -} - -double Test_Side_1500::input0xa9de368() { - double input = -0.395752; - input += synapse0xa9e2b18(); - input += synapse0xa9de4f8(); - input += synapse0xa9de520(); - return input; -} - -double Test_Side_1500::neuron0xa9de368() { - double input = input0xa9de368(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9de548() { - double input = 0.123288; - input += synapse0xa9de720(); - input += synapse0xa9de748(); - input += synapse0xa9de770(); - return input; -} - -double Test_Side_1500::neuron0xa9de548() { - double input = input0xa9de548(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9de798() { - double input = -0.0932859; - input += synapse0xa9de970(); - input += synapse0xa9de998(); - input += synapse0xa9de9c0(); - return input; -} - -double Test_Side_1500::neuron0xa9de798() { - double input = input0xa9de798(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9de9e8() { - double input = 4.13841; - input += synapse0xa9debe0(); - input += synapse0xa9dec08(); - input += synapse0xa9dec30(); - return input; -} - -double Test_Side_1500::neuron0xa9de9e8() { - double input = input0xa9de9e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9dec58() { - double input = 10.0738; - input += synapse0xa9dee50(); - input += synapse0xa9dee78(); - input += synapse0xa9deea0(); - return input; -} - -double Test_Side_1500::neuron0xa9dec58() { - double input = input0xa9dec58(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9deec8() { - double input = 5.63011; - input += synapse0xa9df0c0(); - input += synapse0xa9df0e8(); - input += synapse0xa9df198(); - return input; -} - -double Test_Side_1500::neuron0xa9deec8() { - double input = input0xa9deec8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9df1c0() { - double input = 5.97351; - input += synapse0xa9df370(); - input += synapse0xa9df398(); - input += synapse0xa9df3c0(); - return input; -} - -double Test_Side_1500::neuron0xa9df1c0() { - double input = input0xa9df1c0(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9df3e8() { - double input = -0.708511; - input += synapse0xa9df5e0(); - input += synapse0xa9df608(); - input += synapse0xa9df630(); - return input; -} - -double Test_Side_1500::neuron0xa9df3e8() { - double input = input0xa9df3e8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9df658() { - double input = -0.109748; - input += synapse0xa9df850(); - input += synapse0xa9df878(); - input += synapse0xa9df8a0(); - return input; -} - -double Test_Side_1500::neuron0xa9df658() { - double input = input0xa9df658(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9df8c8() { - double input = 0.189699; - input += synapse0xa9dfac0(); - input += synapse0xa9dfae8(); - input += synapse0xa9dfb10(); - return input; -} - -double Test_Side_1500::neuron0xa9df8c8() { - double input = input0xa9df8c8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9dfb38() { - double input = 0.640774; - input += synapse0xa9dfd38(); - input += synapse0xa9dfd60(); - input += synapse0xa9dfd88(); - return input; -} - -double Test_Side_1500::neuron0xa9dfb38() { - double input = input0xa9dfb38(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9dfeb8() { - double input = 5.85528; - input += synapse0xa9e00b8(); - input += synapse0xa9e00e0(); - input += synapse0xa9e0108(); - return input; -} - -double Test_Side_1500::neuron0xa9dfeb8() { - double input = input0xa9dfeb8(); - return ((1/(1+exp(-input))) * 1)+0; -} - -double Test_Side_1500::input0xa9de248() { - double input = -2.67668; - input += synapse0xa9e01c0(); - input += synapse0xa9e01e8(); - input += synapse0xa9e0210(); - input += synapse0xa9e0238(); - input += synapse0xa9e0260(); - input += synapse0xa9e0288(); - input += synapse0xa9e02b0(); - input += synapse0xa9e02d8(); - input += synapse0xa9e0300(); - input += synapse0xa9e0328(); - input += synapse0xa9e0350(); - input += synapse0xa9e0378(); - return input; -} - -double Test_Side_1500::neuron0xa9de248() { - double input = input0xa9de248(); - return (input * 1)+0; -} - -double Test_Side_1500::synapse0xa9e2b18() { - return (neuron0xa9ddce8()*-0.569663); -} - -double Test_Side_1500::synapse0xa9de4f8() { - return (neuron0xa9dde78()*0.478153); -} - -double Test_Side_1500::synapse0xa9de520() { - return (neuron0xa9de050()*1.93914); -} - -double Test_Side_1500::synapse0xa9de720() { - return (neuron0xa9ddce8()*0.0391599); -} - -double Test_Side_1500::synapse0xa9de748() { - return (neuron0xa9dde78()*-0.266515); -} - -double Test_Side_1500::synapse0xa9de770() { - return (neuron0xa9de050()*1.08551); -} - -double Test_Side_1500::synapse0xa9de970() { - return (neuron0xa9ddce8()*0.803313); -} - -double Test_Side_1500::synapse0xa9de998() { - return (neuron0xa9dde78()*0.576498); -} - -double Test_Side_1500::synapse0xa9de9c0() { - return (neuron0xa9de050()*0.128775); -} - -double Test_Side_1500::synapse0xa9debe0() { - return (neuron0xa9ddce8()*4.01828); -} - -double Test_Side_1500::synapse0xa9dec08() { - return (neuron0xa9dde78()*-0.192983); -} - -double Test_Side_1500::synapse0xa9dec30() { - return (neuron0xa9de050()*9.71096); -} - -double Test_Side_1500::synapse0xa9dee50() { - return (neuron0xa9ddce8()*0.130542); -} - -double Test_Side_1500::synapse0xa9dee78() { - return (neuron0xa9dde78()*0.0180835); -} - -double Test_Side_1500::synapse0xa9deea0() { - return (neuron0xa9de050()*-11.3045); -} - -double Test_Side_1500::synapse0xa9df0c0() { - return (neuron0xa9ddce8()*3.52456); -} - -double Test_Side_1500::synapse0xa9df0e8() { - return (neuron0xa9dde78()*-0.194451); -} - -double Test_Side_1500::synapse0xa9df198() { - return (neuron0xa9de050()*6.59806); -} - -double Test_Side_1500::synapse0xa9df370() { - return (neuron0xa9ddce8()*0.0455052); -} - -double Test_Side_1500::synapse0xa9df398() { - return (neuron0xa9dde78()*-0.269476); -} - -double Test_Side_1500::synapse0xa9df3c0() { - return (neuron0xa9de050()*-5.55112); -} - -double Test_Side_1500::synapse0xa9df5e0() { - return (neuron0xa9ddce8()*-0.233442); -} - -double Test_Side_1500::synapse0xa9df608() { - return (neuron0xa9dde78()*0.0123811); -} - -double Test_Side_1500::synapse0xa9df630() { - return (neuron0xa9de050()*0.680141); -} - -double Test_Side_1500::synapse0xa9df850() { - return (neuron0xa9ddce8()*-0.134326); -} - -double Test_Side_1500::synapse0xa9df878() { - return (neuron0xa9dde78()*-0.0541828); -} - -double Test_Side_1500::synapse0xa9df8a0() { - return (neuron0xa9de050()*0.504204); -} - -double Test_Side_1500::synapse0xa9dfac0() { - return (neuron0xa9ddce8()*-0.0972752); -} - -double Test_Side_1500::synapse0xa9dfae8() { - return (neuron0xa9dde78()*-0.111198); -} - -double Test_Side_1500::synapse0xa9dfb10() { - return (neuron0xa9de050()*-1.766); -} - -double Test_Side_1500::synapse0xa9dfd38() { - return (neuron0xa9ddce8()*0.858686); -} - -double Test_Side_1500::synapse0xa9dfd60() { - return (neuron0xa9dde78()*-0.308873); -} - -double Test_Side_1500::synapse0xa9dfd88() { - return (neuron0xa9de050()*0.193227); -} - -double Test_Side_1500::synapse0xa9e00b8() { - return (neuron0xa9ddce8()*-0.117526); -} - -double Test_Side_1500::synapse0xa9e00e0() { - return (neuron0xa9dde78()*0.225148); -} - -double Test_Side_1500::synapse0xa9e0108() { - return (neuron0xa9de050()*-5.90925); -} - -double Test_Side_1500::synapse0xa9e01c0() { - return (neuron0xa9de368()*-0.977624); -} - -double Test_Side_1500::synapse0xa9e01e8() { - return (neuron0xa9de548()*-2.70834); -} - -double Test_Side_1500::synapse0xa9e0210() { - return (neuron0xa9de798()*0.188397); -} - -double Test_Side_1500::synapse0xa9e0238() { - return (neuron0xa9de9e8()*-2.69945); -} - -double Test_Side_1500::synapse0xa9e0260() { - return (neuron0xa9dec58()*-6.91854); -} - -double Test_Side_1500::synapse0xa9e0288() { - return (neuron0xa9deec8()*2.95758); -} - -double Test_Side_1500::synapse0xa9e02b0() { - return (neuron0xa9df1c0()*6.93083); -} - -double Test_Side_1500::synapse0xa9e02d8() { - return (neuron0xa9df3e8()*-1.59696); -} - -double Test_Side_1500::synapse0xa9e0300() { - return (neuron0xa9df658()*-1.4824); -} - -double Test_Side_1500::synapse0xa9e0328() { - return (neuron0xa9df8c8()*1.27217); -} - -double Test_Side_1500::synapse0xa9e0350() { - return (neuron0xa9dfb38()*0.506543); -} - -double Test_Side_1500::synapse0xa9e0378() { - return (neuron0xa9dfeb8()*7.14613); -} - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Side_1500.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Side_1500.h deleted file mode 100644 index fba2288a93b06..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/Test_Side_1500.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef Test_Side_1500_h -#define Test_Side_1500_h - -class Test_Side_1500 { -public: - Test_Side_1500() {} - ~Test_Side_1500() {} - double value(int index,double in0,double in1,double in2); -private: - double input0; - double input1; - double input2; - double neuron0xa9ddce8(); - double neuron0xa9dde78(); - double neuron0xa9de050(); - double input0xa9de368(); - double neuron0xa9de368(); - double input0xa9de548(); - double neuron0xa9de548(); - double input0xa9de798(); - double neuron0xa9de798(); - double input0xa9de9e8(); - double neuron0xa9de9e8(); - double input0xa9dec58(); - double neuron0xa9dec58(); - double input0xa9deec8(); - double neuron0xa9deec8(); - double input0xa9df1c0(); - double neuron0xa9df1c0(); - double input0xa9df3e8(); - double neuron0xa9df3e8(); - double input0xa9df658(); - double neuron0xa9df658(); - double input0xa9df8c8(); - double neuron0xa9df8c8(); - double input0xa9dfb38(); - double neuron0xa9dfb38(); - double input0xa9dfeb8(); - double neuron0xa9dfeb8(); - double input0xa9de248(); - double neuron0xa9de248(); - double synapse0xa9e2b18(); - double synapse0xa9de4f8(); - double synapse0xa9de520(); - double synapse0xa9de720(); - double synapse0xa9de748(); - double synapse0xa9de770(); - double synapse0xa9de970(); - double synapse0xa9de998(); - double synapse0xa9de9c0(); - double synapse0xa9debe0(); - double synapse0xa9dec08(); - double synapse0xa9dec30(); - double synapse0xa9dee50(); - double synapse0xa9dee78(); - double synapse0xa9deea0(); - double synapse0xa9df0c0(); - double synapse0xa9df0e8(); - double synapse0xa9df198(); - double synapse0xa9df370(); - double synapse0xa9df398(); - double synapse0xa9df3c0(); - double synapse0xa9df5e0(); - double synapse0xa9df608(); - double synapse0xa9df630(); - double synapse0xa9df850(); - double synapse0xa9df878(); - double synapse0xa9df8a0(); - double synapse0xa9dfac0(); - double synapse0xa9dfae8(); - double synapse0xa9dfb10(); - double synapse0xa9dfd38(); - double synapse0xa9dfd60(); - double synapse0xa9dfd88(); - double synapse0xa9e00b8(); - double synapse0xa9e00e0(); - double synapse0xa9e0108(); - double synapse0xa9e01c0(); - double synapse0xa9e01e8(); - double synapse0xa9e0210(); - double synapse0xa9e0238(); - double synapse0xa9e0260(); - double synapse0xa9e0288(); - double synapse0xa9e02b0(); - double synapse0xa9e02d8(); - double synapse0xa9e0300(); - double synapse0xa9e0328(); - double synapse0xa9e0350(); - double synapse0xa9e0378(); -}; - -#endif // Test_Side_1500_h - diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalCrystalMatrixProbality.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalCrystalMatrixProbality.cc new file mode 100644 index 0000000000000..e18fb543728b9 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalCrystalMatrixProbality.cc @@ -0,0 +1,117 @@ +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalCrystalMatrixProbality.h" + +#include "DataFormats/EcalDetId/interface/EBDetId.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" + +template <> +double EcalCrystalMatrixProbality::Central(double x) { + double vEBCentral = 0.0 ; + + if ( x <= 0.180 ) { vEBCentral = 0.0 ; } + else if ( 0.180 < x && x <= 0.300 ) { vEBCentral = ( -3267.97+53882*x-298536*x*x+555872*x*x*x)/2.19773067484200601e+03 ; } + else if ( 0.300 < x && x <= 0.450 ) { vEBCentral = ( -35768.3+ 307852*x -892325*x*x +914708*x*x*x)/2.19773067484200601e+03 ; } + else if ( 0.450 < x && x <= 0.780 ) { vEBCentral = ( 28483 -113912*x +184167*x*x -99781.8*x*x*x)/2.19773067484200601e+03 ; } + else if ( 0.780 < x && x <= 0.845 ) { vEBCentral = ( -2.49877e+07 + 9.18933e+07*x -1.12504e+08*x*x + 4.58581e+07*x*x*x)/2.19773067484200601e+03 ; } + else if ( 0.845 < x ) { vEBCentral = 0.0 ; } + else { vEBCentral = 0.0 ; } + + return vEBCentral ; +} + +template <> +double EcalCrystalMatrixProbality::Diagonal(double x){ + double vEBDiagonal = 0.0 ; + + if ( 0.000 < x && x <= 0.010 ) { vEBDiagonal = TMath::Landau(x,7.02750e-03,2.41060e-03,1)*3.96033283438174431e+03/4.39962923475768821e+03 ; } + else if ( 0.010 < x && x <= 0.100 ) { vEBDiagonal = TMath::Landau(x,1.70472e-03,2.47564e-03,1)*8.34898553737588554e+03/4.39962923475768821e+03 ; } + else if ( 0.100 < x && x <= 0.350 ) { vEBDiagonal = (18206.7-326578*x+2.44528e+06*x*x-9.27532e+06*x*x*x+ 1.75264e+07*x*x*x*x-1.30949e+07*x*x*x*x*x)/4.39962923475768821e+03 ; } + else if ( 0.350 < x ) { vEBDiagonal = 0.0 ; } + else { vEBDiagonal = 0.0 ; } + + return vEBDiagonal ; +} + +template <> +double EcalCrystalMatrixProbality::UpDown(double x){ + double vEBUpDown = 0.0 ; + + if ( 0.000 < x && x <= 0.005 ) { vEBUpDown = (28.5332-35350*x+4.28566e+07*x*x-2.02038e+10*x*x*x+ 3.56185e+12*x*x*x*x)/2.20315994559946967e+03 ; } + else if ( 0.005 < x && x <= 0.015 ) { vEBUpDown = TMath::Landau(x, 1.51342e-02, 3.65756e-03,1)*7.04501225670452641e+02/2.20315994559946967e+03 ; } + else if ( 0.015 < x && x <= 0.020 ) { vEBUpDown = TMath::Landau(x, 1.52460e-02, 5.04539e-03 ,1)*9.70980301933632518e+02/2.20315994559946967e+03 ; } + else if ( 0.020 < x && x <= 0.100 ) { vEBUpDown = (62436.8-2.52677e+06*x+4.92704e+07*x*x-4.95769e+08*x*x*x+ 2.48261e+09*x*x*x*x-4.89172e+09*x*x*x*x*x)/2.20315994559946967e+03 ; } + else if ( 0.100 < x && x <= 0.430 ) { vEBUpDown = ( 19976.7 - 265844*x+ 1.80629e+06*x*x -6.40378e+06*x*x*x+ 1.13017e+07*x*x*x*x -7.91581e+06*x*x*x*x*x)/2.20315994559946967e+03 ; } + else if ( 0.430 < x && x <= 0.453 ) { vEBUpDown = ( -3.78481e+06 +2.60128e+07*x -5.9519e+07*x*x +4.53408e+07*x*x*x)/2.20315994559946967e+03 ; } + else if ( 0.453 < x ) { vEBUpDown = 0.0 ; } + else { vEBUpDown = 0.0 ; } + + return vEBUpDown ; +} + +template <> +double EcalCrystalMatrixProbality::ReftRight(double x){ + double vEBReftRight = 0.0 ; + + if ( 0.000 < x && x <= 0.003 ) { vEBReftRight = (102.682+457094*x-4.34553e+08*x*x+2.59638e+11*x*x*x)/2.19081589410447168e+03 ; } + else if ( 0.003 < x && x <= 0.010 ) { vEBReftRight = TMath::Landau(x, 9.56298e-03, 2.59171e-03,1)*1.27769617491053555e+03/2.19081589410447168e+03 ; } + else if ( 0.010 < x && x <= 0.070 ) { vEBReftRight = TMath::Landau(x, -1.11570e-02 , 9.08308e-04 ,1)*3.58026004645168359e+04/2.19081589410447168e+03 ; } + else if ( 0.070 < x && x <= 0.400 ) { vEBReftRight = ( 15362.5 -230546*x +1.57249e+06*x*x -5.47903e+06*x*x*x+9.4296e+06*x*x*x*x -6.3775e+06*x*x*x*x*x)/2.19081589410447168e+03 ; } + else if ( 0.400 < x && x <= 0.440 ) { vEBReftRight = (2.3163882e+06-2.2437252e+07*x+8.1519104e+07*x*x-1.3162869e+08*x*x*x+7.9682168e+07*x*x*x*x)/2.19081589410447168e+03 ; } + else if ( 0.440 < x ) { vEBReftRight = 0.0 ; } + else { vEBReftRight = 0.0 ; } + + return vEBReftRight ; +} + + +template <> +double EcalCrystalMatrixProbality::Central(double x){ + double vEECentral = 0.0 ; + + if ( x <= 0.195 ) { vEECentral = 0.0 ; } + else if ( 0.195 < x && x <= 0.440 ) { vEECentral = (-30295.4+562760*x-4.04967e+06*x*x+1.40276e+07*x*x*x-2.33108e+07*x*x*x*x+1.50243e+07*x*x*x*x*x)/9.44506089594767786e+02 ; } + else if ( 0.440 < x && x <= 0.840 ) { vEECentral = (-34683.3+274011*x-749408*x*x+895482*x*x*x-396108*x*x*x*x)/9.44506089594767786e+02 ; } + else if ( 0.840 < x && x <= 0.875 ) { vEECentral = (4.7355575e+06-1.6268056e+07*x+1.8629316e+07*x*x-7.1113915e+06*x*x*x)/9.44506089594767786e+02 ; } + else if ( 0.875 < x ) { vEECentral = 0.0 ; } + else { vEECentral = 0.0 ; } + + return vEECentral ; +} + +template <> +double EcalCrystalMatrixProbality::Diagonal(double x){ + double vEEDiagonal = 0.0 ; + + if ( 0.000 < x && x <= 0.015 ) { vEEDiagonal = TMath::Landau(x,8.25505e-03,3.10387e-03,1)*1.68601977536835489e+03/1.86234137068993937e+03 ; } + else if ( 0.015 < x && x <= 0.150 ) { vEEDiagonal = TMath::Landau(x,-5.58560e-04,2.44735e-03,1)*4.88463235185936264e+03/1.86234137068993937e+03 ; } + else if ( 0.150 < x && x <= 0.400 ) { vEEDiagonal = (7416.66-114653*x+763877*x*x-2.57767e+06*x*x*x+4.28872e+06*x*x*x*x-2.79218e+06*x*x*x*x*x)/1.86234137068993937e+03 ; } + else if ( 0.400 < x ) { vEEDiagonal = 0.0 ; } + else { vEEDiagonal = 0.0 ; } + + return vEEDiagonal ; +} + +template <> +double EcalCrystalMatrixProbality::UpDown(double x){ + double vEEUpDown = 0.0 ; + + if ( 0.000 < x && x <= 0.015 ) { vEEUpDown = TMath::Landau(x,1.34809e-02,3.70278e-03,1)*8.62383670884733533e+02/1.88498009908992071e+03 ; } + else if ( 0.015 < x && x <= 0.100 ) { vEEUpDown = (75877.4-3.18767e+06*x+5.89073e+07*x*x-5.08829e+08*x*x*x+1.67247e+09*x*x*x*x)/1.88498009908992071e+03 ; } + else if ( 0.100 < x && x <= 0.450 ) { vEEUpDown = (12087-123704*x+566586*x*x-1.20111e+06*x*x*x+933789*x*x*x*x)/1.88498009908992071e+03 ; } + else if ( 0.450 < x ) { vEEUpDown = 0.0 ; } + else { vEEUpDown = 0.0 ; } + + return vEEUpDown ; +} + +template <> +double EcalCrystalMatrixProbality::ReftRight(double x){ + double vEEReftRight = 0.0 ; + + if ( 0.000 < x && x <= 0.015 ) { vEEReftRight = TMath::Landau(x,1.34809e-02,3.70278e-03,1)*8.62383670884733533e+02/1.88498009908992071e+03 ; } + else if ( 0.015 < x && x <= 0.100 ) { vEEReftRight = (75877.4-3.18767e+06*x+5.89073e+07*x*x-5.08829e+08*x*x*x+1.67247e+09*x*x*x*x)/1.88498009908992071e+03 ; } + else if ( 0.100 < x && x <= 0.450 ) { vEEReftRight = (12087-123704*x+566586*x*x-1.20111e+06*x*x*x+933789*x*x*x*x)/1.88498009908992071e+03 ; } + else if ( 0.450 < x ) { vEEReftRight = 0.0 ; } + else { vEEReftRight = 0.0 ; } + + return vEEReftRight ; +} diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryAlgos.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryAlgos.cc index 27930de024585..d35a2a249cb9b 100644 --- a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryAlgos.cc +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryAlgos.cc @@ -1,239 +1,41 @@ -// -*- C++ -*- // -// Package: EcalDeadChannelRecoveryAlgos -// Class: EcalDeadChannelRecoveryAlgos -// -/**\class EcalDeadChannelRecoveryAlgos EcalDeadChannelRecoveryAlgos.cc RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryAlgos.cc - - Description: - - Implementation: - -*/ +// Original Author: Stilianos Kesisoglou - Institute of Nuclear and Particle +// Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) +// Created: Wed Nov 21 11:24:39 EET 2012 // -// Original Author: Georgios Daskalakis -// Created: Thu Apr 12 17:02:06 CEST 2007 +// Nov 21 2012: First version of the code. Based on the old +// "EcalDeadChannelRecoveryAlgos.cc" code +// Feb 14 2013: Implementation of the criterion to select the "correct" +// max. cont. crystal. // -// May 4th 2007 S. Beauceron : modification of MakeNxNMatrice in order to use vectors -// - - - -// Geometry -#include "Geometry/Records/interface/IdealGeometryRecord.h" -#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" -#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" -#include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" -#include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h" -#include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" -//#include "Geometry/Vector/interface/GlobalPoint.h" - -// Reconstruction Classes -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" #include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h" -#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/CorrectDeadChannelsClassic.cc" -#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/CorrectDeadChannelsNN.cc" - -#include -using namespace cms; -using namespace std; - - -EcalDeadChannelRecoveryAlgos::EcalDeadChannelRecoveryAlgos(const CaloTopology * theCaloTopology) -//EcalDeadChannelRecoveryAlgos::EcalDeadChannelRecoveryAlgos(const edm::ESHandle & theCaloTopology) -{ - //now do what ever initialization is needed - calotopo = theCaloTopology; -} - - -EcalDeadChannelRecoveryAlgos::~EcalDeadChannelRecoveryAlgos() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - -// ------------ method called to for each event ------------ -EcalRecHit EcalDeadChannelRecoveryAlgos::correct(const EBDetId Id, const EcalRecHitCollection* hit_collection, std::string algo_, double Sum8Cut) -{ - double NewEnergy=0.0; - - double MNxN[121]; - int IndDeadChannel[1]={-1}; - - double sum8 = MakeNxNMatrice(Id,hit_collection,IndDeadChannel,MNxN); - - if(algo_=="Spline"){ - - if(sum8>Sum8Cut){ - if(IndDeadChannel[0]>0)NewEnergy = CorrectDeadChannelsClassic(MNxN,Id.ieta()); - } - }else if(algo_=="NeuralNetworks"){ - if(sum8>Sum8Cut){ - if(IndDeadChannel[0]>0)NewEnergy = CorrectDeadChannelsNN(MNxN); - } - } - - // protect against non physical high values - // < sum(energy in neighbours) > = 0.8 * xtal with maximum energy - // => can choose 5 as highest possible energy to be assigned to - // the dead channel - uint32_t flag = 0; - if ( NewEnergy > 5. * sum8 ) { - NewEnergy = 0; - //flag = EcalRecHit::kDead; - } +#include "FWCore/MessageLogger/interface/MessageLogger.h" - EcalRecHit NewHit(Id,NewEnergy,0, flag); - return NewHit; - -} - -// FIXME -- temporary backward compatibility -EcalRecHit EcalDeadChannelRecoveryAlgos::Correct(const EBDetId Id, const EcalRecHitCollection* hit_collection, std::string algo_, double Sum8Cut) -{ - return correct(Id, hit_collection, algo_, Sum8Cut); +template +void EcalDeadChannelRecoveryAlgos::setCaloTopology( + const CaloTopology *topo) { + nn.setCaloTopology(topo); } -//============================================================================================================== -//============================================================================================================== -//============================================================================================================== -//============================================================================================================== - - - -double EcalDeadChannelRecoveryAlgos::MakeNxNMatrice(EBDetId itID,const EcalRecHitCollection* hit_collection, int *IndDeadChannel, double *MNxN){ - - // std::cout<<" In MakeNxNMatrice "< NxNaroundMaxCont = topology->getWindow(EBCellMax,FixedSize,FixedSize); - - double ESUMis=0.0; - int theIndex=0; - - std::vector::const_iterator itCells; - for(itCells=NxNaroundMaxCont.begin();itCellsfind(EBitCell); - if( goS_it != hit_collection->end() ) Energy=goS_it->energy(); - } - - // std::cout<<"Around DC we have eta,phi,E "<0 )ietaCorr= -1; - if((CReta * EBCellMax.ieta()) < 0 && EBCellMax.ieta()<0 )ietaCorr= 1; - if((CReta * EBCellMax.ieta()) > 0 )ietaCorr= 0; - int ieta = -( (CReta -ietaCorr) - EBCellMax.ieta() ) + int((FixedSize - 1)/2); - - int iphiCorr = 0; - if((CRphi - EBCellMax.iphi())> 50)iphiCorr= 360; - if((CRphi - EBCellMax.iphi())<-50)iphiCorr=-360; - int iphi = CRphi - EBCellMax.iphi() - iphiCorr + int((FixedSize - 1)/2); - - int MIndex = ieta+iphi*FixedSize; - if(abs(CReta)<=85) - MNxN[MIndex]=Energy; - if(EBitCell == itID)IndDeadChannel[0]= MIndex; - - - //============ - - - - - //We add up the energy in 5x5 around the MaxCont to decide if we will correct for DCs - // if(theIndex>=36 && theIndex<=40)ESUMis += Energy; - //SB: Modify to sum8 only - if(theIndex>=48 && theIndex<=50)ESUMis += Energy; - if(theIndex>=59 && theIndex<=61)ESUMis += Energy; - if(theIndex>=70 && theIndex<=72)ESUMis += Energy; - // if(theIndex>=80 && theIndex<=84)ESUMis += Energy; - theIndex++; +template +EcalRecHit EcalDeadChannelRecoveryAlgos::correct( + const T id, const EcalRecHitCollection &hit_collection, std::string algo, + double Sum8Cut, bool *AcceptFlag) { + // recover as single dead channel + double NewEnergy = 0.0; + + if (algo == "NeuralNetworks") { + NewEnergy = this->nn.recover(id, hit_collection, Sum8Cut, AcceptFlag); + } else { + edm::LogError("EcalDeadChannelRecoveryAlgos") + << "Invalid algorithm for dead channel recovery."; + *AcceptFlag = false; } - // std::cout<<"Around MaxCont Collected Energy in 5x5 is = "<< ESUMis <; +template class EcalDeadChannelRecoveryAlgos; diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryNN.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryNN.cc new file mode 100644 index 0000000000000..e355c9e4c6e87 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/src/EcalDeadChannelRecoveryNN.cc @@ -0,0 +1,372 @@ +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryNN.h" +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalCrystalMatrixProbality.h" + +#include "FWCore/ParameterSet/interface/FileInPath.h" + +#include +#include + +template +EcalDeadChannelRecoveryNN::EcalDeadChannelRecoveryNN() { + for (int id = 0; id < 9; ++id) { + ctx_[id].mlp = NULL; + } + + this->load(); +} + +template +EcalDeadChannelRecoveryNN::~EcalDeadChannelRecoveryNN() { + for (int id = 0; id < 9; ++id) { + if (ctx_[id].mlp) { + // @TODO segfaults for an uknown reason + // delete ctx[id].mlp; + // delete ctx[id].tree; + } + } +} + +template <> +void EcalDeadChannelRecoveryNN::setCaloTopology(const CaloTopology *topo) +{ + topology_ = topo->getSubdetectorTopology(DetId::Ecal, EcalBarrel); +} + +template <> +void EcalDeadChannelRecoveryNN::setCaloTopology(const CaloTopology *topo) +{ + topology_ = topo->getSubdetectorTopology(DetId::Ecal, EcalEndcap); +} + +template +void EcalDeadChannelRecoveryNN::load_file(MultiLayerPerceptronContext& ctx, std::string fn) { + std::string path = edm::FileInPath(fn).fullPath(); + + TTree *t = new TTree("t", "dummy MLP tree"); + t->SetDirectory(0); + + t->Branch("z1", &(ctx.tmp[0]), "z1/D"); + t->Branch("z2", &(ctx.tmp[1]), "z2/D"); + t->Branch("z3", &(ctx.tmp[2]), "z3/D"); + t->Branch("z4", &(ctx.tmp[3]), "z4/D"); + t->Branch("z5", &(ctx.tmp[4]), "z5/D"); + t->Branch("z6", &(ctx.tmp[5]), "z6/D"); + t->Branch("z7", &(ctx.tmp[6]), "z7/D"); + t->Branch("z8", &(ctx.tmp[7]), "z8/D"); + t->Branch("zf", &(ctx.tmp[8]), "zf/D"); + + ctx.tree = t; + ctx.mlp = + new TMultiLayerPerceptron("@z1,@z2,@z3,@z4,@z5,@z6,@z7,@z8:10:5:zf", t); + ctx.mlp->LoadWeights(path.c_str()); +} + +template <> +void EcalDeadChannelRecoveryNN::load() { + std::string p = "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/data/NNWeights/"; + + this->load_file(ctx_[CellID::CC], p + "EB_ccNNWeights.txt"); + this->load_file(ctx_[CellID::RR], p + "EB_rrNNWeights.txt"); + this->load_file(ctx_[CellID::LL], p + "EB_llNNWeights.txt"); + this->load_file(ctx_[CellID::UU], p + "EB_uuNNWeights.txt"); + this->load_file(ctx_[CellID::DD], p + "EB_ddNNWeights.txt"); + this->load_file(ctx_[CellID::RU], p + "EB_ruNNWeights.txt"); + this->load_file(ctx_[CellID::RD], p + "EB_rdNNWeights.txt"); + this->load_file(ctx_[CellID::LU], p + "EB_luNNWeights.txt"); + this->load_file(ctx_[CellID::LD], p + "EB_ldNNWeights.txt"); +} + +template <> +void EcalDeadChannelRecoveryNN::load() { + std::string p = "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/data/NNWeights/"; + + this->load_file(ctx_[CellID::CC], p + "EE_ccNNWeights.txt"); + this->load_file(ctx_[CellID::RR], p + "EE_rrNNWeights.txt"); + this->load_file(ctx_[CellID::LL], p + "EE_llNNWeights.txt"); + this->load_file(ctx_[CellID::UU], p + "EE_uuNNWeights.txt"); + this->load_file(ctx_[CellID::DD], p + "EE_ddNNWeights.txt"); + this->load_file(ctx_[CellID::RU], p + "EE_ruNNWeights.txt"); + this->load_file(ctx_[CellID::RD], p + "EE_rdNNWeights.txt"); + this->load_file(ctx_[CellID::LU], p + "EE_luNNWeights.txt"); + this->load_file(ctx_[CellID::LD], p + "EE_ldNNWeights.txt"); +} + +template +double EcalDeadChannelRecoveryNN::recover(const T id, const EcalRecHitCollection& hit_collection, double Sum8Cut, bool *AcceptFlag) +{ + // use the correct probability matrix + typedef class EcalCrystalMatrixProbality P; + + double NewEnergy = 0.0; + + double NewEnergy_RelMC = 0.0; + double NewEnergy_RelDC = 0.0; + + double MNxN_RelMC[9] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ; + double MNxN_RelDC[9] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ; + + double sum8 = 0.0; + + double sum8_RelMC = makeNxNMatrice_RelMC(id, hit_collection, MNxN_RelMC,AcceptFlag); + double sum8_RelDC = makeNxNMatrice_RelDC(id, hit_collection, MNxN_RelDC,AcceptFlag); + + // Only if "AcceptFlag" is true call the ANN + if ( *AcceptFlag ) { + if (sum8_RelDC > Sum8Cut && sum8_RelMC > Sum8Cut) { + NewEnergy_RelMC = estimateEnergy(MNxN_RelMC); + NewEnergy_RelDC = estimateEnergy(MNxN_RelDC); + + // Matrices "MNxN_RelMC" and "MNxN_RelDC" have now the full set of energies, the original ones plus + // whatever "estimates" by the ANN for the "dead" xtal. Use those full matrices and calculate probabilities. + // + double SumMNxN_RelMC = MNxN_RelMC[LU] + MNxN_RelMC[UU] + MNxN_RelMC[RU] + + MNxN_RelMC[LL] + MNxN_RelMC[CC] + MNxN_RelMC[RR] + + MNxN_RelMC[LD] + MNxN_RelMC[DD] + MNxN_RelMC[RD] ; + + double frMNxN_RelMC[9]; for (int i=0; i<9; i++) { frMNxN_RelMC[i] = MNxN_RelMC[i] / SumMNxN_RelMC ; } + + double prMNxN_RelMC = P::Diagonal( frMNxN_RelMC[LU] ) * P::UpDown( frMNxN_RelMC[UU] ) * P::Diagonal( frMNxN_RelMC[RU] ) * + P::ReftRight( frMNxN_RelMC[LL] ) * P::Central( frMNxN_RelMC[CC] ) * P::ReftRight( frMNxN_RelMC[RR] ) * + P::Diagonal( frMNxN_RelMC[LD] ) * P::UpDown( frMNxN_RelMC[DD] ) * P::Diagonal( frMNxN_RelMC[RD] ) ; + + double SumMNxN_RelDC = MNxN_RelDC[LU] + MNxN_RelDC[UU] + MNxN_RelDC[RU] + + MNxN_RelDC[LL] + MNxN_RelDC[CC] + MNxN_RelDC[RR] + + MNxN_RelDC[LD] + MNxN_RelDC[DD] + MNxN_RelDC[RD] ; + + double frMNxN_RelDC[9]; for (int i=0; i<9; i++) { frMNxN_RelDC[i] = MNxN_RelDC[i] / SumMNxN_RelDC ; } + + double prMNxN_RelDC = P::Diagonal( frMNxN_RelDC[LU] ) * P::UpDown( frMNxN_RelDC[UU] ) * P::Diagonal( frMNxN_RelDC[RU] ) * + P::ReftRight( frMNxN_RelDC[LL] ) * P::Central( frMNxN_RelDC[CC] ) * P::ReftRight( frMNxN_RelDC[RR] ) * + P::Diagonal( frMNxN_RelDC[LD] ) * P::UpDown( frMNxN_RelDC[DD] ) * P::Diagonal( frMNxN_RelDC[RD] ) ; + + if ( prMNxN_RelDC > prMNxN_RelMC ) { NewEnergy = NewEnergy_RelDC ; sum8 = sum8_RelDC ; } + if ( prMNxN_RelDC <= prMNxN_RelMC ) { NewEnergy = NewEnergy_RelMC ; sum8 = sum8_RelMC ; } + + + // If the return value of "CorrectDeadChannelsNN" is one of the followin negative values then + // it corresponds to an error condition. See "CorrectDeadChannelsNN.cc" for possible values. + if ( NewEnergy == -1000000.0 || + NewEnergy == -1000001.0 || + NewEnergy == -2000000.0 || + NewEnergy == -3000000.0 || + NewEnergy == -3000001.0 ) { *AcceptFlag=false ; NewEnergy = 0.0 ; } + } + } + + // Protect against non physical high values + // From the distribution of (max.cont.xtal / Sum8) we get as limit 5 (hard) and 10 (softer) + // Choose 10 as highest possible energy to be assigned to the dead channel under any scenario. + if ( NewEnergy > 10.0 * sum8 ) { *AcceptFlag=false ; NewEnergy = 0.0 ; } + + return NewEnergy; +} + +template +double EcalDeadChannelRecoveryNN::estimateEnergy(double *M3x3Input, double epsilon) { + int missing[9]; + int missing_index = 0; + + for (int i = 0; i < 9; i++) { + if (TMath::Abs(M3x3Input[i]) < epsilon) { + missing[missing_index++] = i; + } else { + // Generally the "dead" cells are allowed to have negative energies (since they will be estimated by the ANN anyway). + // But all the remaining "live" ones must have positive values otherwise the logarithm fails. + + if (M3x3Input[i] < 0.0) { return -2000000.0; } + } + } + + // Currently EXACTLY ONE AND ONLY ONE dead cell is corrected. Return -1000000.0 if zero DC's detected and -101.0 if more than one DC's exist. + int idxDC = -1 ; + if (missing_index == 0) { return -1000000.0; } // Zero DC's were detected + if (missing_index > 1) { return -1000001.0; } // More than one DC's detected. + if (missing_index == 1) { idxDC = missing[0]; } + + // Arrange inputs into an array of 8, excluding the dead cell; + int input_order[9] = { CC, RR, LL, UU, DD, RU, RD, LU, LD }; + int input_index = 0; + Double_t input[8]; + + for (int id : input_order) { + if (id == idxDC) + continue; + + input[input_index++] = TMath::Log(M3x3Input[id]); + } + + // Select the case to apply the appropriate NN and return the result. + M3x3Input[idxDC] = TMath::Exp(ctx_[idxDC].mlp->Evaluate(0, input)); + return M3x3Input[idxDC]; +} + +template +double EcalDeadChannelRecoveryNN::makeNxNMatrice_RelMC(DetIdT itID, const EcalRecHitCollection& hit_collection, double *MNxN_RelMC, bool* AcceptFlag) { + // Since ANN corrects within a 3x3 window, the possible candidate 3x3 windows that contain + // the "dead" crystal form a 5x5 window around it (totaly eight 3x3 windows overlapping). + // Get this 5x5 and locate the Max.Contain.Crystal within. + + // Get the 5x5 window around the "dead" crystal -> vector "NxNaroundDC" + std::vector NxNaroundDC = topology_->getWindow(itID, 5, 5); + + DetIdT CellMax ; // Create a null DetId + double EnergyMax = 0.0; + + // Loop over all cells in the vector "NxNaroundDC", and for each cell find it's energy + // (from the EcalRecHits collection). Use this energy to detect the Max.Cont.Crystal. + std::vector::const_iterator theCells; + + for (theCells = NxNaroundDC.begin(); theCells != NxNaroundDC.end(); ++theCells) { + DetIdT cell = DetIdT(*theCells); + + if (! cell.null()) { + EcalRecHitCollection::const_iterator goS_it = hit_collection.find(cell); + + if ( goS_it != hit_collection.end() && goS_it->energy() >= EnergyMax ) { + EnergyMax = goS_it->energy(); + CellMax = cell; + } + } + } + + // No Max.Cont.Crystal found, return back with no changes. + if ( CellMax.null() ) { *AcceptFlag=false ; return 0.0 ; } + +#if 1 + // Not a smart check, because why not just get 4x4 matrix and have a guaranteed hit? + + // Check that the "dead" crystal belongs to the 3x3 around Max.Cont.Crystal + bool dcIn3x3 = false ; + + std::vector NxNaroundMaxCont = topology_->getWindow(CellMax,3,3); + std::vector::const_iterator testCell; + for (testCell = NxNaroundMaxCont.begin(); testCell != NxNaroundMaxCont.end(); ++testCell) { + if ( itID == DetIdT(*testCell) ) { dcIn3x3 = true ; } + } + + // If the "dead" crystal is outside the 3x3 then do nothing. + if (!dcIn3x3) { *AcceptFlag=false ; return 0.0 ; } +#endif + + return makeNxNMatrice_RelDC(CellMax, hit_collection, MNxN_RelMC, AcceptFlag); +} + +template <> +double EcalDeadChannelRecoveryNN::makeNxNMatrice_RelDC(EBDetId id, const EcalRecHitCollection& hit_collection, double *MNxN, bool* AcceptFlag) { + // Make an ANN 3x3 energy matrix around the crystal. + // If the "dead" crystal is at the EB boundary (+/- 85) do nothing since we need a full 3x3 around it. + if ( id.ieta() == 85 || id.ieta() == -85 ) { *AcceptFlag=false ; return 0.0 ; } + + // Define the ieta and iphi steps (zero, plus, minus) + int ietaZ = id.ieta() ; + int ietaP = ( ietaZ == -1 ) ? 1 : ietaZ + 1 ; + int ietaN = ( ietaZ == 1 ) ? -1 : ietaZ - 1 ; + + int iphiZ = id.iphi() ; + int iphiP = ( iphiZ == 360 ) ? 1 : iphiZ + 1 ; + int iphiN = ( iphiZ == 1 ) ? 360 : iphiZ - 1 ; + + for (int i=0; i<9; i++) { MNxN[i] = 0.0 ; } + + // Loop over all cells in the vector "window", and fill the MNxN matrix + // to be passed to the ANN for prediction. + std::vector window = topology_->getWindow(id, 3, 3); + + std::vector::const_iterator itCells; + for (itCells = window.begin(); itCells != window.end(); ++itCells) { + EBDetId cell = EBDetId(*itCells); + + if (! cell.null()) { + EcalRecHitCollection::const_iterator goS_it = hit_collection.find(cell); + + if (goS_it != hit_collection.end()) { + double energy = goS_it->energy(); + + if ( cell.ieta() == ietaP && cell.iphi() == iphiP ) { MNxN[RU] = energy; } + else if ( cell.ieta() == ietaP && cell.iphi() == iphiZ ) { MNxN[RR] = energy; } + else if ( cell.ieta() == ietaP && cell.iphi() == iphiN ) { MNxN[RD] = energy; } + + else if ( cell.ieta() == ietaZ && cell.iphi() == iphiP ) { MNxN[UU] = energy; } + else if ( cell.ieta() == ietaZ && cell.iphi() == iphiZ ) { MNxN[CC] = energy; } + else if ( cell.ieta() == ietaZ && cell.iphi() == iphiN ) { MNxN[DD] = energy; } + + else if ( cell.ieta() == ietaN && cell.iphi() == iphiP ) { MNxN[LU] = energy; } + else if ( cell.ieta() == ietaN && cell.iphi() == iphiZ ) { MNxN[LL] = energy; } + else if ( cell.ieta() == ietaN && cell.iphi() == iphiN ) { MNxN[LD] = energy; } + + else { *AcceptFlag=false ; return 0.0 ;} + } + } + } + + // Get the sum of 8 + double ESUMis = 0.0 ; + for (int i=0; i<9; i++) { ESUMis = ESUMis + MNxN[i] ; } + + *AcceptFlag=true ; + return ESUMis; +} + +template <> +double EcalDeadChannelRecoveryNN::makeNxNMatrice_RelDC(EEDetId itID,const EcalRecHitCollection& hit_collection, double *MNxN, bool* AcceptFlag) { + // Make an ANN 3x3 energy matrix around the crystal. + // If the "dead" crystal is at the EB boundary (+/- 85) do nothing since we need a full 3x3 around it. + + // If the "dead" crystal is at the EE boundary (inner or outer ring) do nothing since we need a full 3x3 around it. + if ( EEDetId::isNextToRingBoundary(itID) ) { *AcceptFlag=false ; return 0.0 ; } + + // Define the ix and iy steps (zero, plus, minus) + int ixZ = itID.ix() ; + int ixP = ixZ + 1 ; + int ixN = ixZ - 1 ; + + int iyZ = itID.iy() ; + int iyP = iyZ + 1 ; + int iyN = iyZ - 1 ; + + for (int i=0; i<9; i++) { MNxN[i] = 0.0 ; } + + // Take the "dead" crystal as reference and get the 3x3 around it. + std::vector NxNaroundRefXtal = topology_->getWindow(itID,3,3); + + // Loop over all cells in the vector "NxNaroundRefXtal", and fill the MNxN matrix + // to be passed to the ANN for prediction. + std::vector::const_iterator itCells; + + for (itCells = NxNaroundRefXtal.begin(); itCells != NxNaroundRefXtal.end(); ++itCells) { + EEDetId cell = EEDetId(*itCells); + + if (!cell.null()) { + EcalRecHitCollection::const_iterator goS_it = hit_collection.find(cell); + + if ( goS_it != hit_collection.end() ) { + double energy = goS_it->energy(); + + if ( cell.ix() == ixP && cell.iy() == iyP ) { MNxN[RU] = energy; } + else if ( cell.ix() == ixP && cell.iy() == iyZ ) { MNxN[RR] = energy; } + else if ( cell.ix() == ixP && cell.iy() == iyN ) { MNxN[RD] = energy; } + + else if ( cell.ix() == ixZ && cell.iy() == iyP ) { MNxN[UU] = energy; } + else if ( cell.ix() == ixZ && cell.iy() == iyZ ) { MNxN[CC] = energy; } + else if ( cell.ix() == ixZ && cell.iy() == iyN ) { MNxN[DD] = energy; } + + else if ( cell.ix() == ixN && cell.iy() == iyP ) { MNxN[LU] = energy; } + else if ( cell.ix() == ixN && cell.iy() == iyZ ) { MNxN[LL] = energy; } + else if ( cell.ix() == ixN && cell.iy() == iyN ) { MNxN[LD] = energy; } + + else { *AcceptFlag=false ; return 0.0 ;} + } + } + } + + // Get the sum of 8 + double ESUMis = 0.0 ; + for (int i=0; i<9; i++) { ESUMis = ESUMis + MNxN[i] ; } + + *AcceptFlag=true ; + return ESUMis; +} + + +template class EcalDeadChannelRecoveryNN; +template class EcalDeadChannelRecoveryNN; diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/BuildFile.xml b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/BuildFile.xml similarity index 60% rename from RecoLocalCalo/EcalDeadChannelRecoveryProducers/BuildFile.xml rename to RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/BuildFile.xml index 5746e39fb1f9b..01c4b327b628b 100644 --- a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/BuildFile.xml +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/BuildFile.xml @@ -5,4 +5,9 @@ - + + + + + + diff --git a/RecoCaloTools/EcalChannelKiller/test/DeadCells2448.txt b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/DeadCells2448.txt similarity index 100% rename from RecoCaloTools/EcalChannelKiller/test/DeadCells2448.txt rename to RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/DeadCells2448.txt diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/test/DeadCellsEach5.txt b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/EBDeadCellsEach5.txt similarity index 100% rename from RecoLocalCalo/EcalDeadChannelRecoveryProducers/test/DeadCellsEach5.txt rename to RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/EBDeadCellsEach5.txt diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/EEDeadCellsEach5.txt b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/EEDeadCellsEach5.txt new file mode 100644 index 0000000000000..559fc7045cef7 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/EEDeadCellsEach5.txt @@ -0,0 +1,441 @@ +0 0 -1 +0 5 1 +0 10 -1 +0 15 -1 +0 20 -1 +0 25 1 +0 30 -1 +0 35 1 +0 40 1 +0 45 -1 +0 50 1 +0 55 -1 +0 60 1 +0 65 -1 +0 70 -1 +0 75 -1 +0 80 1 +0 85 -1 +0 90 1 +0 95 -1 +0 100 1 +5 0 1 +5 5 1 +5 10 1 +5 15 -1 +5 20 -1 +5 25 1 +5 30 1 +5 35 1 +5 40 1 +5 45 -1 +5 50 1 +5 55 -1 +5 60 -1 +5 65 1 +5 70 1 +5 75 -1 +5 80 -1 +5 85 1 +5 90 -1 +5 95 -1 +5 100 -1 +10 0 -1 +10 5 -1 +10 10 -1 +10 15 1 +10 20 1 +10 25 -1 +10 30 -1 +10 35 -1 +10 40 -1 +10 45 -1 +10 50 -1 +10 55 1 +10 60 -1 +10 65 -1 +10 70 -1 +10 75 -1 +10 80 1 +10 85 -1 +10 90 -1 +10 95 1 +10 100 -1 +15 0 -1 +15 5 -1 +15 10 1 +15 15 1 +15 20 1 +15 25 -1 +15 30 -1 +15 35 -1 +15 40 1 +15 45 1 +15 50 1 +15 55 -1 +15 60 1 +15 65 1 +15 70 1 +15 75 1 +15 80 -1 +15 85 -1 +15 90 -1 +15 95 1 +15 100 1 +20 0 -1 +20 5 -1 +20 10 -1 +20 15 -1 +20 20 -1 +20 25 -1 +20 30 -1 +20 35 1 +20 40 -1 +20 45 1 +20 50 1 +20 55 1 +20 60 -1 +20 65 1 +20 70 1 +20 75 -1 +20 80 -1 +20 85 1 +20 90 -1 +20 95 1 +20 100 1 +25 0 -1 +25 5 1 +25 10 1 +25 15 -1 +25 20 -1 +25 25 -1 +25 30 -1 +25 35 -1 +25 40 -1 +25 45 -1 +25 50 1 +25 55 1 +25 60 -1 +25 65 1 +25 70 1 +25 75 1 +25 80 1 +25 85 -1 +25 90 -1 +25 95 -1 +25 100 -1 +30 0 1 +30 5 -1 +30 10 1 +30 15 1 +30 20 -1 +30 25 1 +30 30 -1 +30 35 -1 +30 40 -1 +30 45 -1 +30 50 -1 +30 55 -1 +30 60 -1 +30 65 -1 +30 70 -1 +30 75 -1 +30 80 -1 +30 85 1 +30 90 -1 +30 95 -1 +30 100 1 +35 0 -1 +35 5 -1 +35 10 1 +35 15 1 +35 20 -1 +35 25 -1 +35 30 -1 +35 35 1 +35 40 -1 +35 45 -1 +35 50 -1 +35 55 -1 +35 60 -1 +35 65 1 +35 70 1 +35 75 -1 +35 80 1 +35 85 1 +35 90 1 +35 95 1 +35 100 1 +40 0 -1 +40 5 -1 +40 10 1 +40 15 -1 +40 20 -1 +40 25 -1 +40 30 1 +40 35 -1 +40 40 -1 +40 45 -1 +40 50 1 +40 55 1 +40 60 1 +40 65 1 +40 70 -1 +40 75 -1 +40 80 1 +40 85 -1 +40 90 -1 +40 95 1 +40 100 -1 +45 0 -1 +45 5 1 +45 10 1 +45 15 -1 +45 20 1 +45 25 1 +45 30 -1 +45 35 -1 +45 40 -1 +45 45 1 +45 50 -1 +45 55 1 +45 60 1 +45 65 -1 +45 70 1 +45 75 -1 +45 80 -1 +45 85 1 +45 90 1 +45 95 1 +45 100 1 +50 0 1 +50 5 -1 +50 10 1 +50 15 -1 +50 20 -1 +50 25 1 +50 30 1 +50 35 1 +50 40 1 +50 45 -1 +50 50 -1 +50 55 1 +50 60 -1 +50 65 1 +50 70 1 +50 75 1 +50 80 1 +50 85 1 +50 90 1 +50 95 1 +50 100 1 +55 0 1 +55 5 1 +55 10 1 +55 15 -1 +55 20 1 +55 25 -1 +55 30 -1 +55 35 1 +55 40 1 +55 45 1 +55 50 -1 +55 55 1 +55 60 1 +55 65 1 +55 70 1 +55 75 -1 +55 80 -1 +55 85 -1 +55 90 1 +55 95 -1 +55 100 -1 +60 0 1 +60 5 1 +60 10 -1 +60 15 -1 +60 20 1 +60 25 1 +60 30 -1 +60 35 1 +60 40 1 +60 45 1 +60 50 -1 +60 55 1 +60 60 -1 +60 65 1 +60 70 1 +60 75 -1 +60 80 -1 +60 85 -1 +60 90 -1 +60 95 1 +60 100 -1 +65 0 -1 +65 5 1 +65 10 1 +65 15 1 +65 20 1 +65 25 1 +65 30 1 +65 35 -1 +65 40 -1 +65 45 -1 +65 50 -1 +65 55 1 +65 60 1 +65 65 1 +65 70 1 +65 75 1 +65 80 1 +65 85 1 +65 90 1 +65 95 1 +65 100 -1 +70 0 -1 +70 5 1 +70 10 1 +70 15 1 +70 20 -1 +70 25 1 +70 30 1 +70 35 -1 +70 40 1 +70 45 -1 +70 50 -1 +70 55 1 +70 60 -1 +70 65 -1 +70 70 -1 +70 75 -1 +70 80 -1 +70 85 -1 +70 90 1 +70 95 1 +70 100 -1 +75 0 -1 +75 5 1 +75 10 1 +75 15 -1 +75 20 -1 +75 25 -1 +75 30 -1 +75 35 -1 +75 40 -1 +75 45 1 +75 50 1 +75 55 1 +75 60 1 +75 65 1 +75 70 -1 +75 75 -1 +75 80 -1 +75 85 -1 +75 90 -1 +75 95 -1 +75 100 1 +80 0 1 +80 5 1 +80 10 1 +80 15 -1 +80 20 -1 +80 25 -1 +80 30 1 +80 35 1 +80 40 1 +80 45 -1 +80 50 1 +80 55 1 +80 60 1 +80 65 -1 +80 70 -1 +80 75 -1 +80 80 1 +80 85 1 +80 90 -1 +80 95 -1 +80 100 1 +85 0 -1 +85 5 1 +85 10 -1 +85 15 1 +85 20 1 +85 25 1 +85 30 -1 +85 35 -1 +85 40 -1 +85 45 1 +85 50 1 +85 55 1 +85 60 1 +85 65 1 +85 70 1 +85 75 1 +85 80 1 +85 85 1 +85 90 1 +85 95 1 +85 100 -1 +90 0 1 +90 5 -1 +90 10 -1 +90 15 -1 +90 20 -1 +90 25 -1 +90 30 -1 +90 35 -1 +90 40 -1 +90 45 -1 +90 50 1 +90 55 -1 +90 60 -1 +90 65 1 +90 70 -1 +90 75 -1 +90 80 -1 +90 85 1 +90 90 -1 +90 95 1 +90 100 1 +95 0 1 +95 5 1 +95 10 -1 +95 15 1 +95 20 1 +95 25 1 +95 30 -1 +95 35 1 +95 40 1 +95 45 -1 +95 50 -1 +95 55 1 +95 60 1 +95 65 1 +95 70 1 +95 75 1 +95 80 1 +95 85 1 +95 90 1 +95 95 -1 +95 100 -1 +100 0 1 +100 5 1 +100 10 -1 +100 15 1 +100 20 1 +100 25 -1 +100 30 1 +100 35 1 +100 40 -1 +100 45 1 +100 50 1 +100 55 1 +100 60 -1 +100 65 1 +100 70 -1 +100 75 1 +100 80 1 +100 85 -1 +100 90 -1 +100 95 1 +100 100 -1 diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/RecoAllKilledAndCorrected_001_cfg.py b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/RecoAllKilledAndCorrected_001_cfg.py new file mode 100644 index 0000000000000..47d74ab37f874 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/RecoAllKilledAndCorrected_001_cfg.py @@ -0,0 +1,96 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("DCRec") + +process.load("Configuration.StandardSequences.MagneticField_cff") +#process.load("Configuration.StandardSequences.Geometry_cff") # Depreciated +process.load("Configuration.Geometry.GeometryIdeal_cff") + +process.load("Configuration.EventContent.EventContent_cff") +process.load("Geometry.CaloEventSetup.CaloGeometry_cfi") +process.load("Geometry.CaloEventSetup.CaloTopology_cfi") + +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +process.GlobalTag.globaltag = cms.string('START53_V10::All') + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) + +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) + + +# ***************************************************************** +# Input Source +# ***************************************************************** +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( +# '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-RECO/STARTUP_V8_v1/0000/200EB7E3-90F3-DD11-B1B0-001D09F2432B.root', +# '/eos/cms/store/relval/CMSSW_5_3_4_cand1/RelValZEE/GEN-SIM-RECO/PU_START53_V10-v1/0003/22521942-41F7-E111-A383-003048D375AA.root', +# '/store/relval/CMSSW_5_3_4_cand1/RelValZEE/GEN-SIM-RECO/PU_START53_V10-v1/0003/22521942-41F7-E111-A383-003048D375AA.root', +# 'root://eoscms//eos/cms/store/relval/CMSSW_5_3_4_cand1/RelValZEE/GEN-SIM-RECO/PU_START53_V10-v1/0003/22521942-41F7-E111-A383-003048D375AA.root', + 'rfio:/afs/cern.ch/work/i/ikesisog/public/TestFiles/22521942-41F7-E111-A383-003048D375AA.root', + ) +) + + +# ***************************************************************** +# Output Target +# ***************************************************************** +process.out = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('Results.root'), + outputCommands = cms.untracked.vstring('keep *_*_*_DCRec','keep *_*_*_VALIDATION'), + #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring("p") ), +) + + +# ***************************************************************** +# RecHitsKiller and RecHitRecoveryProducer module for Barrel +# ***************************************************************** +process.CreateEBDeadCells = cms.EDProducer("EBChannelKiller", + hitProducer = cms.string("ecalRecHit"), + hitCollection = cms.string("EcalRecHitsEB"), + reducedHitCollection = cms.string("EcalRecHitsEB"), + KilledHitCollection = cms.string("KilledEcalRecHitsEB"), + DeadChannelsFile = cms.string("EBDeadCellsEach5.txt"), + KillDeadCells = cms.bool(True), +) + +process.ModCorrectEBDeadCells = cms.EDProducer("EBDeadChannelRecoveryProducers", + hitProducer = cms.string("CreateEBDeadCells"), + hitCollection = cms.string("EcalRecHitsEB"), + reducedHitCollection = cms.string("EcalRecHitsEB"), + DeadChannelsFile = cms.string("EBDeadCellsEach5.txt"), + Sum8GeVThreshold = cms.double(8.0), + CorrectionMethod = cms.string("NeuralNetworks"), + CorrectDeadCells = cms.bool(True), +) + + +# ***************************************************************** +# RecHitsKiller and RecHitRecoveryProducer module for EndCap +# ***************************************************************** +process.CreateEEDeadCells = cms.EDProducer("EEChannelKiller", + hitProducer = cms.string("ecalRecHit"), + hitCollection = cms.string("EcalRecHitsEE"), + reducedHitCollection = cms.string("EcalRecHitsEE"), + KilledHitCollection = cms.string("KilledEcalRecHitsEE"), + DeadChannelsFile = cms.string("EEDeadCellsEach5.txt"), + KillDeadCells = cms.bool(True), +) + +process.ModCorrectEEDeadCells = cms.EDProducer("EEDeadChannelRecoveryProducers", + hitProducer = cms.string("CreateEEDeadCells"), + hitCollection = cms.string("EcalRecHitsEE"), + reducedHitCollection = cms.string("EcalRecHitsEE"), + DeadChannelsFile = cms.string("EEDeadCellsEach5.txt"), + Sum8GeVThreshold = cms.double(8.0), + CorrectionMethod = cms.string("NeuralNetworks"), + CorrectDeadCells = cms.bool(True), +) + + +# ***************************************************************** +# Execution Path +# ***************************************************************** +process.p = cms.Path(process.CreateEBDeadCells * process.ModCorrectEBDeadCells + process.CreateEEDeadCells * process.ModCorrectEEDeadCells ) +process.outpath = cms.EndPath(process.out) + diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/RecoAllKilledAndCorrected_002_cfg.py b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/RecoAllKilledAndCorrected_002_cfg.py new file mode 100644 index 0000000000000..391c9001d8148 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/RecoAllKilledAndCorrected_002_cfg.py @@ -0,0 +1,130 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process("DCRec") + +process.load("Configuration.StandardSequences.MagneticField_cff") +#process.load("Configuration.StandardSequences.Geometry_cff") # Depreciated +process.load("Configuration.Geometry.GeometryIdeal_cff") + +process.load("Configuration.EventContent.EventContent_cff") +process.load("Geometry.CaloEventSetup.CaloGeometry_cfi") +process.load("Geometry.CaloEventSetup.CaloTopology_cfi") + +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") +#process.GlobalTag.globaltag = cms.string('START53_V10::All') +process.GlobalTag.globaltag = 'GR_P_V42_AN2::All' # this one for run2012D + +process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) +#process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) ) + +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) ) + + +# ***************************************************************** +# Input Source +# ***************************************************************** +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring( +# '/store/relval/CMSSW_2_2_4/RelValTTbar/GEN-SIM-RECO/STARTUP_V8_v1/0000/200EB7E3-90F3-DD11-B1B0-001D09F2432B.root', +# '/eos/cms/store/relval/CMSSW_5_3_4_cand1/RelValZEE/GEN-SIM-RECO/PU_START53_V10-v1/0003/22521942-41F7-E111-A383-003048D375AA.root', +# '/store/relval/CMSSW_5_3_4_cand1/RelValZEE/GEN-SIM-RECO/PU_START53_V10-v1/0003/22521942-41F7-E111-A383-003048D375AA.root', +# 'file:/afs/cern.ch/work/v/vgiakoum/public/8200EF9B-0AA0-E111-9E58-003048FFCB6A.root' +# 'file:/afs/cern.ch/work/i/ikesisog/public/TestFiles/8200EF9B-0AA0-E111-9E58-003048FFCB6A.root' + '/store/data/Run2012D/DoublePhotonHighPt/AOD/PromptReco-v1/000/203/994/30ABB9D1-790E-E211-AFF1-001D09F242EF.root', +# '/store/data/Run2012D/DoublePhotonHighPt/AOD/PromptReco-v1/000/203/994/3E8BBC89-620E-E211-9185-001D09F25479.root', +# '/store/data/Run2012D/DoublePhotonHighPt/AOD/PromptReco-v1/000/203/994/DC93F9B0-6B0E-E211-8F48-003048D37560.root', +# '/store/data/Run2012D/DoublePhotonHighPt/AOD/PromptReco-v1/000/203/994/FA29ECAC-640E-E211-A95F-001D09F28D54.root', +# 'root://eoscms//eos/cms/store/relval/CMSSW_5_3_4_cand1/RelValZEE/GEN-SIM-RECO/PU_START53_V10-v1/0003/22521942-41F7-E111-A383-003048D375AA.root', +# 'rfio:/afs/cern.ch/user/i/ikesisog/public/22521942-41F7-E111-A383-003048D375AA.root', + ) +) + + +# ***************************************************************** +# Output Target +# ***************************************************************** +process.out = cms.OutputModule("PoolOutputModule", + fileName = cms.untracked.string('Results_vic.root'), + outputCommands = cms.untracked.vstring('keep EcalRecHitsSorted_*_*_*'), + #SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring("p") ), +) + + +# ***************************************************************** +# RecHitsKiller and RecHitRecoveryProducer module for Barrel +# ***************************************************************** +process.CreateEBDeadCells = cms.EDProducer("EBChannelKiller", + hitProducer = cms.string("reducedEcalRecHitsEB"), + hitCollection = cms.string(""), + reducedHitCollection = cms.string("CreateEB"), + KilledHitCollection = cms.string("KilledEcalRecHitsEB"), + DeadChannelsFile = cms.string("EBDeadCellsEach5.txt"), + KillDeadCells = cms.bool(True), +) + +process.ModCorrectEBDeadCells = cms.EDProducer("EBDeadChannelRecoveryProducers", + hitProducer = cms.string("CreateEBDeadCells"), + hitCollection = cms.string("CreateEB"), + reducedHitCollection = cms.string("ModifyEB"), + DeadChannelsFile = cms.string("EBDeadCellsEach5.txt"), + Sum8GeVThreshold = cms.double(8.0), + CorrectionMethod = cms.string("NeuralNetworks"), + CorrectDeadCells = cms.bool(True), +) + + +# ***************************************************************** +# RecHitsKiller and RecHitRecoveryProducer module for EndCap +# ***************************************************************** +process.CreateEEDeadCells = cms.EDProducer("EEChannelKiller", + hitProducer = cms.string("reducedEcalRecHitsEE"), + hitCollection = cms.string(""), + reducedHitCollection = cms.string("CreateEE"), + KilledHitCollection = cms.string("KilledEcalRecHitsEE"), + DeadChannelsFile = cms.string("EEDeadCellsEach5.txt"), + KillDeadCells = cms.bool(True), +) + +process.ModCorrectEEDeadCells = cms.EDProducer("EEDeadChannelRecoveryProducers", + hitProducer = cms.string("CreateEEDeadCells"), + hitCollection = cms.string("CreateEE"), + reducedHitCollection = cms.string("ModifyEE"), + DeadChannelsFile = cms.string("EEDeadCellsEach5.txt"), + Sum8GeVThreshold = cms.double(8.0), + CorrectionMethod = cms.string("NeuralNetworks"), + CorrectDeadCells = cms.bool(True), +) + +process.TFileService = cms.Service("TFileService", fileName = cms.string('recovery_hist.root')) + +process.validateRecoveryEB = cms.EDAnalyzer("EcalDeadChannelRecoveryAnalyzer", + originalRecHitCollection = cms.InputTag("reducedEcalRecHitsEB", ""), + recoveredRecHitCollection = cms.InputTag("ModCorrectEBDeadCells", "ModifyEB"), + + titlePrefix = cms.string("(EB) "), +) + +process.validateRecoveryEE = cms.EDAnalyzer("EcalDeadChannelRecoveryAnalyzer", + originalRecHitCollection = cms.InputTag("reducedEcalRecHitsEE", ""), + recoveredRecHitCollection = cms.InputTag("ModCorrectEEDeadCells", "ModifyEE"), + + titlePrefix = cms.string("(EE) "), +) + + + +process.dump = cms.EDAnalyzer("EcalRecHitDump", + EBRecHitCollection = cms.InputTag("ModCorrectEBDeadCells", "ModifyEB"), + EERecHitCollection = cms.InputTag("ModCorrectEEDeadCells", "ModifyEE"), +) + + + +# ***************************************************************** +# Execution Path +# ***************************************************************** +process.p = cms.Path(process.CreateEBDeadCells * process.ModCorrectEBDeadCells * process.validateRecoveryEB + + process.CreateEEDeadCells * process.ModCorrectEEDeadCells * process.validateRecoveryEE ) + +process.outpath = cms.EndPath(process.out) + diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.cc new file mode 100644 index 0000000000000..008babac72e30 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.cc @@ -0,0 +1,160 @@ +// -*- C++ -*- +// +// Package: EcalChannelKiller +// Class: EBChannelKiller +// +/**\class EBChannelKiller EBChannelKiller.cc RecoCaloTools/EcalChannelKiller/src/EBChannelKiller.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) +// Created: Wed Nov 21 11:24:39 EET 2012 +// +// Nov 21 2012: First version of the code. Based on the old "EcalChannelKiller.cc" code +// + + +// Geometry +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" +#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" +#include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h" +#include "Geometry/CaloTopology/interface/EcalEndcapHardcodedTopology.h" + +// Reconstruction Classes +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EcalDetId/interface/EBDetId.h" + +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.h" + +#include +#include +using namespace cms; +using namespace std; + +// +// constructors and destructor +// +EBChannelKiller::EBChannelKiller(const edm::ParameterSet& ps) +{ + hitProducer_ = ps.getParameter("hitProducer"); + hitCollection_ = ps.getParameter("hitCollection"); + reducedHitCollection_ = ps.getParameter("reducedHitCollection"); + DeadChannelFileName_ = ps.getParameter("DeadChannelsFile"); + + produces< EcalRecHitCollection >(reducedHitCollection_); +} + + +EBChannelKiller::~EBChannelKiller() +{ + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +void +EBChannelKiller::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + // get the hit collection from the event: + edm::Handle rhcHandle; + iEvent.getByLabel(hitProducer_, hitCollection_, rhcHandle); + if (!(rhcHandle.isValid())) + { + // std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; + return; + } + const EcalRecHitCollection* hit_collection = rhcHandle.product(); + + int nRed = 0; + + // create an auto_ptr to a EcalRecHitCollection, copy the RecHits into it and put in the Event: + std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); + + for (EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { + + double NewEnergy = it->energy(); + bool ItIsDead = false; + + //Dead Cells are read from text files + std::vector::const_iterator DeadCell; + for (DeadCell = ChannelsDeadID.begin(); DeadCell != ChannelsDeadID.end(); ++DeadCell) { + if ( it->detid() == *DeadCell ) { + ItIsDead=true; + NewEnergy =0.; + nRed++; + // If a "dead" cell is detected add a corresponding recHit with zero energy. + // It perserves the total number of recHits and simulates the true "dead" cell situation. + EcalRecHit NewDeadHit(it->id(),NewEnergy,it->time()); + redCollection->push_back( NewDeadHit ); + } + }//End looping on vector of Dead Cells + + // Make a new RecHit + // + // TODO what will be the it->time() for D.C. ? + // Could we use it for "correction" identification? + // + if ( !ItIsDead ) { redCollection->push_back( *it ); } + } + + iEvent.put(redCollection, reducedHitCollection_); + +} + + + + +// ------------ method called once each job just before starting event loop ------------ +void +EBChannelKiller::beginJob() +{ + //Open the DeadChannel file, read it. + FILE* DeadCha; + printf("Dead Channels FILE: %s\n",DeadChannelFileName_.c_str()); + DeadCha = fopen(DeadChannelFileName_.c_str(),"r"); + + int fileStatus=0; + int ieta=-10000; + int iphi=-10000; + + while (fileStatus != EOF) { + + fileStatus = fscanf(DeadCha,"%d %d\n",&ieta,&iphi); + + // Problem reading Dead Channels file + if (ieta==-10000||iphi==-10000) { break; } + + if( EBDetId::validDetId(ieta,iphi) ) { + EBDetId cell(ieta,iphi); + ChannelsDeadID.push_back(cell); + } + + } //end while + + fclose(DeadCha); +} + + + +// ------------ method called once each job just after ending the event loop ------------ +void +EBChannelKiller::endJob() { +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EBChannelKiller); diff --git a/RecoCaloTools/EcalChannelKiller/interface/EcalChannelKiller.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.h similarity index 64% rename from RecoCaloTools/EcalChannelKiller/interface/EcalChannelKiller.h rename to RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.h index d2b6a3ca499bd..0b1b5939fc53a 100644 --- a/RecoCaloTools/EcalChannelKiller/interface/EcalChannelKiller.h +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBChannelKiller.h @@ -1,8 +1,11 @@ -#ifndef RecoCaloTools_EcalChannelKiller_EcalChannelKiller_HH -#define RecoCaloTools_EcalChannelKiller_EcalChannelKiller_HH +#ifndef RecoCaloTools_EcalChannelKiller_EBChannelKiller_HH +#define RecoCaloTools_EcalChannelKiller_EBChannelKiller_HH -/** \class EcalChannelKiller +/** \class EBChannelKiller * + * $Date: 2012/11/21 13:08:40 $ + * $Revision: 1.0 $ + * \author Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) */ // system include files @@ -25,10 +28,10 @@ // class decleration // -class EcalChannelKiller : public edm::EDProducer { +class EBChannelKiller : public edm::EDProducer { public: - explicit EcalChannelKiller(const edm::ParameterSet&); - ~EcalChannelKiller(); + explicit EBChannelKiller(const edm::ParameterSet&); + ~EBChannelKiller(); private: virtual void beginJob() ; diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.cc new file mode 100644 index 0000000000000..de26858c59f81 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.cc @@ -0,0 +1,170 @@ +// -*- C++ -*- +// +// Package: EcalDeadChannelRecoveryProducers +// Class: EBDeadChannelRecoveryProducers +// +/**\class EBDeadChannelRecoveryProducers EBDeadChannelRecoveryProducers.cc RecoLocalCalo/EcalDeadChannelRecoveryProducers/src/EBDeadChannelRecoveryProducers.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) +// Created: Wed Nov 21 11:24:39 EET 2012 +// +// Nov 21 2012: First version of the code. Based on the old "EcalDeadChannelRecoveryProducers.cc" code +// + + +// system include files +#include + +// Geometry +#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" + +// Reconstruction Classes +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EcalDetId/interface/EBDetId.h" + +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.h" + +#include +#include + +using namespace cms; +using namespace std; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +EBDeadChannelRecoveryProducers::EBDeadChannelRecoveryProducers(const edm::ParameterSet& ps) +{ + //now do what ever other initialization is needed + CorrectDeadCells_ = ps.getParameter("CorrectDeadCells"); + CorrectionMethod_ = ps.getParameter("CorrectionMethod"); + hitProducer_ = ps.getParameter("hitProducer"); + hitCollection_ = ps.getParameter("hitCollection"); + reducedHitCollection_ = ps.getParameter("reducedHitCollection"); + DeadChannelFileName_ = ps.getParameter("DeadChannelsFile"); + Sum8GeVThreshold_= ps.getParameter("Sum8GeVThreshold"); + + produces< EcalRecHitCollection >(reducedHitCollection_); +} + + +EBDeadChannelRecoveryProducers::~EBDeadChannelRecoveryProducers() +{ + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +void +EBDeadChannelRecoveryProducers::produce(edm::Event& evt, const edm::EventSetup& iSetup) +{ + using namespace edm; + + edm::ESHandle theCaloTopology; + iSetup.get().get(theCaloTopology); + + // get the hit collection from the event: + edm::Handle rhcHandle; + evt.getByLabel(hitProducer_, hitCollection_, rhcHandle); + if (!(rhcHandle.isValid())) + { + // std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; + return; + } + const EcalRecHitCollection* hit_collection = rhcHandle.product(); + + // create an auto_ptr to a EcalRecHitCollection, copy the RecHits into it and put it in the Event: + std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); + ebDeadChannelCorrector.setCaloTopology(theCaloTopology.product()); + + // + // Double loop over EcalRecHit collection and "dead" cell RecHits. + // If we step into a "dead" cell call "ebDeadChannelCorrector::correct()" + // + for (EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { + std::vector::const_iterator CheckDead = ChannelsDeadID.begin(); + bool OverADeadRecHit=false; + while ( CheckDead != ChannelsDeadID.end() ) { + if (it->detid()==*CheckDead) { + OverADeadRecHit=true; + bool AcceptRecHit=true; + EcalRecHit hit = ebDeadChannelCorrector.correct(it->detid(),*hit_collection,CorrectionMethod_,Sum8GeVThreshold_, &AcceptRecHit); + + if ( hit.energy() != 0 and AcceptRecHit == true ) { + hit.setFlag(EcalRecHit::kNeighboursRecovered) ; + } else { + // recovery failed + hit.setFlag(EcalRecHit::kDead) ; + } + + redCollection->push_back(hit); + break; + } + CheckDead++; + } + if (!OverADeadRecHit) { redCollection->push_back( *it ) ; } + } + + evt.put(redCollection, reducedHitCollection_); +} + + +// ------------ method called once each job just before starting event loop ------------ +void +EBDeadChannelRecoveryProducers::beginJob() +{ + //Open the DeadChannel file, read it. + FILE* DeadCha; + printf("Dead Channels FILE: %s\n",DeadChannelFileName_.c_str()); + DeadCha = fopen(DeadChannelFileName_.c_str(),"r"); + + int fileStatus=0; + int ieta=-10000; + int iphi=-10000; + + while (fileStatus != EOF) { + + fileStatus = fscanf(DeadCha,"%d %d\n",&ieta,&iphi); + + // Problem reading Dead Channels file + if (ieta==-10000||iphi==-10000) { break; } + + if( EBDetId::validDetId(ieta,iphi) ) { + EBDetId cell(ieta,iphi); + ChannelsDeadID.push_back(cell); + } + + } //end while + + fclose(DeadCha); +} + +// ------------ method called once each job just after ending the event loop ------------ +void +EBDeadChannelRecoveryProducers::endJob() { +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EBDeadChannelRecoveryProducers); diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.h new file mode 100644 index 0000000000000..d8370badf5d39 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EBDeadChannelRecoveryProducers.h @@ -0,0 +1,54 @@ +#ifndef RecoLocalCalo_EcalDeadChannelRecoveryProducers_EBDeadChannelRecoveryProducers_HH +#define RecoLocalCalo_EcalDeadChannelRecoveryProducers_EBDeadChannelRecoveryProducers_HH + +/** \class EBDeadChannelRecoveryProducers + * + * \author Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) + */ + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include + +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h" + +// +// class decleration +// + +class EBDeadChannelRecoveryProducers : public edm::EDProducer { + public: + explicit EBDeadChannelRecoveryProducers(const edm::ParameterSet&); + ~EBDeadChannelRecoveryProducers(); + + private: + virtual void beginJob() ; + virtual void produce(edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + + // ----------member data --------------------------- + + double Sum8GeVThreshold_; + std::string hitProducer_; + std::string hitCollection_; + std::string reducedHitCollection_; + std::string DeadChannelFileName_; + std::vector ChannelsDeadID; + bool CorrectDeadCells_; + std::string CorrectionMethod_; + + EcalDeadChannelRecoveryAlgos ebDeadChannelCorrector; +}; + + +#endif diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.cc new file mode 100644 index 0000000000000..4c83763cc97e0 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.cc @@ -0,0 +1,160 @@ +// -*- C++ -*- +// +// Package: EcalChannelKiller +// Class: EEChannelKiller +// +/**\class EEChannelKiller EEChannelKiller.cc RecoCaloTools/EcalChannelKiller/src/EEChannelKiller.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) +// Created: Wed Nov 21 11:24:39 EET 2012 +// +// Nov 21 2012: First version of the code. Based on the old "EcalChannelKiller.cc" code +// + + +// Geometry +#include "Geometry/Records/interface/IdealGeometryRecord.h" +#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" +#include "Geometry/CaloTopology/interface/EcalBarrelTopology.h" +#include "Geometry/CaloTopology/interface/EcalEndcapTopology.h" +#include "Geometry/CaloTopology/interface/EcalBarrelHardcodedTopology.h" +#include "Geometry/CaloTopology/interface/EcalEndcapHardcodedTopology.h" + +// Reconstruction Classes +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" + +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.h" + +#include +#include +using namespace cms; +using namespace std; + +// +// constructors and destructor +// +EEChannelKiller::EEChannelKiller(const edm::ParameterSet& ps) +{ + hitProducer_ = ps.getParameter("hitProducer"); + hitCollection_ = ps.getParameter("hitCollection"); + reducedHitCollection_ = ps.getParameter("reducedHitCollection"); + DeadChannelFileName_ = ps.getParameter("DeadChannelsFile"); + + produces< EcalRecHitCollection >(reducedHitCollection_); +} + + +EEChannelKiller::~EEChannelKiller() +{ + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +void +EEChannelKiller::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + // get the hit collection from the event: + edm::Handle rhcHandle; + iEvent.getByLabel(hitProducer_, hitCollection_, rhcHandle); + if (!(rhcHandle.isValid())) + { + // std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; + return; + } + const EcalRecHitCollection* hit_collection = rhcHandle.product(); + + int nRed = 0; + + // create an auto_ptr to a EcalRecHitCollection, copy the RecHits into it and put in the Event: + std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); + + for (EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { + + double NewEnergy = it->energy(); + bool ItIsDead = false; + + //Dead Cells are read from text files + std::vector::const_iterator DeadCell; + for (DeadCell = ChannelsDeadID.begin(); DeadCell != ChannelsDeadID.end(); ++DeadCell) { + if ( it->detid() == *DeadCell ) { + ItIsDead=true; + NewEnergy =0.; + nRed++; + // If a "dead" cell is detected add a corresponding recHit with zero energy. + // It perserves the total number of recHits and simulates the true "dead" cell situation. + EcalRecHit NewDeadHit(it->id(),NewEnergy,it->time()); + redCollection->push_back( NewDeadHit ); + } + }//End looping on vector of Dead Cells + + // Make a new RecHit + // + // TODO what will be the it->time() for D.C. ? + // Could we use it for "correction" identification? + // + if ( !ItIsDead ) { redCollection->push_back( *it ); } + } + + iEvent.put(redCollection, reducedHitCollection_); + +} + + + + +// ------------ method called once each job just before starting event loop ------------ +void +EEChannelKiller::beginJob() +{ + //Open the DeadChannel file, read it. + FILE* DeadCha; + printf("Dead Channels FILE: %s\n",DeadChannelFileName_.c_str()); + DeadCha = fopen(DeadChannelFileName_.c_str(),"r"); + + int fileStatus=0; + int ix=-10000; + int iy=-10000; + int iz=-10000; + while (fileStatus != EOF) { + + fileStatus = fscanf(DeadCha,"%d %d %d\n",&ix,&iy,&iz); + + // Problem reading Dead Channels file + if (ix==-10000||iy==-10000||iz==-10000) { break; } + + if( EEDetId::validDetId(ix,iy,iz) ) { + EEDetId cell(ix,iy,iz); + ChannelsDeadID.push_back(cell); + } + + } //end while + + fclose(DeadCha); +} + + + +// ------------ method called once each job just after ending the event loop ------------ +void +EEChannelKiller::endJob() { +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EEChannelKiller); diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/interface/EcalDeadChannelRecoveryProducers.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.h similarity index 59% rename from RecoLocalCalo/EcalDeadChannelRecoveryProducers/interface/EcalDeadChannelRecoveryProducers.h rename to RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.h index c691d23ec1e18..9c6aaab7293d3 100644 --- a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/interface/EcalDeadChannelRecoveryProducers.h +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEChannelKiller.h @@ -1,8 +1,11 @@ -#ifndef RecoLocalCalo_EcalDeadChannelRecoveryProducers_EcalDeadChannelRecoveryProducers_HH -#define RecoLocalCalo_EcalDeadChannelRecoveryProducers_EcalDeadChannelRecoveryProducers_HH +#ifndef RecoCaloTools_EcalChannelKiller_EEChannelKiller_HH +#define RecoCaloTools_EcalChannelKiller_EEChannelKiller_HH -/** \class EcalDeadChannelRecoveryProducers +/** \class EEChannelKiller * + * $Date: 2012/11/21 13:08:40 $ + * $Revision: 1.0 $ + * \author Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) */ // system include files @@ -25,10 +28,10 @@ // class decleration // -class EcalDeadChannelRecoveryProducers : public edm::EDProducer { +class EEChannelKiller : public edm::EDProducer { public: - explicit EcalDeadChannelRecoveryProducers(const edm::ParameterSet&); - ~EcalDeadChannelRecoveryProducers(); + explicit EEChannelKiller(const edm::ParameterSet&); + ~EEChannelKiller(); private: virtual void beginJob() ; @@ -36,16 +39,11 @@ class EcalDeadChannelRecoveryProducers : public edm::EDProducer { virtual void endJob() ; // ----------member data --------------------------- - - double Sum8GeVThreshold_; std::string hitProducer_; std::string hitCollection_; std::string reducedHitCollection_; std::string DeadChannelFileName_; - std::vector ChannelsDeadID; - bool CorrectDeadCells_; - std::string CorrectionMethod_; - + std::vector ChannelsDeadID; }; diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.cc new file mode 100644 index 0000000000000..21966b8ba062b --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.cc @@ -0,0 +1,170 @@ +// -*- C++ -*- +// +// Package: EcalDeadChannelRecoveryProducers +// Class: EEDeadChannelRecoveryProducers +// +/**\class EEDeadChannelRecoveryProducers EEDeadChannelRecoveryProducers.cc RecoLocalCalo/EcalDeadChannelRecoveryProducers/src/EEDeadChannelRecoveryProducers.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) +// Created: Wed Nov 21 11:24:39 EET 2012 +// +// Nov 21 2012: First version of the code. Based on the old "EcalDeadChannelRecoveryProducers.cc" code +// + + +// system include files +#include + +// Geometry +#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" +#include "Geometry/CaloGeometry/interface/CaloGeometry.h" +#include "Geometry/CaloTopology/interface/CaloTopology.h" + +// Reconstruction Classes +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" +#include "DataFormats/EcalDetId/interface/EEDetId.h" + +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.h" + +#include +#include + +using namespace cms; +using namespace std; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +EEDeadChannelRecoveryProducers::EEDeadChannelRecoveryProducers(const edm::ParameterSet& ps) +{ + //now do what ever other initialization is needed + CorrectDeadCells_ = ps.getParameter("CorrectDeadCells"); + CorrectionMethod_ = ps.getParameter("CorrectionMethod"); + hitProducer_ = ps.getParameter("hitProducer"); + hitCollection_ = ps.getParameter("hitCollection"); + reducedHitCollection_ = ps.getParameter("reducedHitCollection"); + DeadChannelFileName_ = ps.getParameter("DeadChannelsFile"); + Sum8GeVThreshold_= ps.getParameter("Sum8GeVThreshold"); + + produces< EcalRecHitCollection >(reducedHitCollection_); +} + + +EEDeadChannelRecoveryProducers::~EEDeadChannelRecoveryProducers() +{ + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) +} + + +// +// member functions +// + +// ------------ method called to produce the data ------------ +void +EEDeadChannelRecoveryProducers::produce(edm::Event& evt, const edm::EventSetup& iSetup) +{ + using namespace edm; + + edm::ESHandle theCaloTopology; + iSetup.get().get(theCaloTopology); + + // get the hit collection from the event: + edm::Handle rhcHandle; + evt.getByLabel(hitProducer_, hitCollection_, rhcHandle); + if (!(rhcHandle.isValid())) + { + // std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; + return; + } + const EcalRecHitCollection* hit_collection = rhcHandle.product(); + + // create an auto_ptr to a EcalRecHitCollection, copy the RecHits into it and put it in the Event: + std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); + eeDeadChannelCorrector.setCaloTopology(theCaloTopology.product()); + + // + // Double loop over EcalRecHit collection and "dead" cell RecHits. + // If we step into a "dead" cell call "eeDeadChannelCorrector::correct()" + // + for (EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { + std::vector::const_iterator CheckDead = ChannelsDeadID.begin(); + bool OverADeadRecHit=false; + while ( CheckDead != ChannelsDeadID.end() ) { + if (it->detid()==*CheckDead) { + OverADeadRecHit=true; + bool AcceptRecHit=true; + EcalRecHit hit = eeDeadChannelCorrector.correct(it->detid(),*hit_collection,CorrectionMethod_,Sum8GeVThreshold_, &AcceptRecHit); + + if ( hit.energy() != 0 and AcceptRecHit == true ) { + hit.setFlag(EcalRecHit::kNeighboursRecovered) ; + } else { + // recovery failed + hit.setFlag(EcalRecHit::kDead) ; + } + + redCollection->push_back(hit); + break; + } + CheckDead++; + } + if (!OverADeadRecHit) { redCollection->push_back( *it ) ; } + } + + evt.put(redCollection, reducedHitCollection_); +} + + +// ------------ method called once each job just before starting event loop ------------ +void +EEDeadChannelRecoveryProducers::beginJob() +{ + //Open the DeadChannel file, read it. + FILE* DeadCha; + printf("Dead Channels FILE: %s\n",DeadChannelFileName_.c_str()); + DeadCha = fopen(DeadChannelFileName_.c_str(),"r"); + + int fileStatus=0; + int ix=-10000; + int iy=-10000; + int iz=-10000; + while (fileStatus != EOF) { + + fileStatus = fscanf(DeadCha,"%d %d %d\n",&ix,&iy,&iz); + + // Problem reading Dead Channels file + if (ix==-10000||iy==-10000||iz==-10000) { break; } + + if ( EEDetId::validDetId(ix,iy,iz) ) { + EEDetId cell(ix,iy,iz); + ChannelsDeadID.push_back(cell); + } + + } //end while + + fclose(DeadCha); +} + +// ------------ method called once each job just after ending the event loop ------------ +void +EEDeadChannelRecoveryProducers::endJob() { +} + +//define this as a plug-in +DEFINE_FWK_MODULE(EEDeadChannelRecoveryProducers); diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.h b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.h new file mode 100644 index 0000000000000..33eed2ee2f08e --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EEDeadChannelRecoveryProducers.h @@ -0,0 +1,55 @@ +#ifndef RecoLocalCalo_EcalDeadChannelRecoveryProducers_EEDeadChannelRecoveryProducers_HH +#define RecoLocalCalo_EcalDeadChannelRecoveryProducers_EEDeadChannelRecoveryProducers_HH + +/** \class EEDeadChannelRecoveryProducers + * + * $Date: 2013/02/20 22:49:13 $ + * $Revision: 1.1 $ + * \author Stilianos Kesisoglou - Institute of Nuclear and Particle Physics NCSR Demokritos (Stilianos.Kesisoglou@cern.ch) + */ + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/ESHandle.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include + +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h" +// +// class decleration +// + +class EEDeadChannelRecoveryProducers : public edm::EDProducer { + public: + explicit EEDeadChannelRecoveryProducers(const edm::ParameterSet&); + ~EEDeadChannelRecoveryProducers(); + + private: + virtual void beginJob() ; + virtual void produce(edm::Event&, const edm::EventSetup&); + virtual void endJob() ; + + // ----------member data --------------------------- + + double Sum8GeVThreshold_; + std::string hitProducer_; + std::string hitCollection_; + std::string reducedHitCollection_; + std::string DeadChannelFileName_; + std::vector ChannelsDeadID; + bool CorrectDeadCells_; + std::string CorrectionMethod_; + + EcalDeadChannelRecoveryAlgos eeDeadChannelCorrector; +}; + + +#endif diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EcalDeadChannelRecoveryAnalyzer.cc b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EcalDeadChannelRecoveryAnalyzer.cc new file mode 100644 index 0000000000000..99d4d9ccb24d8 --- /dev/null +++ b/RecoLocalCalo/EcalDeadChannelRecoveryAlgos/test/plugins/EcalDeadChannelRecoveryAnalyzer.cc @@ -0,0 +1,94 @@ +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" + + +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" +#include "TH1.h" + +#include + +class EcalDeadChannelRecoveryAnalyzer: public edm::EDAnalyzer { + public: + explicit EcalDeadChannelRecoveryAnalyzer(const edm::ParameterSet&); + + private: + virtual void beginJob() {} + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob() {} + + private: + edm::EDGetTokenT originalRecHitCollectionT_; + edm::EDGetTokenT recoveredRecHitCollectionT_; + + TH1D *histoEnergies_; + TH1D *histoRecovery_; +}; + +EcalDeadChannelRecoveryAnalyzer::EcalDeadChannelRecoveryAnalyzer(const edm::ParameterSet& iConfig) { + originalRecHitCollectionT_ = + consumes(iConfig.getParameter("originalRecHitCollection")); + + recoveredRecHitCollectionT_ = + consumes(iConfig.getParameter("recoveredRecHitCollection")); + + std::string titlePrefix = iConfig.getParameter("titlePrefix"); + std::string title; + + edm::Service fs; + + title = titlePrefix + "Original energies."; + histoEnergies_ = fs->make("originalEnergies", title.c_str(), 256, 0 , 10); + + title = titlePrefix + "Recovered energies."; + histoRecovery_ = fs->make("recoveryEnergies", title.c_str(), 256, 0 , 10); +} + +void EcalDeadChannelRecoveryAnalyzer::analyze(const edm::Event& ev, + const edm::EventSetup&) { + + edm::Handle originalRecHits; + edm::Handle recoveredRecHits; + + ev.getByToken(originalRecHitCollectionT_, originalRecHits); + ev.getByToken(recoveredRecHitCollectionT_, recoveredRecHits); + + for (auto const& hit: *recoveredRecHits) { + EcalRecHit original = *(originalRecHits->find(hit.id())); + + if (hit.checkFlag(EcalRecHit::kDead)) { + // if it didn't change from the original, return + if (original.checkFlag(EcalRecHit::kDead)) + continue; + + // std::cout << "Failed to recover: " << hit << std::endl; + // std::cout << "Original: " << original << std::endl; + + histoEnergies_->Fill(original.energy()); + } + + if (hit.checkFlag(EcalRecHit::kNeighboursRecovered)) { + // if it didn't change from the original, return + if (original.checkFlag(EcalRecHit::kNeighboursRecovered)) + continue; + + // std::cout << "Recovered: " << hit << std::endl; + // std::cout << "Original: " << original << std::endl; + + histoEnergies_->Fill(original.energy()); + histoRecovery_->Fill(hit.energy()); + } + + + } +} + +DEFINE_FWK_MODULE(EcalDeadChannelRecoveryAnalyzer); diff --git a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/src/EcalDeadChannelRecoveryProducers.cc b/RecoLocalCalo/EcalDeadChannelRecoveryProducers/src/EcalDeadChannelRecoveryProducers.cc deleted file mode 100644 index 6ded3e0d6d856..0000000000000 --- a/RecoLocalCalo/EcalDeadChannelRecoveryProducers/src/EcalDeadChannelRecoveryProducers.cc +++ /dev/null @@ -1,171 +0,0 @@ -// -*- C++ -*- -// -// Package: EcalDeadChannelRecoveryProducers -// Class: EcalDeadChannelRecoveryProducers -// -/**\class EcalDeadChannelRecoveryProducers EcalDeadChannelRecoveryProducers.cc RecoLocalCalo/EcalDeadChannelRecoveryProducers/src/EcalDeadChannelRecoveryProducers.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Georgios Daskalakis -// Created: Thu Apr 12 17:01:03 CEST 2007 -// -// - - -// system include files -#include - - - -// Geometry -#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h" -#include "Geometry/CaloGeometry/interface/CaloGeometry.h" -#include "Geometry/CaloTopology/interface/CaloTopology.h" - -// Reconstruction Classes -#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" -#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" -#include "DataFormats/EcalDetId/interface/EBDetId.h" - -#include "RecoLocalCalo/EcalDeadChannelRecoveryProducers/interface/EcalDeadChannelRecoveryProducers.h" -#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h" - - -#include -#include - -using namespace cms; -using namespace std; - - - -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - -// -// constructors and destructor -// -EcalDeadChannelRecoveryProducers::EcalDeadChannelRecoveryProducers(const edm::ParameterSet& ps) -{ - - //now do what ever other initialization is needed - CorrectDeadCells_ = ps.getParameter("CorrectDeadCells"); - CorrectionMethod_ = ps.getParameter("CorrectionMethod"); - hitProducer_ = ps.getParameter("hitProducer"); - hitCollection_ = ps.getParameter("hitCollection"); - reducedHitCollection_ = ps.getParameter("reducedHitCollection"); - DeadChannelFileName_ = ps.getParameter("DeadChannelsFile"); - Sum8GeVThreshold_= ps.getParameter("Sum8GeVThreshold"); - - produces< EcalRecHitCollection >(reducedHitCollection_); -} - - -EcalDeadChannelRecoveryProducers::~EcalDeadChannelRecoveryProducers() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - -// ------------ method called to produce the data ------------ -void -EcalDeadChannelRecoveryProducers::produce(edm::Event& evt, const edm::EventSetup& iSetup) -{ - using namespace edm; - - edm::ESHandle theCaloTopology; - iSetup.get().get(theCaloTopology); - - // get the hit collection from the event: - edm::Handle rhcHandle; - evt.getByLabel(hitProducer_, hitCollection_, rhcHandle); - if (!(rhcHandle.isValid())) - { - std::cout << "could not get a handle on the EcalRecHitCollection!" << std::endl; - return; - } - const EcalRecHitCollection* hit_collection = rhcHandle.product(); - - // create an auto_ptr to a EcalRecHitCollection, copy the RecHits into it and put it in the Event: - std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); - - EcalDeadChannelRecoveryAlgos *DeadChannelCorrector = new EcalDeadChannelRecoveryAlgos(theCaloTopology.product()); - - //Dead Cells are read from a text file - std::vector::const_iterator DeadCell; - - // - //This should work only if we REMOVE the DC RecHit from the reduced RecHit collection - // - for(EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { - std::vector::const_iterator CheckDead = ChannelsDeadID.begin(); - bool OverADeadRecHit=false; - while(CheckDeaddetid()==*CheckDead){OverADeadRecHit=true;break;} - CheckDead++; - } - if(!OverADeadRecHit)redCollection->push_back( *it ); - } - for(DeadCell=ChannelsDeadID.begin();DeadCellCorrect(*DeadCell,hit_collection,CorrectionMethod_,Sum8GeVThreshold_); - redCollection->push_back( NewRecHit ); - } - - - - - delete DeadChannelCorrector ; - - evt.put(redCollection, reducedHitCollection_); - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -EcalDeadChannelRecoveryProducers::beginJob() -{ - FILE* DeadCha; - printf("Dead Channels FILE: %s\n",DeadChannelFileName_.c_str()); - DeadCha = fopen(DeadChannelFileName_.c_str(),"r"); - - int fileStatus=0; - int ieta=-10000; - int iphi=-10000; - while(fileStatus != EOF) { - fileStatus = fscanf(DeadCha,"%d %d\n",&ieta,&iphi); - // std::cout<<" ieta "< >("dbStatusToBeExcludedEE"); dbStatusToBeExcludedEB_ = ps.getParameter >("dbStatusToBeExcludedEB"); - - tpDigiToken_ = - c.consumes(ps.getParameter("triggerPrimitiveDigiCollection")); + logWarningEtThreshold_EB_FE_ = ps.getParameter("logWarningEtThreshold_EB_FE"); logWarningEtThreshold_EE_FE_ = ps.getParameter("logWarningEtThreshold_EE_FE"); + + tpDigiToken_ = + c.consumes(ps.getParameter("triggerPrimitiveDigiCollection")); } @@ -129,19 +128,36 @@ EcalRecHitWorkerRecover::run( const edm::Event & evt, } if ( flags == EcalRecHitWorkerRecover::EB_single ) { - // recover as single dead channel - const EcalRecHitCollection * hit_collection = &result; - EcalDeadChannelRecoveryAlgos deadChannelCorrector(caloTopology_.product()); - - // channel recovery - EcalRecHit hit = deadChannelCorrector.correct( detId, hit_collection, singleRecoveryMethod_, singleRecoveryThreshold_ ); - if ( hit.energy() != 0 ) { - hit.setFlag( EcalRecHit::kNeighboursRecovered ) ; - } else { - // recovery failed - hit.setFlag( EcalRecHit::kDead ) ; - } - insertRecHit( hit, result ); + // recover as single dead channel + ebDeadChannelCorrector.setCaloTopology(caloTopology_.product()); + + // channel recovery. Accepted new RecHit has the flag AcceptRecHit=TRUE + bool AcceptRecHit=true; + EcalRecHit hit = ebDeadChannelCorrector.correct( detId, result, singleRecoveryMethod_, singleRecoveryThreshold_, &AcceptRecHit); + + if ( hit.energy() != 0 and AcceptRecHit == true ) { + hit.setFlag( EcalRecHit::kNeighboursRecovered ) ; + } else { + // recovery failed + hit.setFlag( EcalRecHit::kDead ) ; + } + insertRecHit( hit, result ); + + } else if ( flags == EcalRecHitWorkerRecover::EE_single ) { + // recover as single dead channel + eeDeadChannelCorrector.setCaloTopology(caloTopology_.product()); + + // channel recovery. Accepted new RecHit has the flag AcceptRecHit=TRUE + bool AcceptRecHit=true; + EcalRecHit hit = eeDeadChannelCorrector.correct( detId, result, singleRecoveryMethod_, singleRecoveryThreshold_, &AcceptRecHit); + if ( hit.energy() != 0 and AcceptRecHit == true ) { + hit.setFlag( EcalRecHit::kNeighboursRecovered ) ; + } else { + // recovery failed + hit.setFlag( EcalRecHit::kDead ) ; + } + insertRecHit( hit, result ); + } else if ( flags == EcalRecHitWorkerRecover::EB_VFE ) { // recover as dead VFE EcalRecHit hit( detId, 0., 0.); diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerRecover.h b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerRecover.h index 35e7b91ed22c3..f591de2d915b2 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerRecover.h +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerRecover.h @@ -25,7 +25,7 @@ #include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h" #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h" - +#include "RecoLocalCalo/EcalDeadChannelRecoveryAlgos/interface/EcalDeadChannelRecoveryAlgos.h" class EcalRecHitWorkerRecover : public EcalRecHitWorkerBaseClass { public: @@ -92,6 +92,10 @@ class EcalRecHitWorkerRecover : public EcalRecHitWorkerBaseClass { std::set recoveredDetIds_EE_; EcalTPGScale tpgscale_; + + EcalDeadChannelRecoveryAlgos ebDeadChannelCorrector; + EcalDeadChannelRecoveryAlgos eeDeadChannelCorrector; + }; #endif diff --git a/RecoLocalCalo/EcalRecProducers/test/plugins/EcalRecHitDump.cc b/RecoLocalCalo/EcalRecProducers/test/plugins/EcalRecHitDump.cc new file mode 100644 index 0000000000000..2086b9de999d2 --- /dev/null +++ b/RecoLocalCalo/EcalRecProducers/test/plugins/EcalRecHitDump.cc @@ -0,0 +1,51 @@ +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DataFormats/EcalRecHit/interface/EcalRecHit.h" +#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" + +#include + +class EcalRecHitDump : public edm::EDAnalyzer { + public: + explicit EcalRecHitDump(const edm::ParameterSet&); + + private: + virtual void beginJob() {} + virtual void analyze(const edm::Event&, const edm::EventSetup&); + virtual void endJob() {} + + private: + edm::EDGetTokenT EBRecHitCollectionT_; + edm::EDGetTokenT EERecHitCollectionT_; +}; + +EcalRecHitDump::EcalRecHitDump(const edm::ParameterSet& iConfig) { + EBRecHitCollectionT_ = + consumes(iConfig.getParameter("EBRecHitCollection")); + EERecHitCollectionT_ = + consumes(iConfig.getParameter("EERecHitCollection")); +} + +void EcalRecHitDump::analyze(const edm::Event& ev, + const edm::EventSetup&) { + + edm::Handle EBRecHits_; + edm::Handle EERecHits_; + + ev.getByToken(EBRecHitCollectionT_, EBRecHits_); + ev.getByToken(EERecHitCollectionT_, EERecHits_); + + for (auto const& h : (*EBRecHits_)) + std::cout << h << std::endl; + + for (auto const& h : (*EERecHits_)) + std::cout << h << std::endl; +} + +DEFINE_FWK_MODULE(EcalRecHitDump);