63 CorrectDeadCells_ = ps.
getParameter<
bool>(
"CorrectDeadCells");
64 CorrectionMethod_ = ps.
getParameter<std::string>(
"CorrectionMethod");
65 hitProducer_ = ps.
getParameter<std::string>(
"hitProducer");
66 hitCollection_ = ps.
getParameter<std::string>(
"hitCollection");
67 reducedHitCollection_ = ps.
getParameter<std::string>(
"reducedHitCollection");
68 DeadChannelFileName_ = ps.
getParameter<std::string>(
"DeadChannelsFile");
69 Sum8GeVThreshold_= ps.
getParameter<
double>(
"Sum8GeVThreshold");
71 produces< EcalRecHitCollection >(reducedHitCollection_);
99 evt.
getByLabel(hitProducer_, hitCollection_, rhcHandle);
100 if (!(rhcHandle.isValid()))
102 std::cout <<
"could not get a handle on the EcalRecHitCollection!" << std::endl;
113 std::vector<EBDetId>::const_iterator DeadCell;
119 std::vector<EBDetId>::const_iterator CheckDead = ChannelsDeadID.begin();
120 bool OverADeadRecHit=
false;
121 while(CheckDead<ChannelsDeadID.end()){
122 if(it->detid()==*CheckDead){OverADeadRecHit=
true;
break;}
125 if(!OverADeadRecHit)redCollection->push_back( *it );
127 for(DeadCell=ChannelsDeadID.begin();DeadCell<ChannelsDeadID.end();DeadCell++){
128 EcalRecHit NewRecHit = DeadChannelCorrector->Correct(*DeadCell,hit_collection,CorrectionMethod_,Sum8GeVThreshold_);
129 redCollection->push_back( NewRecHit );
135 delete DeadChannelCorrector ;
137 evt.
put(redCollection, reducedHitCollection_);
148 printf(
"Dead Channels FILE: %s\n",DeadChannelFileName_.c_str());
149 DeadCha = fopen(DeadChannelFileName_.c_str(),
"r");
154 while(fileStatus != EOF) {
155 fileStatus = fscanf(DeadCha,
"%d %d\n",&ieta,&iphi);
157 if(ieta==-10000||iphi==-10000){
std::cout <<
"Problem reading Dead Channels file "<<std::endl;
break;}
159 ChannelsDeadID.push_back(cell);
T getParameter(std::string const &) const
DEFINE_FWK_MODULE(TauMET)
std::vector< EcalRecHit >::const_iterator const_iterator
~EcalDeadChannelRecoveryProducers()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
EcalDeadChannelRecoveryProducers(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &)