CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TUtmTriggerMenuDumper Class Reference
Inheritance diagram for L1TUtmTriggerMenuDumper:

Public Member Functions

 L1TUtmTriggerMenuDumper (const ParameterSet &)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (Event const &, EventSetup const &) override
 
void beginJob () override
 
void beginRun (Run const &, EventSetup const &) override
 
void endJob () override
 
void endRun (Run const &, EventSetup const &) override
 

Private Attributes

edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcdm_l1TriggerMenuToken
 

Detailed Description

Definition at line 37 of file L1TUtmTriggerMenuDumper.cc.

Constructor & Destructor Documentation

◆ L1TUtmTriggerMenuDumper()

L1TUtmTriggerMenuDumper::L1TUtmTriggerMenuDumper ( const ParameterSet iConfig)
explicit

Definition at line 53 of file L1TUtmTriggerMenuDumper.cc.

54  : m_l1TriggerMenuToken(esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd, edm::Transition::BeginRun>()) {}
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1TriggerMenuToken

Member Function Documentation

◆ analyze()

void L1TUtmTriggerMenuDumper::analyze ( Event const &  iEvent,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 56 of file L1TUtmTriggerMenuDumper.cc.

56 {}

◆ beginJob()

void L1TUtmTriggerMenuDumper::beginJob ( void  )
overrideprivate

Definition at line 58 of file L1TUtmTriggerMenuDumper.cc.

References gather_cfg::cout.

58 { cout << "INFO: L1TUtmTriggerMenuDumper module beginJob called.\n"; }

◆ beginRun()

void L1TUtmTriggerMenuDumper::beginRun ( Run const &  run,
EventSetup const &  iSetup 
)
overrideprivate

Definition at line 62 of file L1TUtmTriggerMenuDumper.cc.

References gather_cfg::cout, TkAlMuonSelectors_cfi::cut, L1TUtmTriggerMenu::getAlgorithmMap(), L1TUtmTriggerMenu::getConditionMap(), L1TUtmCondition::getCuts(), edm::EventSetup::getHandle(), L1TUtmCondition::getObjects(), L1TUtmTriggerMenu::getScaleMap(), L1TUtmCondition::getType(), cuy::ii, findQualityFiles::jj, GetRecoTauVFromDQM_MC_cff::kk, m_l1TriggerMenuToken, dqmiodumpmetadata::n, AlCaHLTBitMon_QueryRunRegistry::string, and unpackBuffers-CaloStage2::token.

62  {
64 
65  const std::map<std::string, L1TUtmAlgorithm>& algoMap = hmenu->getAlgorithmMap();
66  const std::map<std::string, L1TUtmCondition>& condMap = hmenu->getConditionMap();
67  //We use es types for scale map to use auxiliary functions without having to duplicate code
68  const std::map<std::string, tmeventsetup::esScale> scaleMap(std::begin(hmenu->getScaleMap()),
69  std::end(hmenu->getScaleMap()));
70 
71  bool hasPrecision = false;
72  std::map<std::string, unsigned int> precisions;
73  getPrecisions(precisions, scaleMap);
74  for (std::map<std::string, unsigned int>::const_iterator cit = precisions.begin(); cit != precisions.end(); cit++) {
75  std::cout << cit->first << " = " << cit->second << "\n";
76  hasPrecision = true;
77  }
78 
79  if (hasPrecision) {
80  std::map<std::string, tmeventsetup::esScale>::iterator it1, it2;
81  const tmeventsetup::esScale* scale1 = &scaleMap.find("EG-ETA")->second;
82  const tmeventsetup::esScale* scale2 = &scaleMap.find("MU-ETA")->second;
83 
84  std::vector<long long> lut_eg_2_mu_eta;
85  getCaloMuonEtaConversionLut(lut_eg_2_mu_eta, scale1, scale2);
86 
87  scale1 = &scaleMap.find("EG-PHI")->second;
88  scale2 = &scaleMap.find("MU-PHI")->second;
89 
90  std::vector<long long> lut_eg_2_mu_phi;
91  getCaloMuonPhiConversionLut(lut_eg_2_mu_phi, scale1, scale2);
92 
93  scale1 = &scaleMap.find("EG-ETA")->second;
94  scale2 = &scaleMap.find("MU-ETA")->second;
95 
96  std::vector<double> eg_mu_delta_eta;
97  std::vector<long long> lut_eg_mu_delta_eta;
98  size_t n = getDeltaVector(eg_mu_delta_eta, scale1, scale2);
99  setLut(lut_eg_mu_delta_eta, eg_mu_delta_eta, precisions["PRECISION-EG-MU-Delta"]);
100 
101  std::vector<long long> lut_eg_mu_cosh;
102  applyCosh(eg_mu_delta_eta, n);
103  setLut(lut_eg_mu_cosh, eg_mu_delta_eta, precisions["PRECISION-EG-MU-Math"]);
104 
105  scale1 = &scaleMap.find("EG-PHI")->second;
106  scale2 = &scaleMap.find("MU-PHI")->second;
107 
108  std::vector<double> eg_mu_delta_phi;
109  std::vector<long long> lut_eg_mu_delta_phi;
110  n = getDeltaVector(eg_mu_delta_phi, scale1, scale2);
111  setLut(lut_eg_mu_delta_phi, eg_mu_delta_phi, precisions["PRECISION-EG-MU-Delta"]);
112 
113  std::vector<long long> lut_eg_mu_cos;
114  applyCos(eg_mu_delta_phi, n);
115  setLut(lut_eg_mu_cos, eg_mu_delta_phi, precisions["PRECISION-EG-MU-Math"]);
116 
117  scale1 = &scaleMap.find("EG-ET")->second;
118  std::vector<long long> lut_eg_et;
119  getLut(lut_eg_et, scale1, precisions["PRECISION-EG-MU-MassPt"]);
120 
121  scale1 = &scaleMap.find("MU-ET")->second;
122  std::vector<long long> lut_mu_et;
123  getLut(lut_mu_et, scale1, precisions["PRECISION-EG-MU-MassPt"]);
124  for (size_t ii = 0; ii < lut_mu_et.size(); ii++) {
125  std::cout << lut_mu_et.at(ii) << "\n";
126  }
127  }
128 
129  for (std::map<std::string, L1TUtmAlgorithm>::const_iterator cit = algoMap.begin(); cit != algoMap.end(); cit++) {
130  const L1TUtmAlgorithm& algo = cit->second;
131  std::cout << "algo name = " << algo.getName() << "\n";
132  std::cout << "algo exp. = " << algo.getExpression() << "\n";
133  std::cout << "algo exp. in cond. = " << algo.getExpressionInCondition() << "\n";
134 
135  const std::vector<std::string>& rpn_vec = algo.getRpnVector();
136  for (size_t ii = 0; ii < rpn_vec.size(); ii++) {
137  const std::string& token = rpn_vec.at(ii);
138  if (Algorithm::isGate(token))
139  continue;
140  const L1TUtmCondition& condition = condMap.find(token)->second;
141  std::cout << " cond type = " << condition.getType() << "\n";
142 
143  const std::vector<L1TUtmCut>& cuts = condition.getCuts();
144  for (size_t jj = 0; jj < cuts.size(); jj++) {
145  const L1TUtmCut& cut = cuts.at(jj);
146  std::cout << " cut name = " << cut.getName() << "\n";
147  std::cout << " cut target = " << cut.getObjectType() << "\n";
148  std::cout << " cut type = " << cut.getCutType() << "\n";
149  std::cout << " cut min. value index = " << cut.getMinimum().value << " " << cut.getMinimum().index << "\n";
150  std::cout << " cut max. value index = " << cut.getMaximum().value << " " << cut.getMaximum().index << "\n";
151  std::cout << " cut data = " << cut.getData() << "\n";
152  }
153 
154  const std::vector<L1TUtmObject>& objects = condition.getObjects();
155  for (size_t jj = 0; jj < objects.size(); jj++) {
156  const L1TUtmObject& object = objects.at(jj);
157  std::cout << " obj name = " << object.getName() << "\n";
158  std::cout << " obj type = " << object.getType() << "\n";
159  std::cout << " obj op = " << object.getComparisonOperator() << "\n";
160  std::cout << " obj bx = " << object.getBxOffset() << "\n";
161  if (object.getType() == esObjectType::EXT) {
162  std::cout << " ext name = " << object.getExternalSignalName() << "\n";
163  std::cout << " ext ch id = " << object.getExternalChannelId() << "\n";
164  }
165 
166  const std::vector<L1TUtmCut>& cuts = object.getCuts();
167  for (size_t kk = 0; kk < cuts.size(); kk++) {
168  const L1TUtmCut& cut = cuts.at(kk);
169  std::cout << " cut name = " << cut.getName() << "\n";
170  std::cout << " cut target = " << cut.getObjectType() << "\n";
171  std::cout << " cut type = " << cut.getCutType() << "\n";
172  std::cout << " cut min. value index = " << cut.getMinimum().value << " " << cut.getMinimum().index
173  << "\n";
174  std::cout << " cut max. value index = " << cut.getMaximum().value << " " << cut.getMaximum().index
175  << "\n";
176  std::cout << " cut data = " << cut.getData() << "\n";
177  }
178  }
179  }
180  }
181 }
const int getType() const
const std::vector< L1TUtmObject > & getObjects() const
const std::map< std::string, L1TUtmScale > & getScaleMap() const
const std::map< std::string, L1TUtmCondition > & getConditionMap() const
ii
Definition: cuy.py:589
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1TriggerMenuToken
const std::vector< L1TUtmCut > & getCuts() const
const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap() const

◆ endJob()

void L1TUtmTriggerMenuDumper::endJob ( void  )
overrideprivate

Definition at line 60 of file L1TUtmTriggerMenuDumper.cc.

References gather_cfg::cout.

60 { cout << "INFO: L1TUtmTriggerMenuDumper module endJob called.\n"; }

◆ endRun()

void L1TUtmTriggerMenuDumper::endRun ( Run const &  ,
EventSetup const &   
)
overrideprivate

Definition at line 183 of file L1TUtmTriggerMenuDumper.cc.

183 {}

◆ fillDescriptions()

void L1TUtmTriggerMenuDumper::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 185 of file L1TUtmTriggerMenuDumper.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

185  {
186  //The following says we do not know what parameters are allowed so do no validation
187  // Please change this to state exactly what you do use, even if it is no parameters
189  desc.setUnknown();
190  descriptions.addDefault(desc);
191 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ m_l1TriggerMenuToken

edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> L1TUtmTriggerMenuDumper::m_l1TriggerMenuToken
private

Definition at line 50 of file L1TUtmTriggerMenuDumper.cc.

Referenced by beginRun().