98 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
108 std::vector<DetId> eeC;
109 for(
int dx=1;
dx<=5; ++
dx){
110 for(
int dy=1;
dy<=5; ++
dy){
111 int ix = (sc.
ix()-1)*5 +
dx;
112 int iy = (sc.
iy()-1)*5 +
dy;
115 eeC.push_back(
EEDetId(ix, iy, iz));
119 for (
size_t i = 0;
i < eeC.size(); ++
i ) {
133 bool AcceptRecHit=
true;
136 if ( hit.
energy() != 0 and AcceptRecHit ==
true ) {
149 bool AcceptRecHit=
true;
151 if ( hit.
energy() != 0 and AcceptRecHit ==
true ) {
176 if ( tp != tpDigis->
end() ) {
181 if(tpEt>tpEtThreshEB){
182 edm::LogWarning(
"EnergyInDeadEB_FE")<<
"TP energy in the dead TT = "<<tpEt<<
" at "<<ttDetId;
187 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
202 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
222 for(
int dx=1;
dx<=5; ++
dx){
223 for(
int dy=1;
dy<=5; ++
dy){
224 int ix = (
sc.ix()-1)*5 +
dx;
225 int iy = (
sc.iy()-1)*5 +
dy;
242 std::set<EcalTrigTowerDetId> aTT;
243 for ( std::set<DetId>::const_iterator it = eeC.begin(); it!=eeC.end(); ++it ) {
249 std::set<DetId> aTTC;
250 bool atLeastOneTPSaturated =
false;
251 for ( std::set<EcalTrigTowerDetId>::const_iterator it = aTT.begin(); it != aTT.end(); ++it ) {
254 if ( itTP != tpDigis->
end() ) {
259 std::vector<DetId>::iterator ttcons = v.begin();
260 while (ttcons != v.end()){
262 ttcons=v.erase(ttcons);
268 if ( itTP->compressedEt() == 0xFF ){
269 atLeastOneTPSaturated =
true;
295 if (itTP->compressedEt() == 0){
296 for (
size_t i = 0 ;
i < v.size(); ++
i)
299 else if (itTP->compressedEt()!=0xFF){
300 for (
size_t j = 0; j < v.size(); ++j ) {
311 for ( std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it ) {
316 for ( std::set<DetId>::const_iterator it = aTTC.begin(); it != aTTC.end(); ++it ) {
318 if ( jt != hits->
end() ) {
319 float energy = jt->energy();
321 float pf = 1.0/cosh(eta);
330 if(scEt>scEtThreshEE){
331 edm::LogWarning(
"EnergyInDeadEE_FE")<<
"TP energy in the dead TT = "<<scEt<<
" at "<<
sc;
337 for ( std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it ) {
340 float pf = 1.0/cosh(eta);
357 for (std::vector<DetId>::const_iterator vIdit = vId.begin(); vIdit != vId.end(); ++ vIdit){
358 std::set<DetId>::const_iterator sIdit = sId.find(*vIdit);
359 if (sIdit==sId.end()){
360 float energy = hits->
find(*vIdit)->energy();
362 float pf = 1.0/cosh(eta);
374 return etsat/cosh(ieta)*(ieta>26?2:1);
376 else return xtalE*((vId.size()/(
float)count) - 1)*(ieta>26?2:1);
386 edm::LogWarning(
"EcalRecHitWorkerRecover") <<
"DetId already recovered! Skipping...";
390 if ( it == collection.
end() ) {
415 edm::LogError(
"EcalRecHitWorkerRecover::InvalidDetId") <<
"Invalid DetId " <<
id.rawId();
432 const std::vector<int>& statusestoexclude){
440 uint16_t dbStatus = 0;
442 dbStatus = chIt->getEncodedStatusCode();
444 edm::LogError(
"ObjectNotFound") <<
"No channel status found for xtal " 446 <<
"! something wrong with EcalChannelStatus in your DB? ";
449 for (std::vector<int>::const_iterator
status = statusestoexclude.begin();
452 if ( *
status == dbStatus)
return false;
std::string singleRecoveryMethod_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
double singleRecoveryThreshold_
T getParameter(std::string const &) const
double logWarningEtThreshold_EB_FE_
bool recoverEEIsolatedChannels_
bool alreadyInserted(const DetId &id)
void setEventSetup(const edm::EventSetup &evtSetup)
bool run(const edm::Event &evt, const EcalUncalibratedRecHit &uncalibRH, EcalRecHitCollection &result) override
EcalDeadChannelRecoveryAlgos< EEDetId > eeDeadChannelCorrector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
std::vector< EcalTriggerPrimitiveDigi >::const_iterator const_iterator
Geom::Theta< T > theta() const
std::vector< int > dbStatusToBeExcludedEE_
void push_back(T const &t)
std::vector< Variable::Flags > flags
void setFlag(int flag)
set the flags (from Flags or ESFlags)
edm::ESHandle< CaloTopology > caloTopology_
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi)
float recCheckCalib(float energy, int ieta)
void setCaloTopology(const CaloTopology *topology)
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
void insertRecHit(const EcalRecHit &hit, EcalRecHitCollection &collection)
double logWarningEtThreshold_EE_FE_
uint32_t rawId() const
get the raw id
std::unique_ptr< EcalRecHitSimpleAlgo > rechitMaker_
EcalRecHit correct(const DetIdT id, const EcalRecHitCollection &hit_collection, std::string algo, double Sum8Cut, bool *AccFlag)
edm::ESHandle< EcalTrigTowerConstituentsMap > ttMap_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
edm::ESHandle< CaloSubdetectorGeometry > pEBGeom_
const CaloGeometry * geo_
bool recoverEBIsolatedChannels_
float estimateEnergy(int ieta, EcalRecHitCollection *hits, const std::set< DetId > &sId, const std::vector< DetId > &vId)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< DetId > constituentsOf(const EcalTrigTowerDetId &id) const
Get the constituent detids for this tower id.
const CaloSubdetectorGeometry * ebGeom_
std::vector< EcalRecHit >::iterator iterator
const_iterator end() const
void set(const edm::EventSetup &es) override
DetId id() const
get the id
T const * product() const
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
edm::EDGetTokenT< EcalTrigPrimDigiCollection > tpDigiToken_
std::vector< Item >::const_iterator const_iterator
std::set< DetId > recoveredDetIds_EE_
iterator find(key_type k)
EcalRecHitWorkerRecover(const edm::ParameterSet &, edm::ConsumesCollector &c)
edm::ESHandle< CaloGeometry > caloGeometry_
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::vector< int > dbStatusToBeExcludedEB_
EcalDeadChannelRecoveryAlgos< EBDetId > ebDeadChannelCorrector
edm::ESHandle< EcalChannelStatus > chStatus_
T const * product() const
edm::ESHandle< EcalLaserDbService > laser
const EcalElectronicsMapping * ecalMapping_
edm::ESHandle< EcalElectronicsMapping > pEcalMapping_
bool checkChannelStatus(const DetId &id, const std::vector< int > &statusestoexclude)
std::set< DetId > recoveredDetIds_EB_