12 std::vector<PCaloHit>&
hits,
24 HcalDetId hcid(hcid0.subdet(), hcid0.ieta(), hcid0.iphi(), 1);
25 DetId det(hcid.rawId());
28 <<
" Inclusion of HO Flag " << includeHO;
31 std::vector<DetId> dets(1, det);
34 edm::LogVerbatim(
"IsoTrack") <<
"matrixHCALIds::Total number of cells found is " << vdets.size();
39 for (
unsigned int i = 0;
i < vdets.size();
i++) {
42 int subdet = ((
HcalDetId)(vdets[
i].rawId())).subdet();
44 for (
unsigned int ihit = 0; ihit <
hit.size(); ihit++) {
68 std::vector<PCaloHit>&
hits,
75 HcalDetId hcid(hcid0.subdet(), hcid0.ieta(), hcid0.iphi(), 1);
76 DetId det(hcid.rawId());
77 std::vector<DetId> dets(1, det);
81 std::vector<std::vector<PCaloHit>::const_iterator> hitlist;
82 for (
unsigned int i = 0;
i < vdets.size();
i++) {
84 hitlist.insert(hitlist.end(),
hit.begin(),
hit.end());
88 for (
unsigned int ihit = 0; ihit < hitlist.size(); ihit++)
93 std::vector<double> energies;
94 for (
unsigned int ihit = 0; ihit < hitlist.size(); ihit++) {
95 double energy = hitlist[ihit]->energy();
100 for (
unsigned int idet = 0; idet < dets.size(); ++idet) {
109 energies.push_back(
energy);
113 double energyMax(-99.);
114 for (
unsigned int ihit = 0; ihit < dets.size(); ihit++) {
115 if (energies[ihit] > energyMax) {
116 energyMax = energies[ihit];
124 std::vector<PCaloHit>&
hits,
136 int subdet = detId.
subdet();
141 <<
" Threshold (E) " << eThr <<
" (T) " << tMin <<
":" << tMax;
146 DetId det(hcid.rawId());
149 for (
unsigned int ihit = 0; ihit <
hit.size(); ++ihit) {
150 if (
hit[ihit]->
time() > tMin &&
hit[ihit]->time() < tMax)
153 edm::LogVerbatim(
"IsoTrack") <<
"energyHCALCell:: Hit[" << ihit <<
"] " << hcid <<
" E " 154 <<
hit[ihit]->energy() <<
" t " <<
hit[ihit]->time();
159 <<
" threshold " << eThr;
161 energyCell.push_back(std::pair<double, int>(
energy,
i + 1));
166 std::ostringstream st1;
167 st1 <<
"energyHCALCell:: " << energyCell.size() <<
" entries from " <<
maxDepth <<
" depths:";
168 for (
unsigned int i = 0;
i < energyCell.size(); ++
i) {
169 st1 <<
" [" <<
i <<
"] (" << energyCell[
i].first <<
":" << energyCell[
i].second <<
")";
176 std::vector<HcalDetId> dets;
177 std::vector<double> energies;
178 for (
unsigned int ihit = 0; ihit <
hit.size(); ihit++) {
181 if ((id0.subdet() !=
HcalOuter) || includeHO) {
184 for (
unsigned int idet = 0; idet < dets.size(); ++idet) {
185 if (
id1 == dets[idet]) {
193 energies.push_back(
energy);
197 double energyMax(-99.);
199 for (
unsigned int ihit = 0; ihit < dets.size(); ihit++) {
200 if (energies[ihit] > energyMax) {
201 energyMax = energies[ihit];
202 hotCell = dets[ihit];
209 std::vector<HcalDetId> dets;
210 std::vector<double> energies;
211 for (
unsigned int ihit = 0; ihit <
hit.size(); ihit++) {
217 for (
unsigned int idet = 0; idet < dets.size(); ++idet) {
218 if (
id1 == dets[idet]) {
226 energies.push_back(
energy);
230 double energyMax(-99.);
232 for (
unsigned int ihit = 0; ihit < dets.size(); ihit++) {
233 if (energies[ihit] > energyMax) {
234 energyMax = energies[ihit];
235 hotCell = dets[ihit];
241 double eHCALThreshold(
int subdet,
double hbThr,
double heThr,
double hfThr,
double hoThr) {
Log< level::Info, true > LogVerbatim
std::vector< typename T::const_iterator > findHit(edm::Handle< T > &hits, DetId thisDet, bool debug=false)
constexpr int ietaAbs() const
get the absolute value of the cell ieta
void debugHcalDets(unsigned int, std::vector< DetId > &)
HcalDetId getHotCell(std::vector< HBHERecHitCollection::const_iterator > &hit, bool includeHO, int useRaw=0, bool debug=false)
double eHCALThreshold(int subdet, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100)
constexpr HcalSubdetector subdet() const
get the subdetector
constexpr int ieta() const
get the cell ieta
double getRawEnergy(HBHERecHitCollection::const_iterator hit, int useRaw=0)
constexpr uint32_t rawId() const
get the raw id
std::vector< DetId > matrixHCALIds(std::vector< DetId > &dets, const HcalTopology *topology, int ieta, int iphi, bool includeHO=false, bool debug=false)
double energySum(const DataFrame &df, int fs, int ls)
void energyHCALCell(HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, int depthHE=3, bool debug=false)
constexpr int iphi() const
get the cell iphi
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)