27 #include <Math/GenVector/VectorUtil.h>
36 #include "TDirectory.h"
156 double deltaPhi(
double v1,
double v2);
157 double deltaR(
double eta1,
double phi1,
double eta2,
double phi2);
167 std::map<std::pair<unsigned int, std::string>,
int>
l1AlgoMap_;
302 : trackerHitAssociatorConfig_(consumesCollector()),
303 doMC_(iConfig.getUntrackedParameter<
bool>(
"doMC",
false)),
304 writeAllTracks_(iConfig.getUntrackedParameter<
bool>(
"writeAllTracks",
false)),
305 myverbose_(iConfig.getUntrackedParameter<
int>(
"verbosity", 5)),
306 pvTracksPtMin_(iConfig.getUntrackedParameter<double>(
"pvTracksPtMin", 1.0)),
307 debugTrks_(iConfig.getUntrackedParameter<
int>(
"debugTracks", 0)),
308 printTrkHitPattern_(iConfig.getUntrackedParameter<
bool>(
"printTrkHitPattern",
false)),
309 minTrackP_(iConfig.getUntrackedParameter<double>(
"minTrackP", 1.0)),
310 maxTrackEta_(iConfig.getUntrackedParameter<double>(
"maxTrackEta", 5.0)),
311 debugL1Info_(iConfig.getUntrackedParameter<
bool>(
"debugL1Info",
false)),
312 L1TriggerAlgoInfo_(iConfig.getUntrackedParameter<
bool>(
"l1TriggerAlgoInfo",
false)),
313 tMinE_(iConfig.getUntrackedParameter<double>(
"timeMinCutECAL", -500.)),
314 tMaxE_(iConfig.getUntrackedParameter<double>(
"timeMaxCutECAL", 500.)),
315 tMinH_(iConfig.getUntrackedParameter<double>(
"timeMinCutHCAL", -500.)),
316 tMaxH_(iConfig.getUntrackedParameter<double>(
"timeMaxCutHCAL", 500.)),
317 t_L1AlgoNames(nullptr),
318 t_L1PreScale(nullptr),
319 t_L1CenJetPt(nullptr),
320 t_L1CenJetEta(nullptr),
321 t_L1CenJetPhi(nullptr),
322 t_L1FwdJetPt(nullptr),
323 t_L1FwdJetEta(nullptr),
324 t_L1FwdJetPhi(nullptr),
325 t_L1TauJetPt(nullptr),
326 t_L1TauJetEta(nullptr),
327 t_L1TauJetPhi(nullptr),
329 t_L1MuonEta(nullptr),
330 t_L1MuonPhi(nullptr),
331 t_L1IsoEMPt(nullptr),
332 t_L1IsoEMEta(nullptr),
333 t_L1IsoEMPhi(nullptr),
334 t_L1NonIsoEMPt(nullptr),
335 t_L1NonIsoEMEta(nullptr),
336 t_L1NonIsoEMPhi(nullptr),
343 t_PVTracksSumPt(nullptr),
344 t_PVTracksSumPtWt(nullptr),
345 t_PVTracksSumPtHP(nullptr),
346 t_PVTracksSumPtHPWt(nullptr),
347 t_PVisValid(nullptr),
348 t_PVNTracks(nullptr),
349 t_PVNTracksWt(nullptr),
351 t_PVNTracksHP(nullptr),
352 t_PVNTracksHPWt(nullptr),
356 t_nTrksJetCalo(nullptr),
357 t_nTrksJetVtx(nullptr),
358 t_trackPAll(nullptr),
359 t_trackEtaAll(nullptr),
360 t_trackPhiAll(nullptr),
361 t_trackPdgIdAll(nullptr),
362 t_trackPtAll(nullptr),
363 t_trackDxyAll(nullptr),
364 t_trackDzAll(nullptr),
365 t_trackDxyPVAll(nullptr),
366 t_trackDzPVAll(nullptr),
367 t_trackChiSqAll(nullptr),
372 t_trackEcalEta(nullptr),
373 t_trackEcalPhi(nullptr),
374 t_trackHcalEta(nullptr),
375 t_trackHcalPhi(nullptr),
377 t_trackDxyBS(nullptr),
379 t_trackDzBS(nullptr),
380 t_trackDxyPV(nullptr),
381 t_trackDzPV(nullptr),
382 t_trackChiSq(nullptr),
383 t_trackPVIdx(nullptr),
384 t_NLayersCrossed(nullptr),
385 t_trackNOuterHits(nullptr),
386 t_trackHitsTOB(nullptr),
387 t_trackHitsTEC(nullptr),
388 t_trackHitInMissTOB(nullptr),
389 t_trackHitInMissTEC(nullptr),
390 t_trackHitInMissTIB(nullptr),
391 t_trackHitInMissTID(nullptr),
392 t_trackHitInMissTIBTID(nullptr),
393 t_trackHitOutMissTOB(nullptr),
394 t_trackHitOutMissTEC(nullptr),
395 t_trackHitOutMissTIB(nullptr),
396 t_trackHitOutMissTID(nullptr),
397 t_trackHitOutMissTOBTEC(nullptr),
398 t_trackHitInMeasTOB(nullptr),
399 t_trackHitInMeasTEC(nullptr),
400 t_trackHitInMeasTIB(nullptr),
401 t_trackHitInMeasTID(nullptr),
402 t_trackHitOutMeasTOB(nullptr),
403 t_trackHitOutMeasTEC(nullptr),
404 t_trackHitOutMeasTIB(nullptr),
405 t_trackHitOutMeasTID(nullptr),
406 t_trackOutPosOutHitDr(nullptr),
408 t_maxNearP31x31(nullptr),
409 t_maxNearP21x21(nullptr),
410 t_ecalSpike11x11(nullptr),
415 t_e7x7_10Sig(nullptr),
416 t_e9x9_10Sig(nullptr),
417 t_e11x11_10Sig(nullptr),
418 t_e15x15_10Sig(nullptr),
419 t_e7x7_15Sig(nullptr),
420 t_e9x9_15Sig(nullptr),
421 t_e11x11_15Sig(nullptr),
422 t_e15x15_15Sig(nullptr),
423 t_e7x7_20Sig(nullptr),
424 t_e9x9_20Sig(nullptr),
425 t_e11x11_20Sig(nullptr),
426 t_e15x15_20Sig(nullptr),
427 t_e7x7_25Sig(nullptr),
428 t_e9x9_25Sig(nullptr),
429 t_e11x11_25Sig(nullptr),
430 t_e15x15_25Sig(nullptr),
431 t_e7x7_30Sig(nullptr),
432 t_e9x9_30Sig(nullptr),
433 t_e11x11_30Sig(nullptr),
434 t_e15x15_30Sig(nullptr),
435 t_esimPdgId(nullptr),
436 t_simTrackP(nullptr),
437 t_trkEcalEne(nullptr),
440 t_esim11x11(nullptr),
441 t_esim15x15(nullptr),
442 t_esim7x7Matched(nullptr),
443 t_esim9x9Matched(nullptr),
444 t_esim11x11Matched(nullptr),
445 t_esim15x15Matched(nullptr),
446 t_esim7x7Rest(nullptr),
447 t_esim9x9Rest(nullptr),
448 t_esim11x11Rest(nullptr),
449 t_esim15x15Rest(nullptr),
450 t_esim7x7Photon(nullptr),
451 t_esim9x9Photon(nullptr),
452 t_esim11x11Photon(nullptr),
453 t_esim15x15Photon(nullptr),
454 t_esim7x7NeutHad(nullptr),
455 t_esim9x9NeutHad(nullptr),
456 t_esim11x11NeutHad(nullptr),
457 t_esim15x15NeutHad(nullptr),
458 t_esim7x7CharHad(nullptr),
459 t_esim9x9CharHad(nullptr),
460 t_esim11x11CharHad(nullptr),
461 t_esim15x15CharHad(nullptr),
462 t_maxNearHcalP3x3(nullptr),
463 t_maxNearHcalP5x5(nullptr),
464 t_maxNearHcalP7x7(nullptr),
472 t_trkHcalEne(nullptr),
476 t_hsim3x3Matched(nullptr),
477 t_hsim5x5Matched(nullptr),
478 t_hsim7x7Matched(nullptr),
479 t_hsim3x3Rest(nullptr),
480 t_hsim5x5Rest(nullptr),
481 t_hsim7x7Rest(nullptr),
482 t_hsim3x3Photon(nullptr),
483 t_hsim5x5Photon(nullptr),
484 t_hsim7x7Photon(nullptr),
485 t_hsim3x3NeutHad(nullptr),
486 t_hsim5x5NeutHad(nullptr),
487 t_hsim7x7NeutHad(nullptr),
488 t_hsim3x3CharHad(nullptr),
489 t_hsim5x5CharHad(nullptr),
490 t_hsim7x7CharHad(nullptr) {
513 tok_L1extTauJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraTauJetSource_);
514 tok_L1extCenJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraCenJetSource_);
515 tok_L1extFwdJet_ = consumes<l1extra::L1JetParticleCollection>(L1extraFwdJetSource_);
516 tok_L1extMu_ = consumes<l1extra::L1MuonParticleCollection>(L1extraMuonSource_);
517 tok_L1extIsoEm_ = consumes<l1extra::L1EmParticleCollection>(L1extraIsoEmSource_);
518 tok_L1extNoIsoEm_ = consumes<l1extra::L1EmParticleCollection>(L1extraNonIsoEmSource_);
519 tok_jets_ = consumes<reco::CaloJetCollection>(JetSrc_);
520 tok_hbhe_ = consumes<HBHERecHitCollection>(HBHERecHitSource_);
536 <<
" doMC " <<
doMC_ <<
"\t myverbose " <<
myverbose_ <<
"\t minTrackP "
749 descriptions.
add(
"isolatedTracksNxN", desc);
753 bool haveIsoTrack =
false;
772 edm::LogVerbatim(
"IsoTrack") <<
"Number of Tracks " << trkCollection->size();
783 const bool l1Conf =
m_l1GtUtils->availableL1Configuration(iErrorCode, l1ConfCode);
786 <<
"\nL1 configuration code:" << l1ConfCode <<
"\nNo valid L1 trigger configuration available."
787 <<
"\nSee text above for error code interpretation"
788 <<
"\nNo return here, in order to test each method, protected against configuration error.";
798 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
800 int algBitNumber = (itAlgo->second).algoBitNumber();
801 l1AlgoMap_.insert(std::pair<std::pair<unsigned int, std::string>,
int>(
802 std::pair<unsigned int, std::string>(algBitNumber, algName), 0));
804 std::map<std::pair<unsigned int, std::string>,
int>::iterator
itr;
811 std::vector<int> algbits;
812 for (
CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
814 int algBitNumber = (itAlgo->second).algoBitNumber();
820 l1AlgoMap_[std::pair<unsigned int, std::string>(algBitNumber, algName)] += 1;
825 algbits.push_back(algBitNumber);
834 for (
int i = 0;
i < 128; ++
i) {
842 l1extra::L1JetParticleCollection::const_iterator
itr;
844 for (
itr = l1TauHandle->begin(), iL1Obj = 0;
itr != l1TauHandle->end(); ++
itr, iL1Obj++) {
852 <<
itr->eta() <<
" " <<
itr->phi();
859 for (
itr = l1CenJetHandle->begin(), iL1Obj = 0;
itr != l1CenJetHandle->end(); ++
itr, iL1Obj++) {
867 <<
itr->eta() <<
" " <<
itr->phi();
874 for (
itr = l1FwdJetHandle->begin(), iL1Obj = 0;
itr != l1FwdJetHandle->end(); ++
itr, iL1Obj++) {
882 <<
itr->eta() <<
" " <<
itr->phi();
887 l1extra::L1EmParticleCollection::const_iterator itrEm;
890 for (itrEm = l1IsoEmHandle->begin(), iL1Obj = 0; itrEm != l1IsoEmHandle->end(); ++itrEm, iL1Obj++) {
897 edm::LogVerbatim(
"IsoTrack") <<
"isoEm p/pt " << itrEm->momentum() <<
" " << itrEm->pt() <<
" eta/phi "
898 << itrEm->eta() <<
" " << itrEm->phi();
905 for (itrEm = l1NonIsoEmHandle->begin(), iL1Obj = 0; itrEm != l1NonIsoEmHandle->end(); ++itrEm, iL1Obj++) {
912 edm::LogVerbatim(
"IsoTrack") <<
"nonIsoEm p/pt " << itrEm->momentum() <<
" " << itrEm->pt() <<
" eta/phi "
913 << itrEm->eta() <<
" " << itrEm->phi();
918 l1extra::L1MuonParticleCollection::const_iterator itrMu;
921 for (itrMu = l1MuHandle->begin(), iL1Obj = 0; itrMu != l1MuHandle->end(); ++itrMu, iL1Obj++) {
928 edm::LogVerbatim(
"IsoTrack") <<
"l1muon p/pt " << itrMu->momentum() <<
" " << itrMu->pt() <<
" eta/phi "
929 << itrMu->eta() <<
" " << itrMu->phi();
939 std::vector<reco::Track> svTracks;
941 double sumPtMax = -1.0;
942 for (
unsigned int ind = 0; ind < recVtxs->size(); ind++) {
943 if (!((*recVtxs)[ind].isFake())) {
944 double vtxTrkSumPt = 0.0, vtxTrkSumPtWt = 0.0;
946 double vtxTrkSumPtHP = 0.0, vtxTrkSumPtHPWt = 0.0;
947 int vtxTrkNHP = 0, vtxTrkNHPWt = 0;
951 for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack != (*recVtxs)[ind].tracks_end(); vtxTrack++) {
955 bool trkQuality = (*vtxTrack)->quality(trackQuality_);
957 vtxTrkSumPt += (*vtxTrack)->pt();
959 vtxTrkSumPt += (*vtxTrack)->pt();
961 vtxTrkSumPtHP += (*vtxTrack)->pt();
965 double weight = (*recVtxs)[ind].trackWeight(*vtxTrack);
968 vtxTrkSumPtWt += (*vtxTrack)->pt();
971 vtxTrkSumPtHPWt += (*vtxTrack)->pt();
977 if (vtxTrkSumPt > sumPtMax) {
978 sumPtMax = vtxTrkSumPt;
979 leadPV =
math::XYZPoint((*recVtxs)[ind].
x(), (*recVtxs)[ind].
y(), (*recVtxs)[ind].
z());
982 t_PVx->push_back((*recVtxs)[ind].
x());
983 t_PVy->push_back((*recVtxs)[ind].
y());
984 t_PVz->push_back((*recVtxs)[ind].
z());
986 t_PVNTracks->push_back((*recVtxs)[ind].tracksSize());
998 edm::LogVerbatim(
"IsoTrack") <<
"PV " << ind <<
" isValid " << (*recVtxs)[ind].isValid() <<
" isFake "
999 << (*recVtxs)[ind].isFake() <<
" hasRefittedTracks() " << ind <<
" "
1000 << (*recVtxs)[ind].hasRefittedTracks() <<
" refittedTrksSize "
1001 << (*recVtxs)[ind].refittedTracks().size() <<
" tracksSize() "
1002 << (*recVtxs)[ind].tracksSize() <<
" sumPt " << vtxTrkSumPt;
1021 for (
unsigned int ijet = 0; ijet < (*jets).size(); ijet++) {
1061 if (!
hbhe.isValid()) {
1092 std::unique_ptr<TrackerHitAssociator> associate;
1105 std::vector<spr::propagatedTrackID> trkCaloDets;
1107 std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
1110 for (trkDetItr = trkCaloDets.begin(); trkDetItr != trkCaloDets.end(); trkDetItr++) {
1111 edm::LogVerbatim(
"IsoTrack") << trkDetItr->trkItr->p() <<
" " << trkDetItr->trkItr->eta() <<
" "
1112 << trkDetItr->okECAL <<
" " << trkDetItr->okHCAL;
1113 if (trkDetItr->okECAL) {
1114 if (trkDetItr->detIdECAL.subdetId() ==
EcalBarrel)
1119 if (trkDetItr->okHCAL)
1125 for (trkDetItr = trkCaloDets.begin(),
nTracks = 0; trkDetItr != trkCaloDets.end(); trkDetItr++,
nTracks++) {
1126 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1130 for (
unsigned int ind = 0; ind < recVtxs->size(); ind++) {
1131 if (!((*recVtxs)[ind].isFake())) {
1133 for (vtxTrack = (*recVtxs)[ind].tracks_begin(); vtxTrack != (*recVtxs)[ind].tracks_end(); vtxTrack++) {
1135 if (pTrack == pvtxTrack.
get()) {
1139 if (pTrack->
pt() > 1.0) {
1140 edm::LogVerbatim(
"IsoTrack") <<
"Debug the track association with vertex ";
1143 <<
" trkVtxIndex " << nvtxTracks <<
" vtx " << ind <<
" pt " << pTrack->
pt() <<
" eta "
1144 << pTrack->
eta() <<
" " << pTrack->
pt() - pvtxTrack->
pt() <<
" "
1145 << pTrack->
eta() - pvtxTrack->
eta();
1158 bool ifGood = pTrack->
quality(trackQuality_);
1159 double pt1 = pTrack->
pt();
1160 double p1 = pTrack->
p();
1162 double phi1 = pTrack->
momentum().phi();
1163 double etaEcal1 = trkDetItr->etaECAL;
1164 double phiEcal1 = trkDetItr->phiECAL;
1165 double etaHcal1 = trkDetItr->etaHCAL;
1166 double phiHcal1 = trkDetItr->phiHCAL;
1167 double dxy1 = pTrack->
dxy();
1168 double dz1 = pTrack->
dz();
1170 double dxybs1 = beamSpotH.
isValid() ? pTrack->
dxy(bspot) : pTrack->
dxy();
1171 double dzbs1 = beamSpotH.
isValid() ? pTrack->
dz(bspot) : pTrack->
dz();
1172 double dxypv1 = pTrack->
dxy();
1173 double dzpv1 = pTrack->
dz();
1174 if (pVtxTkId >= 0) {
1176 math::XYZPoint((*recVtxs)[pVtxTkId].
x(), (*recVtxs)[pVtxTkId].
y(), (*recVtxs)[pVtxTkId].
z());
1177 dxypv1 = pTrack->
dxy(thisTkPV);
1178 dzpv1 = pTrack->
dz(thisTkPV);
1188 if (ifGood && nLayersCrossed > 7) {
1212 edm::SimTrackContainer::const_iterator matchedSimTrkAll =
1219 double maxNearP31x31 = 999.0, maxNearP25x25 = 999.0, maxNearP21x21 = 999.0, maxNearP15x15 = 999.0;
1225 int iTrkEtaBin = -1, iTrkMomBin = -1;
1230 for (
unsigned int ipt = 0; ipt <
NPBins; ipt++) {
1234 if (iTrkMomBin >= 0 && iTrkEtaBin >= 0) {
1240 if (maxNearP31x31 < 0.0 && nLayersCrossed > 7 && nOuterHits > 4) {
1250 if (maxNearP31x31 < 1.0) {
1251 haveIsoTrack =
true;
1254 double simTrackP = -1;
1256 edm::SimTrackContainer::const_iterator matchedSimTrk =
1258 if (matchedSimTrk != SimTk->end())
1259 simTrackP = matchedSimTrk->momentum().P();
1266 std::pair<double, bool> e7x7P, e9x9P, e11x11P, e15x15P;
1267 std::pair<double, bool> e7x7_10SigP, e9x9_10SigP, e11x11_10SigP, e15x15_10SigP;
1268 std::pair<double, bool> e7x7_15SigP, e9x9_15SigP, e11x11_15SigP, e15x15_15SigP;
1269 std::pair<double, bool> e7x7_20SigP, e9x9_20SigP, e11x11_20SigP, e15x15_20SigP;
1270 std::pair<double, bool> e7x7_25SigP, e9x9_25SigP, e11x11_25SigP, e15x15_25SigP;
1271 std::pair<double, bool> e7x7_30SigP, e9x9_30SigP, e11x11_30SigP, e15x15_30SigP;
1274 spr::caloSimInfo simInfo11x11, simInfo13x13, simInfo15x15, simInfo21x21, simInfo25x25, simInfo31x31;
1275 double trkEcalEne = 0;
1277 const DetId isoCell = trkDetItr->detIdECAL;
1279 barrelRecHitsHandle,
1280 endcapRecHitsHandle,
1292 barrelRecHitsHandle,
1293 endcapRecHitsHandle,
1305 barrelRecHitsHandle,
1306 endcapRecHitsHandle,
1318 barrelRecHitsHandle,
1319 endcapRecHitsHandle,
1332 barrelRecHitsHandle,
1333 endcapRecHitsHandle,
1345 barrelRecHitsHandle,
1346 endcapRecHitsHandle,
1358 barrelRecHitsHandle,
1359 endcapRecHitsHandle,
1371 barrelRecHitsHandle,
1372 endcapRecHitsHandle,
1385 barrelRecHitsHandle,
1386 endcapRecHitsHandle,
1399 barrelRecHitsHandle,
1400 endcapRecHitsHandle,
1413 barrelRecHitsHandle,
1414 endcapRecHitsHandle,
1427 barrelRecHitsHandle,
1428 endcapRecHitsHandle,
1443 barrelRecHitsHandle,
1444 endcapRecHitsHandle,
1456 barrelRecHitsHandle,
1457 endcapRecHitsHandle,
1469 barrelRecHitsHandle,
1470 endcapRecHitsHandle,
1482 barrelRecHitsHandle,
1483 endcapRecHitsHandle,
1496 barrelRecHitsHandle,
1497 endcapRecHitsHandle,
1509 barrelRecHitsHandle,
1510 endcapRecHitsHandle,
1522 barrelRecHitsHandle,
1523 endcapRecHitsHandle,
1535 barrelRecHitsHandle,
1536 endcapRecHitsHandle,
1549 barrelRecHitsHandle,
1550 endcapRecHitsHandle,
1562 barrelRecHitsHandle,
1563 endcapRecHitsHandle,
1575 barrelRecHitsHandle,
1576 endcapRecHitsHandle,
1588 barrelRecHitsHandle,
1589 endcapRecHitsHandle,
1602 edm::LogVerbatim(
"IsoTrack") <<
"e7x7 " << e7x7P.first <<
" e9x9 " << e9x9P.first <<
" e11x11 "
1603 << e11x11P.first <<
" e15x15 " << e15x15P.first;
1604 edm::LogVerbatim(
"IsoTrack") <<
"e7x7_10Sig " << e7x7_10SigP.first <<
" e11x11_10Sig " << e11x11_10SigP.first
1605 <<
" e15x15_10Sig " << e15x15_10SigP.first;
1611 iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 1, 1, simInfo3x3);
1613 iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 2, 2, simInfo5x5);
1615 iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 3, 3, simInfo7x7);
1617 iEvent, isoCell, geo, caloTopology, pcaloeb, pcaloee, SimTk, SimVtx, pTrack, *associate, 4, 4, simInfo9x9);
1704 << simInfo3x3.
eMatched <<
" eRest " << simInfo3x3.
eRest <<
" eGamma "
1708 << simInfo5x5.
eMatched <<
" eRest " << simInfo5x5.
eRest <<
" eGamma "
1712 << simInfo7x7.
eMatched <<
" eRest " << simInfo7x7.
eRest <<
" eGamma "
1716 << simInfo9x9.
eMatched <<
" eRest " << simInfo9x9.
eRest <<
" eGamma "
1720 << simInfo11x11.
eMatched <<
" eRest " << simInfo11x11.
eRest <<
" eGamma "
1724 << simInfo15x15.
eMatched <<
" eRest " << simInfo15x15.
eRest <<
" eGamma "
1728 << simInfo31x31.
eMatched <<
" eRest " << simInfo31x31.
eRest <<
" eGamma "
1736 double hcalScale = 1.0;
1743 double maxNearHcalP3x3 = -1, maxNearHcalP5x5 = -1, maxNearHcalP7x7 = -1;
1748 double h3x3 = 0, h5x5 = 0, h7x7 = 0;
1749 double h3x3Sig = 0, h5x5Sig = 0, h7x7Sig = 0;
1750 double trkHcalEne = 0;
1753 if (trkDetItr->okHCAL) {
1754 const DetId ClosestCell(trkDetItr->detIdHCAL);
1757 theHBHETopology, ClosestCell,
hbhe, 1, 1,
false,
true, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_);
1759 theHBHETopology, ClosestCell,
hbhe, 2, 2,
false,
true, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_);
1761 theHBHETopology, ClosestCell,
hbhe, 3, 3,
false,
true, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_);
1763 theHBHETopology, ClosestCell,
hbhe, 1, 1,
false,
true, 0.7, 0.8, -100.0, -100.0,
tMinH_,
tMaxH_);
1765 theHBHETopology, ClosestCell,
hbhe, 2, 2,
false,
true, 0.7, 0.8, -100.0, -100.0,
tMinH_,
tMaxH_);
1767 theHBHETopology, ClosestCell,
hbhe, 3, 3,
false,
true, 0.7, 0.8, -100.0, -100.0,
tMinH_,
tMaxH_);
1770 edm::LogVerbatim(
"IsoTrack") <<
"HCAL 3x3 " << h3x3 <<
" " << h3x3Sig <<
" 5x5 " << h5x5 <<
" " << h5x5Sig
1771 <<
" 7x7 " << h7x7 <<
" " << h7x7Sig;
1776 iEvent, theHBHETopology, ClosestCell, geo, pcalohh, SimTk, SimVtx, pTrack, *associate, 1, 1, hsimInfo3x3);
1778 iEvent, theHBHETopology, ClosestCell, geo, pcalohh, SimTk, SimVtx, pTrack, *associate, 2, 2, hsimInfo5x5);
1798 <<
"hsimInfo3x3: eTotal " << hsimInfo3x3.
eTotal <<
" eMatched " << hsimInfo3x3.
eMatched <<
" eRest "
1802 <<
"hsimInfo5x5: eTotal " << hsimInfo5x5.
eTotal <<
" eMatched " << hsimInfo5x5.
eMatched <<
" eRest "
1806 <<
"hsimInfo7x7: eTotal " << hsimInfo7x7.
eTotal <<
" eMatched " << hsimInfo7x7.
eMatched <<
" eRest "
1816 std::vector<std::pair<DetId, double> > v7x7 =
1820 for (
unsigned int iv = 0; iv < v7x7.size(); iv++) {
1821 sumv += v7x7[iv].second;
1823 edm::LogVerbatim(
"IsoTrack") <<
"h7x7 " << h7x7 <<
" v7x7 " << sumv <<
" in " << v7x7.size();
1824 for (
unsigned int iv = 0; iv < v7x7.size(); iv++) {
1827 <<
id <<
" Energy " << v7x7[iv].second;
1841 double trackOutPosOutHitDr =
diff.R();
1842 double trackL = point2_TK0.second;
1844 edm::LogVerbatim(
"IsoTrack") <<
" propagted " << point2_TK0.first <<
" " << point2_TK0.first.eta() <<
" "
1845 << point2_TK0.first.phi();
1849 <<
diff.R() / point2_TK0.second;
1852 for (
unsigned int ind = 0; ind < recVtxs->size(); ind++) {
1853 if (!((*recVtxs)[ind].isFake())) {
1855 if (
deltaR(
eta1, phi1, (*vtxTrack)->eta(), (*vtxTrack)->phi()) < 0.01)
1913 t_e7x7->push_back(e7x7P.first);
1914 t_e9x9->push_back(e9x9P.first);
1915 t_e11x11->push_back(e11x11P.first);
1916 t_e15x15->push_back(e15x15P.first);
2028 double tempgen_TH[
NPBins + 1] = {
2029 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 20.0, 30.0, 50.0, 75.0, 100.0};
2031 for (
unsigned int i = 0;
i <
NPBins + 1;
i++)
2034 double tempgen_Eta[
NEtaBins + 1] = {0.0, 1.131, 1.653, 2.172};
2045 std::map<std::pair<unsigned int, std::string>,
int>::iterator
itr;
2050 TString
name((
itr->first).second);
2074 for (
int i = 0;
i < 128;
i++)
2263 char hname[100], htit[100];
2269 double lowEta = -5.0, highEta = 5.0;
2273 for (
unsigned int ipt = 0; ipt <
NPBins; ipt++) {
2274 double lowP = 0.0, highP = 300.0;
2277 sprintf(hname,
"h_maxNearP31x31_ptBin%i_etaBin%i", ipt,
ieta);
2278 sprintf(htit,
"maxNearP in 31x31 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2281 sprintf(hname,
"h_maxNearP25x25_ptBin%i_etaBin%i", ipt,
ieta);
2282 sprintf(htit,
"maxNearP in 25x25 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2285 sprintf(hname,
"h_maxNearP21x21_ptBin%i_etaBin%i", ipt,
ieta);
2286 sprintf(htit,
"maxNearP in 21x21 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2289 sprintf(hname,
"h_maxNearP15x15_ptBin%i_etaBin%i", ipt,
ieta);
2290 sprintf(htit,
"maxNearP in 15x15 (%3.2f<|#eta|<%3.2f), (%2.0f<trkP<%3.0f)", lowEta, highEta, lowP, highP);
2296 h_L1AlgoNames = fs->
make<TH1I>(
"h_L1AlgoNames",
"h_L1AlgoNames:Bin Labels", 128, -0.5, 127.5);
2300 h_PVTracksWt = fs->
make<TH1F>(
"h_PVTracksWt",
"h_PVTracksWt", 600, -0.1, 1.1);
2302 h_nTracks = fs->
make<TH1F>(
"h_nTracks",
"h_nTracks", 1000, -0.5, 999.5);
2304 sprintf(hname,
"h_recEtaPt_0");
2305 sprintf(htit,
"h_recEtaPt (all tracks Eta vs pT)");
2308 sprintf(hname,
"h_recEtaP_0");
2309 sprintf(htit,
"h_recEtaP (all tracks Eta vs pT)");
2314 h_recEta_0 = fs->
make<TH1F>(
"h_recEta_0",
"Eta (all tracks)", 60, -3.0, 3.0);
2315 h_recPhi_0 = fs->
make<TH1F>(
"h_recPhi_0",
"Phi (all tracks)", 100, -3.2, 3.2);
2317 sprintf(hname,
"h_recEtaPt_1");
2318 sprintf(htit,
"h_recEtaPt (all good tracks Eta vs pT)");
2321 sprintf(hname,
"h_recEtaP_1");
2322 sprintf(htit,
"h_recEtaP (all good tracks Eta vs pT)");
2327 h_recEta_1 = fs->
make<TH1F>(
"h_recEta_1",
"Eta (all good tracks)", 60, -3.0, 3.0);
2328 h_recPhi_1 = fs->
make<TH1F>(
"h_recPhi_1",
"Phi (all good tracks)", 100, -3.2, 3.2);
2330 sprintf(hname,
"h_recEtaPt_2");
2331 sprintf(htit,
"h_recEtaPt (charge isolation Eta vs pT)");
2334 sprintf(hname,
"h_recEtaP_2");
2335 sprintf(htit,
"h_recEtaP (charge isolation Eta vs pT)");
2340 h_recEta_2 = fs->
make<TH1F>(
"h_recEta_2",
"Eta (charge isolation)", 60, -3.0, 3.0);
2341 h_recPhi_2 = fs->
make<TH1F>(
"h_recPhi_2",
"Phi (charge isolation)", 100, -3.2, 3.2);
2343 tree_ = fs->
make<TTree>(
"tree",
"tree");
2344 tree_->SetAutoSave(10000);
2351 t_PVx =
new std::vector<double>();
2352 t_PVy =
new std::vector<double>();
2353 t_PVz =
new std::vector<double>();
2365 tree_->Branch(
"PVx",
"std::vector<double>", &
t_PVx);
2366 tree_->Branch(
"PVy",
"std::vector<double>", &
t_PVy);
2367 tree_->Branch(
"PVz",
"std::vector<double>", &
t_PVz);
2380 for (
int i = 0;
i < 128;
i++)
2431 t_jetPt =
new std::vector<double>();
2432 t_jetEta =
new std::vector<double>();
2433 t_jetPhi =
new std::vector<double>();
2436 tree_->Branch(
"t_jetPt",
"std::vector<double>", &
t_jetPt);
2437 tree_->Branch(
"t_jetEta",
"std::vector<double>", &
t_jetEta);
2438 tree_->Branch(
"t_jetPhi",
"std::vector<double>", &
t_jetPhi);
2463 t_trackP =
new std::vector<double>();
2506 t_trackL =
new std::vector<double>();
2508 tree_->Branch(
"t_trackP",
"std::vector<double>", &
t_trackP);
2540 tree_->Branch(
"t_trackL",
"std::vector<double>", &
t_trackL);
2558 t_e7x7 =
new std::vector<double>();
2559 t_e9x9 =
new std::vector<double>();
2560 t_e11x11 =
new std::vector<double>();
2561 t_e15x15 =
new std::vector<double>();
2564 tree_->Branch(
"t_e7x7",
"std::vector<double>", &
t_e7x7);
2565 tree_->Branch(
"t_e9x9",
"std::vector<double>", &
t_e9x9);
2566 tree_->Branch(
"t_e11x11",
"std::vector<double>", &
t_e11x11);
2567 tree_->Branch(
"t_e15x15",
"std::vector<double>", &
t_e15x15);
2684 t_h3x3 =
new std::vector<double>();
2685 t_h5x5 =
new std::vector<double>();
2686 t_h7x7 =
new std::vector<double>();
2717 tree_->Branch(
"t_h3x3",
"std::vector<double>", &
t_h3x3);
2718 tree_->Branch(
"t_h5x5",
"std::vector<double>", &
t_h5x5);
2719 tree_->Branch(
"t_h7x7",
"std::vector<double>", &
t_h7x7);
2759 double dphi =
deltaPhi(phi1, phi2);
2760 return std::sqrt(deta * deta + dphi * dphi);
2768 << pTrack->
momentum() <<
" (pt,eta,phi)(" << pTrack->
pt() <<
"," << pTrack->
eta() <<
","
2769 << pTrack->
phi() <<
")"
2770 <<
" p " << pTrack->
p() <<
"\n Normalized chi2 " << pTrack->
normalizedChi2()
2771 <<
" charge " << pTrack->
charge() <<
" qoverp() " << pTrack->
qoverp() <<
"+-"
2772 << pTrack->
qoverpError() <<
" d0 " << pTrack->
d0() <<
"\n NValidHits "
2774 <<
" TrackQuality " << pTrack->
qualityName(trackQuality_) <<
" "
2775 << pTrack->
quality(trackQuality_);
2793 edm::LogVerbatim(
"IsoTrack") <<
"\n \t trackerLayersWithMeasurement() " <<
p.trackerLayersWithMeasurement()
2794 <<
"\n \t pixelLayersWithMeasurement() " <<
p.pixelLayersWithMeasurement()
2795 <<
"\n \t stripLayersWithMeasurement() " <<
p.stripLayersWithMeasurement()
2796 <<
"\n \t pixelBarrelLayersWithMeasurement() " <<
p.pixelBarrelLayersWithMeasurement()
2797 <<
"\n \t pixelEndcapLayersWithMeasurement() " <<
p.pixelEndcapLayersWithMeasurement()
2798 <<
"\n \t stripTIBLayersWithMeasurement() " <<
p.stripTIBLayersWithMeasurement()
2799 <<
"\n \t stripTIDLayersWithMeasurement() " <<
p.stripTIDLayersWithMeasurement()
2800 <<
"\n \t stripTOBLayersWithMeasurement() " <<
p.stripTOBLayersWithMeasurement()
2801 <<
"\n \t stripTECLayersWithMeasurement() " <<
p.stripTECLayersWithMeasurement();