147 using namespace reco;
156 if(not met_h.
isValid()
or met_h->size()==0
or met_h->front().pt()<0){
165 CleanedMET->push_back(inCaloMet);
174 edm::LogError(
"DataNotFound") <<
"HLTHcalMETNoiseCleaner: Could not find HcalNoiseRBXCollection product named " 176 CleanedMET->push_back(inCaloMet);
183 for(
auto const & rbx : *rbxs_h) {
190 CleanedMET->push_back(inCaloMet);
200 metVec.SetPtEtaPhi(met_h->front().pt(), 0, met_h->front().phi() );
202 TVector3 noiseHPDVector(0,0,0);
203 TVector3 secondHPDVector(0,0,0);
204 for(
auto it=data.begin();
208 bool passFilter=
true;
211 if(it->validRatio() && it->ratio()<
minRatio_) passFilter=
false;
212 else if(it->validRatio() && it->ratio()>
maxRatio_) passFilter=
false;
213 else if(it->numHPDHits()>=
minHPDHits_) passFilter=
false;
214 else if(it->numRBXHits()>=
minRBXHits_) passFilter=
false;
216 else if(it->numZeros()>=
minZeros_) passFilter=
false;
219 else if(!it->PassTS4TS5()) passFilter=
false;
228 LogDebug(
"") <<
"HLTHcalMETNoiseCleaner debug: Found a noisy RBX: " 229 <<
"energy=" << it->energy() <<
"; " 230 <<
"ratio=" << it->ratio() <<
"; " 231 <<
"# RBX hits=" << it->numRBXHits() <<
"; " 232 <<
"# HPD hits=" << it->numHPDHits() <<
"; " 233 <<
"# Zeros=" << it->numZeros() <<
"; " 234 <<
"min time=" << it->minHighEHitTime() <<
"; " 235 <<
"max time=" << it->maxHighEHitTime() <<
"; " 236 <<
"passTS4TS5=" << it->PassTS4TS5() <<
"; " 237 <<
"RBX EMF=" << it->RBXEMF()
244 if(isNoise && nNoise==1){
248 for( noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++){
250 towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(),(*noiseTowersIt)->eta(),(*noiseTowersIt)->phi());
251 noiseHPDVector+=towerVec;
253 if(noiseHPDVector.Mag()>0) noiseHPDVector.SetPtEtaPhi(noiseHPDVector.Pt(),0,noiseHPDVector.Phi());
254 else noiseHPDVector.SetPtEtaPhi(0,0,0);
257 if(isNoise && cntr > 0){
258 CleanedMET->push_back(inCaloMet);
263 if(!isNoise && cntr == 0){
264 CleanedMET->push_back(inCaloMet);
269 if(!isNoise && nNoise>0){
272 for( noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++){
274 towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(),(*noiseTowersIt)->eta(),(*noiseTowersIt)->phi());
275 secondHPDVector+=towerVec;
277 if(secondHPDVector.Mag()>0) secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(),0,secondHPDVector.Phi());
278 else secondHPDVector.SetPtEtaPhi(0,0,0);
283 if(noiseHPDVector.Mag()==0){
284 CleanedMET->push_back(inCaloMet);
293 float METsumet = met_h->front().energy();
295 metVec+=noiseHPDVector;
297 float ZMETsumet = METsumet-noiseHPDVector.Mag();
298 float ZMETpt = metVec.Pt();
299 float ZMETphi = metVec.Phi();
306 if(secondHPDVector.Mag()>0.){
307 secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(),noiseHPDVector.Eta(),noiseHPDVector.Phi());
308 metVec-= secondHPDVector;
309 SMETsumet = METsumet-noiseHPDVector.Mag();
310 SMETpt = metVec.Pt();
311 SMETphi = metVec.Phi();
314 float CorMetSumEt,CorMetPt,CorMetPhi;
316 CorMetSumEt = ZMETsumet;
320 CorMetSumEt = SMETsumet;
326 CleanedMET->push_back(corMet);
virtual double pt() const final
transverse momentum
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::pair< double, double > > TS4TS5UpperCut_
edm::EDGetTokenT< reco::CaloMETCollection > m_theCaloMetToken
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
const_iterator end() const
Termination of iteration.
reco::CaloMET BuildCaloMet(float sumet, float pt, float phi)
const_iterator begin() const
Initialize an iterator over the RefVector.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
edm::InputTag HcalNoiseRBXCollectionTag_
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
bool accept2NoiseRBXEvents_
char data[epos_bytes_allocation]
double TS4TS5EnergyThreshold_
std::vector< std::pair< double, double > > TS4TS5LowerCut_