32 #include <boost/cstdint.hpp> 39 #include "tmEventSetup/tmEventSetup.hh" 40 #include "tmEventSetup/esTriggerMenu.hh" 41 #include "tmEventSetup/esAlgorithm.hh" 42 #include "tmEventSetup/esCondition.hh" 43 #include "tmEventSetup/esObject.hh" 44 #include "tmEventSetup/esCut.hh" 45 #include "tmEventSetup/esScale.hh" 46 #include "tmGrammar/Algorithm.hh" 52 m_triggerMenuInterface(
"NULL"),
53 m_triggerMenuName(
"NULL"), m_triggerMenuImplementation(0x0), m_scaleDbKey(
"NULL")
72 const unsigned int& numberConditionChipsValue) {
88 const std::vector<int>& orderConditionChipValue) {
96 const unsigned int& numberPhysTriggersValue) {
133 const std::vector<std::vector<MuonTemplate> >& vecMuonTempl) {
139 const std::vector<std::vector<CaloTemplate> >& vecCaloTempl) {
145 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
153 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
160 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
166 const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
174 const std::vector<std::vector<MuonTemplate> >& corMuonTempl) {
180 const std::vector<std::vector<CaloTemplate> >& corCaloTempl) {
186 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
209 const esTriggerMenu* menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
210 const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
212 std::map<std::string, unsigned int> extBitMap;
215 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin();
216 cit != condMap.end(); cit++)
218 const esCondition& condition = cit->second;
219 if(condition.getType() == esConditionType::Externals ) {
222 const std::vector<esObject>&
objects = condition.getObjects();
223 for (
size_t jj = 0;
jj < objects.size();
jj++) {
225 const esObject
object = objects.at(
jj);
226 if(
object.getType() == esObjectType::EXT) {
228 unsigned int channelID =
object.getExternalChannelId();
270 const esTriggerMenu* menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
280 const std::map<std::string, esAlgorithm>& algoMap = menu->getAlgorithmMap();
281 const std::map<std::string, esCondition>& condMap = menu->getConditionMap();
282 const std::map<std::string, esScale>& scaleMap = menu->getScaleMap();
290 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin();
291 cit != algoMap.end(); cit++)
297 const esAlgorithm&
algo = cit->second;
303 const std::vector<std::string>& rpn_vec = algo.getRpnVector();
304 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++)
307 if (isGate(token))
continue;
309 const esCondition& condition = condMap.find(token)->second;
316 if(condition.getType() == esConditionType::SingleEgamma ||
317 condition.getType() == esConditionType::DoubleEgamma ||
318 condition.getType() == esConditionType::TripleEgamma ||
319 condition.getType() == esConditionType::QuadEgamma ||
320 condition.getType() == esConditionType::SingleTau ||
321 condition.getType() == esConditionType::DoubleTau ||
322 condition.getType() == esConditionType::TripleTau ||
323 condition.getType() == esConditionType::QuadTau ||
324 condition.getType() == esConditionType::SingleJet ||
325 condition.getType() == esConditionType::DoubleJet ||
326 condition.getType() == esConditionType::TripleJet ||
327 condition.getType() == esConditionType::QuadJet )
332 }
else if(condition.getType() == esConditionType::TotalEt ||
333 condition.getType() == esConditionType::TotalEtEM ||
334 condition.getType() == esConditionType::TotalHt ||
335 condition.getType() == esConditionType::MissingEt ||
336 condition.getType() == esConditionType::MissingHt ||
337 condition.getType() == esConditionType::MissingEtHF ||
338 condition.getType() == esConditionType::TowerCount ||
339 condition.getType() == esConditionType::MinBiasHFP0 ||
340 condition.getType() == esConditionType::MinBiasHFM0 ||
341 condition.getType() == esConditionType::MinBiasHFP1 ||
342 condition.getType() == esConditionType::MinBiasHFM1 )
347 }
else if(condition.getType() == esConditionType::SingleMuon ||
348 condition.getType() == esConditionType::DoubleMuon ||
349 condition.getType() == esConditionType::TripleMuon ||
350 condition.getType() == esConditionType::QuadMuon )
356 }
else if(condition.getType() == esConditionType::MuonMuonCorrelation ||
357 condition.getType() == esConditionType::MuonEsumCorrelation ||
358 condition.getType() == esConditionType::CaloMuonCorrelation ||
359 condition.getType() == esConditionType::CaloCaloCorrelation ||
360 condition.getType() == esConditionType::CaloEsumCorrelation ||
362 condition.getType() == esConditionType::TransverseMass )
367 }
else if(condition.getType() == esConditionType::Externals )
372 else if(condition.getType() == esConditionType::SingleEgammaOvRm ||
373 condition.getType() == esConditionType::DoubleEgammaOvRm ||
374 condition.getType() == esConditionType::TripleEgammaOvRm ||
375 condition.getType() == esConditionType::QuadEgammaOvRm ||
376 condition.getType() == esConditionType::SingleTauOvRm ||
377 condition.getType() == esConditionType::DoubleTauOvRm ||
378 condition.getType() == esConditionType::TripleTauOvRm ||
379 condition.getType() == esConditionType::QuadTauOvRm ||
380 condition.getType() == esConditionType::SingleJetOvRm ||
381 condition.getType() == esConditionType::DoubleJetOvRm ||
382 condition.getType() == esConditionType::TripleJetOvRm ||
383 condition.getType() == esConditionType::QuadJetOvRm) {
386 <<
"SingleEgammaOvRm" << std::endl
387 <<
"DoubleEgammaOvRm" << std::endl
388 <<
"TripleEgammaOvRm" << std::endl
389 <<
"QuadEgammaOvRm" << std::endl
390 <<
"SingleTauOvRm" << std::endl
391 <<
"DoubleTauOvRm" << std::endl
392 <<
"TripleTauOvRm" << std::endl
393 <<
"QuadTauOvRm" << std::endl
394 <<
"SingleJetOvRm" << std::endl
395 <<
"DoubleJetOvRm" << std::endl
396 <<
"TripleJetOvRm" << std::endl
397 <<
"QuadJetOvRm" << std::endl
398 <<
"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;
402 else if(condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
403 condition.getType() == esConditionType::InvariantMassOvRm ||
404 condition.getType() == esConditionType::TransverseMassOvRm) {
476 for (std::vector<ConditionMap>::iterator itCondOnChip =
m_conditionMap.begin(); itCondOnChip
481 itCondOnChip->clear();
496 <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." << std::endl;
501 <<
" Condition " << cName
502 <<
" already exists - not inserted!" << std::endl;
508 <<
" OK - condition inserted!" 526 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
527 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
532 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
533 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
540 LogTrace(
"TriggerMenuParser") <<
" Bit number " << bitNumber
542 <<
") - algorithm not inserted!" << std::endl;
548 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " 560 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr
562 <<
") - algorithm not inserted!" << std::endl;
571 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
573 <<
"] - algorithm not inserted!" << std::endl;
586 if ( (outputPin == iPin) && (chipNr == iChip)) {
587 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
588 <<
" is the same as for algorithm " << iName
589 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 610 std::stringstream ss;
615 std::stringstream ss;
648 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin();
649 cit != scaleMap.end(); cit++)
651 const esScale&
scale = cit->second;
655 else if (scale.getObjectType() == esObjectType::Egamma) scaleParam = &egScales;
659 else if (scale.getObjectType() == esObjectType::ETTEM) scaleParam = &ettEmScales;
661 else if (scale.getObjectType() == esObjectType::ETMHF) scaleParam = &etmHfScales;
666 if(scaleParam != 0) {
667 switch(scale.getScaleType()) {
668 case esScaleType::EtScale: {
669 scaleParam->
etMin = scale.getMinimum();
670 scaleParam->
etMax = scale.getMaximum();
671 scaleParam->
etStep = scale.getStep();
674 const std::vector<esBin> binsV = scale.getBins();
675 for(
unsigned int i=0;
i<binsV.size();
i++) {
676 const esBin&
bin = binsV.at(
i);
677 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
678 scaleParam->
etBins.push_back(binLimits);
685 scale.getObjectType() == esObjectType::ETTEM || scale.getObjectType() == esObjectType::ETMHF) {
699 case esScaleType::EtaScale: {
700 scaleParam->
etaMin = scale.getMinimum();
701 scaleParam->
etaMax = scale.getMaximum();
702 scaleParam->
etaStep = scale.getStep();
705 const std::vector<esBin> binsV = scale.getBins();
706 scaleParam->
etaBins.resize(
pow(2,scale.getNbits()));
707 for(
unsigned int i=0;
i<binsV.size();
i++) {
708 const esBin&
bin = binsV.at(
i);
709 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
710 scaleParam->
etaBins.at(bin.hw_index) = binLimits;
714 case esScaleType::PhiScale: {
715 scaleParam->
phiMin = scale.getMinimum();
716 scaleParam->
phiMax = scale.getMaximum();
717 scaleParam->
phiStep = scale.getStep();
720 const std::vector<esBin> binsV = scale.getBins();
721 scaleParam->
phiBins.resize(
pow(2,scale.getNbits()));
722 for(
unsigned int i=0;
i<binsV.size();
i++) {
723 const esBin&
bin = binsV.at(
i);
724 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
725 scaleParam->
phiBins.at(bin.hw_index) = binLimits;
751 bool hasPrecision =
false;
752 std::map<std::string, unsigned int> precisions;
753 getPrecisions(precisions, scaleMap);
754 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++)
781 parsePt_LUTS(scaleMap,
"Mass" ,
"EG", precisions[
"PRECISION-EG-MU-MassPt"] );
782 parsePt_LUTS(scaleMap,
"Mass" ,
"MU", precisions[
"PRECISION-EG-MU-MassPt"] );
783 parsePt_LUTS(scaleMap,
"Mass" ,
"JET", precisions[
"PRECISION-EG-JET-MassPt"] );
784 parsePt_LUTS(scaleMap,
"Mass" ,
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"] );
788 parsePt_LUTS(scaleMap,
"TwoBody" ,
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
789 parsePt_LUTS(scaleMap,
"TwoBody" ,
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
790 parsePt_LUTS(scaleMap,
"TwoBody" ,
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"] );
791 parsePt_LUTS(scaleMap,
"TwoBody" ,
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"] );
797 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
798 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
799 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
800 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
802 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
803 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
804 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
806 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
807 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
809 parseDeltaEta_Cosh_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
814 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
815 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
816 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
817 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETM",precisions[
"PRECISION-EG-ETM-Delta"],precisions[
"PRECISION-EG-ETM-Math"]);
818 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETMHF",precisions[
"PRECISION-EG-ETMHF-Delta"],precisions[
"PRECISION-EG-ETMHF-Math"]);
819 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"HTM",precisions[
"PRECISION-EG-HTM-Delta"],precisions[
"PRECISION-EG-HTM-Math"]);
820 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
822 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
823 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
824 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETM",precisions[
"PRECISION-JET-ETM-Delta"],precisions[
"PRECISION-JET-ETM-Math"]);
825 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETMHF",precisions[
"PRECISION-JET-ETMHF-Delta"],precisions[
"PRECISION-JET-ETMHF-Math"]);
826 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"HTM",precisions[
"PRECISION-JET-HTM-Delta"],precisions[
"PRECISION-JET-HTM-Math"]);
827 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
829 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
830 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETM",precisions[
"PRECISION-TAU-ETM-Delta"],precisions[
"PRECISION-TAU-ETM-Math"]);
831 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETMHF",precisions[
"PRECISION-TAU-ETMHF-Delta"],precisions[
"PRECISION-TAU-ETMHF-Math"]);
832 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"HTM",precisions[
"PRECISION-TAU-HTM-Delta"],precisions[
"PRECISION-TAU-HTM-Math"]);
833 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
835 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETM",precisions[
"PRECISION-MU-ETM-Delta"],precisions[
"PRECISION-MU-ETM-Math"]);
836 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETMHF",precisions[
"PRECISION-MU-ETMHF-Delta"],precisions[
"PRECISION-MU-ETMHF-Math"]);
837 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"HTM",precisions[
"PRECISION-MU-HTM-Delta"],precisions[
"PRECISION-MU-HTM-Math"]);
838 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
876 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
878 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
879 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
881 std::vector<long long> lut_cal_2_mu_eta;
882 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
904 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
906 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
907 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
910 std::vector<long long> lut_cal_2_mu_phi;
911 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
931 if( scaleMap.find(scLabel1) == scaleMap.end())
return;
933 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
935 std::vector<long long> lut_pt;
936 getLut(lut_pt, scale1, prec);
955 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
957 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
958 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
959 std::vector<double> val_delta_eta;
960 std::vector<long long> lut_delta_eta;
961 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
962 setLut(lut_delta_eta, val_delta_eta, prec1);
969 std::vector<long long> lut_cosh;
970 applyCosh(val_delta_eta, n);
971 setLut(lut_cosh, val_delta_eta, prec2);
988 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
990 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
991 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
992 std::vector<double> val_delta_phi;
993 std::vector<long long> lut_delta_phi;
994 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
995 setLut(lut_delta_phi, val_delta_phi, prec1);
1002 std::vector<long long> lut_cos;
1003 applyCos(val_delta_phi, n);
1004 setLut(lut_cos, val_delta_phi, prec2);
1018 if( scaleMap.find(scLabel) == scaleMap.end() )
return;
1021 const esScale*
scale = &scaleMap.find(scLabel)->second;
1023 const double step = scale->getStep();
1024 const double range = scale->getMaximum() - scale->getMinimum();
1025 const size_t n = std::ceil(range / step);
1026 const size_t bitwidth = std::ceil(std::log10(n) / std::log10(2));
1030 for (
size_t ii = 0;
ii <
n;
ii++)
1032 array.at(
ii) = step *
ii;
1036 std::vector<long long>
lut;
1039 setLut(lut, array, prec);
1043 setLut(lut, array, prec);
1063 unsigned int chipNr,
const bool corrFlag) {
1078 if (condMu.getType() == esConditionType::SingleMuon) {
1082 }
else if (condMu.getType() == esConditionType::DoubleMuon) {
1086 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1090 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1095 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" 1096 << type <<
")" << std::endl;
1101 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1102 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1107 <<
"\n ****************************************** " 1109 <<
"\n condition = " << condition
1110 <<
"\n particle = " << particle
1111 <<
"\n type = " << type
1112 <<
"\n name = " << name
1120 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1126 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1127 tmpValues.reserve( nrObj );
1129 if(
int(condMu.getObjects().size())!=nrObj ){
1130 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1131 <<
"condMu.getObjects().size() = " 1132 << condMu.getObjects().size()
1139 unsigned int chargeCorrelation = 1;
1140 const std::vector<esCut>&
cuts = condMu.getCuts();
1141 for (
size_t jj = 0;
jj < cuts.size();
jj++)
1143 const esCut
cut = cuts.at(
jj);
1144 if(cut.getCutType() == esCutType::ChargeCorrelation) {
1145 if( cut.getData()==
"ls" ) chargeCorrelation = 2;
1146 else if( cut.getData()==
"os" ) chargeCorrelation = 4;
1147 else chargeCorrelation = 1;
1163 const std::vector<esObject>&
objects = condMu.getObjects();
1164 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1166 const esObject
object = objects.at(
jj);
1167 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1170 relativeBx =
object.getBxOffset();
1173 int upperThresholdInd = -1;
1174 int lowerThresholdInd = 0;
1175 int upperIndexInd = -1;
1176 int lowerIndexInd = 0;
1178 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1180 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1181 int isolationLUT = 0xF;
1183 int qualityLUT = 0xFFFF;
1185 const std::vector<esCut>& cuts =
object.getCuts();
1186 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1188 const esCut
cut = cuts.at(
kk);
1190 switch(cut.getCutType()){
1192 lowerThresholdInd = cut.getMinimum().index;
1193 upperThresholdInd = cut.getMaximum().index;
1196 case esCutType::Slice:
1197 lowerIndexInd =
int(cut.getMinimum().value);
1198 upperIndexInd =
int(cut.getMaximum().value);
1204 etaWindow1Lower = cut.getMinimum().index;
1205 etaWindow1Upper = cut.getMaximum().index;
1206 }
else if(cntEta == 1) {
1207 etaWindow2Lower = cut.getMinimum().index;
1208 etaWindow2Upper = cut.getMaximum().index;
1210 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1211 << particle <<
")" << std::endl;
1221 phiWindow1Lower = cut.getMinimum().index;
1222 phiWindow1Upper = cut.getMaximum().index;
1223 }
else if(cntPhi == 1) {
1224 phiWindow2Lower = cut.getMinimum().index;
1225 phiWindow2Upper = cut.getMaximum().index;
1227 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1228 << particle <<
")" << std::endl;
1235 case esCutType::Charge:
1236 if( cut.getData()==
"positive" ) charge = 0;
1237 else if( cut.getData()==
"negative" ) charge = 1;
1245 case esCutType::Isolation: {
1258 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1259 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1261 objParameter[cnt].indexHigh = upperIndexInd;
1262 objParameter[cnt].indexLow = lowerIndexInd;
1264 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1265 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1266 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1267 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1269 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1270 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1271 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1272 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1275 objParameter[cnt].enableMip =
false;
1276 objParameter[cnt].enableIso =
false;
1277 objParameter[cnt].requestIso =
false;
1279 objParameter[cnt].charge =
charge;
1280 objParameter[cnt].qualityLUT = qualityLUT;
1281 objParameter[cnt].isolationLUT = isolationLUT;
1289 std::vector<GlobalObject> objType(nrObj,
gtMu);
1305 std::ostringstream myCoutStream;
1306 muonCond.
print(myCoutStream);
1307 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1313 <<
" Error: duplicate condition (" << name <<
")" 1318 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the ConditionMap" << std::endl;
1324 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the vecMuonTemplate vector" << std::endl;
1336 unsigned int chipNr) {
1354 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1355 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1360 <<
"\n ****************************************** " 1362 <<
"\n condition = " << condition
1363 <<
"\n particle = " << particle
1364 <<
"\n type = " << type
1365 <<
"\n name = " << name
1373 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1379 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1380 tmpValues.reserve( nrObj );
1386 unsigned int chargeCorrelation = 0;
1387 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1388 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1389 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1402 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1405 relativeBx = corrMu->getBxOffset();
1408 int upperThresholdInd = -1;
1409 int lowerThresholdInd = 0;
1410 int upperIndexInd = -1;
1411 int lowerIndexInd = 0;
1413 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1415 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1416 int isolationLUT = 0xF;
1418 int qualityLUT = 0xFFFF;
1420 const std::vector<esCut>&
cuts = corrMu->getCuts();
1421 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1423 const esCut
cut = cuts.at(
kk);
1425 switch(cut.getCutType()){
1427 lowerThresholdInd = cut.getMinimum().index;
1428 upperThresholdInd = cut.getMaximum().index;
1431 case esCutType::Slice:
1432 lowerIndexInd =
int(cut.getMinimum().value);
1433 upperIndexInd =
int(cut.getMaximum().value);
1439 etaWindow1Lower = cut.getMinimum().index;
1440 etaWindow1Upper = cut.getMaximum().index;
1441 }
else if(cntEta == 1) {
1442 etaWindow2Lower = cut.getMinimum().index;
1443 etaWindow2Upper = cut.getMaximum().index;
1445 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1446 << particle <<
")" << std::endl;
1456 phiWindow1Lower = cut.getMinimum().index;
1457 phiWindow1Upper = cut.getMaximum().index;
1458 }
else if(cntPhi == 1) {
1459 phiWindow2Lower = cut.getMinimum().index;
1460 phiWindow2Upper = cut.getMaximum().index;
1462 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1463 << particle <<
")" << std::endl;
1470 case esCutType::Charge:
1471 if( cut.getData()==
"positive" ) charge = 0;
1472 else if( cut.getData()==
"negative" ) charge = 1;
1480 case esCutType::Isolation: {
1493 objParameter[0].ptHighThreshold = upperThresholdInd;
1494 objParameter[0].ptLowThreshold = lowerThresholdInd;
1496 objParameter[0].indexHigh = upperIndexInd;
1497 objParameter[0].indexLow = lowerIndexInd;
1499 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1500 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1501 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1502 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1504 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1505 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1506 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1507 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1510 objParameter[0].enableMip =
false;
1511 objParameter[0].enableIso =
false;
1512 objParameter[0].requestIso =
false;
1514 objParameter[0].charge =
charge;
1515 objParameter[0].qualityLUT = qualityLUT;
1516 objParameter[0].isolationLUT = isolationLUT;
1520 std::vector<GlobalObject> objType(nrObj,
gtMu);
1533 std::ostringstream myCoutStream;
1534 muonCond.
print(myCoutStream);
1535 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1571 unsigned int chipNr,
const bool corrFlag) {
1585 <<
"\n ****************************************** " 1586 <<
"\n (in parseCalo) " 1587 <<
"\n condition = " << condition
1588 <<
"\n particle = " << particle
1589 <<
"\n type = " << type
1590 <<
"\n name = " << name
1601 if (condCalo.getType() == esConditionType::SingleEgamma) {
1606 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1611 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1616 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1621 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1622 caloObjType =
gtJet;
1626 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1627 caloObjType =
gtJet;
1631 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1632 caloObjType =
gtJet;
1636 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1637 caloObjType =
gtJet;
1641 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1642 caloObjType =
gtTau;
1646 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1647 caloObjType =
gtTau;
1651 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1652 caloObjType =
gtTau;
1656 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1657 caloObjType =
gtTau;
1662 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1663 << particle <<
")" << std::endl;
1670 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1671 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1678 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1684 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1685 tmpValues.reserve( nrObj );
1688 if(
int(condCalo.getObjects().size())!=nrObj ){
1689 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1690 <<
"condCalo.getObjects().size() = " 1691 << condCalo.getObjects().size()
1707 const std::vector<esObject>&
objects = condCalo.getObjects();
1708 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1710 const esObject
object = objects.at(
jj);
1711 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1714 relativeBx =
object.getBxOffset();
1717 int upperThresholdInd = -1;
1718 int lowerThresholdInd = 0;
1719 int upperIndexInd = -1;
1720 int lowerIndexInd = 0;
1722 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1724 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1725 int isolationLUT = 0xF;
1726 int qualityLUT = 0xF;
1729 const std::vector<esCut>&
cuts =
object.getCuts();
1730 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1732 const esCut
cut = cuts.at(
kk);
1734 switch(cut.getCutType()){
1736 lowerThresholdInd = cut.getMinimum().index;
1737 upperThresholdInd = cut.getMaximum().index;
1739 case esCutType::Slice:
1740 lowerIndexInd =
int(cut.getMinimum().value);
1741 upperIndexInd =
int(cut.getMaximum().value);
1746 etaWindow1Lower = cut.getMinimum().index;
1747 etaWindow1Upper = cut.getMaximum().index;
1748 }
else if(cntEta == 1) {
1749 etaWindow2Lower = cut.getMinimum().index;
1750 etaWindow2Upper = cut.getMaximum().index;
1752 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 1753 << particle <<
")" << std::endl;
1763 phiWindow1Lower = cut.getMinimum().index;
1764 phiWindow1Upper = cut.getMaximum().index;
1765 }
else if(cntPhi == 1) {
1766 phiWindow2Lower = cut.getMinimum().index;
1767 phiWindow2Upper = cut.getMaximum().index;
1769 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 1770 << particle <<
")" << std::endl;
1777 case esCutType::Charge: {
1779 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 1780 << particle <<
")" << std::endl;
1789 case esCutType::Isolation: {
1801 objParameter[cnt].etHighThreshold = upperThresholdInd;
1802 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1803 objParameter[cnt].indexHigh = upperIndexInd;
1804 objParameter[cnt].indexLow = lowerIndexInd;
1805 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1806 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1807 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1808 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1809 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1810 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1811 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1812 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1813 objParameter[cnt].isolationLUT = isolationLUT;
1814 objParameter[cnt].qualityLUT = qualityLUT;
1818 <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " 1819 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
1820 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1821 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1822 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1823 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1824 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1825 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1826 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1827 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1828 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1829 << objParameter[cnt].isolationLUT
1830 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" 1831 << objParameter[cnt].qualityLUT <<
std::dec 1840 std::vector<GlobalObject> objType(nrObj, caloObjType);
1862 std::ostringstream myCoutStream;
1863 caloCond.
print(myCoutStream);
1864 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1873 <<
" Error: duplicate condition (" << name <<
")" 1908 unsigned int chipNr) {
1922 <<
"\n ****************************************** " 1923 <<
"\n (in parseCalo) " 1924 <<
"\n condition = " << condition
1925 <<
"\n particle = " << particle
1926 <<
"\n type = " << type
1927 <<
"\n name = " << name
1939 if (corrCalo->getType() == esObjectType::Egamma) {
1942 caloObjType =
gtJet;
1944 caloObjType =
gtTau;
1946 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1947 << particle <<
")" << std::endl;
1955 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1956 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1963 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1969 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1970 tmpValues.reserve( nrObj );
1979 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1982 relativeBx = corrCalo->getBxOffset();
1985 int upperThresholdInd = -1;
1986 int lowerThresholdInd = 0;
1987 int upperIndexInd = -1;
1988 int lowerIndexInd = 0;
1990 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1992 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1993 int isolationLUT = 0xF;
1994 int qualityLUT = 0xF;
1997 const std::vector<esCut>&
cuts = corrCalo->getCuts();
1998 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2000 const esCut
cut = cuts.at(
kk);
2002 switch(cut.getCutType()){
2004 lowerThresholdInd = cut.getMinimum().index;
2005 upperThresholdInd = cut.getMaximum().index;
2007 case esCutType::Slice:
2008 lowerIndexInd =
int(cut.getMinimum().value);
2009 upperIndexInd =
int(cut.getMaximum().value);
2014 etaWindow1Lower = cut.getMinimum().index;
2015 etaWindow1Upper = cut.getMaximum().index;
2016 }
else if(cntEta == 1) {
2017 etaWindow2Lower = cut.getMinimum().index;
2018 etaWindow2Upper = cut.getMaximum().index;
2020 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 2021 << particle <<
")" << std::endl;
2031 phiWindow1Lower = cut.getMinimum().index;
2032 phiWindow1Upper = cut.getMaximum().index;
2033 }
else if(cntPhi == 1) {
2034 phiWindow2Lower = cut.getMinimum().index;
2035 phiWindow2Upper = cut.getMaximum().index;
2037 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 2038 << particle <<
")" << std::endl;
2045 case esCutType::Charge: {
2047 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 2048 << particle <<
")" << std::endl;
2057 case esCutType::Isolation: {
2069 objParameter[0].etLowThreshold = lowerThresholdInd;
2070 objParameter[0].etHighThreshold = upperThresholdInd;
2071 objParameter[0].indexHigh = upperIndexInd;
2072 objParameter[0].indexLow = lowerIndexInd;
2073 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2074 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2075 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2076 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2077 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2078 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2079 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2080 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2081 objParameter[0].isolationLUT = isolationLUT;
2082 objParameter[0].qualityLUT = qualityLUT;
2086 <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " <<
" = " 2087 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold
2088 <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x" 2089 << objParameter[0].etaWindow1Lower <<
" / 0x" << objParameter[0].etaWindow1Upper
2090 <<
"\n etaWindowVeto Lower / Upper for calo object " <<
" = 0x" 2091 << objParameter[0].etaWindow2Lower <<
" / 0x" << objParameter[0].etaWindow2Upper
2092 <<
"\n phiWindow Lower / Upper for calo object " <<
" = 0x" 2093 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2094 <<
"\n phiWindowVeto Lower / Upper for calo object " <<
" = 0x" 2095 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2096 <<
"\n Isolation LUT for calo object " <<
" = 0x" 2097 << objParameter[0].isolationLUT
2098 <<
"\n Quality LUT for calo object " <<
" = 0x" 2099 << objParameter[0].qualityLUT <<
std::dec 2107 std::vector<GlobalObject> objType(nrObj, caloObjType);
2129 std::ostringstream myCoutStream;
2130 caloCond.
print(myCoutStream);
2131 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2169 unsigned int chipNr,
const bool corrFlag) {
2182 <<
"\n ****************************************** " 2183 <<
"\n (in parseEnergySum) " 2184 <<
"\n condition = " << condition
2185 <<
"\n type = " << type
2186 <<
"\n name = " << name
2195 if( condEnergySum.getType() == esConditionType::MissingEt ){
2199 else if( condEnergySum.getType() == esConditionType::TotalEt ){
2203 else if( condEnergySum.getType() == esConditionType::TotalEtEM ){
2207 else if( condEnergySum.getType() == esConditionType::TotalHt ){
2211 else if( condEnergySum.getType() == esConditionType::MissingHt ){
2215 else if( condEnergySum.getType() == esConditionType::MissingEtHF ){
2219 else if( condEnergySum.getType() == esConditionType::TowerCount ){
2223 else if( condEnergySum.getType() == esConditionType::MinBiasHFP0 ){
2227 else if( condEnergySum.getType() == esConditionType::MinBiasHFM0 ){
2231 else if( condEnergySum.getType() == esConditionType::MinBiasHFP1 ){
2235 else if( condEnergySum.getType() == esConditionType::MinBiasHFM1 ){
2241 <<
"Wrong type for energy-sum condition (" << type
2242 <<
")" << std::endl;
2256 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2268 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2269 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2271 const esObject
object = objects.at(
jj);
2272 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2275 relativeBx =
object.getBxOffset();
2278 int lowerThresholdInd = 0;
2279 int upperThresholdInd = -1;
2281 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2284 const std::vector<esCut>&
cuts =
object.getCuts();
2285 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2287 const esCut
cut = cuts.at(
kk);
2289 switch(cut.getCutType()){
2291 lowerThresholdInd = cut.getMinimum().index;
2292 upperThresholdInd = cut.getMaximum().index;
2301 phiWindow1Lower = cut.getMinimum().index;
2302 phiWindow1Upper = cut.getMaximum().index;
2303 }
else if(cntPhi == 1) {
2304 phiWindow2Lower = cut.getMinimum().index;
2305 phiWindow2Upper = cut.getMaximum().index;
2307 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2308 << type <<
")" << std::endl;
2316 case esCutType::Count:
2317 lowerThresholdInd = cut.getMinimum().index;
2318 upperThresholdInd = 0xffffff;
2330 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2331 objParameter[cnt].etHighThreshold = upperThresholdInd;
2332 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2333 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2334 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2335 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2340 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2341 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
2342 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2343 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2344 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2345 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper <<
std::dec 2352 std::vector<GlobalObject> objType(nrObj, energySumObjType);
2368 std::ostringstream myCoutStream;
2369 energySumCond.
print(myCoutStream);
2370 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2378 <<
" Error: duplicate condition (" << name <<
")" 2414 unsigned int chipNr) {
2427 <<
"\n ****************************************** " 2428 <<
"\n (in parseEnergySum) " 2429 <<
"\n condition = " << condition
2430 <<
"\n type = " << type
2431 <<
"\n name = " << name
2448 else if( corrESum->getType()== esObjectType::ETMHF ){
2452 else if( corrESum->getType()== esObjectType::TOWERCOUNT ){
2458 <<
"Wrong type for energy-sum correclation condition (" << type
2459 <<
")" << std::endl;
2473 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2485 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2488 relativeBx = corrESum->getBxOffset();
2491 int lowerThresholdInd = 0;
2492 int upperThresholdInd = -1;
2494 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2497 const std::vector<esCut>&
cuts = corrESum->getCuts();
2498 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2500 const esCut
cut = cuts.at(
kk);
2502 switch(cut.getCutType()){
2504 lowerThresholdInd = cut.getMinimum().index;
2505 upperThresholdInd = cut.getMaximum().index;
2514 phiWindow1Lower = cut.getMinimum().index;
2515 phiWindow1Upper = cut.getMaximum().index;
2516 }
else if(cntPhi == 1) {
2517 phiWindow2Lower = cut.getMinimum().index;
2518 phiWindow2Upper = cut.getMaximum().index;
2520 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2521 << type <<
")" << std::endl;
2538 objParameter[0].etLowThreshold = lowerThresholdInd;
2539 objParameter[0].etHighThreshold = upperThresholdInd;
2540 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2541 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2542 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2543 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2548 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2549 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2550 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2551 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2552 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2553 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper <<
std::dec 2558 std::vector<GlobalObject> objType(nrObj, energySumObjType);
2574 std::ostringstream myCoutStream;
2575 energySumCond.
print(myCoutStream);
2576 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2617 unsigned int chipNr) {
2631 <<
"\n ****************************************** " 2632 <<
"\n (in parseExternal) " 2633 <<
"\n condition = " << condition
2634 <<
"\n particle = " << particle
2635 <<
"\n type = " << type
2636 <<
"\n name = " << name
2647 unsigned int channelID = 0;
2650 const std::vector<esObject>&
objects = condExt.getObjects();
2651 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2653 const esObject
object = objects.at(
jj);
2654 if(
object.getType() == esObjectType::EXT) {
2655 relativeBx =
object.getBxOffset();
2656 channelID =
object.getExternalChannelId();
2665 std::vector<GlobalObject> objType(nrObj, extSignalType);
2678 << externalCond <<
"\n" << std::endl;
2684 <<
" Error: duplicate condition (" << name
2685 <<
")" << std::endl;
2711 tmeventsetup::esCondition corrCond,
2712 unsigned int chipNr) {
2721 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2722 <<
" (in parseCorrelation) " << std::endl
2723 <<
" condition = " << condition << std::endl
2724 <<
" particle = " << particle << std::endl
2725 <<
" type = " << type << std::endl
2726 <<
" name = " << name << std::endl;
2738 <<
" Error: duplicate correlation condition (" << name <<
")" 2751 const int nrObj = 2;
2754 int intGEq[nrObj] = { -1, -1 };
2755 std::vector<GlobalObject> objType(nrObj);
2756 std::vector<GtConditionCategory> condCateg(nrObj);
2759 const bool corrFlag =
true;
2760 int corrIndexVal[nrObj] = { -1, -1 };
2769 const std::vector<esCut>&
cuts = corrCond.getCuts();
2770 for (
size_t jj = 0;
jj < cuts.size();
jj++)
2772 const esCut
cut = cuts.at(
jj);
2774 if(cut.getCutType() == esCutType::ChargeCorrelation) {
2783 double minV = cut.getMinimum().value;
2784 double maxV = cut.getMaximum().value;
2787 if(maxV > 1.0e8) maxV = 1.0e8;
2790 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2791 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2792 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2793 corrParameter.
precEtaCut = cut.getMinimum().index;
2794 cutType = cutType | 0x1;
2796 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2797 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2798 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2799 corrParameter.
precPhiCut = cut.getMinimum().index;
2800 cutType = cutType | 0x2;
2802 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaR Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2803 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2804 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2805 corrParameter.
precDRCut = cut.getMinimum().index;
2806 cutType = cutType | 0x4;
2807 }
else if (cut.getCutType() == esCutType::TwoBodyPt) {
2810 corrParameter.
precTBPTCut = cut.getMinimum().index;
2811 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tTPBT Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2812 cutType = cutType | 0x20;
2814 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tMass Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2817 corrParameter.
precMassCut = cut.getMinimum().index;
2819 if (corrCond.getType() == esConditionType::TransverseMass){
2820 cutType = cutType | 0x10;
2823 cutType = cutType | 0x8;
2833 const std::vector<esObject>&
objects = corrCond.getObjects();
2834 if(objects.size() != 2) {
2836 <<
"incorrect number of objects for the correlation condition " << name <<
" corrFlag " << corrFlag << std::endl;
2841 for (
size_t jj = 0;
jj < objects.size();
jj++)
2843 const esObject
object = objects.at(
jj);
2889 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2893 }
else if(
object.getType() == esObjectType::Egamma ||
2902 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2903 switch(
object.getType()) {
2904 case esObjectType::Egamma: {
2926 object.getType() == esObjectType::ETMHF ||
2927 object.getType() == esObjectType::TOWERCOUNT ||
2935 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2936 switch(
object.getType()) {
2945 case esObjectType::ETMHF: {
2949 case esObjectType::TOWERCOUNT: {
2963 <<
"Illegal Object Type " <<
object.getType()
2964 <<
" for the correlation condition " << name << std::endl;
2974 if (intGEq[0] != intGEq[1]) {
2976 <<
"Inconsistent GEq flags for sub-conditions " 2977 <<
" for the correlation condition " << name << std::endl;
2982 gEq = (intGEq[0] != 0);
3003 std::ostringstream myCoutStream;
3004 correlationCond.
print(myCoutStream);
3005 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3033 const tmeventsetup::esCondition& corrCond,
3034 unsigned int chipNr) {
3043 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3044 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3045 <<
" condition = " << condition << std::endl
3046 <<
" particle = " << particle << std::endl
3047 <<
" type = " << type << std::endl
3048 <<
" name = " << name << std::endl;
3060 <<
" Error: duplicate correlation condition (" << name <<
")" 3073 const int nrObj = 3;
3076 int intGEq[nrObj] = { -1, -1, -1 };
3077 std::vector<GlobalObject> objType(nrObj);
3078 std::vector<GtConditionCategory> condCateg(nrObj);
3081 const bool corrFlag =
true;
3082 int corrIndexVal[nrObj] = { -1, -1, -1 };
3091 const std::vector<esCut>&
cuts = corrCond.getCuts();
3092 for (
size_t jj = 0;
jj < cuts.size();
jj++)
3094 const esCut
cut = cuts.at(
jj);
3096 if(cut.getCutType() == esCutType::ChargeCorrelation) {
3105 double minV = cut.getMinimum().value;
3106 double maxV = cut.getMaximum().value;
3109 if(maxV > 1.0e8) maxV = 1.0e8;
3113 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3114 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3115 corrParameter.
precEtaCut = cut.getMinimum().index;
3116 cutType = cutType | 0x1;
3119 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3120 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3121 corrParameter.
precPhiCut = cut.getMinimum().index;
3122 cutType = cutType | 0x2;
3125 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3126 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3127 corrParameter.
precDRCut = cut.getMinimum().index;
3128 cutType = cutType | 0x4;
3133 corrParameter.
precMassCut = cut.getMinimum().index;
3134 cutType = cutType | 0x8;
3136 if(cut.getCutType() == esCutType::OvRmDeltaEta) {
3141 cutType = cutType | 0x10;
3142 }
else if (cut.getCutType() == esCutType::OvRmDeltaPhi) {
3147 cutType = cutType | 0x20;
3148 }
else if (cut.getCutType() == esCutType::OvRmDeltaR) {
3153 cutType = cutType | 0x40;
3162 const std::vector<esObject>&
objects = corrCond.getObjects();
3163 if(objects.size() != 3) {
3165 <<
"incorrect number of objects for the correlation condition with overlap removal " << name <<
" corrFlag " << corrFlag << std::endl;
3170 for (
size_t jj = 0;
jj < objects.size();
jj++)
3172 const esObject&
object = objects.at(
jj);
3219 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3223 }
else if(
object.getType() == esObjectType::Egamma ||
3232 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3233 switch(
object.getType()) {
3234 case esObjectType::Egamma: {
3256 object.getType() == esObjectType::ETMHF ||
3257 object.getType() == esObjectType::TOWERCOUNT ||
3265 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3266 switch(
object.getType()) {
3275 case esObjectType::ETMHF: {
3279 case esObjectType::TOWERCOUNT: {
3293 <<
"Illegal Object Type " <<
object.getType()
3294 <<
" for the correlation condition " << name << std::endl;
3304 if (intGEq[0] != intGEq[1]) {
3306 <<
"Inconsistent GEq flags for sub-conditions " 3307 <<
" for the correlation condition " << name << std::endl;
3312 gEq = (intGEq[0] != 0);
3335 std::ostringstream myCoutStream;
3336 correlationWORCond.
print(myCoutStream);
3337 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3365 unsigned int chipNr) {
3376 if (algAlias ==
"") {
3379 <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3380 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3384 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3385 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3390 std::string logExpression = algorithm.getExpressionInCondition();
3393 <<
" Logical expression: " << logExpression
3394 <<
" Chip number: " << chipNr
3398 int outputPin = algorithm.getIndex();
3402 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin
3408 int bitNumber = outputPin;
3411 LogDebug(
"TriggerMenuParser") <<
" Bit number: " << bitNumber
3421 std::ostringstream myCoutStream;
3422 alg.
print(myCoutStream);
3423 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 &)
virtual void print(std::ostream &myCout) const
print the condition
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)
long long minMassCutValue
virtual void setLUT_CalMuPhi(const std::string &lutName, std::vector< long long > lut)
void setScalesName(const std::string &name)
virtual void setLUT_DeltaEta(const std::string &lutName, std::vector< long long > lut, unsigned int precision)
virtual void print(std::ostream &myCout) const
print the condition
void setCondRelativeBx(const int &cRelativeBx)
void setETMHfScales(ScaleParameters &scales)
virtual void print(std::ostream &myCout) const
print the condition
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
virtual void print(std::ostream &myCout) const
print the condition
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
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 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)
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 print(std::ostream &myCout) const
print the condition
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