33 #include <boost/cstdint.hpp> 40 #include "tmEventSetup/tmEventSetup.hh" 41 #include "tmEventSetup/esTriggerMenu.hh" 42 #include "tmEventSetup/esAlgorithm.hh" 43 #include "tmEventSetup/esCondition.hh" 44 #include "tmEventSetup/esObject.hh" 45 #include "tmEventSetup/esCut.hh" 46 #include "tmEventSetup/esScale.hh" 47 #include "tmGrammar/Algorithm.hh" 53 m_triggerMenuInterface(
"NULL"),
54 m_triggerMenuName(
"NULL"), m_triggerMenuImplementation(0x0), m_scaleDbKey(
"NULL")
73 const unsigned int& numberConditionChipsValue) {
89 const std::vector<int>& orderConditionChipValue) {
97 const unsigned int& numberPhysTriggersValue) {
134 const std::vector<std::vector<MuonTemplate> >& vecMuonTempl) {
140 const std::vector<std::vector<CaloTemplate> >& vecCaloTempl) {
146 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
154 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
161 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
167 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
175 const std::vector<std::vector<MuonTemplate> >& corMuonTempl) {
181 const std::vector<std::vector<CaloTemplate> >& corCaloTempl) {
187 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
210 const esTriggerMenu* menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
211 const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
213 std::map<std::string, unsigned int> extBitMap;
216 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin();
217 cit != condMap.end(); cit++)
219 const esCondition& condition = cit->second;
220 if(condition.getType() == esConditionType::Externals ) {
223 const std::vector<esObject>&
objects = condition.getObjects();
224 for (
size_t jj = 0;
jj < objects.size();
jj++) {
226 const esObject
object = objects.at(
jj);
227 if(
object.getType() == esObjectType::EXT) {
229 unsigned int channelID =
object.getExternalChannelId();
271 const esTriggerMenu* menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
281 const std::map<std::string, esAlgorithm>& algoMap = menu->getAlgorithmMap();
282 const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
283 const std::map<std::string, esScale>& scaleMap = menu->getScaleMap();
291 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin();
292 cit != algoMap.end(); cit++)
298 const esAlgorithm&
algo = cit->second;
304 const std::vector<std::string>& rpn_vec = algo.getRpnVector();
305 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++)
308 if (isGate(token))
continue;
310 const esCondition& condition = condMap.find(token)->second;
317 if(condition.getType() == esConditionType::SingleEgamma ||
318 condition.getType() == esConditionType::DoubleEgamma ||
319 condition.getType() == esConditionType::TripleEgamma ||
320 condition.getType() == esConditionType::QuadEgamma ||
321 condition.getType() == esConditionType::SingleTau ||
322 condition.getType() == esConditionType::DoubleTau ||
323 condition.getType() == esConditionType::TripleTau ||
324 condition.getType() == esConditionType::QuadTau ||
325 condition.getType() == esConditionType::SingleJet ||
326 condition.getType() == esConditionType::DoubleJet ||
327 condition.getType() == esConditionType::TripleJet ||
328 condition.getType() == esConditionType::QuadJet )
333 }
else if(condition.getType() == esConditionType::TotalEt ||
334 condition.getType() == esConditionType::TotalEtEM ||
335 condition.getType() == esConditionType::TotalHt ||
336 condition.getType() == esConditionType::MissingEt ||
337 condition.getType() == esConditionType::MissingHt ||
338 condition.getType() == esConditionType::MissingEtHF ||
339 condition.getType() == esConditionType::TowerCount ||
340 condition.getType() == esConditionType::MinBiasHFP0 ||
341 condition.getType() == esConditionType::MinBiasHFM0 ||
342 condition.getType() == esConditionType::MinBiasHFP1 ||
343 condition.getType() == esConditionType::MinBiasHFM1 ||
344 condition.getType() == esConditionType::AsymmetryEt ||
345 condition.getType() == esConditionType::AsymmetryHt ||
346 condition.getType() == esConditionType::AsymmetryEtHF ||
347 condition.getType() == esConditionType::AsymmetryHtHF ||
348 condition.getType() == esConditionType::Centrality0 ||
349 condition.getType() == esConditionType::Centrality1 ||
350 condition.getType() == esConditionType::Centrality2 ||
351 condition.getType() == esConditionType::Centrality3 ||
352 condition.getType() == esConditionType::Centrality4 ||
353 condition.getType() == esConditionType::Centrality5 ||
354 condition.getType() == esConditionType::Centrality6 ||
355 condition.getType() == esConditionType::Centrality7 )
360 }
else if(condition.getType() == esConditionType::SingleMuon ||
361 condition.getType() == esConditionType::DoubleMuon ||
362 condition.getType() == esConditionType::TripleMuon ||
363 condition.getType() == esConditionType::QuadMuon )
369 }
else if(condition.getType() == esConditionType::MuonMuonCorrelation ||
370 condition.getType() == esConditionType::MuonEsumCorrelation ||
371 condition.getType() == esConditionType::CaloMuonCorrelation ||
372 condition.getType() == esConditionType::CaloCaloCorrelation ||
373 condition.getType() == esConditionType::CaloEsumCorrelation ||
375 condition.getType() == esConditionType::TransverseMass )
380 }
else if(condition.getType() == esConditionType::Externals )
385 else if(condition.getType() == esConditionType::SingleEgammaOvRm ||
386 condition.getType() == esConditionType::DoubleEgammaOvRm ||
387 condition.getType() == esConditionType::TripleEgammaOvRm ||
388 condition.getType() == esConditionType::QuadEgammaOvRm ||
389 condition.getType() == esConditionType::SingleTauOvRm ||
390 condition.getType() == esConditionType::DoubleTauOvRm ||
391 condition.getType() == esConditionType::TripleTauOvRm ||
392 condition.getType() == esConditionType::QuadTauOvRm ||
393 condition.getType() == esConditionType::SingleJetOvRm ||
394 condition.getType() == esConditionType::DoubleJetOvRm ||
395 condition.getType() == esConditionType::TripleJetOvRm ||
396 condition.getType() == esConditionType::QuadJetOvRm) {
399 <<
"SingleEgammaOvRm" << std::endl
400 <<
"DoubleEgammaOvRm" << std::endl
401 <<
"TripleEgammaOvRm" << std::endl
402 <<
"QuadEgammaOvRm" << std::endl
403 <<
"SingleTauOvRm" << std::endl
404 <<
"DoubleTauOvRm" << std::endl
405 <<
"TripleTauOvRm" << std::endl
406 <<
"QuadTauOvRm" << std::endl
407 <<
"SingleJetOvRm" << std::endl
408 <<
"DoubleJetOvRm" << std::endl
409 <<
"TripleJetOvRm" << std::endl
410 <<
"QuadJetOvRm" << std::endl
411 <<
"The above conditions types OvRm are not implemented yet in the parser. Please remove alogrithms that use this type of condtion from L1T Menu!" << std::endl;
415 else if(condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
416 condition.getType() == esConditionType::InvariantMassOvRm ||
417 condition.getType() == esConditionType::TransverseMassOvRm) {
489 for (std::vector<ConditionMap>::iterator itCondOnChip =
m_conditionMap.begin(); itCondOnChip
494 itCondOnChip->clear();
509 <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." << std::endl;
514 <<
" Condition " << cName
515 <<
" already exists - not inserted!" << std::endl;
521 <<
" OK - condition inserted!" 539 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
540 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
545 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
546 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
553 LogTrace(
"TriggerMenuParser") <<
" Bit number " << bitNumber
555 <<
") - algorithm not inserted!" << std::endl;
561 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " 573 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr
575 <<
") - algorithm not inserted!" << std::endl;
584 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
586 <<
"] - algorithm not inserted!" << std::endl;
599 if ( (outputPin == iPin) && (chipNr == iChip)) {
600 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
601 <<
" is the same as for algorithm " << iName
602 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 623 std::stringstream ss;
628 std::stringstream ss;
661 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin();
662 cit != scaleMap.end(); cit++)
664 const esScale&
scale = cit->second;
668 else if (scale.getObjectType() == esObjectType::Egamma) scaleParam = &egScales;
672 else if (scale.getObjectType() == esObjectType::ETTEM) scaleParam = &ettEmScales;
674 else if (scale.getObjectType() == esObjectType::ETMHF) scaleParam = &etmHfScales;
677 else scaleParam =
nullptr;
679 if(scaleParam !=
nullptr) {
680 switch(scale.getScaleType()) {
681 case esScaleType::EtScale: {
682 scaleParam->
etMin = scale.getMinimum();
683 scaleParam->
etMax = scale.getMaximum();
684 scaleParam->
etStep = scale.getStep();
687 const std::vector<esBin>& binsV = scale.getBins();
688 for(
unsigned int i=0;
i<binsV.size();
i++) {
689 const esBin&
bin = binsV.at(
i);
690 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
691 scaleParam->
etBins.push_back(binLimits);
698 scale.getObjectType() == esObjectType::ETTEM || scale.getObjectType() == esObjectType::ETMHF) {
712 case esScaleType::EtaScale: {
713 scaleParam->
etaMin = scale.getMinimum();
714 scaleParam->
etaMax = scale.getMaximum();
715 scaleParam->
etaStep = scale.getStep();
718 const std::vector<esBin>& binsV = scale.getBins();
719 scaleParam->
etaBins.resize(
pow(2,scale.getNbits()));
720 for(
unsigned int i=0;
i<binsV.size();
i++) {
721 const esBin&
bin = binsV.at(
i);
722 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
723 scaleParam->
etaBins.at(bin.hw_index) = binLimits;
727 case esScaleType::PhiScale: {
728 scaleParam->
phiMin = scale.getMinimum();
729 scaleParam->
phiMax = scale.getMaximum();
730 scaleParam->
phiStep = scale.getStep();
733 const std::vector<esBin>& binsV = scale.getBins();
734 scaleParam->
phiBins.resize(
pow(2,scale.getNbits()));
735 for(
unsigned int i=0;
i<binsV.size();
i++) {
736 const esBin&
bin = binsV.at(
i);
737 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
738 scaleParam->
phiBins.at(bin.hw_index) = binLimits;
764 bool hasPrecision =
false;
765 std::map<std::string, unsigned int> precisions;
766 getPrecisions(precisions, scaleMap);
767 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++)
794 parsePt_LUTS(scaleMap,
"Mass" ,
"EG", precisions[
"PRECISION-EG-MU-MassPt"] );
795 parsePt_LUTS(scaleMap,
"Mass" ,
"MU", precisions[
"PRECISION-EG-MU-MassPt"] );
796 parsePt_LUTS(scaleMap,
"Mass" ,
"JET", precisions[
"PRECISION-EG-JET-MassPt"] );
797 parsePt_LUTS(scaleMap,
"Mass" ,
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"] );
798 parsePt_LUTS(scaleMap,
"Mass" ,
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"] );
799 parsePt_LUTS(scaleMap,
"Mass" ,
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"] );
800 parsePt_LUTS(scaleMap,
"Mass" ,
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"] );
804 parsePt_LUTS(scaleMap,
"TwoBody" ,
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
805 parsePt_LUTS(scaleMap,
"TwoBody" ,
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
806 parsePt_LUTS(scaleMap,
"TwoBody" ,
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"] );
807 parsePt_LUTS(scaleMap,
"TwoBody" ,
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"] );
808 parsePt_LUTS(scaleMap,
"TwoBody" ,
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"] );
809 parsePt_LUTS(scaleMap,
"TwoBody" ,
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"] );
810 parsePt_LUTS(scaleMap,
"TwoBody" ,
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"] );
816 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
817 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
818 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
819 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
821 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
822 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
823 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
825 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
826 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
828 parseDeltaEta_Cosh_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
833 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
834 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
835 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
836 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETM",precisions[
"PRECISION-EG-ETM-Delta"],precisions[
"PRECISION-EG-ETM-Math"]);
837 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETMHF",precisions[
"PRECISION-EG-ETMHF-Delta"],precisions[
"PRECISION-EG-ETMHF-Math"]);
838 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"HTM",precisions[
"PRECISION-EG-HTM-Delta"],precisions[
"PRECISION-EG-HTM-Math"]);
839 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
841 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
842 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
843 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETM",precisions[
"PRECISION-JET-ETM-Delta"],precisions[
"PRECISION-JET-ETM-Math"]);
844 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETMHF",precisions[
"PRECISION-JET-ETMHF-Delta"],precisions[
"PRECISION-JET-ETMHF-Math"]);
845 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"HTM",precisions[
"PRECISION-JET-HTM-Delta"],precisions[
"PRECISION-JET-HTM-Math"]);
846 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
848 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
849 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETM",precisions[
"PRECISION-TAU-ETM-Delta"],precisions[
"PRECISION-TAU-ETM-Math"]);
850 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETMHF",precisions[
"PRECISION-TAU-ETMHF-Delta"],precisions[
"PRECISION-TAU-ETMHF-Math"]);
851 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"HTM",precisions[
"PRECISION-TAU-HTM-Delta"],precisions[
"PRECISION-TAU-HTM-Math"]);
852 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
854 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETM",precisions[
"PRECISION-MU-ETM-Delta"],precisions[
"PRECISION-MU-ETM-Math"]);
855 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETMHF",precisions[
"PRECISION-MU-ETMHF-Delta"],precisions[
"PRECISION-MU-ETMHF-Math"]);
856 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"HTM",precisions[
"PRECISION-MU-HTM-Delta"],precisions[
"PRECISION-MU-HTM-Math"]);
857 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
895 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
897 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
898 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
900 std::vector<long long> lut_cal_2_mu_eta;
901 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
923 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
925 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
926 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
929 std::vector<long long> lut_cal_2_mu_phi;
930 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
950 if( scaleMap.find(scLabel1) == scaleMap.end())
return;
952 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
954 std::vector<long long> lut_pt;
955 getLut(lut_pt, scale1, prec);
974 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
976 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
977 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
978 std::vector<double> val_delta_eta;
979 std::vector<long long> lut_delta_eta;
980 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
981 setLut(lut_delta_eta, val_delta_eta, prec1);
988 std::vector<long long> lut_cosh;
989 applyCosh(val_delta_eta, n);
990 setLut(lut_cosh, val_delta_eta, prec2);
1007 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
1009 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
1010 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
1011 std::vector<double> val_delta_phi;
1012 std::vector<long long> lut_delta_phi;
1013 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
1014 setLut(lut_delta_phi, val_delta_phi, prec1);
1021 std::vector<long long> lut_cos;
1022 applyCos(val_delta_phi, n);
1023 setLut(lut_cos, val_delta_phi, prec2);
1037 if( scaleMap.find(scLabel) == scaleMap.end() )
return;
1040 const esScale*
scale = &scaleMap.find(scLabel)->second;
1042 const double step = scale->getStep();
1043 const double range = scale->getMaximum() - scale->getMinimum();
1044 const size_t n = std::ceil(range / step);
1045 const size_t bitwidth = std::ceil(std::log10(n) / std::log10(2));
1049 for (
size_t ii = 0;
ii <
n;
ii++)
1051 array.at(
ii) = step *
ii;
1055 std::vector<long long>
lut;
1058 setLut(lut, array, prec);
1062 setLut(lut, array, prec);
1082 unsigned int chipNr,
const bool corrFlag) {
1097 if (condMu.getType() == esConditionType::SingleMuon) {
1101 }
else if (condMu.getType() == esConditionType::DoubleMuon) {
1105 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1109 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1114 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" 1115 << type <<
")" << std::endl;
1120 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1121 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1126 <<
"\n ****************************************** " 1128 <<
"\n condition = " << condition
1129 <<
"\n particle = " << particle
1130 <<
"\n type = " << type
1131 <<
"\n name = " << name
1139 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1145 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1146 tmpValues.reserve( nrObj );
1148 if(
int(condMu.getObjects().size())!=nrObj ){
1149 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1150 <<
"condMu.getObjects().size() = " 1151 << condMu.getObjects().size()
1158 unsigned int chargeCorrelation = 1;
1159 const std::vector<esCut>&
cuts = condMu.getCuts();
1160 for (
size_t jj = 0;
jj < cuts.size();
jj++)
1162 const esCut
cut = cuts.at(
jj);
1163 if(cut.getCutType() == esCutType::ChargeCorrelation) {
1164 if( cut.getData()==
"ls" ) chargeCorrelation = 2;
1165 else if( cut.getData()==
"os" ) chargeCorrelation = 4;
1166 else chargeCorrelation = 1;
1182 const std::vector<esObject>&
objects = condMu.getObjects();
1183 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1185 const esObject
object = objects.at(
jj);
1186 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1189 relativeBx =
object.getBxOffset();
1192 int upperThresholdInd = -1;
1193 int lowerThresholdInd = 0;
1194 int upperIndexInd = -1;
1195 int lowerIndexInd = 0;
1197 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1199 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1200 int isolationLUT = 0xF;
1202 int qualityLUT = 0xFFFF;
1204 const std::vector<esCut>& cuts =
object.getCuts();
1205 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1207 const esCut
cut = cuts.at(
kk);
1209 switch(cut.getCutType()){
1211 lowerThresholdInd = cut.getMinimum().index;
1212 upperThresholdInd = cut.getMaximum().index;
1215 case esCutType::Slice:
1216 lowerIndexInd =
int(cut.getMinimum().value);
1217 upperIndexInd =
int(cut.getMaximum().value);
1223 etaWindow1Lower = cut.getMinimum().index;
1224 etaWindow1Upper = cut.getMaximum().index;
1225 }
else if(cntEta == 1) {
1226 etaWindow2Lower = cut.getMinimum().index;
1227 etaWindow2Upper = cut.getMaximum().index;
1229 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1230 << particle <<
")" << std::endl;
1240 phiWindow1Lower = cut.getMinimum().index;
1241 phiWindow1Upper = cut.getMaximum().index;
1242 }
else if(cntPhi == 1) {
1243 phiWindow2Lower = cut.getMinimum().index;
1244 phiWindow2Upper = cut.getMaximum().index;
1246 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1247 << particle <<
")" << std::endl;
1254 case esCutType::Charge:
1255 if( cut.getData()==
"positive" ) charge = 0;
1256 else if( cut.getData()==
"negative" ) charge = 1;
1264 case esCutType::Isolation: {
1277 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1278 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1280 objParameter[cnt].indexHigh = upperIndexInd;
1281 objParameter[cnt].indexLow = lowerIndexInd;
1283 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1284 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1285 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1286 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1288 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1289 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1290 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1291 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1294 objParameter[cnt].enableMip =
false;
1295 objParameter[cnt].enableIso =
false;
1296 objParameter[cnt].requestIso =
false;
1298 objParameter[cnt].charge =
charge;
1299 objParameter[cnt].qualityLUT = qualityLUT;
1300 objParameter[cnt].isolationLUT = isolationLUT;
1324 std::ostringstream myCoutStream;
1325 muonCond.
print(myCoutStream);
1326 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1332 <<
" Error: duplicate condition (" << name <<
")" 1337 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the ConditionMap" << std::endl;
1343 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the vecMuonTemplate vector" << std::endl;
1355 unsigned int chipNr) {
1373 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1374 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1379 <<
"\n ****************************************** " 1381 <<
"\n condition = " << condition
1382 <<
"\n particle = " << particle
1383 <<
"\n type = " << type
1384 <<
"\n name = " << name
1392 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1398 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1399 tmpValues.reserve( nrObj );
1405 unsigned int chargeCorrelation = 0;
1406 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1407 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1408 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1421 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1424 relativeBx = corrMu->getBxOffset();
1427 int upperThresholdInd = -1;
1428 int lowerThresholdInd = 0;
1429 int upperIndexInd = -1;
1430 int lowerIndexInd = 0;
1432 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1434 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1435 int isolationLUT = 0xF;
1437 int qualityLUT = 0xFFFF;
1439 const std::vector<esCut>&
cuts = corrMu->getCuts();
1440 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1442 const esCut
cut = cuts.at(
kk);
1444 switch(cut.getCutType()){
1446 lowerThresholdInd = cut.getMinimum().index;
1447 upperThresholdInd = cut.getMaximum().index;
1450 case esCutType::Slice:
1451 lowerIndexInd =
int(cut.getMinimum().value);
1452 upperIndexInd =
int(cut.getMaximum().value);
1458 etaWindow1Lower = cut.getMinimum().index;
1459 etaWindow1Upper = cut.getMaximum().index;
1460 }
else if(cntEta == 1) {
1461 etaWindow2Lower = cut.getMinimum().index;
1462 etaWindow2Upper = cut.getMaximum().index;
1464 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1465 << particle <<
")" << std::endl;
1475 phiWindow1Lower = cut.getMinimum().index;
1476 phiWindow1Upper = cut.getMaximum().index;
1477 }
else if(cntPhi == 1) {
1478 phiWindow2Lower = cut.getMinimum().index;
1479 phiWindow2Upper = cut.getMaximum().index;
1481 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1482 << particle <<
")" << std::endl;
1489 case esCutType::Charge:
1490 if( cut.getData()==
"positive" ) charge = 0;
1491 else if( cut.getData()==
"negative" ) charge = 1;
1499 case esCutType::Isolation: {
1512 objParameter[0].ptHighThreshold = upperThresholdInd;
1513 objParameter[0].ptLowThreshold = lowerThresholdInd;
1515 objParameter[0].indexHigh = upperIndexInd;
1516 objParameter[0].indexLow = lowerIndexInd;
1518 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1519 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1520 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1521 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1523 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1524 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1525 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1526 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1529 objParameter[0].enableMip =
false;
1530 objParameter[0].enableIso =
false;
1531 objParameter[0].requestIso =
false;
1533 objParameter[0].charge =
charge;
1534 objParameter[0].qualityLUT = qualityLUT;
1535 objParameter[0].isolationLUT = isolationLUT;
1552 std::ostringstream myCoutStream;
1553 muonCond.
print(myCoutStream);
1554 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1590 unsigned int chipNr,
const bool corrFlag) {
1604 <<
"\n ****************************************** " 1605 <<
"\n (in parseCalo) " 1606 <<
"\n condition = " << condition
1607 <<
"\n particle = " << particle
1608 <<
"\n type = " << type
1609 <<
"\n name = " << name
1620 if (condCalo.getType() == esConditionType::SingleEgamma) {
1625 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1630 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1635 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1640 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1641 caloObjType =
gtJet;
1645 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1646 caloObjType =
gtJet;
1650 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1651 caloObjType =
gtJet;
1655 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1656 caloObjType =
gtJet;
1660 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1661 caloObjType =
gtTau;
1665 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1666 caloObjType =
gtTau;
1670 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1671 caloObjType =
gtTau;
1675 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1676 caloObjType =
gtTau;
1681 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1682 << particle <<
")" << std::endl;
1689 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1690 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1697 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1703 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1704 tmpValues.reserve( nrObj );
1707 if(
int(condCalo.getObjects().size())!=nrObj ){
1708 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1709 <<
"condCalo.getObjects().size() = " 1710 << condCalo.getObjects().size()
1726 const std::vector<esObject>&
objects = condCalo.getObjects();
1727 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1729 const esObject
object = objects.at(
jj);
1730 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1733 relativeBx =
object.getBxOffset();
1736 int upperThresholdInd = -1;
1737 int lowerThresholdInd = 0;
1738 int upperIndexInd = -1;
1739 int lowerIndexInd = 0;
1741 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1743 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1744 int isolationLUT = 0xF;
1745 int qualityLUT = 0xF;
1748 const std::vector<esCut>&
cuts =
object.getCuts();
1749 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1751 const esCut
cut = cuts.at(
kk);
1753 switch(cut.getCutType()){
1755 lowerThresholdInd = cut.getMinimum().index;
1756 upperThresholdInd = cut.getMaximum().index;
1758 case esCutType::Slice:
1759 lowerIndexInd =
int(cut.getMinimum().value);
1760 upperIndexInd =
int(cut.getMaximum().value);
1765 etaWindow1Lower = cut.getMinimum().index;
1766 etaWindow1Upper = cut.getMaximum().index;
1767 }
else if(cntEta == 1) {
1768 etaWindow2Lower = cut.getMinimum().index;
1769 etaWindow2Upper = cut.getMaximum().index;
1771 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 1772 << particle <<
")" << std::endl;
1782 phiWindow1Lower = cut.getMinimum().index;
1783 phiWindow1Upper = cut.getMaximum().index;
1784 }
else if(cntPhi == 1) {
1785 phiWindow2Lower = cut.getMinimum().index;
1786 phiWindow2Upper = cut.getMaximum().index;
1788 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 1789 << particle <<
")" << std::endl;
1796 case esCutType::Charge: {
1798 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 1799 << particle <<
")" << std::endl;
1808 case esCutType::Isolation: {
1820 objParameter[cnt].etHighThreshold = upperThresholdInd;
1821 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1822 objParameter[cnt].indexHigh = upperIndexInd;
1823 objParameter[cnt].indexLow = lowerIndexInd;
1824 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1825 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1826 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1827 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1828 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1829 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1830 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1831 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1832 objParameter[cnt].isolationLUT = isolationLUT;
1833 objParameter[cnt].qualityLUT = qualityLUT;
1837 <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " 1838 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
1839 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1840 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1841 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1842 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1843 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1844 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1845 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1846 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1847 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1848 << objParameter[cnt].isolationLUT
1849 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" 1850 << objParameter[cnt].qualityLUT <<
std::dec 1859 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1881 std::ostringstream myCoutStream;
1882 caloCond.
print(myCoutStream);
1883 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1892 <<
" Error: duplicate condition (" << name <<
")" 1927 unsigned int chipNr) {
1941 <<
"\n ****************************************** " 1942 <<
"\n (in parseCalo) " 1943 <<
"\n condition = " << condition
1944 <<
"\n particle = " << particle
1945 <<
"\n type = " << type
1946 <<
"\n name = " << name
1958 if (corrCalo->getType() == esObjectType::Egamma) {
1961 caloObjType =
gtJet;
1963 caloObjType =
gtTau;
1965 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1966 << particle <<
")" << std::endl;
1974 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1975 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1982 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1988 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1989 tmpValues.reserve( nrObj );
1998 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
2001 relativeBx = corrCalo->getBxOffset();
2004 int upperThresholdInd = -1;
2005 int lowerThresholdInd = 0;
2006 int upperIndexInd = -1;
2007 int lowerIndexInd = 0;
2009 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
2011 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2012 int isolationLUT = 0xF;
2013 int qualityLUT = 0xF;
2016 const std::vector<esCut>&
cuts = corrCalo->getCuts();
2017 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2019 const esCut
cut = cuts.at(
kk);
2021 switch(cut.getCutType()){
2023 lowerThresholdInd = cut.getMinimum().index;
2024 upperThresholdInd = cut.getMaximum().index;
2026 case esCutType::Slice:
2027 lowerIndexInd =
int(cut.getMinimum().value);
2028 upperIndexInd =
int(cut.getMaximum().value);
2033 etaWindow1Lower = cut.getMinimum().index;
2034 etaWindow1Upper = cut.getMaximum().index;
2035 }
else if(cntEta == 1) {
2036 etaWindow2Lower = cut.getMinimum().index;
2037 etaWindow2Upper = cut.getMaximum().index;
2039 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 2040 << particle <<
")" << std::endl;
2050 phiWindow1Lower = cut.getMinimum().index;
2051 phiWindow1Upper = cut.getMaximum().index;
2052 }
else if(cntPhi == 1) {
2053 phiWindow2Lower = cut.getMinimum().index;
2054 phiWindow2Upper = cut.getMaximum().index;
2056 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 2057 << particle <<
")" << std::endl;
2064 case esCutType::Charge: {
2066 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 2067 << particle <<
")" << std::endl;
2076 case esCutType::Isolation: {
2088 objParameter[0].etLowThreshold = lowerThresholdInd;
2089 objParameter[0].etHighThreshold = upperThresholdInd;
2090 objParameter[0].indexHigh = upperIndexInd;
2091 objParameter[0].indexLow = lowerIndexInd;
2092 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2093 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2094 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2095 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2096 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2097 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2098 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2099 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2100 objParameter[0].isolationLUT = isolationLUT;
2101 objParameter[0].qualityLUT = qualityLUT;
2105 <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " <<
" = " 2106 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold
2107 <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x" 2108 << objParameter[0].etaWindow1Lower <<
" / 0x" << objParameter[0].etaWindow1Upper
2109 <<
"\n etaWindowVeto Lower / Upper for calo object " <<
" = 0x" 2110 << objParameter[0].etaWindow2Lower <<
" / 0x" << objParameter[0].etaWindow2Upper
2111 <<
"\n phiWindow Lower / Upper for calo object " <<
" = 0x" 2112 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2113 <<
"\n phiWindowVeto Lower / Upper for calo object " <<
" = 0x" 2114 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2115 <<
"\n Isolation LUT for calo object " <<
" = 0x" 2116 << objParameter[0].isolationLUT
2117 <<
"\n Quality LUT for calo object " <<
" = 0x" 2118 << objParameter[0].qualityLUT <<
std::dec 2126 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2148 std::ostringstream myCoutStream;
2149 caloCond.
print(myCoutStream);
2150 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2188 unsigned int chipNr,
const bool corrFlag) {
2201 <<
"\n ****************************************** " 2202 <<
"\n (in parseEnergySum) " 2203 <<
"\n condition = " << condition
2204 <<
"\n type = " << type
2205 <<
"\n name = " << name
2214 if( condEnergySum.getType() == esConditionType::MissingEt ){
2218 else if( condEnergySum.getType() == esConditionType::TotalEt ){
2222 else if( condEnergySum.getType() == esConditionType::TotalEtEM ){
2226 else if( condEnergySum.getType() == esConditionType::TotalHt ){
2230 else if( condEnergySum.getType() == esConditionType::MissingHt ){
2234 else if( condEnergySum.getType() == esConditionType::MissingEtHF ){
2238 else if( condEnergySum.getType() == esConditionType::TowerCount ){
2242 else if( condEnergySum.getType() == esConditionType::MinBiasHFP0 ){
2246 else if( condEnergySum.getType() == esConditionType::MinBiasHFM0 ){
2250 else if( condEnergySum.getType() == esConditionType::MinBiasHFP1 ){
2254 else if( condEnergySum.getType() == esConditionType::MinBiasHFM1 ){
2258 else if( condEnergySum.getType() == esConditionType::AsymmetryEt ){
2262 else if( condEnergySum.getType() == esConditionType::AsymmetryHt ){
2266 else if( condEnergySum.getType() == esConditionType::AsymmetryEtHF ){
2270 else if( condEnergySum.getType() == esConditionType::AsymmetryHtHF ){
2274 else if( condEnergySum.getType() == esConditionType::Centrality0 ){
2278 else if( condEnergySum.getType() == esConditionType::Centrality1 ){
2282 else if( condEnergySum.getType() == esConditionType::Centrality2 ){
2286 else if( condEnergySum.getType() == esConditionType::Centrality3 ){
2290 else if( condEnergySum.getType() == esConditionType::Centrality4 ){
2294 else if( condEnergySum.getType() == esConditionType::Centrality5 ){
2298 else if( condEnergySum.getType() == esConditionType::Centrality6 ){
2302 else if( condEnergySum.getType() == esConditionType::Centrality7 ){
2308 <<
"Wrong type for energy-sum condition (" << type
2309 <<
")" << std::endl;
2323 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2335 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2336 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2338 const esObject
object = objects.at(
jj);
2339 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2342 relativeBx =
object.getBxOffset();
2345 int lowerThresholdInd = 0;
2346 int upperThresholdInd = -1;
2348 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2351 const std::vector<esCut>&
cuts =
object.getCuts();
2352 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2354 const esCut
cut = cuts.at(
kk);
2356 switch(cut.getCutType()){
2358 lowerThresholdInd = cut.getMinimum().index;
2359 upperThresholdInd = cut.getMaximum().index;
2368 phiWindow1Lower = cut.getMinimum().index;
2369 phiWindow1Upper = cut.getMaximum().index;
2370 }
else if(cntPhi == 1) {
2371 phiWindow2Lower = cut.getMinimum().index;
2372 phiWindow2Upper = cut.getMaximum().index;
2374 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2375 << type <<
")" << std::endl;
2383 case esCutType::Count:
2384 lowerThresholdInd = cut.getMinimum().index;
2385 upperThresholdInd = 0xffffff;
2397 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2398 objParameter[cnt].etHighThreshold = upperThresholdInd;
2399 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2400 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2401 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2402 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2407 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2408 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
2409 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2410 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2411 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2412 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper <<
std::dec 2419 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2435 std::ostringstream myCoutStream;
2436 energySumCond.
print(myCoutStream);
2437 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2445 <<
" Error: duplicate condition (" << name <<
")" 2481 unsigned int chipNr) {
2494 <<
"\n ****************************************** " 2495 <<
"\n (in parseEnergySum) " 2496 <<
"\n condition = " << condition
2497 <<
"\n type = " << type
2498 <<
"\n name = " << name
2515 else if( corrESum->getType()== esObjectType::ETMHF ){
2519 else if( corrESum->getType()== esObjectType::TOWERCOUNT ){
2525 <<
"Wrong type for energy-sum correclation condition (" << type
2526 <<
")" << std::endl;
2540 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2552 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2555 relativeBx = corrESum->getBxOffset();
2558 int lowerThresholdInd = 0;
2559 int upperThresholdInd = -1;
2561 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2564 const std::vector<esCut>&
cuts = corrESum->getCuts();
2565 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2567 const esCut
cut = cuts.at(
kk);
2569 switch(cut.getCutType()){
2571 lowerThresholdInd = cut.getMinimum().index;
2572 upperThresholdInd = cut.getMaximum().index;
2581 phiWindow1Lower = cut.getMinimum().index;
2582 phiWindow1Upper = cut.getMaximum().index;
2583 }
else if(cntPhi == 1) {
2584 phiWindow2Lower = cut.getMinimum().index;
2585 phiWindow2Upper = cut.getMaximum().index;
2587 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2588 << type <<
")" << std::endl;
2605 objParameter[0].etLowThreshold = lowerThresholdInd;
2606 objParameter[0].etHighThreshold = upperThresholdInd;
2607 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2608 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2609 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2610 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2615 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2616 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2617 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2618 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2619 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2620 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper <<
std::dec 2625 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2641 std::ostringstream myCoutStream;
2642 energySumCond.
print(myCoutStream);
2643 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2684 unsigned int chipNr) {
2698 <<
"\n ****************************************** " 2699 <<
"\n (in parseExternal) " 2700 <<
"\n condition = " << condition
2701 <<
"\n particle = " << particle
2702 <<
"\n type = " << type
2703 <<
"\n name = " << name
2714 unsigned int channelID = 0;
2717 const std::vector<esObject>&
objects = condExt.getObjects();
2718 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2720 const esObject
object = objects.at(
jj);
2721 if(
object.getType() == esObjectType::EXT) {
2722 relativeBx =
object.getBxOffset();
2723 channelID =
object.getExternalChannelId();
2732 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2745 << externalCond <<
"\n" << std::endl;
2751 <<
" Error: duplicate condition (" << name
2752 <<
")" << std::endl;
2778 tmeventsetup::esCondition corrCond,
2779 unsigned int chipNr) {
2788 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2789 <<
" (in parseCorrelation) " << std::endl
2790 <<
" condition = " << condition << std::endl
2791 <<
" particle = " << particle << std::endl
2792 <<
" type = " << type << std::endl
2793 <<
" name = " << name << std::endl;
2805 <<
" Error: duplicate correlation condition (" << name <<
")" 2818 const int nrObj = 2;
2821 int intGEq[nrObj] = { -1, -1 };
2822 std::vector<GlobalObject>
objType(nrObj);
2823 std::vector<GtConditionCategory> condCateg(nrObj);
2826 const bool corrFlag =
true;
2827 int corrIndexVal[nrObj] = { -1, -1 };
2836 const std::vector<esCut>&
cuts = corrCond.getCuts();
2837 for (
size_t jj = 0;
jj < cuts.size();
jj++)
2839 const esCut
cut = cuts.at(
jj);
2841 if(cut.getCutType() == esCutType::ChargeCorrelation) {
2850 double minV = cut.getMinimum().value;
2851 double maxV = cut.getMaximum().value;
2854 if(maxV > 1.0e8) maxV = 1.0e8;
2857 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2858 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2859 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2860 corrParameter.
precEtaCut = cut.getMinimum().index;
2861 cutType = cutType | 0x1;
2863 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2864 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2865 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2866 corrParameter.
precPhiCut = cut.getMinimum().index;
2867 cutType = cutType | 0x2;
2869 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaR Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2870 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2871 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2872 corrParameter.
precDRCut = cut.getMinimum().index;
2873 cutType = cutType | 0x4;
2874 }
else if (cut.getCutType() == esCutType::TwoBodyPt) {
2877 corrParameter.
precTBPTCut = cut.getMinimum().index;
2878 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tTPBT Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2879 cutType = cutType | 0x20;
2881 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tMass Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2884 corrParameter.
precMassCut = cut.getMinimum().index;
2886 if (corrCond.getType() == esConditionType::TransverseMass){
2887 cutType = cutType | 0x10;
2890 cutType = cutType | 0x8;
2900 const std::vector<esObject>&
objects = corrCond.getObjects();
2901 if(objects.size() != 2) {
2903 <<
"incorrect number of objects for the correlation condition " << name <<
" corrFlag " << corrFlag << std::endl;
2908 for (
size_t jj = 0;
jj < objects.size();
jj++)
2910 const esObject
object = objects.at(
jj);
2956 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2960 }
else if(
object.getType() == esObjectType::Egamma ||
2969 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2970 switch(
object.getType()) {
2971 case esObjectType::Egamma: {
2993 object.getType() == esObjectType::ETMHF ||
2994 object.getType() == esObjectType::TOWERCOUNT ||
3002 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3003 switch(
object.getType()) {
3012 case esObjectType::ETMHF: {
3016 case esObjectType::TOWERCOUNT: {
3030 <<
"Illegal Object Type " <<
object.getType()
3031 <<
" for the correlation condition " << name << std::endl;
3041 if (intGEq[0] != intGEq[1]) {
3043 <<
"Inconsistent GEq flags for sub-conditions " 3044 <<
" for the correlation condition " << name << std::endl;
3049 gEq = (intGEq[0] != 0);
3070 std::ostringstream myCoutStream;
3071 correlationCond.
print(myCoutStream);
3072 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3100 const tmeventsetup::esCondition& corrCond,
3101 unsigned int chipNr) {
3110 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3111 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3112 <<
" condition = " << condition << std::endl
3113 <<
" particle = " << particle << std::endl
3114 <<
" type = " << type << std::endl
3115 <<
" name = " << name << std::endl;
3127 <<
" Error: duplicate correlation condition (" << name <<
")" 3140 const int nrObj = 3;
3143 int intGEq[nrObj] = { -1, -1, -1 };
3144 std::vector<GlobalObject>
objType(nrObj);
3145 std::vector<GtConditionCategory> condCateg(nrObj);
3148 const bool corrFlag =
true;
3149 int corrIndexVal[nrObj] = { -1, -1, -1 };
3158 const std::vector<esCut>&
cuts = corrCond.getCuts();
3159 for (
size_t jj = 0;
jj < cuts.size();
jj++)
3161 const esCut
cut = cuts.at(
jj);
3163 if(cut.getCutType() == esCutType::ChargeCorrelation) {
3172 double minV = cut.getMinimum().value;
3173 double maxV = cut.getMaximum().value;
3176 if(maxV > 1.0e8) maxV = 1.0e8;
3180 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3181 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3182 corrParameter.
precEtaCut = cut.getMinimum().index;
3183 cutType = cutType | 0x1;
3186 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3187 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3188 corrParameter.
precPhiCut = cut.getMinimum().index;
3189 cutType = cutType | 0x2;
3192 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3193 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3194 corrParameter.
precDRCut = cut.getMinimum().index;
3195 cutType = cutType | 0x4;
3200 corrParameter.
precMassCut = cut.getMinimum().index;
3201 cutType = cutType | 0x8;
3203 if(cut.getCutType() == esCutType::OvRmDeltaEta) {
3208 cutType = cutType | 0x10;
3209 }
else if (cut.getCutType() == esCutType::OvRmDeltaPhi) {
3214 cutType = cutType | 0x20;
3215 }
else if (cut.getCutType() == esCutType::OvRmDeltaR) {
3220 cutType = cutType | 0x40;
3229 const std::vector<esObject>&
objects = corrCond.getObjects();
3230 if(objects.size() != 3) {
3232 <<
"incorrect number of objects for the correlation condition with overlap removal " << name <<
" corrFlag " << corrFlag << std::endl;
3237 for (
size_t jj = 0;
jj < objects.size();
jj++)
3239 const esObject&
object = objects.at(
jj);
3286 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3290 }
else if(
object.getType() == esObjectType::Egamma ||
3299 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3300 switch(
object.getType()) {
3301 case esObjectType::Egamma: {
3323 object.getType() == esObjectType::ETMHF ||
3324 object.getType() == esObjectType::TOWERCOUNT ||
3332 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3333 switch(
object.getType()) {
3342 case esObjectType::ETMHF: {
3346 case esObjectType::TOWERCOUNT: {
3360 <<
"Illegal Object Type " <<
object.getType()
3361 <<
" for the correlation condition " << name << std::endl;
3371 if (intGEq[0] != intGEq[1]) {
3373 <<
"Inconsistent GEq flags for sub-conditions " 3374 <<
" for the correlation condition " << name << std::endl;
3379 gEq = (intGEq[0] != 0);
3402 std::ostringstream myCoutStream;
3403 correlationWORCond.
print(myCoutStream);
3404 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3432 unsigned int chipNr) {
3443 if (algAlias.empty()) {
3446 <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3447 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3451 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3452 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3457 const std::string& logExpression = algorithm.getExpressionInCondition();
3460 <<
" Logical expression: " << logExpression
3461 <<
" Chip number: " << chipNr
3465 int outputPin = algorithm.getIndex();
3469 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin
3475 int bitNumber = outputPin;
3478 LogDebug(
"TriggerMenuParser") <<
" Bit number: " << bitNumber
3488 std::ostringstream myCoutStream;
3489 alg.
print(myCoutStream);
3490 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
unsigned int chargeCorrelation
unsigned int precOverlapRemovalPhiCut
long long maxOverlapRemovalEtaCutValue
void setCondGEq(const bool &cGEq)
void setETMScales(ScaleParameters &scales)
long long maxMassCutValue
void setJetScales(ScaleParameters &scales)
void setAlgoAlias(const std::string &algoAliasValue)
void setCond0Index(const int &)
unsigned int chargeCorrelation
std::vector< std::pair< double, double > > etaBins
void setCond1Index(const int &)
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)
void print(std::ostream &myCout) const override
print the condition
long long minMassCutValue
virtual void setLUT_CalMuPhi(const std::string &lutName, std::vector< long long > lut)
void setScalesName(const std::string &name)
void print(std::ostream &myCout) const override
print the condition
virtual void setLUT_DeltaEta(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
void setCondRelativeBx(const int &cRelativeBx)
void setETMHfScales(ScaleParameters &scales)
void setCondChipNr(const int &cChipNr)
VDouble InvariantMass(Tau)
long long maxMassCutValue
void setCorrelationWithOverlapRemovalParameter(const CorrelationWithOverlapRemovalParameter &corrParameter)
int algoBitNumber() const
get / set algorithm bit number
virtual void setLUT_Cos(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
void setCond0Category(const l1t::GtConditionCategory &)
Container::value_type value_type
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void setExternalChannel(unsigned int extCh)
set functions
long long minOverlapRemovalEtaCutValue
void setCond0Index(const int &)
void setEGScales(ScaleParameters &scales)
long long minMassCutValue
void setTauScales(ScaleParameters &scales)
long long minTBPTCutValue
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 print(std::ostream &myCout) const override
print the condition
unsigned int precOverlapRemovalEtaCut
long long minOverlapRemovalPhiCutValue
void setETTEmScales(ScaleParameters &scales)
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
virtual void setLUT_Cosh(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
void print(std::ostream &myCout) const override
print the condition
void setObjectType(const std::vector< l1t::GlobalObject > &objType)
bin
set the eta bin as selection string.
const std::string & condName() const
get / set condition name
void setCond2Category(const l1t::GtConditionCategory &)
std::vector< std::pair< double, double > > etBins
const std::string algoName() const
get / set algorithm name
virtual void setLUT_DeltaPhi(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
void print(std::ostream &myCout) const override
print the condition
long long maxOverlapRemovalDRCutValue
void setMuonScales(ScaleParameters &scales)
void setHTTScales(ScaleParameters &scales)
void setCond0Category(const l1t::GtConditionCategory &)
std::string const & algoAlias() const
get / set algorithm alias
virtual void setLUT_Pt(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
void setHTMScales(ScaleParameters &scales)
unsigned int precOverlapRemovalDRCut
void setAlgoChipNumber(const int algoChipNumberValue)
typedef for a single object template
long long maxOverlapRemovalPhiCutValue
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
typedef for correlation parameters
long long maxTBPTCutValue
char data[epos_bytes_allocation]
long long minOverlapRemovalDRCutValue
void setETTScales(ScaleParameters &scales)
typedef for correlation parameters
void setCond1Category(const l1t::GtConditionCategory &)
typedef for correlation parameters
virtual void setLUT_CalMuEta(const std::string &lutName, std::vector< long long > lut)
unsigned int chargeCorrelation
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
virtual void setLUT_Sin(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
Power< A, B >::type pow(const A &a, const B &b)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
void setCond2Index(const int &)
void setCond1Index(const int &)
const int algoChipNumber() const
get / set algorithm bit number