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 )
348 }
else if(condition.getType() == esConditionType::SingleMuon ||
349 condition.getType() == esConditionType::DoubleMuon ||
350 condition.getType() == esConditionType::TripleMuon ||
351 condition.getType() == esConditionType::QuadMuon )
357 }
else if(condition.getType() == esConditionType::MuonMuonCorrelation ||
358 condition.getType() == esConditionType::MuonEsumCorrelation ||
359 condition.getType() == esConditionType::CaloMuonCorrelation ||
360 condition.getType() == esConditionType::CaloCaloCorrelation ||
361 condition.getType() == esConditionType::CaloEsumCorrelation ||
363 condition.getType() == esConditionType::TransverseMass )
368 }
else if(condition.getType() == esConditionType::Externals )
373 else if(condition.getType() == esConditionType::SingleEgammaOvRm ||
374 condition.getType() == esConditionType::DoubleEgammaOvRm ||
375 condition.getType() == esConditionType::TripleEgammaOvRm ||
376 condition.getType() == esConditionType::QuadEgammaOvRm ||
377 condition.getType() == esConditionType::SingleTauOvRm ||
378 condition.getType() == esConditionType::DoubleTauOvRm ||
379 condition.getType() == esConditionType::TripleTauOvRm ||
380 condition.getType() == esConditionType::QuadTauOvRm ||
381 condition.getType() == esConditionType::SingleJetOvRm ||
382 condition.getType() == esConditionType::DoubleJetOvRm ||
383 condition.getType() == esConditionType::TripleJetOvRm ||
384 condition.getType() == esConditionType::QuadJetOvRm) {
387 <<
"SingleEgammaOvRm" << std::endl
388 <<
"DoubleEgammaOvRm" << std::endl
389 <<
"TripleEgammaOvRm" << std::endl
390 <<
"QuadEgammaOvRm" << std::endl
391 <<
"SingleTauOvRm" << std::endl
392 <<
"DoubleTauOvRm" << std::endl
393 <<
"TripleTauOvRm" << std::endl
394 <<
"QuadTauOvRm" << std::endl
395 <<
"SingleJetOvRm" << std::endl
396 <<
"DoubleJetOvRm" << std::endl
397 <<
"TripleJetOvRm" << std::endl
398 <<
"QuadJetOvRm" << std::endl
399 <<
"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;
403 else if(condition.getType() == esConditionType::CaloCaloCorrelationOvRm ||
404 condition.getType() == esConditionType::InvariantMassOvRm ||
405 condition.getType() == esConditionType::TransverseMassOvRm) {
477 for (std::vector<ConditionMap>::iterator itCondOnChip =
m_conditionMap.begin(); itCondOnChip
482 itCondOnChip->clear();
497 <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." << std::endl;
502 <<
" Condition " << cName
503 <<
" already exists - not inserted!" << std::endl;
509 <<
" OK - condition inserted!" 527 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
528 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
533 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
534 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
541 LogTrace(
"TriggerMenuParser") <<
" Bit number " << bitNumber
543 <<
") - algorithm not inserted!" << std::endl;
549 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed " 561 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr
563 <<
") - algorithm not inserted!" << std::endl;
572 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
574 <<
"] - algorithm not inserted!" << std::endl;
587 if ( (outputPin == iPin) && (chipNr == iChip)) {
588 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
589 <<
" is the same as for algorithm " << iName
590 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!" 611 std::stringstream ss;
616 std::stringstream ss;
649 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin();
650 cit != scaleMap.end(); cit++)
652 const esScale&
scale = cit->second;
656 else if (scale.getObjectType() == esObjectType::Egamma) scaleParam = &egScales;
660 else if (scale.getObjectType() == esObjectType::ETTEM) scaleParam = &ettEmScales;
662 else if (scale.getObjectType() == esObjectType::ETMHF) scaleParam = &etmHfScales;
665 else scaleParam =
nullptr;
667 if(scaleParam !=
nullptr) {
668 switch(scale.getScaleType()) {
669 case esScaleType::EtScale: {
670 scaleParam->
etMin = scale.getMinimum();
671 scaleParam->
etMax = scale.getMaximum();
672 scaleParam->
etStep = scale.getStep();
675 const std::vector<esBin>& binsV = scale.getBins();
676 for(
unsigned int i=0;
i<binsV.size();
i++) {
677 const esBin&
bin = binsV.at(
i);
678 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
679 scaleParam->
etBins.push_back(binLimits);
686 scale.getObjectType() == esObjectType::ETTEM || scale.getObjectType() == esObjectType::ETMHF) {
700 case esScaleType::EtaScale: {
701 scaleParam->
etaMin = scale.getMinimum();
702 scaleParam->
etaMax = scale.getMaximum();
703 scaleParam->
etaStep = scale.getStep();
706 const std::vector<esBin>& binsV = scale.getBins();
707 scaleParam->
etaBins.resize(
pow(2,scale.getNbits()));
708 for(
unsigned int i=0;
i<binsV.size();
i++) {
709 const esBin&
bin = binsV.at(
i);
710 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
711 scaleParam->
etaBins.at(bin.hw_index) = binLimits;
715 case esScaleType::PhiScale: {
716 scaleParam->
phiMin = scale.getMinimum();
717 scaleParam->
phiMax = scale.getMaximum();
718 scaleParam->
phiStep = scale.getStep();
721 const std::vector<esBin>& binsV = scale.getBins();
722 scaleParam->
phiBins.resize(
pow(2,scale.getNbits()));
723 for(
unsigned int i=0;
i<binsV.size();
i++) {
724 const esBin&
bin = binsV.at(
i);
725 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
726 scaleParam->
phiBins.at(bin.hw_index) = binLimits;
752 bool hasPrecision =
false;
753 std::map<std::string, unsigned int> precisions;
754 getPrecisions(precisions, scaleMap);
755 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++)
782 parsePt_LUTS(scaleMap,
"Mass" ,
"EG", precisions[
"PRECISION-EG-MU-MassPt"] );
783 parsePt_LUTS(scaleMap,
"Mass" ,
"MU", precisions[
"PRECISION-EG-MU-MassPt"] );
784 parsePt_LUTS(scaleMap,
"Mass" ,
"JET", precisions[
"PRECISION-EG-JET-MassPt"] );
785 parsePt_LUTS(scaleMap,
"Mass" ,
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"] );
786 parsePt_LUTS(scaleMap,
"Mass" ,
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"] );
787 parsePt_LUTS(scaleMap,
"Mass" ,
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"] );
788 parsePt_LUTS(scaleMap,
"Mass" ,
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"] );
792 parsePt_LUTS(scaleMap,
"TwoBody" ,
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
793 parsePt_LUTS(scaleMap,
"TwoBody" ,
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
794 parsePt_LUTS(scaleMap,
"TwoBody" ,
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"] );
795 parsePt_LUTS(scaleMap,
"TwoBody" ,
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"] );
796 parsePt_LUTS(scaleMap,
"TwoBody" ,
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"] );
797 parsePt_LUTS(scaleMap,
"TwoBody" ,
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"] );
798 parsePt_LUTS(scaleMap,
"TwoBody" ,
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"] );
804 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
805 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
806 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
807 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
809 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
810 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
811 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
813 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
814 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
816 parseDeltaEta_Cosh_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
821 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
822 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
823 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
824 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETM",precisions[
"PRECISION-EG-ETM-Delta"],precisions[
"PRECISION-EG-ETM-Math"]);
825 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETMHF",precisions[
"PRECISION-EG-ETMHF-Delta"],precisions[
"PRECISION-EG-ETMHF-Math"]);
826 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"HTM",precisions[
"PRECISION-EG-HTM-Delta"],precisions[
"PRECISION-EG-HTM-Math"]);
827 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
829 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
830 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
831 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETM",precisions[
"PRECISION-JET-ETM-Delta"],precisions[
"PRECISION-JET-ETM-Math"]);
832 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETMHF",precisions[
"PRECISION-JET-ETMHF-Delta"],precisions[
"PRECISION-JET-ETMHF-Math"]);
833 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"HTM",precisions[
"PRECISION-JET-HTM-Delta"],precisions[
"PRECISION-JET-HTM-Math"]);
834 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
836 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
837 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETM",precisions[
"PRECISION-TAU-ETM-Delta"],precisions[
"PRECISION-TAU-ETM-Math"]);
838 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETMHF",precisions[
"PRECISION-TAU-ETMHF-Delta"],precisions[
"PRECISION-TAU-ETMHF-Math"]);
839 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"HTM",precisions[
"PRECISION-TAU-HTM-Delta"],precisions[
"PRECISION-TAU-HTM-Math"]);
840 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
842 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETM",precisions[
"PRECISION-MU-ETM-Delta"],precisions[
"PRECISION-MU-ETM-Math"]);
843 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETMHF",precisions[
"PRECISION-MU-ETMHF-Delta"],precisions[
"PRECISION-MU-ETMHF-Math"]);
844 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"HTM",precisions[
"PRECISION-MU-HTM-Delta"],precisions[
"PRECISION-MU-HTM-Math"]);
845 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
883 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
885 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
886 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
888 std::vector<long long> lut_cal_2_mu_eta;
889 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
911 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
913 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
914 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
917 std::vector<long long> lut_cal_2_mu_phi;
918 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
938 if( scaleMap.find(scLabel1) == scaleMap.end())
return;
940 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
942 std::vector<long long> lut_pt;
943 getLut(lut_pt, scale1, prec);
962 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
964 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
965 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
966 std::vector<double> val_delta_eta;
967 std::vector<long long> lut_delta_eta;
968 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
969 setLut(lut_delta_eta, val_delta_eta, prec1);
976 std::vector<long long> lut_cosh;
977 applyCosh(val_delta_eta, n);
978 setLut(lut_cosh, val_delta_eta, prec2);
995 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
997 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
998 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
999 std::vector<double> val_delta_phi;
1000 std::vector<long long> lut_delta_phi;
1001 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
1002 setLut(lut_delta_phi, val_delta_phi, prec1);
1009 std::vector<long long> lut_cos;
1010 applyCos(val_delta_phi, n);
1011 setLut(lut_cos, val_delta_phi, prec2);
1025 if( scaleMap.find(scLabel) == scaleMap.end() )
return;
1028 const esScale*
scale = &scaleMap.find(scLabel)->second;
1030 const double step = scale->getStep();
1031 const double range = scale->getMaximum() - scale->getMinimum();
1032 const size_t n = std::ceil(range / step);
1033 const size_t bitwidth = std::ceil(std::log10(n) / std::log10(2));
1037 for (
size_t ii = 0;
ii <
n;
ii++)
1039 array.at(
ii) = step *
ii;
1043 std::vector<long long>
lut;
1046 setLut(lut, array, prec);
1050 setLut(lut, array, prec);
1070 unsigned int chipNr,
const bool corrFlag) {
1085 if (condMu.getType() == esConditionType::SingleMuon) {
1089 }
else if (condMu.getType() == esConditionType::DoubleMuon) {
1093 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1097 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1102 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" 1103 << type <<
")" << std::endl;
1108 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1109 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1114 <<
"\n ****************************************** " 1116 <<
"\n condition = " << condition
1117 <<
"\n particle = " << particle
1118 <<
"\n type = " << type
1119 <<
"\n name = " << name
1127 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1133 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1134 tmpValues.reserve( nrObj );
1136 if(
int(condMu.getObjects().size())!=nrObj ){
1137 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1138 <<
"condMu.getObjects().size() = " 1139 << condMu.getObjects().size()
1146 unsigned int chargeCorrelation = 1;
1147 const std::vector<esCut>&
cuts = condMu.getCuts();
1148 for (
size_t jj = 0;
jj < cuts.size();
jj++)
1150 const esCut
cut = cuts.at(
jj);
1151 if(cut.getCutType() == esCutType::ChargeCorrelation) {
1152 if( cut.getData()==
"ls" ) chargeCorrelation = 2;
1153 else if( cut.getData()==
"os" ) chargeCorrelation = 4;
1154 else chargeCorrelation = 1;
1170 const std::vector<esObject>&
objects = condMu.getObjects();
1171 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1173 const esObject
object = objects.at(
jj);
1174 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1177 relativeBx =
object.getBxOffset();
1180 int upperThresholdInd = -1;
1181 int lowerThresholdInd = 0;
1182 int upperIndexInd = -1;
1183 int lowerIndexInd = 0;
1185 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1187 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1188 int isolationLUT = 0xF;
1190 int qualityLUT = 0xFFFF;
1192 const std::vector<esCut>& cuts =
object.getCuts();
1193 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1195 const esCut
cut = cuts.at(
kk);
1197 switch(cut.getCutType()){
1199 lowerThresholdInd = cut.getMinimum().index;
1200 upperThresholdInd = cut.getMaximum().index;
1203 case esCutType::Slice:
1204 lowerIndexInd =
int(cut.getMinimum().value);
1205 upperIndexInd =
int(cut.getMaximum().value);
1211 etaWindow1Lower = cut.getMinimum().index;
1212 etaWindow1Upper = cut.getMaximum().index;
1213 }
else if(cntEta == 1) {
1214 etaWindow2Lower = cut.getMinimum().index;
1215 etaWindow2Upper = cut.getMaximum().index;
1217 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1218 << particle <<
")" << std::endl;
1228 phiWindow1Lower = cut.getMinimum().index;
1229 phiWindow1Upper = cut.getMaximum().index;
1230 }
else if(cntPhi == 1) {
1231 phiWindow2Lower = cut.getMinimum().index;
1232 phiWindow2Upper = cut.getMaximum().index;
1234 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1235 << particle <<
")" << std::endl;
1242 case esCutType::Charge:
1243 if( cut.getData()==
"positive" ) charge = 0;
1244 else if( cut.getData()==
"negative" ) charge = 1;
1252 case esCutType::Isolation: {
1265 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1266 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1268 objParameter[cnt].indexHigh = upperIndexInd;
1269 objParameter[cnt].indexLow = lowerIndexInd;
1271 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1272 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1273 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1274 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1276 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1277 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1278 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1279 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1282 objParameter[cnt].enableMip =
false;
1283 objParameter[cnt].enableIso =
false;
1284 objParameter[cnt].requestIso =
false;
1286 objParameter[cnt].charge =
charge;
1287 objParameter[cnt].qualityLUT = qualityLUT;
1288 objParameter[cnt].isolationLUT = isolationLUT;
1312 std::ostringstream myCoutStream;
1313 muonCond.
print(myCoutStream);
1314 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1320 <<
" Error: duplicate condition (" << name <<
")" 1325 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the ConditionMap" << std::endl;
1331 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the vecMuonTemplate vector" << std::endl;
1343 unsigned int chipNr) {
1361 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1362 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1367 <<
"\n ****************************************** " 1369 <<
"\n condition = " << condition
1370 <<
"\n particle = " << particle
1371 <<
"\n type = " << type
1372 <<
"\n name = " << name
1380 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1386 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1387 tmpValues.reserve( nrObj );
1393 unsigned int chargeCorrelation = 0;
1394 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1395 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1396 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1409 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1412 relativeBx = corrMu->getBxOffset();
1415 int upperThresholdInd = -1;
1416 int lowerThresholdInd = 0;
1417 int upperIndexInd = -1;
1418 int lowerIndexInd = 0;
1420 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1422 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1423 int isolationLUT = 0xF;
1425 int qualityLUT = 0xFFFF;
1427 const std::vector<esCut>&
cuts = corrMu->getCuts();
1428 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1430 const esCut
cut = cuts.at(
kk);
1432 switch(cut.getCutType()){
1434 lowerThresholdInd = cut.getMinimum().index;
1435 upperThresholdInd = cut.getMaximum().index;
1438 case esCutType::Slice:
1439 lowerIndexInd =
int(cut.getMinimum().value);
1440 upperIndexInd =
int(cut.getMaximum().value);
1446 etaWindow1Lower = cut.getMinimum().index;
1447 etaWindow1Upper = cut.getMaximum().index;
1448 }
else if(cntEta == 1) {
1449 etaWindow2Lower = cut.getMinimum().index;
1450 etaWindow2Upper = cut.getMaximum().index;
1452 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1453 << particle <<
")" << std::endl;
1463 phiWindow1Lower = cut.getMinimum().index;
1464 phiWindow1Upper = cut.getMaximum().index;
1465 }
else if(cntPhi == 1) {
1466 phiWindow2Lower = cut.getMinimum().index;
1467 phiWindow2Upper = cut.getMaximum().index;
1469 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1470 << particle <<
")" << std::endl;
1477 case esCutType::Charge:
1478 if( cut.getData()==
"positive" ) charge = 0;
1479 else if( cut.getData()==
"negative" ) charge = 1;
1487 case esCutType::Isolation: {
1500 objParameter[0].ptHighThreshold = upperThresholdInd;
1501 objParameter[0].ptLowThreshold = lowerThresholdInd;
1503 objParameter[0].indexHigh = upperIndexInd;
1504 objParameter[0].indexLow = lowerIndexInd;
1506 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1507 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1508 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1509 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1511 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1512 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1513 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1514 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1517 objParameter[0].enableMip =
false;
1518 objParameter[0].enableIso =
false;
1519 objParameter[0].requestIso =
false;
1521 objParameter[0].charge =
charge;
1522 objParameter[0].qualityLUT = qualityLUT;
1523 objParameter[0].isolationLUT = isolationLUT;
1540 std::ostringstream myCoutStream;
1541 muonCond.
print(myCoutStream);
1542 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1578 unsigned int chipNr,
const bool corrFlag) {
1592 <<
"\n ****************************************** " 1593 <<
"\n (in parseCalo) " 1594 <<
"\n condition = " << condition
1595 <<
"\n particle = " << particle
1596 <<
"\n type = " << type
1597 <<
"\n name = " << name
1608 if (condCalo.getType() == esConditionType::SingleEgamma) {
1613 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1618 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1623 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1628 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1629 caloObjType =
gtJet;
1633 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1634 caloObjType =
gtJet;
1638 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1639 caloObjType =
gtJet;
1643 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1644 caloObjType =
gtJet;
1648 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1649 caloObjType =
gtTau;
1653 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1654 caloObjType =
gtTau;
1658 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1659 caloObjType =
gtTau;
1663 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1664 caloObjType =
gtTau;
1669 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1670 << particle <<
")" << std::endl;
1677 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1678 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1685 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1691 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1692 tmpValues.reserve( nrObj );
1695 if(
int(condCalo.getObjects().size())!=nrObj ){
1696 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1697 <<
"condCalo.getObjects().size() = " 1698 << condCalo.getObjects().size()
1714 const std::vector<esObject>&
objects = condCalo.getObjects();
1715 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1717 const esObject
object = objects.at(
jj);
1718 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1721 relativeBx =
object.getBxOffset();
1724 int upperThresholdInd = -1;
1725 int lowerThresholdInd = 0;
1726 int upperIndexInd = -1;
1727 int lowerIndexInd = 0;
1729 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1731 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1732 int isolationLUT = 0xF;
1733 int qualityLUT = 0xF;
1736 const std::vector<esCut>&
cuts =
object.getCuts();
1737 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1739 const esCut
cut = cuts.at(
kk);
1741 switch(cut.getCutType()){
1743 lowerThresholdInd = cut.getMinimum().index;
1744 upperThresholdInd = cut.getMaximum().index;
1746 case esCutType::Slice:
1747 lowerIndexInd =
int(cut.getMinimum().value);
1748 upperIndexInd =
int(cut.getMaximum().value);
1753 etaWindow1Lower = cut.getMinimum().index;
1754 etaWindow1Upper = cut.getMaximum().index;
1755 }
else if(cntEta == 1) {
1756 etaWindow2Lower = cut.getMinimum().index;
1757 etaWindow2Upper = cut.getMaximum().index;
1759 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 1760 << particle <<
")" << std::endl;
1770 phiWindow1Lower = cut.getMinimum().index;
1771 phiWindow1Upper = cut.getMaximum().index;
1772 }
else if(cntPhi == 1) {
1773 phiWindow2Lower = cut.getMinimum().index;
1774 phiWindow2Upper = cut.getMaximum().index;
1776 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 1777 << particle <<
")" << std::endl;
1784 case esCutType::Charge: {
1786 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 1787 << particle <<
")" << std::endl;
1796 case esCutType::Isolation: {
1808 objParameter[cnt].etHighThreshold = upperThresholdInd;
1809 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1810 objParameter[cnt].indexHigh = upperIndexInd;
1811 objParameter[cnt].indexLow = lowerIndexInd;
1812 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1813 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1814 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1815 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1816 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1817 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1818 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1819 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1820 objParameter[cnt].isolationLUT = isolationLUT;
1821 objParameter[cnt].qualityLUT = qualityLUT;
1825 <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " 1826 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
1827 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1828 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1829 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1830 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1831 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1832 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1833 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1834 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1835 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1836 << objParameter[cnt].isolationLUT
1837 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" 1838 << objParameter[cnt].qualityLUT <<
std::dec 1847 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1869 std::ostringstream myCoutStream;
1870 caloCond.
print(myCoutStream);
1871 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1880 <<
" Error: duplicate condition (" << name <<
")" 1915 unsigned int chipNr) {
1929 <<
"\n ****************************************** " 1930 <<
"\n (in parseCalo) " 1931 <<
"\n condition = " << condition
1932 <<
"\n particle = " << particle
1933 <<
"\n type = " << type
1934 <<
"\n name = " << name
1946 if (corrCalo->getType() == esObjectType::Egamma) {
1949 caloObjType =
gtJet;
1951 caloObjType =
gtTau;
1953 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1954 << particle <<
")" << std::endl;
1962 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1963 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1970 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1976 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1977 tmpValues.reserve( nrObj );
1986 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1989 relativeBx = corrCalo->getBxOffset();
1992 int upperThresholdInd = -1;
1993 int lowerThresholdInd = 0;
1994 int upperIndexInd = -1;
1995 int lowerIndexInd = 0;
1997 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1999 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2000 int isolationLUT = 0xF;
2001 int qualityLUT = 0xF;
2004 const std::vector<esCut>&
cuts = corrCalo->getCuts();
2005 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2007 const esCut
cut = cuts.at(
kk);
2009 switch(cut.getCutType()){
2011 lowerThresholdInd = cut.getMinimum().index;
2012 upperThresholdInd = cut.getMaximum().index;
2014 case esCutType::Slice:
2015 lowerIndexInd =
int(cut.getMinimum().value);
2016 upperIndexInd =
int(cut.getMaximum().value);
2021 etaWindow1Lower = cut.getMinimum().index;
2022 etaWindow1Upper = cut.getMaximum().index;
2023 }
else if(cntEta == 1) {
2024 etaWindow2Lower = cut.getMinimum().index;
2025 etaWindow2Upper = cut.getMaximum().index;
2027 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 2028 << particle <<
")" << std::endl;
2038 phiWindow1Lower = cut.getMinimum().index;
2039 phiWindow1Upper = cut.getMaximum().index;
2040 }
else if(cntPhi == 1) {
2041 phiWindow2Lower = cut.getMinimum().index;
2042 phiWindow2Upper = cut.getMaximum().index;
2044 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 2045 << particle <<
")" << std::endl;
2052 case esCutType::Charge: {
2054 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 2055 << particle <<
")" << std::endl;
2064 case esCutType::Isolation: {
2076 objParameter[0].etLowThreshold = lowerThresholdInd;
2077 objParameter[0].etHighThreshold = upperThresholdInd;
2078 objParameter[0].indexHigh = upperIndexInd;
2079 objParameter[0].indexLow = lowerIndexInd;
2080 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2081 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2082 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2083 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2084 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2085 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2086 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2087 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2088 objParameter[0].isolationLUT = isolationLUT;
2089 objParameter[0].qualityLUT = qualityLUT;
2093 <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " <<
" = " 2094 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold
2095 <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x" 2096 << objParameter[0].etaWindow1Lower <<
" / 0x" << objParameter[0].etaWindow1Upper
2097 <<
"\n etaWindowVeto Lower / Upper for calo object " <<
" = 0x" 2098 << objParameter[0].etaWindow2Lower <<
" / 0x" << objParameter[0].etaWindow2Upper
2099 <<
"\n phiWindow Lower / Upper for calo object " <<
" = 0x" 2100 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2101 <<
"\n phiWindowVeto Lower / Upper for calo object " <<
" = 0x" 2102 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2103 <<
"\n Isolation LUT for calo object " <<
" = 0x" 2104 << objParameter[0].isolationLUT
2105 <<
"\n Quality LUT for calo object " <<
" = 0x" 2106 << objParameter[0].qualityLUT <<
std::dec 2114 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2136 std::ostringstream myCoutStream;
2137 caloCond.
print(myCoutStream);
2138 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2176 unsigned int chipNr,
const bool corrFlag) {
2189 <<
"\n ****************************************** " 2190 <<
"\n (in parseEnergySum) " 2191 <<
"\n condition = " << condition
2192 <<
"\n type = " << type
2193 <<
"\n name = " << name
2202 if( condEnergySum.getType() == esConditionType::MissingEt ){
2206 else if( condEnergySum.getType() == esConditionType::TotalEt ){
2210 else if( condEnergySum.getType() == esConditionType::TotalEtEM ){
2214 else if( condEnergySum.getType() == esConditionType::TotalHt ){
2218 else if( condEnergySum.getType() == esConditionType::MissingHt ){
2222 else if( condEnergySum.getType() == esConditionType::MissingEtHF ){
2226 else if( condEnergySum.getType() == esConditionType::TowerCount ){
2230 else if( condEnergySum.getType() == esConditionType::MinBiasHFP0 ){
2234 else if( condEnergySum.getType() == esConditionType::MinBiasHFM0 ){
2238 else if( condEnergySum.getType() == esConditionType::MinBiasHFP1 ){
2242 else if( condEnergySum.getType() == esConditionType::MinBiasHFM1 ){
2248 <<
"Wrong type for energy-sum condition (" << type
2249 <<
")" << std::endl;
2263 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2275 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2276 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2278 const esObject
object = objects.at(
jj);
2279 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2282 relativeBx =
object.getBxOffset();
2285 int lowerThresholdInd = 0;
2286 int upperThresholdInd = -1;
2288 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2291 const std::vector<esCut>&
cuts =
object.getCuts();
2292 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2294 const esCut
cut = cuts.at(
kk);
2296 switch(cut.getCutType()){
2298 lowerThresholdInd = cut.getMinimum().index;
2299 upperThresholdInd = cut.getMaximum().index;
2308 phiWindow1Lower = cut.getMinimum().index;
2309 phiWindow1Upper = cut.getMaximum().index;
2310 }
else if(cntPhi == 1) {
2311 phiWindow2Lower = cut.getMinimum().index;
2312 phiWindow2Upper = cut.getMaximum().index;
2314 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2315 << type <<
")" << std::endl;
2323 case esCutType::Count:
2324 lowerThresholdInd = cut.getMinimum().index;
2325 upperThresholdInd = 0xffffff;
2337 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2338 objParameter[cnt].etHighThreshold = upperThresholdInd;
2339 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2340 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2341 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2342 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2347 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2348 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
2349 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2350 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2351 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2352 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper <<
std::dec 2359 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2375 std::ostringstream myCoutStream;
2376 energySumCond.
print(myCoutStream);
2377 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2385 <<
" Error: duplicate condition (" << name <<
")" 2421 unsigned int chipNr) {
2434 <<
"\n ****************************************** " 2435 <<
"\n (in parseEnergySum) " 2436 <<
"\n condition = " << condition
2437 <<
"\n type = " << type
2438 <<
"\n name = " << name
2455 else if( corrESum->getType()== esObjectType::ETMHF ){
2459 else if( corrESum->getType()== esObjectType::TOWERCOUNT ){
2465 <<
"Wrong type for energy-sum correclation condition (" << type
2466 <<
")" << std::endl;
2480 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2492 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2495 relativeBx = corrESum->getBxOffset();
2498 int lowerThresholdInd = 0;
2499 int upperThresholdInd = -1;
2501 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2504 const std::vector<esCut>&
cuts = corrESum->getCuts();
2505 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2507 const esCut
cut = cuts.at(
kk);
2509 switch(cut.getCutType()){
2511 lowerThresholdInd = cut.getMinimum().index;
2512 upperThresholdInd = cut.getMaximum().index;
2521 phiWindow1Lower = cut.getMinimum().index;
2522 phiWindow1Upper = cut.getMaximum().index;
2523 }
else if(cntPhi == 1) {
2524 phiWindow2Lower = cut.getMinimum().index;
2525 phiWindow2Upper = cut.getMaximum().index;
2527 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2528 << type <<
")" << std::endl;
2545 objParameter[0].etLowThreshold = lowerThresholdInd;
2546 objParameter[0].etHighThreshold = upperThresholdInd;
2547 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2548 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2549 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2550 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2555 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2556 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2557 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2558 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2559 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2560 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper <<
std::dec 2565 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2581 std::ostringstream myCoutStream;
2582 energySumCond.
print(myCoutStream);
2583 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2624 unsigned int chipNr) {
2638 <<
"\n ****************************************** " 2639 <<
"\n (in parseExternal) " 2640 <<
"\n condition = " << condition
2641 <<
"\n particle = " << particle
2642 <<
"\n type = " << type
2643 <<
"\n name = " << name
2654 unsigned int channelID = 0;
2657 const std::vector<esObject>&
objects = condExt.getObjects();
2658 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2660 const esObject
object = objects.at(
jj);
2661 if(
object.getType() == esObjectType::EXT) {
2662 relativeBx =
object.getBxOffset();
2663 channelID =
object.getExternalChannelId();
2672 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2685 << externalCond <<
"\n" << std::endl;
2691 <<
" Error: duplicate condition (" << name
2692 <<
")" << std::endl;
2718 tmeventsetup::esCondition corrCond,
2719 unsigned int chipNr) {
2728 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2729 <<
" (in parseCorrelation) " << std::endl
2730 <<
" condition = " << condition << std::endl
2731 <<
" particle = " << particle << std::endl
2732 <<
" type = " << type << std::endl
2733 <<
" name = " << name << std::endl;
2745 <<
" Error: duplicate correlation condition (" << name <<
")" 2758 const int nrObj = 2;
2761 int intGEq[nrObj] = { -1, -1 };
2762 std::vector<GlobalObject>
objType(nrObj);
2763 std::vector<GtConditionCategory> condCateg(nrObj);
2766 const bool corrFlag =
true;
2767 int corrIndexVal[nrObj] = { -1, -1 };
2776 const std::vector<esCut>&
cuts = corrCond.getCuts();
2777 for (
size_t jj = 0;
jj < cuts.size();
jj++)
2779 const esCut
cut = cuts.at(
jj);
2781 if(cut.getCutType() == esCutType::ChargeCorrelation) {
2790 double minV = cut.getMinimum().value;
2791 double maxV = cut.getMaximum().value;
2794 if(maxV > 1.0e8) maxV = 1.0e8;
2797 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2798 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2799 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2800 corrParameter.
precEtaCut = cut.getMinimum().index;
2801 cutType = cutType | 0x1;
2803 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2804 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2805 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2806 corrParameter.
precPhiCut = cut.getMinimum().index;
2807 cutType = cutType | 0x2;
2809 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaR Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2810 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2811 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2812 corrParameter.
precDRCut = cut.getMinimum().index;
2813 cutType = cutType | 0x4;
2814 }
else if (cut.getCutType() == esCutType::TwoBodyPt) {
2817 corrParameter.
precTBPTCut = cut.getMinimum().index;
2818 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tTPBT Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2819 cutType = cutType | 0x20;
2821 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tMass Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2824 corrParameter.
precMassCut = cut.getMinimum().index;
2826 if (corrCond.getType() == esConditionType::TransverseMass){
2827 cutType = cutType | 0x10;
2830 cutType = cutType | 0x8;
2840 const std::vector<esObject>&
objects = corrCond.getObjects();
2841 if(objects.size() != 2) {
2843 <<
"incorrect number of objects for the correlation condition " << name <<
" corrFlag " << corrFlag << std::endl;
2848 for (
size_t jj = 0;
jj < objects.size();
jj++)
2850 const esObject
object = objects.at(
jj);
2896 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2900 }
else if(
object.getType() == esObjectType::Egamma ||
2909 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2910 switch(
object.getType()) {
2911 case esObjectType::Egamma: {
2933 object.getType() == esObjectType::ETMHF ||
2934 object.getType() == esObjectType::TOWERCOUNT ||
2942 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2943 switch(
object.getType()) {
2952 case esObjectType::ETMHF: {
2956 case esObjectType::TOWERCOUNT: {
2970 <<
"Illegal Object Type " <<
object.getType()
2971 <<
" for the correlation condition " << name << std::endl;
2981 if (intGEq[0] != intGEq[1]) {
2983 <<
"Inconsistent GEq flags for sub-conditions " 2984 <<
" for the correlation condition " << name << std::endl;
2989 gEq = (intGEq[0] != 0);
3010 std::ostringstream myCoutStream;
3011 correlationCond.
print(myCoutStream);
3012 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3040 const tmeventsetup::esCondition& corrCond,
3041 unsigned int chipNr) {
3050 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3051 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3052 <<
" condition = " << condition << std::endl
3053 <<
" particle = " << particle << std::endl
3054 <<
" type = " << type << std::endl
3055 <<
" name = " << name << std::endl;
3067 <<
" Error: duplicate correlation condition (" << name <<
")" 3080 const int nrObj = 3;
3083 int intGEq[nrObj] = { -1, -1, -1 };
3084 std::vector<GlobalObject>
objType(nrObj);
3085 std::vector<GtConditionCategory> condCateg(nrObj);
3088 const bool corrFlag =
true;
3089 int corrIndexVal[nrObj] = { -1, -1, -1 };
3098 const std::vector<esCut>&
cuts = corrCond.getCuts();
3099 for (
size_t jj = 0;
jj < cuts.size();
jj++)
3101 const esCut
cut = cuts.at(
jj);
3103 if(cut.getCutType() == esCutType::ChargeCorrelation) {
3112 double minV = cut.getMinimum().value;
3113 double maxV = cut.getMaximum().value;
3116 if(maxV > 1.0e8) maxV = 1.0e8;
3120 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3121 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3122 corrParameter.
precEtaCut = cut.getMinimum().index;
3123 cutType = cutType | 0x1;
3126 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3127 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3128 corrParameter.
precPhiCut = cut.getMinimum().index;
3129 cutType = cutType | 0x2;
3132 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3133 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3134 corrParameter.
precDRCut = cut.getMinimum().index;
3135 cutType = cutType | 0x4;
3140 corrParameter.
precMassCut = cut.getMinimum().index;
3141 cutType = cutType | 0x8;
3143 if(cut.getCutType() == esCutType::OvRmDeltaEta) {
3148 cutType = cutType | 0x10;
3149 }
else if (cut.getCutType() == esCutType::OvRmDeltaPhi) {
3154 cutType = cutType | 0x20;
3155 }
else if (cut.getCutType() == esCutType::OvRmDeltaR) {
3160 cutType = cutType | 0x40;
3169 const std::vector<esObject>&
objects = corrCond.getObjects();
3170 if(objects.size() != 3) {
3172 <<
"incorrect number of objects for the correlation condition with overlap removal " << name <<
" corrFlag " << corrFlag << std::endl;
3177 for (
size_t jj = 0;
jj < objects.size();
jj++)
3179 const esObject&
object = objects.at(
jj);
3226 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3230 }
else if(
object.getType() == esObjectType::Egamma ||
3239 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3240 switch(
object.getType()) {
3241 case esObjectType::Egamma: {
3263 object.getType() == esObjectType::ETMHF ||
3264 object.getType() == esObjectType::TOWERCOUNT ||
3272 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3273 switch(
object.getType()) {
3282 case esObjectType::ETMHF: {
3286 case esObjectType::TOWERCOUNT: {
3300 <<
"Illegal Object Type " <<
object.getType()
3301 <<
" for the correlation condition " << name << std::endl;
3311 if (intGEq[0] != intGEq[1]) {
3313 <<
"Inconsistent GEq flags for sub-conditions " 3314 <<
" for the correlation condition " << name << std::endl;
3319 gEq = (intGEq[0] != 0);
3342 std::ostringstream myCoutStream;
3343 correlationWORCond.
print(myCoutStream);
3344 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3372 unsigned int chipNr) {
3383 if (algAlias.empty()) {
3386 <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3387 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3391 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3392 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3397 const std::string& logExpression = algorithm.getExpressionInCondition();
3400 <<
" Logical expression: " << logExpression
3401 <<
" Chip number: " << chipNr
3405 int outputPin = algorithm.getIndex();
3409 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin
3415 int bitNumber = outputPin;
3418 LogDebug(
"TriggerMenuParser") <<
" Bit number: " << bitNumber
3428 std::ostringstream myCoutStream;
3429 alg.
print(myCoutStream);
3430 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