46 #include <TLorentzVector.h>
54 : HcalNoiseRBXCollectionTag_(iConfig.getParameter<edm::InputTag>(
"HcalNoiseRBXCollection")),
55 TowerCollectionTag_(iConfig.getParameter<edm::InputTag>(
"CaloTowerCollection")),
56 severity_(iConfig.getParameter<int> (
"severity")),
57 maxNumRBXs_(iConfig.getParameter<int>(
"maxNumRBXs")),
58 numRBXsToConsider_(iConfig.getParameter<int>(
"numRBXsToConsider")),
59 needEMFCoincidence_(iConfig.getParameter<bool>(
"needEMFCoincidence")),
60 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
61 minRatio_(iConfig.getParameter<double>(
"minRatio")),
62 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
63 minHPDHits_(iConfig.getParameter<int>(
"minHPDHits")),
64 minRBXHits_(iConfig.getParameter<int>(
"minRBXHits")),
65 minHPDNoOtherHits_(iConfig.getParameter<int>(
"minHPDNoOtherHits")),
66 minZeros_(iConfig.getParameter<int>(
"minZeros")),
67 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
68 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
69 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
70 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
71 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
72 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
73 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold"))
76 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
77 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
78 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
79 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
81 for(
int i = 0;
i < (int)TS4TS5UpperThresholdTemp.size() &&
i < (int)TS4TS5UpperCutTemp.size();
i++)
82 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[i]));
85 for(
int i = 0; i < (int)TS4TS5LowerThresholdTemp.size() && i < (int)TS4TS5LowerCutTemp.size(); i++)
86 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
89 produces<CaloTowerCollection>();
100 desc.
add<
double>(
"maxTowerNoiseEnergyFraction",0.5);
101 desc.
add<
int>(
"severity",1);
102 desc.
add<
int>(
"maxNumRBXs",2);
103 desc.
add<
int>(
"numRBXsToConsider",2);
104 desc.
add<
bool>(
"needEMFCoincidence",
true);
105 desc.
add<
double>(
"minRBXEnergy",50.0);
106 desc.
add<
double>(
"minRatio",-999.);
107 desc.
add<
double>(
"maxRatio",999.);
108 desc.
add<
int>(
"minHPDHits",17);
109 desc.
add<
int>(
"minRBXHits",999);
110 desc.
add<
int>(
"minHPDNoOtherHits",10);
111 desc.
add<
int>(
"minZeros",10);
112 desc.
add<
double>(
"minHighEHitTime",-9999.0);
113 desc.
add<
double>(
"maxHighEHitTime",9999.0);
114 desc.
add<
double>(
"maxRBXEMF",0.02);
115 desc.
add<
double>(
"minRecHitE",1.5);
116 desc.
add<
double>(
"minLowHitE",10.0);
117 desc.
add<
double>(
"minHighHitE",25.0);
118 desc.
add<
double>(
"TS4TS5EnergyThreshold",50.0);
120 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000 };
121 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
122 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
123 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
124 std::vector<double> TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray+5);
125 std::vector<double> TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray+5);
126 std::vector<double> TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray+7);
127 std::vector<double> TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray+7);
129 desc.
add<std::vector<double> >(
"TS4TS5UpperThreshold", TS4TS5UpperThreshold);
130 desc.
add<std::vector<double> >(
"TS4TS5UpperCut", TS4TS5UpperCut);
131 desc.
add<std::vector<double> >(
"TS4TS5LowerThreshold", TS4TS5LowerThreshold);
132 desc.
add<std::vector<double> >(
"TS4TS5LowerCut", TS4TS5LowerCut);
133 descriptions.
add(
"hltHcalTowerNoiseCleaner",desc);
142 using namespace reco;
148 std::set<unsigned int> noisyTowers;
150 if(not tower_h.isValid()){
151 edm::LogError(
"HLTHcalTowerNoiseCleaner") <<
"Input Tower Collection is not Valid";
159 if(!rbxs_h.isValid()) {
160 edm::LogWarning(
"HLTHcalTowerNoiseCleaner") <<
"Could not find HcalNoiseRBXCollection product named "
167 for(HcalNoiseRBXCollection::const_iterator it=rbxs_h->begin(); it!=rbxs_h->end(); ++it) {
177 for(noisedataset_t::const_iterator it=
data.begin();
182 bool passFilter=
true;
185 if(it->validRatio() && it->ratio()<
minRatio_) passFilter=
false;
186 else if(it->validRatio() && it->ratio()>
maxRatio_) passFilter=
false;
187 else if(it->numHPDHits()>=
minHPDHits_) passFilter=
false;
188 else if(it->numRBXHits()>=
minRBXHits_) passFilter=
false;
190 else if(it->numZeros()>=
minZeros_) passFilter=
false;
193 else if(!it->PassTS4TS5()) passFilter=
false;
202 LogDebug(
"") <<
"HLTHcalTowerNoiseCleaner debug: Found a noisy RBX: "
203 <<
"energy=" << it->energy() <<
"; "
204 <<
"ratio=" << it->ratio() <<
"; "
205 <<
"# RBX hits=" << it->numRBXHits() <<
"; "
206 <<
"# HPD hits=" << it->numHPDHits() <<
"; "
207 <<
"# Zeros=" << it->numZeros() <<
"; "
208 <<
"min time=" << it->minHighEHitTime() <<
"; "
209 <<
"max time=" << it->maxHighEHitTime() <<
"; "
210 <<
"passTS4TS5=" << it->PassTS4TS5() <<
"; "
211 <<
"RBX EMF=" << it->RBXEMF()
217 for( noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++){
220 noisyTowers.insert(
id.denseIndex() );
230 for(inTowersIt = tower_h->begin(); inTowersIt != tower_h->end(); inTowersIt++){
233 if(noisyTowers.find(
id.denseIndex() ) == noisyTowers.end()){
234 OutputTowers->push_back(*inTowersIt);
237 iEvent.
put(OutputTowers);
T getParameter(std::string const &) const
edm::InputTag TowerCollectionTag_
HLTHcalTowerNoiseCleaner(const edm::ParameterSet &)
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
std::vector< CaloTower >::const_iterator const_iterator
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
std::vector< std::pair< double, double > > TS4TS5UpperCut_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::InputTag HcalNoiseRBXCollectionTag_
virtual void produce(edm::Event &, const edm::EventSetup &)
CaloTowerDetId id() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~HLTHcalTowerNoiseCleaner()
double TS4TS5EnergyThreshold_
char data[epos_bytes_allocation]
edm::SortedCollection< CaloTower > CaloTowerCollection
ProductID id() const
Accessor for product ID.
std::vector< std::pair< double, double > > TS4TS5LowerCut_