100 std::vector<DetId> vid =
ttMap_->constituentsOf( ttDetId );
101 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
110 EcalScDetId sc( 1+(
id.ix()-1)/5, 1+(
id.iy()-1)/5,
id.zside() );
111 std::vector<DetId> eeC;
112 for(
int dx=1; dx<=5; ++dx){
113 for(
int dy=1; dy<=5; ++dy){
114 int ix = (sc.
ix()-1)*5 + dx;
115 int iy = (sc.
iy()-1)*5 + dy;
118 eeC.push_back(
EEDetId(ix, iy, iz));
122 for (
size_t i = 0;
i < eeC.size(); ++
i ) {
138 if ( hit.energy() != 0 ) {
162 if ( tp != tpDigis->
end() ) {
164 std::vector<DetId> vid =
ttMap_->constituentsOf( ttDetId );
167 if(tpEt>tpEtThreshEB){
168 edm::LogWarning(
"EnergyInDeadEB_FE")<<
"TP energy in the dead TT = "<<tpEt<<
" at "<<ttDetId;
173 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
187 std::vector<DetId> vid =
ttMap_->constituentsOf( ttDetId );
188 for ( std::vector<DetId>::const_iterator dit = vid.begin(); dit != vid.end(); ++dit ) {
208 for(
int dx=1; dx<=5; ++dx){
209 for(
int dy=1; dy<=5; ++dy){
210 int ix = (sc.ix()-1)*5 + dx;
211 int iy = (sc.iy()-1)*5 + dy;
228 std::set<EcalTrigTowerDetId> aTT;
229 for ( std::set<DetId>::const_iterator it = eeC.begin(); it!=eeC.end(); ++it ) {
230 aTT.insert(
ttMap_->towerOf( *it ) );
235 std::set<DetId> aTTC;
236 bool atLeastOneTPSaturated =
false;
237 for ( std::set<EcalTrigTowerDetId>::const_iterator it = aTT.begin(); it != aTT.end(); ++it ) {
240 if ( itTP != tpDigis->
end() ) {
242 std::vector<DetId>
v =
ttMap_->constituentsOf( *it );
245 std::vector<DetId>::iterator ttcons = v.begin();
246 while (ttcons != v.end()){
248 ttcons=v.erase(ttcons);
254 if ( itTP->compressedEt() == 0xFF ){
255 atLeastOneTPSaturated =
true;
281 if (itTP->compressedEt() == 0){
282 for (
size_t i = 0 ;
i < v.size(); ++
i)
285 else if (itTP->compressedEt()!=0xFF){
286 for (
size_t j = 0;
j < v.size(); ++
j ) {
297 for ( std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it ) {
302 for ( std::set<DetId>::const_iterator it = aTTC.begin(); it != aTTC.end(); ++it ) {
304 if ( jt != hits->
end() ) {
305 float energy = jt->energy();
307 float pf = 1.0/cosh(eta);
317 if(scEt>scEtThreshEE){
318 edm::LogWarning(
"EnergyInDeadEE_FE")<<
"TP energy in the dead TT = "<<scEt<<
" at "<<sc;
324 for ( std::set<DetId>::const_iterator it = eeC.begin(); it != eeC.end(); ++it ) {
327 float pf = 1.0/cosh(eta);
344 for (std::vector<DetId>::const_iterator vIdit = vId.begin(); vIdit != vId.end(); ++ vIdit){
345 std::set<DetId>::const_iterator sIdit = sId.find(*vIdit);
346 if (sIdit==sId.end()){
349 float pf = 1.0/cosh(eta);
358 ttMap_->towerOf(*vId.begin()));
361 return etsat/cosh(ieta)*(ieta>26?2:1);
363 else return xtalE*((vId.size()/(float)count) - 1)*(ieta>26?2:1);
373 edm::LogWarning(
"EcalRecHitWorkerRecover") <<
"DetId already recovered! Skipping...";
377 if ( it == collection.
end() ) {
402 edm::LogError(
"EcalRecHitWorkerRecover::InvalidDetId") <<
"Invalid DetId " <<
id.rawId();
418 const std::vector<int>& statusestoexclude){
426 uint16_t dbStatus = 0;
428 dbStatus = chIt->getStatusCode();
430 edm::LogError(
"ObjectNotFound") <<
"No channel status found for xtal "
432 <<
"! something wrong with EcalChannelStatus in your DB? ";
435 for (std::vector<int>::const_iterator
status = statusestoexclude.begin();
438 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 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)
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
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.
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_