54 calotopo = theCaloTopology;
77 int IndDeadChannel[1]={-1};
79 double sum8 = MakeNxNMatrice(Id,hit_collection,IndDeadChannel,MNxN);
86 }
else if(algo_==
"NeuralNetworks"){
97 if ( NewEnergy > 5. * sum8 ) {
110 return correct(Id, hit_collection, algo_, Sum8Cut);
125 for(
int i=0;
i<121;
i++)MNxN[
i]=0.0;
132 std::vector<DetId> NxNaroundDC = topology->
getWindow(itID,size,size);
137 std::vector<DetId>::const_iterator theCells;
140 double EnergyMax = 0.0;
142 for(theCells=NxNaroundDC.begin();theCells<NxNaroundDC.end();theCells++){
148 if( goS_it != hit_collection->
end() && goS_it->energy()>=EnergyMax){EnergyMax=goS_it->energy(); EBCellMax = EBCell;}
153 if(EBCellMax.
null()){
return 0;}
164 std::vector<DetId> NxNaroundMaxCont = topology->
getWindow(EBCellMax,FixedSize,FixedSize);
169 std::vector<DetId>::const_iterator itCells;
170 for(itCells=NxNaroundMaxCont.begin();itCells<NxNaroundMaxCont.end();itCells++){
172 int CReta = EBitCell.
ieta();
173 int CRphi = EBitCell.
iphi();
176 if(!EBitCell.
null()){
178 if( goS_it != hit_collection->
end() ) Energy=goS_it->energy();
185 if((CReta * EBCellMax.
ieta()) < 0 && EBCellMax.
ieta()>0 )ietaCorr= -1;
186 if((CReta * EBCellMax.
ieta()) < 0 && EBCellMax.
ieta()<0 )ietaCorr= 1;
187 if((CReta * EBCellMax.
ieta()) > 0 )ietaCorr= 0;
188 int ieta = -( (CReta -ietaCorr) - EBCellMax.
ieta() ) +
int((FixedSize - 1)/2);
191 if((CRphi - EBCellMax.
iphi())> 50)iphiCorr= 360;
192 if((CRphi - EBCellMax.
iphi())<-50)iphiCorr=-360;
193 int iphi = CRphi - EBCellMax.
iphi() - iphiCorr + int((FixedSize - 1)/2);
195 int MIndex = ieta+iphi*FixedSize;
198 if(EBitCell == itID)IndDeadChannel[0]= MIndex;
209 if(theIndex>=48 && theIndex<=50)ESUMis += Energy;
210 if(theIndex>=59 && theIndex<=61)ESUMis += Energy;
211 if(theIndex>=70 && theIndex<=72)ESUMis += Energy;
double CorrectDeadChannelsClassic(double *M11x11Input, const int DCeta)
std::vector< EcalRecHit >::const_iterator const_iterator
EcalRecHit correct(const EBDetId Id, const EcalRecHitCollection *hit_collection, std::string algo_, double Sum8Cut)
int iphi() const
get the crystal iphi
EcalDeadChannelRecoveryAlgos()
Abs< T >::type abs(const T &t)
int ieta() const
get the crystal ieta
double MakeNxNMatrice(EBDetId itID, const EcalRecHitCollection *hit_collection, int *IndDeadChannel, double *MNxN)
const_iterator end() const
double CorrectDeadChannelsNN(double *M5x5Input)
EcalRecHit Correct(const EBDetId Id, const EcalRecHitCollection *hit_collection, std::string algo_, double Sum8Cut)
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
bool null() const
is this a null id ?
iterator find(key_type k)
~EcalDeadChannelRecoveryAlgos()
tuple size
Write out results.