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;
664 else scaleParam =
nullptr;
666 if(scaleParam !=
nullptr) {
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"] );
785 parsePt_LUTS(scaleMap,
"Mass" ,
"ETM", precisions[
"PRECISION-EG-ETM-MassPt"] );
786 parsePt_LUTS(scaleMap,
"Mass" ,
"ETMHF", precisions[
"PRECISION-EG-ETMHF-MassPt"] );
787 parsePt_LUTS(scaleMap,
"Mass" ,
"HTM", precisions[
"PRECISION-EG-HTM-MassPt"] );
791 parsePt_LUTS(scaleMap,
"TwoBody" ,
"EG", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
792 parsePt_LUTS(scaleMap,
"TwoBody" ,
"MU", precisions[
"PRECISION-EG-MU-TwoBodyPt"] );
793 parsePt_LUTS(scaleMap,
"TwoBody" ,
"JET", precisions[
"PRECISION-EG-JET-TwoBodyPt"] );
794 parsePt_LUTS(scaleMap,
"TwoBody" ,
"TAU", precisions[
"PRECISION-EG-TAU-TwoBodyPt"] );
795 parsePt_LUTS(scaleMap,
"TwoBody" ,
"ETM", precisions[
"PRECISION-EG-ETM-TwoBodyPt"] );
796 parsePt_LUTS(scaleMap,
"TwoBody" ,
"ETMHF", precisions[
"PRECISION-EG-ETMHF-TwoBodyPt"] );
797 parsePt_LUTS(scaleMap,
"TwoBody" ,
"HTM", precisions[
"PRECISION-EG-HTM-TwoBodyPt"] );
803 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
804 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
805 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
806 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
808 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
809 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
810 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
812 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
813 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
815 parseDeltaEta_Cosh_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
820 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
821 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
822 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
823 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETM",precisions[
"PRECISION-EG-ETM-Delta"],precisions[
"PRECISION-EG-ETM-Math"]);
824 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETMHF",precisions[
"PRECISION-EG-ETMHF-Delta"],precisions[
"PRECISION-EG-ETMHF-Math"]);
825 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"HTM",precisions[
"PRECISION-EG-HTM-Delta"],precisions[
"PRECISION-EG-HTM-Math"]);
826 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
828 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
829 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
830 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETM",precisions[
"PRECISION-JET-ETM-Delta"],precisions[
"PRECISION-JET-ETM-Math"]);
831 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETMHF",precisions[
"PRECISION-JET-ETMHF-Delta"],precisions[
"PRECISION-JET-ETMHF-Math"]);
832 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"HTM",precisions[
"PRECISION-JET-HTM-Delta"],precisions[
"PRECISION-JET-HTM-Math"]);
833 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
835 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
836 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETM",precisions[
"PRECISION-TAU-ETM-Delta"],precisions[
"PRECISION-TAU-ETM-Math"]);
837 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETMHF",precisions[
"PRECISION-TAU-ETMHF-Delta"],precisions[
"PRECISION-TAU-ETMHF-Math"]);
838 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"HTM",precisions[
"PRECISION-TAU-HTM-Delta"],precisions[
"PRECISION-TAU-HTM-Math"]);
839 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
841 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETM",precisions[
"PRECISION-MU-ETM-Delta"],precisions[
"PRECISION-MU-ETM-Math"]);
842 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETMHF",precisions[
"PRECISION-MU-ETMHF-Delta"],precisions[
"PRECISION-MU-ETMHF-Math"]);
843 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"HTM",precisions[
"PRECISION-MU-HTM-Delta"],precisions[
"PRECISION-MU-HTM-Math"]);
844 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
882 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
884 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
885 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
887 std::vector<long long> lut_cal_2_mu_eta;
888 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
910 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
912 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
913 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
916 std::vector<long long> lut_cal_2_mu_phi;
917 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
937 if( scaleMap.find(scLabel1) == scaleMap.end())
return;
939 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
941 std::vector<long long> lut_pt;
942 getLut(lut_pt, scale1, prec);
961 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
963 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
964 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
965 std::vector<double> val_delta_eta;
966 std::vector<long long> lut_delta_eta;
967 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
968 setLut(lut_delta_eta, val_delta_eta, prec1);
975 std::vector<long long> lut_cosh;
976 applyCosh(val_delta_eta, n);
977 setLut(lut_cosh, val_delta_eta, prec2);
994 if( scaleMap.find(scLabel1) == scaleMap.end() || scaleMap.find(scLabel2) == scaleMap.end())
return;
996 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
997 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
998 std::vector<double> val_delta_phi;
999 std::vector<long long> lut_delta_phi;
1000 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
1001 setLut(lut_delta_phi, val_delta_phi, prec1);
1008 std::vector<long long> lut_cos;
1009 applyCos(val_delta_phi, n);
1010 setLut(lut_cos, val_delta_phi, prec2);
1024 if( scaleMap.find(scLabel) == scaleMap.end() )
return;
1027 const esScale*
scale = &scaleMap.find(scLabel)->second;
1029 const double step = scale->getStep();
1030 const double range = scale->getMaximum() - scale->getMinimum();
1031 const size_t n = std::ceil(range / step);
1032 const size_t bitwidth = std::ceil(std::log10(n) / std::log10(2));
1036 for (
size_t ii = 0;
ii <
n;
ii++)
1038 array.at(
ii) = step *
ii;
1042 std::vector<long long>
lut;
1045 setLut(lut, array, prec);
1049 setLut(lut, array, prec);
1069 unsigned int chipNr,
const bool corrFlag) {
1084 if (condMu.getType() == esConditionType::SingleMuon) {
1088 }
else if (condMu.getType() == esConditionType::DoubleMuon) {
1092 }
else if (condMu.getType() == esConditionType::TripleMuon) {
1096 }
else if (condMu.getType() == esConditionType::QuadMuon) {
1101 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition (" 1102 << type <<
")" << std::endl;
1107 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1108 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1113 <<
"\n ****************************************** " 1115 <<
"\n condition = " << condition
1116 <<
"\n particle = " << particle
1117 <<
"\n type = " << type
1118 <<
"\n name = " << name
1126 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1132 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1133 tmpValues.reserve( nrObj );
1135 if(
int(condMu.getObjects().size())!=nrObj ){
1136 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
1137 <<
"condMu.getObjects().size() = " 1138 << condMu.getObjects().size()
1145 unsigned int chargeCorrelation = 1;
1146 const std::vector<esCut>&
cuts = condMu.getCuts();
1147 for (
size_t jj = 0;
jj < cuts.size();
jj++)
1149 const esCut
cut = cuts.at(
jj);
1150 if(cut.getCutType() == esCutType::ChargeCorrelation) {
1151 if( cut.getData()==
"ls" ) chargeCorrelation = 2;
1152 else if( cut.getData()==
"os" ) chargeCorrelation = 4;
1153 else chargeCorrelation = 1;
1169 const std::vector<esObject>&
objects = condMu.getObjects();
1170 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1172 const esObject
object = objects.at(
jj);
1173 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1176 relativeBx =
object.getBxOffset();
1179 int upperThresholdInd = -1;
1180 int lowerThresholdInd = 0;
1181 int upperIndexInd = -1;
1182 int lowerIndexInd = 0;
1184 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1186 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1187 int isolationLUT = 0xF;
1189 int qualityLUT = 0xFFFF;
1191 const std::vector<esCut>& cuts =
object.getCuts();
1192 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1194 const esCut
cut = cuts.at(
kk);
1196 switch(cut.getCutType()){
1198 lowerThresholdInd = cut.getMinimum().index;
1199 upperThresholdInd = cut.getMaximum().index;
1202 case esCutType::Slice:
1203 lowerIndexInd =
int(cut.getMinimum().value);
1204 upperIndexInd =
int(cut.getMaximum().value);
1210 etaWindow1Lower = cut.getMinimum().index;
1211 etaWindow1Upper = cut.getMaximum().index;
1212 }
else if(cntEta == 1) {
1213 etaWindow2Lower = cut.getMinimum().index;
1214 etaWindow2Upper = cut.getMaximum().index;
1216 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1217 << particle <<
")" << std::endl;
1227 phiWindow1Lower = cut.getMinimum().index;
1228 phiWindow1Upper = cut.getMaximum().index;
1229 }
else if(cntPhi == 1) {
1230 phiWindow2Lower = cut.getMinimum().index;
1231 phiWindow2Upper = cut.getMaximum().index;
1233 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1234 << particle <<
")" << std::endl;
1241 case esCutType::Charge:
1242 if( cut.getData()==
"positive" ) charge = 0;
1243 else if( cut.getData()==
"negative" ) charge = 1;
1251 case esCutType::Isolation: {
1264 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1265 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1267 objParameter[cnt].indexHigh = upperIndexInd;
1268 objParameter[cnt].indexLow = lowerIndexInd;
1270 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1271 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1272 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1273 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1275 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1276 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1277 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1278 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1281 objParameter[cnt].enableMip =
false;
1282 objParameter[cnt].enableIso =
false;
1283 objParameter[cnt].requestIso =
false;
1285 objParameter[cnt].charge =
charge;
1286 objParameter[cnt].qualityLUT = qualityLUT;
1287 objParameter[cnt].isolationLUT = isolationLUT;
1311 std::ostringstream myCoutStream;
1312 muonCond.
print(myCoutStream);
1313 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1319 <<
" Error: duplicate condition (" << name <<
")" 1324 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the ConditionMap" << std::endl;
1330 LogDebug(
"TriggerMenuParser") <<
"Added Condition " << name <<
" to the vecMuonTemplate vector" << std::endl;
1342 unsigned int chipNr) {
1360 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" << type
1361 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1366 <<
"\n ****************************************** " 1368 <<
"\n condition = " << condition
1369 <<
"\n particle = " << particle
1370 <<
"\n type = " << type
1371 <<
"\n name = " << name
1379 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1385 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1386 tmpValues.reserve( nrObj );
1392 unsigned int chargeCorrelation = 0;
1393 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1394 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1395 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1408 gEq = (corrMu->getComparisonOperator() == esComparisonOperator::GE);
1411 relativeBx = corrMu->getBxOffset();
1414 int upperThresholdInd = -1;
1415 int lowerThresholdInd = 0;
1416 int upperIndexInd = -1;
1417 int lowerIndexInd = 0;
1419 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1421 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1422 int isolationLUT = 0xF;
1424 int qualityLUT = 0xFFFF;
1426 const std::vector<esCut>&
cuts = corrMu->getCuts();
1427 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1429 const esCut
cut = cuts.at(
kk);
1431 switch(cut.getCutType()){
1433 lowerThresholdInd = cut.getMinimum().index;
1434 upperThresholdInd = cut.getMaximum().index;
1437 case esCutType::Slice:
1438 lowerIndexInd =
int(cut.getMinimum().value);
1439 upperIndexInd =
int(cut.getMaximum().value);
1445 etaWindow1Lower = cut.getMinimum().index;
1446 etaWindow1Upper = cut.getMaximum().index;
1447 }
else if(cntEta == 1) {
1448 etaWindow2Lower = cut.getMinimum().index;
1449 etaWindow2Upper = cut.getMaximum().index;
1451 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition (" 1452 << particle <<
")" << std::endl;
1462 phiWindow1Lower = cut.getMinimum().index;
1463 phiWindow1Upper = cut.getMaximum().index;
1464 }
else if(cntPhi == 1) {
1465 phiWindow2Lower = cut.getMinimum().index;
1466 phiWindow2Upper = cut.getMaximum().index;
1468 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition (" 1469 << particle <<
")" << std::endl;
1476 case esCutType::Charge:
1477 if( cut.getData()==
"positive" ) charge = 0;
1478 else if( cut.getData()==
"negative" ) charge = 1;
1486 case esCutType::Isolation: {
1499 objParameter[0].ptHighThreshold = upperThresholdInd;
1500 objParameter[0].ptLowThreshold = lowerThresholdInd;
1502 objParameter[0].indexHigh = upperIndexInd;
1503 objParameter[0].indexLow = lowerIndexInd;
1505 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1506 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1507 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1508 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1510 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1511 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1512 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1513 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1516 objParameter[0].enableMip =
false;
1517 objParameter[0].enableIso =
false;
1518 objParameter[0].requestIso =
false;
1520 objParameter[0].charge =
charge;
1521 objParameter[0].qualityLUT = qualityLUT;
1522 objParameter[0].isolationLUT = isolationLUT;
1539 std::ostringstream myCoutStream;
1540 muonCond.
print(myCoutStream);
1541 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1577 unsigned int chipNr,
const bool corrFlag) {
1591 <<
"\n ****************************************** " 1592 <<
"\n (in parseCalo) " 1593 <<
"\n condition = " << condition
1594 <<
"\n particle = " << particle
1595 <<
"\n type = " << type
1596 <<
"\n name = " << name
1607 if (condCalo.getType() == esConditionType::SingleEgamma) {
1612 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1617 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1622 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1627 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1628 caloObjType =
gtJet;
1632 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1633 caloObjType =
gtJet;
1637 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1638 caloObjType =
gtJet;
1642 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1643 caloObjType =
gtJet;
1647 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1648 caloObjType =
gtTau;
1652 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1653 caloObjType =
gtTau;
1657 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1658 caloObjType =
gtTau;
1662 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1663 caloObjType =
gtTau;
1668 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1669 << particle <<
")" << std::endl;
1676 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1677 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1684 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1690 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1691 tmpValues.reserve( nrObj );
1694 if(
int(condCalo.getObjects().size())!=nrObj ){
1695 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1696 <<
"condCalo.getObjects().size() = " 1697 << condCalo.getObjects().size()
1713 const std::vector<esObject>&
objects = condCalo.getObjects();
1714 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1716 const esObject
object = objects.at(
jj);
1717 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
1720 relativeBx =
object.getBxOffset();
1723 int upperThresholdInd = -1;
1724 int lowerThresholdInd = 0;
1725 int upperIndexInd = -1;
1726 int lowerIndexInd = 0;
1728 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1730 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1731 int isolationLUT = 0xF;
1732 int qualityLUT = 0xF;
1735 const std::vector<esCut>&
cuts =
object.getCuts();
1736 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1738 const esCut
cut = cuts.at(
kk);
1740 switch(cut.getCutType()){
1742 lowerThresholdInd = cut.getMinimum().index;
1743 upperThresholdInd = cut.getMaximum().index;
1745 case esCutType::Slice:
1746 lowerIndexInd =
int(cut.getMinimum().value);
1747 upperIndexInd =
int(cut.getMaximum().value);
1752 etaWindow1Lower = cut.getMinimum().index;
1753 etaWindow1Upper = cut.getMaximum().index;
1754 }
else if(cntEta == 1) {
1755 etaWindow2Lower = cut.getMinimum().index;
1756 etaWindow2Upper = cut.getMaximum().index;
1758 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 1759 << particle <<
")" << std::endl;
1769 phiWindow1Lower = cut.getMinimum().index;
1770 phiWindow1Upper = cut.getMaximum().index;
1771 }
else if(cntPhi == 1) {
1772 phiWindow2Lower = cut.getMinimum().index;
1773 phiWindow2Upper = cut.getMaximum().index;
1775 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 1776 << particle <<
")" << std::endl;
1783 case esCutType::Charge: {
1785 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 1786 << particle <<
")" << std::endl;
1795 case esCutType::Isolation: {
1807 objParameter[cnt].etHighThreshold = upperThresholdInd;
1808 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1809 objParameter[cnt].indexHigh = upperIndexInd;
1810 objParameter[cnt].indexLow = lowerIndexInd;
1811 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1812 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1813 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1814 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1815 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1816 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1817 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1818 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1819 objParameter[cnt].isolationLUT = isolationLUT;
1820 objParameter[cnt].qualityLUT = qualityLUT;
1824 <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = " 1825 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
1826 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1827 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1828 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1829 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1830 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 1831 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1832 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 1833 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1834 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x" 1835 << objParameter[cnt].isolationLUT
1836 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x" 1837 << objParameter[cnt].qualityLUT <<
std::dec 1846 std::vector<GlobalObject>
objType(nrObj, caloObjType);
1868 std::ostringstream myCoutStream;
1869 caloCond.
print(myCoutStream);
1870 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1879 <<
" Error: duplicate condition (" << name <<
")" 1914 unsigned int chipNr) {
1928 <<
"\n ****************************************** " 1929 <<
"\n (in parseCalo) " 1930 <<
"\n condition = " << condition
1931 <<
"\n particle = " << particle
1932 <<
"\n type = " << type
1933 <<
"\n name = " << name
1945 if (corrCalo->getType() == esObjectType::Egamma) {
1948 caloObjType =
gtJet;
1950 caloObjType =
gtTau;
1952 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition (" 1953 << particle <<
")" << std::endl;
1961 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" << type
1962 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1969 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1975 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1976 tmpValues.reserve( nrObj );
1985 gEq = (corrCalo->getComparisonOperator() == esComparisonOperator::GE);
1988 relativeBx = corrCalo->getBxOffset();
1991 int upperThresholdInd = -1;
1992 int lowerThresholdInd = 0;
1993 int upperIndexInd = -1;
1994 int lowerIndexInd = 0;
1996 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1998 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1999 int isolationLUT = 0xF;
2000 int qualityLUT = 0xF;
2003 const std::vector<esCut>&
cuts = corrCalo->getCuts();
2004 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2006 const esCut
cut = cuts.at(
kk);
2008 switch(cut.getCutType()){
2010 lowerThresholdInd = cut.getMinimum().index;
2011 upperThresholdInd = cut.getMaximum().index;
2013 case esCutType::Slice:
2014 lowerIndexInd =
int(cut.getMinimum().value);
2015 upperIndexInd =
int(cut.getMaximum().value);
2020 etaWindow1Lower = cut.getMinimum().index;
2021 etaWindow1Upper = cut.getMaximum().index;
2022 }
else if(cntEta == 1) {
2023 etaWindow2Lower = cut.getMinimum().index;
2024 etaWindow2Upper = cut.getMaximum().index;
2026 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition (" 2027 << particle <<
")" << std::endl;
2037 phiWindow1Lower = cut.getMinimum().index;
2038 phiWindow1Upper = cut.getMaximum().index;
2039 }
else if(cntPhi == 1) {
2040 phiWindow2Lower = cut.getMinimum().index;
2041 phiWindow2Upper = cut.getMaximum().index;
2043 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition (" 2044 << particle <<
")" << std::endl;
2051 case esCutType::Charge: {
2053 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition (" 2054 << particle <<
")" << std::endl;
2063 case esCutType::Isolation: {
2075 objParameter[0].etLowThreshold = lowerThresholdInd;
2076 objParameter[0].etHighThreshold = upperThresholdInd;
2077 objParameter[0].indexHigh = upperIndexInd;
2078 objParameter[0].indexLow = lowerIndexInd;
2079 objParameter[0].etaWindow1Lower = etaWindow1Lower;
2080 objParameter[0].etaWindow1Upper = etaWindow1Upper;
2081 objParameter[0].etaWindow2Lower = etaWindow2Lower;
2082 objParameter[0].etaWindow2Upper = etaWindow2Upper;
2083 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2084 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2085 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2086 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2087 objParameter[0].isolationLUT = isolationLUT;
2088 objParameter[0].qualityLUT = qualityLUT;
2092 <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " <<
" = " 2093 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold
2094 <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x" 2095 << objParameter[0].etaWindow1Lower <<
" / 0x" << objParameter[0].etaWindow1Upper
2096 <<
"\n etaWindowVeto Lower / Upper for calo object " <<
" = 0x" 2097 << objParameter[0].etaWindow2Lower <<
" / 0x" << objParameter[0].etaWindow2Upper
2098 <<
"\n phiWindow Lower / Upper for calo object " <<
" = 0x" 2099 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2100 <<
"\n phiWindowVeto Lower / Upper for calo object " <<
" = 0x" 2101 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
2102 <<
"\n Isolation LUT for calo object " <<
" = 0x" 2103 << objParameter[0].isolationLUT
2104 <<
"\n Quality LUT for calo object " <<
" = 0x" 2105 << objParameter[0].qualityLUT <<
std::dec 2113 std::vector<GlobalObject>
objType(nrObj, caloObjType);
2135 std::ostringstream myCoutStream;
2136 caloCond.
print(myCoutStream);
2137 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2175 unsigned int chipNr,
const bool corrFlag) {
2188 <<
"\n ****************************************** " 2189 <<
"\n (in parseEnergySum) " 2190 <<
"\n condition = " << condition
2191 <<
"\n type = " << type
2192 <<
"\n name = " << name
2201 if( condEnergySum.getType() == esConditionType::MissingEt ){
2205 else if( condEnergySum.getType() == esConditionType::TotalEt ){
2209 else if( condEnergySum.getType() == esConditionType::TotalEtEM ){
2213 else if( condEnergySum.getType() == esConditionType::TotalHt ){
2217 else if( condEnergySum.getType() == esConditionType::MissingHt ){
2221 else if( condEnergySum.getType() == esConditionType::MissingEtHF ){
2225 else if( condEnergySum.getType() == esConditionType::TowerCount ){
2229 else if( condEnergySum.getType() == esConditionType::MinBiasHFP0 ){
2233 else if( condEnergySum.getType() == esConditionType::MinBiasHFM0 ){
2237 else if( condEnergySum.getType() == esConditionType::MinBiasHFP1 ){
2241 else if( condEnergySum.getType() == esConditionType::MinBiasHFM1 ){
2247 <<
"Wrong type for energy-sum condition (" << type
2248 <<
")" << std::endl;
2262 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2274 const std::vector<esObject>&
objects = condEnergySum.getObjects();
2275 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2277 const esObject
object = objects.at(
jj);
2278 gEq = (
object.getComparisonOperator() == esComparisonOperator::GE);
2281 relativeBx =
object.getBxOffset();
2284 int lowerThresholdInd = 0;
2285 int upperThresholdInd = -1;
2287 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2290 const std::vector<esCut>&
cuts =
object.getCuts();
2291 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2293 const esCut
cut = cuts.at(
kk);
2295 switch(cut.getCutType()){
2297 lowerThresholdInd = cut.getMinimum().index;
2298 upperThresholdInd = cut.getMaximum().index;
2307 phiWindow1Lower = cut.getMinimum().index;
2308 phiWindow1Upper = cut.getMaximum().index;
2309 }
else if(cntPhi == 1) {
2310 phiWindow2Lower = cut.getMinimum().index;
2311 phiWindow2Upper = cut.getMaximum().index;
2313 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2314 << type <<
")" << std::endl;
2322 case esCutType::Count:
2323 lowerThresholdInd = cut.getMinimum().index;
2324 upperThresholdInd = 0xffffff;
2336 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2337 objParameter[cnt].etHighThreshold = upperThresholdInd;
2338 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2339 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2340 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2341 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2346 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2347 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
2348 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2349 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2350 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2351 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper <<
std::dec 2358 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2374 std::ostringstream myCoutStream;
2375 energySumCond.
print(myCoutStream);
2376 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2384 <<
" Error: duplicate condition (" << name <<
")" 2420 unsigned int chipNr) {
2433 <<
"\n ****************************************** " 2434 <<
"\n (in parseEnergySum) " 2435 <<
"\n condition = " << condition
2436 <<
"\n type = " << type
2437 <<
"\n name = " << name
2454 else if( corrESum->getType()== esObjectType::ETMHF ){
2458 else if( corrESum->getType()== esObjectType::TOWERCOUNT ){
2464 <<
"Wrong type for energy-sum correclation condition (" << type
2465 <<
")" << std::endl;
2479 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2491 gEq = (corrESum->getComparisonOperator() == esComparisonOperator::GE);
2494 relativeBx = corrESum->getBxOffset();
2497 int lowerThresholdInd = 0;
2498 int upperThresholdInd = -1;
2500 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2503 const std::vector<esCut>&
cuts = corrESum->getCuts();
2504 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2506 const esCut
cut = cuts.at(
kk);
2508 switch(cut.getCutType()){
2510 lowerThresholdInd = cut.getMinimum().index;
2511 upperThresholdInd = cut.getMaximum().index;
2520 phiWindow1Lower = cut.getMinimum().index;
2521 phiWindow1Upper = cut.getMaximum().index;
2522 }
else if(cntPhi == 1) {
2523 phiWindow2Lower = cut.getMinimum().index;
2524 phiWindow2Upper = cut.getMaximum().index;
2526 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition (" 2527 << type <<
")" << std::endl;
2544 objParameter[0].etLowThreshold = lowerThresholdInd;
2545 objParameter[0].etHighThreshold = upperThresholdInd;
2546 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2547 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2548 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2549 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2554 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = " 2555 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2556 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x" 2557 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2558 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x" 2559 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper <<
std::dec 2564 std::vector<GlobalObject>
objType(nrObj, energySumObjType);
2580 std::ostringstream myCoutStream;
2581 energySumCond.
print(myCoutStream);
2582 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2623 unsigned int chipNr) {
2637 <<
"\n ****************************************** " 2638 <<
"\n (in parseExternal) " 2639 <<
"\n condition = " << condition
2640 <<
"\n particle = " << particle
2641 <<
"\n type = " << type
2642 <<
"\n name = " << name
2653 unsigned int channelID = 0;
2656 const std::vector<esObject>&
objects = condExt.getObjects();
2657 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2659 const esObject
object = objects.at(
jj);
2660 if(
object.getType() == esObjectType::EXT) {
2661 relativeBx =
object.getBxOffset();
2662 channelID =
object.getExternalChannelId();
2671 std::vector<GlobalObject>
objType(nrObj, extSignalType);
2684 << externalCond <<
"\n" << std::endl;
2690 <<
" Error: duplicate condition (" << name
2691 <<
")" << std::endl;
2717 tmeventsetup::esCondition corrCond,
2718 unsigned int chipNr) {
2727 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2728 <<
" (in parseCorrelation) " << std::endl
2729 <<
" condition = " << condition << std::endl
2730 <<
" particle = " << particle << std::endl
2731 <<
" type = " << type << std::endl
2732 <<
" name = " << name << std::endl;
2744 <<
" Error: duplicate correlation condition (" << name <<
")" 2757 const int nrObj = 2;
2760 int intGEq[nrObj] = { -1, -1 };
2761 std::vector<GlobalObject>
objType(nrObj);
2762 std::vector<GtConditionCategory> condCateg(nrObj);
2765 const bool corrFlag =
true;
2766 int corrIndexVal[nrObj] = { -1, -1 };
2775 const std::vector<esCut>&
cuts = corrCond.getCuts();
2776 for (
size_t jj = 0;
jj < cuts.size();
jj++)
2778 const esCut
cut = cuts.at(
jj);
2780 if(cut.getCutType() == esCutType::ChargeCorrelation) {
2789 double minV = cut.getMinimum().value;
2790 double maxV = cut.getMaximum().value;
2793 if(maxV > 1.0e8) maxV = 1.0e8;
2796 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaEta Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2797 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2798 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2799 corrParameter.
precEtaCut = cut.getMinimum().index;
2800 cutType = cutType | 0x1;
2802 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaPhi Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2803 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2804 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2805 corrParameter.
precPhiCut = cut.getMinimum().index;
2806 cutType = cutType | 0x2;
2808 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tDeltaR Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2809 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2810 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2811 corrParameter.
precDRCut = cut.getMinimum().index;
2812 cutType = cutType | 0x4;
2813 }
else if (cut.getCutType() == esCutType::TwoBodyPt) {
2816 corrParameter.
precTBPTCut = cut.getMinimum().index;
2817 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tTPBT Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2818 cutType = cutType | 0x20;
2820 LogDebug(
"TriggerMenuParser") <<
"CutType: " << cut.getCutType() <<
"\tMass Cut minV = " << minV <<
" Max = " << maxV <<
" precMin = " << cut.getMinimum().index <<
" precMax = " << cut.getMaximum().index << std::endl;
2823 corrParameter.
precMassCut = cut.getMinimum().index;
2825 if (corrCond.getType() == esConditionType::TransverseMass){
2826 cutType = cutType | 0x10;
2829 cutType = cutType | 0x8;
2839 const std::vector<esObject>&
objects = corrCond.getObjects();
2840 if(objects.size() != 2) {
2842 <<
"incorrect number of objects for the correlation condition " << name <<
" corrFlag " << corrFlag << std::endl;
2847 for (
size_t jj = 0;
jj < objects.size();
jj++)
2849 const esObject
object = objects.at(
jj);
2895 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2899 }
else if(
object.getType() == esObjectType::Egamma ||
2908 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2909 switch(
object.getType()) {
2910 case esObjectType::Egamma: {
2932 object.getType() == esObjectType::ETMHF ||
2933 object.getType() == esObjectType::TOWERCOUNT ||
2941 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
2942 switch(
object.getType()) {
2951 case esObjectType::ETMHF: {
2955 case esObjectType::TOWERCOUNT: {
2969 <<
"Illegal Object Type " <<
object.getType()
2970 <<
" for the correlation condition " << name << std::endl;
2980 if (intGEq[0] != intGEq[1]) {
2982 <<
"Inconsistent GEq flags for sub-conditions " 2983 <<
" for the correlation condition " << name << std::endl;
2988 gEq = (intGEq[0] != 0);
3009 std::ostringstream myCoutStream;
3010 correlationCond.
print(myCoutStream);
3011 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3039 const tmeventsetup::esCondition& corrCond,
3040 unsigned int chipNr) {
3049 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
3050 <<
" (in parseCorrelationWithOverlapRemoval) " << std::endl
3051 <<
" condition = " << condition << std::endl
3052 <<
" particle = " << particle << std::endl
3053 <<
" type = " << type << std::endl
3054 <<
" name = " << name << std::endl;
3066 <<
" Error: duplicate correlation condition (" << name <<
")" 3079 const int nrObj = 3;
3082 int intGEq[nrObj] = { -1, -1, -1 };
3083 std::vector<GlobalObject>
objType(nrObj);
3084 std::vector<GtConditionCategory> condCateg(nrObj);
3087 const bool corrFlag =
true;
3088 int corrIndexVal[nrObj] = { -1, -1, -1 };
3097 const std::vector<esCut>&
cuts = corrCond.getCuts();
3098 for (
size_t jj = 0;
jj < cuts.size();
jj++)
3100 const esCut
cut = cuts.at(
jj);
3102 if(cut.getCutType() == esCutType::ChargeCorrelation) {
3111 double minV = cut.getMinimum().value;
3112 double maxV = cut.getMaximum().value;
3115 if(maxV > 1.0e8) maxV = 1.0e8;
3119 corrParameter.
minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3120 corrParameter.
maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3121 corrParameter.
precEtaCut = cut.getMinimum().index;
3122 cutType = cutType | 0x1;
3125 corrParameter.
minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3126 corrParameter.
maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3127 corrParameter.
precPhiCut = cut.getMinimum().index;
3128 cutType = cutType | 0x2;
3131 corrParameter.
minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
3132 corrParameter.
maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
3133 corrParameter.
precDRCut = cut.getMinimum().index;
3134 cutType = cutType | 0x4;
3139 corrParameter.
precMassCut = cut.getMinimum().index;
3140 cutType = cutType | 0x8;
3142 if(cut.getCutType() == esCutType::OvRmDeltaEta) {
3147 cutType = cutType | 0x10;
3148 }
else if (cut.getCutType() == esCutType::OvRmDeltaPhi) {
3153 cutType = cutType | 0x20;
3154 }
else if (cut.getCutType() == esCutType::OvRmDeltaR) {
3159 cutType = cutType | 0x40;
3168 const std::vector<esObject>&
objects = corrCond.getObjects();
3169 if(objects.size() != 3) {
3171 <<
"incorrect number of objects for the correlation condition with overlap removal " << name <<
" corrFlag " << corrFlag << std::endl;
3176 for (
size_t jj = 0;
jj < objects.size();
jj++)
3178 const esObject&
object = objects.at(
jj);
3225 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3229 }
else if(
object.getType() == esObjectType::Egamma ||
3238 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3239 switch(
object.getType()) {
3240 case esObjectType::Egamma: {
3262 object.getType() == esObjectType::ETMHF ||
3263 object.getType() == esObjectType::TOWERCOUNT ||
3271 intGEq[
jj] = (
object.getComparisonOperator() == esComparisonOperator::GE);
3272 switch(
object.getType()) {
3281 case esObjectType::ETMHF: {
3285 case esObjectType::TOWERCOUNT: {
3299 <<
"Illegal Object Type " <<
object.getType()
3300 <<
" for the correlation condition " << name << std::endl;
3310 if (intGEq[0] != intGEq[1]) {
3312 <<
"Inconsistent GEq flags for sub-conditions " 3313 <<
" for the correlation condition " << name << std::endl;
3318 gEq = (intGEq[0] != 0);
3341 std::ostringstream myCoutStream;
3342 correlationWORCond.
print(myCoutStream);
3343 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" 3371 unsigned int chipNr) {
3382 if (algAlias ==
"") {
3385 <<
"\n No alias defined for algorithm. Alias set to algorithm name." 3386 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3390 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm." 3391 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
3396 const std::string& logExpression = algorithm.getExpressionInCondition();
3399 <<
" Logical expression: " << logExpression
3400 <<
" Chip number: " << chipNr
3404 int outputPin = algorithm.getIndex();
3408 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin
3414 int bitNumber = outputPin;
3417 LogDebug(
"TriggerMenuParser") <<
" Bit number: " << bitNumber
3427 std::ostringstream myCoutStream;
3428 alg.
print(myCoutStream);
3429 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