37 1.005, 0.986, 1.086, 1.000, 1.000, 1.086, 0.986, 1.005, 0.981,
38 0.958, 0.956, 0.975, 0.965, 0.970, 1.105, 1.000, 1.000};
51 m_usePMTFlag = usePMTflag;
52 m_usePulseFlag = usePulseflag;
55 m_correctionSet = correctionSet;
57 for (
int ii = 0;
ii < 13;
ii++) {
58 m_cutByEta.push_back(-1);
59 m_seedmnEta.push_back(99);
60 m_seedMXeta.push_back(-1);
62 for (
int ii = 0;
ii < 73;
ii++) {
63 double minphi = 0.0872664 * (
ii - 1);
64 double maxphi = 0.0872664 * (
ii + 1);
65 while (minphi < -
M_PI)
69 while (maxphi < -
M_PI)
75 m_seedmnPhi.push_back(minphi);
76 m_seedMXphi.push_back(maxphi);
80 for (
int ii = 0;
ii < 13 * 2;
ii++)
81 m_correctionByEta.push_back(1.0);
82 if (m_correctionSet == 1) {
83 for (
int ii = 0;
ii < 13 * 2;
ii++)
94 std::vector<HFCompleteHit> protoseeds,
seeds;
96 std::vector<HFCompleteHit>::iterator
i;
97 std::vector<HFCompleteHit>::iterator
k;
103 bool doCluster =
false;
105 for (
j =
hf.begin();
j !=
hf.end();
j++) {
106 const int aieta =
j->id().ietaAbs();
107 int iz = (aieta - 29);
109 if (
j->id().depth() != 1)
111 if (aieta == 40 || aieta == 41 || aieta == 29)
114 if (iz < 0 || iz > 12) {
119 if (m_cutByEta[iz] < 0) {
121 m_cutByEta[iz] = m_seedThreshold * cosh(
eta);
122 auto ccg =
geom->getGeometry(
j->id());
124 for (
size_t sc = 0; sc < CellCorners.
size(); sc++) {
125 if (fabs(CellCorners[sc].z()) < 1200) {
126 if (fabs(CellCorners[sc].
eta()) < m_seedmnEta[iz])
127 m_seedmnEta[iz] = fabs(CellCorners[sc].
eta());
128 if (fabs(CellCorners[sc].
eta()) > m_seedMXeta[iz])
129 m_seedMXeta[iz] = fabs(CellCorners[sc].
eta());
133 double elong =
j->energy() * m_correctionByEta[
indexByEta(
j->id())];
134 if (elong > m_cutByEta[iz]) {
136 double eshort = (j2 ==
hf.end()) ? (0) : (j2->energy());
138 eshort *= m_correctionByEta[
indexByEta(j2->id())];
139 if (((elong - eshort) / (elong + eshort)) > m_maximumSL)
151 protoseeds.push_back(ahit);
155 if (!protoseeds.empty()) {
157 for (
i = protoseeds.begin();
i != protoseeds.end();
i++) {
161 if ((
i == protoseeds.begin()) && (isok)) {
167 for (dE = -2; dE <= 2; dE++)
168 for (dP = -4; dP <= 4; dP += 2) {
169 PWrap =
k->id.iphi() + dP;
175 if ((
i->id.iphi() == PWrap) && (
i->id.ieta() ==
k->id.ieta() + dE))
186 bool clusterOk = makeCluster(
i->id(),
hf,
geom, clusShp, Sclus);
188 clusterShapes.push_back(clusShp);
189 SuperClusters.push_back(Sclus);
220 std::vector<double> coreCanid;
221 std::vector<double>::const_iterator ci;
223 std::vector<DetId> usedHits;
229 bool clusterOk =
true;
233 bool edge_type1 = seedid.
ietaAbs() == 39 && (seedid.
iphi() % 4) == 3;
235 double e_seed = si->energy() * m_correctionByEta[
indexByEta(si->id())];
237 for (de = -2; de <= 2; de++)
238 for (
dp = -4;
dp <= 4;
dp += 2) {
239 phiWrap = seedid.
iphi() +
dp;
246 if (edge_type1 && de == seedid.
zside()) {
251 }
else if (
dp == -4) {
263 double e_short = 0.0;
265 e_long = il->energy() * m_correctionByEta[
indexByEta(il->id())];
266 if (e_long <= m_minTowerEnergy)
269 e_short = is->energy() * m_correctionByEta[
indexByEta(is->id())];
270 if (e_short <= m_minTowerEnergy)
272 double eRatio = (e_long - e_short) /
std::max(1.0, (e_long + e_short));
275 if ((
abs(eRatio) > m_maximumSL) && (
std::max(e_long, e_short) > m_maximumRenergy)) {
276 if (
dp == 0 && de == 0)
281 if ((il !=
hf.end()) && (isPMTHit(*il))) {
282 if (
dp == 0 && de == 0)
287 if (e_long > m_minTowerEnergy && il !=
hf.end()) {
289 usedHits.push_back(idl.rawId());
293 if ((de > -2) && (de < 2) && (
dp > -4) && (
dp < 4)) {
297 if ((
dp == 0) && (de == 0)) {
302 if ((de > -2) && (de < 2) && (
dp > -4) && (dp < 4) && (e_long > (.5 * e_seed))) {
303 coreCanid.push_back(e_long);
309 double d_p =
p.phi() - sp.
phi();
314 double d_e =
p.eta() - sp.
eta();
324 w_x += (
p.x()) * wgt;
325 w_y += (
p.y()) * wgt;
326 w_z += (
p.z()) * wgt;
330 if (
dp == 0 && de == 0)
334 if (e_short > m_minTowerEnergy && is !=
hf.end()) {
336 usedHits.push_back(ids.rawId());
340 if ((de > -2) && (de < 2) && (
dp > -4) && (
dp < 4)) {
344 if ((
dp == 0) && (de == 0)) {
354 std::sort(coreCanid.begin(), coreCanid.end(),
CompareHFCore());
355 for (ci = coreCanid.begin(); ci != coreCanid.end(); ci++) {
356 if (ci == coreCanid.begin()) {
358 }
else if (*ci > .5 * l_1e) {
368 double eta = xyzclus.eta();
370 double phi = xyzclus.phi();
378 int idx = fabs(seedid.
ieta()) - 29;
379 int ipx = seedid.
iphi();
380 double Cphi = (phi - m_seedmnPhi[ipx]) / (m_seedMXphi[ipx] - m_seedmnPhi[ipx]);
381 double Ceta = (fabs(
eta) - m_seedmnEta[
idx]) / (m_seedMXeta[
idx] - m_seedmnEta[
idx]);
384 HFEMClusterShape myClusShp(l_1, s_1, l_3, s_3, l_5, s_5, l_1e, Ceta, Cphi, seedid);
397 if (!(m_isMC && !m_forcePulseFlagMC))
405 for (
int ii = 0;
ii < 13;
ii++) {
406 m_cutByEta.push_back(-1);
407 m_seedmnEta.push_back(99);
408 m_seedMXeta.push_back(-1);