99 std::vector<DetId> vid =
ttMap_->constituentsOf( ttDetId );
100 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
110 std::vector<DetId> eeC;
111 for(
int dx=1; dx<=5; ++dx){
112 for(
int dy=1; dy<=5; ++dy){
113 int ix = (sc.
ix()-1)*5 + dx;
114 int iy = (sc.
iy()-1)*5 + dy;
117 eeC.push_back(
EEDetId(ix, iy, iz));
121 for (
size_t i = 0;
i < eeC.size(); ++
i ) {
135 bool AcceptRecHit=
true;
138 if ( hit.
energy() != 0 and AcceptRecHit ==
true ) {
151 bool AcceptRecHit=
true;
153 if ( hit.
energy() != 0 and AcceptRecHit ==
true ) {
178 if ( tp != tpDigis->
end() ) {
180 std::vector<DetId> vid =
ttMap_->constituentsOf( ttDetId );
183 if(tpEt>tpEtThreshEB){
184 edm::LogWarning(
"EnergyInDeadEB_FE")<<
"TP energy in the dead TT = "<<tpEt<<
" at "<<ttDetId;
189 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
203 std::vector<DetId> vid =
ttMap_->constituentsOf( ttDetId );
204 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
224 for(
int dx=1; dx<=5; ++dx){
225 for(
int dy=1; dy<=5; ++dy){
226 int ix = (sc.ix()-1)*5 + dx;
227 int iy = (sc.iy()-1)*5 + dy;
244 std::set<EcalTrigTowerDetId> aTT;
245 for ( std::set<DetId>::const_iterator it = eeC.begin(); it!=eeC.end(); ++it ) {
246 aTT.insert(
ttMap_->towerOf( *it ) );
251 std::set<DetId> aTTC;
252 bool atLeastOneTPSaturated =
false;
253 for ( std::set<EcalTrigTowerDetId>::const_iterator it = aTT.begin(); it != aTT.end(); ++it ) {
256 if ( itTP != tpDigis->
end() ) {
258 std::vector<DetId>
v =
ttMap_->constituentsOf( *it );
261 std::vector<DetId>::iterator ttcons = v.begin();
262 while (ttcons != v.end()){
264 ttcons=v.erase(ttcons);
270 if ( itTP->compressedEt() == 0xFF ){
271 atLeastOneTPSaturated =
true;
297 if (itTP->compressedEt() == 0){
298 for (
size_t i = 0 ;
i < v.size(); ++
i)
301 else if (itTP->compressedEt()!=0xFF){
302 for (
size_t j = 0;
j < v.size(); ++
j ) {
313 for ( std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it ) {
318 for ( std::set<DetId>::const_iterator it = aTTC.begin(); it != aTTC.end(); ++it ) {
320 if ( jt != hits->
end() ) {
321 float energy = jt->energy();
323 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 ) {
343 float pf = 1.0/cosh(eta);
360 for (std::vector<DetId>::const_iterator vIdit = vId.begin(); vIdit != vId.end(); ++ vIdit){
361 std::set<DetId>::const_iterator sIdit = sId.find(*vIdit);
362 if (sIdit==sId.end()){
365 float pf = 1.0/cosh(eta);
374 ttMap_->towerOf(*vId.begin()));
377 return etsat/cosh(ieta)*(ieta>26?2:1);
379 else return xtalE*((vId.size()/(float)count) - 1)*(ieta>26?2:1);
389 edm::LogWarning(
"EcalRecHitWorkerRecover") <<
"DetId already recovered! Skipping...";
393 if ( it == collection.
end() ) {
418 edm::LogError(
"EcalRecHitWorkerRecover::InvalidDetId") <<
"Invalid DetId " <<
id.rawId();
435 const std::vector<int>& statusestoexclude){
443 uint16_t dbStatus = 0;
445 dbStatus = chIt->getEncodedStatusCode();
447 edm::LogError(
"ObjectNotFound") <<
"No channel status found for xtal "
449 <<
"! something wrong with EcalChannelStatus in your DB? ";
452 for (std::vector<int>::const_iterator
status = statusestoexclude.begin();
455 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)
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)
const CaloSubdetectorGeometry * eeGeom_
virtual const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Geom::Theta< T > theta() const
void insertRecHit(const EcalRecHit &hit, EcalRecHitCollection &collection)
double logWarningEtThreshold_EE_FE_
uint32_t rawId() const
get the raw id
EcalRecHit correct(const DetIdT id, const EcalRecHitCollection &hit_collection, std::string algo, double Sum8Cut, bool *AccFlag)
edm::ESHandle< CaloSubdetectorGeometry > pEEGeom_
edm::ESHandle< EcalTrigTowerConstituentsMap > ttMap_
const 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) ...
const CaloSubdetectorGeometry * ebGeom_
std::vector< EcalRecHit >::iterator iterator
const_iterator end() const
DetId id() const
get the id
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_
T const * product() const
EcalRecHitSimpleAlgo * rechitMaker_
T const * product() const
void set(const edm::EventSetup &es)
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_
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
EcalDeadChannelRecoveryAlgos< EBDetId > ebDeadChannelCorrector
edm::ESHandle< EcalChannelStatus > chStatus_
edm::ESHandle< EcalLaserDbService > laser
const EcalElectronicsMapping * ecalMapping_
edm::ESHandle< EcalElectronicsMapping > pEcalMapping_
bool run(const edm::Event &evt, const EcalUncalibratedRecHit &uncalibRH, EcalRecHitCollection &result)
bool checkChannelStatus(const DetId &id, const std::vector< int > &statusestoexclude)
std::set< DetId > recoveredDetIds_EB_