45 #include <TLorentzVector.h> 53 : HcalNoiseRBXCollectionTag_(iConfig.getParameter<
edm::
InputTag>(
"HcalNoiseRBXCollection")),
54 TowerCollectionTag_(iConfig.getParameter<
edm::
InputTag>(
"CaloTowerCollection")),
55 severity_(iConfig.getParameter<
int>(
"severity")),
56 maxNumRBXs_(iConfig.getParameter<
int>(
"maxNumRBXs")),
57 numRBXsToConsider_(iConfig.getParameter<
int>(
"numRBXsToConsider")),
58 needEMFCoincidence_(iConfig.getParameter<
bool>(
"needEMFCoincidence")),
59 minRBXEnergy_(iConfig.getParameter<double>(
"minRBXEnergy")),
60 minRatio_(iConfig.getParameter<double>(
"minRatio")),
61 maxRatio_(iConfig.getParameter<double>(
"maxRatio")),
62 minHPDHits_(iConfig.getParameter<
int>(
"minHPDHits")),
63 minRBXHits_(iConfig.getParameter<
int>(
"minRBXHits")),
64 minHPDNoOtherHits_(iConfig.getParameter<
int>(
"minHPDNoOtherHits")),
65 minZeros_(iConfig.getParameter<
int>(
"minZeros")),
66 minHighEHitTime_(iConfig.getParameter<double>(
"minHighEHitTime")),
67 maxHighEHitTime_(iConfig.getParameter<double>(
"maxHighEHitTime")),
68 maxRBXEMF_(iConfig.getParameter<double>(
"maxRBXEMF")),
69 minRecHitE_(iConfig.getParameter<double>(
"minRecHitE")),
70 minLowHitE_(iConfig.getParameter<double>(
"minLowHitE")),
71 minHighHitE_(iConfig.getParameter<double>(
"minHighHitE")),
73 TS4TS5EnergyThreshold_(iConfig.getParameter<double>(
"TS4TS5EnergyThreshold")) {
74 std::vector<double> TS4TS5UpperThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperThreshold");
75 std::vector<double> TS4TS5UpperCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5UpperCut");
76 std::vector<double> TS4TS5LowerThresholdTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerThreshold");
77 std::vector<double> TS4TS5LowerCutTemp = iConfig.
getParameter<std::vector<double> >(
"TS4TS5LowerCut");
79 for (
int i = 0;
i < (
int)TS4TS5UpperThresholdTemp.size() &&
i < (
int)TS4TS5UpperCutTemp.size();
i++)
80 TS4TS5UpperCut_.push_back(std::pair<double, double>(TS4TS5UpperThresholdTemp[
i], TS4TS5UpperCutTemp[i]));
83 for (
int i = 0; i < (
int)TS4TS5LowerThresholdTemp.size() && i < (
int)TS4TS5LowerCutTemp.size(); i++)
84 TS4TS5LowerCut_.push_back(std::pair<double, double>(TS4TS5LowerThresholdTemp[i], TS4TS5LowerCutTemp[i]));
90 if (iConfig.
existsAs<
double>(
"minR45HitE"))
93 produces<CaloTowerCollection>();
102 desc.
add<
double>(
"maxTowerNoiseEnergyFraction", 0.5);
103 desc.
add<
int>(
"severity", 1);
104 desc.
add<
int>(
"maxNumRBXs", 2);
105 desc.
add<
int>(
"numRBXsToConsider", 2);
106 desc.
add<
bool>(
"needEMFCoincidence",
true);
107 desc.
add<
double>(
"minRBXEnergy", 50.0);
108 desc.
add<
double>(
"minRatio", -999.);
109 desc.
add<
double>(
"maxRatio", 999.);
110 desc.
add<
int>(
"minHPDHits", 17);
111 desc.
add<
int>(
"minRBXHits", 999);
112 desc.
add<
int>(
"minHPDNoOtherHits", 10);
113 desc.
add<
int>(
"minZeros", 10);
114 desc.
add<
double>(
"minHighEHitTime", -9999.0);
115 desc.
add<
double>(
"maxHighEHitTime", 9999.0);
116 desc.
add<
double>(
"maxRBXEMF", 0.02);
117 desc.
add<
double>(
"minRecHitE", 1.5);
118 desc.
add<
double>(
"minLowHitE", 10.0);
119 desc.
add<
double>(
"minHighHitE", 25.0);
120 desc.
add<
double>(
"minR45HitE", 5.0);
121 desc.
add<
double>(
"TS4TS5EnergyThreshold", 50.0);
123 double TS4TS5UpperThresholdArray[5] = {70, 90, 100, 400, 4000};
124 double TS4TS5UpperCutArray[5] = {1, 0.8, 0.75, 0.72, 0.72};
125 double TS4TS5LowerThresholdArray[7] = {100, 120, 150, 200, 300, 400, 500};
126 double TS4TS5LowerCutArray[7] = {-1, -0.7, -0.4, -0.2, -0.08, 0, 0.1};
127 std::vector<double>
TS4TS5UpperThreshold(TS4TS5UpperThresholdArray, TS4TS5UpperThresholdArray + 5);
128 std::vector<double>
TS4TS5UpperCut(TS4TS5UpperCutArray, TS4TS5UpperCutArray + 5);
129 std::vector<double>
TS4TS5LowerThreshold(TS4TS5LowerThresholdArray, TS4TS5LowerThresholdArray + 7);
130 std::vector<double>
TS4TS5LowerCut(TS4TS5LowerCutArray, TS4TS5LowerCutArray + 7);
136 descriptions.
add(
"hltHcalTowerNoiseCleaner", desc);
144 using namespace reco;
150 std::set<unsigned int> noisyTowers;
153 edm::LogError(
"HLTHcalTowerNoiseCleaner") <<
"Input Tower Collection is not Valid";
172 for (
auto const& rbx : *rbxs_h) {
187 for (
auto const& it : data) {
188 bool passFilter =
true;
191 if (it.validRatio() && it.ratio() <
minRatio_)
193 else if (it.validRatio() && it.ratio() >
maxRatio_)
207 else if (!it.PassTS4TS5())
217 LogDebug(
"") <<
"HLTHcalTowerNoiseCleaner debug: Found a noisy RBX: " 218 <<
"energy=" << it.energy() <<
"; " 219 <<
"ratio=" << it.ratio() <<
"; " 220 <<
"# RBX hits=" << it.numRBXHits() <<
"; " 221 <<
"# HPD hits=" << it.numHPDHits() <<
"; " 222 <<
"# Zeros=" << it.numZeros() <<
"; " 223 <<
"min time=" << it.minHighEHitTime() <<
"; " 224 <<
"max time=" << it.maxHighEHitTime() <<
"; " 225 <<
"passTS4TS5=" << it.PassTS4TS5() <<
"; " 226 <<
"RBX EMF=" << it.RBXEMF() << std::endl;
231 for (noiseTowersIt = noiseTowers.
begin(); noiseTowersIt != noiseTowers.
end(); noiseTowersIt++) {
234 noisyTowers.insert(caloTowerTopology->
denseIndex(
id));
245 for (inTowersIt = tower_h->
begin(); inTowersIt != tower_h->
end(); inTowersIt++) {
248 if (noisyTowers.find(caloTowerTopology->
denseIndex(
id)) == noisyTowers.end()) {
249 OutputTowers->push_back(*inTowersIt);
T getParameter(std::string const &) const
edm::InputTag TowerCollectionTag_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
HLTHcalTowerNoiseCleaner(const edm::ParameterSet &)
~HLTHcalTowerNoiseCleaner() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::set< CommonHcalNoiseRBXData, noisedatacomp > noisedataset_t
std::vector< CaloTower >::const_iterator const_iterator
const_iterator end() const
Termination of iteration.
ProductID id() const
Accessor for product ID.
const_iterator begin() const
Initialize an iterator over the RefVector.
std::vector< std::pair< double, double > > TS4TS5UpperCut_
edm::EDGetTokenT< CaloTowerCollection > m_theCaloTowerCollectionToken
edm::SortedCollection< CaloTower > CaloTowerCollection
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::InputTag HcalNoiseRBXCollectionTag_
const_iterator end() const
uint32_t denseIndex(const DetId &id) const
CaloTowerDetId id() const
edm::EDGetTokenT< reco::HcalNoiseRBXCollection > m_theHcalNoiseToken
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double TS4TS5EnergyThreshold_
char data[epos_bytes_allocation]
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< std::pair< double, double > > TS4TS5LowerCut_
const_iterator begin() const