96 dttpgSource_(ps.getParameter<
InputTag>(
"dttpgSource")) {
104 cout <<
"L1TDTTPG: constructor...." << endl;
108 cout <<
"L1T Monitoring histograms will be saved to " <<
outputFile_.c_str() << endl;
128 dttpgphbx[0] = ibooker.
book1D(
"BxEncoding_PHI",
"Bunch encoding DTTF Phi", 11, 0, 11);
130 dttpgphbx[1] = ibooker.
book1D(
"BxEncoding_OUT",
"Bunch encoding DTTF Output", 11, 0, 11);
133 dttpgphbx[2] = ibooker.
book1D(
"NumberOfSegmentsPHI_BunchNeg1",
"Number of segments for bunch -1 Dttf Phi", 20, 0, 20);
135 dttpgphbx[3] = ibooker.
book1D(
"NumberOfSegmentsPHI_Bunch0",
"Number of segments for bunch 0 Dttf Phi", 20, 0, 20);
137 dttpgphbx[4] = ibooker.
book1D(
"NumberOfSegmentsPHI_Bunch1",
"Number of segments for bunch 1 Dttf Phi", 20, 0, 20);
141 ibooker.
book1D(
"NumberOfSegmentsOUT_BunchNeg1",
"Number of segments for bunch -1 Dttf Output", 20, 0, 20);
143 dttpgphbx[6] = ibooker.
book1D(
"NumberOfSegmentsOUT_Bunch0",
"Number of segments for bunch 0 Dttf Output", 20, 0, 20);
145 dttpgphbx[7] = ibooker.
book1D(
"NumberOfSegmentsOUT_Bunch1",
"Number of segments for bunch 1 Dttf Output", 20, 0, 20);
147 for (
int i = 0;
i < 2;
i++) {
158 dttpgphbxcomp = ibooker.
book2D(
"BxEncoding_PHI_OUT",
"Bunch encoding: DTTF Phi vs. Output", 11, 0, 11, 11, 0, 11);
161 for (
int i = 1;
i <= 2;
i++) {
173 dttpgthntrack = ibooker.
book1D(
"DT_TPG_theta_ntrack",
"DT TPG theta ntrack", 20, -0.5, 19.5);
175 for (
int ibx = 0; ibx <= 2; ibx++) {
182 bxn =
"+" + bxnum.str();
186 ibooker.
book1D(
"DT_TPG_phi_wheel_number_" + bxn,
"DT TPG phi wheel number " + bxn, 5, -2.5, 2.5);
188 ibooker.
book1D(
"DT_TPG_phi_sector_number_" + bxn,
"DT TPG phi sector number " + bxn, 12, -0.5, 11.5);
190 ibooker.
book1D(
"DT_TPG_phi_station_number_" + bxn,
"DT TPG phi station number " + bxn, 5, 0.5, 4.5);
195 dttpgphquality[ibx] = ibooker.
book1D(
"DT_TPG_phi_quality_" + bxn,
"DT TPG phi quality " + bxn, 8, -0.5, 7.5);
196 dttpgphts2tag[ibx] = ibooker.
book1D(
"DT_TPG_phi_Ts2Tag_" + bxn,
"DT TPG phi Ts2Tag " + bxn, 2, -0.5, 1.5);
200 ibooker.
book2D(
"DT_TPG_phi_map_bx" + bxn,
"Map of triggers per station (BX=" + bxn +
")", 20, 1, 21, 12, 0, 12);
204 dttpgthbx[ibx] = ibooker.
book1D(
"DT_TPG_theta_bx_" + bxn,
"DT TPG theta bx " + bxn, 50, -24.5, 24.5);
206 ibooker.
book1D(
"DT_TPG_theta_wheel_number_" + bxn,
"DT TPG theta wheel number " + bxn, 5, -2.5, 2.5);
208 ibooker.
book1D(
"DT_TPG_theta_sector_number_" + bxn,
"DT TPG theta sector number " + bxn, 12, -0.5, 11.5);
210 ibooker.
book1D(
"DT_TPG_theta_station_number_" + bxn,
"DT TPG theta station number " + bxn, 5, -0.5, 4.5);
211 dttpgththeta[ibx] = ibooker.
book1D(
"DT_TPG_theta_" + bxn,
"DT TPG theta " + bxn, 20, -0.5, 19.5);
212 dttpgthquality[ibx] = ibooker.
book1D(
"DT_TPG_theta_quality_" + bxn,
"DT TPG theta quality " + bxn, 8, -0.5, 7.5);
214 "DT_TPG_theta_map_bx_" + bxn,
"Map of triggers per station (BX=" + bxn +
")", 15, 1, 16, 12, 0, 12);
218 dttf_p_phi[ibx] = ibooker.
book1D(
"dttf_p_phi_" + bxn,
"dttf phi output #phi " + bxn, 256, -0.5, 255.5);
219 dttf_p_qual[ibx] = ibooker.
book1D(
"dttf_p_qual_" + bxn,
"dttf phi output qual " + bxn, 8, -0.5, 7.5);
220 dttf_p_q[ibx] = ibooker.
book1D(
"dttf_p_q_" + bxn,
"dttf phi output q " + bxn, 2, -0.5, 1.5);
221 dttf_p_pt[ibx] = ibooker.
book1D(
"dttf_p_pt_" + bxn,
"dttf phi output p_{t} " + bxn, 32, -0.5, 31.5);
224 dttpgphmap = ibooker.
book2D(
"DT_TPG_phi_map",
"Map of triggers per station", 20, 1, 21, 12, 0, 12);
226 ibooker.
book2D(
"DT_TPG_phi_map_corr",
"Map of correlated triggers per station", 20, 1, 21, 12, 0, 12);
227 dttpgphmap2nd = ibooker.
book2D(
"DT_TPG_phi_map_2nd",
"Map of second tracks per station", 20, 1, 21, 12, 0, 12);
228 dttpgphbestmap = ibooker.
book2D(
"DT_TPG_phi_best_map",
"Map of best triggers per station", 20, 1, 21, 12, 0, 12);
230 ibooker.
book2D(
"DT_TPG_phi_best_map_corr",
"Map of correlated best triggers per station", 20, 1, 21, 12, 0, 12);
237 dttpgthmap = ibooker.
book2D(
"DT_TPG_theta_map",
"Map of triggers per station", 15, 1, 16, 12, 0, 12);
238 dttpgthmaph = ibooker.
book2D(
"DT_TPG_theta_map_h",
"Map of H quality triggers per station", 15, 1, 16, 12, 0, 12);
239 dttpgthbestmap = ibooker.
book2D(
"DT_TPG_theta_best_map",
"Map of besttriggers per station", 15, 1, 16, 12, 0, 12);
241 ibooker.
book2D(
"DT_TPG_theta_best_map_h",
"Map of H quality best triggers per station", 15, 1, 16, 12, 0, 12);
251 cout <<
"L1TDTTPG: analyze...." << endl;
256 if (!myL1MuDTChambPhContainer.
isValid()) {
265 if (!myL1MuDTChambThContainer.
isValid()) {
267 edm::LogInfo(
"DataNotFound") <<
"if this fails try to add DATA to the process name.";
273 int ndttpgphtrack = 0;
274 int ndttpgthtrack = 0;
275 int NumberOfSegmentsPhi[3] = {0, 0, 0};
277 for (L1MuDTChambPhContainer::Phi_Container::const_iterator DTPhDigiItr = myPhContainer->begin();
278 DTPhDigiItr != myPhContainer->end();
280 int bx = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag();
282 NumberOfSegmentsPhi[0]++;
284 NumberOfSegmentsPhi[1]++;
286 NumberOfSegmentsPhi[2]++;
290 for (
int k = 0;
k < 3;
k++) {
293 int bxCounterDttfPhi = 0;
294 for (
int k = 0;
k < 3;
k++) {
295 if (NumberOfSegmentsPhi[
k] > 0)
302 if (bxCounterDttfPhi == 0) {
304 }
else if (bxCounterDttfPhi == 1) {
305 for (
int k = 0;
k < 3;
k++) {
306 if (NumberOfSegmentsPhi[
k] > 0)
309 }
else if (bxCounterDttfPhi == 2) {
310 for (
int k = 0;
k < 3;
k++) {
311 if (NumberOfSegmentsPhi[
k] == 0)
314 }
else if (bxCounterDttfPhi == 3) {
324 for (L1MuDTChambPhContainer::Phi_Container::const_iterator DTPhDigiItr = myPhContainer->begin();
325 DTPhDigiItr != myPhContainer->end();
329 int bxindex = DTPhDigiItr->bxNum() - DTPhDigiItr->Ts2Tag() + 1;
333 cout <<
"DTTPG phi wheel number " << DTPhDigiItr->whNum() << endl;
337 cout <<
"DTTPG phi station number " << DTPhDigiItr->stNum() << endl;
341 cout <<
"DTTPG phi sector number " << DTPhDigiItr->scNum() << endl;
345 cout <<
"DTTPG phi quality " << DTPhDigiItr->code() << endl;
349 cout <<
"DTTPG phi ts2tag " << DTPhDigiItr->Ts2Tag() << endl;
351 int ypos = DTPhDigiItr->scNum();
352 int xpos = DTPhDigiItr->stNum() + 4 * (DTPhDigiItr->whNum() + 2);
354 if (DTPhDigiItr->Ts2Tag())
357 if (DTPhDigiItr->code() > 3)
360 if (bestPhQualMap[DTPhDigiItr->whNum() + 2][DTPhDigiItr->scNum()][DTPhDigiItr->stNum() - 1] ==
nullptr ||
361 bestPhQualMap[DTPhDigiItr->whNum() + 2][DTPhDigiItr->scNum()][DTPhDigiItr->stNum() - 1]->
code() <
362 DTPhDigiItr->code()) {
363 bestPhQualMap[DTPhDigiItr->whNum() + 2][DTPhDigiItr->scNum()][DTPhDigiItr->stNum() - 1] = &(*DTPhDigiItr);
367 for (
int iwh = 0; iwh < 5; iwh++) {
369 for (
int ist = 0; ist < 4; ist++) {
370 if (bestPhQualMap[iwh][
isec][ist]) {
371 int xpos = iwh * 4 + ist + 1;
373 if (bestPhQualMap[iwh][
isec][ist]->code() > 3)
380 int bestThQualMap[5][12][3];
381 memset(bestThQualMap, 0, 180 *
sizeof(
int));
383 for (L1MuDTChambThContainer::The_Container::const_iterator DTThDigiItr = myThContainer->begin();
384 DTThDigiItr != myThContainer->end();
388 int bxindex = DTThDigiItr->bxNum() + 1;
392 cout <<
"DTTPG theta wheel number " << DTThDigiItr->whNum() << endl;
396 cout <<
"DTTPG theta station number " << DTThDigiItr->stNum() << endl;
400 cout <<
"DTTPG theta sector number " << DTThDigiItr->scNum() << endl;
404 cout <<
"DTTPG theta bx number " << DTThDigiItr->bxNum() << endl;
406 int thcode[7] = {0, 0, 0, 0, 0, 0, 0};
407 for (
int j = 0;
j < 7;
j++) {
410 cout <<
"DTTPG theta position " << DTThDigiItr->position(
j) << endl;
412 thcode[
j] = DTThDigiItr->code(
j);
415 cout <<
"DTTPG theta quality " << DTThDigiItr->code(
j) << endl;
419 int ypos = DTThDigiItr->scNum();
420 int xpos = DTThDigiItr->stNum() + 4 * (DTThDigiItr->whNum() + 2);
425 if (thcode[
pos] > bestqual)
426 bestqual = thcode[
pos];
427 if (thcode[
pos] == 2)
431 if (bestThQualMap[DTThDigiItr->whNum() + 2][DTThDigiItr->scNum()][DTThDigiItr->stNum() - 1] < bestqual) {
432 bestThQualMap[DTThDigiItr->whNum() + 2][DTThDigiItr->scNum()][DTThDigiItr->stNum() - 1] = bestqual;
436 for (
int iwh = 0; iwh < 5; iwh++) {
438 for (
int ist = 0; ist < 3; ist++) {
439 if (bestThQualMap[iwh][
isec][ist]) {
440 int xpos = iwh * 4 + ist + 1;
442 if (bestThQualMap[iwh][
isec][ist] == 2)
451 cout <<
"DTTPG phi ntrack " << ndttpgphtrack << endl;
455 cout <<
"DTTPG theta ntrack " << ndttpgthtrack << endl;
459 e.getByToken(
trToken_, myL1MuDTTrackContainer);
461 if (!myL1MuDTTrackContainer.
isValid()) {
468 int NumberOfSegmentsOut[3] = {0, 0, 0};
469 for (L1MuDTTrackContainer::TrackContainer::const_iterator
i =
t->begin();
i !=
t->end(); ++
i) {
471 NumberOfSegmentsOut[0]++;
473 NumberOfSegmentsOut[1]++;
475 NumberOfSegmentsOut[2]++;
479 for (
int k = 0;
k < 3;
k++) {
485 int bxCounterDttfOut = 0;
486 for (
int k = 0;
k < 3;
k++) {
487 if (NumberOfSegmentsOut[
k] > 0)
492 if (bxCounterDttfOut == 0) {
494 }
else if (bxCounterDttfOut == 1) {
495 for (
int k = 0;
k < 3;
k++) {
496 if (NumberOfSegmentsOut[
k] > 0)
499 }
else if (bxCounterDttfOut == 2) {
500 for (
int k = 0;
k < 3;
k++) {
501 if (NumberOfSegmentsOut[
k] == 0)
504 }
else if (bxCounterDttfOut == 3) {
516 for (L1MuDTTrackContainer::TrackContainer::const_iterator
i =
t->begin();
i !=
t->end(); ++
i) {
519 std::cout <<
"quality (packed) = " <<
i->quality_packed() << std::endl;
520 std::cout <<
"pt (packed) = " <<
i->pt_packed() << std::endl;
521 std::cout <<
"phi (packed) = " <<
i->phi_packed() << std::endl;
522 std::cout <<
"charge (packed) = " <<
i->charge_packed() << std::endl;
525 int bxindex =
i->bx() + 1;
534 me->setAxisTitle(
"DTTF Sector", 2);
535 for (
int i = 0;
i < 5;
i++) {
538 me->setBinLabel(1 +
i * 4,
"Wheel " +
wheel.str(), 1);
543 me->setAxisTitle(
"DTTF Sector", 2);
544 for (
int i = 0;
i < 5;
i++) {
547 me->setBinLabel(1 +
i * 3,
"Wheel " +
wheel.str(), 1);
MonitorElement * dttpgthbestmaph
MonitorElement * dttf_p_phi[3]
L1TDTTPG(const edm::ParameterSet &ps)
MonitorElement * dttpgphmap
MonitorElement * dttpgphbestmapcorr
MonitorElement * dttpgphmapcorr
void setMapPhLabel(MonitorElement *me)
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * dttpgphbx[8]
edm::EDGetTokenT< L1MuDTChambThContainer > dttpgSourceThContainer_token_
MonitorElement * dttpgththeta[3]
void analyze(const edm::Event &e, const edm::EventSetup &c) override
MonitorElement * dttpgphwheel[3]
MonitorElement * dttpgthbestmap
MonitorElement * dttpgphbxcomp
edm::EDGetTokenT< L1MuDTTrackContainer > trToken_
MonitorElement * dttpgthmaph
MonitorElement * dttpgthsector[3]
The_Container const * getContainer() const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * dttpgthmapbx[3]
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
MonitorElement * dttpgthwheel[3]
MonitorElement * dttpgthmap
std::vector< L1MuDTTrackCand > TrackContainer
MonitorElement * dttf_p_qual[3]
MonitorElement * dttpgthbx[3]
MonitorElement * dttpgthquality[3]
std::vector< L1MuDTChambPhDigi > Phi_Container
TrackContainer const * getContainer() const
MonitorElement * dttf_p_pt[3]
std::vector< L1MuDTChambThDigi > The_Container
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Log< level::Info, false > LogInfo
MonitorElement * dttpgphbestmap
Phi_Container const * getContainer() const
MonitorElement * dttpgthntrack
edm::InputTag dttpgSource_
MonitorElement * dttpgphts2tag[3]
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * dttpgphntrack
edm::EDGetTokenT< L1MuDTChambPhContainer > dttpgSourcePhContainer_token_
MonitorElement * dttf_p_q[3]
void setMapThLabel(MonitorElement *me)
MonitorElement * dttpgphmapbx[3]
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * dttpgthstation[3]
MonitorElement * dttpgphsector[3]
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * dttpgphquality[3]
MonitorElement * dttpgphmap2nd
MonitorElement * dttpgphstation[3]
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)