28 #include <boost/cstdint.hpp>
35 #include "tmEventSetup/tmEventSetup.hh"
36 #include "tmEventSetup/esTriggerMenu.hh"
37 #include "tmEventSetup/esAlgorithm.hh"
38 #include "tmEventSetup/esCondition.hh"
39 #include "tmEventSetup/esObject.hh"
40 #include "tmEventSetup/esCut.hh"
41 #include "tmEventSetup/esScale.hh"
42 #include "tmGrammar/Algorithm.hh"
48 m_triggerMenuInterface(
"NULL"),
49 m_triggerMenuName(
"NULL"), m_triggerMenuImplementation(0x0), m_scaleDbKey(
"NULL")
68 const unsigned int& numberConditionChipsValue) {
70 m_numberConditionChips = numberConditionChipsValue;
77 m_pinsOnConditionChip = pinsOnConditionChipValue;
84 const std::vector<int>& orderConditionChipValue) {
86 m_orderConditionChip = orderConditionChipValue;
92 const unsigned int& numberPhysTriggersValue) {
94 m_numberPhysTriggers = numberPhysTriggersValue;
101 m_conditionMap = condMap;
106 m_triggerMenuInterface = menuInterface;
111 m_triggerMenuUUID =
uuid;
115 m_triggerMenuName = menuName;
119 m_triggerMenuImplementation = menuImplementation;
124 m_scaleDbKey = scaleKey;
129 const std::vector<std::vector<MuonTemplate> >& vecMuonTempl) {
131 m_vecMuonTemplate = vecMuonTempl;
135 const std::vector<std::vector<CaloTemplate> >& vecCaloTempl) {
137 m_vecCaloTemplate = vecCaloTempl;
141 const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTempl) {
143 m_vecEnergySumTemplate = vecEnergySumTempl;
149 const std::vector<std::vector<ExternalTemplate> >& vecExternalTempl) {
151 m_vecExternalTemplate = vecExternalTempl;
156 const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTempl) {
158 m_vecCorrelationTemplate = vecCorrelationTempl;
164 const std::vector<std::vector<MuonTemplate> >& corMuonTempl) {
166 m_corMuonTemplate = corMuonTempl;
170 const std::vector<std::vector<CaloTemplate> >& corCaloTempl) {
172 m_corCaloTemplate = corCaloTempl;
176 const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTempl) {
178 m_corEnergySumTemplate = corEnergySumTempl;
186 m_algorithmMap = algoMap;
191 m_algorithmAliasMap = algoMap;
198 using namespace tmeventsetup;
199 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
200 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
202 std::map<std::string, unsigned int> extBitMap;
205 for (std::map<std::string, esCondition>::const_iterator cit = condMap.begin();
206 cit != condMap.end(); cit++)
208 const esCondition& condition = cit->second;
209 if(condition.getType() == esConditionType::Externals ) {
212 const std::vector<esObject>& objects = condition.getObjects();
213 for (
size_t jj = 0;
jj < objects.size();
jj++) {
215 const esObject
object = objects.at(
jj);
216 if(
object.getType() == esObjectType::EXT) {
218 unsigned int channelID =
object.getExternalChannelId();
244 m_conditionMap.resize(m_numberConditionChips);
246 m_vecMuonTemplate.resize(m_numberConditionChips);
247 m_vecCaloTemplate.resize(m_numberConditionChips);
248 m_vecEnergySumTemplate.resize(m_numberConditionChips);
249 m_vecExternalTemplate.resize(m_numberConditionChips);
251 m_vecCorrelationTemplate.resize(m_numberConditionChips);
252 m_corMuonTemplate.resize(m_numberConditionChips);
253 m_corCaloTemplate.resize(m_numberConditionChips);
254 m_corEnergySumTemplate.resize(m_numberConditionChips);
256 using namespace tmeventsetup;
257 using namespace Algorithm;
259 const esTriggerMenu*
menu =
reinterpret_cast<const esTriggerMenu*
> (utmMenu);
262 m_triggerMenuDescription =
menu->getComment();
263 m_triggerMenuDate =
menu->getDatetime();
264 m_triggerMenuImplementation = 0;
265 m_triggerMenuName =
menu->getName();
266 m_triggerMenuInterface =
menu->getVersion();
267 m_triggerMenuUUID = 0;
269 const std::map<std::string, esAlgorithm>& algoMap =
menu->getAlgorithmMap();
270 const std::map<std::string, esCondition>& condMap =
menu->getConditionMap();
271 const std::map<std::string, esScale>& scaleMap =
menu->getScaleMap();
274 m_gtScales.setScalesName(
menu->getScaleSetName() );
275 parseScales(scaleMap);
279 for (std::map<std::string, esAlgorithm>::const_iterator cit = algoMap.begin();
280 cit != algoMap.end(); cit++)
286 const esAlgorithm&
algo = cit->second;
289 parseAlgorithm(algo,chipNr);
292 const std::vector<std::string>& rpn_vec = algo.getRpnVector();
293 for (
size_t ii = 0;
ii < rpn_vec.size();
ii++)
296 if (isGate(token))
continue;
298 const esCondition& condition = condMap.find(token)->second;
302 if ((m_conditionMap[chipNr]).
count(condition.getName()) == 0) {
305 if(condition.getType() == esConditionType::SingleEgamma ||
306 condition.getType() == esConditionType::DoubleEgamma ||
307 condition.getType() == esConditionType::TripleEgamma ||
308 condition.getType() == esConditionType::QuadEgamma ||
309 condition.getType() == esConditionType::SingleTau ||
310 condition.getType() == esConditionType::DoubleTau ||
311 condition.getType() == esConditionType::TripleTau ||
312 condition.getType() == esConditionType::QuadTau ||
313 condition.getType() == esConditionType::SingleJet ||
314 condition.getType() == esConditionType::DoubleJet ||
315 condition.getType() == esConditionType::TripleJet ||
316 condition.getType() == esConditionType::QuadJet )
318 parseCalo(condition,chipNr,
false);
321 }
else if(condition.getType() == esConditionType::TotalEt ||
322 condition.getType() == esConditionType::TotalHt ||
323 condition.getType() == esConditionType::MissingEt ||
324 condition.getType() == esConditionType::MissingHt )
328 parseEnergySum(condition,chipNr,
false);
333 condition.getType() == esConditionType::TripleMuon ||
334 condition.getType() == esConditionType::QuadMuon )
336 parseMuon(condition,chipNr,
false);
340 }
else if(condition.getType() == esConditionType::MuonMuonCorrelation ||
341 condition.getType() == esConditionType::MuonEsumCorrelation ||
342 condition.getType() == esConditionType::CaloMuonCorrelation ||
343 condition.getType() == esConditionType::CaloCaloCorrelation ||
344 condition.getType() == esConditionType::CaloEsumCorrelation ||
347 parseCorrelation(condition,chipNr);
350 }
else if(condition.getType() == esConditionType::Externals )
352 parseExternal(condition,chipNr);
371 m_triggerMenuInterfaceDate = val;
377 m_triggerMenuInterfaceAuthor = val;
383 m_triggerMenuInterfaceDescription = val;
390 m_triggerMenuDate = val;
396 m_triggerMenuAuthor = val;
402 m_triggerMenuDescription = val;
408 m_algorithmImplementation = val;
422 for (std::vector<ConditionMap>::iterator itCondOnChip = m_conditionMap.begin(); itCondOnChip
423 != m_conditionMap.end(); itCondOnChip++) {
427 itCondOnChip->clear();
432 m_algorithmMap.clear();
442 <<
" Trying to insert condition \"" << cName <<
"\" in the condition map." ;
445 if ((m_conditionMap[chipNr]).
count(cName) != 0) {
446 LogTrace(
"TriggerMenuParser") <<
" Condition " << cName
447 <<
" already exists - not inserted!" << std::endl;
451 (m_conditionMap[chipNr])[cName] = &cond;
453 <<
" OK - condition inserted!"
470 if (m_algorithmMap.count(algName) != 0) {
471 LogTrace(
"TriggerMenuParser") <<
" Algorithm \"" << algName
472 <<
"\"already exists in the algorithm map- not inserted!" << std::endl;
476 if (m_algorithmAliasMap.count(algAlias) != 0) {
477 LogTrace(
"TriggerMenuParser") <<
" Algorithm alias \"" << algAlias
478 <<
"\"already exists in the algorithm alias map- not inserted!" << std::endl;
484 if ((bitNumber < 0) || (bitNumber >= static_cast<int>(m_numberPhysTriggers))) {
485 LogTrace(
"TriggerMenuParser") <<
" Bit number " << bitNumber
486 <<
" outside allowed range [0, " << m_numberPhysTriggers
487 <<
") - algorithm not inserted!" << std::endl;
492 if (m_algorithmMap.size() >= m_numberPhysTriggers) {
493 LogTrace(
"TriggerMenuParser") <<
" More than maximum allowed "
494 << m_numberPhysTriggers <<
" algorithms in the algorithm map - not inserted!"
501 int chipNr = alg.
algoChipNumber(static_cast<int>(m_numberConditionChips),
502 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
504 if ((chipNr < 0) || (chipNr > static_cast<int>(m_numberConditionChips))) {
505 LogTrace(
"TriggerMenuParser") <<
" Chip number " << chipNr
506 <<
" outside allowed range [0, " << m_numberConditionChips
507 <<
") - algorithm not inserted!" << std::endl;
512 int outputPin = alg.
algoOutputPin(static_cast<int>(m_numberConditionChips),
513 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
515 if ((outputPin < 0) || (outputPin > static_cast<int>(m_pinsOnConditionChip))) {
516 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
517 <<
" outside allowed range [0, " << m_pinsOnConditionChip
518 <<
"] - algorithm not inserted!" << std::endl;
523 for (
CItAlgo itAlgo = m_algorithmMap.begin(); itAlgo != m_algorithmMap.end(); itAlgo++) {
525 int iPin = (itAlgo->second).algoOutputPin( static_cast<int>(m_numberConditionChips),
526 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
528 int iChip = (itAlgo->second).algoChipNumber(static_cast<int>(m_numberConditionChips),
529 static_cast<int>(m_pinsOnConditionChip), m_orderConditionChip);
531 if ( (outputPin == iPin) && (chipNr == iChip)) {
532 LogTrace(
"TriggerMenuParser") <<
" Output pin " << outputPin
533 <<
" is the same as for algorithm " << iName
534 <<
"\n from the same chip number " << chipNr <<
" - algorithm not inserted!"
542 m_algorithmMap[algName] = alg;
543 m_algorithmAliasMap[algAlias] = alg;
555 std::stringstream
ss;
560 std::stringstream
ss;
577 using namespace tmeventsetup;
591 for (std::map<std::string, esScale>::const_iterator cit = scaleMap.begin();
592 cit != scaleMap.end(); cit++)
594 const esScale&
scale = cit->second;
598 else if (scale.getObjectType() == esObjectType::Egamma) scaleParam = &egScales;
607 if(scaleParam != 0) {
608 switch(scale.getScaleType()) {
609 case esScaleType::EtScale: {
610 scaleParam->
etMin = scale.getMinimum();
611 scaleParam->
etMax = scale.getMaximum();
612 scaleParam->
etStep = scale.getStep();
615 const std::vector<esBin> binsV = scale.getBins();
616 for(
unsigned int i=0;
i<binsV.size();
i++) {
617 const esBin&
bin = binsV.at(
i);
618 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
619 scaleParam->
etBins.push_back(binLimits);
638 case esScaleType::EtaScale: {
639 scaleParam->
etaMin = scale.getMinimum();
640 scaleParam->
etaMax = scale.getMaximum();
641 scaleParam->
etaStep = scale.getStep();
644 const std::vector<esBin> binsV = scale.getBins();
645 scaleParam->
etaBins.resize(
pow(2,scale.getNbits()));
646 for(
unsigned int i=0;
i<binsV.size();
i++) {
647 const esBin&
bin = binsV.at(
i);
648 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
649 scaleParam->
etaBins.at(bin.hw_index) = binLimits;
653 case esScaleType::PhiScale: {
654 scaleParam->
phiMin = scale.getMinimum();
655 scaleParam->
phiMax = scale.getMaximum();
656 scaleParam->
phiStep = scale.getStep();
659 const std::vector<esBin> binsV = scale.getBins();
660 scaleParam->
phiBins.resize(
pow(2,scale.getNbits()));
661 for(
unsigned int i=0;
i<binsV.size();
i++) {
662 const esBin&
bin = binsV.at(
i);
663 std::pair<double, double> binLimits(bin.minimum, bin.maximum);
664 scaleParam->
phiBins.at(bin.hw_index) = binLimits;
676 m_gtScales.setMuonScales(muScales);
677 m_gtScales.setEGScales(egScales);
678 m_gtScales.setTauScales(tauScales);
679 m_gtScales.setJetScales(jetScales);
680 m_gtScales.setETTScales(ettScales);
681 m_gtScales.setETMScales(etmScales);
682 m_gtScales.setHTTScales(httScales);
683 m_gtScales.setHTMScales(htmScales);
688 bool hasPrecision =
false;
689 std::map<std::string, unsigned int> precisions;
690 getPrecisions(precisions, scaleMap);
691 for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++)
703 parseCalMuEta_LUTS(scaleMap,
"EG",
"MU");
704 parseCalMuEta_LUTS(scaleMap,
"JET",
"MU");
705 parseCalMuEta_LUTS(scaleMap,
"TAU",
"MU");
709 parseCalMuPhi_LUTS(scaleMap,
"EG",
"MU");
710 parseCalMuPhi_LUTS(scaleMap,
"JET",
"MU");
711 parseCalMuPhi_LUTS(scaleMap,
"TAU",
"MU");
712 parseCalMuPhi_LUTS(scaleMap,
"HTM",
"MU");
713 parseCalMuPhi_LUTS(scaleMap,
"ETM",
"MU");
717 parsePt_LUTS(scaleMap,
"EG", precisions[
"PRECISION-EG-MU-MassPt"] );
718 parsePt_LUTS(scaleMap,
"MU", precisions[
"PRECISION-EG-MU-MassPt"] );
719 parsePt_LUTS(scaleMap,
"JET", precisions[
"PRECISION-EG-JET-MassPt"] );
720 parsePt_LUTS(scaleMap,
"TAU", precisions[
"PRECISION-EG-TAU-MassPt"] );
724 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
725 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
726 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
727 parseDeltaEta_Cosh_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
729 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
730 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
731 parseDeltaEta_Cosh_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
733 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
734 parseDeltaEta_Cosh_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
736 parseDeltaEta_Cosh_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
741 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"EG", precisions[
"PRECISION-EG-EG-Delta"], precisions[
"PRECISION-EG-EG-Math"]);
742 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"JET",precisions[
"PRECISION-EG-JET-Delta"],precisions[
"PRECISION-EG-JET-Math"]);
743 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"TAU",precisions[
"PRECISION-EG-TAU-Delta"],precisions[
"PRECISION-EG-TAU-Math"]);
744 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"ETM",precisions[
"PRECISION-EG-ETM-Delta"],precisions[
"PRECISION-EG-ETM-Math"]);
745 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"HTM",precisions[
"PRECISION-EG-HTM-Delta"],precisions[
"PRECISION-EG-HTM-Math"]);
746 parseDeltaPhi_Cos_LUTS(scaleMap,
"EG",
"MU", precisions[
"PRECISION-EG-MU-Delta"], precisions[
"PRECISION-EG-MU-Math"]);
748 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"JET",precisions[
"PRECISION-JET-JET-Delta"],precisions[
"PRECISION-JET-JET-Math"]);
749 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"TAU",precisions[
"PRECISION-JET-TAU-Delta"],precisions[
"PRECISION-JET-TAU-Math"]);
750 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"ETM",precisions[
"PRECISION-JET-ETM-Delta"],precisions[
"PRECISION-JET-ETM-Math"]);
751 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"HTM",precisions[
"PRECISION-JET-HTM-Delta"],precisions[
"PRECISION-JET-HTM-Math"]);
752 parseDeltaPhi_Cos_LUTS(scaleMap,
"JET",
"MU", precisions[
"PRECISION-JET-MU-Delta"], precisions[
"PRECISION-JET-MU-Math"]);
754 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"TAU",precisions[
"PRECISION-TAU-TAU-Delta"],precisions[
"PRECISION-TAU-TAU-Math"]);
755 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"ETM",precisions[
"PRECISION-TAU-ETM-Delta"],precisions[
"PRECISION-TAU-ETM-Math"]);
756 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"HTM",precisions[
"PRECISION-TAU-HTM-Delta"],precisions[
"PRECISION-TAU-HTM-Math"]);
757 parseDeltaPhi_Cos_LUTS(scaleMap,
"TAU",
"MU", precisions[
"PRECISION-TAU-MU-Delta"], precisions[
"PRECISION-TAU-MU-Math"]);
759 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"ETM",precisions[
"PRECISION-MU-ETM-Delta"],precisions[
"PRECISION-MU-ETM-Math"]);
760 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"HTM",precisions[
"PRECISION-MU-HTM-Delta"],precisions[
"PRECISION-MU-HTM-Math"]);
761 parseDeltaPhi_Cos_LUTS(scaleMap,
"MU",
"MU", precisions[
"PRECISION-MU-MU-Delta"], precisions[
"PRECISION-MU-MU-Math"]);
778 using namespace tmeventsetup;
785 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
786 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
788 std::vector<long long> lut_cal_2_mu_eta;
789 getCaloMuonEtaConversionLut(lut_cal_2_mu_eta, scale1, scale2);
794 m_gtScales.setLUT_CalMuEta(lutName,lut_cal_2_mu_eta);
802 using namespace tmeventsetup;
809 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
810 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
812 std::vector<long long> lut_cal_2_mu_phi;
813 getCaloMuonPhiConversionLut(lut_cal_2_mu_phi, scale1, scale2);
818 m_gtScales.setLUT_CalMuPhi(lutName,lut_cal_2_mu_phi);
826 using namespace tmeventsetup;
831 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
833 std::vector<long long> lut_pt;
834 getLut(lut_pt, scale1, prec);
835 m_gtScales.setLUT_Pt(scLabel1,lut_pt,prec);
843 using namespace tmeventsetup;
850 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
851 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
852 std::vector<double> val_delta_eta;
853 std::vector<long long> lut_delta_eta;
854 size_t n = getDeltaVector(val_delta_eta, scale1, scale2);
855 setLut(lut_delta_eta, val_delta_eta, prec1);
859 m_gtScales.setLUT_DeltaEta(lutName,lut_delta_eta,prec1);
862 std::vector<long long> lut_cosh;
863 applyCosh(val_delta_eta,
n);
864 setLut(lut_cosh, val_delta_eta, prec2);
865 m_gtScales.setLUT_Cosh(lutName,lut_cosh,prec2);
872 using namespace tmeventsetup;
879 const esScale* scale1 = &scaleMap.find(scLabel1)->second;
880 const esScale* scale2 = &scaleMap.find(scLabel2)->second;
881 std::vector<double> val_delta_phi;
882 std::vector<long long> lut_delta_phi;
883 size_t n = getDeltaVector(val_delta_phi, scale1, scale2);
884 setLut(lut_delta_phi, val_delta_phi, prec1);
888 m_gtScales.setLUT_DeltaPhi(lutName,lut_delta_phi,prec1);
891 std::vector<long long> lut_cos;
892 applyCos(val_delta_phi,
n);
893 setLut(lut_cos, val_delta_phi, prec2);
894 m_gtScales.setLUT_Cos(lutName,lut_cos,prec2);
910 unsigned int chipNr,
const bool corrFlag) {
912 using namespace tmeventsetup;
933 }
else if (condMu.getType() == esConditionType::TripleMuon) {
937 }
else if (condMu.getType() == esConditionType::QuadMuon) {
942 edm::LogError(
"TriggerMenuParser") <<
"Wrong type for muon-condition ("
943 <<
type <<
")" << std::endl;
948 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type
949 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
954 <<
"\n ****************************************** "
956 <<
"\n condition = " << condition
957 <<
"\n particle = " << particle
958 <<
"\n type = " <<
type
959 <<
"\n name = " <<
name
967 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
973 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
974 tmpValues.reserve( nrObj );
976 if(
int(condMu.getObjects().size())!=nrObj ){
977 edm::LogError(
"TriggerMenuParser") <<
" condMu objects: nrObj = " << nrObj
978 <<
"condMu.getObjects().size() = "
979 << condMu.getObjects().size()
986 unsigned int chargeCorrelation = 1;
987 const std::vector<esCut>&
cuts = condMu.getCuts();
991 if(cut.getCutType() == esCutType::ChargeCorrelation) {
992 if( cut.getData()==
"ls" ) chargeCorrelation = 2;
993 else if( cut.getData()==
"os" ) chargeCorrelation = 4;
994 else chargeCorrelation = 1;
999 corrParameter.chargeCorrelation = chargeCorrelation;
1010 const std::vector<esObject>& objects = condMu.getObjects();
1011 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1013 const esObject
object = objects.at(
jj);
1017 relativeBx =
object.getBxOffset();
1020 int upperThresholdInd = -1;
1021 int lowerThresholdInd = 0;
1023 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1025 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1026 int isolationLUT = 0xF;
1028 int qualityLUT = 0xFFFF;
1030 const std::vector<esCut>&
cuts =
object.getCuts();
1031 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1033 const esCut
cut = cuts.at(
kk);
1035 switch(cut.getCutType()){
1036 case esCutType::Threshold:
1037 lowerThresholdInd = cut.getMinimum().index;
1038 upperThresholdInd = cut.getMaximum().index;
1044 etaWindow1Lower = cut.getMinimum().index;
1045 etaWindow1Upper = cut.getMaximum().index;
1046 }
else if(cntEta == 1) {
1047 etaWindow2Lower = cut.getMinimum().index;
1048 etaWindow2Upper = cut.getMaximum().index;
1050 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition ("
1051 << particle <<
")" << std::endl;
1061 phiWindow1Lower = cut.getMinimum().index;
1062 phiWindow1Upper = cut.getMaximum().index;
1063 }
else if(cntPhi == 1) {
1064 phiWindow2Lower = cut.getMinimum().index;
1065 phiWindow2Upper = cut.getMaximum().index;
1067 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition ("
1068 << particle <<
")" << std::endl;
1075 case esCutType::Charge:
1076 if( cut.getData()==
"positive" ) charge = 0;
1077 else if( cut.getData()==
"negative" ) charge = 1;
1082 qualityLUT = l1tstr2int(cut.getData());
1085 case esCutType::Isolation: {
1087 isolationLUT = l1tstr2int(cut.getData());
1098 objParameter[cnt].ptHighThreshold = upperThresholdInd;
1099 objParameter[cnt].ptLowThreshold = lowerThresholdInd;
1101 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1102 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1103 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1104 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1106 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1107 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1108 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1109 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1112 objParameter[cnt].enableMip =
false;
1113 objParameter[cnt].enableIso =
false;
1114 objParameter[cnt].requestIso =
false;
1116 objParameter[cnt].charge =
charge;
1117 objParameter[cnt].qualityLUT = qualityLUT;
1118 objParameter[cnt].isolationLUT = isolationLUT;
1126 std::vector<GlobalObject> objType(nrObj,
gtMu);
1142 std::ostringstream myCoutStream;
1143 muonCond.
print(myCoutStream);
1144 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1148 if ( !insertConditionIntoMap(muonCond, chipNr)) {
1150 <<
" Error: duplicate condition (" <<
name <<
")"
1155 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the ConditionMap" << std::endl;
1158 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1161 LogDebug(
"TriggerMenuParser") <<
"Added Condition " <<
name <<
" to the vecMuonTemplate vector" << std::endl;
1162 (m_vecMuonTemplate[chipNr]).push_back(muonCond);
1173 unsigned int chipNr) {
1177 using namespace tmeventsetup;
1191 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for muon-condition (" <<
type
1192 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1197 <<
"\n ****************************************** "
1199 <<
"\n condition = " << condition
1200 <<
"\n particle = " << particle
1201 <<
"\n type = " <<
type
1202 <<
"\n name = " <<
name
1210 std::vector<MuonTemplate::ObjectParameter> objParameter(nrObj);
1216 std::vector<boost::uint64_t> tmpValues((nrObj > 2) ? nrObj : 2);
1217 tmpValues.reserve( nrObj );
1223 unsigned int chargeCorrelation = 0;
1224 if( str_chargeCorrelation==
"ig" ) chargeCorrelation = 1;
1225 else if( str_chargeCorrelation==
"ls" ) chargeCorrelation = 2;
1226 else if( str_chargeCorrelation==
"os" ) chargeCorrelation = 4;
1229 corrParameter.chargeCorrelation = chargeCorrelation;
1242 relativeBx = corrMu->getBxOffset();
1245 int upperThresholdInd = -1;
1246 int lowerThresholdInd = 0;
1248 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1250 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1251 int isolationLUT = 0xF;
1253 int qualityLUT = 0xFFFF;
1255 const std::vector<esCut>&
cuts = corrMu->getCuts();
1260 switch(cut.getCutType()){
1261 case esCutType::Threshold:
1262 lowerThresholdInd = cut.getMinimum().index;
1263 upperThresholdInd = cut.getMaximum().index;
1269 etaWindow1Lower = cut.getMinimum().index;
1270 etaWindow1Upper = cut.getMaximum().index;
1271 }
else if(cntEta == 1) {
1272 etaWindow2Lower = cut.getMinimum().index;
1273 etaWindow2Upper = cut.getMaximum().index;
1275 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for muon-condition ("
1276 << particle <<
")" << std::endl;
1286 phiWindow1Lower = cut.getMinimum().index;
1287 phiWindow1Upper = cut.getMaximum().index;
1288 }
else if(cntPhi == 1) {
1289 phiWindow2Lower = cut.getMinimum().index;
1290 phiWindow2Upper = cut.getMaximum().index;
1292 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for muon-condition ("
1293 << particle <<
")" << std::endl;
1300 case esCutType::Charge:
1301 if( cut.getData()==
"positive" )
charge = 0;
1302 else if( cut.getData()==
"negative" )
charge = 1;
1307 qualityLUT = l1tstr2int(cut.getData());
1310 case esCutType::Isolation: {
1312 isolationLUT = l1tstr2int(cut.getData());
1323 objParameter[0].ptHighThreshold = upperThresholdInd;
1324 objParameter[0].ptLowThreshold = lowerThresholdInd;
1326 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1327 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1328 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1329 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1331 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1332 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1333 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1334 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1337 objParameter[0].enableMip =
false;
1338 objParameter[0].enableIso =
false;
1339 objParameter[0].requestIso =
false;
1341 objParameter[0].charge =
charge;
1342 objParameter[0].qualityLUT = qualityLUT;
1343 objParameter[0].isolationLUT = isolationLUT;
1347 std::vector<GlobalObject> objType(nrObj,
gtMu);
1360 std::ostringstream myCoutStream;
1361 muonCond.
print(myCoutStream);
1362 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1378 (m_corMuonTemplate[chipNr]).push_back(muonCond);
1398 unsigned int chipNr,
const bool corrFlag) {
1402 using namespace tmeventsetup;
1412 <<
"\n ****************************************** "
1413 <<
"\n (in parseCalo) "
1414 <<
"\n condition = " << condition
1415 <<
"\n particle = " << particle
1416 <<
"\n type = " <<
type
1417 <<
"\n name = " <<
name
1428 if (condCalo.getType() == esConditionType::SingleEgamma) {
1433 }
else if (condCalo.getType() == esConditionType::DoubleEgamma) {
1438 }
else if (condCalo.getType() == esConditionType::TripleEgamma) {
1443 }
else if (condCalo.getType() == esConditionType::QuadEgamma) {
1448 }
else if (condCalo.getType() == esConditionType::SingleJet) {
1449 caloObjType =
gtJet;
1453 }
else if (condCalo.getType() == esConditionType::DoubleJet) {
1454 caloObjType =
gtJet;
1458 }
else if (condCalo.getType() == esConditionType::TripleJet) {
1459 caloObjType =
gtJet;
1463 }
else if (condCalo.getType() == esConditionType::QuadJet) {
1464 caloObjType =
gtJet;
1468 }
else if (condCalo.getType() == esConditionType::SingleTau) {
1469 caloObjType =
gtTau;
1473 }
else if (condCalo.getType() == esConditionType::DoubleTau) {
1474 caloObjType =
gtTau;
1478 }
else if (condCalo.getType() == esConditionType::TripleTau) {
1479 caloObjType =
gtTau;
1483 }
else if (condCalo.getType() == esConditionType::QuadTau) {
1484 caloObjType =
gtTau;
1489 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition ("
1490 << particle <<
")" << std::endl;
1497 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type
1498 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1505 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1511 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1512 tmpValues.reserve( nrObj );
1515 if(
int(condCalo.getObjects().size())!=nrObj ){
1516 edm::LogError(
"TriggerMenuParser") <<
" condCalo objects: nrObj = " << nrObj
1517 <<
"condCalo.getObjects().size() = "
1518 << condCalo.getObjects().size()
1534 const std::vector<esObject>& objects = condCalo.getObjects();
1535 for (
size_t jj = 0;
jj < objects.size();
jj++) {
1537 const esObject
object = objects.at(
jj);
1541 relativeBx =
object.getBxOffset();
1544 int upperThresholdInd = -1;
1545 int lowerThresholdInd = 0;
1547 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1549 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1550 int isolationLUT = 0xF;
1551 int qualityLUT = 0xF;
1554 const std::vector<esCut>&
cuts =
object.getCuts();
1555 for (
size_t kk = 0;
kk < cuts.size();
kk++)
1557 const esCut
cut = cuts.at(
kk);
1559 switch(cut.getCutType()){
1560 case esCutType::Threshold:
1561 lowerThresholdInd = cut.getMinimum().index;
1562 upperThresholdInd = cut.getMaximum().index;
1567 etaWindow1Lower = cut.getMinimum().index;
1568 etaWindow1Upper = cut.getMaximum().index;
1569 }
else if(cntEta == 1) {
1570 etaWindow2Lower = cut.getMinimum().index;
1571 etaWindow2Upper = cut.getMaximum().index;
1573 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition ("
1574 << particle <<
")" << std::endl;
1584 phiWindow1Lower = cut.getMinimum().index;
1585 phiWindow1Upper = cut.getMaximum().index;
1586 }
else if(cntPhi == 1) {
1587 phiWindow2Lower = cut.getMinimum().index;
1588 phiWindow2Upper = cut.getMaximum().index;
1590 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition ("
1591 << particle <<
")" << std::endl;
1598 case esCutType::Charge: {
1600 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition ("
1601 << particle <<
")" << std::endl;
1607 qualityLUT = l1tstr2int(cut.getData());
1610 case esCutType::Isolation: {
1612 isolationLUT = l1tstr2int(cut.getData());
1622 objParameter[cnt].etHighThreshold = upperThresholdInd;
1623 objParameter[cnt].etLowThreshold = lowerThresholdInd;
1624 objParameter[cnt].etaWindow1Lower = etaWindow1Lower;
1625 objParameter[cnt].etaWindow1Upper = etaWindow1Upper;
1626 objParameter[cnt].etaWindow2Lower = etaWindow2Lower;
1627 objParameter[cnt].etaWindow2Upper = etaWindow2Upper;
1628 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
1629 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
1630 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
1631 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
1632 objParameter[cnt].isolationLUT = isolationLUT;
1633 objParameter[cnt].qualityLUT = qualityLUT;
1637 <<
"\n Calo ET high thresholds (hex) for calo object " << caloObjType <<
" " << cnt <<
" = "
1638 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
1639 <<
"\n etaWindow Lower / Upper for calo object " << cnt <<
" = 0x"
1640 << objParameter[cnt].etaWindow1Lower <<
" / 0x" << objParameter[cnt].etaWindow1Upper
1641 <<
"\n etaWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
1642 << objParameter[cnt].etaWindow2Lower <<
" / 0x" << objParameter[cnt].etaWindow2Upper
1643 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
1644 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
1645 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
1646 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper
1647 <<
"\n Isolation LUT for calo object " << cnt <<
" = 0x"
1648 << objParameter[cnt].isolationLUT
1649 <<
"\n Quality LUT for calo object " << cnt <<
" = 0x"
1650 << objParameter[cnt].qualityLUT <<
std::dec
1659 std::vector<GlobalObject> objType(nrObj, caloObjType);
1681 std::ostringstream myCoutStream;
1682 caloCond.
print(myCoutStream);
1683 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1689 if ( !insertConditionIntoMap(caloCond, chipNr)) {
1692 <<
" Error: duplicate condition (" <<
name <<
")"
1700 (m_corCaloTemplate[chipNr]).push_back(caloCond);
1703 (m_vecCaloTemplate[chipNr]).push_back(caloCond);
1727 unsigned int chipNr) {
1731 using namespace tmeventsetup;
1741 <<
"\n ****************************************** "
1742 <<
"\n (in parseCalo) "
1743 <<
"\n condition = " << condition
1744 <<
"\n particle = " << particle
1745 <<
"\n type = " <<
type
1746 <<
"\n name = " <<
name
1758 if (corrCalo->getType() == esObjectType::Egamma) {
1761 caloObjType =
gtJet;
1763 caloObjType =
gtTau;
1765 edm::LogError(
"TriggerMenuParser") <<
"Wrong particle for calo-condition ("
1766 << particle <<
")" << std::endl;
1774 edm::LogError(
"TriggerMenuParser") <<
"Unknown type for calo-condition (" <<
type
1775 <<
")" <<
"\nCan not determine number of trigger objects. " << std::endl;
1782 std::vector<CaloTemplate::ObjectParameter> objParameter(nrObj);
1788 std::vector<boost::uint64_t> tmpValues((nrObj > 1) ? nrObj : 1);
1789 tmpValues.reserve( nrObj );
1801 relativeBx = corrCalo->getBxOffset();
1804 int upperThresholdInd = -1;
1805 int lowerThresholdInd = 0;
1807 unsigned int etaWindow1Lower=-1, etaWindow1Upper=-1, etaWindow2Lower=-1, etaWindow2Upper=-1;
1809 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
1810 int isolationLUT = 0xF;
1811 int qualityLUT = 0xF;
1814 const std::vector<esCut>&
cuts = corrCalo->getCuts();
1819 switch(cut.getCutType()){
1820 case esCutType::Threshold:
1821 lowerThresholdInd = cut.getMinimum().index;
1822 upperThresholdInd = cut.getMaximum().index;
1827 etaWindow1Lower = cut.getMinimum().index;
1828 etaWindow1Upper = cut.getMaximum().index;
1829 }
else if(cntEta == 1) {
1830 etaWindow2Lower = cut.getMinimum().index;
1831 etaWindow2Upper = cut.getMaximum().index;
1833 edm::LogError(
"TriggerMenuParser") <<
"Too Many Eta Cuts for calo-condition ("
1834 << particle <<
")" << std::endl;
1844 phiWindow1Lower = cut.getMinimum().index;
1845 phiWindow1Upper = cut.getMaximum().index;
1846 }
else if(cntPhi == 1) {
1847 phiWindow2Lower = cut.getMinimum().index;
1848 phiWindow2Upper = cut.getMaximum().index;
1850 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for calo-condition ("
1851 << particle <<
")" << std::endl;
1858 case esCutType::Charge: {
1860 edm::LogError(
"TriggerMenuParser") <<
"No charge cut for calo-condition ("
1861 << particle <<
")" << std::endl;
1867 qualityLUT = l1tstr2int(cut.getData());
1870 case esCutType::Isolation: {
1872 isolationLUT = l1tstr2int(cut.getData());
1882 objParameter[0].etLowThreshold = lowerThresholdInd;
1883 objParameter[0].etHighThreshold = upperThresholdInd;
1884 objParameter[0].etaWindow1Lower = etaWindow1Lower;
1885 objParameter[0].etaWindow1Upper = etaWindow1Upper;
1886 objParameter[0].etaWindow2Lower = etaWindow2Lower;
1887 objParameter[0].etaWindow2Upper = etaWindow2Upper;
1888 objParameter[0].phiWindow1Lower = phiWindow1Lower;
1889 objParameter[0].phiWindow1Upper = phiWindow1Upper;
1890 objParameter[0].phiWindow2Lower = phiWindow2Lower;
1891 objParameter[0].phiWindow2Upper = phiWindow2Upper;
1892 objParameter[0].isolationLUT = isolationLUT;
1893 objParameter[0].qualityLUT = qualityLUT;
1897 <<
"\n Calo ET high threshold (hex) for calo object " << caloObjType <<
" " <<
" = "
1898 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etHighThreshold
1899 <<
"\n etaWindow Lower / Upper for calo object " <<
" = 0x"
1900 << objParameter[0].etaWindow1Lower <<
" / 0x" << objParameter[0].etaWindow1Upper
1901 <<
"\n etaWindowVeto Lower / Upper for calo object " <<
" = 0x"
1902 << objParameter[0].etaWindow2Lower <<
" / 0x" << objParameter[0].etaWindow2Upper
1903 <<
"\n phiWindow Lower / Upper for calo object " <<
" = 0x"
1904 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
1905 <<
"\n phiWindowVeto Lower / Upper for calo object " <<
" = 0x"
1906 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper
1907 <<
"\n Isolation LUT for calo object " <<
" = 0x"
1908 << objParameter[0].isolationLUT
1909 <<
"\n Quality LUT for calo object " <<
" = 0x"
1910 << objParameter[0].qualityLUT <<
std::dec
1918 std::vector<GlobalObject> objType(nrObj, caloObjType);
1940 std::ostringstream myCoutStream;
1941 caloCond.
print(myCoutStream);
1942 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
1960 (m_corCaloTemplate[chipNr]).push_back(caloCond);
1980 unsigned int chipNr,
const bool corrFlag) {
1984 using namespace tmeventsetup;
1993 <<
"\n ****************************************** "
1994 <<
"\n (in parseEnergySum) "
1995 <<
"\n condition = " << condition
1996 <<
"\n type = " <<
type
1997 <<
"\n name = " <<
name
2006 if( condEnergySum.getType() == esConditionType::MissingEt ){
2010 else if( condEnergySum.getType() == esConditionType::TotalEt ){
2014 else if( condEnergySum.getType() == esConditionType::TotalHt ){
2018 else if( condEnergySum.getType() == esConditionType::MissingHt ){
2032 <<
"Wrong type for energy-sum condition (" <<
type
2033 <<
")" << std::endl;
2047 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2059 const std::vector<esObject>& objects = condEnergySum.getObjects();
2060 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2062 const esObject
object = objects.at(
jj);
2066 relativeBx =
object.getBxOffset();
2069 int lowerThresholdInd = 0;
2070 int upperThresholdInd = -1;
2072 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2075 const std::vector<esCut>&
cuts =
object.getCuts();
2076 for (
size_t kk = 0;
kk < cuts.size();
kk++)
2078 const esCut
cut = cuts.at(
kk);
2080 switch(cut.getCutType()){
2081 case esCutType::Threshold:
2082 lowerThresholdInd = cut.getMinimum().index;
2083 upperThresholdInd = cut.getMaximum().index;
2092 phiWindow1Lower = cut.getMinimum().index;
2093 phiWindow1Upper = cut.getMaximum().index;
2094 }
else if(cntPhi == 1) {
2095 phiWindow2Lower = cut.getMinimum().index;
2096 phiWindow2Upper = cut.getMaximum().index;
2098 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition ("
2099 <<
type <<
")" << std::endl;
2116 objParameter[cnt].etLowThreshold = lowerThresholdInd;
2117 objParameter[cnt].etHighThreshold = upperThresholdInd;
2118 objParameter[cnt].phiWindow1Lower = phiWindow1Lower;
2119 objParameter[cnt].phiWindow1Upper = phiWindow1Upper;
2120 objParameter[cnt].phiWindow2Lower = phiWindow2Lower;
2121 objParameter[cnt].phiWindow2Upper = phiWindow2Upper;
2126 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2127 << std::hex << objParameter[cnt].etLowThreshold <<
" - " << objParameter[cnt].etHighThreshold
2128 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
2129 << objParameter[cnt].phiWindow1Lower <<
" / 0x" << objParameter[cnt].phiWindow1Upper
2130 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
2131 << objParameter[cnt].phiWindow2Lower <<
" / 0x" << objParameter[cnt].phiWindow2Upper <<
std::dec
2138 std::vector<GlobalObject> objType(nrObj, energySumObjType);
2154 std::ostringstream myCoutStream;
2155 energySumCond.
print(myCoutStream);
2156 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2161 if ( !insertConditionIntoMap(energySumCond, chipNr)) {
2164 <<
" Error: duplicate condition (" <<
name <<
")"
2172 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2176 (m_vecEnergySumTemplate[chipNr]).push_back(energySumCond);
2200 unsigned int chipNr) {
2204 using namespace tmeventsetup;
2213 <<
"\n ****************************************** "
2214 <<
"\n (in parseEnergySum) "
2215 <<
"\n condition = " << condition
2216 <<
"\n type = " <<
type
2217 <<
"\n name = " <<
name
2240 <<
"Wrong type for energy-sum correclation condition (" <<
type
2241 <<
")" << std::endl;
2255 std::vector<EnergySumTemplate::ObjectParameter> objParameter(nrObj);
2270 relativeBx = corrESum->getBxOffset();
2273 int lowerThresholdInd = 0;
2274 int upperThresholdInd = -1;
2276 unsigned int phiWindow1Lower=-1, phiWindow1Upper=-1, phiWindow2Lower=-1, phiWindow2Upper=-1;
2279 const std::vector<esCut>&
cuts = corrESum->getCuts();
2284 switch(cut.getCutType()){
2285 case esCutType::Threshold:
2286 lowerThresholdInd = cut.getMinimum().index;
2287 upperThresholdInd = cut.getMaximum().index;
2296 phiWindow1Lower = cut.getMinimum().index;
2297 phiWindow1Upper = cut.getMaximum().index;
2298 }
else if(cntPhi == 1) {
2299 phiWindow2Lower = cut.getMinimum().index;
2300 phiWindow2Upper = cut.getMaximum().index;
2302 edm::LogError(
"TriggerMenuParser") <<
"Too Many Phi Cuts for esum-condition ("
2303 <<
type <<
")" << std::endl;
2320 objParameter[0].etLowThreshold = lowerThresholdInd;
2321 objParameter[0].etHighThreshold = upperThresholdInd;
2322 objParameter[0].phiWindow1Lower = phiWindow1Lower;
2323 objParameter[0].phiWindow1Upper = phiWindow1Upper;
2324 objParameter[0].phiWindow2Lower = phiWindow2Lower;
2325 objParameter[0].phiWindow2Upper = phiWindow2Upper;
2330 <<
"\n EnergySum ET high threshold (hex) for energy sum object " << cnt <<
" = "
2331 << std::hex << objParameter[0].etLowThreshold <<
" - " << objParameter[0].etLowThreshold
2332 <<
"\n phiWindow Lower / Upper for calo object " << cnt <<
" = 0x"
2333 << objParameter[0].phiWindow1Lower <<
" / 0x" << objParameter[0].phiWindow1Upper
2334 <<
"\n phiWindowVeto Lower / Upper for calo object " << cnt <<
" = 0x"
2335 << objParameter[0].phiWindow2Lower <<
" / 0x" << objParameter[0].phiWindow2Upper <<
std::dec
2340 std::vector<GlobalObject> objType(nrObj, energySumObjType);
2356 std::ostringstream myCoutStream;
2357 energySumCond.
print(myCoutStream);
2358 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2377 (m_corEnergySumTemplate[chipNr]).push_back(energySumCond);
2399 unsigned int chipNr) {
2402 using namespace tmeventsetup;
2413 <<
"\n ****************************************** "
2414 <<
"\n (in parseExternal) "
2415 <<
"\n condition = " << condition
2416 <<
"\n particle = " << particle
2417 <<
"\n type = " <<
type
2418 <<
"\n name = " <<
name
2427 unsigned int channelID = 0;
2430 const std::vector<esObject>& objects = condExt.getObjects();
2431 for (
size_t jj = 0;
jj < objects.size();
jj++) {
2433 const esObject
object = objects.at(
jj);
2434 if(
object.getType() == esObjectType::EXT) {
2435 relativeBx =
object.getBxOffset();
2436 channelID =
object.getExternalChannelId();
2454 << externalCond <<
"\n" << std::endl;
2457 if ( !insertConditionIntoMap(externalCond, chipNr)) {
2460 <<
" Error: duplicate condition (" <<
name
2461 <<
")" << std::endl;
2466 (m_vecExternalTemplate[chipNr]).push_back(externalCond);
2487 tmeventsetup::esCondition corrCond,
2488 unsigned int chipNr) {
2490 using namespace tmeventsetup;
2497 LogDebug(
"TriggerMenuParser") <<
" ****************************************** " << std::endl
2498 <<
" (in parseCorrelation) " << std::endl
2499 <<
" condition = " << condition << std::endl
2500 <<
" particle = " << particle << std::endl
2501 <<
" type = " <<
type << std::endl
2502 <<
" name = " <<
name << std::endl;
2511 if ( !insertConditionIntoMap(correlationCond, chipNr)) {
2514 <<
" Error: duplicate correlation condition (" <<
name <<
")"
2527 const int nrObj = 2;
2530 int intGEq[nrObj] = { -1, -1 };
2531 std::vector<GlobalObject> objType(nrObj);
2532 std::vector<GtConditionCategory> condCateg(nrObj);
2535 const bool corrFlag =
true;
2536 int corrIndexVal[nrObj] = { -1, -1 };
2545 const std::vector<esCut>&
cuts = corrCond.getCuts();
2550 if(cut.getCutType() == esCutType::ChargeCorrelation) {
2551 if( cut.getData()==
"ls" ) corrParameter.chargeCorrelation = 2;
2552 else if( cut.getData()==
"os" ) corrParameter.chargeCorrelation = 4;
2553 else corrParameter.chargeCorrelation = 1;
2559 double minV = cut.getMinimum().value;
2560 double maxV = cut.getMaximum().value;
2563 if(maxV > 1.0e6) maxV = 1.0e6;
2567 corrParameter.minEtaCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2568 corrParameter.maxEtaCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2569 corrParameter.precEtaCut = cut.getMinimum().index;
2570 cutType = cutType | 0x1;
2573 corrParameter.minPhiCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2574 corrParameter.maxPhiCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2575 corrParameter.precPhiCut = cut.getMinimum().index;
2576 cutType = cutType | 0x2;
2579 corrParameter.minDRCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2580 corrParameter.maxDRCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2581 corrParameter.precDRCut = cut.getMinimum().index;
2582 cutType = cutType | 0x4;
2585 corrParameter.minMassCutValue = (
long long)(minV *
pow(10.,cut.getMinimum().index));
2586 corrParameter.maxMassCutValue = (
long long)(maxV *
pow(10.,cut.getMaximum().index));
2587 corrParameter.precMassCut = cut.getMinimum().index;
2588 cutType = cutType | 0x8;
2593 corrParameter.corrCutType = cutType;
2596 const std::vector<esObject>& objects = corrCond.getObjects();
2597 if(objects.size() != 2) {
2599 <<
"incorrect number of objects for the correlation condition " <<
name <<
" corrFlag " << corrFlag << std::endl;
2604 for (
size_t jj = 0;
jj < objects.size();
jj++)
2606 const esObject
object = objects.at(
jj);
2647 parseMuonCorr(&
object,chipNr);
2648 corrIndexVal[
jj] = (m_corMuonTemplate[chipNr]).
size() - 1;
2655 }
else if(
object.getType() == esObjectType::Egamma ||
2660 parseCaloCorr(&
object,chipNr);
2661 corrIndexVal[
jj] = (m_corCaloTemplate[chipNr]).
size() - 1;
2665 switch(
object.getType()) {
2666 case esObjectType::Egamma: {
2692 parseEnergySumCorr(&
object,chipNr);
2693 corrIndexVal[
jj] = (m_corEnergySumTemplate[chipNr]).
size() - 1;
2697 switch(
object.getType()) {
2720 <<
"Illegal Object Type "
2721 <<
" for the correlation condition " <<
name << std::endl;
2731 if (intGEq[0] != intGEq[1]) {
2733 <<
"Inconsistent GEq flags for sub-conditions "
2734 <<
" for the correlation condition " <<
name << std::endl;
2739 gEq = (intGEq[0] != 0);
2760 std::ostringstream myCoutStream;
2761 correlationCond.
print(myCoutStream);
2762 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n"
2770 (m_vecCorrelationTemplate[chipNr]).push_back(correlationCond);
2790 unsigned int chipNr) {
2793 using namespace tmeventsetup;
2801 if (algAlias ==
"") {
2804 <<
"\n No alias defined for algorithm. Alias set to algorithm name."
2805 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
2809 LogDebug(
"TriggerMenuParser") <<
"\n Alias defined for algorithm."
2810 <<
"\n Algorithm name: " << algName <<
"\n Algorithm alias: " << algAlias
2815 std::string logExpression = algorithm.getExpressionInCondition();
2818 <<
" Logical expression: " << logExpression
2819 <<
" Chip number: " << chipNr
2823 int outputPin = algorithm.getIndex();
2827 LogDebug(
"TriggerMenuParser") <<
" Output pin: " << outputPin
2833 int bitNumber = outputPin;
2836 LogDebug(
"TriggerMenuParser") <<
" Bit number: " << bitNumber
2846 std::ostringstream myCoutStream;
2847 alg.
print(myCoutStream);
2848 LogTrace(
"TriggerMenuParser") << myCoutStream.str() <<
"\n" << std::endl;
2853 if ( !insertAlgorithmIntoMap(alg)) {
void setCondGEq(const bool &cGEq)
void setAlgoAlias(const std::string &algoAliasValue)
void setCond0Index(const int &)
virtual void print(std::ostream &myCout) const
print the condition
unsigned int chargeCorrelation
std::vector< std::pair< double, double > > etaBins
virtual void print(std::ostream &myCout) const
print condition
std::vector< std::pair< double, double > > phiBins
void setCondType(const l1t::GtConditionType &cType)
void setCorrelationParameter(const CorrelationParameter &corrParameter)
virtual void print(std::ostream &myCout) const
print the condition
void setCondRelativeBx(const int &cRelativeBx)
virtual void print(std::ostream &myCout) const
print the condition
void setCondChipNr(const int &cChipNr)
VDouble InvariantMass(Tau)
int algoBitNumber() const
get / set algorithm bit number
Container::value_type value_type
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
void setExternalChannel(unsigned int extCh)
set functions
void setCond1Category(const l1t::GtConditionCategory &)
const int algoOutputPin(const int numberConditionChips, const int pinsOnConditionChip, const std::vector< int > &orderConditionChip) const
get the output pin on the condition chip for the algorithm
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
void setObjectType(const std::vector< GlobalObject > &objType)
const std::string & condName() const
get / set condition name
std::vector< std::pair< double, double > > etBins
const std::string algoName() const
get / set algorithm name
void setCond0Category(const l1t::GtConditionCategory &)
std::string const & algoAlias() const
get / set algorithm alias
void setAlgoChipNumber(const int algoChipNumberValue)
typedef for a single object template
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
typedef for correlation parameters
typedef for correlation parameters
virtual void print(std::ostream &myCout) const
print the condition
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
void setCond1Index(const int &)
const int algoChipNumber() const
get / set algorithm bit number