Skip to content

Commit 4c3ab65

Browse files
committed
Issue fix in Exotica HLT validation code
1 parent a27c112 commit 4c3ab65

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

HLTriggerOffline/Exotica/src/HLTExoticaPlotter.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@ void HLTExoticaPlotter::analyze(const bool &isPassTrigger,
126126
totalobjectssize++;
127127
totalobjectssize *= countobjects.size();
128128
// Fill the histos if pass the trigger (just the two with higher pt)
129+
unsigned int jaux = 0;
130+
// jaux is being used as a dedicated counter to avoid getting
131+
// a non-existent element inside dxys
132+
// more information in the issue https://github.com/cms-sw/cmssw/issues/32550
129133
for (size_t j = 0; j < matches.size(); ++j) {
130134
// Is this object owned by this trigger? If not we are not interested...
131135
if (_objectsType.find(matches[j].pdgId()) == _objectsType.end()) {
136+
++jaux;
132137
continue;
133138
}
134139

@@ -149,8 +154,10 @@ void HLTExoticaPlotter::analyze(const bool &isPassTrigger,
149154
}
150155

151156
if (!dxys.empty() &&
152-
(objType == EVTColContainer::ELEC || objType == EVTColContainer::MUON || objType == EVTColContainer::MUTRK))
153-
this->fillHist(isPassTrigger, source, objTypeStr, "Dxy", dxys[j]);
157+
(objType == EVTColContainer::ELEC || objType == EVTColContainer::MUON || objType == EVTColContainer::MUTRK)){
158+
this->fillHist(isPassTrigger, source, objTypeStr, "Dxy", dxys[jaux]);
159+
++jaux;
160+
}
154161

155162
if (countobjects[objType] == 0) {
156163
if (!(TString(objTypeStr).Contains("MET") || TString(objTypeStr).Contains("MHT")) || source != "gen") {

HLTriggerOffline/Exotica/src/HLTExoticaSubAnalysis.cc

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,18 @@ void HLTExoticaSubAnalysis::analyze(const edm::Event &iEvent, const edm::EventSe
659659
}
660660
}
661661

662+
int jel = 0;
663+
int jmu = 0;
664+
int jmutrk = 0;
665+
666+
// jel, jmu and jmutrk are being used as a dedicated counters to avoid getting
667+
// non-existent elements inside trkObjs[11], trkObjs[13] and trkObjs[130], respectively
668+
// more information in the issue https://github.com/cms-sw/cmssw/issues/32550
669+
662670
for (size_t j = 0; (j != matchesReco.size()) && isPassedLeadingCut; ++j) {
663671
const unsigned int objType = matchesReco[j].pdgId();
664-
// std::cout << "(4) Gonna call with " << objType << std::endl;
672+
//std::cout << "(4) Gonna call with " << objType << std::endl;
673+
665674
const std::string objTypeStr = EVTColContainer::getTypeString(objType);
666675

667676
float pt = matchesReco[j].pt();
@@ -703,10 +712,25 @@ void HLTExoticaSubAnalysis::analyze(const edm::Event &iEvent, const edm::EventSe
703712
this->fillHist("rec", objTypeStr, "SumEt", theSumEt[objType]);
704713
}
705714

706-
if (trkObjs[objType].size() >= j + 1) {
707-
float dxyRec = trkObjs[objType].at(j)->dxy(cols->bs->position());
715+
if(objType == 11){
716+
float dxyRec = trkObjs[objType].at(jel)->dxy(cols->bs->position());
717+
this->fillHist("rec", objTypeStr, "Dxy", dxyRec);
718+
dxys.push_back(dxyRec);
719+
++jel;
720+
}
721+
722+
if(objType == 13){
723+
float dxyRec = trkObjs[objType].at(jmu)->dxy(cols->bs->position());
724+
this->fillHist("rec", objTypeStr, "Dxy", dxyRec);
725+
dxys.push_back(dxyRec);
726+
++jmu;
727+
}
728+
729+
if(objType == 130){
730+
float dxyRec = trkObjs[objType].at(jmutrk)->dxy(cols->bs->position());
708731
this->fillHist("rec", objTypeStr, "Dxy", dxyRec);
709732
dxys.push_back(dxyRec);
733+
++jmutrk;
710734
}
711735

712736
} // Closes loop in reco

0 commit comments

Comments
 (0)