16 std::vector<spr::propagatedTrackID>& vdetIds,
22 const DetId coreDet = vdetIds[trkIndex].detIdECAL;
26 std::cout <<
"DetId " << (
EBDetId)(coreDet) <<
" Flag " << vdetIds[trkIndex].okECAL << std::endl;
28 std::cout <<
"DetId " << (
EEDetId)(coreDet) <<
" Flag " << vdetIds[trkIndex].okECAL << std::endl;
31 double maxNearP = -1.0;
32 if (vdetIds[trkIndex].okECAL) {
36 std::cout <<
"chargeIsolationEcal:: eta/phi/dets " <<
ieta <<
" " <<
iphi <<
" " << vdets.size() << std::endl;
39 for (
unsigned int indx = 0; indx < vdetIds.size(); ++indx) {
40 if (indx != trkIndex && vdetIds[indx].
ok && vdetIds[indx].okECAL) {
41 const DetId anyCell = vdetIds[indx].detIdECAL;
43 const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
44 if (maxNearP < pTrack->
p())
45 maxNearP = pTrack->
p();
54 reco::TrackCollection::const_iterator trkItr,
69 std::cout <<
"chargeIsolation:: eta/phi/dets " <<
ieta <<
" " <<
iphi <<
" " << vdets.size() << std::endl;
71 double maxNearP = -1.0;
75 reco::TrackCollection::const_iterator trkItr2;
76 for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
80 if ((trkItr2 != trkItr) && trkQuality) {
90 std::cout <<
"chargeIsolationEcal Cell " << (
EBDetId)(anyCell) <<
" pt " << pTrack2->
p() << std::endl;
92 if (maxNearP < pTrack2->
p())
93 maxNearP = pTrack2->
p();
101 std::cout <<
"chargeIsolationEcal Cell " << (
EEDetId)(anyCell) <<
" pt " << pTrack2->
p() << std::endl;
103 if (maxNearP < pTrack2->
p())
104 maxNearP = pTrack2->
p();
115 std::vector<spr::propagatedTrackID>& vdetIds,
120 std::vector<DetId> dets(1, vdetIds[trkIndex].detIdHCAL);
123 std::cout <<
"DetId " << (
HcalDetId)(dets[0]) <<
" Flag " << vdetIds[trkIndex].okHCAL << std::endl;
126 double maxNearP = -1.0;
127 if (vdetIds[trkIndex].okHCAL) {
131 std::cout <<
"chargeIsolationHcal:: eta/phi/dets " <<
ieta <<
" " <<
iphi <<
" " << vdets.size() << std::endl;
133 for (
unsigned indx = 0; indx < vdetIds.size(); ++indx) {
134 if (indx != trkIndex && vdetIds[indx].
ok && vdetIds[indx].okHCAL) {
135 const DetId anyCell = vdetIds[indx].detIdHCAL;
137 const reco::Track* pTrack = &(*(vdetIds[indx].trkItr));
140 std::cout <<
"chargeIsolationHcal Cell " << (
HcalDetId)(anyCell) <<
" pt " << pTrack->
p() << std::endl;
142 if (maxNearP < pTrack->
p())
143 maxNearP = pTrack->
p();
155 const DetId ClosestCell,
163 std::vector<DetId> dets(1, ClosestCell);
172 for (
unsigned int i = 0;
i < vdets.size();
i++) {
177 double maxNearP = -1.0;
180 reco::TrackCollection::const_iterator trkItr2;
181 for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
185 if ((trkItr2 != trkItr) && trkQuality) {
191 std::cout <<
"Track2 (p,eta,phi) " << pTrack2->
p() <<
" " << pTrack2->
eta() <<
" " << pTrack2->
phi()
198 if (maxNearP < pTrack2->
p())
199 maxNearP = pTrack2->
p();
203 std::cout <<
"maxNearP " << maxNearP <<
" thisCell " << (
HcalDetId)anyCell <<
" (" <<
info.first.x() <<
","
204 <<
info.first.y() <<
"," <<
info.first.z() <<
")" << std::endl;
214 bool isIsolated =
true;
215 for (
unsigned int i = 0;
i < vdets.size();
i++) {
216 if (anyCell == vdets[
i]) {
226 reco::TrackCollection::const_iterator trkItr,
232 int& nLayers_maxNearP,
233 int& trkQual_maxNearP,
234 double& maxNearP_goodTrk,
239 nLayers_maxNearP = 0;
240 trkQual_maxNearP = -1;
241 maxNearP_goodTrk = -999.0;
242 double maxNearP = -999.0;
246 reco::TrackCollection::const_iterator trkItr2;
247 for (trkItr2 = trkCollection->begin(); trkItr2 != trkCollection->end(); ++trkItr2) {
254 trkQual_maxNearP = 1;
260 if (trkItr2 != trkItr) {
271 if (isConeChargedIso == 0) {
273 if (maxNearP < pTrack2->
p()) {
274 maxNearP = pTrack2->
p();
275 if (trkQual_maxNearP > 0 && nLayers_maxNearP > 7 && maxNearP_goodTrk < pTrack2->
p()) {
276 maxNearP_goodTrk = pTrack2->
p();
288 std::vector<spr::propagatedTrackDirection>& trkDirs,
292 double maxNearP = -1.0;
294 if (trkDirs[trkIndex].okHCAL) {
297 std::cout <<
"chargeIsolationCone with " << trkDirs.size() <<
" tracks " << std::endl;
299 for (
unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
300 if (indx != trkIndex && trkDirs[indx].
ok && trkDirs[indx].okHCAL) {
302 trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL,
dR);
303 if (isConeChargedIso == 0) {
305 const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
306 if (maxNearP < pTrack->
p())
307 maxNearP = pTrack->
p();
314 std::cout <<
"chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL <<
" maxNearP " << maxNearP << std::endl;
320 std::vector<spr::propagatedTrackDirection>& trkDirs,
323 double maxNearP = -1.0;
325 if (trkDirs[trkIndex].okHCAL) {
328 std::cout <<
"chargeIsolationCone with " << trkDirs.size() <<
" tracks " << std::endl;
330 for (
unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
331 if (indx != trkIndex && trkDirs[indx].
ok && trkDirs[indx].okHCAL) {
333 trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL,
dR);
334 if (isConeChargedIso == 0) {
335 const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
336 sumP += (pTrack->
p());
337 if (maxNearP < pTrack->
p())
338 maxNearP = pTrack->
p();
345 std::cout <<
"chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL <<
" maxNearP " << maxNearP <<
":" << sumP
348 return std::pair<double, double>(maxNearP, sumP);