28 #include <boost/cstdint.hpp>
35 #include "tmEventSetup/tmEventSetup.hh"
36 #include "tmEventSetup/esTriggerMenu.hh"
37 #include "tmEventSetup/esAlgorithm.hh"
38 #include "tmEventSetup/esCondition.hh"
39 #include "tmEventSetup/esObject.hh"
40 #include "tmEventSetup/esCut.hh"
41 #include "tmEventSetup/esScale.hh"
42 #include "tmGrammar/Algorithm.hh"
48 m_triggerMenuInterface(
"NULL"),
49 m_triggerMenuName(
"NULL"), m_triggerMenuImplementation(0x0), m_scaleDbKey(
"NULL")
68 const unsigned int& numberConditionChipsValue) {
70 m_numberConditionChips = numberConditionChipsValue;
77 m_pinsOnConditionChip = pinsOnConditionChipValue;
84 const std::vector<int>& orderConditionChipValue) {
86 m_orderConditionChip = orderConditionChipValue;
92 const unsigned int& numberPhysTriggersValue) {
94 m_numberPhysTriggers = numberPhysTriggersValue;
101 m_conditionMap = condMap;
106 m_triggerMenuInterface = menuInterface;
111 m_triggerMenuUUID =
uuid;
115 m_triggerMenuName = menuName;
119 m_triggerMenuImplementation = menuImplementation;
124 m_scaleDbKey = scaleKey;
129 const std::vector<std::vector<MuonTemplate> >& vecMuonTempl) {
131 m_vecMuonTemplate = vecMuonTempl;
135 const std::vector<std::vector<CaloTemplate> >& vecCaloTempl) {
137 m_vecCaloTemplate = vecCaloTempl;
141 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
143 m_vecEnergySumTemplate = vecEnergySumTempl;
149 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
151 m_vecExternalTemplate = vecExternalTempl;
156 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
158 m_vecCorrelationTemplate = vecCorrelationTempl;
164 const std::vector<std::vector<MuonTemplate> >& corMuonTempl) {
166 m_corMuonTemplate = corMuonTempl;
170 const std::vector<std::vector<CaloTemplate> >& corCaloTempl) {
172 m_corCaloTemplate = corCaloTempl;
176 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
178 m_corEnergySumTemplate = corEnergySumTempl;
186 m_algorithmMap = algoMap;
191 m_algorithmAliasMap = algoMap;
198 using namespace tmeventsetup;
199 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
200 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
202 std::map<std::string, unsigned int> extBitMap;
205 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin();
206 cit != condMap.end(); cit++)
208 const esCondition& condition = cit->second;
209 if(condition.getType() == esConditionType::Externals ) {
212 const std::vector<esObject>& objects = condition.getObjects();
213 for (
size_t jj = 0;
jj < objects.size();
jj++) {
215 const esObject
object = objects.at(
jj);
216 if(
object.getType() == esObjectType::EXT) {
218 unsigned int channelID =
object.getExternalChannelId();
244 m_conditionMap.resize(m_numberConditionChips);
246 m_vecMuonTemplate.resize(m_numberConditionChips);
247 m_vecCaloTemplate.resize(m_numberConditionChips);
248 m_vecEnergySumTemplate.resize(m_numberConditionChips);
249 m_vecExternalTemplate.resize(m_numberConditionChips);
251 m_vecCorrelationTemplate.resize(m_numberConditionChips);
252 m_corMuonTemplate.resize(m_numberConditionChips);
253 m_corCaloTemplate.resize(m_numberConditionChips);
254 m_corEnergySumTemplate.resize(m_numberConditionChips);
256 using namespace tmeventsetup;
257 using namespace Algorithm;
259 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
262 m_triggerMenuDescription =
menu->getComment();
263 m_triggerMenuDate =
menu->getDatetime();
264 m_triggerMenuImplementation = ( getMmHashN(
menu->getFirmwareUuid()) & 0xFFFFFFFF);
265 m_triggerMenuName =
menu->getName();
266 m_triggerMenuInterface =
menu->getVersion();
267 m_triggerMenuUUID = ( getMmHashN(
menu->getName()) & 0xFFFFFFFF);
269 const std::map<std::string, esAlgorithm>& algoMap =
menu->getAlgorithmMap();
270 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
271 const std::map<std::string, esScale>& scaleMap =
menu->getScaleMap();
274 m_gtScales.setScalesName(
menu->getScaleSetName() );
275 parseScales(scaleMap);
279 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin();
280 cit != algoMap.end(); cit++)
286 const esAlgorithm&
algo = cit->second;
289 parseAlgorithm(algo,chipNr);
292 const std::vector<std::string>& rpn_vec = algo.getRpnVector();
293 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++)
296 if (isGate(token))
continue;
298 const esCondition& condition = condMap.find(token)->second;
302 if ((m_conditionMap[chipNr]).
count(condition.getName()) == 0) {
305 if(condition.getType() == esConditionType::SingleEgamma ||
306 condition.getType() == esConditionType::DoubleEgamma ||
307 condition.getType() == esConditionType::TripleEgamma ||
308 condition.getType() == esConditionType::QuadEgamma ||
309 condition.getType() == esConditionType::SingleTau ||
310 condition.getType() == esConditionType::DoubleTau ||
311 condition.getType() == esConditionType::TripleTau ||
312 condition.getType() == esConditionType::QuadTau ||
313 condition.getType() == esConditionType::SingleJet ||
314 condition.getType() == esConditionType::DoubleJet ||
315 condition.getType() == esConditionType::TripleJet ||
316 condition.getType() == esConditionType::QuadJet )
318 parseCalo(condition,chipNr,
false);
321 }
else if(condition.getType() == esConditionType::TotalEt ||
322 condition.getType() == esConditionType::TotalHt ||
323 condition.getType() == esConditionType::MissingEt ||
324 condition.getType() == esConditionType::MissingHt ||
326 condition.getType() == esConditionType::MinBiasHFP0 ||
327 condition.getType() == esConditionType::MinBiasHFM0 ||
328 condition.getType() == esConditionType::MinBiasHFP1 ||
329 condition.getType() == esConditionType::MinBiasHFM1 )
331 parseEnergySum(condition,chipNr,
false);
336 condition.getType() == esConditionType::TripleMuon ||
337 condition.getType() == esConditionType::QuadMuon )
339 parseMuon(condition,chipNr,
false);
343 }
else if(condition.getType() == esConditionType::MuonMuonCorrelation ||
344 condition.getType() == esConditionType::MuonEsumCorrelation ||
345 condition.getType() == esConditionType::CaloMuonCorrelation ||
346 condition.getType() == esConditionType::CaloCaloCorrelation ||
347 condition.getType() == esConditionType::CaloEsumCorrelation ||
350 parseCorrelation(condition,chipNr);
353 }
else if(condition.getType() == esConditionType::Externals )
355 parseExternal(condition,chipNr);
374 m_triggerMenuInterfaceDate = val;
380 m_triggerMenuInterfaceAuthor = val;
386 m_triggerMenuInterfaceDescription = val;
393 m_triggerMenuDate = val;
399 m_triggerMenuAuthor = val;
405 m_triggerMenuDescription = val;
411 m_algorithmImplementation = val;
425 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip
426 != m_conditionMap.end(); itCondOnChip++) {
430 itCondOnChip->clear();
435 m_algorithmMap.clear();
445 <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." ;
448 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
449 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName
450 <<
" already exists - not inserted!" << std::endl;
454 (m_conditionMap[chipNr])[cName] = &cond;
456 <<
" OK - condition inserted!"
473 if (m_algorithmMap.count(algName) != 0) {
474 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
475 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
479 if (m_algorithmAliasMap.count(algAlias) != 0) {
480 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
481 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
487 if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberPhysTriggers))) {
488 LogTrace(
"TriggerMenuParser") <<
" Bit number " << bitNumber
489 <<
" outside allowed range [0, " << m_numberPhysTriggers
490 <<
") - algorithm not inserted!" << std::endl;
495 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
496 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed "
497 << m_numberPhysTriggers <<
" algorithms in the algorithm map - not inserted!"
504 int chipNr = alg.
algoChipNumber(static_cast<int>(m_numberConditionChips),
505 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
507 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
508 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr
509 <<
" outside allowed range [0, " << m_numberConditionChips
510 <<
") - algorithm not inserted!" << std::endl;
515 int outputPin = alg.
algoOutputPin(static_cast<int>(m_numberConditionChips),
516 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
518 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
519 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
520 <<
" outside allowed range [0, " << m_pinsOnConditionChip
521 <<
"] - algorithm not inserted!" << std::endl;
526 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
528 int iPin = (itAlgo->second).algoOutputPin( static_cast<int>(m_numberConditionChips),
529 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
531 int iChip = (itAlgo->second).algoChipNumber(static_cast<int>(m_numberConditionChips),
532 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
534 if ( (outputPin == iPin) && (chipNr == iChip)) {
535 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
536 <<
" is the same as for algorithm " << iName
537 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!"
545 m_algorithmMap[algName] = alg;
546 m_algorithmAliasMap[algAlias] = alg;
558 std::stringstream
ss;
563 std::stringstream
ss;
580 using namespace tmeventsetup;
594 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin();
595 cit != scaleMap.end(); cit++)
597 const esScale&
scale = cit->second;
601 else if (scale.getObjectType() == esObjectType::Egamma) scaleParam = &egScales;
610 if(scaleParam != 0) {
611 switch(scale.getScaleType()) {
612 case esScaleType::EtScale: {
613 scaleParam->
etMin = scale.getMinimum();
614 scaleParam->
etMax = scale.getMaximum();
615 scaleParam->
etStep = scale.getStep();
618 const std::vector<esBin> binsV = scale.getBins();
619 for(
unsigned int i=0;
i<binsV.size();
i++) {
620 const esBin&
bin = binsV.at(
i);
621 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
622 scaleParam->
etBins.push_back(binLimits);
641 case esScaleType::EtaScale: {
642 scaleParam->
etaMin = scale.getMinimum();
643 scaleParam->
etaMax = scale.getMaximum();
644 scaleParam->
etaStep = scale.getStep();
647 const std::vector<esBin> binsV = scale.getBins();
648 scaleParam->
etaBins.resize(
pow(2,scale.getNbits()));
649 for(
unsigned int i=0;
i<binsV.size();
i++) {
650 const esBin&
bin = binsV.at(
i);
651 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
652 scaleParam->
etaBins.at(bin.hw_index) = binLimits;
656 case esScaleType::PhiScale: {
657 scaleParam->
phiMin = scale.getMinimum();
658 scaleParam->
phiMax = scale.getMaximum();
659 scaleParam->
phiStep = scale.getStep();
662 const std::vector<esBin> binsV = scale.getBins();
663 scaleParam->
phiBins.resize(
pow(2,scale.getNbits()));
664 for(
unsigned int i=0;
i<binsV.size();
i++) {
665 const esBin&
bin = binsV.at(
i);
666 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
667 scaleParam->
phiBins.at(bin.hw_index) = binLimits;
679 m_gtScales.setMuonScales(muScales);
680 m_gtScales.setEGScales(egScales);
681 m_gtScales.setTauScales(tauScales);
682 m_gtScales.setJetScales(jetScales);
683 m_gtScales.setETTScales(ettScales);
684 m_gtScales.setETMScales(etmScales);
685 m_gtScales.setHTTScales(httScales);
686 m_gtScales.setHTMScales(htmScales);
691 bool hasPrecision =
false;
692 std::map<std::string, unsigned int> precisions;
693 getPrecisions(precisions, scaleMap);
694 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++)
706 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
707 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
708 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
712 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
713 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
714 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
715 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
716 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
720 parsePt_LUTS(scaleMap,
"EG", precisions[
"PRECISION-EG-MU-MassPt"] );
721 parsePt_LUTS(scaleMap,
"MU", precisions[
"PRECISION-EG-MU-MassPt"] );
722 parsePt_LUTS(scaleMap,
"JET", precisions[
"PRECISION-EG-JET-MassPt"] );
723 parsePt_LUTS(scaleMap,
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"] );
727 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
728 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
729 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
730 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
732 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
733 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
734 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
736 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
737 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
739 parseDeltaEta_Cosh_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
744 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
745 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
746 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
747 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETM",precisions[
"PRECISION-EG-ETM-Delta"],precisions[
"PRECISION-EG-ETM-Math"]);
748 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"HTM",precisions[
"PRECISION-EG-HTM-Delta"],precisions[
"PRECISION-EG-HTM-Math"]);
749 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
751 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
752 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
753 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETM",precisions[
"PRECISION-JET-ETM-Delta"],precisions[
"PRECISION-JET-ETM-Math"]);
754 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"HTM",precisions[
"PRECISION-JET-HTM-Delta"],precisions[
"PRECISION-JET-HTM-Math"]);
755 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
757 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
758 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETM",precisions[
"PRECISION-TAU-ETM-Delta"],precisions[
"PRECISION-TAU-ETM-Math"]);
759 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"HTM",precisions[
"PRECISION-TAU-HTM-Delta"],precisions[
"PRECISION-TAU-HTM-Math"]);
760 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
762 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETM",precisions[
"PRECISION-MU-ETM-Delta"],precisions[
"PRECISION-MU-ETM-Math"]);
763 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"HTM",precisions[
"PRECISION-MU-HTM-Delta"],precisions[
"PRECISION-MU-HTM-Math"]);
764 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
781 using namespace tmeventsetup;
788 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
789 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
791 std::vector<long long> lut_cal_2_mu_eta;
792 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
797 m_gtScales.setLUT_CalMuEta(lutName,lut_cal_2_mu_eta);
805 using namespace tmeventsetup;
812 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
813 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
815 std::vector<long long> lut_cal_2_mu_phi;
816 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
821 m_gtScales.setLUT_CalMuPhi(lutName,lut_cal_2_mu_phi);
829 using namespace tmeventsetup;
834 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
836 std::vector<long long> lut_pt;
837 getLut(lut_pt, scale1, prec);
838 m_gtScales.setLUT_Pt(scLabel1,lut_pt,prec);
846 using namespace tmeventsetup;
853 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
854 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
855 std::vector<double> val_delta_eta;
856 std::vector<long long> lut_delta_eta;
857 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
858 setLut(lut_delta_eta, val_delta_eta, prec1);
862 m_gtScales.setLUT_DeltaEta(lutName,lut_delta_eta,prec1);
865 std::vector<long long> lut_cosh;
866 applyCosh(val_delta_eta,
n);
867 setLut(lut_cosh, val_delta_eta, prec2);
868 m_gtScales.setLUT_Cosh(lutName,lut_cosh,prec2);
875 using namespace tmeventsetup;
882 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
883 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
884 std::vector<double> val_delta_phi;
885 std::vector<long long> lut_delta_phi;
886 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
887 setLut(lut_delta_phi, val_delta_phi, prec1);
891 m_gtScales.setLUT_DeltaPhi(lutName,lut_delta_phi,prec1);
894 std::vector<long long> lut_cos;
895 applyCos(val_delta_phi,
n);
896 setLut(lut_cos, val_delta_phi, prec2);
897 m_gtScales.setLUT_Cos(lutName,lut_cos,prec2);
913 unsigned int chipNr,
const bool corrFlag) {
915 using namespace tmeventsetup;
936 }
else if (condMu.getType() == esConditionType::TripleMuon) {
940 }
else if (condMu.getType() == esConditionType::QuadMuon) {
945 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition ("
946 <<
type <<
")" << std::endl;
951 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type
952 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
957 <<
"\n ****************************************** "
959 <<
"\n condition = " << condition
960 <<
"\n particle = " << particle
961 <<
"\n type = " <<
type
962 <<
"\n name = " <<
name
970 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
976 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
977 tmpValues.reserve( nrObj );
979 if(
int(condMu.getObjects().size())!=nrObj ){
980 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
981 <<
"condMu.getObjects().size() = "
982 << condMu.getObjects().size()
989 unsigned int chargeCorrelation = 1;
990 const std::vector<esCut>&
cuts = condMu.getCuts();
994 if(cut.getCutType() == esCutType::ChargeCorrelation) {
995 if( cut.getData()==
"ls" ) chargeCorrelation = 2;
996 else if( cut.getData()==
"os" ) chargeCorrelation = 4;
997 else chargeCorrelation = 1;
1002 corrParameter.chargeCorrelation = chargeCorrelation;
1013 const std::vector<esObject>& objects = condMu.getObjects();
1014 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1016 const esObject
object = objects.at(
jj);
1020 relativeBx =
object.getBxOffset();
1023 int upperThresholdInd = -1;
1024 int lowerThresholdInd = 0;
1026 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1028 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1029 int isolationLUT = 0xF;
1031 int qualityLUT = 0xFFFF;
1033 const std::vector<esCut>&
cuts =
object.getCuts();
1034 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1036 const esCut
cut = cuts.at(
kk);
1038 switch(cut.getCutType()){
1039 case esCutType::Threshold:
1040 lowerThresholdInd = cut.getMinimum().index;
1041 upperThresholdInd = cut.getMaximum().index;
1047 etaWindow1Lower = cut.getMinimum().index;
1048 etaWindow1Upper = cut.getMaximum().index;
1049 }
else if(cntEta == 1) {
1050 etaWindow2Lower = cut.getMinimum().index;
1051 etaWindow2Upper = cut.getMaximum().index;
1053 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition ("
1054 << particle <<
")" << std::endl;
1064 phiWindow1Lower = cut.getMinimum().index;
1065 phiWindow1Upper = cut.getMaximum().index;
1066 }
else if(cntPhi == 1) {
1067 phiWindow2Lower = cut.getMinimum().index;
1068 phiWindow2Upper = cut.getMaximum().index;
1070 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition ("
1071 << particle <<
")" << std::endl;
1078 case esCutType::Charge:
1079 if( cut.getData()==
"positive" ) charge = 0;
1080 else if( cut.getData()==
"negative" ) charge = 1;
1085 qualityLUT = l1tstr2int(cut.getData());
1088 case esCutType::Isolation: {
1090 isolationLUT = l1tstr2int(cut.getData());
1101 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1102 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1104 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1105 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1106 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1107 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1109 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1110 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1111 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1112 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1115 objParameter[cnt].enableMip =
false;
1116 objParameter[cnt].enableIso =
false;
1117 objParameter[cnt].requestIso =
false;
1119 objParameter[cnt].charge =
charge;
1120 objParameter[cnt].qualityLUT = qualityLUT;
1121 objParameter[cnt].isolationLUT = isolationLUT;
1129 std::vector<GlobalObject> objType(nrObj,
gtMu);
1145 std::ostringstream myCoutStream;
1146 muonCond.
print(myCoutStream);
1147 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1151 if ( !insertConditionIntoMap(muonCond, chipNr)) {
1153 <<
" Error: duplicate condition (" <<
name <<
")"
1158 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1161 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1164 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1165 (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1176 unsigned int chipNr) {
1180 using namespace tmeventsetup;
1194 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type
1195 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1200 <<
"\n ****************************************** "
1202 <<
"\n condition = " << condition
1203 <<
"\n particle = " << particle
1204 <<
"\n type = " <<
type
1205 <<
"\n name = " <<
name
1213 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1219 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1220 tmpValues.reserve( nrObj );
1226 unsigned int chargeCorrelation = 0;
1227 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1228 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1229 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1232 corrParameter.chargeCorrelation = chargeCorrelation;
1245 relativeBx = corrMu->getBxOffset();
1248 int upperThresholdInd = -1;
1249 int lowerThresholdInd = 0;
1251 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1253 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1254 int isolationLUT = 0xF;
1256 int qualityLUT = 0xFFFF;
1258 const std::vector<esCut>&
cuts = corrMu->getCuts();
1263 switch(cut.getCutType()){
1264 case esCutType::Threshold:
1265 lowerThresholdInd = cut.getMinimum().index;
1266 upperThresholdInd = cut.getMaximum().index;
1272 etaWindow1Lower = cut.getMinimum().index;
1273 etaWindow1Upper = cut.getMaximum().index;
1274 }
else if(cntEta == 1) {
1275 etaWindow2Lower = cut.getMinimum().index;
1276 etaWindow2Upper = cut.getMaximum().index;
1278 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition ("
1279 << particle <<
")" << std::endl;
1289 phiWindow1Lower = cut.getMinimum().index;
1290 phiWindow1Upper = cut.getMaximum().index;
1291 }
else if(cntPhi == 1) {
1292 phiWindow2Lower = cut.getMinimum().index;
1293 phiWindow2Upper = cut.getMaximum().index;
1295 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition ("
1296 << particle <<
")" << std::endl;
1303 case esCutType::Charge:
1304 if( cut.getData()==
"positive" )
charge = 0;
1305 else if( cut.getData()==
"negative" )
charge = 1;
1310 qualityLUT = l1tstr2int(cut.getData());
1313 case esCutType::Isolation: {
1315 isolationLUT = l1tstr2int(cut.getData());
1326 objParameter[0].ptHighThreshold = upperThresholdInd;
1327 objParameter[0].ptLowThreshold = lowerThresholdInd;
1329 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1330 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1331 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1332 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1334 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1335 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1336 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1337 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1340 objParameter[0].enableMip =
false;
1341 objParameter[0].enableIso =
false;
1342 objParameter[0].requestIso =
false;
1344 objParameter[0].charge =
charge;
1345 objParameter[0].qualityLUT = qualityLUT;
1346 objParameter[0].isolationLUT = isolationLUT;
1350 std::vector<GlobalObject> objType(nrObj,
gtMu);
1363 std::ostringstream myCoutStream;
1364 muonCond.
print(myCoutStream);
1365 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1381 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1401 unsigned int chipNr,
const bool corrFlag) {
1405 using namespace tmeventsetup;
1415 <<
"\n ****************************************** "
1416 <<
"\n (in parseCalo) "
1417 <<
"\n condition = " << condition
1418 <<
"\n particle = " << particle
1419 <<
"\n type = " <<
type
1420 <<
"\n name = " <<
name
1431 if (condCalo.getType() == esConditionType::SingleEgamma) {
1436 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1441 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1446 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1451 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1452 caloObjType =
gtJet;
1456 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1457 caloObjType =
gtJet;
1461 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1462 caloObjType =
gtJet;
1466 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1467 caloObjType =
gtJet;
1471 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1472 caloObjType =
gtTau;
1476 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1477 caloObjType =
gtTau;
1481 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1482 caloObjType =
gtTau;
1486 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1487 caloObjType =
gtTau;
1492 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition ("
1493 << particle <<
")" << std::endl;
1500 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type
1501 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1508 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1514 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1515 tmpValues.reserve( nrObj );
1518 if(
int(condCalo.getObjects().size())!=nrObj ){
1519 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1520 <<
"condCalo.getObjects().size() = "
1521 << condCalo.getObjects().size()
1537 const std::vector<esObject>& objects = condCalo.getObjects();
1538 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1540 const esObject
object = objects.at(
jj);
1544 relativeBx =
object.getBxOffset();
1547 int upperThresholdInd = -1;
1548 int lowerThresholdInd = 0;
1550 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1552 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1553 int isolationLUT = 0xF;
1554 int qualityLUT = 0xF;
1557 const std::vector<esCut>&
cuts =
object.getCuts();
1558 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1560 const esCut
cut = cuts.at(
kk);
1562 switch(cut.getCutType()){
1563 case esCutType::Threshold:
1564 lowerThresholdInd = cut.getMinimum().index;
1565 upperThresholdInd = cut.getMaximum().index;
1570 etaWindow1Lower = cut.getMinimum().index;
1571 etaWindow1Upper = cut.getMaximum().index;
1572 }
else if(cntEta == 1) {
1573 etaWindow2Lower = cut.getMinimum().index;
1574 etaWindow2Upper = cut.getMaximum().index;
1576 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition ("
1577 << particle <<
")" << std::endl;
1587 phiWindow1Lower = cut.getMinimum().index;
1588 phiWindow1Upper = cut.getMaximum().index;
1589 }
else if(cntPhi == 1) {
1590 phiWindow2Lower = cut.getMinimum().index;
1591 phiWindow2Upper = cut.getMaximum().index;
1593 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition ("
1594 << particle <<
")" << std::endl;
1601 case esCutType::Charge: {
1603 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition ("
1604 << particle <<
")" << std::endl;
1610 qualityLUT = l1tstr2int(cut.getData());
1613 case esCutType::Isolation: {
1615 isolationLUT = l1tstr2int(cut.getData());
1625 objParameter[cnt].etHighThreshold = upperThresholdInd;
1626 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1627 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1628 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1629 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1630 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1631 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1632 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1633 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1634 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1635 objParameter[cnt].isolationLUT = isolationLUT;
1636 objParameter[cnt].qualityLUT = qualityLUT;
1640 <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = "
1641 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
1642 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x"
1643 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1644 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
1645 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1646 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
1647 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1648 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
1649 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1650 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x"
1651 << objParameter[cnt].isolationLUT
1652 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x"
1653 << objParameter[cnt].qualityLUT <<
std::dec
1662 std::vector<GlobalObject> objType(nrObj, caloObjType);
1684 std::ostringstream myCoutStream;
1685 caloCond.
print(myCoutStream);
1686 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1692 if ( !insertConditionIntoMap(caloCond, chipNr)) {
1695 <<
" Error: duplicate condition (" <<
name <<
")"
1703 (m_corCaloTemplate[chipNr]).push_back(caloCond);
1706 (m_vecCaloTemplate[chipNr]).push_back(caloCond);
1730 unsigned int chipNr) {
1734 using namespace tmeventsetup;
1744 <<
"\n ****************************************** "
1745 <<
"\n (in parseCalo) "
1746 <<
"\n condition = " << condition
1747 <<
"\n particle = " << particle
1748 <<
"\n type = " <<
type
1749 <<
"\n name = " <<
name
1761 if (corrCalo->getType() == esObjectType::Egamma) {
1764 caloObjType =
gtJet;
1766 caloObjType =
gtTau;
1768 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition ("
1769 << particle <<
")" << std::endl;
1777 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type
1778 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1785 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1791 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1792 tmpValues.reserve( nrObj );
1804 relativeBx = corrCalo->getBxOffset();
1807 int upperThresholdInd = -1;
1808 int lowerThresholdInd = 0;
1810 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1812 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1813 int isolationLUT = 0xF;
1814 int qualityLUT = 0xF;
1817 const std::vector<esCut>&
cuts = corrCalo->getCuts();
1822 switch(cut.getCutType()){
1823 case esCutType::Threshold:
1824 lowerThresholdInd = cut.getMinimum().index;
1825 upperThresholdInd = cut.getMaximum().index;
1830 etaWindow1Lower = cut.getMinimum().index;
1831 etaWindow1Upper = cut.getMaximum().index;
1832 }
else if(cntEta == 1) {
1833 etaWindow2Lower = cut.getMinimum().index;
1834 etaWindow2Upper = cut.getMaximum().index;
1836 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition ("
1837 << particle <<
")" << std::endl;
1847 phiWindow1Lower = cut.getMinimum().index;
1848 phiWindow1Upper = cut.getMaximum().index;
1849 }
else if(cntPhi == 1) {
1850 phiWindow2Lower = cut.getMinimum().index;
1851 phiWindow2Upper = cut.getMaximum().index;
1853 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition ("
1854 << particle <<
")" << std::endl;
1861 case esCutType::Charge: {
1863 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition ("
1864 << particle <<
")" << std::endl;
1870 qualityLUT = l1tstr2int(cut.getData());
1873 case esCutType::Isolation: {
1875 isolationLUT = l1tstr2int(cut.getData());
1885 objParameter[0].etLowThreshold = lowerThresholdInd;
1886 objParameter[0].etHighThreshold = upperThresholdInd;
1887 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1888 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1889 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1890 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1891 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1892 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1893 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1894 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1895 objParameter[0].isolationLUT = isolationLUT;
1896 objParameter[0].qualityLUT = qualityLUT;
1900 <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " <<
" = "
1901 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold
1902 <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x"
1903 << objParameter[0].etaWindow1Lower <<
" / 0x" << objParameter[0].etaWindow1Upper
1904 <<
"\n etaWindowVeto Lower / Upper for calo object " <<
" = 0x"
1905 << objParameter[0].etaWindow2Lower <<
" / 0x" << objParameter[0].etaWindow2Upper
1906 <<
"\n phiWindow Lower / Upper for calo object " <<
" = 0x"
1907 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
1908 <<
"\n phiWindowVeto Lower / Upper for calo object " <<
" = 0x"
1909 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
1910 <<
"\n Isolation LUT for calo object " <<
" = 0x"
1911 << objParameter[0].isolationLUT
1912 <<
"\n Quality LUT for calo object " <<
" = 0x"
1913 << objParameter[0].qualityLUT <<
std::dec
1921 std::vector<GlobalObject> objType(nrObj, caloObjType);
1943 std::ostringstream myCoutStream;
1944 caloCond.
print(myCoutStream);
1945 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1963 (m_corCaloTemplate[chipNr]).push_back(caloCond);
1983 unsigned int chipNr,
const bool corrFlag) {
1987 using namespace tmeventsetup;
1996 <<
"\n ****************************************** "
1997 <<
"\n (in parseEnergySum) "
1998 <<
"\n condition = " << condition
1999 <<
"\n type = " <<
type
2000 <<
"\n name = " <<
name
2009 if( condEnergySum.getType() == esConditionType::MissingEt ){
2013 else if( condEnergySum.getType() == esConditionType::TotalEt ){
2017 else if( condEnergySum.getType() == esConditionType::TotalHt ){
2021 else if( condEnergySum.getType() == esConditionType::MissingHt ){
2029 else if( condEnergySum.getType() == esConditionType::MinBiasHFP0 ){
2033 else if( condEnergySum.getType() == esConditionType::MinBiasHFM0 ){
2037 else if( condEnergySum.getType() == esConditionType::MinBiasHFP1 ){
2041 else if( condEnergySum.getType() == esConditionType::MinBiasHFM1 ){
2047 <<
"Wrong type for energy-sum condition (" <<
type
2048 <<
")" << std::endl;
2062 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2074 const std::vector<esObject>& objects = condEnergySum.getObjects();
2075 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2077 const esObject
object = objects.at(
jj);
2081 relativeBx =
object.getBxOffset();
2084 int lowerThresholdInd = 0;
2085 int upperThresholdInd = -1;
2087 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2090 const std::vector<esCut>&
cuts =
object.getCuts();
2091 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2093 const esCut
cut = cuts.at(
kk);
2095 switch(cut.getCutType()){
2096 case esCutType::Threshold:
2097 lowerThresholdInd = cut.getMinimum().index;
2098 upperThresholdInd = cut.getMaximum().index;
2107 phiWindow1Lower = cut.getMinimum().index;
2108 phiWindow1Upper = cut.getMaximum().index;
2109 }
else if(cntPhi == 1) {
2110 phiWindow2Lower = cut.getMinimum().index;
2111 phiWindow2Upper = cut.getMaximum().index;
2113 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition ("
2114 <<
type <<
")" << std::endl;
2122 case esCutType::Count:
2123 lowerThresholdInd = cut.getMinimum().index;
2124 upperThresholdInd = 0xffffff;
2136 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2137 objParameter[cnt].etHighThreshold = upperThresholdInd;
2138 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2139 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2140 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2141 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2146 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2147 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
2148 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
2149 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2150 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
2151 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper <<
std::dec
2158 std::vector<GlobalObject> objType(nrObj, energySumObjType);
2174 std::ostringstream myCoutStream;
2175 energySumCond.
print(myCoutStream);
2176 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2181 if ( !insertConditionIntoMap(energySumCond, chipNr)) {
2184 <<
" Error: duplicate condition (" <<
name <<
")"
2192 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2196 (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2220 unsigned int chipNr) {
2224 using namespace tmeventsetup;
2233 <<
"\n ****************************************** "
2234 <<
"\n (in parseEnergySum) "
2235 <<
"\n condition = " << condition
2236 <<
"\n type = " <<
type
2237 <<
"\n name = " <<
name
2260 <<
"Wrong type for energy-sum correclation condition (" <<
type
2261 <<
")" << std::endl;
2275 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2290 relativeBx = corrESum->getBxOffset();
2293 int lowerThresholdInd = 0;
2294 int upperThresholdInd = -1;
2296 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2299 const std::vector<esCut>&
cuts = corrESum->getCuts();
2304 switch(cut.getCutType()){
2305 case esCutType::Threshold:
2306 lowerThresholdInd = cut.getMinimum().index;
2307 upperThresholdInd = cut.getMaximum().index;
2316 phiWindow1Lower = cut.getMinimum().index;
2317 phiWindow1Upper = cut.getMaximum().index;
2318 }
else if(cntPhi == 1) {
2319 phiWindow2Lower = cut.getMinimum().index;
2320 phiWindow2Upper = cut.getMaximum().index;
2322 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition ("
2323 <<
type <<
")" << std::endl;
2340 objParameter[0].etLowThreshold = lowerThresholdInd;
2341 objParameter[0].etHighThreshold = upperThresholdInd;
2342 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2343 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2344 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2345 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2350 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2351 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2352 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
2353 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2354 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
2355 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper <<
std::dec
2360 std::vector<GlobalObject> objType(nrObj, energySumObjType);
2376 std::ostringstream myCoutStream;
2377 energySumCond.
print(myCoutStream);
2378 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2397 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2419 unsigned int chipNr) {
2422 using namespace tmeventsetup;
2433 <<
"\n ****************************************** "
2434 <<
"\n (in parseExternal) "
2435 <<
"\n condition = " << condition
2436 <<
"\n particle = " << particle
2437 <<
"\n type = " <<
type
2438 <<
"\n name = " <<
name
2447 unsigned int channelID = 0;
2450 const std::vector<esObject>& objects = condExt.getObjects();
2451 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2453 const esObject
object = objects.at(
jj);
2454 if(
object.getType() == esObjectType::EXT) {
2455 relativeBx =
object.getBxOffset();
2456 channelID =
object.getExternalChannelId();
2474 << externalCond <<
"\n" << std::endl;
2477 if ( !insertConditionIntoMap(externalCond, chipNr)) {
2480 <<
" Error: duplicate condition (" <<
name
2481 <<
")" << std::endl;
2486 (m_vecExternalTemplate[chipNr]).push_back(externalCond);
2507 tmeventsetup::esCondition corrCond,
2508 unsigned int chipNr) {
2510 using namespace tmeventsetup;
2517 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2518 <<
" (in parseCorrelation) " << std::endl
2519 <<
" condition = " << condition << std::endl
2520 <<
" particle = " << particle << std::endl
2521 <<
" type = " <<
type << std::endl
2522 <<
" name = " <<
name << std::endl;
2531 if ( !insertConditionIntoMap(correlationCond, chipNr)) {
2534 <<
" Error: duplicate correlation condition (" <<
name <<
")"
2547 const int nrObj = 2;
2550 int intGEq[nrObj] = { -1, -1 };
2551 std::vector<GlobalObject> objType(nrObj);
2552 std::vector<GtConditionCategory> condCateg(nrObj);
2555 const bool corrFlag =
true;
2556 int corrIndexVal[nrObj] = { -1, -1 };
2565 const std::vector<esCut>&
cuts = corrCond.getCuts();
2570 if(cut.getCutType() == esCutType::ChargeCorrelation) {
2571 if( cut.getData()==
"ls" ) corrParameter.chargeCorrelation = 2;
2572 else if( cut.getData()==
"os" ) corrParameter.chargeCorrelation = 4;
2573 else corrParameter.chargeCorrelation = 1;
2579 double minV = cut.getMinimum().value;
2580 double maxV = cut.getMaximum().value;
2583 if(maxV > 1.0e6) maxV = 1.0e6;
2587 corrParameter.minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2588 corrParameter.maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2589 corrParameter.precEtaCut = cut.getMinimum().index;
2590 cutType = cutType | 0x1;
2593 corrParameter.minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2594 corrParameter.maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2595 corrParameter.precPhiCut = cut.getMinimum().index;
2596 cutType = cutType | 0x2;
2599 corrParameter.minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2600 corrParameter.maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2601 corrParameter.precDRCut = cut.getMinimum().index;
2602 cutType = cutType | 0x4;
2605 corrParameter.minMassCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2606 corrParameter.maxMassCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2607 corrParameter.precMassCut = cut.getMinimum().index;
2608 cutType = cutType | 0x8;
2613 corrParameter.corrCutType = cutType;
2616 const std::vector<esObject>& objects = corrCond.getObjects();
2617 if(objects.size() != 2) {
2619 <<
"incorrect number of objects for the correlation condition " <<
name <<
" corrFlag " << corrFlag << std::endl;
2624 for (
size_t jj = 0;
jj < objects.size();
jj++)
2626 const esObject
object = objects.at(
jj);
2667 parseMuonCorr(&
object,chipNr);
2668 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2675 }
else if(
object.getType() == esObjectType::Egamma ||
2680 parseCaloCorr(&
object,chipNr);
2681 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2685 switch(
object.getType()) {
2686 case esObjectType::Egamma: {
2712 parseEnergySumCorr(&
object,chipNr);
2713 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2717 switch(
object.getType()) {
2740 <<
"Illegal Object Type "
2741 <<
" for the correlation condition " <<
name << std::endl;
2751 if (intGEq[0] != intGEq[1]) {
2753 <<
"Inconsistent GEq flags for sub-conditions "
2754 <<
" for the correlation condition " <<
name << std::endl;
2759 gEq = (intGEq[0] != 0);
2780 std::ostringstream myCoutStream;
2781 correlationCond.
print(myCoutStream);
2782 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n"
2790 (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
2810 unsigned int chipNr) {
2813 using namespace tmeventsetup;
2821 if (algAlias ==
"") {
2824 <<
"\n No alias defined for algorithm. Alias set to algorithm name."
2825 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
2829 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm."
2830 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
2835 std::string logExpression = algorithm.getExpressionInCondition();
2838 <<
" Logical expression: " << logExpression
2839 <<
" Chip number: " << chipNr
2843 int outputPin = algorithm.getIndex();
2847 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin
2853 int bitNumber = outputPin;
2856 LogDebug(
"TriggerMenuParser") <<
" Bit number: " << bitNumber
2866 std::ostringstream myCoutStream;
2867 alg.
print(myCoutStream);
2868 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2873 if ( !insertAlgorithmIntoMap(alg)) {
void setCondGEq(const bool &cGEq)
void setAlgoAlias(const std::string &algoAliasValue)
void setCond0Index(const int &)
virtual void print(std::ostream &myCout) const
print the condition
unsigned int chargeCorrelation
std::vector< std::pair< double, double > > etaBins
virtual void print(std::ostream &myCout) const
print condition
std::vector< std::pair< double, double > > phiBins
void setCondType(const l1t::GtConditionType &cType)
void setCorrelationParameter(const CorrelationParameter &corrParameter)
virtual void print(std::ostream &myCout) const
print the condition
void setCondRelativeBx(const int &cRelativeBx)
virtual void print(std::ostream &myCout) const
print the condition
void setCondChipNr(const int &cChipNr)
VDouble InvariantMass(Tau)
int algoBitNumber() const
get / set algorithm bit number
Container::value_type value_type
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void setExternalChannel(unsigned int extCh)
set functions
void setCond1Category(const l1t::GtConditionCategory &)
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
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
void setObjectType(const std::vector< GlobalObject > &objType)
const std::string & condName() const
get / set condition name
std::vector< std::pair< double, double > > etBins
const std::string algoName() const
get / set algorithm name
void setCond0Category(const l1t::GtConditionCategory &)
std::string const & algoAlias() const
get / set algorithm alias
void setAlgoChipNumber(const int algoChipNumberValue)
typedef for a single object template
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
typedef for correlation parameters
typedef for correlation parameters
virtual void print(std::ostream &myCout) const
print the condition
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
void setCond1Index(const int &)
const int algoChipNumber() const
get / set algorithm bit number