45 if (recoverEBIsolatedChannels_ && singleRecoveryMethod_ ==
"BDTG")
93 for (std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit) {
104 std::vector<DetId> eeC;
105 for (
int dx = 1;
dx <= 5; ++
dx) {
106 for (
int dy = 1;
dy <= 5; ++
dy) {
107 int ix = (sc.
ix() - 1) * 5 +
dx;
108 int iy = (sc.
iy() - 1) * 5 +
dy;
111 eeC.push_back(
EEDetId(ix, iy, iz));
115 for (
size_t i = 0;
i < eeC.size(); ++
i) {
130 bool AcceptRecHit =
true;
135 if (hit.
energy() != 0 and AcceptRecHit ==
true) {
148 bool AcceptRecHit =
true;
152 if (hit.
energy() != 0 and AcceptRecHit ==
true) {
177 if (tp != tpDigis->
end()) {
182 if (tpEt > tpEtThreshEB) {
183 edm::LogWarning(
"EnergyInDeadEB_FE") <<
"TP energy in the dead TT = " << tpEt <<
" at " << ttDetId;
188 for (std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit) {
196 if (tp->compressedEt() == 0xFF)
206 for (std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit) {
227 for (
int dx = 1;
dx <= 5; ++
dx) {
228 for (
int dy = 1;
dy <= 5; ++
dy) {
229 int ix = (
sc.ix() - 1) * 5 +
dx;
230 int iy = (
sc.iy() - 1) * 5 +
dy;
247 std::set<EcalTrigTowerDetId> aTT;
248 for (std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it) {
254 std::set<DetId> aTTC;
255 bool atLeastOneTPSaturated =
false;
256 for (std::set<EcalTrigTowerDetId>::const_iterator it = aTT.begin(); it != aTT.end(); ++it) {
259 if (itTP != tpDigis->
end()) {
263 std::vector<DetId>::iterator ttcons = v.begin();
264 while (ttcons != v.end()) {
266 ttcons = v.erase(ttcons);
272 if (itTP->compressedEt() == 0xFF) {
273 atLeastOneTPSaturated =
300 if (itTP->compressedEt() == 0) {
301 for (
size_t i = 0;
i < v.size(); ++
i)
303 }
else if (itTP->compressedEt() != 0xFF) {
305 for (
size_t j = 0; j < v.size(); ++j) {
315 for (std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it) {
320 for (std::set<DetId>::const_iterator it = aTTC.begin(); it != aTTC.end(); ++it) {
322 if (jt != hits->
end()) {
323 float energy = jt->energy();
325 float pf = 1.0 / cosh(eta);
333 if (scEt > scEtThreshEE) {
334 edm::LogWarning(
"EnergyInDeadEE_FE") <<
"TP energy in the dead TT = " << scEt <<
" at " <<
sc;
340 for (std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it) {
342 float pf = 1.0 / cosh(eta);
345 if (atLeastOneTPSaturated)
358 const std::set<DetId>& sId,
359 const std::vector<DetId>& vId) {
362 for (std::vector<DetId>::const_iterator vIdit = vId.begin(); vIdit != vId.end(); ++vIdit) {
363 std::set<DetId>::const_iterator sIdit = sId.find(*vIdit);
364 if (sIdit == sId.end()) {
365 float energy = hits->
find(*vIdit)->energy();
367 float pf = 1.0 / cosh(eta);
368 xtalE += energy *
pf;
379 return etsat / cosh(ieta) * (ieta > 26 ? 2 : 1);
381 return xtalE * ((vId.size() / (
float)count) - 1) * (ieta > 26 ? 2 : 1);
387 edm::LogWarning(
"EcalRecHitWorkerRecover") <<
"DetId already recovered! Skipping...";
391 if (it == collection.
end()) {
414 edm::LogError(
"EcalRecHitWorkerRecover::InvalidDetId") <<
"Invalid DetId " <<
id.rawId();
431 uint16_t dbStatus = 0;
433 dbStatus = chIt->getEncodedStatusCode();
435 edm::LogError(
"ObjectNotFound") <<
"No channel status found for xtal " <<
id.rawId()
436 <<
"! something wrong with EcalChannelStatus in your DB? ";
439 for (std::vector<int>::const_iterator
status = statusestoexclude.begin();
status != statusestoexclude.end();
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)
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
Geom::Theta< T > theta() const
std::vector< int > dbStatusToBeExcludedEE_
void push_back(T const &t)
std::vector< Variable::Flags > flags
edm::ESHandle< EcalElectronicsMapping > pEcalMapping_
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_
std::unique_ptr< EcalRecHitSimpleAlgo > rechitMaker_
edm::ESHandle< EcalTrigTowerConstituentsMap > ttMap_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
void setParameters(const edm::ParameterSet &ps)
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)
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_
float correct(const DetIdT id, const EcalRecHitCollection &hit_collection, std::string algo, double single8Cut, double sum8Cut, bool *accFlag)
double sum8RecoveryThreshold_
EcalDeadChannelRecoveryAlgos< EBDetId > ebDeadChannelCorrector
edm::ESHandle< EcalChannelStatus > chStatus_
T const * product() const
edm::ESHandle< EcalLaserDbService > laser
const EcalElectronicsMapping * ecalMapping_
bool checkChannelStatus(const DetId &id, const std::vector< int > &statusestoexclude)
std::set< DetId > recoveredDetIds_EB_