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) {
272 if (isConeChargedIso == 0) {
274 if (maxNearP < pTrack2->
p()) {
275 maxNearP = pTrack2->
p();
276 if (trkQual_maxNearP > 0 && nLayers_maxNearP > 7 && maxNearP_goodTrk < pTrack2->
p()) {
277 maxNearP_goodTrk = pTrack2->
p();
289 std::vector<spr::propagatedTrackDirection>& trkDirs,
293 double maxNearP = -1.0;
295 if (trkDirs[trkIndex].okHCAL) {
298 std::cout <<
"chargeIsolationCone with " << trkDirs.size() <<
" tracks " << std::endl;
300 for (
unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
301 if (indx != trkIndex && trkDirs[indx].
ok && trkDirs[indx].okHCAL) {
303 trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL,
dR);
304 if (isConeChargedIso == 0) {
306 const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
307 if (maxNearP < pTrack->
p())
308 maxNearP = pTrack->
p();
315 std::cout <<
"chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL <<
" maxNearP " << maxNearP << std::endl;
321 std::vector<spr::propagatedTrackDirection>& trkDirs,
324 double maxNearP = -1.0;
326 if (trkDirs[trkIndex].okHCAL) {
329 std::cout <<
"chargeIsolationCone with " << trkDirs.size() <<
" tracks " << std::endl;
331 for (
unsigned int indx = 0; indx < trkDirs.size(); ++indx) {
332 if (indx != trkIndex && trkDirs[indx].
ok && trkDirs[indx].okHCAL) {
334 trkDirs[trkIndex].pointHCAL, trkDirs[indx].pointHCAL, trkDirs[trkIndex].directionHCAL,
dR);
335 if (isConeChargedIso == 0) {
336 const reco::Track* pTrack = &(*(trkDirs[indx].trkItr));
337 sumP += (pTrack->
p());
338 if (maxNearP < pTrack->
p())
339 maxNearP = pTrack->
p();
346 std::cout <<
"chargeIsolationCone Track " << trkDirs[trkIndex].okHCAL <<
" maxNearP " << maxNearP <<
":" << sumP
349 return std::pair<double, double>(maxNearP, sumP);