@@ -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" ) {
@@ -208,8 +215,15 @@ void HLTExoticaPlotter::bookHist(DQMStore::IBooker &iBooker,
208215 double max = _parametersDxy[2 ];
209216 h = new TH1F (name.c_str (), title.c_str (), nBins, min, max);
210217 } else if (variable.find (" MaxPt" ) != std::string::npos) {
211- std::string desc =
212- (variable == " MaxPt1" ) ? " Leading" : (variable == " MaxPt2" ) ? " Next-to-Leading" : " Next-to-next-to-Leading" ;
218+ std::string desc; // =
219+ // (variable == "MaxPt1") ? "Leading" : (variable == "MaxPt2") ? "Next-to-Leading" : "Next-to-next-to-Leading";
220+ if (variable == " MaxPt1" ) {
221+ desc = " Leading" ;
222+ } else if (variable == " MaxPt2" ) {
223+ desc = " Next-to-Leading" ;
224+ } else {
225+ desc = " Next-to-next-to-Leading" ;
226+ }
213227 std::string title = " pT of " + desc + " " + sourceUpper + " " + objType +
214228 " "
215229 " where event pass the " +
0 commit comments