CMS 3D CMS Logo

L1CSCTPEmulatorConfigAnalyzer.cc
Go to the documentation of this file.
1 
7 #include <iostream>
8 
15 
16 // Configuration via EventSetup
19 
21 
22 public:
24 
26 
27  void beginJob() override {}
28  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
29  void endJob() override {}
30 
31 private:
32 
34 };
35 
36 using namespace std;
38 {
39  pyConfig = iConfig;
40 }
41 
42 void
44 {
46  iSetup.get<CSCDBL1TPParametersRcd>().get(confH);
47  const CSCDBL1TPParameters* dbConfig = confH.product();
48 
49  // python params
51  edm::ParameterSet alctParams = pyConfig.getParameter<edm::ParameterSet>("alctParam07");
52  edm::ParameterSet clctParams = pyConfig.getParameter<edm::ParameterSet>("clctParam07");
53 
54  unsigned int db_alctFifoTbins = dbConfig->alctFifoTbins();
55  unsigned int db_alctFifoPretrig = dbConfig->alctFifoPretrig();
56  unsigned int db_alctDriftDelay = dbConfig->alctDriftDelay();
57  unsigned int db_alctNplanesHitPretrig = dbConfig->alctNplanesHitPretrig();
58  unsigned int db_alctNplanesHitPattern = dbConfig->alctNplanesHitPattern();
59  unsigned int db_alctNplanesHitAccelPretrig = dbConfig->alctNplanesHitAccelPretrig();
60  unsigned int db_alctNplanesHitAccelPattern = dbConfig->alctNplanesHitAccelPattern();
61  unsigned int db_alctTrigMode = dbConfig->alctTrigMode();
62  unsigned int db_alctAccelMode = dbConfig->alctAccelMode();
63  unsigned int db_alctL1aWindowWidth = dbConfig->alctL1aWindowWidth();
64 
65  unsigned int db_clctFifoTbins = dbConfig->clctFifoTbins();
66  unsigned int db_clctFifoPretrig = dbConfig->clctFifoPretrig();
67  unsigned int db_clctHitPersist = dbConfig->clctHitPersist();
68  unsigned int db_clctDriftDelay = dbConfig->clctDriftDelay();
69  unsigned int db_clctNplanesHitPretrig = dbConfig->clctNplanesHitPretrig();
70  unsigned int db_clctNplanesHitPattern = dbConfig->clctNplanesHitPattern();
71  unsigned int db_clctPidThreshPretrig = dbConfig->clctPidThreshPretrig();
72  unsigned int db_clctMinSeparation = dbConfig->clctMinSeparation();
73 
74  unsigned int db_tmbMpcBlockMe1a = dbConfig->tmbMpcBlockMe1a();
75  unsigned int db_tmbAlctTrigEnable = dbConfig->tmbAlctTrigEnable();
76  unsigned int db_tmbClctTrigEnable = dbConfig->tmbClctTrigEnable();
77  unsigned int db_tmbMatchTrigEnable = dbConfig->tmbMatchTrigEnable();
78  unsigned int db_tmbMatchTrigWindowSize = dbConfig->tmbMatchTrigWindowSize();
79  unsigned int db_tmbL1aWindowSize = dbConfig->tmbTmbL1aWindowSize();
80 
81 
82  unsigned int py_alctFifoTbins = alctParams.getParameter<unsigned int>("alctFifoTbins");
83  unsigned int py_alctFifoPretrig = alctParams.getParameter<unsigned int>("alctFifoPretrig");
84  unsigned int py_alctDriftDelay = alctParams.getParameter<unsigned int>("alctDriftDelay");
85  unsigned int py_alctNplanesHitPretrig = alctParams.getParameter<unsigned int>("alctNplanesHitPretrig");
86  unsigned int py_alctNplanesHitPattern = alctParams.getParameter<unsigned int>("alctNplanesHitPattern");
87  unsigned int py_alctNplanesHitAccelPretrig = alctParams.getParameter<unsigned int>("alctNplanesHitAccelPretrig");
88  unsigned int py_alctNplanesHitAccelPattern = alctParams.getParameter<unsigned int>("alctNplanesHitAccelPattern");
89  unsigned int py_alctTrigMode = alctParams.getParameter<unsigned int>("alctTrigMode");
90  unsigned int py_alctAccelMode = alctParams.getParameter<unsigned int>("alctAccelMode");
91  unsigned int py_alctL1aWindowWidth = alctParams.getParameter<unsigned int>("alctL1aWindowWidth");
92 
93  unsigned int py_clctFifoTbins = clctParams.getParameter<unsigned int>("clctFifoTbins");
94  unsigned int py_clctFifoPretrig = clctParams.getParameter<unsigned int>("clctFifoPretrig");
95  unsigned int py_clctHitPersist = clctParams.getParameter<unsigned int>("clctHitPersist");
96  unsigned int py_clctDriftDelay = clctParams.getParameter<unsigned int>("clctDriftDelay");
97  unsigned int py_clctNplanesHitPretrig = clctParams.getParameter<unsigned int>("clctNplanesHitPretrig");
98  unsigned int py_clctNplanesHitPattern = clctParams.getParameter<unsigned int>("clctNplanesHitPattern");
99  unsigned int py_clctPidThreshPretrig = clctParams.getParameter<unsigned int>("clctPidThreshPretrig");
100  unsigned int py_clctMinSeparation = clctParams.getParameter<unsigned int>("clctMinSeparation");
101 
102  unsigned int py_tmbMpcBlockMe1a = tmbParams.getParameter<unsigned int>("mpcBlockMe1a");
103  unsigned int py_tmbAlctTrigEnable = tmbParams.getParameter<unsigned int>("alctTrigEnable");
104  unsigned int py_tmbClctTrigEnable = tmbParams.getParameter<unsigned int>("clctTrigEnable");
105  unsigned int py_tmbMatchTrigEnable = tmbParams.getParameter<unsigned int>("matchTrigEnable");
106  unsigned int py_tmbMatchTrigWindowSize = tmbParams.getParameter<unsigned int>("matchTrigWindowSize");
107  unsigned int py_tmbL1aWindowSize = tmbParams.getParameter<unsigned int>("tmbL1aWindowSize");
108 
109 
110  //check
111  bool ok_alctFifoTbins = db_alctFifoTbins == py_alctFifoTbins;
112  bool ok_alctFifoPretrig = db_alctFifoPretrig == py_alctFifoPretrig;
113  bool ok_alctDriftDelay = db_alctDriftDelay == py_alctDriftDelay;
114  bool ok_alctNplanesHitPretrig = db_alctNplanesHitPretrig == py_alctNplanesHitPretrig;
115  bool ok_alctNplanesHitPattern = db_alctNplanesHitPattern == py_alctNplanesHitPattern;
116  bool ok_alctNplanesHitAccelPretrig = db_alctNplanesHitAccelPretrig == py_alctNplanesHitAccelPretrig;
117  bool ok_alctNplanesHitAccelPattern = db_alctNplanesHitAccelPattern == py_alctNplanesHitAccelPattern;
118  bool ok_alctTrigMode = db_alctTrigMode == py_alctTrigMode;
119  bool ok_alctAccelMode = db_alctAccelMode == py_alctAccelMode;
120  bool ok_alctL1aWindowWidth = db_alctL1aWindowWidth == py_alctL1aWindowWidth;
121 
122  bool ok_clctFifoTbins = db_clctFifoTbins == py_clctFifoTbins;
123  bool ok_clctFifoPretrig = db_clctFifoPretrig == py_clctFifoPretrig;
124  bool ok_clctHitPersist = db_clctHitPersist == py_clctHitPersist;
125  bool ok_clctDriftDelay = db_clctDriftDelay == py_clctDriftDelay;
126  bool ok_clctNplanesHitPretrig = db_clctNplanesHitPretrig == py_clctNplanesHitPretrig;
127  bool ok_clctNplanesHitPattern = db_clctNplanesHitPattern == py_clctNplanesHitPattern;
128  bool ok_clctPidThreshPretrig = db_clctPidThreshPretrig == py_clctPidThreshPretrig;
129  bool ok_clctMinSeparation = db_clctMinSeparation == py_clctMinSeparation;
130 
131  bool ok_tmbMpcBlockMe1a = db_tmbMpcBlockMe1a == py_tmbMpcBlockMe1a;
132  bool ok_tmbAlctTrigEnable = db_tmbAlctTrigEnable == py_tmbAlctTrigEnable;
133  bool ok_tmbClctTrigEnable = db_tmbClctTrigEnable == py_tmbClctTrigEnable;
134  bool ok_tmbMatchTrigEnable = db_tmbMatchTrigEnable == py_tmbMatchTrigEnable;
135  bool ok_tmbMatchTrigWindowSize = db_tmbMatchTrigWindowSize == py_tmbMatchTrigWindowSize;
136  bool ok_tmbL1aWindowSize = db_tmbL1aWindowSize == py_tmbL1aWindowSize;
137 
138  std::cout << std::endl;
139  std::cout << "Start Comparing the L1 CSC TP emulator settings between Python and conditions DB." <<std::endl;
140 
141  std::cout << std::endl;
142  std::cout << "Parameters different between Py and DB" << std::endl;
143  std::cout << "- - - - - - - - - - - - - - - - - - - " <<std::endl;
144  std::cout << std::endl;
145 
146  if (!ok_alctFifoTbins) std::cout <<"alctFifoTbins: Py = " << py_alctFifoTbins << ", DB = " << db_alctFifoTbins << std::endl;
147  if (!ok_alctFifoPretrig) std::cout <<"alctFifoPretrig: Py = " << py_alctFifoPretrig << ", DB = " << db_alctFifoPretrig << std::endl;
148  if (!ok_alctDriftDelay) std::cout <<"alctDriftDelay: Py = " << py_alctDriftDelay << ", DB = " << db_alctDriftDelay << std::endl;
149  if (!ok_alctNplanesHitPretrig) std::cout <<"alctNplanesHitPretrig: Py = " << py_alctNplanesHitPretrig << ", DB = " << db_alctNplanesHitPretrig << std::endl;
150  if (!ok_alctNplanesHitPattern) std::cout <<"alctNplanesHitPattern: Py = " << py_alctNplanesHitPattern << ", DB = " << db_alctNplanesHitPattern << std::endl;
151  if (!ok_alctNplanesHitAccelPretrig) std::cout <<"alctNplanesHitAccelPretrig: Py = " << py_alctNplanesHitAccelPretrig << ", DB = " << db_alctNplanesHitAccelPretrig << std::endl;
152  if (!ok_alctNplanesHitAccelPattern) std::cout <<"alctNplanesHitAccelPattern: Py = " << py_alctNplanesHitAccelPattern << ", DB = " << db_alctNplanesHitAccelPattern << std::endl;
153  if (!ok_alctTrigMode) std::cout <<"alctTrigMode: Py = " << py_alctTrigMode << ", DB = " << db_alctTrigMode << std::endl;
154  if (!ok_alctAccelMode) std::cout <<"alctAccelMode: Py = " << py_alctAccelMode << ", DB = " << db_alctAccelMode << std::endl;
155  if (!ok_alctL1aWindowWidth) std::cout <<"alctL1aWindowWidth: Py = " << py_alctL1aWindowWidth << ", DB = " << db_alctL1aWindowWidth << std::endl;
156  std::cout << std::endl;
157 
158  if (!ok_clctFifoTbins) std::cout <<"clctFifoTbins: Py = " << py_clctFifoTbins << ", DB = " << db_clctFifoTbins << std::endl;
159  if (!ok_clctFifoPretrig) std::cout <<"clctFifoPretrig: Py = " << py_clctFifoPretrig << ", DB = " << db_clctFifoPretrig << std::endl;
160  if (!ok_clctHitPersist) std::cout <<"clctHitPersist: Py = " << py_clctHitPersist << ", DB = " << db_clctHitPersist << std::endl;
161  if (!ok_clctDriftDelay) std::cout <<"clctDriftDelay: Py = " << py_clctDriftDelay << ", DB = " << db_clctDriftDelay << std::endl;
162  if (!ok_clctNplanesHitPretrig) std::cout <<"clctNplanesHitPretrig: Py = " << py_clctNplanesHitPretrig << ", DB = " << db_clctNplanesHitPretrig << std::endl;
163  if (!ok_clctNplanesHitPattern) std::cout <<"clctNplanesHitPattern: Py = " << py_clctNplanesHitPattern << ", DB = " << db_clctNplanesHitPattern << std::endl;
164  if (!ok_clctPidThreshPretrig) std::cout <<"clctPidThreshPretrig: Py = " << py_clctPidThreshPretrig << ", DB = " << db_clctPidThreshPretrig << std::endl;
165  if (!ok_clctMinSeparation) std::cout <<"clctMinSeparation: Py = " << py_clctMinSeparation << ", DB = " << db_clctMinSeparation << std::endl;
166  std::cout << std::endl;
167 
168  if (!ok_tmbMpcBlockMe1a) std::cout <<"tmbMpcBlockMe1a: Py = " << py_tmbMpcBlockMe1a << ", DB = " << db_tmbMpcBlockMe1a << std::endl;
169  if (!ok_tmbAlctTrigEnable) std::cout <<"tmbAlctTrigEnable: Py = " << py_tmbAlctTrigEnable << ", DB = " << db_tmbAlctTrigEnable << std::endl;
170  if (!ok_tmbClctTrigEnable) std::cout <<"tmbClctTrigEnable: Py = " << py_tmbClctTrigEnable << ", DB = " << db_tmbClctTrigEnable << std::endl;
171  if (!ok_tmbMatchTrigEnable) std::cout <<"tmbMatchTrigEnable: Py = " << py_tmbMatchTrigEnable << ", DB = " << db_tmbMatchTrigEnable << std::endl;
172  if (!ok_tmbMatchTrigWindowSize) std::cout <<"tmbMatchTrigWindowSize: Py = " << py_tmbMatchTrigWindowSize << ", DB = " << db_tmbMatchTrigWindowSize << std::endl;
173  if (!ok_tmbL1aWindowSize) std::cout <<"tmbL1aWindowSize: Py = " << py_tmbL1aWindowSize << ", DB = " << db_tmbL1aWindowSize << std::endl;
174 
175  std::cout << std::endl;
176  std::cout << "Parameters same in Py and DB" << std::endl;
177  std::cout << "- - - - - - - - - - - - - - " <<std::endl;
178  std::cout << std::endl;
179 
180  if (ok_alctFifoTbins) std::cout <<"alctFifoTbins: " << py_alctFifoTbins << std::endl;
181  if (ok_alctFifoPretrig) std::cout <<"alctFifoPretrig: " << py_alctFifoPretrig << std::endl;
182  if (ok_alctDriftDelay) std::cout <<"alctDriftDelay: " << py_alctDriftDelay << std::endl;
183  if (ok_alctNplanesHitPretrig) std::cout <<"alctNplanesHitPretrig: " << py_alctNplanesHitPretrig << std::endl;
184  if (ok_alctNplanesHitPattern) std::cout <<"alctNplanesHitPattern: " << py_alctNplanesHitPattern << std::endl;
185  if (ok_alctNplanesHitAccelPretrig) std::cout <<"alctNplanesHitAccelPretrig: " << py_alctNplanesHitAccelPretrig << std::endl;
186  if (ok_alctNplanesHitAccelPattern) std::cout <<"alctNplanesHitAccelPattern: " << py_alctNplanesHitAccelPattern << std::endl;
187  if (ok_alctTrigMode) std::cout <<"alctTrigMode: " << py_alctTrigMode << std::endl;
188  if (ok_alctAccelMode) std::cout <<"alctAccelMode: " << py_alctAccelMode << std::endl;
189  if (ok_alctL1aWindowWidth) std::cout <<"alctL1aWindowWidth: " << py_alctL1aWindowWidth << std::endl;
190  std::cout << std::endl;
191 
192  if (ok_clctFifoTbins) std::cout <<"clctFifoTbins: " << py_clctFifoTbins << std::endl;
193  if (ok_clctFifoPretrig) std::cout <<"clctFifoPretrig: " << py_clctFifoPretrig << std::endl;
194  if (ok_clctHitPersist) std::cout <<"clctHitPersist: " << py_clctHitPersist << std::endl;
195  if (ok_clctDriftDelay) std::cout <<"clctDriftDelay: " << py_clctDriftDelay << std::endl;
196  if (ok_clctNplanesHitPretrig) std::cout <<"clctNplanesHitPretrig: " << py_clctNplanesHitPretrig << std::endl;
197  if (ok_clctNplanesHitPattern) std::cout <<"clctNplanesHitPattern: " << py_clctNplanesHitPattern << std::endl;
198  if (ok_clctPidThreshPretrig) std::cout <<"clctPidThreshPretrig: " << py_clctPidThreshPretrig << std::endl;
199  if (ok_clctMinSeparation) std::cout <<"clctMinSeparation: " << py_clctMinSeparation << std::endl;
200  std::cout << std::endl;
201 
202  if (ok_tmbMpcBlockMe1a) std::cout <<"tmbMpcBlockMe1a: " << py_tmbMpcBlockMe1a << std::endl;
203  if (ok_tmbAlctTrigEnable) std::cout <<"tmbAlctTrigEnable: " << py_tmbAlctTrigEnable << std::endl;
204  if (ok_tmbClctTrigEnable) std::cout <<"tmbClctTrigEnable: " << py_tmbClctTrigEnable << std::endl;
205  if (ok_tmbMatchTrigEnable) std::cout <<"tmbMatchTrigEnable: " << py_tmbMatchTrigEnable << std::endl;
206  if (ok_tmbMatchTrigWindowSize) std::cout <<"tmbMatchTrigWindowSize: " << py_tmbMatchTrigWindowSize << std::endl;
207  if (ok_tmbL1aWindowSize) std::cout <<"tmbL1aWindowSize: " << py_tmbL1aWindowSize << std::endl;
208  std::cout << std::endl;
209 
210  std::cout << "Done." <<std::endl;
211 }
212 
213 //define this as a plug-in
T getParameter(std::string const &) const
unsigned int alctDriftDelay() const
unsigned int clctHitPersist() const
unsigned int clctNplanesHitPattern() const
unsigned int tmbClctTrigEnable() const
unsigned int alctNplanesHitPretrig() const
unsigned int clctMinSeparation() const
unsigned int clctNplanesHitPretrig() const
unsigned int clctDriftDelay() const
unsigned int alctL1aWindowWidth() const
L1CSCTPEmulatorConfigAnalyzer(const edm::ParameterSet &pset)
int iEvent
Definition: GenABIO.cc:224
unsigned int tmbTmbL1aWindowSize() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned int clctPidThreshPretrig() const
unsigned int tmbMatchTrigWindowSize() const
unsigned int tmbAlctTrigEnable() const
unsigned int clctFifoPretrig() const
unsigned int alctTrigMode() const
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
unsigned int tmbMpcBlockMe1a() const
unsigned int alctAccelMode() const
unsigned int alctFifoPretrig() const
unsigned int alctNplanesHitAccelPretrig() const
unsigned int alctNplanesHitAccelPattern() const
unsigned int clctFifoTbins() const
T get() const
Definition: EventSetup.h:71
unsigned int alctNplanesHitPattern() const
T const * product() const
Definition: ESHandle.h:86
unsigned int tmbMatchTrigEnable() const
unsigned int alctFifoTbins() const