36 std::pair<Partition,int> hpdId (
HcalDetId fId) {
37 int hpd = fId.
iphi ();
40 partition = fId.
ieta() > 0 ? HBP : HBM;
43 partition = fId.
ieta() > 0 ? HEP : HEM;
44 if ((fId.
iphi ()-1) % 4 < 2) {
53 if (fId.
depth () == 1 || fId.
depth () == 3) hpd += 1;
68 if (fId.
depth () == 2) hpd += 1;
75 return std::pair<Partition,int> (partition, hpd);
80 mInputTag (iConfig.getParameter <edm::InputTag> (
"inputTag")),
81 mEnergyThreshold (iConfig.getParameter <double> (
"energy")),
82 mHPDSpikeEnergyThreshold (iConfig.getParameter <double> (
"hpdSpikeEnergy")),
83 mHPDSpikeIsolationEnergyThreshold (iConfig.getParameter <double> (
"hpdSpikeIsolationEnergy")),
84 mRBXSpikeEnergyThreshold (iConfig.getParameter <double> (
"rbxSpikeEnergy")),
85 mRBXSpikeUnbalanceThreshold (iConfig.getParameter <double> (
"rbxSpikeUnbalance"))
95 desc.
add<
double>(
"energy",-99.0);
96 desc.
add<
double>(
"hpdSpikeEnergy",10.0);
97 desc.
add<
double>(
"hpdSpikeIsolationEnergy",1.0);
98 desc.
add<
double>(
"rbxSpikeEnergy",50.0);
99 desc.
add<
double>(
"rbxSpikeUnbalance",0.2);
100 descriptions.
add(
"hltHPDFilter",desc);
111 float hpdEnergy[4][73];
112 for (
size_t i = 0;
i < 4; ++
i)
for (
size_t j = 0;
j < 73; ++
j) hpdEnergy[
i][
j] = 0;
115 for (
unsigned i = 0;
i < hbhe->size(); ++
i) {
117 std::pair<Partition,int> hpd = hpdId ((*hbhe)[
i].
id());
118 hpdEnergy[int (hpd.first)][hpd.second] += (*hbhe)[
i].energy ();
124 for (
size_t partition = 0; partition < 4; ++partition) {
125 for (
size_t i = 1;
i < 73; ++
i) {
128 if (hpdPlus == 73) hpdPlus = 1;
129 int hpdMinus =
i - 1;
130 if (hpdMinus == 0) hpdMinus = 72;
131 double maxNeighborEnergy = fmax (hpdEnergy[partition][hpdPlus], hpdEnergy[partition][hpdMinus]);
140 for (
size_t partition = 0; partition < 4; ++partition) {
141 for (
size_t rbx = 1; rbx < 19; ++rbx) {
142 int ifirst = (rbx-1)*4-1;
143 int iend = (rbx-1)*4+3;
144 double minEnergy = 0;
145 double maxEnergy = -1;
146 double totalEnergy = 0;
147 for (
int irm = ifirst; irm < iend; ++irm) {
149 if (hpd <= 0) hpd = 72 + hpd;
150 totalEnergy += hpdEnergy[partition][hpd];
151 if (minEnergy > maxEnergy) {
152 minEnergy = maxEnergy = hpdEnergy[partition][hpd];
155 if (hpdEnergy[partition][hpd] < minEnergy) minEnergy = hpdEnergy[partition][hpd];
156 if (hpdEnergy[partition][hpd] > maxEnergy) maxEnergy = hpdEnergy[partition][hpd];
HcalSubdetector subdet() const
get the subdetector
HLTHPDFilter(const edm::ParameterSet &)
double mRBXSpikeEnergyThreshold
virtual bool filter(edm::Event &, const edm::EventSetup &)
int depth() const
get the tower depth
int ieta() const
get the cell ieta
double mHPDSpikeIsolationEnergyThreshold
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double mRBXSpikeUnbalanceThreshold
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iphi() const
get the cell iphi
double mHPDSpikeEnergyThreshold
void add(std::string const &label, ParameterSetDescription const &psetDescription)