44 #include <TLorentzVector.h>
48 : HcalNoiseRBXCollectionTag_(iConfig.getParameter<edm::
InputTag>(
"HcalNoiseRBXCollection")),
49 CaloMetCollectionTag_(iConfig.getParameter<edm::
InputTag>(
"CaloMetCollection")),
50 CaloMetCut_(iConfig.getParameter<double>(
"CaloMetCut")),
51 severity_(iConfig.getParameter<int> (
"severity")),
52 maxNumRBXs_(iConfig.getParameter<int>(
"maxNumRBXs")),
53 numRBXsToConsider_(iConfig.getParameter<int>(
"numRBXsToConsider")),
54 accept2NoiseRBXEvents_(iConfig.getParameter<bool>(
"accept2NoiseRBXEvents")),
55 needEMFCoincidence_(iConfig.getParameter<bool>(
"needEMFCoincidence")),
56 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
57 minRatio_(iConfig.getParameter<double>(
"minRatio")),
58 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
59 minHPDHits_(iConfig.getParameter<int>(
"minHPDHits")),
60 minRBXHits_(iConfig.getParameter<int>(
"minRBXHits")),
61 minHPDNoOtherHits_(iConfig.getParameter<int>(
"minHPDNoOtherHits")),
62 minZeros_(iConfig.getParameter<int>(
"minZeros")),
63 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
64 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
65 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
66 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
67 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
68 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
70 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold"))
73 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
74 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
75 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
76 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
78 for(
int i = 0;
i < (int)TS4TS5UpperThresholdTemp.size() &&
i < (int)TS4TS5UpperCutTemp.size();
i++)
79 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[i]));
82 for(
int i = 0; i < (int)TS4TS5LowerThresholdTemp.size() && i < (int)TS4TS5LowerCutTemp.size(); i++)
83 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
89 if(iConfig.
existsAs<
double>(
"minR45HitE"))
92 produces<reco::CaloMETCollection>();
103 desc.
add<
double>(
"CaloMetCut",0.0);
104 desc.
add<
int>(
"severity",1);
105 desc.
add<
int>(
"maxNumRBXs",2);
106 desc.
add<
int>(
"numRBXsToConsider",2);
107 desc.
add<
bool>(
"accept2NoiseRBXEvents",
true);
108 desc.
add<
bool>(
"needEMFCoincidence",
true);
109 desc.
add<
double>(
"minRBXEnergy",50.0);
110 desc.
add<
double>(
"minRatio",-999.);
111 desc.
add<
double>(
"maxRatio",999.);
112 desc.
add<
int>(
"minHPDHits",17);
113 desc.
add<
int>(
"minRBXHits",999);
114 desc.
add<
int>(
"minHPDNoOtherHits",10);
115 desc.
add<
int>(
"minZeros",10);
116 desc.
add<
double>(
"minHighEHitTime",-9999.0);
117 desc.
add<
double>(
"maxHighEHitTime",9999.0);
118 desc.
add<
double>(
"maxRBXEMF",0.02);
119 desc.
add<
double>(
"minRecHitE",1.5);
120 desc.
add<
double>(
"minLowHitE",10.0);
121 desc.
add<
double>(
"minHighHitE",25.0);
122 desc.
add<
double>(
"minR45HitE",5.0);
123 desc.
add<
double>(
"TS4TS5EnergyThreshold",50.0);
125 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000 };
126 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
127 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
128 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
129 std::vector<double>
TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray+5);
130 std::vector<double>
TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray+5);
131 std::vector<double>
TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray+7);
132 std::vector<double>
TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray+7);
138 descriptions.
add(
"hltHcalMETNoiseCleaner",desc);
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);
166 iEvent.
put(CleanedMET);
173 if(!rbxs_h.isValid()) {
174 edm::LogError(
"DataNotFound") <<
"HLTHcalMETNoiseCleaner: Could not find HcalNoiseRBXCollection product named "
176 CleanedMET->push_back(inCaloMet);
177 iEvent.
put(CleanedMET);
183 for(HcalNoiseRBXCollection::const_iterator it=rbxs_h->begin(); it!=rbxs_h->end(); ++it) {
191 CleanedMET->push_back(inCaloMet);
192 iEvent.
put(CleanedMET);
201 metVec.SetPtEtaPhi(met_h->front().pt(), 0, met_h->front().phi() );
203 TVector3 noiseHPDVector(0,0,0);
204 TVector3 secondHPDVector(0,0,0);
205 for(noisedataset_t::const_iterator it=
data.begin();
209 bool passFilter=
true;
212 if(it->validRatio() && it->ratio()<
minRatio_) passFilter=
false;
213 else if(it->validRatio() && it->ratio()>
maxRatio_) passFilter=
false;
214 else if(it->numHPDHits()>=
minHPDHits_) passFilter=
false;
215 else if(it->numRBXHits()>=
minRBXHits_) passFilter=
false;
217 else if(it->numZeros()>=
minZeros_) passFilter=
false;
220 else if(!it->PassTS4TS5()) passFilter=
false;
229 LogDebug(
"") <<
"HLTHcalMETNoiseCleaner debug: Found a noisy RBX: "
230 <<
"energy=" << it->energy() <<
"; "
231 <<
"ratio=" << it->ratio() <<
"; "
232 <<
"# RBX hits=" << it->numRBXHits() <<
"; "
233 <<
"# HPD hits=" << it->numHPDHits() <<
"; "
234 <<
"# Zeros=" << it->numZeros() <<
"; "
235 <<
"min time=" << it->minHighEHitTime() <<
"; "
236 <<
"max time=" << it->maxHighEHitTime() <<
"; "
237 <<
"passTS4TS5=" << it->PassTS4TS5() <<
"; "
238 <<
"RBX EMF=" << it->RBXEMF()
245 if(isNoise && nNoise==1){
249 for( noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++){
251 towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(),(*noiseTowersIt)->eta(),(*noiseTowersIt)->phi());
252 noiseHPDVector+=towerVec;
254 if(noiseHPDVector.Mag()>0) noiseHPDVector.SetPtEtaPhi(noiseHPDVector.Pt(),0,noiseHPDVector.Phi());
255 else noiseHPDVector.SetPtEtaPhi(0,0,0);
258 if(isNoise && cntr > 0){
259 CleanedMET->push_back(inCaloMet);
260 iEvent.
put(CleanedMET);
264 if(!isNoise && cntr == 0){
265 CleanedMET->push_back(inCaloMet);
266 iEvent.
put(CleanedMET);
270 if(!isNoise && nNoise>0){
273 for( noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++){
275 towerVec.SetPtEtaPhi((*noiseTowersIt)->pt(),(*noiseTowersIt)->eta(),(*noiseTowersIt)->phi());
276 secondHPDVector+=towerVec;
278 if(secondHPDVector.Mag()>0) secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(),0,secondHPDVector.Phi());
279 else secondHPDVector.SetPtEtaPhi(0,0,0);
284 if(noiseHPDVector.Mag()==0){
285 CleanedMET->push_back(inCaloMet);
286 iEvent.
put(CleanedMET);
294 float METsumet = met_h->front().energy();
296 metVec+=noiseHPDVector;
298 float ZMETsumet = METsumet-noiseHPDVector.Mag();
299 float ZMETpt = metVec.Pt();
300 float ZMETphi = metVec.Phi();
307 if(secondHPDVector.Mag()>0.){
308 secondHPDVector.SetPtEtaPhi(secondHPDVector.Pt(),noiseHPDVector.Eta(),noiseHPDVector.Phi());
309 metVec-= secondHPDVector;
310 SMETsumet = METsumet-noiseHPDVector.Mag();
311 SMETpt = metVec.Pt();
312 SMETphi = metVec.Phi();
315 float CorMetSumEt,CorMetPt,CorMetPhi;
317 CorMetSumEt = ZMETsumet;
321 CorMetSumEt = SMETsumet;
327 CleanedMET->push_back(corMet);
328 iEvent.
put(CleanedMET);
361 p4TL.SetPtEtaPhiM(pt,0.,phi,0.);
362 const LorentzVector
p4(p4TL.X(),p4TL.Y(),0,p4TL.T());
363 const Point vtx( 0.0, 0.0, 0.0 );
T getParameter(std::string const &) const
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~HLTHcalMETNoiseCleaner()
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.
edm::InputTag CaloMetCollectionTag_
reco::CaloMET BuildCaloMet(float sumet, float pt, float phi)
const_iterator begin() const
Initialize an iterator over the RefVector.
virtual bool filter(edm::Event &, const edm::EventSetup &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
HLTHcalMETNoiseCleaner(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::InputTag HcalNoiseRBXCollectionTag_
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool accept2NoiseRBXEvents_
tuple TS4TS5LowerThreshold
tuple TS4TS5UpperThreshold
double TS4TS5EnergyThreshold_
math::PtEtaPhiELorentzVectorF LorentzVector
std::vector< std::pair< double, double > > TS4TS5LowerCut_