29 #include "TDirectory.h"
113 std::vector<double> &PixMaxP,
122 std::vector<bool> &Flags,
131 double &phiTriggered,
267 std::vector<math::XYZTLorentzVector>
vec_[3];
271 : hltPrescaleProvider_(iConfig, consumesCollector(), *this),
272 trigNames_(iConfig.getUntrackedParameter<std::
vector<std::
string>>(
"Triggers")),
273 pixCandTag_(iConfig.getUntrackedParameter<edm::
InputTag>(
"pixCandTag")),
274 l1CandTag_(iConfig.getUntrackedParameter<edm::
InputTag>(
"l1CandTag")),
275 l2CandTag_(iConfig.getUntrackedParameter<edm::
InputTag>(
"l2CandTag")),
276 pixelTracksSources_(iConfig.getUntrackedParameter<std::
vector<edm::
InputTag>>(
"pixelTracksSources")),
277 doL2L3_(iConfig.getUntrackedParameter<bool>(
"doL2L3",
true)),
278 doTiming_(iConfig.getUntrackedParameter<bool>(
"doTimingTree",
true)),
279 doMipCutTree_(iConfig.getUntrackedParameter<bool>(
"doMipCutTree",
true)),
280 doTrkResTree_(iConfig.getUntrackedParameter<bool>(
"doTrkResTree",
true)),
281 doChgIsolTree_(iConfig.getUntrackedParameter<bool>(
"doChgIsolTree",
true)),
282 doStudyIsol_(iConfig.getUntrackedParameter<bool>(
"doStudyIsol",
true)),
283 verbosity_(iConfig.getUntrackedParameter<int>(
"verbosity", 0)),
285 minPTrackValue_(iConfig.getUntrackedParameter<double>(
"minPTrackValue")),
286 vtxCutSeed_(iConfig.getUntrackedParameter<double>(
"vertexCutSeed")),
287 vtxCutIsol_(iConfig.getUntrackedParameter<double>(
"vertexCutIsol")),
288 tauUnbiasCone_(iConfig.getUntrackedParameter<double>(
"tauUnbiasCone")),
289 prelimCone_(iConfig.getUntrackedParameter<double>(
"prelimCone")),
290 theTrackQuality_(iConfig.getUntrackedParameter<std::
string>(
"trackQuality",
"highPurity")),
291 processName_(iConfig.getUntrackedParameter<std::
string>(
"processName",
"HLT")),
292 dr_L1_(iConfig.getUntrackedParameter<double>(
"isolationL1", 1.0)),
293 a_coneR_(iConfig.getUntrackedParameter<double>(
"coneRadius", 34.98)),
294 a_charIsoR_(a_coneR_ + 28.9),
295 a_neutIsoR_(a_charIsoR_ * 0.726),
296 a_mipR_(iConfig.getUntrackedParameter<double>(
"coneRadiusMIP", 14.0)),
297 a_neutR1_(iConfig.getUntrackedParameter<double>(
"coneRadiusNeut1", 21.0)),
298 a_neutR2_(iConfig.getUntrackedParameter<double>(
"coneRadiusNeut2", 29.0)),
299 cutMip_(iConfig.getUntrackedParameter<double>(
"cutMIP", 1.0)),
300 cutCharge_(iConfig.getUntrackedParameter<double>(
"chargeIsolation", 2.0)),
301 cutNeutral_(iConfig.getUntrackedParameter<double>(
"neutralIsolation", 2.0)),
302 minRunNo_(iConfig.getUntrackedParameter<int>(
"minRun")),
303 maxRunNo_(iConfig.getUntrackedParameter<int>(
"maxRun")),
305 t_timeL2Prod(nullptr),
311 t_TrkselTkFlag(nullptr),
312 t_TrkqltyFlag(nullptr),
313 t_TrkMissFlag(nullptr),
314 t_TrkPVFlag(nullptr),
315 t_TrkNuIsolFlag(nullptr),
317 t_PixcandPt(nullptr),
318 t_PixcandEta(nullptr),
319 t_PixcandPhi(nullptr),
320 t_PixcandMaxP(nullptr),
321 t_PixTrkcandP(nullptr),
322 t_PixTrkcandPt(nullptr),
323 t_PixTrkcandEta(nullptr),
324 t_PixTrkcandPhi(nullptr),
325 t_PixTrkcandMaxP(nullptr),
326 t_PixTrkcandselTk(nullptr),
329 t_NFcandEta(nullptr),
330 t_NFcandPhi(nullptr),
331 t_NFcandEmip(nullptr),
332 t_NFTrkcandP(nullptr),
333 t_NFTrkcandPt(nullptr),
334 t_NFTrkcandEta(nullptr),
335 t_NFTrkcandPhi(nullptr),
336 t_NFTrkcandEmip(nullptr),
337 t_NFTrkMinDR(nullptr),
338 t_NFTrkMinDP1(nullptr),
339 t_NFTrkselTkFlag(nullptr),
340 t_NFTrkqltyFlag(nullptr),
341 t_NFTrkMissFlag(nullptr),
342 t_NFTrkPVFlag(nullptr),
343 t_NFTrkPropFlag(nullptr),
344 t_NFTrkChgIsoFlag(nullptr),
345 t_NFTrkNeuIsoFlag(nullptr),
346 t_NFTrkMipFlag(nullptr),
366 tok_trigEvt_ = consumes<trigger::TriggerEvent>(triggerEvent_);
368 tok_trigRes_ = consumes<edm::TriggerResults>(theTriggerResultsLabel);
410 <<
"\t prelimCone " <<
prelimCone_ <<
"\t pixelIsolationConeSizeAtEC";
414 double pl[] = {20, 30, 40, 60, 80, 120};
415 for (
int i = 0;
i < 6; ++
i)
420 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
421 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
516 std::vector<std::string> triggers = {
"HLT_IsoTrackHB"};
518 std::vector<double> cones = {35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 63.9, 70.0};
520 desc.
addUntracked<std::vector<std::string>>(
"Triggers", triggers);
553 desc.
addUntracked<std::vector<double>>(
"pixelIsolationConeSizeAtEC", cones);
559 desc.
add<
unsigned int>(
"stageL1Trigger", 1);
560 descriptions.
add(
"isoTrigDefault", desc);
565 edm::LogVerbatim(
"IsoTrack") <<
"Event starts====================================";
567 int RunNo = iEvent.
id().
run();
579 if (!triggerEventHandle.
isValid()) {
580 edm::LogWarning(
"IsoTrack") <<
"Error! Can't get the product hltTriggerSummaryAOD";
583 triggerEvent = *(triggerEventHandle.
product());
600 if (!
recVtxs_->empty() && !((*recVtxs_)[0].isFake())) {
617 for (reco::TrackCollection::const_iterator pit = iPixCol->begin(); pit != iPixCol->end(); pit++) {
627 for (
unsigned int ifilter = 0; ifilter < triggerEvent.
sizeFilters(); ++ifilter) {
628 std::string FilterNames[7] = {
"hltL1sL1SingleJet68",
629 "hltIsolPixelTrackL2FilterHE",
630 "ecalIsolPixelTrackFilterHE",
631 "hltIsolPixelTrackL3FilterHE",
632 "hltIsolPixelTrackL2FilterHB",
633 "ecalIsolPixelTrackFilterHB",
634 "hltIsolPixelTrackL3FilterHB"};
636 for (
int i = 0;
i < 7;
i++) {
637 if (label == FilterNames[
i])
651 if (!triggerResults.isValid()) {
652 edm::LogWarning(
"IsoTrack") <<
"Error! Can't get the product triggerResults";
656 std::vector<std::string>
modules;
657 h_nHLT->Fill(triggerResults->size());
660 const std::vector<std::string> &triggerNames_ = triggerNames.
triggerNames();
663 int hlt(-1), preL1(-1), preHLT(-1), prescale(-1);
664 for (
unsigned int i = 0;
i < triggerResults->size();
i++) {
665 unsigned int triggerindx = hltConfig.
triggerIndex(triggerNames_[
i]);
666 const std::vector<std::string> &moduleLabels(hltConfig.
moduleLabels(triggerindx));
672 edm::LogVerbatim(
"IsoTrack") <<
"trigger that i want " << triggerNames_[
i] <<
" accept "
673 << triggerResults->accept(i);
674 hlt = triggerResults->accept(i);
686 prescale = preL1 * preHLT;
689 << triggerNames_[
i] <<
" accept " <<
hlt <<
" preL1 " << preL1 <<
" preHLT " << preHLT;
690 for (
int iv = 0;
iv < 3; ++
iv)
695 trigList_.insert(std::pair<unsigned int, unsigned int>(RunNo, 1));
699 for (
unsigned int ifilter = 0; ifilter < triggerEvent.
sizeFilters(); ++ifilter) {
700 std::vector<int>
Keys;
703 for (
unsigned int imodule = 0; imodule < moduleLabels.size(); imodule++) {
704 if (label.find(moduleLabels[imodule]) != std::string::npos) {
707 for (
unsigned int ifiltrKey = 0; ifiltrKey < triggerEvent.
filterKeys(ifilter).size(); ++ifiltrKey) {
708 Keys.push_back(triggerEvent.
filterKeys(ifilter)[ifiltrKey]);
711 if (label.find(
"L2Filter") != std::string::npos) {
712 vec_[1].push_back(v4);
713 }
else if (label.find(
"L3Filter") != std::string::npos) {
714 vec_[2].push_back(v4);
716 vec_[0].push_back(v4);
721 <<
" phi " << TO.
phi() <<
" mass " << TO.
mass() <<
" Id " << TO.
id();
726 std::vector<reco::TrackCollection::const_iterator> goodTks;
732 reco::TrackCollection::const_iterator trkItr;
733 for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); trkItr++)
734 goodTks.push_back(trkItr);
755 chgIsolation(etaphi.first, etaphi.second, trkCollection, iEvent);
763 h_Pre->Fill(prescale);
773 const unsigned int n(hltConfig.
size());
774 for (
unsigned itrig = 0; itrig < triggerNames_.size(); itrig++) {
775 unsigned int triggerindx = hltConfig.
triggerIndex(triggerNames_[itrig]);
776 if (triggerindx >=
n)
777 edm::LogVerbatim(
"IsoTrack") << triggerNames_[itrig] <<
" " << triggerindx <<
" does not exist in"
778 <<
" the current menu";
780 edm::LogVerbatim(
"IsoTrack") << triggerNames_[itrig] <<
" " << triggerindx <<
" exists";
831 std::vector<double> &PixMaxP,
853 std::vector<bool> &Flags,
879 char hname[100], htit[100];
881 "L2Match",
"L2NoMatch",
"L3Match",
"L3NoMatch",
"HLTTrk",
"HLTGoodTrk",
882 "HLTIsoTrk",
"HLTMip",
"HLTSelect",
"nonHLTTrk",
"nonHLTGoodTrk",
"nonHLTIsoTrk",
883 "nonHLTMip",
"nonHLTSelect"};
891 TimingTree_->Branch(
"t_timeL2Prod",
"std::vector<double>", &t_timeL2Prod);
892 TimingTree_->Branch(
"t_nPixCand",
"std::vector<int>", &t_nPixCand);
893 TimingTree_->Branch(
"t_nPixSeed",
"std::vector<int>", &t_nPixSeed);
894 TimingTree_->Branch(
"t_nGoodTk",
"std::vector<int>", &t_nGoodTk);
899 t_TrkP =
new std::vector<double>();
906 TrkResTree_->Branch(
"t_TrkhCone",
"std::vector<double>", &t_TrkhCone);
907 TrkResTree_->Branch(
"t_TrkP",
"std::vector<double>", &t_TrkP);
908 TrkResTree_->Branch(
"t_TrkselTkFlag",
"std::vector<bool>", &t_TrkselTkFlag);
909 TrkResTree_->Branch(
"t_TrkqltyFlag",
"std::vector<bool>", &t_TrkqltyFlag);
910 TrkResTree_->Branch(
"t_TrkMissFlag",
"std::vector<bool>", &t_TrkMissFlag);
911 TrkResTree_->Branch(
"t_TrkPVFlag",
"std::vector<bool>", &t_TrkPVFlag);
912 TrkResTree_->Branch(
"t_TrkNuIsolFlag",
"std::vector<bool>", &t_TrkNuIsolFlag);
928 ChgIsolnTree_->Branch(
"t_PixcandP",
"std::vector<double>", &t_PixcandP);
929 ChgIsolnTree_->Branch(
"t_PixcandPt",
"std::vector<double>", &t_PixcandPt);
930 ChgIsolnTree_->Branch(
"t_PixcandEta",
"std::vector<double>", &t_PixcandEta);
931 ChgIsolnTree_->Branch(
"t_PixcandPhi",
"std::vector<double>", &t_PixcandPhi);
932 ChgIsolnTree_->Branch(
"t_PixcandMaxP",
"std::vector<std::vector<double> >", &t_PixcandMaxP);
933 ChgIsolnTree_->Branch(
"t_PixTrkcandP",
"std::vector<double>", &t_PixTrkcandP);
934 ChgIsolnTree_->Branch(
"t_PixTrkcandPt",
"std::vector<double>", &t_PixTrkcandPt);
935 ChgIsolnTree_->Branch(
"t_PixTrkcandEta",
"std::vector<double>", &t_PixTrkcandEta);
936 ChgIsolnTree_->Branch(
"t_PixTrkcandPhi",
"std::vector<double>", &t_PixTrkcandPhi);
937 ChgIsolnTree_->Branch(
"t_PixTrkcandMaxP",
"std::vector<double>", &t_PixTrkcandMaxP);
938 ChgIsolnTree_->Branch(
"t_PixTrkcandselTk",
"std::vector<bool>", &t_PixTrkcandselTk);
962 t_ECone =
new std::vector<double>();
964 MipCutTree_->Branch(
"t_NFcandP",
"std::vector<double>", &t_NFcandP);
965 MipCutTree_->Branch(
"t_NFcandPt",
"std::vector<double>", &t_NFcandPt);
966 MipCutTree_->Branch(
"t_NFcandEta",
"std::vector<double>", &t_NFcandEta);
967 MipCutTree_->Branch(
"t_NFcandPhi",
"std::vector<double>", &t_NFcandPhi);
968 MipCutTree_->Branch(
"t_NFcandEmip",
"std::vector<double>", &t_NFcandEmip);
969 MipCutTree_->Branch(
"t_NFTrkcandP",
"std::vector<double>", &t_NFTrkcandP);
970 MipCutTree_->Branch(
"t_NFTrkcandPt",
"std::vector<double>", &t_NFTrkcandPt);
971 MipCutTree_->Branch(
"t_NFTrkcandEta",
"std::vector<double>", &t_NFTrkcandEta);
972 MipCutTree_->Branch(
"t_NFTrkcandPhi",
"std::vector<double>", &t_NFTrkcandPhi);
973 MipCutTree_->Branch(
"t_NFTrkcandEmip",
"std::vector<double>", &t_NFTrkcandEmip);
974 MipCutTree_->Branch(
"t_NFTrkMinDR",
"std::vector<double>", &t_NFTrkMinDR);
975 MipCutTree_->Branch(
"t_NFTrkMinDP1",
"std::vector<double>", &t_NFTrkMinDP1);
976 MipCutTree_->Branch(
"t_NFTrkselTkFlag",
"std::vector<bool>", &t_NFTrkselTkFlag);
977 MipCutTree_->Branch(
"t_NFTrkqltyFlag",
"std::vector<bool>", &t_NFTrkqltyFlag);
978 MipCutTree_->Branch(
"t_NFTrkMissFlag",
"std::vector<bool>", &t_NFTrkMissFlag);
979 MipCutTree_->Branch(
"t_NFTrkPVFlag",
"std::vector<bool>", &t_NFTrkPVFlag);
980 MipCutTree_->Branch(
"t_NFTrkPropFlag",
"std::vector<bool>", &t_NFTrkPropFlag);
981 MipCutTree_->Branch(
"t_NFTrkChgIsoFlag",
"std::vector<bool>", &t_NFTrkChgIsoFlag);
982 MipCutTree_->Branch(
"t_NFTrkNeuIsoFlag",
"std::vector<bool>", &t_NFTrkNeuIsoFlag);
983 MipCutTree_->Branch(
"t_NFTrkMipFlag",
"std::vector<bool>", &t_NFTrkMipFlag);
984 MipCutTree_->Branch(
"t_ECone",
"std::vector<double>", &t_ECone);
987 std::string FilterNames[7] = {
"hltL1sL1SingleJet68",
988 "hltIsolPixelTrackL2FilterHE",
989 "ecalIsolPixelTrackFilterHE",
990 "hltIsolPixelTrackL3FilterHE",
991 "hltIsolPixelTrackL2FilterHB",
992 "ecalIsolPixelTrackFilterHB",
993 "hltIsolPixelTrackL3FilterHB"};
994 for (
int i = 0;
i < 7;
i++) {
995 h_Filters->GetXaxis()->SetBinLabel(
i + 1, FilterNames[
i].c_str());
998 h_nHLT =
fs_->
make<TH1I>(
"h_nHLT",
"Size of trigger Names", 1000, 1, 1000);
999 h_HLT =
fs_->
make<TH1I>(
"h_HLT",
"HLT accept", 3, -1, 2);
1000 h_PreL1 =
fs_->
make<TH1I>(
"h_PreL1",
"L1 Prescale", 500, 0, 500);
1002 h_Pre =
fs_->
make<TH1I>(
"h_Pre",
"Prescale", 3000, 0, 3000);
1004 h_PreL1wt =
fs_->
make<TH1D>(
"h_PreL1wt",
"Weighted L1 Prescale", 500, 0, 500);
1005 h_PreHLTwt =
fs_->
make<TH1D>(
"h_PreHLTwt",
"Weighted HLT Prescale", 500, 0, 100);
1008 h_EnIn =
fs_->
make<TH1D>(
"h_EnInEcal",
"EnergyIn Ecal", 200, 0.0, 20.0);
1009 h_EnOut =
fs_->
make<TH1D>(
"h_EnOutEcal",
"EnergyOut Ecal", 200, 0.0, 20.0);
1011 fs_->
make<TH2D>(
"h_MipEnMatch",
"MipEn: HLT level vs Reco Level (Matched)", 200, 0.0, 20.0, 200, 0.0, 20.0);
1013 "h_MipEnNoMatch",
"MipEn: HLT level vs Reco Level (No Match Found)", 200, 0.0, 20.0, 200, 0.0, 20.0);
1016 h_nL3Objs =
fs_->
make<TH1I>(
"h_nL3Objs",
"Number of L3 objects", 10, 0, 10);
1025 "NewFilterRecoMatch",
1026 "NewFilterRecoNoMatch"};
1027 for (
int ipair = 0; ipair < 9; ipair++) {
1028 sprintf(hname,
"h_dEta%s", pairs[ipair].c_str());
1029 sprintf(htit,
"#Delta#eta for %s", pairs[ipair].c_str());
1030 h_dEta[ipair] =
fs_->
make<TH1D>(hname, htit, 200, -10.0, 10.0);
1031 h_dEta[ipair]->GetXaxis()->SetTitle(
"d#eta");
1033 sprintf(hname,
"h_dPhi%s", pairs[ipair].c_str());
1034 sprintf(htit,
"#Delta#phi for %s", pairs[ipair].c_str());
1035 h_dPhi[ipair] =
fs_->
make<TH1D>(hname, htit, 140, -7.0, 7.0);
1036 h_dPhi[ipair]->GetXaxis()->SetTitle(
"d#phi");
1038 sprintf(hname,
"h_dPt%s", pairs[ipair].c_str());
1039 sprintf(htit,
"#Delta dp_{T} for %s objects", pairs[ipair].c_str());
1040 h_dPt[ipair] =
fs_->
make<TH1D>(hname, htit, 400, -200.0, 200.0);
1041 h_dPt[ipair]->GetXaxis()->SetTitle(
"dp_{T} (GeV)");
1043 sprintf(hname,
"h_dP%s", pairs[ipair].c_str());
1044 sprintf(htit,
"#Delta p for %s objects", pairs[ipair].c_str());
1045 h_dP[ipair] =
fs_->
make<TH1D>(hname, htit, 400, -200.0, 200.0);
1046 h_dP[ipair]->GetXaxis()->SetTitle(
"dP (GeV)");
1048 sprintf(hname,
"h_dinvPt%s", pairs[ipair].c_str());
1049 sprintf(htit,
"#Delta (1/p_{T}) for %s objects", pairs[ipair].c_str());
1051 h_dinvPt[ipair]->GetXaxis()->SetTitle(
"d(1/p_{T})");
1052 sprintf(hname,
"h_mindR%s", pairs[ipair].c_str());
1053 sprintf(htit,
"min(#Delta R) for %s objects", pairs[ipair].c_str());
1055 h_mindR[ipair]->GetXaxis()->SetTitle(
"dR");
1058 for (
int lvl = 0; lvl < 2; lvl++) {
1059 sprintf(hname,
"h_dEtaL1%s", levels[lvl + 1].c_str());
1060 sprintf(htit,
"#Delta#eta for L1 and %s objects", levels[lvl + 1].c_str());
1063 sprintf(hname,
"h_dPhiL1%s", levels[lvl + 1].c_str());
1064 sprintf(htit,
"#Delta#phi for L1 and %s objects", levels[lvl + 1].c_str());
1067 sprintf(hname,
"h_dRL1%s", levels[lvl + 1].c_str());
1068 sprintf(htit,
"#Delta R for L1 and %s objects", levels[lvl + 1].c_str());
1073 int levmin = (
doL2L3_ ? 0 : 10);
1074 for (
int ilevel = levmin; ilevel < 20; ilevel++) {
1075 sprintf(hname,
"h_p%s", levels[ilevel].c_str());
1076 sprintf(htit,
"p for %s objects", levels[ilevel].c_str());
1077 h_p[ilevel] =
fs_->
make<TH1D>(hname, htit, 100, 0.0, 500.0);
1078 h_p[ilevel]->GetXaxis()->SetTitle(
"p (GeV)");
1080 sprintf(hname,
"h_pt%s", levels[ilevel].c_str());
1081 sprintf(htit,
"p_{T} for %s objects", levels[ilevel].c_str());
1082 h_pt[ilevel] =
fs_->
make<TH1D>(hname, htit, 100, 0.0, 500.0);
1083 h_pt[ilevel]->GetXaxis()->SetTitle(
"p_{T} (GeV)");
1085 sprintf(hname,
"h_eta%s", levels[ilevel].c_str());
1086 sprintf(htit,
"#eta for %s objects", levels[ilevel].c_str());
1087 h_eta[ilevel] =
fs_->
make<TH1D>(hname, htit, 100, -5.0, 5.0);
1088 h_eta[ilevel]->GetXaxis()->SetTitle(
"#eta");
1090 sprintf(hname,
"h_phi%s", levels[ilevel].c_str());
1091 sprintf(htit,
"#phi for %s objects", levels[ilevel].c_str());
1092 h_phi[ilevel] =
fs_->
make<TH1D>(hname, htit, 70, -3.5, 3.50);
1093 h_phi[ilevel]->GetXaxis()->SetTitle(
"#phi");
1098 for (
int icut = 0; icut < 2; icut++) {
1099 sprintf(hname,
"h_eMip%s", cuts[icut].c_str());
1100 sprintf(htit,
"eMip for %s tracks", cuts[icut].c_str());
1101 h_eMip[icut] =
fs_->
make<TH1D>(hname, htit, 200, 0.0, 10.0);
1102 h_eMip[icut]->GetXaxis()->SetTitle(
"E_{Mip} (GeV)");
1104 sprintf(hname,
"h_eMaxNearP%s", cuts[icut].c_str());
1105 sprintf(htit,
"eMaxNearP for %s tracks", cuts[icut].c_str());
1107 h_eMaxNearP[icut]->GetXaxis()->SetTitle(
"E_{MaxNearP} (GeV)");
1109 sprintf(hname,
"h_eNeutIso%s", cuts[icut].c_str());
1110 sprintf(htit,
"eNeutIso for %s ", cuts[icut].c_str());
1112 h_eNeutIso[icut]->GetXaxis()->SetTitle(
"E_{NeutIso} (GeV)");
1114 for (
int kcut = 0; kcut < 2; ++kcut) {
1115 for (
int lim = 0; lim < 5; ++lim) {
1116 sprintf(hname,
"h_etaCalibTracks%sCut%dLim%d", cuts[icut].c_str(), kcut, lim);
1118 "#eta for %s isolated MIP tracks (%4.1f < p < %5.1f Gev/c %s)",
1122 cuts2[kcut].c_str());
1126 sprintf(hname,
"h_etaMipTracks%sCut%dLim%d", cuts[icut].c_str(), kcut, lim);
1128 "#eta for %s charge isolated MIP tracks (%4.1f < p < %5.1f Gev/c %s)",
1132 cuts2[kcut].c_str());
1139 std::string ecut1[3] = {
"all",
"HLTMatched",
"HLTNotMatched"};
1141 int etac[48] = {-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16,
1142 -17, -18, -19, -20, -21, -22, -23, -24, 1, 2, 3, 4, 5, 6, 7, 8,
1143 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24};
1144 for (
int icut = 0; icut < 6; icut++) {
1146 int i1 = (icut > 2 ? 1 : 0);
1147 int i2 = icut - i1 * 3;
1148 for (
int kcut = 0; kcut < 48; kcut++) {
1149 for (
int lim = 0; lim < 5; ++lim) {
1150 sprintf(hname,
"h_eta%dEnHcal%s%s%d", etac[kcut], ecut1[i2].c_str(), ecut2[i1].c_str(), lim);
1152 "HCAL energy for #eta=%d for %s tracks (p=%4.1f:%5.1f Gev) %s neutral isolation",
1158 h_eHcal[lim][icut][kcut] =
fs_->
make<TH1D>(hname, htit, 750, 0.0, 150.0);
1159 h_eHcal[lim][icut][kcut]->GetXaxis()->SetTitle(
"Energy (GeV)");
1160 sprintf(hname,
"h_eta%dEnCalo%s%s%d", etac[kcut], ecut1[i2].c_str(), ecut2[i1].c_str(), lim);
1162 "Calorimter energy for #eta=%d for %s tracks (p=%4.1f:%5.1f Gev) %s neutral isolation",
1168 h_eCalo[lim][icut][kcut] =
fs_->
make<TH1D>(hname, htit, 750, 0.0, 150.0);
1169 h_eCalo[lim][icut][kcut]->GetXaxis()->SetTitle(
"Energy (GeV)");
1177 unsigned int preL1, preHLT;
1178 std::map<unsigned int, unsigned int>::iterator itr;
1179 std::map<unsigned int, const std::pair<int, int>>::iterator itrPre;
1190 preL1 = (itrPre->second).
first;
1191 preHLT = (itrPre->second).
second;
1192 edm::LogVerbatim(
"IsoTrack") << itr->first <<
" " << itr->second <<
" " << itrPre->first <<
" " << preL1 <<
" "
1194 g_Accepts->Fill(itr->first, itr->second);
1195 g_PreL1->Fill(itr->first, preL1);
1196 g_PreHLT->Fill(itr->first, preHLT);
1197 g_Pre->Fill(itr->first, preL1 * preHLT);
1215 if (!trkCollection.
isValid()) {
1218 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1219 std::vector<spr::propagatedTrackDirection> trkCaloDirections1;
1223 int nRH_eMipDR = 0, nNearTRKs = 0;
1224 std::vector<bool> selFlags;
1225 for (trkDetItr = trkCaloDirections1.begin(); trkDetItr != trkCaloDirections1.end(); trkDetItr++, nTracks++) {
1226 double conehmaxNearP = 0, hCone = 0, eMipDR = 0.0;
1227 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1229 edm::LogVerbatim(
"IsoTrack") <<
"track no. " << nTracks <<
" p(): " << pTrack->
p();
1230 if (pTrack->
p() > 20) {
1235 trkDetItr->pointHCAL,
1236 trkDetItr->pointECAL,
1238 trkDetItr->directionECAL,
1243 oneCutParameters.
maxDzPV = 100;
1249 oneCutParameters.
maxDzPV = 100;
1257 <<
" nNearTRKs " << nNearTRKs;
1261 edm::LogVerbatim(
"IsoTrack") <<
"coneh " << conehmaxNearP <<
"ok " << trkDetItr->okECAL <<
" "
1262 << trkDetItr->okHCAL;
1266 trkDetItr->pointHCAL,
1267 trkDetItr->pointECAL,
1269 trkDetItr->directionECAL,
1274 trkDetItr->pointHCAL,
1275 trkDetItr->pointECAL,
1277 trkDetItr->directionECAL,
1279 double e_inCone = e2 - e1;
1280 bool chgIsolFlag = (conehmaxNearP <
cutCharge_);
1281 bool mipFlag = (eMipDR <
cutMip_);
1283 bool trkpropFlag = ((trkDetItr->okECAL) && (trkDetItr->okHCAL));
1285 selFlags.push_back(selectTk);
1286 selFlags.push_back(qltyFlag);
1287 selFlags.push_back(qltyMissFlag);
1288 selFlags.push_back(qltyPVFlag);
1291 <<
" ; ok: " << trkDetItr->okECAL <<
"/" << trkDetItr->okHCAL
1292 <<
" ; chgiso: " << conehmaxNearP <<
"<" <<
cutCharge_ <<
"(" << chgIsolFlag
1295 if (chgIsolFlag && mipFlag && trkpropFlag) {
1296 double distFromHotCell = -99.0;
1297 int nRecHitsCone = -99, ietaHotCell = -99, iphiHotCell = -99;
1299 std::vector<DetId> coneRecHitDetIds;
1302 trkDetItr->pointHCAL,
1303 trkDetItr->pointECAL,
1305 trkDetItr->directionHCAL,
1320 t_TrkP->push_back(pTrack->
p());
1341 edm::LogVerbatim(
"IsoTrack") <<
"size of Seeding TripletLayers hb/he " << layershb->
size() <<
"/"
1342 << layershe->
size();
1349 int nSeedHB = 0, nSeedHE = 0;
1358 std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1tauobjref;
1359 std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1jetobjref;
1360 std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1forjetobjref;
1366 double ptTriggered = -10;
1367 double etaTriggered = -100;
1368 double phiTriggered = -100;
1369 for (
unsigned int p = 0;
p < l1tauobjref.size();
p++) {
1370 if (l1tauobjref[
p]->
pt() > ptTriggered) {
1371 ptTriggered = l1tauobjref[
p]->pt();
1372 phiTriggered = l1tauobjref[
p]->phi();
1373 etaTriggered = l1tauobjref[
p]->eta();
1376 for (
unsigned int p = 0;
p < l1jetobjref.size();
p++) {
1377 if (l1jetobjref[
p]->
pt() > ptTriggered) {
1378 ptTriggered = l1jetobjref[
p]->pt();
1379 phiTriggered = l1jetobjref[
p]->phi();
1380 etaTriggered = l1jetobjref[
p]->eta();
1383 for (
unsigned int p = 0;
p < l1forjetobjref.size();
p++) {
1384 if (l1forjetobjref[
p]->
pt() > ptTriggered) {
1385 ptTriggered = l1forjetobjref[
p]->pt();
1386 phiTriggered = l1forjetobjref[
p]->phi();
1387 etaTriggered = l1forjetobjref[
p]->eta();
1391 reco::VertexCollection::const_iterator vitSel;
1394 for (reco::VertexCollection::const_iterator vit = pVertHE->begin(); vit != pVertHE->end(); vit++) {
1410 reco::VertexCollection::const_iterator vitSel;
1412 bool vtxMatch(
false);
1413 for (reco::VertexCollection::const_iterator vit = pVertHB->begin(); vit != pVertHB->end(); vit++) {
1425 if (R > 1.2 && vtxMatch)
1430 edm::LogVerbatim(
"IsoTrack") <<
"(HB/HE) nCand: " << nCandHB <<
"/" << nCandHE <<
"nSeed: " << nSeedHB <<
"/"
1446 if (!trkCollection.
isValid()) {
1449 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1450 std::vector<spr::propagatedTrackDirection> trkCaloDirections1;
1454 edm::LogVerbatim(
"IsoTrack") <<
"Number of L2cands:" << L2cands->size() <<
" to be matched to something out of "
1455 << trkCaloDirections1.size() <<
" reco tracks";
1456 for (
unsigned int i = 0;
i < L2cands->size();
i++) {
1459 double enIn = candref->energyIn();
1460 h_EnIn->Fill(candref->energyIn());
1461 h_EnOut->Fill(candref->energyOut());
1463 candref->track()->px(), candref->track()->py(), candref->track()->pz(), candref->track()->p());
1465 edm::LogVerbatim(
"IsoTrack") <<
"HLT Level Candidate eta/phi/pt/enIn:" << candref->track()->eta() <<
"/"
1466 << candref->track()->phi() <<
"/" << candref->track()->pt() <<
"/"
1467 << candref->energyIn();
1469 double mindR = 999.9, mindP1 = 999.9, eMipDR = 0.0;
1470 std::vector<bool> selFlags;
1472 double conehmaxNearP = 0, hCone = 0;
1473 for (trkDetItr = trkCaloDirections1.begin(); trkDetItr != trkCaloDirections1.end(); trkDetItr++, nTracks++) {
1474 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1476 double dr =
dR(v1, v2);
1477 double dp1 =
std::abs(1. / v1.r() - 1. / v2.r());
1479 edm::LogVerbatim(
"IsoTrack") <<
"This recotrack(eta/phi/pt) " << pTrack->
eta() <<
"/" << pTrack->
phi() <<
"/"
1480 << pTrack->
pt() <<
" has dr/dp= " << dr <<
"/" << dp1;
1485 int nRH_eMipDR = 0, nNearTRKs = 0;
1489 trkDetItr->pointHCAL,
1490 trkDetItr->pointECAL,
1492 trkDetItr->directionECAL,
1497 oneCutParameters.
maxDzPV = 100;
1503 oneCutParameters.
maxDzPV = 100;
1514 trkDetItr->pointHCAL,
1515 trkDetItr->pointECAL,
1517 trkDetItr->directionECAL,
1522 trkDetItr->pointHCAL,
1523 trkDetItr->pointECAL,
1525 trkDetItr->directionECAL,
1527 double e_inCone = e2 - e1;
1528 bool chgIsolFlag = (conehmaxNearP <
cutCharge_);
1529 bool mipFlag = (eMipDR <
cutMip_);
1531 bool trkpropFlag = ((trkDetItr->okECAL) && (trkDetItr->okHCAL));
1533 selFlags.push_back(selectTk);
1534 selFlags.push_back(qltyFlag);
1535 selFlags.push_back(qltyMissFlag);
1536 selFlags.push_back(qltyPVFlag);
1537 selFlags.push_back(trkpropFlag);
1538 selFlags.push_back(chgIsolFlag);
1539 selFlags.push_back(neuIsolFlag);
1540 selFlags.push_back(mipFlag);
1541 double distFromHotCell = -99.0;
1542 int nRecHitsCone = -99, ietaHotCell = -99, iphiHotCell = -99;
1544 std::vector<DetId> coneRecHitDetIds;
1547 trkDetItr->pointHCAL,
1548 trkDetItr->pointECAL,
1550 trkDetItr->directionHCAL,
1562 if (mindR >= 0.05) {
1575 std::vector<reco::TrackCollection::const_iterator> &goodTks) {
1579 for (
int j = 0;
j < 3;
j++) {
1580 for (
unsigned int k = 0;
k <
vec_[
j].size();
k++) {
1588 double deta, dphi,
dr;
1590 for (
int lvl = 1; lvl < 3; lvl++) {
1591 for (
unsigned int i = 0;
i <
vec_[lvl].size();
i++) {
1596 edm::LogVerbatim(
"IsoTrack") <<
"lvl " << lvl <<
" i " << i <<
" deta " << deta <<
" dphi " << dphi <<
" dR "
1606 for (
unsigned int k = 0;
k <
vec_[2].size(); ++
k) {
1611 <<
vec_[2][
k].phi();
1612 for (
unsigned int j = 0;
j <
vec_[1].size();
j++) {
1616 mindRvec =
vec_[1][
j];
1633 edm::LogVerbatim(
"IsoTrack") <<
"Now Matching L3 track with reco: L3 Track (eta, phi) " <<
vec_[2][
k].eta() <<
":"
1634 <<
vec_[2][
k].phi() <<
" L2 Track " << mindRvec.eta() <<
":" << mindRvec.phi()
1636 reco::TrackCollection::const_iterator goodTk = trkCollection->end();
1637 if (trkCollection.
isValid()) {
1638 double mindP(9999.9);
1639 reco::TrackCollection::const_iterator trkItr;
1640 for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); trkItr++) {
1644 if (deltaR < mindR) {
1650 if ((
verbosity_ / 10) % 10 > 1 && deltaR < 1.0)
1651 edm::LogVerbatim(
"IsoTrack") <<
"reco track: pt " << v4.pt() <<
" eta " << v4.eta() <<
" phi " << v4.phi()
1655 edm::LogVerbatim(
"IsoTrack") <<
"Now Matching at Reco level in step 1 DR: " << mindR <<
":" << mindP
1656 <<
" eta:phi " << mindRvec.eta() <<
":" << mindRvec.phi();
1657 if (mindR < 0.03 && mindP > 0.1) {
1658 for (trkItr = trkCollection->begin(); trkItr != trkCollection->end(); trkItr++) {
1662 if (dp < mindP && deltaR < 0.03) {
1670 edm::LogVerbatim(
"IsoTrack") <<
"Now Matching at Reco level in step 2 DR: " << mindR <<
":" << mindP
1671 <<
" eta:phi " << mindRvec.eta() <<
":" << mindRvec.phi();
1682 if (goodTk != trkCollection->end())
1683 goodTks.push_back(goodTk);
1689 std::vector<reco::TrackCollection::const_iterator> &goodTks) {
1690 if (trkCollection.
isValid()) {
1691 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
1695 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1701 <<
" energy " <<
hit->energy();
1707 <<
" energy " <<
hit->energy();
1715 unsigned int nTracks = 0, ngoodTk = 0, nselTk = 0;
1717 for (trkDetItr = trkCaloDirections.begin(); trkDetItr != trkCaloDirections.end(); trkDetItr++, nTracks++) {
1718 bool l3Track = (
std::find(goodTks.begin(), goodTks.end(), trkDetItr->trkItr) != goodTks.end());
1719 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1722 double eMipDR = 9999., e_inCone = 0, conehmaxNearP = 0, mindR = 999.9, hCone = 0;
1723 if (trkDetItr->okHCAL) {
1725 ieta = detId.
ieta();
1727 for (
unsigned k = 0;
k <
vec_[0].size(); ++
k) {
1733 edm::LogVerbatim(
"IsoTrack") <<
"Track ECAL " << trkDetItr->okECAL <<
" HCAL " << trkDetItr->okHCAL <<
" Flag "
1735 if (selectTk && trkDetItr->okECAL && trkDetItr->okHCAL) {
1737 int nRH_eMipDR = 0, nNearTRKs = 0;
1741 trkDetItr->pointHCAL,
1742 trkDetItr->pointECAL,
1744 trkDetItr->directionECAL,
1749 trkDetItr->pointHCAL,
1750 trkDetItr->pointECAL,
1752 trkDetItr->directionECAL,
1757 trkDetItr->pointHCAL,
1758 trkDetItr->pointECAL,
1760 trkDetItr->directionECAL,
1765 double distFromHotCell = -99.0;
1766 int nRecHitsCone = -99, ietaHotCell = -99, iphiHotCell = -99;
1768 std::vector<DetId> coneRecHitDetIds;
1771 trkDetItr->pointHCAL,
1772 trkDetItr->pointECAL,
1774 trkDetItr->directionHCAL,
1789 fillCuts(0, eMipDR, conehmaxNearP, e_inCone, v4, ieta, (mindR >
dr_L1_));
1808 fillCuts(1, eMipDR, conehmaxNearP, e_inCone, v4, ieta, (mindR >
dr_L1_));
1830 double &phiTriggered,
1835 edm::LogVerbatim(
"IsoTrack") <<
"Inside chgIsolation() with eta/phi Triggered: " << etaTriggered <<
"/"
1837 std::vector<double> maxP;
1839 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
1840 std::vector<spr::propagatedTrackDirection> trkCaloDirections1;
1847 std::vector<std::pair<unsigned int, std::pair<double, double>>> VecSeedsatEC;
1851 bool vtxMatch =
false;
1853 unsigned int ivSel =
recVtxs_->size();
1871 std::pair<double, double> seedCooAtEC;
1886 VecSeedsatEC.push_back(std::make_pair(iS, seedCooAtEC));
1890 for (
unsigned int l = 0;
l < VecSeedsatEC.size();
l++) {
1891 unsigned int iSeed = VecSeedsatEC[
l].first;
1897 for (
unsigned int j = 0;
j < VecSeedsatEC.size();
j++) {
1898 unsigned int iSurr = VecSeedsatEC[
j].first;
1899 if (iSeed != iSurr) {
1907 unsigned int ivSel =
recVtxs_->size();
1908 double minDZ2 = 100;
1919 VecSeedsatEC[i].second.second,
1920 VecSeedsatEC[
j].second.first,
1921 VecSeedsatEC[j].second.second);
1933 double conehmaxNearP = -1;
1934 bool selectTk =
false;
1935 double mindR = 999.9;
1938 for (trkDetItr = trkCaloDirections1.begin(); trkDetItr != trkCaloDirections1.end(); trkDetItr++, nTracks++) {
1940 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
1942 double dr =
dR(v1, v2);
1958 std::vector<int> nGood(4, 0);
1959 if (trkCollection.
isValid()) {
1960 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
1968 std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1tauobjref;
1970 std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1jetobjref;
1972 std::vector<edm::Ref<l1extra::L1JetParticleCollection>> l1forjetobjref;
1975 double ptTriggered(-10), etaTriggered(-100), phiTriggered(-100);
1976 for (
unsigned int p = 0;
p < l1tauobjref.size();
p++) {
1977 if (l1tauobjref[
p]->
pt() > ptTriggered) {
1978 ptTriggered = l1tauobjref[
p]->pt();
1979 phiTriggered = l1tauobjref[
p]->phi();
1980 etaTriggered = l1tauobjref[
p]->eta();
1983 for (
unsigned int p = 0;
p < l1jetobjref.size();
p++) {
1984 if (l1jetobjref[
p]->
pt() > ptTriggered) {
1985 ptTriggered = l1jetobjref[
p]->pt();
1986 phiTriggered = l1jetobjref[
p]->phi();
1987 etaTriggered = l1jetobjref[
p]->eta();
1990 for (
unsigned int p = 0;
p < l1forjetobjref.size();
p++) {
1991 if (l1forjetobjref[
p]->
pt() > ptTriggered) {
1992 ptTriggered = l1forjetobjref[
p]->pt();
1993 phiTriggered = l1forjetobjref[
p]->phi();
1994 etaTriggered = l1forjetobjref[
p]->eta();
1997 double pTriggered = ptTriggered * cosh(etaTriggered);
1999 ptTriggered *
cos(phiTriggered), ptTriggered *
sin(phiTriggered), pTriggered * tanh(etaTriggered), pTriggered);
2001 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
2003 for (trkDetItr = trkCaloDirections.begin(); trkDetItr != trkCaloDirections.end(); trkDetItr++, nTracks++) {
2004 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
2007 double mindR =
dR(v4, pTrigger);
2009 edm::LogVerbatim(
"IsoTrack") <<
"Track ECAL " << trkDetItr->okECAL <<
" HCAL " << trkDetItr->okHCAL <<
" Flag "
2011 if (selectTk && trkDetItr->okECAL && trkDetItr->okHCAL && mindR > 1.0) {
2012 int nRH_eMipDR(0), nNearTRKs(0);
2016 trkDetItr->pointHCAL,
2017 trkDetItr->pointECAL,
2019 trkDetItr->directionECAL,
2021 double conehmaxNearP =
2023 if (conehmaxNearP < 2.0 && eMipDR < 1.0) {
2024 if (pTrack->
p() >= 20 && pTrack->
p() < 30) {
2026 }
else if (pTrack->
p() >= 30 && pTrack->
p() < 40) {
2028 }
else if (pTrack->
p() >= 40 && pTrack->
p() < 60) {
2030 }
else if (pTrack->
p() >= 60 && pTrack->
p() < 100) {
2038 for (
unsigned int ii = 0;
ii < nGood.size(); ++
ii)
2043 h_p[indx]->Fill(vec.r());
2044 h_pt[indx]->Fill(vec.pt());
2045 h_eta[indx]->Fill(vec.eta());
2046 h_phi[indx]->Fill(vec.phi());
2050 double dr =
dR(vec1, vec2);
2051 double deta =
dEta(vec1, vec2);
2052 double dphi =
dPhi(vec1, vec2);
2053 double dpt =
dPt(vec1, vec2);
2054 double dp =
dP(vec1, vec2);
2055 double dinvpt =
dinvPt(vec1, vec2);
2056 h_dEta[indx]->Fill(deta);
2057 h_dPhi[indx]->Fill(dphi);
2058 h_dPt[indx]->Fill(dpt);
2059 h_dP[indx]->Fill(dp);
2063 edm::LogVerbatim(
"IsoTrack") <<
"mindR for index " << indx <<
" is " << dr <<
" deta " << deta <<
" dphi " << dphi
2064 <<
" dpt " << dpt <<
" dinvpt " << dinvpt;
2069 h_eMip[indx]->Fill(eMipDR);
2073 for (
int lim = 0; lim < 5; ++lim) {
2090 if (ieta > 0 && ieta < 25)
2092 else if (ieta > -25 && ieta < 0)
2094 if (kk >= 0 && eMipDR > 0.01 && hCone > 1.0) {
2095 for (
int lim = 0; lim < 5; ++lim) {
2098 h_eCalo[lim][indx][
kk]->Fill(hCone + eMipDR);
2107 double phi1 = vec1.phi();
2110 double phi2 = vec2.phi();
2113 double dphi = phi1 - phi2;
2116 else if (dphi < -
M_PI)
2122 double deta =
dEta(vec1, vec2);
2123 double dphi =
dPhi(vec1, vec2);
2124 return std::sqrt(deta * deta + dphi * dphi);
2130 return (
std::abs(vec1.r() - vec2.r()));
2134 return ((1 / vec1.pt()) - (1 / vec2.pt()));
2138 double eta(0),
phi(0), ptmax(0);
2139 for (
unsigned int k = 0;
k <
vec_[0].size(); ++
k) {
2143 ptmax =
vec_[0][
k].pt();
2144 }
else if (
vec_[0][
k].
pt() > ptmax) {
2147 ptmax =
vec_[0][
k].pt();
2150 return std::pair<double, double>(
eta,
phi);
2158 double Rcurv = 9999999;
2160 Rcurv = pT * 33.3 * 100 / (
bfVal_ * 10);
2162 double ecDist =
zEE_;
2163 double ecRad =
rEB_;
2164 double theta = 2 * atan(
exp(-etaIP));
2166 if (theta > 0.5 *
M_PI)
2168 if (fabs(etaIP) < 1.479) {
2169 if ((0.5 * ecRad / Rcurv) > 1) {
2173 deltaPhi = -charge * asin(0.5 * ecRad / Rcurv);
2174 double alpha1 = 2 * asin(0.5 * ecRad / Rcurv);
2175 double z = ecRad /
tan(theta);
2177 zNew = z * (Rcurv * alpha1) / ecRad + vtxZ;
2179 zNew = -z * (Rcurv * alpha1) / ecRad + vtxZ;
2180 double zAbs = fabs(zNew);
2181 if (zAbs < ecDist) {
2182 etaEC = -
log(
tan(0.5 * atan(ecRad / zAbs)));
2183 deltaPhi = -charge * asin(0.5 * ecRad / Rcurv);
2185 if (zAbs > ecDist) {
2186 zAbs = (fabs(etaIP) / etaIP) * ecDist;
2187 double Zflight = fabs(zAbs - vtxZ);
2188 double alpha = (Zflight * ecRad) / (z * Rcurv);
2189 double Rec = 2 * Rcurv *
sin(alpha / 2);
2190 deltaPhi = -charge * alpha / 2;
2191 etaEC = -
log(
tan(0.5 * atan(Rec / ecDist)));
2195 zNew = (fabs(etaIP) / etaIP) * ecDist;
2196 double Zflight = fabs(zNew - vtxZ);
2197 double Rvirt = fabs(Zflight *
tan(theta));
2198 double Rec = 2 * Rcurv *
sin(Rvirt / (2 * Rcurv));
2199 deltaPhi = -(
charge) * (Rvirt / (2 * Rcurv));
2200 etaEC = -
log(
tan(0.5 * atan(Rec / ecDist)));
2212 std::pair<double, double> retVal(etaEC, phiEC);
2218 double theta1 = 2 * atan(
exp(-eta1));
2219 double theta2 = 2 * atan(
exp(-eta2));
2220 if (fabs(eta1) < 1.479)
2222 else if (fabs(eta1) > 1.479 && fabs(eta1) < 7.0)
2230 if (angle < 0.5 *
M_PI)
2231 return fabs((Rec /
sin(theta1)) *
tan(angle));
unsigned int size() const
number of trigger paths in trigger table
std::pair< T, T > etaphi(T x, T y, T z)
static const std::string kSharedResource
double p() const
momentum vector magnitude
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, int useRaw=0, bool debug=false)
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
std::vector< bool > * t_NFTrkPVFlag
std::vector< double > * t_PixTrkcandPhi
std::vector< double > * t_PixTrkcandP
T getUntrackedParameter(std::string const &, T const &) const
void endRun(edm::Run const &, edm::EventSetup const &) override
std::string theTrackQuality_
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_l2cand_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
edm::Service< TFileService > fs_
static std::vector< std::string > checklist log
const edm::InputTag l2CandTag_
edm::Handle< EcalRecHitCollection > endcapRecHitsHandle_
std::vector< double > * t_NFTrkMinDR
void beginRun(edm::Run const &, edm::EventSetup const &) override
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
void chgIsolation(double &etaTriggered, double &phiTriggered, edm::Handle< reco::TrackCollection > &trkCollection, const edm::Event &theEvent)
std::vector< bool > * t_NFTrkMissFlag
const bool doChgIsolTree_
edm::EDGetTokenT< LumiDetails > tok_lumi_
edm::Handle< HBHERecHitCollection > hbhe_
std::vector< bool > * t_PixTrkcandselTk
std::vector< reco::TrackRef > pixelTrackRefsHB_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
void studyIsolation(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define DEFINE_FWK_MODULE(type)
std::vector< double > * t_NFTrkcandEta
std::vector< double > * t_NFcandP
Sin< T >::type sin(const T &t)
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
const Keys & filterKeys(trigger::size_type index) const
std::map< unsigned int, const std::pair< int, int > > trigPreList_
Global3DPoint GlobalPoint
std::vector< EcalRecHit >::const_iterator const_iterator
Geom::Theta< T > theta() const
tuple cuts2
split ieta < 16
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
edm::Handle< EcalRecHitCollection > barrelRecHitsHandle_
double phi() const
azimuthal angle of momentum vector
std::vector< int > * t_nPixSeed
std::vector< double > * t_TrkhCone
edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > tok_pixtk_
std::vector< bool > * t_NFTrkqltyFlag
T * make(const Args &...args) const
make new ROOT object
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
std::vector< double > * t_PixTrkcandMaxP
const double minPTrackValue_
edm::Handle< reco::BeamSpot > beamSpotH_
vtxCutIsol_(config.getParameter< double >("MaxVtxDXYIsol"))
Exp< T >::type exp(const T &t)
std::vector< math::XYZTLorentzVector > vec_[3]
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double px() const
x coordinate of momentum vector
std::vector< bool > * t_NFTrkselTkFlag
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double dP(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< double > * t_PixcandP
std::pair< double, double > etaPhiTrigger()
Strings const & triggerNames() const
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
const double tauUnbiasCone_
std::vector< bool > * t_NFTrkMipFlag
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
void pushMipCutTreeVecs(math::XYZTLorentzVector &NFcand, math::XYZTLorentzVector &Trkcand, double &EmipNFcand, double &EmipTrkcand, double &mindR, double &mindP1, std::vector< bool > &Flags, double hCone)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
bool getData(T &iHolder) const
U second(std::pair< T, U > const &p)
std::vector< double > * t_NFTrkMinDP1
void analyze(const edm::Event &, const edm::EventSetup &) override
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const std::vector< edm::InputTag > pixelTracksSources_
void studyMipCut(edm::Handle< reco::TrackCollection > &trkCollection, edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &L2cands)
HLTPrescaleProvider hltPrescaleProvider_
double dinvPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
TkSoA const *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
double eta() const
pseudorapidity of momentum vector
void studyTrigger(edm::Handle< reco::TrackCollection > &, std::vector< reco::TrackCollection::const_iterator > &)
void fillHist(int, math::XYZTLorentzVector &)
std::vector< double > * t_NFTrkcandP
edm::EDGetTokenT< SeedingLayerSetsHits > tok_SeedingLayerHB_
std::vector< bool > * t_TrkNuIsolFlag
std::map< unsigned int, unsigned int > trigList_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
std::vector< bool > * t_TrkPVFlag
const TriggerObjectCollection & getObjects() const
std::pair< TL1, THLT > prescaleValues(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
Combined L1T (pair.first) and HLT (pair.second) prescales per HLT path.
std::vector< double > * t_ECone
std::vector< double > vec1
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
double pt() const
track transverse momentum
void fillEnergy(int, int, double, double, math::XYZTLorentzVector &)
Cos< T >::type cos(const T &t)
std::vector< bool > * t_NFTrkChgIsoFlag
std::vector< edm::EDGetTokenT< reco::TrackCollection > > tok_pixtks_
std::vector< double > * t_TrkP
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
spr::trackSelectionParameters selectionParameters_
constexpr int ieta() const
get the cell ieta
std::vector< double > * t_NFcandEta
edm::EDGetTokenT< SeedingLayerSetsHits > tok_SeedingLayerHE_
std::vector< double > * t_timeL2Prod
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
LuminosityBlock const & getLuminosityBlock() const
minPTrackValue_(config.getParameter< double >("minPTrack"))
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
vtxCutSeed_(config.getParameter< double >("MaxVtxDXYSeed"))
static std::string const triggerResults
IsoTrig(const edm::ParameterSet &)
std::vector< double > * t_PixcandPt
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const CaloGeometry * geo_
std::vector< double > * t_NFcandEmip
double dPhi(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
void studyTiming(const edm::Event &theEvent)
void clearChgIsolnTreeVectors()
std::vector< bool > * t_NFTrkPropFlag
double pz() const
z coordinate of momentum vector
std::vector< reco::TrackRef > pixelTrackRefsHE_
std::vector< double > * t_NFTrkcandPhi
prelimCone_(config.getParameter< double >("ExtrapolationConeSize"))
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
const edm::InputTag filterTag(trigger::size_type index) const
std::vector< bool > * t_TrkMissFlag
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
std::vector< int > * t_nPixCand
static TrackQuality qualityByName(const std::string &name)
void StudyTrkEbyP(edm::Handle< reco::TrackCollection > &trkCollection)
std::vector< double > * t_NFTrkcandPt
T const * product() const
const edm::InputTag pixCandTag_
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< size_type > Keys
std::vector< double > * t_PixTrkcandPt
double dEta(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
edm::EDGetTokenT< reco::VertexCollection > tok_verthb_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< double > * t_NFcandPt
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::Handle< reco::VertexCollection > recVtxs_
std::vector< bool > * t_TrkqltyFlag
HLTConfigProvider const & hltConfigProvider() const
TH1D * h_etaMipTracks[5][2][2]
const std::string processName_
std::vector< std::vector< double > > * t_PixcandMaxP
std::vector< double > * t_NFTrkcandEmip
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_l1cand_
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
const edm::InputTag l1CandTag_
void clearMipCutTreeVectors()
edm::EDGetTokenT< SiPixelRecHitCollection > tok_SiPixelRecHits_
std::vector< double > * t_PixcandEta
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
static int position[264][3]
reco::TrackBase::TrackQuality minQuality
void fillDifferences(int, math::XYZTLorentzVector &, math::XYZTLorentzVector &, bool)
const MagneticField * bField_
double dPt(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
std::vector< bool > * t_NFTrkNeuIsoFlag
std::vector< double > * t_PixcandPhi
std::vector< double > * t_PixTrkcandEta
tauUnbiasCone_(config.getParameter< double >("tauUnbiasCone"))
std::vector< int > * t_nGoodTk
pixelIsolationConeSizeAtEC_(config.getParameter< double >("PixelIsolationConeSizeAtEC"))
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< reco::VertexCollection > tok_verthe_
const std::vector< double > pixelIsolationConeSizeAtEC_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
void getGoodTracks(const edm::Event &, edm::Handle< reco::TrackCollection > &)
TH1D * h_etaCalibTracks[5][2][2]
unsigned short size() const
Get the number of SeedingLayerSets.
std::vector< bool > * t_TrkselTkFlag
const std::vector< std::string > trigNames_
tuple size
Write out results.
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
double py() const
y coordinate of momentum vector
void fillCuts(int, double, double, double, math::XYZTLorentzVector &, int, bool)
void pushChgIsolnTreeVecs(math::XYZTLorentzVector &Pixcand, math::XYZTLorentzVector &Trkcand, std::vector< double > &PixMaxP, double &TrkMaxP, bool &selTk)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
std::vector< double > * t_NFcandPhi
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_