CMS 3D CMS Logo

TriggerMenuParser.cc
Go to the documentation of this file.
1 
25 // this class header
26 #include "TriggerMenuParser.h"
27 
28 // system include files
29 #include <string>
30 #include <vector>
31 
32 #include <iostream>
33 #include <fstream>
34 #include <iomanip>
35 #include <cmath>
36 
38 
41 
42 #include "tmEventSetup/tmEventSetup.hh"
43 #include "tmEventSetup/esTriggerMenu.hh"
44 #include "tmEventSetup/esAlgorithm.hh"
45 #include "tmEventSetup/esCondition.hh"
46 #include "tmEventSetup/esObject.hh"
47 #include "tmEventSetup/esCut.hh"
48 #include "tmEventSetup/esScale.hh"
49 #include "tmGrammar/Algorithm.hh"
50 #include <cstdint>
51 
52 // constructor
54  : m_triggerMenuInterface("NULL"),
55  m_triggerMenuName("NULL"),
56  m_triggerMenuImplementation(0x0),
57  m_scaleDbKey("NULL")
58 
59 {
60  // menu names, scale key initialized to NULL due to ORACLE treatment of strings
61 
62  // empty
63 }
64 
65 // destructor
67 
68 // set the number of condition chips in GTL
69 void l1t::TriggerMenuParser::setGtNumberConditionChips(const unsigned int& numberConditionChipsValue) {
70  m_numberConditionChips = numberConditionChipsValue;
71 }
72 
73 // set the number of pins on the GTL condition chips
74 void l1t::TriggerMenuParser::setGtPinsOnConditionChip(const unsigned int& pinsOnConditionChipValue) {
75  m_pinsOnConditionChip = pinsOnConditionChipValue;
76 }
77 
78 // set the correspondence "condition chip - GTL algorithm word"
79 // in the hardware
80 void l1t::TriggerMenuParser::setGtOrderConditionChip(const std::vector<int>& orderConditionChipValue) {
81  m_orderConditionChip = orderConditionChipValue;
82 }
83 
84 // set the number of physics trigger algorithms
85 void l1t::TriggerMenuParser::setGtNumberPhysTriggers(const unsigned int& numberPhysTriggersValue) {
86  m_numberPhysTriggers = numberPhysTriggersValue;
87 }
88 
89 // set the condition maps
90 void l1t::TriggerMenuParser::setGtConditionMap(const std::vector<ConditionMap>& condMap) { m_conditionMap = condMap; }
91 
92 // set the trigger menu name
94  m_triggerMenuInterface = menuInterface;
95 }
96 
97 // set the trigger menu uuid
98 void l1t::TriggerMenuParser::setGtTriggerMenuUUID(const int uuid) { m_triggerMenuUUID = uuid; }
99 
100 void l1t::TriggerMenuParser::setGtTriggerMenuName(const std::string& menuName) { m_triggerMenuName = menuName; }
101 
102 void l1t::TriggerMenuParser::setGtTriggerMenuImplementation(const unsigned long& menuImplementation) {
103  m_triggerMenuImplementation = menuImplementation;
104 }
105 
106 // set menu associated scale key
107 void l1t::TriggerMenuParser::setGtScaleDbKey(const std::string& scaleKey) { m_scaleDbKey = scaleKey; }
108 
109 // set the vectors containing the conditions
110 void l1t::TriggerMenuParser::setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >& vecMuonTempl) {
111  m_vecMuonTemplate = vecMuonTempl;
112 }
113 
114 void l1t::TriggerMenuParser::setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >& vecCaloTempl) {
115  m_vecCaloTemplate = vecCaloTempl;
116 }
117 
119  const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
120  m_vecEnergySumTemplate = vecEnergySumTempl;
121 }
122 
124  const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
125  m_vecExternalTemplate = vecExternalTempl;
126 }
127 
129  const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
130  m_vecCorrelationTemplate = vecCorrelationTempl;
131 }
132 
134  const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
135  m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
136 }
137 
139  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
140  m_vecCorrelationWithOverlapRemovalTemplate = vecCorrelationWithOverlapRemovalTempl;
141 }
142 
143 // set the vectors containing the conditions for correlation templates
144 //
145 void l1t::TriggerMenuParser::setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >& corMuonTempl) {
146  m_corMuonTemplate = corMuonTempl;
147 }
148 
149 void l1t::TriggerMenuParser::setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >& corCaloTempl) {
150  m_corCaloTemplate = corCaloTempl;
151 }
152 
154  const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
155  m_corEnergySumTemplate = corEnergySumTempl;
156 }
157 
158 // set the algorithm map (by algorithm names)
159 void l1t::TriggerMenuParser::setGtAlgorithmMap(const AlgorithmMap& algoMap) { m_algorithmMap = algoMap; }
160 
161 // set the algorithm map (by algorithm aliases)
162 void l1t::TriggerMenuParser::setGtAlgorithmAliasMap(const AlgorithmMap& algoMap) { m_algorithmAliasMap = algoMap; }
163 
164 std::map<std::string, unsigned int> l1t::TriggerMenuParser::getExternalSignals(const L1TUtmTriggerMenu* utmMenu) {
165  using namespace tmeventsetup;
166  const esTriggerMenu* menu = reinterpret_cast<const esTriggerMenu*>(utmMenu);
167  const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
168 
169  std::map<std::string, unsigned int> extBitMap;
170 
171  //loop over the algorithms
172  for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin(); cit != condMap.end(); cit++) {
173  const esCondition& condition = cit->second;
174  if (condition.getType() == esConditionType::Externals) {
175  // Get object for External conditions
176  const std::vector<esObject>& objects = condition.getObjects();
177  for (size_t jj = 0; jj < objects.size(); jj++) {
178  const esObject object = objects.at(jj);
179  if (object.getType() == esObjectType::EXT) {
180  unsigned int channelID = object.getExternalChannelId();
181  std::string name = object.getExternalSignalName();
182 
183  if (extBitMap.count(name) == 0)
184  extBitMap.insert(std::map<std::string, unsigned int>::value_type(name, channelID));
185  }
186  }
187  }
188  }
189  /*
190  for (std::map<std::string, unsigned int>::const_iterator cit = extBitMap.begin();
191  cit != extBitMap.end(); cit++) {
192  std::cout << " Ext Map: Name " << cit->first << " Bit " << cit->second << std::endl;
193  }
194 */
195  return extBitMap;
196 }
197 
198 // parse def.xml file
200  // resize the vector of condition maps
201  // the number of condition chips should be correctly set before calling parseXmlFile
202  m_conditionMap.resize(m_numberConditionChips);
203 
204  m_vecMuonTemplate.resize(m_numberConditionChips);
205  m_vecCaloTemplate.resize(m_numberConditionChips);
206  m_vecEnergySumTemplate.resize(m_numberConditionChips);
207  m_vecExternalTemplate.resize(m_numberConditionChips);
208 
209  m_vecCorrelationTemplate.resize(m_numberConditionChips);
210  m_vecCorrelationThreeBodyTemplate.resize(m_numberConditionChips);
211  m_vecCorrelationWithOverlapRemovalTemplate.resize(m_numberConditionChips);
212  m_corMuonTemplate.resize(m_numberConditionChips);
213  m_corCaloTemplate.resize(m_numberConditionChips);
214  m_corEnergySumTemplate.resize(m_numberConditionChips);
215 
216  using namespace tmeventsetup;
217  using namespace Algorithm;
218 
219  const esTriggerMenu* menu = reinterpret_cast<const esTriggerMenu*>(utmMenu);
220 
221  //get the meta data
222  m_triggerMenuDescription = menu->getComment();
223  m_triggerMenuDate = menu->getDatetime();
224  m_triggerMenuImplementation = (getMmHashN(menu->getFirmwareUuid()) & 0xFFFFFFFF); //make sure we only have 32 bits
225  m_triggerMenuName = menu->getName();
226  m_triggerMenuInterface = menu->getVersion(); //BLW: correct descriptor?
227  m_triggerMenuUUID = (getMmHashN(menu->getName()) & 0xFFFFFFFF); //make sure we only have 32 bits
228 
229  const std::map<std::string, esAlgorithm>& algoMap = menu->getAlgorithmMap();
230  const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
231  const std::map<std::string, esScale>& scaleMap = menu->getScaleMap();
232 
233  // parse the scales
234  m_gtScales.setScalesName(menu->getScaleSetName());
235  parseScales(scaleMap);
236 
237  //loop over the algorithms
238  for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
239  //condition chip (artifact) TO DO: Update
240  int chipNr = 0;
241 
242  //get algorithm
243  const esAlgorithm& algo = cit->second;
244 
245  //parse the algorithm
246  parseAlgorithm(algo, chipNr); //blw
247 
248  //get conditions for this algorithm
249  const std::vector<std::string>& rpn_vec = algo.getRpnVector();
250  for (size_t ii = 0; ii < rpn_vec.size(); ii++) {
251  const std::string& token = rpn_vec.at(ii);
252  if (isGate(token))
253  continue;
254  // long hash = getHash(token);
255  const esCondition& condition = condMap.find(token)->second;
256 
257  //check to see if this condtion already exists
258  if ((m_conditionMap[chipNr]).count(condition.getName()) == 0) {
259  // parse Calo Conditions (EG, Jets, Taus)
260  if (condition.getType() == esConditionType::SingleEgamma ||
261  condition.getType() == esConditionType::DoubleEgamma ||
262  condition.getType() == esConditionType::TripleEgamma ||
263  condition.getType() == esConditionType::QuadEgamma || condition.getType() == esConditionType::SingleTau ||
264  condition.getType() == esConditionType::DoubleTau || condition.getType() == esConditionType::TripleTau ||
265  condition.getType() == esConditionType::QuadTau || condition.getType() == esConditionType::SingleJet ||
266  condition.getType() == esConditionType::DoubleJet || condition.getType() == esConditionType::TripleJet ||
267  condition.getType() == esConditionType::QuadJet) {
268  parseCalo(condition, chipNr, false);
269 
270  // parse Energy Sums
271  } else if (condition.getType() == esConditionType::TotalEt ||
272  condition.getType() == esConditionType::TotalEtEM ||
273  condition.getType() == esConditionType::TotalHt ||
274  condition.getType() == esConditionType::MissingEt ||
275  condition.getType() == esConditionType::MissingHt ||
276  condition.getType() == esConditionType::MissingEtHF ||
277  condition.getType() == esConditionType::TowerCount ||
278  condition.getType() == esConditionType::MinBiasHFP0 ||
279  condition.getType() == esConditionType::MinBiasHFM0 ||
280  condition.getType() == esConditionType::MinBiasHFP1 ||
281  condition.getType() == esConditionType::MinBiasHFM1 ||
282  condition.getType() == esConditionType::AsymmetryEt ||
283  condition.getType() == esConditionType::AsymmetryHt ||
284  condition.getType() == esConditionType::AsymmetryEtHF ||
285  condition.getType() == esConditionType::AsymmetryHtHF ||
286  condition.getType() == esConditionType::Centrality0 ||
287  condition.getType() == esConditionType::Centrality1 ||
288  condition.getType() == esConditionType::Centrality2 ||
289  condition.getType() == esConditionType::Centrality3 ||
290  condition.getType() == esConditionType::Centrality4 ||
291  condition.getType() == esConditionType::Centrality5 ||
292  condition.getType() == esConditionType::Centrality6 ||
293  condition.getType() == esConditionType::Centrality7) {
294  parseEnergySum(condition, chipNr, false);
295 
296  //parse Muons
297  } else if (condition.getType() == esConditionType::SingleMuon ||
298  condition.getType() == esConditionType::DoubleMuon ||
299  condition.getType() == esConditionType::TripleMuon ||
300  condition.getType() == esConditionType::QuadMuon) {
301  parseMuon(condition, chipNr, false);
302 
303  //parse Correlation Conditions
304  } else if (condition.getType() == esConditionType::MuonMuonCorrelation ||
305  condition.getType() == esConditionType::MuonEsumCorrelation ||
306  condition.getType() == esConditionType::CaloMuonCorrelation ||
307  condition.getType() == esConditionType::CaloCaloCorrelation ||
308  condition.getType() == esConditionType::CaloEsumCorrelation ||
309  condition.getType() == esConditionType::InvariantMass ||
310  condition.getType() == esConditionType::TransverseMass ||
311  condition.getType() == esConditionType::InvariantMassUpt) { // Added for displaced muons
312  parseCorrelation(condition, chipNr);
313 
314  //parse three-body Correlation Conditions
315  } else if (condition.getType() == esConditionType::InvariantMass3) {
316  parseCorrelationThreeBody(condition, chipNr);
317 
318  //parse Externals
319  } else if (condition.getType() == esConditionType::Externals) {
320  parseExternal(condition, chipNr);
321 
322  } else if (condition.getType() == esConditionType::SingleEgammaOvRm ||
323  condition.getType() == esConditionType::DoubleEgammaOvRm ||
324  condition.getType() == esConditionType::TripleEgammaOvRm ||
325  condition.getType() == esConditionType::QuadEgammaOvRm ||
326  condition.getType() == esConditionType::SingleTauOvRm ||
327  condition.getType() == esConditionType::DoubleTauOvRm ||
328  condition.getType() == esConditionType::TripleTauOvRm ||
329  condition.getType() == esConditionType::QuadTauOvRm ||
330  condition.getType() == esConditionType::SingleJetOvRm ||
331  condition.getType() == esConditionType::DoubleJetOvRm ||
332  condition.getType() == esConditionType::TripleJetOvRm ||
333  condition.getType() == esConditionType::QuadJetOvRm) {
334  edm::LogError("TriggerMenuParser")
335  << std::endl
336  << "SingleEgammaOvRm" << std::endl
337  << "DoubleEgammaOvRm" << std::endl
338  << "TripleEgammaOvRm" << std::endl
339  << "QuadEgammaOvRm" << std::endl
340  << "SingleTauOvRm" << std::endl
341  << "DoubleTauOvRm" << std::endl
342  << "TripleTauOvRm" << std::endl
343  << "QuadTauOvRm" << std::endl
344  << "SingleJetOvRm" << std::endl
345  << "DoubleJetOvRm" << std::endl
346  << "TripleJetOvRm" << std::endl
347  << "QuadJetOvRm" << std::endl
348  << "The above conditions types OvRm are not implemented yet in the parser. Please remove alogrithms that "
349  "use this type of condtion from L1T Menu!"
350  << std::endl;
351 
352  }
353  //parse CorrelationWithOverlapRemoval
354  else if (condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
355  condition.getType() == esConditionType::InvariantMassOvRm ||
356  condition.getType() == esConditionType::TransverseMassOvRm) {
357  parseCorrelationWithOverlapRemoval(condition, chipNr);
358  }
359 
360  } //if condition is a new one
361  } //loop over conditions
362  } //loop over algorithms
363 
364  return;
365 }
366 
367 //
368 
369 void l1t::TriggerMenuParser::setGtTriggerMenuInterfaceDate(const std::string& val) { m_triggerMenuInterfaceDate = val; }
370 
372  m_triggerMenuInterfaceAuthor = val;
373 }
374 
376  m_triggerMenuInterfaceDescription = val;
377 }
378 
380 
381 void l1t::TriggerMenuParser::setGtTriggerMenuAuthor(const std::string& val) { m_triggerMenuAuthor = val; }
382 
383 void l1t::TriggerMenuParser::setGtTriggerMenuDescription(const std::string& val) { m_triggerMenuDescription = val; }
384 
385 void l1t::TriggerMenuParser::setGtAlgorithmImplementation(const std::string& val) { m_algorithmImplementation = val; }
386 
387 // methods for conditions and algorithms
388 
389 // clearMaps - delete all conditions and algorithms in
390 // the maps and clear the maps.
392  // loop over condition maps (one map per condition chip)
393  // then loop over conditions in the map
394  for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip != m_conditionMap.end();
395  itCondOnChip++) {
396  // the conditions in the maps are deleted in L1uGtTriggerMenu, not here
397 
398  itCondOnChip->clear();
399  }
400 
401  // the algorithms in the maps are deleted in L1uGtTriggerMenu, not here
402  m_algorithmMap.clear();
403 }
404 
405 // insertConditionIntoMap - safe insert of condition into condition map.
406 // if the condition name already exists, do not insert it and return false
408  std::string cName = cond.condName();
409  LogTrace("TriggerMenuParser") << " Trying to insert condition \"" << cName << "\" in the condition map."
410  << std::endl;
411 
412  // no condition name has to appear twice!
413  if ((m_conditionMap[chipNr]).count(cName) != 0) {
414  LogTrace("TriggerMenuParser") << " Condition " << cName << " already exists - not inserted!" << std::endl;
415  return false;
416  }
417 
418  (m_conditionMap[chipNr])[cName] = &cond;
419  LogTrace("TriggerMenuParser") << " OK - condition inserted!" << std::endl;
420 
421  return true;
422 }
423 
424 // insert an algorithm into algorithm map
426  std::string algName = alg.algoName();
427  const std::string& algAlias = alg.algoAlias();
428  //LogTrace("TriggerMenuParser")
429  //<< " Trying to insert algorithm \"" << algName << "\" in the algorithm map." ;
430 
431  // no algorithm name has to appear twice!
432  if (m_algorithmMap.count(algName) != 0) {
433  LogTrace("TriggerMenuParser") << " Algorithm \"" << algName
434  << "\"already exists in the algorithm map- not inserted!" << std::endl;
435  return false;
436  }
437 
438  if (m_algorithmAliasMap.count(algAlias) != 0) {
439  LogTrace("TriggerMenuParser") << " Algorithm alias \"" << algAlias
440  << "\"already exists in the algorithm alias map- not inserted!" << std::endl;
441  return false;
442  }
443 
444  // bit number less than zero or greater than maximum number of algorithms
445  int bitNumber = alg.algoBitNumber();
446  if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberPhysTriggers))) {
447  LogTrace("TriggerMenuParser") << " Bit number " << bitNumber << " outside allowed range [0, "
448  << m_numberPhysTriggers << ") - algorithm not inserted!" << std::endl;
449  return false;
450  }
451 
452  // maximum number of algorithms
453  if (m_algorithmMap.size() >= m_numberPhysTriggers) {
454  LogTrace("TriggerMenuParser") << " More than maximum allowed " << m_numberPhysTriggers
455  << " algorithms in the algorithm map - not inserted!" << std::endl;
456  return false;
457  }
458 
459  // chip number outside allowed values
460  int chipNr = alg.algoChipNumber(
461  static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
462 
463  if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
464  LogTrace("TriggerMenuParser") << " Chip number " << chipNr << " outside allowed range [0, "
465  << m_numberConditionChips << ") - algorithm not inserted!" << std::endl;
466  return false;
467  }
468 
469  // output pin outside allowed values
470  int outputPin = alg.algoOutputPin(
471  static_cast<int>(m_numberConditionChips), static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
472 
473  if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
474  LogTrace("TriggerMenuParser") << " Output pin " << outputPin << " outside allowed range [0, "
475  << m_pinsOnConditionChip << "] - algorithm not inserted!" << std::endl;
476  return false;
477  }
478 
479  // no two algorithms on the same chip can have the same output pin
480  for (CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
481  int iPin = (itAlgo->second)
482  .algoOutputPin(static_cast<int>(m_numberConditionChips),
483  static_cast<int>(m_pinsOnConditionChip),
484  m_orderConditionChip);
485  std::string iName = itAlgo->first;
486  int iChip = (itAlgo->second)
487  .algoChipNumber(static_cast<int>(m_numberConditionChips),
488  static_cast<int>(m_pinsOnConditionChip),
489  m_orderConditionChip);
490 
491  if ((outputPin == iPin) && (chipNr == iChip)) {
492  LogTrace("TriggerMenuParser") << " Output pin " << outputPin << " is the same as for algorithm " << iName
493  << "\n from the same chip number " << chipNr << " - algorithm not inserted!"
494  << std::endl;
495  return false;
496  }
497  }
498 
499  // insert algorithm
500  m_algorithmMap[algName] = alg;
501  m_algorithmAliasMap[algAlias] = alg;
502 
503  //LogTrace("TriggerMenuParser")
504  //<< " OK - algorithm inserted!"
505  //<< std::endl;
506 
507  return true;
508 }
509 
510 template <typename T>
512  std::stringstream ss;
513  ss << data;
514  return ss.str();
515 }
517  std::stringstream ss;
518  ss << data;
519  int value;
520  ss >> value;
521  return value;
522 }
523 
531 bool l1t::TriggerMenuParser::parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap) {
532  using namespace tmeventsetup;
533 
534  // Setup ScaleParameter to hold information from parsing
540  GlobalScales::ScaleParameters ettEmScales;
542  GlobalScales::ScaleParameters etmHfScales;
545 
546  // Start by parsing the Scale Map
547  for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin(); cit != scaleMap.end(); cit++) {
548  const esScale& scale = cit->second;
549 
550  GlobalScales::ScaleParameters* scaleParam;
551  if (scale.getObjectType() == esObjectType::Muon)
552  scaleParam = &muScales;
553  else if (scale.getObjectType() == esObjectType::Egamma)
554  scaleParam = &egScales;
555  else if (scale.getObjectType() == esObjectType::Tau)
556  scaleParam = &tauScales;
557  else if (scale.getObjectType() == esObjectType::Jet)
558  scaleParam = &jetScales;
559  else if (scale.getObjectType() == esObjectType::ETT)
560  scaleParam = &ettScales;
561  else if (scale.getObjectType() == esObjectType::ETTEM)
562  scaleParam = &ettEmScales;
563  else if (scale.getObjectType() == esObjectType::ETM)
564  scaleParam = &etmScales;
565  else if (scale.getObjectType() == esObjectType::ETMHF)
566  scaleParam = &etmHfScales;
567  else if (scale.getObjectType() == esObjectType::HTT)
568  scaleParam = &httScales;
569  else if (scale.getObjectType() == esObjectType::HTM)
570  scaleParam = &htmScales;
571  else
572  scaleParam = nullptr;
573 
574  if (scaleParam != nullptr) {
575  switch (scale.getScaleType()) {
576  case esScaleType::EtScale: {
577  scaleParam->etMin = scale.getMinimum();
578  scaleParam->etMax = scale.getMaximum();
579  scaleParam->etStep = scale.getStep();
580 
581  //Get bin edges
582  const std::vector<esBin>& binsV = scale.getBins();
583  for (unsigned int i = 0; i < binsV.size(); i++) {
584  const esBin& bin = binsV.at(i);
585  std::pair<double, double> binLimits(bin.minimum, bin.maximum);
586  scaleParam->etBins.push_back(binLimits);
587  }
588 
589  // If this is an energy sum fill dummy values for eta and phi
590  // There are no scales for these in the XML so the other case statements will not be seen....do it here.
591  if (scale.getObjectType() == esObjectType::ETT || scale.getObjectType() == esObjectType::HTT ||
592  scale.getObjectType() == esObjectType::ETM || scale.getObjectType() == esObjectType::HTM ||
593  scale.getObjectType() == esObjectType::ETTEM || scale.getObjectType() == esObjectType::ETMHF) {
594  scaleParam->etaMin = -1.;
595  scaleParam->etaMax = -1.;
596  scaleParam->etaStep = -1.;
597  if (scale.getObjectType() == esObjectType::ETT || scale.getObjectType() == esObjectType::HTT ||
598  scale.getObjectType() == esObjectType::ETTEM) {
599  // if(scale.getObjectType() == esObjectType::ETT || scale.getObjectType() == esObjectType::HTT) {
600  scaleParam->phiMin = -1.;
601  scaleParam->phiMax = -1.;
602  scaleParam->phiStep = -1.;
603  }
604  }
605  } break;
606  case esScaleType::UnconstrainedPtScale: { // Added for displaced muons
607  scaleParam->uptMin = scale.getMinimum();
608  scaleParam->uptMax = scale.getMaximum();
609  scaleParam->uptStep = scale.getStep();
610 
611  //Get bin edges
612  const std::vector<esBin>& binsV = scale.getBins();
613  for (unsigned int i = 0; i < binsV.size(); i++) {
614  const esBin& bin = binsV.at(i);
615  std::pair<double, double> binLimits(bin.minimum, bin.maximum);
616  scaleParam->uptBins.push_back(binLimits);
617  }
618  } break;
619  case esScaleType::EtaScale: {
620  scaleParam->etaMin = scale.getMinimum();
621  scaleParam->etaMax = scale.getMaximum();
622  scaleParam->etaStep = scale.getStep();
623 
624  //Get bin edges
625  const std::vector<esBin>& binsV = scale.getBins();
626  scaleParam->etaBins.resize(pow(2, scale.getNbits()));
627  for (unsigned int i = 0; i < binsV.size(); i++) {
628  const esBin& bin = binsV.at(i);
629  std::pair<double, double> binLimits(bin.minimum, bin.maximum);
630  scaleParam->etaBins.at(bin.hw_index) = binLimits;
631  }
632  } break;
633  case esScaleType::PhiScale: {
634  scaleParam->phiMin = scale.getMinimum();
635  scaleParam->phiMax = scale.getMaximum();
636  scaleParam->phiStep = scale.getStep();
637 
638  //Get bin edges
639  const std::vector<esBin>& binsV = scale.getBins();
640  scaleParam->phiBins.resize(pow(2, scale.getNbits()));
641  for (unsigned int i = 0; i < binsV.size(); i++) {
642  const esBin& bin = binsV.at(i);
643  std::pair<double, double> binLimits(bin.minimum, bin.maximum);
644  scaleParam->phiBins.at(bin.hw_index) = binLimits;
645  }
646  } break;
647  default:
648 
649  break;
650  } //end switch
651  } //end valid scale
652  } //end loop over scaleMap
653 
654  // put the ScaleParameters into the class
655  m_gtScales.setMuonScales(muScales);
656  m_gtScales.setEGScales(egScales);
657  m_gtScales.setTauScales(tauScales);
658  m_gtScales.setJetScales(jetScales);
659  m_gtScales.setETTScales(ettScales);
660  m_gtScales.setETTEmScales(ettEmScales);
661  m_gtScales.setETMScales(etmScales);
662  m_gtScales.setETMHfScales(etmHfScales);
663  m_gtScales.setHTTScales(httScales);
664  m_gtScales.setHTMScales(htmScales);
665 
666  // Setup the LUT for the Scale Conversions
667  bool hasPrecision = false;
668  std::map<std::string, unsigned int> precisions;
669  getPrecisions(precisions, scaleMap);
670  for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
671  hasPrecision = true;
672  }
673 
674  if (hasPrecision) {
675  //Start with the Cal - Muon Eta LUTS
676  //----------------------------------
677  parseCalMuEta_LUTS(scaleMap, "EG", "MU");
678  parseCalMuEta_LUTS(scaleMap, "JET", "MU");
679  parseCalMuEta_LUTS(scaleMap, "TAU", "MU");
680 
681  //Now the Cal - Muon Phi LUTS
682  //-------------------------------------
683  parseCalMuPhi_LUTS(scaleMap, "EG", "MU");
684  parseCalMuPhi_LUTS(scaleMap, "JET", "MU");
685  parseCalMuPhi_LUTS(scaleMap, "TAU", "MU");
686  parseCalMuPhi_LUTS(scaleMap, "HTM", "MU");
687  parseCalMuPhi_LUTS(scaleMap, "ETM", "MU");
688  parseCalMuPhi_LUTS(scaleMap, "ETMHF", "MU");
689 
690  // Now the Pt LUTs (??? more combinations needed ??)
691  // ---------------
692  parsePt_LUTS(scaleMap, "Mass", "EG", precisions["PRECISION-EG-MU-MassPt"]);
693  parsePt_LUTS(scaleMap, "Mass", "MU", precisions["PRECISION-EG-MU-MassPt"]);
694  parseUpt_LUTS(scaleMap, "Mass", "MU", precisions["PRECISION-EG-MU-MassPt"]); // Added for displaced muons
695  parsePt_LUTS(scaleMap, "Mass", "JET", precisions["PRECISION-EG-JET-MassPt"]);
696  parsePt_LUTS(scaleMap, "Mass", "TAU", precisions["PRECISION-EG-TAU-MassPt"]);
697  parsePt_LUTS(scaleMap, "Mass", "ETM", precisions["PRECISION-EG-ETM-MassPt"]);
698  parsePt_LUTS(scaleMap, "Mass", "ETMHF", precisions["PRECISION-EG-ETMHF-MassPt"]);
699  parsePt_LUTS(scaleMap, "Mass", "HTM", precisions["PRECISION-EG-HTM-MassPt"]);
700 
701  // Now the Pt LUTs for TBPT calculation (??? CCLA following what was done for MASS pt LUTs for now ??)
702  // ---------------
703  parsePt_LUTS(scaleMap, "TwoBody", "EG", precisions["PRECISION-EG-MU-TwoBodyPt"]);
704  parsePt_LUTS(scaleMap, "TwoBody", "MU", precisions["PRECISION-EG-MU-TwoBodyPt"]);
705  parsePt_LUTS(scaleMap, "TwoBody", "JET", precisions["PRECISION-EG-JET-TwoBodyPt"]);
706  parsePt_LUTS(scaleMap, "TwoBody", "TAU", precisions["PRECISION-EG-TAU-TwoBodyPt"]);
707  parsePt_LUTS(scaleMap, "TwoBody", "ETM", precisions["PRECISION-EG-ETM-TwoBodyPt"]);
708  parsePt_LUTS(scaleMap, "TwoBody", "ETMHF", precisions["PRECISION-EG-ETMHF-TwoBodyPt"]);
709  parsePt_LUTS(scaleMap, "TwoBody", "HTM", precisions["PRECISION-EG-HTM-TwoBodyPt"]);
710 
711  // Now the Delta Eta/Cosh LUTs (must be done in groups)
712  // ----------------------------------------------------
713  parseDeltaEta_Cosh_LUTS(
714  scaleMap, "EG", "EG", precisions["PRECISION-EG-EG-Delta"], precisions["PRECISION-EG-EG-Math"]);
715  parseDeltaEta_Cosh_LUTS(
716  scaleMap, "EG", "JET", precisions["PRECISION-EG-JET-Delta"], precisions["PRECISION-EG-JET-Math"]);
717  parseDeltaEta_Cosh_LUTS(
718  scaleMap, "EG", "TAU", precisions["PRECISION-EG-TAU-Delta"], precisions["PRECISION-EG-TAU-Math"]);
719  parseDeltaEta_Cosh_LUTS(
720  scaleMap, "EG", "MU", precisions["PRECISION-EG-MU-Delta"], precisions["PRECISION-EG-MU-Math"]);
721 
722  parseDeltaEta_Cosh_LUTS(
723  scaleMap, "JET", "JET", precisions["PRECISION-JET-JET-Delta"], precisions["PRECISION-JET-JET-Math"]);
724  parseDeltaEta_Cosh_LUTS(
725  scaleMap, "JET", "TAU", precisions["PRECISION-JET-TAU-Delta"], precisions["PRECISION-JET-TAU-Math"]);
726  parseDeltaEta_Cosh_LUTS(
727  scaleMap, "JET", "MU", precisions["PRECISION-JET-MU-Delta"], precisions["PRECISION-JET-MU-Math"]);
728 
729  parseDeltaEta_Cosh_LUTS(
730  scaleMap, "TAU", "TAU", precisions["PRECISION-TAU-TAU-Delta"], precisions["PRECISION-TAU-TAU-Math"]);
731  parseDeltaEta_Cosh_LUTS(
732  scaleMap, "TAU", "MU", precisions["PRECISION-TAU-MU-Delta"], precisions["PRECISION-TAU-MU-Math"]);
733 
734  parseDeltaEta_Cosh_LUTS(
735  scaleMap, "MU", "MU", precisions["PRECISION-MU-MU-Delta"], precisions["PRECISION-MU-MU-Math"]);
736 
737  // Now the Delta Phi/Cos LUTs (must be done in groups)
738  // ----------------------------------------------------
739  parseDeltaPhi_Cos_LUTS(
740  scaleMap, "EG", "EG", precisions["PRECISION-EG-EG-Delta"], precisions["PRECISION-EG-EG-Math"]);
741  parseDeltaPhi_Cos_LUTS(
742  scaleMap, "EG", "JET", precisions["PRECISION-EG-JET-Delta"], precisions["PRECISION-EG-JET-Math"]);
743  parseDeltaPhi_Cos_LUTS(
744  scaleMap, "EG", "TAU", precisions["PRECISION-EG-TAU-Delta"], precisions["PRECISION-EG-TAU-Math"]);
745  parseDeltaPhi_Cos_LUTS(
746  scaleMap, "EG", "ETM", precisions["PRECISION-EG-ETM-Delta"], precisions["PRECISION-EG-ETM-Math"]);
747  parseDeltaPhi_Cos_LUTS(
748  scaleMap, "EG", "ETMHF", precisions["PRECISION-EG-ETMHF-Delta"], precisions["PRECISION-EG-ETMHF-Math"]);
749  parseDeltaPhi_Cos_LUTS(
750  scaleMap, "EG", "HTM", precisions["PRECISION-EG-HTM-Delta"], precisions["PRECISION-EG-HTM-Math"]);
751  parseDeltaPhi_Cos_LUTS(
752  scaleMap, "EG", "MU", precisions["PRECISION-EG-MU-Delta"], precisions["PRECISION-EG-MU-Math"]);
753 
754  parseDeltaPhi_Cos_LUTS(
755  scaleMap, "JET", "JET", precisions["PRECISION-JET-JET-Delta"], precisions["PRECISION-JET-JET-Math"]);
756  parseDeltaPhi_Cos_LUTS(
757  scaleMap, "JET", "TAU", precisions["PRECISION-JET-TAU-Delta"], precisions["PRECISION-JET-TAU-Math"]);
758  parseDeltaPhi_Cos_LUTS(
759  scaleMap, "JET", "ETM", precisions["PRECISION-JET-ETM-Delta"], precisions["PRECISION-JET-ETM-Math"]);
760  parseDeltaPhi_Cos_LUTS(
761  scaleMap, "JET", "ETMHF", precisions["PRECISION-JET-ETMHF-Delta"], precisions["PRECISION-JET-ETMHF-Math"]);
762  parseDeltaPhi_Cos_LUTS(
763  scaleMap, "JET", "HTM", precisions["PRECISION-JET-HTM-Delta"], precisions["PRECISION-JET-HTM-Math"]);
764  parseDeltaPhi_Cos_LUTS(
765  scaleMap, "JET", "MU", precisions["PRECISION-JET-MU-Delta"], precisions["PRECISION-JET-MU-Math"]);
766 
767  parseDeltaPhi_Cos_LUTS(
768  scaleMap, "TAU", "TAU", precisions["PRECISION-TAU-TAU-Delta"], precisions["PRECISION-TAU-TAU-Math"]);
769  parseDeltaPhi_Cos_LUTS(
770  scaleMap, "TAU", "ETM", precisions["PRECISION-TAU-ETM-Delta"], precisions["PRECISION-TAU-ETM-Math"]);
771  parseDeltaPhi_Cos_LUTS(
772  scaleMap, "TAU", "ETMHF", precisions["PRECISION-TAU-ETMHF-Delta"], precisions["PRECISION-TAU-ETMHF-Math"]);
773  parseDeltaPhi_Cos_LUTS(
774  scaleMap, "TAU", "HTM", precisions["PRECISION-TAU-HTM-Delta"], precisions["PRECISION-TAU-HTM-Math"]);
775  parseDeltaPhi_Cos_LUTS(
776  scaleMap, "TAU", "MU", precisions["PRECISION-TAU-MU-Delta"], precisions["PRECISION-TAU-MU-Math"]);
777 
778  parseDeltaPhi_Cos_LUTS(
779  scaleMap, "MU", "ETM", precisions["PRECISION-MU-ETM-Delta"], precisions["PRECISION-MU-ETM-Math"]);
780  parseDeltaPhi_Cos_LUTS(
781  scaleMap, "MU", "ETMHF", precisions["PRECISION-MU-ETMHF-Delta"], precisions["PRECISION-MU-ETMHF-Math"]);
782  parseDeltaPhi_Cos_LUTS(
783  scaleMap, "MU", "HTM", precisions["PRECISION-MU-HTM-Delta"], precisions["PRECISION-MU-HTM-Math"]);
784  parseDeltaPhi_Cos_LUTS(
785  scaleMap, "MU", "MU", precisions["PRECISION-MU-MU-Delta"], precisions["PRECISION-MU-MU-Math"]);
786 
787  parsePhi_Trig_LUTS(scaleMap, "EG", l1t::COS, precisions["PRECISION-EG-EG-Math"]);
788  parsePhi_Trig_LUTS(scaleMap, "JET", l1t::COS, precisions["PRECISION-JET-JET-Math"]);
789  parsePhi_Trig_LUTS(scaleMap, "TAU", l1t::COS, precisions["PRECISION-TAU-TAU-Math"]);
790  parsePhi_Trig_LUTS(scaleMap, "MU", l1t::COS, precisions["PRECISION-MU-MU-Math"]);
791 
792  parsePhi_Trig_LUTS(scaleMap, "EG", l1t::SIN, precisions["PRECISION-EG-EG-Math"]);
793  parsePhi_Trig_LUTS(scaleMap, "JET", l1t::SIN, precisions["PRECISION-JET-JET-Math"]);
794  parsePhi_Trig_LUTS(scaleMap, "TAU", l1t::SIN, precisions["PRECISION-TAU-TAU-Math"]);
795  parsePhi_Trig_LUTS(scaleMap, "MU", l1t::SIN, precisions["PRECISION-MU-MU-Math"]);
796 
797  //CCLA
798  //m_gtScales.dumpAllLUTs(std::cout);
799  //m_gtScales.print(std::cout);
800  }
801 
802  return true;
803 }
804 
805 void l1t::TriggerMenuParser::parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
806  std::string obj1,
807  std::string obj2) {
808  using namespace tmeventsetup;
809 
810  // First Delta Eta for this set
811  std::string scLabel1 = obj1;
812  scLabel1 += "-ETA";
813  std::string scLabel2 = obj2;
814  scLabel2 += "-ETA";
815 
816  //This LUT does not exist in L1 Menu file, don't fill it
817  if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
818  return;
819 
820  const esScale* scale1 = &scaleMap.find(scLabel1)->second;
821  const esScale* scale2 = &scaleMap.find(scLabel2)->second;
822 
823  std::vector<long long> lut_cal_2_mu_eta;
824  getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
825 
826  std::string lutName = obj1;
827  lutName += "-";
828  lutName += obj2;
829  m_gtScales.setLUT_CalMuEta(lutName, lut_cal_2_mu_eta);
830 }
831 
832 void l1t::TriggerMenuParser::parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
833  std::string obj1,
834  std::string obj2) {
835  using namespace tmeventsetup;
836 
837  // First Delta Eta for this set
838  std::string scLabel1 = obj1;
839  scLabel1 += "-PHI";
840  std::string scLabel2 = obj2;
841  scLabel2 += "-PHI";
842 
843  //This LUT does not exist in L1 Menu file, don't fill it
844  if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
845  return;
846 
847  const esScale* scale1 = &scaleMap.find(scLabel1)->second;
848  const esScale* scale2 = &scaleMap.find(scLabel2)->second;
849 
850  std::vector<long long> lut_cal_2_mu_phi;
851  getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
852 
853  std::string lutName = obj1;
854  lutName += "-";
855  lutName += obj2;
856  m_gtScales.setLUT_CalMuPhi(lutName, lut_cal_2_mu_phi);
857 }
858 
859 void l1t::TriggerMenuParser::parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
860  std::string lutpfx,
861  std::string obj1,
862  unsigned int prec) {
863  using namespace tmeventsetup;
864 
865  // First Delta Eta for this set
866  std::string scLabel1 = obj1;
867  scLabel1 += "-ET";
868 
869  //This LUT does not exist in L1 Menu file, don't fill it
870  if (scaleMap.find(scLabel1) == scaleMap.end())
871  return;
872 
873  const esScale* scale1 = &scaleMap.find(scLabel1)->second;
874 
875  std::vector<long long> lut_pt;
876  getLut(lut_pt, scale1, prec);
877 
878  m_gtScales.setLUT_Pt(lutpfx + "_" + scLabel1, lut_pt, prec);
879 }
880 
881 // Added for displaced muons
882 void l1t::TriggerMenuParser::parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
883  std::string lutpfx,
884  std::string obj1,
885  unsigned int prec) {
886  using namespace tmeventsetup;
887 
888  // First Delta Eta for this set
889  std::string scLabel1 = obj1;
890  scLabel1 += "-UPT";
891 
892  //This LUT does not exist in L1 Menu file, don't fill it
893  if (scaleMap.find(scLabel1) == scaleMap.end())
894  return;
895 
896  const esScale* scale1 = &scaleMap.find(scLabel1)->second;
897 
898  std::vector<long long> lut_pt;
899  getLut(lut_pt, scale1, prec);
900 
901  m_gtScales.setLUT_Upt(lutpfx + "_" + scLabel1, lut_pt, prec);
902 }
903 
904 void l1t::TriggerMenuParser::parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
905  std::string obj1,
906  std::string obj2,
907  unsigned int prec1,
908  unsigned int prec2) {
909  using namespace tmeventsetup;
910 
911  // First Delta Eta for this set
912  std::string scLabel1 = obj1;
913  scLabel1 += "-ETA";
914  std::string scLabel2 = obj2;
915  scLabel2 += "-ETA";
916 
917  //This LUT does not exist in L1 Menu file, don't fill it
918  if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
919  return;
920 
921  const esScale* scale1 = &scaleMap.find(scLabel1)->second;
922  const esScale* scale2 = &scaleMap.find(scLabel2)->second;
923  std::vector<double> val_delta_eta;
924  std::vector<long long> lut_delta_eta;
925  size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
926  setLut(lut_delta_eta, val_delta_eta, prec1);
927  std::string lutName = obj1;
928  lutName += "-";
929  lutName += obj2;
930  m_gtScales.setLUT_DeltaEta(lutName, lut_delta_eta, prec1);
931 
932  // Second Get the Cosh for this delta Eta Set
933  std::vector<long long> lut_cosh;
934  applyCosh(val_delta_eta, n);
935  setLut(lut_cosh, val_delta_eta, prec2);
936  m_gtScales.setLUT_Cosh(lutName, lut_cosh, prec2);
937 }
938 
939 void l1t::TriggerMenuParser::parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
940  const std::string& obj1,
941  const std::string& obj2,
942  unsigned int prec1,
943  unsigned int prec2) {
944  using namespace tmeventsetup;
945 
946  // First Delta phi for this set
947  std::string scLabel1 = obj1;
948  scLabel1 += "-PHI";
949  std::string scLabel2 = obj2;
950  scLabel2 += "-PHI";
951 
952  //This LUT does not exist in L1 Menu file, don't fill it
953  if (scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
954  return;
955 
956  const esScale* scale1 = &scaleMap.find(scLabel1)->second;
957  const esScale* scale2 = &scaleMap.find(scLabel2)->second;
958  std::vector<double> val_delta_phi;
959  std::vector<long long> lut_delta_phi;
960  size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
961  setLut(lut_delta_phi, val_delta_phi, prec1);
962  std::string lutName = obj1;
963  lutName += "-";
964  lutName += obj2;
965  m_gtScales.setLUT_DeltaPhi(lutName, lut_delta_phi, prec1);
966 
967  // Second Get the Cosh for this delta phi Set
968  std::vector<long long> lut_cos;
969  applyCos(val_delta_phi, n);
970  setLut(lut_cos, val_delta_phi, prec2);
971  m_gtScales.setLUT_Cos(lutName, lut_cos, prec2);
972 }
973 
974 void l1t::TriggerMenuParser::parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
975  const std::string& obj,
977  unsigned int prec) {
978  using namespace tmeventsetup;
979 
980  std::string scLabel = obj;
981  scLabel += "-PHI";
982 
983  //This LUT does not exist in L1 Menu file, don't fill it
984  if (scaleMap.find(scLabel) == scaleMap.end())
985  return;
986  if (func != l1t::SIN and func != l1t::COS)
987  return;
988 
989  const esScale* scale = &scaleMap.find(scLabel)->second;
990 
991  const double step = scale->getStep();
992  const double range = scale->getMaximum() - scale->getMinimum();
993  const size_t n = std::ceil(range / step);
994  const size_t bitwidth = std::ceil(std::log10(n) / std::log10(2));
995 
996  std::vector<double> array(std::pow(2, bitwidth), 0);
997 
998  for (size_t ii = 0; ii < n; ii++) {
999  array.at(ii) = step * ii;
1000  }
1001 
1002  const std::string& lutName = obj;
1003  std::vector<long long> lut;
1004  if (func == l1t::SIN) {
1005  applySin(array, n);
1006  setLut(lut, array, prec);
1007  m_gtScales.setLUT_Sin(lutName, lut, prec);
1008  } else if (func == l1t::COS) {
1009  applyCos(array, n);
1010  setLut(lut, array, prec);
1011  m_gtScales.setLUT_Cos(lutName, lut, prec);
1012  }
1013 }
1014 
1026 bool l1t::TriggerMenuParser::parseMuon(tmeventsetup::esCondition condMu, unsigned int chipNr, const bool corrFlag) {
1027  using namespace tmeventsetup;
1028 
1029  // get condition, particle name (must be muon) and type name
1030  std::string condition = "muon";
1031  std::string particle = "muon"; //l1t2string( condMu.objectType() );
1032  std::string type = l1t2string(condMu.getType());
1033  std::string name = l1t2string(condMu.getName());
1034  int nrObj = -1;
1035 
1037 
1038  if (condMu.getType() == esConditionType::SingleMuon) {
1039  type = "1_s";
1040  cType = l1t::Type1s;
1041  nrObj = 1;
1042  } else if (condMu.getType() == esConditionType::DoubleMuon) {
1043  type = "2_s";
1044  cType = l1t::Type2s;
1045  nrObj = 2;
1046  } else if (condMu.getType() == esConditionType::TripleMuon) {
1047  type = "3";
1048  cType = l1t::Type3s;
1049  nrObj = 3;
1050  } else if (condMu.getType() == esConditionType::QuadMuon) {
1051  type = "4";
1052  cType = l1t::Type4s;
1053  nrObj = 4;
1054  } else {
1055  edm::LogError("TriggerMenuParser") << "Wrong type for muon-condition (" << type << ")" << std::endl;
1056  return false;
1057  }
1058 
1059  if (nrObj < 0) {
1060  edm::LogError("TriggerMenuParser") << "Unknown type for muon-condition (" << type << ")"
1061  << "\nCan not determine number of trigger objects. " << std::endl;
1062  return false;
1063  }
1064 
1065  LogDebug("TriggerMenuParser") << "\n ****************************************** "
1066  << "\n parseMuon "
1067  << "\n condition = " << condition << "\n particle = " << particle
1068  << "\n type = " << type << "\n name = " << name << std::endl;
1069 
1070  // // get values
1071 
1072  // temporary storage of the parameters
1073  std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1074 
1075  // Do we need this?
1076  MuonTemplate::CorrelationParameter corrParameter;
1077 
1078  // need at least two values for deltaPhi
1079  std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1080  tmpValues.reserve(nrObj);
1081 
1082  if (int(condMu.getObjects().size()) != nrObj) {
1083  edm::LogError("TriggerMenuParser") << " condMu objects: nrObj = " << nrObj
1084  << "condMu.getObjects().size() = " << condMu.getObjects().size() << std::endl;
1085  return false;
1086  }
1087 
1088  // Look for cuts on the objects in the condition
1089  unsigned int chargeCorrelation = 1;
1090  const std::vector<esCut>& cuts = condMu.getCuts();
1091  for (size_t jj = 0; jj < cuts.size(); jj++) {
1092  const esCut cut = cuts.at(jj);
1093  if (cut.getCutType() == esCutType::ChargeCorrelation) {
1094  if (cut.getData() == "ls")
1095  chargeCorrelation = 2;
1096  else if (cut.getData() == "os")
1097  chargeCorrelation = 4;
1098  else
1099  chargeCorrelation = 1; //ignore correlation
1100  }
1101  }
1102 
1103  //set charge correlation parameter
1104  corrParameter.chargeCorrelation = chargeCorrelation; //tmpValues[0];
1105 
1106  int cnt = 0;
1107 
1108  // BLW TO DO: These needs to the added to the object rather than the whole condition.
1109  int relativeBx = 0;
1110  bool gEq = false;
1111 
1112  // Loop over objects and extract the cuts on the objects
1113  const std::vector<esObject>& objects = condMu.getObjects();
1114  for (size_t jj = 0; jj < objects.size(); jj++) {
1115  const esObject object = objects.at(jj);
1116  gEq = (object.getComparisonOperator() == esComparisonOperator::GE);
1117 
1118  // BLW TO DO: This needs to be added to the Object Parameters
1119  relativeBx = object.getBxOffset();
1120 
1121  // Loop over the cuts for this object
1122  int upperUnconstrainedPtInd = -1;
1123  int lowerUnconstrainedPtInd = 0;
1124  int upperImpactParameterInd = -1;
1125  int lowerImpactParameterInd = 0;
1126  int upperThresholdInd = -1;
1127  int lowerThresholdInd = 0;
1128  int upperIndexInd = -1;
1129  int lowerIndexInd = 0;
1130  int cntEta = 0;
1131  unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1132  int cntPhi = 0;
1133  unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1134  int isolationLUT = 0xF; //default is to ignore unless specified.
1135  int impactParameterLUT = 0xF; //default is to ignore unless specified
1136  int charge = -1; //default value is to ignore unless specified
1137  int qualityLUT = 0xFFFF; //default is to ignore unless specified.
1138 
1139  const std::vector<esCut>& cuts = object.getCuts();
1140  for (size_t kk = 0; kk < cuts.size(); kk++) {
1141  const esCut cut = cuts.at(kk);
1142 
1143  switch (cut.getCutType()) {
1144  case esCutType::UnconstrainedPt:
1145  lowerUnconstrainedPtInd = cut.getMinimum().index;
1146  upperUnconstrainedPtInd = cut.getMaximum().index;
1147  break;
1148 
1149  case esCutType::ImpactParameter:
1150  lowerImpactParameterInd = cut.getMinimum().index;
1151  upperImpactParameterInd = cut.getMaximum().index;
1152  impactParameterLUT = l1tstr2int(cut.getData());
1153  break;
1154 
1155  case esCutType::Threshold:
1156  lowerThresholdInd = cut.getMinimum().index;
1157  upperThresholdInd = cut.getMaximum().index;
1158  break;
1159 
1160  case esCutType::Slice:
1161  lowerIndexInd = int(cut.getMinimum().value);
1162  upperIndexInd = int(cut.getMaximum().value);
1163  break;
1164 
1165  case esCutType::Eta: {
1166  if (cntEta == 0) {
1167  etaWindow1Lower = cut.getMinimum().index;
1168  etaWindow1Upper = cut.getMaximum().index;
1169  } else if (cntEta == 1) {
1170  etaWindow2Lower = cut.getMinimum().index;
1171  etaWindow2Upper = cut.getMaximum().index;
1172  } else {
1173  edm::LogError("TriggerMenuParser")
1174  << "Too Many Eta Cuts for muon-condition (" << particle << ")" << std::endl;
1175  return false;
1176  }
1177  cntEta++;
1178 
1179  } break;
1180 
1181  case esCutType::Phi: {
1182  if (cntPhi == 0) {
1183  phiWindow1Lower = cut.getMinimum().index;
1184  phiWindow1Upper = cut.getMaximum().index;
1185  } else if (cntPhi == 1) {
1186  phiWindow2Lower = cut.getMinimum().index;
1187  phiWindow2Upper = cut.getMaximum().index;
1188  } else {
1189  edm::LogError("TriggerMenuParser")
1190  << "Too Many Phi Cuts for muon-condition (" << particle << ")" << std::endl;
1191  return false;
1192  }
1193  cntPhi++;
1194 
1195  } break;
1196 
1197  case esCutType::Charge:
1198  if (cut.getData() == "positive")
1199  charge = 0;
1200  else if (cut.getData() == "negative")
1201  charge = 1;
1202  else
1203  charge = -1;
1204  break;
1205  case esCutType::Quality:
1206 
1207  qualityLUT = l1tstr2int(cut.getData());
1208 
1209  break;
1210  case esCutType::Isolation: {
1211  isolationLUT = l1tstr2int(cut.getData());
1212 
1213  } break;
1214  default:
1215  break;
1216  } //end switch
1217 
1218  } //end loop over cuts
1219 
1220  // Set the parameter cuts
1221  objParameter[cnt].unconstrainedPtHigh = upperUnconstrainedPtInd;
1222  objParameter[cnt].unconstrainedPtLow = lowerUnconstrainedPtInd;
1223  objParameter[cnt].impactParameterHigh = upperImpactParameterInd;
1224  objParameter[cnt].impactParameterLow = lowerImpactParameterInd;
1225  objParameter[cnt].impactParameterLUT = impactParameterLUT;
1226 
1227  objParameter[cnt].ptHighThreshold = upperThresholdInd;
1228  objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1229 
1230  objParameter[cnt].indexHigh = upperIndexInd;
1231  objParameter[cnt].indexLow = lowerIndexInd;
1232 
1233  objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1234  objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1235  objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1236  objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1237 
1238  objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1239  objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1240  objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1241  objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1242 
1243  // BLW TO DO: Do we need these anymore? Drop them?
1244  objParameter[cnt].enableMip = false; //tmpMip[i];
1245  objParameter[cnt].enableIso = false; //tmpEnableIso[i];
1246  objParameter[cnt].requestIso = false; //tmpRequestIso[i];
1247 
1248  objParameter[cnt].charge = charge;
1249  objParameter[cnt].qualityLUT = qualityLUT;
1250  objParameter[cnt].isolationLUT = isolationLUT;
1251 
1252  cnt++;
1253  } //end loop over objects
1254 
1255  // object types - all muons
1256  std::vector<GlobalObject> objType(nrObj, gtMu);
1257 
1258  // now create a new CondMuonition
1259  MuonTemplate muonCond(name);
1260 
1261  muonCond.setCondType(cType);
1262  muonCond.setObjectType(objType);
1263  muonCond.setCondGEq(gEq);
1264  muonCond.setCondChipNr(chipNr);
1265  muonCond.setCondRelativeBx(relativeBx);
1266 
1267  muonCond.setConditionParameter(objParameter, corrParameter);
1268 
1269  if (edm::isDebugEnabled()) {
1270  std::ostringstream myCoutStream;
1271  muonCond.print(myCoutStream);
1272  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
1273  }
1274 
1275  // insert condition into the map and into muon template vector
1276  if (!insertConditionIntoMap(muonCond, chipNr)) {
1277  edm::LogError("TriggerMenuParser") << " Error: duplicate condition (" << name << ")" << std::endl;
1278  return false;
1279  } else {
1280  LogDebug("TriggerMenuParser") << "Added Condition " << name << " to the ConditionMap" << std::endl;
1281  if (corrFlag) {
1282  (m_corMuonTemplate[chipNr]).push_back(muonCond);
1283  } else {
1284  LogDebug("TriggerMenuParser") << "Added Condition " << name << " to the vecMuonTemplate vector" << std::endl;
1285  (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1286  }
1287  }
1288 
1289  //
1290  return true;
1291 }
1292 
1293 bool l1t::TriggerMenuParser::parseMuonCorr(const tmeventsetup::esObject* corrMu, unsigned int chipNr) {
1294  // XERCES_CPP_NAMESPACE_USE
1295  using namespace tmeventsetup;
1296 
1297  // get condition, particle name (must be muon) and type name
1298  std::string condition = "muon";
1299  std::string particle = "muon"; //l1t2string( condMu.objectType() );
1300  std::string type = l1t2string(corrMu->getType());
1301  std::string name = l1t2string(corrMu->getName());
1302  int nrObj = 1;
1303  type = "1_s";
1304  GtConditionType cType = l1t::Type1s;
1305 
1306  if (nrObj < 0) {
1307  edm::LogError("TriggerMenuParser") << "Unknown type for muon-condition (" << type << ")"
1308  << "\nCan not determine number of trigger objects. " << std::endl;
1309  return false;
1310  }
1311 
1312  LogDebug("TriggerMenuParser") << "\n ****************************************** "
1313  << "\n parseMuon "
1314  << "\n condition = " << condition << "\n particle = " << particle
1315  << "\n type = " << type << "\n name = " << name << std::endl;
1316 
1317  // // get values
1318 
1319  // temporary storage of the parameters
1320  std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1321 
1322  // Do we need this?
1323  MuonTemplate::CorrelationParameter corrParameter;
1324 
1325  // need at least two values for deltaPhi
1326  std::vector<uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1327  tmpValues.reserve(nrObj);
1328 
1329  // BLW TO DO: How do we deal with these in the new format
1330  // std::string str_chargeCorrelation = l1t2string( condMu.requestedChargeCorr() );
1331  std::string str_chargeCorrelation = "ig";
1332  unsigned int chargeCorrelation = 0;
1333  if (str_chargeCorrelation == "ig")
1334  chargeCorrelation = 1;
1335  else if (str_chargeCorrelation == "ls")
1336  chargeCorrelation = 2;
1337  else if (str_chargeCorrelation == "os")
1338  chargeCorrelation = 4;
1339 
1340  //getXMLHexTextValue("1", dst);
1341  corrParameter.chargeCorrelation = chargeCorrelation; //tmpValues[0];
1342 
1343  // BLW TO DO: These needs to the added to the object rather than the whole condition.
1344  int relativeBx = 0;
1345  bool gEq = false;
1346 
1347  //const esObject* object = condMu;
1348  gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1349 
1350  // BLW TO DO: This needs to be added to the Object Parameters
1351  relativeBx = corrMu->getBxOffset();
1352 
1353  // Loop over the cuts for this object
1354  int upperUnconstrainedPtInd = -1; // Added for displaced muons
1355  int lowerUnconstrainedPtInd = 0; // Added for displaced muons
1356  int upperImpactParameterInd = -1; // Added for displaced muons
1357  int lowerImpactParameterInd = 0; // Added for displaced muons
1358  int impactParameterLUT = 0xF; // Added for displaced muons, default is to ignore unless specified
1359  int upperThresholdInd = -1;
1360  int lowerThresholdInd = 0;
1361  int upperIndexInd = -1;
1362  int lowerIndexInd = 0;
1363  int cntEta = 0;
1364  unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1365  int cntPhi = 0;
1366  unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1367  int isolationLUT = 0xF; //default is to ignore unless specified.
1368  int charge = -1; //defaut is to ignore unless specified
1369  int qualityLUT = 0xFFFF; //default is to ignore unless specified.
1370 
1371  const std::vector<esCut>& cuts = corrMu->getCuts();
1372  for (size_t kk = 0; kk < cuts.size(); kk++) {
1373  const esCut cut = cuts.at(kk);
1374 
1375  switch (cut.getCutType()) {
1376  case esCutType::UnconstrainedPt: // Added for displaced muons
1377  lowerUnconstrainedPtInd = cut.getMinimum().index;
1378  upperUnconstrainedPtInd = cut.getMaximum().index;
1379  break;
1380 
1381  case esCutType::ImpactParameter: // Added for displaced muons
1382  lowerImpactParameterInd = cut.getMinimum().index;
1383  upperImpactParameterInd = cut.getMaximum().index;
1384  impactParameterLUT = l1tstr2int(cut.getData());
1385  break;
1386 
1387  case esCutType::Threshold:
1388  lowerThresholdInd = cut.getMinimum().index;
1389  upperThresholdInd = cut.getMaximum().index;
1390  break;
1391 
1392  case esCutType::Slice:
1393  lowerIndexInd = int(cut.getMinimum().value);
1394  upperIndexInd = int(cut.getMaximum().value);
1395  break;
1396 
1397  case esCutType::Eta: {
1398  if (cntEta == 0) {
1399  etaWindow1Lower = cut.getMinimum().index;
1400  etaWindow1Upper = cut.getMaximum().index;
1401  } else if (cntEta == 1) {
1402  etaWindow2Lower = cut.getMinimum().index;
1403  etaWindow2Upper = cut.getMaximum().index;
1404  } else {
1405  edm::LogError("TriggerMenuParser")
1406  << "Too Many Eta Cuts for muon-condition (" << particle << ")" << std::endl;
1407  return false;
1408  }
1409  cntEta++;
1410 
1411  } break;
1412 
1413  case esCutType::Phi: {
1414  if (cntPhi == 0) {
1415  phiWindow1Lower = cut.getMinimum().index;
1416  phiWindow1Upper = cut.getMaximum().index;
1417  } else if (cntPhi == 1) {
1418  phiWindow2Lower = cut.getMinimum().index;
1419  phiWindow2Upper = cut.getMaximum().index;
1420  } else {
1421  edm::LogError("TriggerMenuParser")
1422  << "Too Many Phi Cuts for muon-condition (" << particle << ")" << std::endl;
1423  return false;
1424  }
1425  cntPhi++;
1426 
1427  } break;
1428 
1429  case esCutType::Charge:
1430  if (cut.getData() == "positive")
1431  charge = 0;
1432  else if (cut.getData() == "negative")
1433  charge = 1;
1434  else
1435  charge = -1;
1436  break;
1437  case esCutType::Quality:
1438 
1439  qualityLUT = l1tstr2int(cut.getData());
1440 
1441  break;
1442  case esCutType::Isolation: {
1443  isolationLUT = l1tstr2int(cut.getData());
1444 
1445  } break;
1446  default:
1447  break;
1448  } //end switch
1449 
1450  } //end loop over cuts
1451 
1452  // Set the parameter cuts
1453  objParameter[0].unconstrainedPtHigh = upperUnconstrainedPtInd; // Added for displacd muons
1454  objParameter[0].unconstrainedPtLow = lowerUnconstrainedPtInd; // Added for displacd muons
1455  objParameter[0].impactParameterHigh = upperImpactParameterInd; // Added for displacd muons
1456  objParameter[0].impactParameterLow = lowerImpactParameterInd; // Added for displacd muons
1457  objParameter[0].impactParameterLUT = impactParameterLUT; // Added for displacd muons
1458 
1459  objParameter[0].ptHighThreshold = upperThresholdInd;
1460  objParameter[0].ptLowThreshold = lowerThresholdInd;
1461 
1462  objParameter[0].indexHigh = upperIndexInd;
1463  objParameter[0].indexLow = lowerIndexInd;
1464 
1465  objParameter[0].etaWindow1Lower = etaWindow1Lower;
1466  objParameter[0].etaWindow1Upper = etaWindow1Upper;
1467  objParameter[0].etaWindow2Lower = etaWindow2Lower;
1468  objParameter[0].etaWindow2Upper = etaWindow2Upper;
1469 
1470  objParameter[0].phiWindow1Lower = phiWindow1Lower;
1471  objParameter[0].phiWindow1Upper = phiWindow1Upper;
1472  objParameter[0].phiWindow2Lower = phiWindow2Lower;
1473  objParameter[0].phiWindow2Upper = phiWindow2Upper;
1474 
1475  // BLW TO DO: Do we need these anymore? Drop them?
1476  objParameter[0].enableMip = false; //tmpMip[i];
1477  objParameter[0].enableIso = false; //tmpEnableIso[i];
1478  objParameter[0].requestIso = false; //tmpRequestIso[i];
1479 
1480  objParameter[0].charge = charge;
1481  objParameter[0].qualityLUT = qualityLUT;
1482  objParameter[0].isolationLUT = isolationLUT;
1483 
1484  // object types - all muons
1485  std::vector<GlobalObject> objType(nrObj, gtMu);
1486 
1487  // now create a new CondMuonition
1488  MuonTemplate muonCond(name);
1489 
1490  muonCond.setCondType(cType);
1491  muonCond.setObjectType(objType);
1492  muonCond.setCondGEq(gEq);
1493  muonCond.setCondChipNr(chipNr);
1494  muonCond.setCondRelativeBx(relativeBx);
1495  muonCond.setConditionParameter(objParameter, corrParameter);
1496 
1497  if (edm::isDebugEnabled()) {
1498  std::ostringstream myCoutStream;
1499  muonCond.print(myCoutStream);
1500  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
1501  }
1502 
1503  /*
1504  // insert condition into the map and into muon template vector
1505  if ( !insertConditionIntoMap(muonCond, chipNr)) {
1506  edm::LogError("TriggerMenuParser")
1507  << " Error: duplicate condition (" << name << ")"
1508  << std::endl;
1509  return false;
1510  }
1511  else {
1512  LogDebug("TriggerMenuParser") << "Added Condition " << name << " to the ConditionMap" << std::endl;
1513  (m_corMuonTemplate[chipNr]).push_back(muonCond);
1514  }
1515 */
1516  (m_corMuonTemplate[chipNr]).push_back(muonCond);
1517 
1518  //
1519  return true;
1520 }
1521 
1533 bool l1t::TriggerMenuParser::parseCalo(tmeventsetup::esCondition condCalo, unsigned int chipNr, const bool corrFlag) {
1534  // XERCES_CPP_NAMESPACE_USE
1535  using namespace tmeventsetup;
1536 
1537  // get condition, particle name and type name
1538 
1539  std::string condition = "calo";
1540  std::string particle = "test-fix";
1541  std::string type = l1t2string(condCalo.getType());
1542  std::string name = l1t2string(condCalo.getName());
1543 
1544  LogDebug("TriggerMenuParser") << "\n ****************************************** "
1545  << "\n (in parseCalo) "
1546  << "\n condition = " << condition << "\n particle = " << particle
1547  << "\n type = " << type << "\n name = " << name << std::endl;
1548 
1550 
1551  // determine object type type
1552  // BLW TO DO: Can this object type wait and be done later in the parsing. Or done differently completely..
1553  GlobalObject caloObjType;
1554  int nrObj = -1;
1555 
1556  if (condCalo.getType() == esConditionType::SingleEgamma) {
1557  caloObjType = gtEG;
1558  type = "1_s";
1559  cType = l1t::Type1s;
1560  nrObj = 1;
1561  } else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1562  caloObjType = gtEG;
1563  type = "2_s";
1564  cType = l1t::Type2s;
1565  nrObj = 2;
1566  } else if (condCalo.getType() == esConditionType::TripleEgamma) {
1567  caloObjType = gtEG;
1568  cType = l1t::Type3s;
1569  type = "3";
1570  nrObj = 3;
1571  } else if (condCalo.getType() == esConditionType::QuadEgamma) {
1572  caloObjType = gtEG;
1573  cType = l1t::Type4s;
1574  type = "4";
1575  nrObj = 4;
1576  } else if (condCalo.getType() == esConditionType::SingleJet) {
1577  caloObjType = gtJet;
1578  cType = l1t::Type1s;
1579  type = "1_s";
1580  nrObj = 1;
1581  } else if (condCalo.getType() == esConditionType::DoubleJet) {
1582  caloObjType = gtJet;
1583  cType = l1t::Type2s;
1584  type = "2_s";
1585  nrObj = 2;
1586  } else if (condCalo.getType() == esConditionType::TripleJet) {
1587  caloObjType = gtJet;
1588  cType = l1t::Type3s;
1589  type = "3";
1590  nrObj = 3;
1591  } else if (condCalo.getType() == esConditionType::QuadJet) {
1592  caloObjType = gtJet;
1593  cType = l1t::Type4s;
1594  type = "4";
1595  nrObj = 4;
1596  } else if (condCalo.getType() == esConditionType::SingleTau) {
1597  caloObjType = gtTau;
1598  cType = l1t::Type1s;
1599  type = "1_s";
1600  nrObj = 1;
1601  } else if (condCalo.getType() == esConditionType::DoubleTau) {
1602  caloObjType = gtTau;
1603  cType = l1t::Type2s;
1604  type = "2_s";
1605  nrObj = 2;
1606  } else if (condCalo.getType() == esConditionType::TripleTau) {
1607  caloObjType = gtTau;
1608  cType = l1t::Type3s;
1609  type = "3";
1610  nrObj = 3;
1611  } else if (condCalo.getType() == esConditionType::QuadTau) {
1612  caloObjType = gtTau;
1613  cType = l1t::Type4s;
1614  type = "4";
1615  nrObj = 4;
1616  } else {
1617  edm::LogError("TriggerMenuParser") << "Wrong particle for calo-condition (" << particle << ")" << std::endl;
1618  return false;
1619  }
1620 
1621  // std::string str_etComparison = l1t2string( condCalo.comparison_operator() );
1622 
1623  if (nrObj < 0) {
1624  edm::LogError("TriggerMenuParser") << "Unknown type for calo-condition (" << type << ")"
1625  << "\nCan not determine number of trigger objects. " << std::endl;
1626  return false;
1627  }
1628 
1629  // get values
1630 
1631  // temporary storage of the parameters
1632  std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1633 
1634  //BLW TO DO: Can this be dropped?
1635  CaloTemplate::CorrelationParameter corrParameter;
1636 
1637  // need at least one value for deltaPhiRange
1638  std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1639  tmpValues.reserve(nrObj);
1640 
1641  if (int(condCalo.getObjects().size()) != nrObj) {
1642  edm::LogError("TriggerMenuParser") << " condCalo objects: nrObj = " << nrObj
1643  << "condCalo.getObjects().size() = " << condCalo.getObjects().size()
1644  << std::endl;
1645  return false;
1646  }
1647 
1648  // std::string str_condCalo = "";
1649  // uint64_t tempUIntH, tempUIntL;
1650  // uint64_t dst;
1651  int cnt = 0;
1652 
1653  // BLW TO DO: These needs to the added to the object rather than the whole condition.
1654  int relativeBx = 0;
1655  bool gEq = false;
1656 
1657  // Loop over objects and extract the cuts on the objects
1658  const std::vector<esObject>& objects = condCalo.getObjects();
1659  for (size_t jj = 0; jj < objects.size(); jj++) {
1660  const esObject object = objects.at(jj);
1661  gEq = (object.getComparisonOperator() == esComparisonOperator::GE);
1662 
1663  // BLW TO DO: This needs to be added to the Object Parameters
1664  relativeBx = object.getBxOffset();
1665 
1666  // Loop over the cuts for this object
1667  int upperThresholdInd = -1;
1668  int lowerThresholdInd = 0;
1669  int upperIndexInd = -1;
1670  int lowerIndexInd = 0;
1671  int cntEta = 0;
1672  unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1673  int cntPhi = 0;
1674  unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1675  int isolationLUT = 0xF; //default is to ignore isolation unless specified.
1676  int qualityLUT = 0xF; //default is to ignore quality unless specified.
1677 
1678  const std::vector<esCut>& cuts = object.getCuts();
1679  for (size_t kk = 0; kk < cuts.size(); kk++) {
1680  const esCut cut = cuts.at(kk);
1681 
1682  switch (cut.getCutType()) {
1683  case esCutType::Threshold:
1684  lowerThresholdInd = cut.getMinimum().index;
1685  upperThresholdInd = cut.getMaximum().index;
1686  break;
1687  case esCutType::Slice:
1688  lowerIndexInd = int(cut.getMinimum().value);
1689  upperIndexInd = int(cut.getMaximum().value);
1690  break;
1691  case esCutType::Eta: {
1692  if (cntEta == 0) {
1693  etaWindow1Lower = cut.getMinimum().index;
1694  etaWindow1Upper = cut.getMaximum().index;
1695  } else if (cntEta == 1) {
1696  etaWindow2Lower = cut.getMinimum().index;
1697  etaWindow2Upper = cut.getMaximum().index;
1698  } else {
1699  edm::LogError("TriggerMenuParser")
1700  << "Too Many Eta Cuts for calo-condition (" << particle << ")" << std::endl;
1701  return false;
1702  }
1703  cntEta++;
1704 
1705  } break;
1706 
1707  case esCutType::Phi: {
1708  if (cntPhi == 0) {
1709  phiWindow1Lower = cut.getMinimum().index;
1710  phiWindow1Upper = cut.getMaximum().index;
1711  } else if (cntPhi == 1) {
1712  phiWindow2Lower = cut.getMinimum().index;
1713  phiWindow2Upper = cut.getMaximum().index;
1714  } else {
1715  edm::LogError("TriggerMenuParser")
1716  << "Too Many Phi Cuts for calo-condition (" << particle << ")" << std::endl;
1717  return false;
1718  }
1719  cntPhi++;
1720 
1721  } break;
1722 
1723  case esCutType::Charge: {
1724  edm::LogError("TriggerMenuParser") << "No charge cut for calo-condition (" << particle << ")" << std::endl;
1725  return false;
1726 
1727  } break;
1728  case esCutType::Quality: {
1729  qualityLUT = l1tstr2int(cut.getData());
1730 
1731  } break;
1732  case esCutType::Isolation: {
1733  isolationLUT = l1tstr2int(cut.getData());
1734 
1735  } break;
1736  default:
1737  break;
1738  } //end switch
1739 
1740  } //end loop over cuts
1741 
1742  // Fill the object parameters
1743  objParameter[cnt].etHighThreshold = upperThresholdInd;
1744  objParameter[cnt].etLowThreshold = lowerThresholdInd;
1745  objParameter[cnt].indexHigh = upperIndexInd;
1746  objParameter[cnt].indexLow = lowerIndexInd;
1747  objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1748  objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1749  objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1750  objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1751  objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1752  objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1753  objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1754  objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1755  objParameter[cnt].isolationLUT = isolationLUT;
1756  objParameter[cnt].qualityLUT = qualityLUT; //TO DO: Must add
1757 
1758  // Output for debugging
1759  LogDebug("TriggerMenuParser") << "\n Calo ET high thresholds (hex) for calo object " << caloObjType << " "
1760  << cnt << " = " << std::hex << objParameter[cnt].etLowThreshold << " - "
1761  << objParameter[cnt].etHighThreshold
1762  << "\n etaWindow Lower / Upper for calo object " << cnt << " = 0x"
1763  << objParameter[cnt].etaWindow1Lower << " / 0x" << objParameter[cnt].etaWindow1Upper
1764  << "\n etaWindowVeto Lower / Upper for calo object " << cnt << " = 0x"
1765  << objParameter[cnt].etaWindow2Lower << " / 0x" << objParameter[cnt].etaWindow2Upper
1766  << "\n phiWindow Lower / Upper for calo object " << cnt << " = 0x"
1767  << objParameter[cnt].phiWindow1Lower << " / 0x" << objParameter[cnt].phiWindow1Upper
1768  << "\n phiWindowVeto Lower / Upper for calo object " << cnt << " = 0x"
1769  << objParameter[cnt].phiWindow2Lower << " / 0x" << objParameter[cnt].phiWindow2Upper
1770  << "\n Isolation LUT for calo object " << cnt << " = 0x"
1771  << objParameter[cnt].isolationLUT << "\n Quality LUT for calo object " << cnt
1772  << " = 0x" << objParameter[cnt].qualityLUT << std::dec << std::endl;
1773 
1774  cnt++;
1775  } //end loop over objects
1776 
1777  // object types - all same caloObjType
1778  std::vector<GlobalObject> objType(nrObj, caloObjType);
1779 
1780  // now create a new calo condition
1781  CaloTemplate caloCond(name);
1782 
1783  caloCond.setCondType(cType);
1784  caloCond.setObjectType(objType);
1785 
1786  //BLW TO DO: This needs to be added to the object rather than the whole condition
1787  caloCond.setCondGEq(gEq);
1788  caloCond.setCondChipNr(chipNr);
1789 
1790  //BLW TO DO: This needs to be added to the object rather than the whole condition
1791  caloCond.setCondRelativeBx(relativeBx);
1792 
1793  caloCond.setConditionParameter(objParameter, corrParameter);
1794 
1795  if (edm::isDebugEnabled()) {
1796  std::ostringstream myCoutStream;
1797  caloCond.print(myCoutStream);
1798  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
1799  }
1800 
1801  // insert condition into the map
1802  if (!insertConditionIntoMap(caloCond, chipNr)) {
1803  edm::LogError("TriggerMenuParser") << " Error: duplicate condition (" << name << ")" << std::endl;
1804 
1805  return false;
1806  } else {
1807  if (corrFlag) {
1808  (m_corCaloTemplate[chipNr]).push_back(caloCond);
1809  } else {
1810  (m_vecCaloTemplate[chipNr]).push_back(caloCond);
1811  }
1812  }
1813 
1814  //
1815  return true;
1816 }
1817 
1829 bool l1t::TriggerMenuParser::parseCaloCorr(const tmeventsetup::esObject* corrCalo, unsigned int chipNr) {
1830  // XERCES_CPP_NAMESPACE_USE
1831  using namespace tmeventsetup;
1832 
1833  // get condition, particle name and type name
1834 
1835  std::string condition = "calo";
1836  std::string particle = "test-fix";
1837  std::string type = l1t2string(corrCalo->getType());
1838  std::string name = l1t2string(corrCalo->getName());
1839 
1840  LogDebug("TriggerMenuParser") << "\n ****************************************** "
1841  << "\n (in parseCalo) "
1842  << "\n condition = " << condition << "\n particle = " << particle
1843  << "\n type = " << type << "\n name = " << name << std::endl;
1844 
1845  // determine object type type
1846  // BLW TO DO: Can this object type wait and be done later in the parsing. Or done differently completely..
1847  GlobalObject caloObjType;
1848  int nrObj = 1;
1849  type = "1_s";
1850  GtConditionType cType = l1t::Type1s;
1851 
1852  if (corrCalo->getType() == esObjectType::Egamma) {
1853  caloObjType = gtEG;
1854  } else if (corrCalo->getType() == esObjectType::Jet) {
1855  caloObjType = gtJet;
1856  } else if (corrCalo->getType() == esObjectType::Tau) {
1857  caloObjType = gtTau;
1858  } else {
1859  edm::LogError("TriggerMenuParser") << "Wrong particle for calo-condition (" << particle << ")" << std::endl;
1860  return false;
1861  }
1862 
1863  // std::string str_etComparison = l1t2string( condCalo.comparison_operator() );
1864 
1865  if (nrObj < 0) {
1866  edm::LogError("TriggerMenuParser") << "Unknown type for calo-condition (" << type << ")"
1867  << "\nCan not determine number of trigger objects. " << std::endl;
1868  return false;
1869  }
1870 
1871  // get values
1872 
1873  // temporary storage of the parameters
1874  std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1875 
1876  //BLW TO DO: Can this be dropped?
1877  CaloTemplate::CorrelationParameter corrParameter;
1878 
1879  // need at least one value for deltaPhiRange
1880  std::vector<uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1881  tmpValues.reserve(nrObj);
1882 
1883  // BLW TO DO: These needs to the added to the object rather than the whole condition.
1884  int relativeBx = 0;
1885  bool gEq = false;
1886 
1887  gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1888 
1889  // BLW TO DO: This needs to be added to the Object Parameters
1890  relativeBx = corrCalo->getBxOffset();
1891 
1892  // Loop over the cuts for this object
1893  int upperThresholdInd = -1;
1894  int lowerThresholdInd = 0;
1895  int upperIndexInd = -1;
1896  int lowerIndexInd = 0;
1897  int cntEta = 0;
1898  unsigned int etaWindow1Lower = -1, etaWindow1Upper = -1, etaWindow2Lower = -1, etaWindow2Upper = -1;
1899  int cntPhi = 0;
1900  unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
1901  int isolationLUT = 0xF; //default is to ignore isolation unless specified.
1902  int qualityLUT = 0xF; //default is to ignore quality unless specified.
1903 
1904  const std::vector<esCut>& cuts = corrCalo->getCuts();
1905  for (size_t kk = 0; kk < cuts.size(); kk++) {
1906  const esCut cut = cuts.at(kk);
1907 
1908  switch (cut.getCutType()) {
1909  case esCutType::Threshold:
1910  lowerThresholdInd = cut.getMinimum().index;
1911  upperThresholdInd = cut.getMaximum().index;
1912  break;
1913  case esCutType::Slice:
1914  lowerIndexInd = int(cut.getMinimum().value);
1915  upperIndexInd = int(cut.getMaximum().value);
1916  break;
1917  case esCutType::Eta: {
1918  if (cntEta == 0) {
1919  etaWindow1Lower = cut.getMinimum().index;
1920  etaWindow1Upper = cut.getMaximum().index;
1921  } else if (cntEta == 1) {
1922  etaWindow2Lower = cut.getMinimum().index;
1923  etaWindow2Upper = cut.getMaximum().index;
1924  } else {
1925  edm::LogError("TriggerMenuParser")
1926  << "Too Many Eta Cuts for calo-condition (" << particle << ")" << std::endl;
1927  return false;
1928  }
1929  cntEta++;
1930 
1931  } break;
1932 
1933  case esCutType::Phi: {
1934  if (cntPhi == 0) {
1935  phiWindow1Lower = cut.getMinimum().index;
1936  phiWindow1Upper = cut.getMaximum().index;
1937  } else if (cntPhi == 1) {
1938  phiWindow2Lower = cut.getMinimum().index;
1939  phiWindow2Upper = cut.getMaximum().index;
1940  } else {
1941  edm::LogError("TriggerMenuParser")
1942  << "Too Many Phi Cuts for calo-condition (" << particle << ")" << std::endl;
1943  return false;
1944  }
1945  cntPhi++;
1946 
1947  } break;
1948 
1949  case esCutType::Charge: {
1950  edm::LogError("TriggerMenuParser") << "No charge cut for calo-condition (" << particle << ")" << std::endl;
1951  return false;
1952 
1953  } break;
1954  case esCutType::Quality: {
1955  qualityLUT = l1tstr2int(cut.getData());
1956 
1957  } break;
1958  case esCutType::Isolation: {
1959  isolationLUT = l1tstr2int(cut.getData());
1960 
1961  } break;
1962  default:
1963  break;
1964  } //end switch
1965 
1966  } //end loop over cuts
1967 
1968  // Fill the object parameters
1969  objParameter[0].etLowThreshold = lowerThresholdInd;
1970  objParameter[0].etHighThreshold = upperThresholdInd;
1971  objParameter[0].indexHigh = upperIndexInd;
1972  objParameter[0].indexLow = lowerIndexInd;
1973  objParameter[0].etaWindow1Lower = etaWindow1Lower;
1974  objParameter[0].etaWindow1Upper = etaWindow1Upper;
1975  objParameter[0].etaWindow2Lower = etaWindow2Lower;
1976  objParameter[0].etaWindow2Upper = etaWindow2Upper;
1977  objParameter[0].phiWindow1Lower = phiWindow1Lower;
1978  objParameter[0].phiWindow1Upper = phiWindow1Upper;
1979  objParameter[0].phiWindow2Lower = phiWindow2Lower;
1980  objParameter[0].phiWindow2Upper = phiWindow2Upper;
1981  objParameter[0].isolationLUT = isolationLUT;
1982  objParameter[0].qualityLUT = qualityLUT; //TO DO: Must add
1983 
1984  // Output for debugging
1985  LogDebug("TriggerMenuParser") << "\n Calo ET high threshold (hex) for calo object " << caloObjType << " "
1986  << " = " << std::hex << objParameter[0].etLowThreshold << " - "
1987  << objParameter[0].etHighThreshold << "\n etaWindow Lower / Upper for calo object "
1988  << " = 0x" << objParameter[0].etaWindow1Lower << " / 0x"
1989  << objParameter[0].etaWindow1Upper
1990  << "\n etaWindowVeto Lower / Upper for calo object "
1991  << " = 0x" << objParameter[0].etaWindow2Lower << " / 0x"
1992  << objParameter[0].etaWindow2Upper << "\n phiWindow Lower / Upper for calo object "
1993  << " = 0x" << objParameter[0].phiWindow1Lower << " / 0x"
1994  << objParameter[0].phiWindow1Upper
1995  << "\n phiWindowVeto Lower / Upper for calo object "
1996  << " = 0x" << objParameter[0].phiWindow2Lower << " / 0x"
1997  << objParameter[0].phiWindow2Upper << "\n Isolation LUT for calo object "
1998  << " = 0x" << objParameter[0].isolationLUT << "\n Quality LUT for calo object "
1999  << " = 0x" << objParameter[0].qualityLUT << std::dec << std::endl;
2000 
2001  // object types - all same caloObjType
2002  std::vector<GlobalObject> objType(nrObj, caloObjType);
2003 
2004  // now create a new calo condition
2005  CaloTemplate caloCond(name);
2006 
2007  caloCond.setCondType(cType);
2008  caloCond.setObjectType(objType);
2009 
2010  //BLW TO DO: This needs to be added to the object rather than the whole condition
2011  caloCond.setCondGEq(gEq);
2012  caloCond.setCondChipNr(chipNr);
2013 
2014  //BLW TO DO: This needs to be added to the object rather than the whole condition
2015  caloCond.setCondRelativeBx(relativeBx);
2016 
2017  caloCond.setConditionParameter(objParameter, corrParameter);
2018 
2019  if (edm::isDebugEnabled()) {
2020  std::ostringstream myCoutStream;
2021  caloCond.print(myCoutStream);
2022  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
2023  }
2024 
2025  /*
2026  // insert condition into the map
2027  if ( !insertConditionIntoMap(caloCond, chipNr)) {
2028 
2029  edm::LogError("TriggerMenuParser")
2030  << " Error: duplicate condition (" << name << ")"
2031  << std::endl;
2032 
2033  return false;
2034  }
2035  else {
2036  (m_corCaloTemplate[chipNr]).push_back(caloCond);
2037  }
2038 */
2039  (m_corCaloTemplate[chipNr]).push_back(caloCond);
2040 
2041  //
2042  return true;
2043 }
2044 
2056 bool l1t::TriggerMenuParser::parseEnergySum(tmeventsetup::esCondition condEnergySum,
2057  unsigned int chipNr,
2058  const bool corrFlag) {
2059  // XERCES_CPP_NAMESPACE_USE
2060  using namespace tmeventsetup;
2061 
2062  // get condition, particle name and type name
2063 
2064  std::string condition = "calo";
2065  std::string type = l1t2string(condEnergySum.getType());
2066  std::string name = l1t2string(condEnergySum.getName());
2067 
2068  LogDebug("TriggerMenuParser") << "\n ****************************************** "
2069  << "\n (in parseEnergySum) "
2070  << "\n condition = " << condition << "\n type = " << type
2071  << "\n name = " << name << std::endl;
2072 
2073  // determine object type type
2074  GlobalObject energySumObjType;
2075  GtConditionType cType;
2076 
2077  if (condEnergySum.getType() == esConditionType::MissingEt) {
2078  energySumObjType = GlobalObject::gtETM;
2079  cType = TypeETM;
2080  } else if (condEnergySum.getType() == esConditionType::TotalEt) {
2081  energySumObjType = GlobalObject::gtETT;
2082  cType = TypeETT;
2083  } else if (condEnergySum.getType() == esConditionType::TotalEtEM) {
2084  energySumObjType = GlobalObject::gtETTem;
2085  cType = TypeETTem;
2086  } else if (condEnergySum.getType() == esConditionType::TotalHt) {
2087  energySumObjType = GlobalObject::gtHTT;
2088  cType = TypeHTT;
2089  } else if (condEnergySum.getType() == esConditionType::MissingHt) {
2090  energySumObjType = GlobalObject::gtHTM;
2091  cType = TypeHTM;
2092  } else if (condEnergySum.getType() == esConditionType::MissingEtHF) {
2093  energySumObjType = GlobalObject::gtETMHF;
2094  cType = TypeETMHF;
2095  } else if (condEnergySum.getType() == esConditionType::TowerCount) {
2096  energySumObjType = GlobalObject::gtTowerCount;
2097  cType = TypeTowerCount;
2098  } else if (condEnergySum.getType() == esConditionType::MinBiasHFP0) {
2099  energySumObjType = GlobalObject::gtMinBiasHFP0;
2100  cType = TypeMinBiasHFP0;
2101  } else if (condEnergySum.getType() == esConditionType::MinBiasHFM0) {
2102  energySumObjType = GlobalObject::gtMinBiasHFM0;
2103  cType = TypeMinBiasHFM0;
2104  } else if (condEnergySum.getType() == esConditionType::MinBiasHFP1) {
2105  energySumObjType = GlobalObject::gtMinBiasHFP1;
2106  cType = TypeMinBiasHFP1;
2107  } else if (condEnergySum.getType() == esConditionType::MinBiasHFM1) {
2108  energySumObjType = GlobalObject::gtMinBiasHFM1;
2109  cType = TypeMinBiasHFM1;
2110  } else if (condEnergySum.getType() == esConditionType::AsymmetryEt) {
2111  energySumObjType = GlobalObject::gtAsymmetryEt;
2112  cType = TypeAsymEt;
2113  } else if (condEnergySum.getType() == esConditionType::AsymmetryHt) {
2114  energySumObjType = GlobalObject::gtAsymmetryHt;
2115  cType = TypeAsymHt;
2116  } else if (condEnergySum.getType() == esConditionType::AsymmetryEtHF) {
2117  energySumObjType = GlobalObject::gtAsymmetryEtHF;
2118  cType = TypeAsymEtHF;
2119  } else if (condEnergySum.getType() == esConditionType::AsymmetryHtHF) {
2120  energySumObjType = GlobalObject::gtAsymmetryHtHF;
2121  cType = TypeAsymHtHF;
2122  } else if (condEnergySum.getType() == esConditionType::Centrality0) {
2123  energySumObjType = GlobalObject::gtCentrality0;
2124  cType = TypeCent0;
2125  } else if (condEnergySum.getType() == esConditionType::Centrality1) {
2126  energySumObjType = GlobalObject::gtCentrality1;
2127  cType = TypeCent1;
2128  } else if (condEnergySum.getType() == esConditionType::Centrality2) {
2129  energySumObjType = GlobalObject::gtCentrality2;
2130  cType = TypeCent2;
2131  } else if (condEnergySum.getType() == esConditionType::Centrality3) {
2132  energySumObjType = GlobalObject::gtCentrality3;
2133  cType = TypeCent3;
2134  } else if (condEnergySum.getType() == esConditionType::Centrality4) {
2135  energySumObjType = GlobalObject::gtCentrality4;
2136  cType = TypeCent4;
2137  } else if (condEnergySum.getType() == esConditionType::Centrality5) {
2138  energySumObjType = GlobalObject::gtCentrality5;
2139  cType = TypeCent5;
2140  } else if (condEnergySum.getType() == esConditionType::Centrality6) {
2141  energySumObjType = GlobalObject::gtCentrality6;
2142  cType = TypeCent6;
2143  } else if (condEnergySum.getType() == esConditionType::Centrality7) {
2144  energySumObjType = GlobalObject::gtCentrality7;
2145  cType = TypeCent7;
2146  } else {
2147  edm::LogError("TriggerMenuParser") << "Wrong type for energy-sum condition (" << type << ")" << std::endl;
2148  return false;
2149  }
2150 
2151  // global object
2152  int nrObj = 1;
2153 
2154  // std::string str_etComparison = l1t2string( condEnergySum.comparison_operator() );
2155 
2156  // get values
2157 
2158  // temporary storage of the parameters
2159  std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2160 
2161  int cnt = 0;
2162 
2163  // BLW TO DO: These needs to the added to the object rather than the whole condition.
2164  int relativeBx = 0;
2165  bool gEq = false;
2166 
2167  // l1t::EnergySumsObjectRequirement objPar = condEnergySum.objectRequirement();
2168 
2169  // Loop over objects and extract the cuts on the objects
2170  const std::vector<esObject>& objects = condEnergySum.getObjects();
2171  for (size_t jj = 0; jj < objects.size(); jj++) {
2172  const esObject object = objects.at(jj);
2173  gEq = (object.getComparisonOperator() == esComparisonOperator::GE);
2174 
2175  // BLW TO DO: This needs to be added to the Object Parameters
2176  relativeBx = object.getBxOffset();
2177 
2178  // Loop over the cuts for this object
2179  int lowerThresholdInd = 0;
2180  int upperThresholdInd = -1;
2181  int cntPhi = 0;
2182  unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2183 
2184  const std::vector<esCut>& cuts = object.getCuts();
2185  for (size_t kk = 0; kk < cuts.size(); kk++) {
2186  const esCut cut = cuts.at(kk);
2187 
2188  switch (cut.getCutType()) {
2189  case esCutType::Threshold:
2190  lowerThresholdInd = cut.getMinimum().index;
2191  upperThresholdInd = cut.getMaximum().index;
2192  break;
2193 
2194  case esCutType::Eta:
2195  break;
2196 
2197  case esCutType::Phi: {
2198  if (cntPhi == 0) {
2199  phiWindow1Lower = cut.getMinimum().index;
2200  phiWindow1Upper = cut.getMaximum().index;
2201  } else if (cntPhi == 1) {
2202  phiWindow2Lower = cut.getMinimum().index;
2203  phiWindow2Upper = cut.getMaximum().index;
2204  } else {
2205  edm::LogError("TriggerMenuParser") << "Too Many Phi Cuts for esum-condition (" << type << ")" << std::endl;
2206  return false;
2207  }
2208  cntPhi++;
2209 
2210  } break;
2211 
2212  case esCutType::Count:
2213  lowerThresholdInd = cut.getMinimum().index;
2214  upperThresholdInd = 0xffffff;
2215  break;
2216 
2217  default:
2218  break;
2219  } //end switch
2220 
2221  } //end loop over cuts
2222 
2223  // Fill the object parameters
2224  objParameter[cnt].etLowThreshold = lowerThresholdInd;
2225  objParameter[cnt].etHighThreshold = upperThresholdInd;
2226  objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2227  objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2228  objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2229  objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2230 
2231  // Output for debugging
2232  LogDebug("TriggerMenuParser") << "\n EnergySum ET high threshold (hex) for energy sum object " << cnt << " = "
2233  << std::hex << objParameter[cnt].etLowThreshold << " - "
2234  << objParameter[cnt].etHighThreshold
2235  << "\n phiWindow Lower / Upper for calo object " << cnt << " = 0x"
2236  << objParameter[cnt].phiWindow1Lower << " / 0x" << objParameter[cnt].phiWindow1Upper
2237  << "\n phiWindowVeto Lower / Upper for calo object " << cnt << " = 0x"
2238  << objParameter[cnt].phiWindow2Lower << " / 0x" << objParameter[cnt].phiWindow2Upper
2239  << std::dec << std::endl;
2240 
2241  cnt++;
2242  } //end loop over objects
2243 
2244  // object types - all same energySumObjType
2245  std::vector<GlobalObject> objType(nrObj, energySumObjType);
2246 
2247  // now create a new energySum condition
2248 
2249  EnergySumTemplate energySumCond(name);
2250 
2251  energySumCond.setCondType(cType);
2252  energySumCond.setObjectType(objType);
2253  energySumCond.setCondGEq(gEq);
2254  energySumCond.setCondChipNr(chipNr);
2255  energySumCond.setCondRelativeBx(relativeBx);
2256 
2257  energySumCond.setConditionParameter(objParameter);
2258 
2259  if (edm::isDebugEnabled()) {
2260  std::ostringstream myCoutStream;
2261  energySumCond.print(myCoutStream);
2262  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
2263  }
2264 
2265  // insert condition into the map
2266  if (!insertConditionIntoMap(energySumCond, chipNr)) {
2267  edm::LogError("TriggerMenuParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2268 
2269  return false;
2270  } else {
2271  if (corrFlag) {
2272  (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2273 
2274  } else {
2275  (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2276  }
2277  }
2278 
2279  //
2280  return true;
2281 }
2282 
2294 bool l1t::TriggerMenuParser::parseEnergySumCorr(const tmeventsetup::esObject* corrESum, unsigned int chipNr) {
2295  // XERCES_CPP_NAMESPACE_USE
2296  using namespace tmeventsetup;
2297 
2298  // get condition, particle name and type name
2299 
2300  std::string condition = "calo";
2301  std::string type = l1t2string(corrESum->getType());
2302  std::string name = l1t2string(corrESum->getName());
2303 
2304  LogDebug("TriggerMenuParser") << "\n ****************************************** "
2305  << "\n (in parseEnergySum) "
2306  << "\n condition = " << condition << "\n type = " << type
2307  << "\n name = " << name << std::endl;
2308 
2309  // determine object type type
2310  GlobalObject energySumObjType;
2311  GtConditionType cType;
2312 
2313  if (corrESum->getType() == esObjectType::ETM) {
2314  energySumObjType = GlobalObject::gtETM;
2315  cType = TypeETM;
2316  } else if (corrESum->getType() == esObjectType::HTM) {
2317  energySumObjType = GlobalObject::gtHTM;
2318  cType = TypeHTM;
2319  } else if (corrESum->getType() == esObjectType::ETMHF) {
2320  energySumObjType = GlobalObject::gtETMHF;
2321  cType = TypeETMHF;
2322  } else if (corrESum->getType() == esObjectType::TOWERCOUNT) {
2323  energySumObjType = GlobalObject::gtTowerCount;
2324  cType = TypeTowerCount;
2325  } else {
2326  edm::LogError("TriggerMenuParser") << "Wrong type for energy-sum correclation condition (" << type << ")"
2327  << std::endl;
2328  return false;
2329  }
2330 
2331  // global object
2332  int nrObj = 1;
2333 
2334  // std::string str_etComparison = l1t2string( condEnergySum.comparison_operator() );
2335 
2336  // get values
2337 
2338  // temporary storage of the parameters
2339  std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2340 
2341  int cnt = 0;
2342 
2343  // BLW TO DO: These needs to the added to the object rather than the whole condition.
2344  int relativeBx = 0;
2345  bool gEq = false;
2346 
2347  // l1t::EnergySumsObjectRequirement objPar = condEnergySum.objectRequirement();
2348 
2349  gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2350 
2351  // BLW TO DO: This needs to be added to the Object Parameters
2352  relativeBx = corrESum->getBxOffset();
2353 
2354  // Loop over the cuts for this object
2355  int lowerThresholdInd = 0;
2356  int upperThresholdInd = -1;
2357  int cntPhi = 0;
2358  unsigned int phiWindow1Lower = -1, phiWindow1Upper = -1, phiWindow2Lower = -1, phiWindow2Upper = -1;
2359 
2360  const std::vector<esCut>& cuts = corrESum->getCuts();
2361  for (size_t kk = 0; kk < cuts.size(); kk++) {
2362  const esCut cut = cuts.at(kk);
2363 
2364  switch (cut.getCutType()) {
2365  case esCutType::Threshold:
2366  lowerThresholdInd = cut.getMinimum().index;
2367  upperThresholdInd = cut.getMaximum().index;
2368  break;
2369 
2370  case esCutType::Eta:
2371  break;
2372 
2373  case esCutType::Phi: {
2374  if (cntPhi == 0) {
2375  phiWindow1Lower = cut.getMinimum().index;
2376  phiWindow1Upper = cut.getMaximum().index;
2377  } else if (cntPhi == 1) {
2378  phiWindow2Lower = cut.getMinimum().index;
2379  phiWindow2Upper = cut.getMaximum().index;
2380  } else {
2381  edm::LogError("TriggerMenuParser") << "Too Many Phi Cuts for esum-condition (" << type << ")" << std::endl;
2382  return false;
2383  }
2384  cntPhi++;
2385 
2386  } break;
2387 
2388  default:
2389  break;
2390  } //end switch
2391 
2392  } //end loop over cuts
2393 
2394  // Fill the object parameters
2395  objParameter[0].etLowThreshold = lowerThresholdInd;
2396  objParameter[0].etHighThreshold = upperThresholdInd;
2397  objParameter[0].phiWindow1Lower = phiWindow1Lower;
2398  objParameter[0].phiWindow1Upper = phiWindow1Upper;
2399  objParameter[0].phiWindow2Lower = phiWindow2Lower;
2400  objParameter[0].phiWindow2Upper = phiWindow2Upper;
2401 
2402  // Output for debugging
2403  LogDebug("TriggerMenuParser") << "\n EnergySum ET high threshold (hex) for energy sum object " << cnt << " = "
2404  << std::hex << objParameter[0].etLowThreshold << " - " << objParameter[0].etLowThreshold
2405  << "\n phiWindow Lower / Upper for calo object " << cnt << " = 0x"
2406  << objParameter[0].phiWindow1Lower << " / 0x" << objParameter[0].phiWindow1Upper
2407  << "\n phiWindowVeto Lower / Upper for calo object " << cnt << " = 0x"
2408  << objParameter[0].phiWindow2Lower << " / 0x" << objParameter[0].phiWindow2Upper
2409  << std::dec << std::endl;
2410 
2411  // object types - all same energySumObjType
2412  std::vector<GlobalObject> objType(nrObj, energySumObjType);
2413 
2414  // now create a new energySum condition
2415 
2416  EnergySumTemplate energySumCond(name);
2417 
2418  energySumCond.setCondType(cType);
2419  energySumCond.setObjectType(objType);
2420  energySumCond.setCondGEq(gEq);
2421  energySumCond.setCondChipNr(chipNr);
2422  energySumCond.setCondRelativeBx(relativeBx);
2423 
2424  energySumCond.setConditionParameter(objParameter);
2425 
2426  if (edm::isDebugEnabled()) {
2427  std::ostringstream myCoutStream;
2428  energySumCond.print(myCoutStream);
2429  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
2430  }
2431  /*
2432  // insert condition into the map
2433  if ( !insertConditionIntoMap(energySumCond, chipNr)) {
2434 
2435  edm::LogError("TriggerMenuParser")
2436  << " Error: duplicate condition (" << name << ")"
2437  << std::endl;
2438 
2439  return false;
2440  }
2441  else {
2442 
2443  (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2444 
2445  }
2446 */
2447  (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2448 
2449  //
2450  return true;
2451 }
2452 
2465 bool l1t::TriggerMenuParser::parseExternal(tmeventsetup::esCondition condExt, unsigned int chipNr) {
2466  using namespace tmeventsetup;
2467 
2468  // get condition, particle name and type name
2469  std::string condition = "ext";
2470  std::string particle = "test-fix";
2471  std::string type = l1t2string(condExt.getType());
2472  std::string name = l1t2string(condExt.getName());
2473 
2474  LogDebug("TriggerMenuParser") << "\n ****************************************** "
2475  << "\n (in parseExternal) "
2476  << "\n condition = " << condition << "\n particle = " << particle
2477  << "\n type = " << type << "\n name = " << name << std::endl;
2478 
2479  // object type and condition type
2480  // object type - irrelevant for External conditions
2481  GtConditionType cType = TypeExternal;
2482  GlobalObject extSignalType = GlobalObject::gtExternal;
2483  int nrObj = 1; //only one object for these conditions
2484 
2485  int relativeBx = 0;
2486  unsigned int channelID = 0;
2487 
2488  // Get object for External conditions
2489  const std::vector<esObject>& objects = condExt.getObjects();
2490  for (size_t jj = 0; jj < objects.size(); jj++) {
2491  const esObject object = objects.at(jj);
2492  if (object.getType() == esObjectType::EXT) {
2493  relativeBx = object.getBxOffset();
2494  channelID = object.getExternalChannelId();
2495  }
2496  }
2497 
2498  // set the boolean value for the ge_eq mode - irrelevant for External conditions
2499  bool gEq = false;
2500 
2501  //object types - all same for external conditions
2502  std::vector<GlobalObject> objType(nrObj, extSignalType);
2503 
2504  // now create a new External condition
2505  ExternalTemplate externalCond(name);
2506 
2507  externalCond.setCondType(cType);
2508  externalCond.setObjectType(objType);
2509  externalCond.setCondGEq(gEq);
2510  externalCond.setCondChipNr(chipNr);
2511  externalCond.setCondRelativeBx(relativeBx);
2512  externalCond.setExternalChannel(channelID);
2513 
2514  LogTrace("TriggerMenuParser") << externalCond << "\n" << std::endl;
2515 
2516  // insert condition into the map
2517  if (!insertConditionIntoMap(externalCond, chipNr)) {
2518  edm::LogError("TriggerMenuParser") << " Error: duplicate condition (" << name << ")" << std::endl;
2519 
2520  return false;
2521  } else {
2522  (m_vecExternalTemplate[chipNr]).push_back(externalCond);
2523  }
2524 
2525  return true;
2526 }
2527 
2540 bool l1t::TriggerMenuParser::parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr) {
2541  using namespace tmeventsetup;
2542 
2543  std::string condition = "corr";
2544  std::string particle = "test-fix";
2545  std::string type = l1t2string(corrCond.getType());
2546  std::string name = l1t2string(corrCond.getName());
2547 
2548  LogDebug("TriggerMenuParser") << " ****************************************** " << std::endl
2549  << " (in parseCorrelation) " << std::endl
2550  << " condition = " << condition << std::endl
2551  << " particle = " << particle << std::endl
2552  << " type = " << type << std::endl
2553  << " name = " << name << std::endl;
2554 
2555  // create a new correlation condition
2556  CorrelationTemplate correlationCond(name);
2557 
2558  // check that the condition does not exist already in the map
2559  if (!insertConditionIntoMap(correlationCond, chipNr)) {
2560  edm::LogError("TriggerMenuParser") << " Error: duplicate correlation condition (" << name << ")" << std::endl;
2561 
2562  return false;
2563  }
2564 
2565  // Define some of the quantities to store the parased information
2566 
2567  // condition type BLW (Do we change this to the type of correlation condition?)
2569 
2570  // two objects (for sure)
2571  const int nrObj = 2;
2572 
2573  // object types and greater equal flag - filled in the loop
2574  int intGEq[nrObj] = {-1, -1};
2575  std::vector<GlobalObject> objType(nrObj); //BLW do we want to define these as a different type?
2576  std::vector<GtConditionCategory> condCateg(nrObj); //BLW do we want to change these categories
2577 
2578  // correlation flag and index in the cor*vector
2579  const bool corrFlag = true;
2580  int corrIndexVal[nrObj] = {-1, -1};
2581 
2582  // Storage of the correlation selection
2584  corrParameter.chargeCorrelation = 1; //ignore charge correlation
2585 
2586  // Get the correlation Cuts on the legs
2587  int cutType = 0;
2588  const std::vector<esCut>& cuts = corrCond.getCuts();
2589  for (size_t jj = 0; jj < cuts.size(); jj++) {
2590  const esCut cut = cuts.at(jj);
2591 
2592  if (cut.getCutType() == esCutType::ChargeCorrelation) {
2593  if (cut.getData() == "ls")
2594  corrParameter.chargeCorrelation = 2;
2595  else if (cut.getData() == "os")
2596  corrParameter.chargeCorrelation = 4;
2597  else
2598  corrParameter.chargeCorrelation = 1; //ignore charge correlation
2599  } else {
2600  //
2601  // Until utm has method to calculate these, do the integer value calculation with precision.
2602  //
2603  double minV = cut.getMinimum().value;
2604  double maxV = cut.getMaximum().value;
2605 
2606  //Scale down very large numbers out of xml
2607  if (maxV > 1.0e8)
2608  maxV = 1.0e8;
2609 
2610  if (cut.getCutType() == esCutType::DeltaEta) {
2611  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tDeltaEta Cut minV = " << minV
2612  << " Max = " << maxV << " precMin = " << cut.getMinimum().index
2613  << " precMax = " << cut.getMaximum().index << std::endl;
2614  corrParameter.minEtaCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2615  corrParameter.maxEtaCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2616  corrParameter.precEtaCut = cut.getMinimum().index;
2617  cutType = cutType | 0x1;
2618  } else if (cut.getCutType() == esCutType::DeltaPhi) {
2619  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tDeltaPhi Cut minV = " << minV
2620  << " Max = " << maxV << " precMin = " << cut.getMinimum().index
2621  << " precMax = " << cut.getMaximum().index << std::endl;
2622  corrParameter.minPhiCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2623  corrParameter.maxPhiCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2624  corrParameter.precPhiCut = cut.getMinimum().index;
2625  cutType = cutType | 0x2;
2626  } else if (cut.getCutType() == esCutType::DeltaR) {
2627  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tDeltaR Cut minV = " << minV
2628  << " Max = " << maxV << " precMin = " << cut.getMinimum().index
2629  << " precMax = " << cut.getMaximum().index << std::endl;
2630  corrParameter.minDRCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2631  corrParameter.maxDRCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2632  corrParameter.precDRCut = cut.getMinimum().index;
2633  cutType = cutType | 0x4;
2634  } else if (cut.getCutType() == esCutType::TwoBodyPt) {
2635  corrParameter.minTBPTCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2636  corrParameter.maxTBPTCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2637  corrParameter.precTBPTCut = cut.getMinimum().index;
2638  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tTPBT Cut minV = " << minV
2639  << " Max = " << maxV << " precMin = " << cut.getMinimum().index
2640  << " precMax = " << cut.getMaximum().index << std::endl;
2641  cutType = cutType | 0x20;
2642  } else if (cut.getCutType() == esCutType::Mass) {
2643  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tMass Cut minV = " << minV
2644  << " Max = " << maxV << " precMin = " << cut.getMinimum().index
2645  << " precMax = " << cut.getMaximum().index << std::endl;
2646  corrParameter.minMassCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2647  corrParameter.maxMassCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2648  corrParameter.precMassCut = cut.getMinimum().index;
2649  // cutType = cutType | 0x8;
2650  if (corrCond.getType() == esConditionType::TransverseMass) {
2651  cutType = cutType | 0x10;
2652  } else {
2653  cutType = cutType | 0x8;
2654  }
2655  } else if (cut.getCutType() == esCutType::MassUpt) { // Added for displaced muons
2656  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tMass Cut minV = " << minV
2657  << " Max = " << maxV << " precMin = " << cut.getMinimum().index
2658  << " precMax = " << cut.getMaximum().index << std::endl;
2659  corrParameter.minMassCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2660  corrParameter.maxMassCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2661  corrParameter.precMassCut = cut.getMinimum().index;
2662  cutType = cutType | 0x40; // Note: 0x40 (MassUpt) is next available bit after 0x20 (TwoBodyPt)
2663  } // Careful: cutType carries same info as esCutType, but is hard coded!!
2664  } // This seems like a historical hack, which may be error prone.
2665  } // cutType is defined here, for use later in CorrCondition.cc
2666  corrParameter.corrCutType = cutType;
2667 
2668  // Get the two objects that form the legs
2669  const std::vector<esObject>& objects = corrCond.getObjects();
2670  if (objects.size() != 2) {
2671  edm::LogError("TriggerMenuParser") << "incorrect number of objects for the correlation condition " << name
2672  << " corrFlag " << corrFlag << std::endl;
2673  return false;
2674  }
2675 
2676  // loop over legs
2677  for (size_t jj = 0; jj < objects.size(); jj++) {
2678  const esObject object = objects.at(jj);
2679  LogDebug("TriggerMenuParser") << " obj name = " << object.getName() << "\n";
2680  LogDebug("TriggerMenuParser") << " obj type = " << object.getType() << "\n";
2681  LogDebug("TriggerMenuParser") << " obj op = " << object.getComparisonOperator() << "\n";
2682  LogDebug("TriggerMenuParser") << " obj bx = " << object.getBxOffset() << "\n";
2683 
2684  // check the leg type
2685  if (object.getType() == esObjectType::Muon) {
2686  // we have a muon
2687 
2688  /*
2689  //BLW Hold on to this code we may need to go back to it at some point.
2690  // Now we are putting ALL leg conditions into the vector (so there are duplicates)
2691  // This is potentially a place to slim down the code. Note: We currently evaluate the
2692  // conditions every time, so even if we put the condition in the vector once, we would
2693  // still evaluate it multiple times. This is a place for optimization.
2694  {
2695 
2696  parseMuonCorr(&object,chipNr);
2697  corrIndexVal[jj] = (m_corMuonTemplate[chipNr]).size() - 1;
2698 
2699  } else {
2700  LogDebug("TriggerMenuParser") << "Not Adding Correlation Muon Condition to Map...looking for the condition in Muon Cor Vector" << std::endl;
2701  bool found = false;
2702  int index = 0;
2703  while(!found && index<(int)((m_corMuonTemplate[chipNr]).size()) ) {
2704  if( (m_corMuonTemplate[chipNr]).at(index).condName() == object.getName() ) {
2705  LogDebug("TriggerMenuParser") << "Found condition " << object.getName() << " in vector at index " << index << std::endl;
2706  found = true;
2707  } else {
2708  index++;
2709  }
2710  }
2711  if(found) {
2712  corrIndexVal[jj] = index;
2713  } else {
2714  edm::LogError("TriggerMenuParser") << "FAILURE: Condition " << object.getName() << " is in map but not in cor. vector " << std::endl;
2715  }
2716 
2717  }
2718 */
2719  parseMuonCorr(&object, chipNr);
2720  corrIndexVal[jj] = (m_corMuonTemplate[chipNr]).size() - 1;
2721 
2722  //Now set some flags for this subCondition
2723  intGEq[jj] = (object.getComparisonOperator() == esComparisonOperator::GE);
2724  objType[jj] = gtMu;
2725  condCateg[jj] = CondMuon;
2726 
2727  } else if (object.getType() == esObjectType::Egamma || object.getType() == esObjectType::Jet ||
2728  object.getType() == esObjectType::Tau) {
2729  // we have an Calo object
2730  parseCaloCorr(&object, chipNr);
2731  corrIndexVal[jj] = (m_corCaloTemplate[chipNr]).size() - 1;
2732 
2733  //Now set some flags for this subCondition
2734  intGEq[jj] = (object.getComparisonOperator() == esComparisonOperator::GE);
2735  switch (object.getType()) {
2736  case esObjectType::Egamma: {
2737  objType[jj] = gtEG;
2738  } break;
2739  case esObjectType::Jet: {
2740  objType[jj] = gtJet;
2741  } break;
2742  case esObjectType::Tau: {
2743  objType[jj] = gtTau;
2744  } break;
2745  default: {
2746  } break;
2747  }
2748  condCateg[jj] = CondCalo;
2749 
2750  } else if (object.getType() == esObjectType::ETM || object.getType() == esObjectType::ETMHF ||
2751  object.getType() == esObjectType::TOWERCOUNT || object.getType() == esObjectType::HTM) {
2752  // we have Energy Sum
2753  parseEnergySumCorr(&object, chipNr);
2754  corrIndexVal[jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
2755 
2756  //Now set some flags for this subCondition
2757  intGEq[jj] = (object.getComparisonOperator() == esComparisonOperator::GE);
2758  switch (object.getType()) {
2759  case esObjectType::ETM: {
2761  } break;
2762  case esObjectType::HTM: {
2764  } break;
2765  case esObjectType::ETMHF: {
2767  } break;
2768  case esObjectType::TOWERCOUNT: {
2770  } break;
2771  default: {
2772  } break;
2773  }
2774  condCateg[jj] = CondEnergySum;
2775 
2776  } else {
2777  edm::LogError("TriggerMenuParser") << "Illegal Object Type " << object.getType()
2778  << " for the correlation condition " << name << std::endl;
2779  return false;
2780 
2781  } //if block on leg types
2782 
2783  } //loop over legs
2784 
2785  // get greater equal flag for the correlation condition
2786  bool gEq = true;
2787  if (intGEq[0] != intGEq[1]) {
2788  edm::LogError("TriggerMenuParser") << "Inconsistent GEq flags for sub-conditions "
2789  << " for the correlation condition " << name << std::endl;
2790  return false;
2791 
2792  } else {
2793  gEq = (intGEq[0] != 0);
2794  }
2795 
2796  // fill the correlation condition
2797  correlationCond.setCondType(cType);
2798  correlationCond.setObjectType(objType);
2799  correlationCond.setCondGEq(gEq);
2800  correlationCond.setCondChipNr(chipNr);
2801 
2802  correlationCond.setCond0Category(condCateg[0]);
2803  correlationCond.setCond1Category(condCateg[1]);
2804 
2805  correlationCond.setCond0Index(corrIndexVal[0]);
2806  correlationCond.setCond1Index(corrIndexVal[1]);
2807 
2808  correlationCond.setCorrelationParameter(corrParameter);
2809 
2810  if (edm::isDebugEnabled()) {
2811  std::ostringstream myCoutStream;
2812  correlationCond.print(myCoutStream);
2813  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
2814  }
2815 
2816  // insert condition into the map
2817  // condition is not duplicate, check was done at the beginning
2818 
2819  (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
2820 
2821  //
2822  return true;
2823 }
2824 
2826 
2838 bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition corrCond, unsigned int chipNr) {
2839  using namespace tmeventsetup;
2840 
2841  std::string condition = "corrThreeBody";
2842  std::string particle = "muon";
2843  std::string type = l1t2string(corrCond.getType());
2844  std::string name = l1t2string(corrCond.getName());
2845 
2846  LogDebug("TriggerMenuParser") << " ****************************************** " << std::endl
2847  << " (in parseCorrelationThreeBody) " << std::endl
2848  << " condition = " << condition << std::endl
2849  << " particle = " << particle << std::endl
2850  << " type = " << type << std::endl
2851  << " name = " << name << std::endl;
2852 
2853  // create a new correlation condition
2854  CorrelationThreeBodyTemplate correlationThreeBodyCond(name);
2855 
2856  // check that the condition does not exist already in the map
2857  if (!insertConditionIntoMap(correlationThreeBodyCond, chipNr)) {
2858  edm::LogError("TriggerMenuParser") << " Error: duplicate correlation condition (" << name << ")" << std::endl;
2859  return false;
2860  }
2861 
2862  // Define some of the quantities to store the parsed information
2863  GtConditionType cType = l1t::Type3s;
2864 
2865  // three objects (for sure)
2866  const int nrObj = 3;
2867 
2868  // object types and greater equal flag - filled in the loop
2869  std::vector<GlobalObject> objType(nrObj);
2870  std::vector<GtConditionCategory> condCateg(nrObj);
2871 
2872  // correlation flag and index in the cor*vector
2873  const bool corrFlag = true;
2874  int corrIndexVal[nrObj] = {-1, -1, -1};
2875 
2876  // Storage of the correlation selection
2878 
2879  // Get the correlation cuts on the legs
2880  int cutType = 0;
2881  const std::vector<esCut>& cuts = corrCond.getCuts();
2882  for (size_t lll = 0; lll < cuts.size(); lll++) {
2883  const esCut cut = cuts.at(lll);
2884 
2885  //
2886  // Until utm has method to calculate these, do the integer value calculation with precision.
2887  //
2888  double minV = cut.getMinimum().value;
2889  double maxV = cut.getMaximum().value;
2890 
2891  //Scale down very large numbers out of xml
2892  if (maxV > 1.0e8)
2893  maxV = 1.0e8;
2894 
2895  if (cut.getCutType() == esCutType::Mass) {
2896  LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tMass Cut minV = " << minV
2897  << "\tMass Cut maxV = " << maxV << " precMin = " << cut.getMinimum().index
2898  << " precMax = " << cut.getMaximum().index << std::endl;
2899  corrThreeBodyParameter.minMassCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
2900  corrThreeBodyParameter.maxMassCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
2901  corrThreeBodyParameter.precMassCut = cut.getMinimum().index;
2902  cutType = cutType | 0x8;
2903  }
2904  }
2905  corrThreeBodyParameter.corrCutType = cutType;
2906 
2907  // Get the three objects that form the legs
2908  const std::vector<esObject>& objects = corrCond.getObjects();
2909  if (objects.size() != 3) {
2910  edm::LogError("TriggerMenuParser") << "incorrect number of objects for the correlation condition " << name
2911  << " corrFlag " << corrFlag << std::endl;
2912  return false;
2913  }
2914 
2915  // Loop over legs
2916  for (size_t lll = 0; lll < objects.size(); lll++) {
2917  const esObject object = objects.at(lll);
2918  LogDebug("TriggerMenuParser") << " obj name = " << object.getName() << "\n";
2919  LogDebug("TriggerMenuParser") << " obj type = " << object.getType() << "\n";
2920  LogDebug("TriggerMenuParser") << " obj bx = " << object.getBxOffset() << "\n";
2921 
2922  // check the leg type
2923  if (object.getType() == esObjectType::Muon) {
2924  // we have a muon
2925  parseMuonCorr(&object, chipNr);
2926  corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).size() - 1;
2927 
2928  //Now set some flags for this subCondition
2929  objType[lll] = gtMu;
2930  condCateg[lll] = CondMuon;
2931 
2932  } else {
2933  edm::LogError("TriggerMenuParser") << "Checked the object Type " << object.getType()
2934  << " for the correlation condition " << name
2935  << ": no three muons in the event!" << std::endl;
2936  }
2937  } // End loop over legs
2938 
2939  // fill the three-body correlation condition
2940  correlationThreeBodyCond.setCondType(cType);
2941  correlationThreeBodyCond.setObjectType(objType);
2942  correlationThreeBodyCond.setCondChipNr(chipNr);
2943 
2944  correlationThreeBodyCond.setCond0Category(condCateg[0]);
2945  correlationThreeBodyCond.setCond1Category(condCateg[1]);
2946  correlationThreeBodyCond.setCond2Category(condCateg[2]);
2947 
2948  correlationThreeBodyCond.setCond0Index(corrIndexVal[0]);
2949  correlationThreeBodyCond.setCond1Index(corrIndexVal[1]);
2950  correlationThreeBodyCond.setCond2Index(corrIndexVal[2]);
2951 
2952  correlationThreeBodyCond.setCorrelationThreeBodyParameter(corrThreeBodyParameter);
2953 
2954  if (edm::isDebugEnabled()) {
2955  std::ostringstream myCoutStream;
2956  correlationThreeBodyCond.print(myCoutStream);
2957  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
2958  }
2959 
2960  // insert condition into the map
2961  // condition is not duplicate, check was done at the beginning
2962 
2963  (m_vecCorrelationThreeBodyTemplate[chipNr]).push_back(correlationThreeBodyCond);
2964 
2965  //
2966  return true;
2967 }
2968 
2970 
2982 bool l1t::TriggerMenuParser::parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition& corrCond,
2983  unsigned int chipNr) {
2984  using namespace tmeventsetup;
2985 
2986  std::string condition = "corrWithOverlapRemoval";
2987  std::string particle = "test-fix";
2988  std::string type = l1t2string(corrCond.getType());
2989  std::string name = l1t2string(corrCond.getName());
2990 
2991  LogDebug("TriggerMenuParser") << " ****************************************** " << std::endl
2992  << " (in parseCorrelationWithOverlapRemoval) " << std::endl
2993  << " condition = " << condition << std::endl
2994  << " particle = " << particle << std::endl
2995  << " type = " << type << std::endl
2996  << " name = " << name << std::endl;
2997 
2998  // create a new correlation condition
2999  CorrelationWithOverlapRemovalTemplate correlationWORCond(name);
3000 
3001  // check that the condition does not exist already in the map
3002  if (!insertConditionIntoMap(correlationWORCond, chipNr)) {
3003  edm::LogError("TriggerMenuParser") << " Error: duplicate correlation condition (" << name << ")" << std::endl;
3004 
3005  return false;
3006  }
3007 
3008  // Define some of the quantities to store the parased information
3009 
3010  // condition type BLW (Do we change this to the type of correlation condition?)
3012 
3013  // three objects (for sure)
3014  const int nrObj = 3;
3015 
3016  // object types and greater equal flag - filled in the loop
3017  int intGEq[nrObj] = {-1, -1, -1};
3018  std::vector<GlobalObject> objType(nrObj); //BLW do we want to define these as a different type?
3019  std::vector<GtConditionCategory> condCateg(nrObj); //BLW do we want to change these categories
3020 
3021  // correlation flag and index in the cor*vector
3022  const bool corrFlag = true;
3023  int corrIndexVal[nrObj] = {-1, -1, -1};
3024 
3025  // Storage of the correlation selection
3027  corrParameter.chargeCorrelation = 1; //ignore charge correlation for corr-legs
3028 
3029  // Get the correlation Cuts on the legs
3030  int cutType = 0;
3031  const std::vector<esCut>& cuts = corrCond.getCuts();
3032  for (size_t jj = 0; jj < cuts.size(); jj++) {
3033  const esCut cut = cuts.at(jj);
3034 
3035  if (cut.getCutType() == esCutType::ChargeCorrelation) {
3036  if (cut.getData() == "ls")
3037  corrParameter.chargeCorrelation = 2;
3038  else if (cut.getData() == "os")
3039  corrParameter.chargeCorrelation = 4;
3040  else
3041  corrParameter.chargeCorrelation = 1; //ignore charge correlation
3042  } else {
3043  //
3044  // Unitl utm has method to calculate these, do the integer value calculation with precision.
3045  //
3046  double minV = cut.getMinimum().value;
3047  double maxV = cut.getMaximum().value;
3048 
3049  //Scale down very large numbers out of xml
3050  if (maxV > 1.0e8)
3051  maxV = 1.0e8;
3052 
3053  if (cut.getCutType() == esCutType::DeltaEta) {
3054  //std::cout << "DeltaEta Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3055  corrParameter.minEtaCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3056  corrParameter.maxEtaCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3057  corrParameter.precEtaCut = cut.getMinimum().index;
3058  cutType = cutType | 0x1;
3059  } else if (cut.getCutType() == esCutType::DeltaPhi) {
3060  //std::cout << "DeltaPhi Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3061  corrParameter.minPhiCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3062  corrParameter.maxPhiCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3063  corrParameter.precPhiCut = cut.getMinimum().index;
3064  cutType = cutType | 0x2;
3065  } else if (cut.getCutType() == esCutType::DeltaR) {
3066  //std::cout << "DeltaR Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3067  corrParameter.minDRCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3068  corrParameter.maxDRCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3069  corrParameter.precDRCut = cut.getMinimum().index;
3070  cutType = cutType | 0x4;
3071  } else if (cut.getCutType() == esCutType::Mass) {
3072  //std::cout << "Mass Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3073  corrParameter.minMassCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3074  corrParameter.maxMassCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3075  corrParameter.precMassCut = cut.getMinimum().index;
3076  cutType = cutType | 0x8;
3077  }
3078  if (cut.getCutType() == esCutType::OvRmDeltaEta) {
3079  //std::cout << "OverlapRemovalDeltaEta Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3080  corrParameter.minOverlapRemovalEtaCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3081  corrParameter.maxOverlapRemovalEtaCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3082  corrParameter.precOverlapRemovalEtaCut = cut.getMinimum().index;
3083  cutType = cutType | 0x10;
3084  } else if (cut.getCutType() == esCutType::OvRmDeltaPhi) {
3085  //std::cout << "OverlapRemovalDeltaPhi Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3086  corrParameter.minOverlapRemovalPhiCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3087  corrParameter.maxOverlapRemovalPhiCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3088  corrParameter.precOverlapRemovalPhiCut = cut.getMinimum().index;
3089  cutType = cutType | 0x20;
3090  } else if (cut.getCutType() == esCutType::OvRmDeltaR) {
3091  //std::cout << "DeltaR Cut minV = " << minV << " Max = " << maxV << " precMin = " << cut.getMinimum().index << " precMax = " << cut.getMaximum().index << std::endl;
3092  corrParameter.minOverlapRemovalDRCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
3093  corrParameter.maxOverlapRemovalDRCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
3094  corrParameter.precOverlapRemovalDRCut = cut.getMinimum().index;
3095  cutType = cutType | 0x40;
3096  }
3097  }
3098  }
3099  corrParameter.corrCutType = cutType;
3100 
3101  // Get the two objects that form the legs
3102  const std::vector<esObject>& objects = corrCond.getObjects();
3103  if (objects.size() != 3) {
3104  edm::LogError("TriggerMenuParser")
3105  << "incorrect number of objects for the correlation condition with overlap removal " << name << " corrFlag "
3106  << corrFlag << std::endl;
3107  return false;
3108  }
3109 
3110  // Loop over legs
3111  for (size_t jj = 0; jj < objects.size(); jj++) {
3112  const esObject& object = objects.at(jj);
3113  LogDebug("TriggerMenuParser") << " obj name = " << object.getName() << "\n";
3114  LogDebug("TriggerMenuParser") << " obj type = " << object.getType() << "\n";
3115  LogDebug("TriggerMenuParser") << " obj op = " << object.getComparisonOperator() << "\n";
3116  LogDebug("TriggerMenuParser") << " obj bx = " << object.getBxOffset() << "\n";
3117  LogDebug("TriggerMenuParser") << "type = done" << std::endl;
3118 
3119  // check the leg type
3120  if (object.getType() == esObjectType::Muon) {
3121  // we have a muon
3122 
3123  /*
3124  //BLW Hold on to this code we may need to go back to it at some point.
3125  // Now we are putting ALL leg conditions into the vector (so there are duplicates)
3126  // This is potentially a place to slim down the code. Note: We currently evaluate the
3127  // conditions every time, so even if we put the condition in the vector once, we would
3128  // still evaluate it multiple times. This is a place for optimization.
3129  {
3130 
3131  parseMuonCorr(&object,chipNr);
3132  corrIndexVal[jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3133 
3134  } else {
3135  LogDebug("TriggerMenuParser") << "Not Adding Correlation Muon Condition to Map...looking for the condition in Muon Cor Vector" << std::endl;
3136  bool found = false;
3137  int index = 0;
3138  while(!found && index<(int)((m_corMuonTemplate[chipNr]).size()) ) {
3139  if( (m_corMuonTemplate[chipNr]).at(index).condName() == object.getName() ) {
3140  LogDebug("TriggerMenuParser") << "Found condition " << object.getName() << " in vector at index " << index << std::endl;
3141  found = true;
3142  } else {
3143  index++;
3144  }
3145  }
3146  if(found) {
3147  corrIndexVal[jj] = index;
3148  } else {
3149  edm::LogError("TriggerMenuParser") << "FAILURE: Condition " << object.getName() << " is in map but not in cor. vector " << std::endl;
3150  }
3151 
3152  }
3153 */
3154  parseMuonCorr(&object, chipNr);
3155  corrIndexVal[jj] = (m_corMuonTemplate[chipNr]).size() - 1;
3156 
3157  //Now set some flags for this subCondition
3158  intGEq[jj] = (object.getComparisonOperator() == esComparisonOperator::GE);
3159  objType[jj] = gtMu;
3160  condCateg[jj] = CondMuon;
3161 
3162  } else if (object.getType() == esObjectType::Egamma || object.getType() == esObjectType::Jet ||
3163  object.getType() == esObjectType::Tau) {
3164  // we have an Calo object
3165  parseCaloCorr(&object, chipNr);
3166  corrIndexVal[jj] = (m_corCaloTemplate[chipNr]).size() - 1;
3167 
3168  //Now set some flags for this subCondition
3169  intGEq[jj] = (object.getComparisonOperator() == esComparisonOperator::GE);
3170  switch (object.getType()) {
3171  case esObjectType::Egamma: {
3172  objType[jj] = gtEG;
3173  } break;
3174  case esObjectType::Jet: {
3175  objType[jj] = gtJet;
3176  } break;
3177  case esObjectType::Tau: {
3178  objType[jj] = gtTau;
3179  } break;
3180  default: {
3181  } break;
3182  }
3183  condCateg[jj] = CondCalo;
3184 
3185  } else if (object.getType() == esObjectType::ETM || object.getType() == esObjectType::ETMHF ||
3186  object.getType() == esObjectType::TOWERCOUNT || object.getType() == esObjectType::HTM) {
3187  // we have Energy Sum
3188  parseEnergySumCorr(&object, chipNr);
3189  corrIndexVal[jj] = (m_corEnergySumTemplate[chipNr]).size() - 1;
3190 
3191  //Now set some flags for this subCondition
3192  intGEq[jj] = (object.getComparisonOperator() == esComparisonOperator::GE);
3193  switch (object.getType()) {
3194  case esObjectType::ETM: {
3196  } break;
3197  case esObjectType::HTM: {
3199  } break;
3200  case esObjectType::ETMHF: {
3202  } break;
3203  case esObjectType::TOWERCOUNT: {
3205  } break;
3206  default: {
3207  } break;
3208  }
3209  condCateg[jj] = CondEnergySum;
3210 
3211  } else {
3212  edm::LogError("TriggerMenuParser") << "Illegal Object Type " << object.getType()
3213  << " for the correlation condition " << name << std::endl;
3214  return false;
3215 
3216  } //if block on leg types
3217 
3218  } //loop over legs
3219 
3220  // get greater equal flag for the correlation condition
3221  bool gEq = true;
3222  if (intGEq[0] != intGEq[1]) {
3223  edm::LogError("TriggerMenuParser") << "Inconsistent GEq flags for sub-conditions "
3224  << " for the correlation condition " << name << std::endl;
3225  return false;
3226 
3227  } else {
3228  gEq = (intGEq[0] != 0);
3229  }
3230 
3231  // fill the correlation condition
3232  correlationWORCond.setCondType(cType);
3233  correlationWORCond.setObjectType(objType);
3234  correlationWORCond.setCondGEq(gEq);
3235  correlationWORCond.setCondChipNr(chipNr);
3236 
3237  correlationWORCond.setCond0Category(condCateg[0]);
3238  correlationWORCond.setCond1Category(condCateg[1]);
3239  correlationWORCond.setCond2Category(condCateg[2]);
3240 
3241  correlationWORCond.setCond0Index(corrIndexVal[0]);
3242  correlationWORCond.setCond1Index(corrIndexVal[1]);
3243  correlationWORCond.setCond2Index(corrIndexVal[2]);
3244 
3245  correlationWORCond.setCorrelationWithOverlapRemovalParameter(corrParameter);
3246 
3247  if (edm::isDebugEnabled()) {
3248  std::ostringstream myCoutStream;
3249  correlationWORCond.print(myCoutStream);
3250  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
3251  }
3252 
3253  // insert condition into the map
3254  // condition is not duplicate, check was done at the beginning
3255 
3256  (m_vecCorrelationWithOverlapRemovalTemplate[chipNr]).push_back(correlationWORCond);
3257 
3258  //
3259  return true;
3260 }
3261 
3273 bool l1t::TriggerMenuParser::parseAlgorithm(tmeventsetup::esAlgorithm algorithm, unsigned int chipNr) {
3274  using namespace tmeventsetup;
3275  //using namespace Algorithm;
3276 
3277  // get alias
3278  std::string algAlias = algorithm.getName();
3279  const std::string& algName = algorithm.getName();
3280 
3281  if (algAlias.empty()) {
3282  algAlias = algName;
3283  LogDebug("TriggerMenuParser") << "\n No alias defined for algorithm. Alias set to algorithm name."
3284  << "\n Algorithm name: " << algName << "\n Algorithm alias: " << algAlias
3285  << std::endl;
3286  } else {
3287  //LogDebug("TriggerMenuParser")
3288  LogDebug("TriggerMenuParser") << "\n Alias defined for algorithm."
3289  << "\n Algorithm name: " << algName << "\n Algorithm alias: " << algAlias
3290  << std::endl;
3291  }
3292 
3293  // get the logical expression
3294  const std::string& logExpression = algorithm.getExpressionInCondition();
3295 
3296  LogDebug("TriggerMenuParser") << " Logical expression: " << logExpression
3297  << " Chip number: " << chipNr << std::endl;
3298 
3299  // determine output pin
3300  int outputPin = algorithm.getIndex();
3301 
3302  //LogTrace("TriggerMenuParser")
3303  LogDebug("TriggerMenuParser") << " Output pin: " << outputPin << std::endl;
3304 
3305  // compute the bit number from chip number, output pin and order of the chips
3306  // pin numbering start with 1, bit numbers with 0
3307  int bitNumber = outputPin; // + (m_orderConditionChip[chipNr] -1)*m_pinsOnConditionChip -1;
3308 
3309  //LogTrace("TriggerMenuParser")
3310  LogDebug("TriggerMenuParser") << " Bit number: " << bitNumber << std::endl;
3311 
3312  // create a new algorithm and insert it into algorithm map
3313  GlobalAlgorithm alg(algName, logExpression, bitNumber);
3314  alg.setAlgoChipNumber(static_cast<int>(chipNr));
3315  alg.setAlgoAlias(algAlias);
3316 
3317  if (edm::isDebugEnabled()) {
3318  std::ostringstream myCoutStream;
3319  alg.print(myCoutStream);
3320  LogTrace("TriggerMenuParser") << myCoutStream.str() << "\n" << std::endl;
3321  }
3322 
3323  // insert algorithm into the map
3324  if (!insertAlgorithmIntoMap(alg)) {
3325  return false;
3326  }
3327 
3328  return true;
3329 }
3330 
3331 // static class members
l1t::TriggerMenuParser::l1t2string
std::string l1t2string(T)
Definition: TriggerMenuParser.cc:511
l1t::GlobalScales::ScaleParameters::etaStep
double etaStep
Definition: GlobalScales.h:54
CaloTemplate
Definition: CaloTemplate.h:33
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precMassCut
unsigned int precMassCut
Definition: CorrelationWithOverlapRemovalTemplate.h:82
CorrelationTemplate::setCond1Category
void setCond1Category(const l1t::GtConditionCategory &)
Definition: CorrelationTemplate.cc:115
l1t::gtHTM
Definition: GlobalObject.h:24
CorrelationTemplate::setCond0Index
void setCond0Index(const int &)
Definition: CorrelationTemplate.cc:118
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
l1t::Type2cor
Definition: GlobalDefinitions.h:54
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minOverlapRemovalEtaCutValue
long long minOverlapRemovalEtaCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:88
l1t::TypeCent5
Definition: GlobalDefinitions.h:75
GlobalCondition::setCondType
void setCondType(const l1t::GtConditionType &cType)
Definition: GlobalCondition.h:63
l1t::GlobalScales::ScaleParameters::uptMax
double uptMax
Definition: GlobalScales.h:43
l1t::gtCentrality0
Definition: GlobalObject.h:36
CorrelationTemplate::CorrelationParameter::maxEtaCutValue
long long maxEtaCutValue
Definition: CorrelationTemplate.h:63
l1t::gtExternal
Definition: GlobalObject.h:44
HLT_FULL_cff.Threshold
Threshold
Definition: HLT_FULL_cff.py:11663
CorrelationThreeBodyTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: CorrelationThreeBodyTemplate.cc:145
HTM
Definition: L1GtObject.h:38
mps_fire.i
i
Definition: mps_fire.py:428
l1t::TriggerMenuParser::setGtPinsOnConditionChip
void setGtPinsOnConditionChip(const unsigned int &)
Definition: TriggerMenuParser.cc:74
l1t::TriggerMenuParser::getExternalSignals
std::map< std::string, unsigned int > getExternalSignals(const L1TUtmTriggerMenu *utmMenu)
Definition: TriggerMenuParser.cc:164
l1t::TriggerMenuParser::parseMuon
bool parseMuon(tmeventsetup::esCondition condMu, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon condition
Definition: TriggerMenuParser.cc:1026
l1t::TriggerMenuParser::setGtScaleDbKey
void setGtScaleDbKey(const std::string &)
Definition: TriggerMenuParser.cc:107
MessageLogger.h
l1t::TriggerMenuParser::setVecMuonTemplate
void setVecMuonTemplate(const std::vector< std::vector< MuonTemplate > > &)
Definition: TriggerMenuParser.cc:110
GlobalAlgorithm::setAlgoChipNumber
void setAlgoChipNumber(const int algoChipNumberValue)
Definition: GlobalAlgorithm.h:79
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
GlobalAlgorithm::algoName
const std::string algoName() const
get / set algorithm name
Definition: GlobalAlgorithm.h:52
MuonTemplate::setConditionParameter
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
Definition: MuonTemplate.cc:65
GlobalCondition::setCondRelativeBx
void setCondRelativeBx(const int &cRelativeBx)
Definition: GlobalCondition.h:83
CaloTemplate::setConditionParameter
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
Definition: CaloTemplate.cc:63
cuts
const TkSoA *__restrict__ CAHitNtupletGeneratorKernelsGPU::QualityCuts cuts
Definition: CAHitNtupletGeneratorKernelsImpl.h:338
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
CorrelationThreeBodyTemplate::setCond2Category
void setCond2Category(const l1t::GtConditionCategory &)
Definition: CorrelationThreeBodyTemplate.cc:130
l1t::GlobalScales::ScaleParameters::etStep
double etStep
Definition: GlobalScales.h:38
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
l1t::TriggerMenuParser::setGtNumberPhysTriggers
void setGtNumberPhysTriggers(const unsigned int &)
Definition: TriggerMenuParser.cc:85
CorrelationThreeBodyTemplate::CorrelationThreeBodyParameter
typedef for correlation three-body parameters
Definition: CorrelationThreeBodyTemplate.h:65
l1t::TriggerMenuParser::setGtTriggerMenuUUID
void setGtTriggerMenuUUID(const int)
Definition: TriggerMenuParser.cc:98
step
step
Definition: StallMonitor.cc:94
CorrelationTemplate::CorrelationParameter::precPhiCut
unsigned int precPhiCut
Definition: CorrelationTemplate.h:68
l1t::TriggerMenuParser::setGtTriggerMenuInterfaceDate
void setGtTriggerMenuInterfaceDate(const std::string &)
Definition: TriggerMenuParser.cc:369
ETM
Definition: L1GtObject.h:35
EnergySumTemplate::setConditionParameter
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
Definition: EnergySumTemplate.cc:66
l1t::TriggerMenuParser::parseCorrelationWithOverlapRemoval
bool parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition &corrCond, unsigned int chipNr=0)
parse a correlation condition with overlap removal
Definition: TriggerMenuParser.cc:2982
l1t::GlobalScales::ScaleParameters::phiMax
double phiMax
Definition: GlobalScales.h:48
GlobalAlgorithm::algoAlias
std::string const & algoAlias() const
get / set algorithm alias
Definition: GlobalAlgorithm.h:57
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxDRCutValue
long long maxDRCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:76
l1t::TriggerMenuParser::setVecEnergySumTemplate
void setVecEnergySumTemplate(const std::vector< std::vector< EnergySumTemplate > > &)
Definition: TriggerMenuParser.cc:118
l1t::GlobalScales::ScaleParameters::uptStep
double uptStep
Definition: GlobalScales.h:44
l1t::TriggerMenuParser::parseDeltaEta_Cosh_LUTS
void parseDeltaEta_Cosh_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2, unsigned int prec1, unsigned int prec2)
Definition: TriggerMenuParser.cc:904
l1t::TriggerMenuParser::setCorCaloTemplate
void setCorCaloTemplate(const std::vector< std::vector< CaloTemplate > > &)
Definition: TriggerMenuParser.cc:149
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precEtaCut
unsigned int precEtaCut
Definition: CorrelationWithOverlapRemovalTemplate.h:69
L1TRate_Offline_cfi.Tau
Tau
Definition: L1TRate_Offline_cfi.py:43
l1t::TypeNull
Definition: GlobalDefinitions.h:50
CorrelationThreeBodyTemplate::CorrelationThreeBodyParameter::corrCutType
int corrCutType
Definition: CorrelationThreeBodyTemplate.h:79
l1t::TrigFunc_t
TrigFunc_t
Definition: TriggerMenuParser.h:60
l1t::GlobalScales::ScaleParameters::etMin
double etMin
Definition: GlobalScales.h:36
CorrelationTemplate::setCond1Index
void setCond1Index(const int &)
Definition: CorrelationTemplate.cc:120
HLT_FULL_cff.Algorithm
Algorithm
Definition: HLT_FULL_cff.py:9477
objects
Definition: __init__.py:1
CorrelationTemplate::CorrelationParameter::minMassCutValue
long long minMassCutValue
Definition: CorrelationTemplate.h:74
l1t::TriggerMenuParser::parseCorrelationThreeBody
bool parseCorrelationThreeBody(tmeventsetup::esCondition corrCond, unsigned int chipNr=0)
parse a three-body correlation condition
Definition: TriggerMenuParser.cc:2838
l1t::GlobalScales::ScaleParameters::etaMin
double etaMin
Definition: GlobalScales.h:52
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxMassCutValue
long long maxMassCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:81
l1t::TypeETM
Definition: GlobalDefinitions.h:57
l1t::gtEG
Definition: GlobalObject.h:18
l1t::Type3s
Definition: GlobalDefinitions.h:55
CorrelationTemplate::CorrelationParameter::precDRCut
unsigned int precDRCut
Definition: CorrelationTemplate.h:72
l1t::TriggerMenuParser::setVecCorrelationTemplate
void setVecCorrelationTemplate(const std::vector< std::vector< CorrelationTemplate > > &)
Definition: TriggerMenuParser.cc:128
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precDRCut
unsigned int precDRCut
Definition: CorrelationWithOverlapRemovalTemplate.h:78
CorrelationTemplate::CorrelationParameter::precMassCut
unsigned int precMassCut
Definition: CorrelationTemplate.h:76
l1t::gtETTem
Definition: GlobalObject.h:31
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:48
l1t::TriggerMenuParser::parseDeltaPhi_Cos_LUTS
void parseDeltaPhi_Cos_LUTS(const std::map< std::string, tmeventsetup::esScale > &scaleMap, const std::string &obj1, const std::string &obj2, unsigned int prec1, unsigned int prec2)
Definition: TriggerMenuParser.cc:939
CorrelationWithOverlapRemovalTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: CorrelationWithOverlapRemovalTemplate.cc:152
CaloTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: CaloTemplate.cc:69
l1t::gtMinBiasHFP1
Definition: GlobalObject.h:29
l1t::gtMinBiasHFM1
Definition: GlobalObject.h:30
CorrelationTemplate::CorrelationParameter::corrCutType
int corrCutType
Definition: CorrelationTemplate.h:85
l1t::GlobalScales::ScaleParameters::phiMin
double phiMin
Definition: GlobalScales.h:47
CorrelationThreeBodyTemplate
Definition: CorrelationThreeBodyTemplate.h:35
mps_check.array
array
Definition: mps_check.py:216
l1t::TypeAsymEtHF
Definition: GlobalDefinitions.h:80
l1t::TriggerMenuParser::parseCondFormats
void parseCondFormats(const L1TUtmTriggerMenu *utmMenu)
Definition: TriggerMenuParser.cc:199
MuonTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: MuonTemplate.cc:71
l1t::gtAsymmetryEt
Definition: GlobalObject.h:32
HLT_FULL_cff.DeltaEta
DeltaEta
Definition: HLT_FULL_cff.py:454
GlobalCondition.h
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minDRCutValue
long long minDRCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:75
CorrelationThreeBodyTemplate::setCond0Category
void setCond0Category(const l1t::GtConditionCategory &)
Definition: CorrelationThreeBodyTemplate.cc:124
l1t::TypeMinBiasHFP0
Definition: GlobalDefinitions.h:63
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxEtaCutValue
long long maxEtaCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:68
HLT_FULL_cff.SingleMuon
SingleMuon
Definition: HLT_FULL_cff.py:6072
CorrelationThreeBodyTemplate::setCorrelationThreeBodyParameter
void setCorrelationThreeBodyParameter(const CorrelationThreeBodyParameter &corrThreeBodyParameter)
Definition: CorrelationThreeBodyTemplate.cc:140
l1t::TriggerMenuParser::~TriggerMenuParser
virtual ~TriggerMenuParser()
destructor
Definition: TriggerMenuParser.cc:66
l1t::TriggerMenuParser::setGtTriggerMenuInterfaceDescription
void setGtTriggerMenuInterfaceDescription(const std::string &)
Definition: TriggerMenuParser.cc:375
CorrelationThreeBodyTemplate::setCond0Index
void setCond0Index(const int &)
Definition: CorrelationThreeBodyTemplate.cc:135
l1t::TypeCent2
Definition: GlobalDefinitions.h:72
l1t::TriggerMenuParser::setGtTriggerMenuInterface
void setGtTriggerMenuInterface(const std::string &)
Definition: TriggerMenuParser.cc:93
l1t::TypeCent3
Definition: GlobalDefinitions.h:73
CorrelationTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: CorrelationTemplate.cc:127
l1t::gtCentrality5
Definition: GlobalObject.h:41
l1t::TypeCent7
Definition: GlobalDefinitions.h:77
l1t::TriggerMenuParser::setVecExternalTemplate
void setVecExternalTemplate(const std::vector< std::vector< ExternalTemplate > > &)
Definition: TriggerMenuParser.cc:123
ntuple_cfi.Egamma
Egamma
Definition: ntuple_cfi.py:5
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::corrCutType
int corrCutType
Definition: CorrelationWithOverlapRemovalTemplate.h:103
l1t::TypeMinBiasHFM1
Definition: GlobalDefinitions.h:66
l1t::gtCentrality7
Definition: GlobalObject.h:43
HLT_FULL_cff.DeltaPhi
DeltaPhi
Definition: HLT_FULL_cff.py:465
l1t::TriggerMenuParser::setGtTriggerMenuDescription
void setGtTriggerMenuDescription(const std::string &)
Definition: TriggerMenuParser.cc:383
l1t::gtAsymmetryHt
Definition: GlobalObject.h:33
CorrelationWithOverlapRemovalTemplate::setCond2Category
void setCond2Category(const l1t::GtConditionCategory &)
Definition: CorrelationWithOverlapRemovalTemplate.cc:135
l1t::gtCentrality4
Definition: GlobalObject.h:40
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minPhiCutValue
long long minPhiCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:71
l1t::gtJet
Definition: GlobalObject.h:19
CorrelationTemplate::CorrelationParameter::minTBPTCutValue
long long minTBPTCutValue
Definition: CorrelationTemplate.h:78
l1t::gtTowerCount
Definition: GlobalObject.h:26
CorrelationTemplate::CorrelationParameter::precTBPTCut
unsigned int precTBPTCut
Definition: CorrelationTemplate.h:80
L1TUtmTriggerMenu
Definition: L1TUtmTriggerMenu.h:25
l1t::Type2corWithOverlapRemoval
Definition: GlobalDefinitions.h:69
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
GlobalObject
cmsdt::algo
algo
Definition: constants.h:165
ExternalTemplate
Definition: ExternalTemplate.h:32
CorrelationWithOverlapRemovalTemplate::setCond0Index
void setCond0Index(const int &)
Definition: CorrelationWithOverlapRemovalTemplate.cc:140
l1t::TriggerMenuParser::parseCaloCorr
bool parseCaloCorr(const tmeventsetup::esObject *corrCalo, unsigned int chipNr=0)
Definition: TriggerMenuParser.cc:1829
CorrelationWithOverlapRemovalTemplate::setCorrelationWithOverlapRemovalParameter
void setCorrelationWithOverlapRemovalParameter(const CorrelationWithOverlapRemovalParameter &corrParameter)
Definition: CorrelationWithOverlapRemovalTemplate.cc:147
l1t::TypeCent1
Definition: GlobalDefinitions.h:71
l1t::CondCalo
Definition: GlobalDefinitions.h:96
l1t::SIN
Definition: TriggerMenuParser.h:60
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minOverlapRemovalDRCutValue
long long minOverlapRemovalDRCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:96
GlobalAlgorithm
Definition: GlobalAlgorithm.h:32
createPayload.uuid
uuid
Definition: createPayload.py:391
reco::ceil
constexpr int32_t ceil(float num)
Definition: constexpr_cmath.h:7
l1t::TriggerMenuParser::setVecCorrelationThreeBodyTemplate
void setVecCorrelationThreeBodyTemplate(const std::vector< std::vector< CorrelationThreeBodyTemplate > > &)
Definition: TriggerMenuParser.cc:133
CorrelationWithOverlapRemovalTemplate::setCond2Index
void setCond2Index(const int &)
Definition: CorrelationWithOverlapRemovalTemplate.cc:144
l1t::GlobalScales::ScaleParameters::uptBins
std::vector< std::pair< double, double > > uptBins
Definition: GlobalScales.h:45
CorrelationTemplate::CorrelationParameter::maxPhiCutValue
long long maxPhiCutValue
Definition: CorrelationTemplate.h:67
l1t::GtConditionType
GtConditionType
Definition: GlobalDefinitions.h:49
GlobalCondition::setCondChipNr
void setCondChipNr(const int &cChipNr)
Definition: GlobalCondition.h:78
HLT_FULL_cff.DoubleMuon
DoubleMuon
Definition: HLT_FULL_cff.py:3857
l1t::GlobalScales::ScaleParameters::etaMax
double etaMax
Definition: GlobalScales.h:53
GlobalAlgorithm::algoBitNumber
int algoBitNumber() const
get / set algorithm bit number
Definition: GlobalAlgorithm.h:72
HTT
Definition: L1GtObject.h:37
l1t::TypeAsymEt
Definition: GlobalDefinitions.h:78
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxOverlapRemovalDRCutValue
long long maxOverlapRemovalDRCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:97
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
l1t::gtETMHF
Definition: GlobalObject.h:25
l1t::COS
Definition: TriggerMenuParser.h:60
l1t::TypeHTT
Definition: GlobalDefinitions.h:59
l1t::TriggerMenuParser::parseCalMuPhi_LUTS
void parseCalMuPhi_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2)
Definition: TriggerMenuParser.cc:832
L1TRate_cfi.Jet
Jet
Definition: L1TRate_cfi.py:43
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
HLTSiStripMonitoring_cff.Mass
Mass
Definition: HLTSiStripMonitoring_cff.py:135
l1t::TriggerMenuParser::setCorMuonTemplate
void setCorMuonTemplate(const std::vector< std::vector< MuonTemplate > > &)
Definition: TriggerMenuParser.cc:145
l1t::TriggerMenuParser::setVecCaloTemplate
void setVecCaloTemplate(const std::vector< std::vector< CaloTemplate > > &)
Definition: TriggerMenuParser.cc:114
l1t::gtHTT
Definition: GlobalObject.h:23
VtxSmearedParameters_cfi.Phi
Phi
Definition: VtxSmearedParameters_cfi.py:112
CorrelationThreeBodyTemplate::setCond1Index
void setCond1Index(const int &)
Definition: CorrelationThreeBodyTemplate.cc:136
l1t::TriggerMenuParser::parseScales
bool parseScales(std::map< std::string, tmeventsetup::esScale > scaleMap)
parse scales
Definition: TriggerMenuParser.cc:531
MuonTemplate
Definition: MuonTemplate.h:33
l1t::TypeCent4
Definition: GlobalDefinitions.h:74
CorrelationThreeBodyTemplate::CorrelationThreeBodyParameter::minMassCutValue
long long minMassCutValue
Definition: CorrelationThreeBodyTemplate.h:75
l1t::TriggerMenuParser::insertConditionIntoMap
bool insertConditionIntoMap(GlobalCondition &cond, const int chipNr)
Definition: TriggerMenuParser.cc:407
GlobalAlgorithm::algoOutputPin
const int algoOutputPin(const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
get the output pin on the condition chip for the algorithm
Definition: GlobalAlgorithm.cc:95
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minOverlapRemovalPhiCutValue
long long minOverlapRemovalPhiCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:92
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
l1t::TriggerMenuParser::l1tstr2int
int l1tstr2int(const std::string data)
Definition: TriggerMenuParser.cc:516
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CorrelationTemplate::CorrelationParameter::chargeCorrelation
unsigned int chargeCorrelation
Definition: CorrelationTemplate.h:83
l1t::TriggerMenuParser::setGtAlgorithmAliasMap
void setGtAlgorithmAliasMap(const AlgorithmMap &)
Definition: TriggerMenuParser.cc:162
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
cond
Definition: plugin.cc:23
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxOverlapRemovalEtaCutValue
long long maxOverlapRemovalEtaCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:89
l1t::TriggerMenuParser::setVecCorrelationWithOverlapRemovalTemplate
void setVecCorrelationWithOverlapRemovalTemplate(const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > &)
Definition: TriggerMenuParser.cc:138
l1t::gtCentrality1
Definition: GlobalObject.h:37
CorrelationWithOverlapRemovalTemplate::setCond0Category
void setCond0Category(const l1t::GtConditionCategory &)
Definition: CorrelationWithOverlapRemovalTemplate.cc:127
l1t::gtETM
Definition: GlobalObject.h:21
electrons_cff.objType
objType
Definition: electrons_cff.py:520
optionsL1T.menu
menu
Definition: optionsL1T.py:29
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MessageDrop.h
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxOverlapRemovalPhiCutValue
long long maxOverlapRemovalPhiCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:93
l1t::TriggerMenuParser::parseEnergySum
bool parseEnergySum(tmeventsetup::esCondition condEnergySums, unsigned int chipNr=0, const bool corrFlag=false)
parse an "energy sum" condition
Definition: TriggerMenuParser.cc:2056
EnergySumTemplate::print
void print(std::ostream &myCout) const override
print the condition
Definition: EnergySumTemplate.cc:70
l1t::TriggerMenuParser::TriggerMenuParser
TriggerMenuParser()
Definition: TriggerMenuParser.cc:53
l1t::TriggerMenuParser::setGtTriggerMenuDate
void setGtTriggerMenuDate(const std::string &)
Definition: TriggerMenuParser.cc:379
l1t::gtMu
Definition: GlobalObject.h:17
l1t::GlobalScales::ScaleParameters::etaBins
std::vector< std::pair< double, double > > etaBins
Definition: GlobalScales.h:55
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precOverlapRemovalEtaCut
unsigned int precOverlapRemovalEtaCut
Definition: CorrelationWithOverlapRemovalTemplate.h:90
l1t::TriggerMenuParser::setCorEnergySumTemplate
void setCorEnergySumTemplate(const std::vector< std::vector< EnergySumTemplate > > &)
Definition: TriggerMenuParser.cc:153
l1t::Type1s
Definition: GlobalDefinitions.h:51
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
CorrelationTemplate::CorrelationParameter::maxTBPTCutValue
long long maxTBPTCutValue
Definition: CorrelationTemplate.h:79
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter
typedef for correlation parameters
Definition: CorrelationWithOverlapRemovalTemplate.h:65
EnergySumTemplate
Definition: EnergySumTemplate.h:32
l1t::gtAsymmetryEtHF
Definition: GlobalObject.h:34
CorrelationTemplate::CorrelationParameter::minPhiCutValue
long long minPhiCutValue
Definition: CorrelationTemplate.h:66
l1t::gtCentrality6
Definition: GlobalObject.h:42
l1t::TriggerMenuParser::setGtAlgorithmMap
void setGtAlgorithmMap(const AlgorithmMap &)
Definition: TriggerMenuParser.cc:159
CorrelationTemplate::CorrelationParameter::minDRCutValue
long long minDRCutValue
Definition: CorrelationTemplate.h:70
qcdUeDQM_cfi.algorithm
algorithm
Definition: qcdUeDQM_cfi.py:32
l1t::gtMinBiasHFP0
Definition: GlobalObject.h:27
l1t::TypeMinBiasHFP1
Definition: GlobalDefinitions.h:65
createfilelist.int
int
Definition: createfilelist.py:10
dumpRecoGeometry_cfg.Muon
Muon
Definition: dumpRecoGeometry_cfg.py:190
l1t::AlgorithmMap
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
Definition: TriggerMenuFwd.h:32
l1t::GlobalScales::ScaleParameters
typedef for a single object template
Definition: GlobalScales.h:35
l1t::TriggerMenuParser::setGtConditionMap
void setGtConditionMap(const std::vector< ConditionMap > &)
Definition: TriggerMenuParser.cc:90
l1t::TypeTowerCount
Definition: GlobalDefinitions.h:62
l1t::TriggerMenuParser::setGtTriggerMenuAuthor
void setGtTriggerMenuAuthor(const std::string &)
Definition: TriggerMenuParser.cc:381
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
ETT
Definition: L1GtObject.h:36
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::maxPhiCutValue
long long maxPhiCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:72
Quality
pixelTrack::Quality Quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:28
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
CorrelationTemplate
Definition: CorrelationTemplate.h:34
electronAnalyzer_cfi.DeltaR
DeltaR
Definition: electronAnalyzer_cfi.py:33
l1t::CondEnergySum
Definition: GlobalDefinitions.h:97
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CorrelationWithOverlapRemovalTemplate::setCond1Category
void setCond1Category(const l1t::GtConditionCategory &)
Definition: CorrelationWithOverlapRemovalTemplate.cc:131
CorrelationThreeBodyTemplate::CorrelationThreeBodyParameter::precMassCut
unsigned int precMassCut
Definition: CorrelationThreeBodyTemplate.h:77
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
l1t::TriggerMenuParser::setGtAlgorithmImplementation
void setGtAlgorithmImplementation(const std::string &)
Definition: TriggerMenuParser.cc:385
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precPhiCut
unsigned int precPhiCut
Definition: CorrelationWithOverlapRemovalTemplate.h:73
l1t::GlobalScales::ScaleParameters::phiStep
double phiStep
Definition: GlobalScales.h:49
MuonTemplate::CorrelationParameter::chargeCorrelation
unsigned int chargeCorrelation
Definition: MuonTemplate.h:91
CorrelationThreeBodyTemplate::CorrelationThreeBodyParameter::maxMassCutValue
long long maxMassCutValue
Definition: CorrelationThreeBodyTemplate.h:76
CorrelationWithOverlapRemovalTemplate::setCond1Index
void setCond1Index(const int &)
Definition: CorrelationWithOverlapRemovalTemplate.cc:142
l1t::gtETT
Definition: GlobalObject.h:22
l1t::TypeETMHF
Definition: GlobalDefinitions.h:61
l1t::TypeAsymHt
Definition: GlobalDefinitions.h:79
l1t::TriggerMenuParser::setGtTriggerMenuName
void setGtTriggerMenuName(const std::string &)
Definition: TriggerMenuParser.cc:100
l1t::gtCentrality3
Definition: GlobalObject.h:39
l1t::TriggerMenuParser::setGtTriggerMenuInterfaceAuthor
void setGtTriggerMenuInterfaceAuthor(const std::string &)
Definition: TriggerMenuParser.cc:371
l1t::TypeETTem
Definition: GlobalDefinitions.h:67
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minMassCutValue
long long minMassCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:80
CorrelationThreeBodyTemplate::setCond2Index
void setCond2Index(const int &)
Definition: CorrelationThreeBodyTemplate.cc:137
l1t::CItAlgo
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Definition: TriggerMenuFwd.h:39
l1t::Type2s
Definition: GlobalDefinitions.h:52
heppy_batch.val
val
Definition: heppy_batch.py:351
l1t::GlobalScales::ScaleParameters::etBins
std::vector< std::pair< double, double > > etBins
Definition: GlobalScales.h:39
l1t::TypeETT
Definition: GlobalDefinitions.h:58
GlobalAlgorithm::setAlgoAlias
void setAlgoAlias(const std::string &algoAliasValue)
Definition: GlobalAlgorithm.h:59
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::minEtaCutValue
long long minEtaCutValue
Definition: CorrelationWithOverlapRemovalTemplate.h:67
TriggerMenuParser.h
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precOverlapRemovalPhiCut
unsigned int precOverlapRemovalPhiCut
Definition: CorrelationWithOverlapRemovalTemplate.h:94
l1t::TriggerMenuParser::parsePt_LUTS
void parsePt_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string lutpfx, std::string obj1, unsigned int prec)
Definition: TriggerMenuParser.cc:859
l1t::TypeHTM
Definition: GlobalDefinitions.h:60
CorrelationTemplate::CorrelationParameter::maxDRCutValue
long long maxDRCutValue
Definition: CorrelationTemplate.h:71
GlobalAlgorithm::print
virtual void print(std::ostream &myCout) const
print condition
Definition: GlobalAlgorithm.cc:106
l1t::TriggerMenuParser::setGtOrderConditionChip
void setGtOrderConditionChip(const std::vector< int > &)
Definition: TriggerMenuParser.cc:80
T
long double T
Definition: Basic3DVectorLD.h:48
l1t::TriggerMenuParser::insertAlgorithmIntoMap
bool insertAlgorithmIntoMap(const GlobalAlgorithm &alg)
insert an algorithm into algorithm map
Definition: TriggerMenuParser.cc:425
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CorrelationThreeBodyTemplate::setCond1Category
void setCond1Category(const l1t::GtConditionCategory &)
Definition: CorrelationThreeBodyTemplate.cc:127
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::precOverlapRemovalDRCut
unsigned int precOverlapRemovalDRCut
Definition: CorrelationWithOverlapRemovalTemplate.h:98
l1t::gtTau
Definition: GlobalObject.h:20
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
l1t::TypeExternal
Definition: GlobalDefinitions.h:68
l1t::TriggerMenuParser::setGtNumberConditionChips
void setGtNumberConditionChips(const unsigned int &)
Definition: TriggerMenuParser.cc:69
CorrelationTemplate::setCond0Category
void setCond0Category(const l1t::GtConditionCategory &)
Definition: CorrelationTemplate.cc:113
GlobalCondition::setObjectType
void setObjectType(const std::vector< l1t::GlobalObject > &objType)
Definition: GlobalCondition.h:68
PixelTestBeamValidation_cfi.Charge
Charge
Definition: PixelTestBeamValidation_cfi.py:91
l1t::TriggerMenuParser::parseCalMuEta_LUTS
void parseCalMuEta_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2)
Definition: TriggerMenuParser.cc:805
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
CaloTemplate::CorrelationParameter
typedef for correlation parameters
Definition: CaloTemplate.h:78
l1t::TypeCent6
Definition: GlobalDefinitions.h:76
l1t::CondMuon
Definition: GlobalDefinitions.h:95
CorrelationTemplate::CorrelationParameter::precEtaCut
unsigned int precEtaCut
Definition: CorrelationTemplate.h:64
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
l1t::gtMinBiasHFM0
Definition: GlobalObject.h:28
l1t::TriggerMenuParser::parseUpt_LUTS
void parseUpt_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string lutpfx, std::string obj1, unsigned int prec)
Definition: TriggerMenuParser.cc:882
l1t::GlobalScales::ScaleParameters::uptMin
double uptMin
Definition: GlobalScales.h:42
l1t::TypeAsymHtHF
Definition: GlobalDefinitions.h:81
l1t::TriggerMenuParser::parseCalo
bool parseCalo(tmeventsetup::esCondition condCalo, unsigned int chipNr=0, const bool corrFlag=false)
parse a calorimeter condition
Definition: TriggerMenuParser.cc:1533
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
l1t::Type4s
Definition: GlobalDefinitions.h:56
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
MuonTemplate::CorrelationParameter
Definition: MuonTemplate.h:90
l1t::GlobalScales::ScaleParameters::phiBins
std::vector< std::pair< double, double > > phiBins
Definition: GlobalScales.h:50
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
l1t::TypeMinBiasHFM0
Definition: GlobalDefinitions.h:64
CorrelationTemplate::CorrelationParameter::minEtaCutValue
long long minEtaCutValue
Definition: CorrelationTemplate.h:62
ExternalTemplate::setExternalChannel
void setExternalChannel(unsigned int extCh)
set functions
Definition: ExternalTemplate.h:58
l1t::TriggerMenuParser::parseEnergySumCorr
bool parseEnergySumCorr(const tmeventsetup::esObject *corrESum, unsigned int chipNr=0)
Definition: TriggerMenuParser.cc:2294
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
GlobalCondition
Definition: GlobalCondition.h:34
GlobalAlgorithm::algoChipNumber
const int algoChipNumber() const
get / set algorithm bit number
Definition: GlobalAlgorithm.h:77
CorrelationWithOverlapRemovalTemplate
Definition: CorrelationWithOverlapRemovalTemplate.h:34
l1t::TypeCent0
Definition: GlobalDefinitions.h:70
l1t::TriggerMenuParser::parseMuonCorr
bool parseMuonCorr(const tmeventsetup::esObject *condMu, unsigned int chipNr=0)
Definition: TriggerMenuParser.cc:1293
CorrelationTemplate::setCorrelationParameter
void setCorrelationParameter(const CorrelationParameter &corrParameter)
Definition: CorrelationTemplate.cc:123
l1t::TriggerMenuParser::setGtTriggerMenuImplementation
void setGtTriggerMenuImplementation(const unsigned long &)
Definition: TriggerMenuParser.cc:102
CorrelationTemplate::CorrelationParameter::maxMassCutValue
long long maxMassCutValue
Definition: CorrelationTemplate.h:75
l1t::gtCentrality2
Definition: GlobalObject.h:38
l1t::TriggerMenuParser::parseExternal
bool parseExternal(tmeventsetup::esCondition condExt, unsigned int chipNr=0)
Definition: TriggerMenuParser.cc:2465
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
l1t::TriggerMenuParser::parsePhi_Trig_LUTS
void parsePhi_Trig_LUTS(const std::map< std::string, tmeventsetup::esScale > &scaleMap, const std::string &obj, TrigFunc_t func, unsigned int prec)
Definition: TriggerMenuParser.cc:974
cuy.ii
ii
Definition: cuy.py:590
l1t::GlobalScales::ScaleParameters::etMax
double etMax
Definition: GlobalScales.h:37
CorrelationWithOverlapRemovalTemplate::CorrelationWithOverlapRemovalParameter::chargeCorrelation
unsigned int chargeCorrelation
Definition: CorrelationWithOverlapRemovalTemplate.h:101
GlobalCondition::setCondGEq
void setCondGEq(const bool &cGEq)
Definition: GlobalCondition.h:73
l1t::gtAsymmetryHtHF
Definition: GlobalObject.h:35
l1t::TriggerMenuParser::parseCorrelation
bool parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr=0)
parse a correlation condition
Definition: TriggerMenuParser.cc:2540
CorrelationTemplate::CorrelationParameter
typedef for correlation parameters
Definition: CorrelationTemplate.h:60
l1t::TriggerMenuParser::parseAlgorithm
bool parseAlgorithm(tmeventsetup::esAlgorithm algorithm, unsigned int chipNr=0)
parse all algorithms
Definition: TriggerMenuParser.cc:3273
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
l1t::TriggerMenuParser::clearMaps
void clearMaps()
Definition: TriggerMenuParser.cc:391
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316