30 if(verbose_)
cout <<
"L1TGMT: constructor...." << endl;
33 if ( outputFile_.size() != 0 ) {
34 cout <<
"L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
62 if(verbose_)
cout <<
"L1TGMT: analyze...." << endl;
69 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection" ;
74 int bx1st[4] = {9, 9, 9, 9};
79 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
81 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
83 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ )
86 vector<L1MuRegionalCand> INPCands[4] = {
87 RRItr->getDTBXCands(),
88 RRItr->getBrlRPCCands(),
90 RRItr->getFwdRPCCands()
92 vector<L1MuGMTExtendedCand> GMTCands = RRItr->getGMTCands();
94 vector<L1MuRegionalCand>::const_iterator INPItr;
95 vector<L1MuGMTExtendedCand>::const_iterator GMTItr;
96 vector<L1MuGMTExtendedCand>::const_iterator GMTItr2;
98 int BxInEvent = RRItr->getBxInEvent();
101 int nSUBS[5] = {0, 0, 0, 0, 0};
102 for(
int i=0;
i<4;
i++) {
103 for( INPItr = INPCands[
i].
begin(); INPItr != INPCands[
i].end(); ++INPItr ) {
104 if(!INPItr->empty()) {
106 if(bx1st[
i]==9) bx1st[
i]=BxInEvent;
109 subs_nbx[
i]->Fill(
float(nSUBS[
i]),
float(BxInEvent));
112 for( GMTItr = GMTCands.begin(); GMTItr != GMTCands.end(); ++GMTItr ) {
113 if(!GMTItr->empty()) nSUBS[
GMT]++;
115 subs_nbx[
GMT]->Fill(
float(nSUBS[
GMT]),
float(BxInEvent));
119 if(BxInEvent!=0)
continue;
122 int Bx = RRItr->getBxNr();
123 int Ev = RRItr->getEvNr();
125 bx_number->Fill(
double(Bx));
127 for(
int i=0;
i<4;
i++) {
128 for( INPItr = INPCands[
i].
begin(); INPItr != INPCands[
i].end(); ++INPItr ) {
129 if(INPItr->empty())
continue;
130 subs_eta[
i]->Fill(INPItr->etaValue());
131 subs_phi[
i]->Fill(phiconv_(INPItr->phiValue()));
132 subs_pt[
i]->Fill(INPItr->ptValue());
133 subs_qty[
i]->Fill(INPItr->quality());
134 subs_etaphi[
i]->Fill(INPItr->etaValue(),phiconv_(INPItr->phiValue()));
135 subs_etaqty[
i]->Fill(INPItr->etaValue(),INPItr->quality());
136 int word = INPItr->getDataWord();
137 for(
int j=0;
j<32;
j++ ) {
138 if( word&(1<<
j) ) subs_bits[
i]->Fill(
float(
j));
143 for( GMTItr = GMTCands.begin(); GMTItr != GMTCands.end(); ++GMTItr ) {
144 if(GMTItr->empty())
continue;
145 subs_eta[
GMT]->Fill(GMTItr->etaValue());
146 subs_phi[
GMT]->Fill(phiconv_(GMTItr->phiValue()));
147 subs_pt[
GMT]->Fill(GMTItr->ptValue());
148 subs_qty[
GMT]->Fill(GMTItr->quality());
149 subs_etaphi[
GMT]->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
150 subs_etaqty[
GMT]->Fill(GMTItr->etaValue(),GMTItr->quality());
151 int word = GMTItr->getDataWord();
152 for(
int j=0;
j<32;
j++ ) {
153 if( word&(1<<
j) ) subs_bits[
GMT]->Fill(
float(
j));
156 if(GMTItr->isMatchedCand()) {
157 if(GMTItr->quality()>3) {
158 eta_dtcsc_and_rpc->Fill(GMTItr->etaValue());
159 phi_dtcsc_and_rpc->Fill(phiconv_(GMTItr->phiValue()));
160 etaphi_dtcsc_and_rpc->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
162 }
else if(GMTItr->isRPC()) {
163 if(GMTItr->quality()>3) {
164 eta_rpc_only->Fill(GMTItr->etaValue());
165 phi_rpc_only->Fill(phiconv_(GMTItr->phiValue()));
166 etaphi_rpc_only->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
169 if(GMTItr->quality()>3) {
170 eta_dtcsc_only->Fill(GMTItr->etaValue());
171 phi_dtcsc_only->Fill(phiconv_(GMTItr->phiValue()));
172 etaphi_dtcsc_only->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
175 if(GMTItr != GMTCands.end()){
176 for( GMTItr2 = GMTCands.begin(); GMTItr2 != GMTCands.end(); ++GMTItr2 ) {
177 if(GMTItr2==GMTItr)
continue;
178 if(GMTItr2->empty())
continue;
179 if(GMTItr2->isRPC()) {
180 if(GMTItr->isFwd()) {
181 dist_eta_csc_rpc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
182 dist_phi_csc_rpc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
184 dist_eta_dt_rpc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
185 dist_phi_dt_rpc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
188 if(!(GMTItr->isFwd()) && GMTItr2->isFwd()) {
189 dist_eta_dt_csc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
190 dist_phi_dt_csc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
191 }
else if(GMTItr->isFwd() && !(GMTItr2->isFwd())){
192 dist_eta_dt_csc->Fill( GMTItr2->etaValue() - GMTItr->etaValue() );
193 dist_phi_dt_csc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
203 n_rpcb_vs_dttf ->Fill(
float(nSUBS[DTTF]),
float(nSUBS[RPCb]));
204 n_rpcf_vs_csctf->Fill(
float(nSUBS[CSCTF]),
float(nSUBS[RPCf]));
205 n_csctf_vs_dttf->Fill(
float(nSUBS[DTTF]),
float(nSUBS[CSCTF]));
207 regional_triggers->Fill(-1.);
208 if(nSUBS[GMT]) regional_triggers->Fill(0.);
210 for(
int i=0;
i<4;
i++) {
211 if(nSUBS[
i]) regional_triggers->Fill(
float(5*i+nSUBS[i]+ioff));
213 if(nSUBS[DTTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(22.);
214 if(nSUBS[DTTF] && nSUBS[CSCTF]) regional_triggers->Fill(23.);
215 if(nSUBS[CSCTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(24.);
216 if(nSUBS[DTTF] && nSUBS[CSCTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(25.);
221 if( bxnum_old_ > -1 ) {
222 int dBx = Bx - bxnum_old_ + 3564*(e.
orbitNumber() - obnum_old_);
223 for(
int id = 0;
id<4;
id++) {
224 if( trsrc_old_&(1<<
id) ) {
225 for(
int i=0;
i<4;
i++) {
226 if(nSUBS[
i]) subs_dbx[
i]->Fill(
float(dBx),
float(
id));
238 for(
int i=0;
i<4;
i++) {
239 if(nSUBS[
i]) trsrc_old_ |= (1<<
i);
243 if(bx1st[DTTF]<9 && bx1st[RPCb]<9) bx_dt_rpc->Fill(bx1st[DTTF], bx1st[RPCb]);
244 if(bx1st[CSCTF]<9 && bx1st[RPCf]<9) bx_csc_rpc->Fill(bx1st[CSCTF],bx1st[RPCf]);
245 if(bx1st[DTTF]<9 && bx1st[CSCTF]<9) bx_dt_csc->Fill(bx1st[DTTF], bx1st[CSCTF]);
250 double phiout = double(phi);
259 std::string subs[5] = {
"DTTF",
"RPCb",
"CSCTF",
"RPCf",
"GMT" };
271 int nqty=8;
double qtymin=-0.5;
double qtymax=7.5;
277 if(nbins>144) nbins=144;
286 for(
int j=0;
j<9;
j++) {
287 qscale[
j] = -0.5 +
j;
296 if(nbins>31) nbins=31;
300 ptscale[
nbins]=ptscale[nbins-1]+10.;
304 float etascale[5][66];
309 if(nbins>65) nbins = 65;
313 netascale[DTTF]=
nbins;
318 if(nbins>65) nbins = 65;
322 netascale[RPCb]=
nbins;
328 if(nbins>32) nbins = 32;
331 for(
int j=nbins;
j>=0;
j--,i++) {
337 netascale[CSCTF]=i-1;
342 if(nbins>65) nbins = 65;
346 netascale[RPCf]=
nbins;
351 if(nbins>32) nbins = 32;
354 for(
int j=nbins;
j>0;
j--,i++) {
367 for(
int i=0;
i<5;
i++) {
369 hname = subs[
i] +
"_nbx"; htitle = subs[
i] +
" multiplicity in bx";
370 subs_nbx[
i] = ibooker.
book2D(hname.data(),htitle.data(), 4, 1., 5., 5, -2.5, 2.5);
372 subs_nbx[
i]->setAxisTitle(
"bx wrt L1A",2);
374 hname = subs[
i] +
"_eta"; htitle = subs[
i] +
" eta value";
375 subs_eta[
i] = ibooker.
book1D(hname.data(),htitle.data(), netascale[
i], etascale[
i]);
378 hname = subs[
i] +
"_phi"; htitle = subs[
i] +
" phi value";
379 subs_phi[
i] = ibooker.
book1D(hname.data(),htitle.data(), nphiscale, phiscale);
382 hname = subs[
i] +
"_pt"; htitle = subs[
i] +
" pt value";
383 subs_pt[
i] = ibooker.
book1D(hname.data(),htitle.data(), nptscale, ptscale);
386 hname = subs[
i] +
"_qty"; htitle = subs[
i] +
" qty value";
387 subs_qty[
i] = ibooker.
book1D(hname.data(),htitle.data(), nqty, qtymin, qtymax);
390 hname = subs[
i] +
"_etaphi"; htitle = subs[
i] +
" phi vs eta";
391 subs_etaphi[
i] = ibooker.
book2D(hname.data(),htitle.data(), netascale[
i], etascale[
i], nphiscale, phiscale);
393 subs_etaphi[
i]->setAxisTitle(
"phi (deg)",2);
395 hname = subs[
i] +
"_etaqty"; htitle = subs[
i] +
" qty vs eta";
396 subs_etaqty[
i] = ibooker.
book2D(hname.data(),htitle.data(), netascale[
i], etascale[
i], nqty, qscale);
398 subs_etaqty[
i]->setAxisTitle(subs[
i] +
" quality",2);
400 hname = subs[
i] +
"_bits"; htitle = subs[
i] +
" bit population";
401 subs_bits[
i] = ibooker.
book1D(hname.data(),htitle.data(), 32, -0.5, 31.5);
405 regional_triggers = ibooker.
book1D(
"Regional_trigger",
"Muon trigger contribution", 27, 0., 27.);
408 regional_triggers->setBinLabel(ib++,
"All muons",1);
410 regional_triggers->setBinLabel(ib++,
"DT 1mu",1);
411 regional_triggers->setBinLabel(ib++,
"DT 2mu",1);
412 regional_triggers->setBinLabel(ib++,
"DT 3mu",1);
413 regional_triggers->setBinLabel(ib++,
"DT 4mu",1);
415 regional_triggers->setBinLabel(ib++,
"RPCb 1mu",1);
416 regional_triggers->setBinLabel(ib++,
"RPCb 2mu",1);
417 regional_triggers->setBinLabel(ib++,
"RPCb 3mu",1);
418 regional_triggers->setBinLabel(ib++,
"RPCb 4mu",1);
420 regional_triggers->setBinLabel(ib++,
"CSC 1mu",1);
421 regional_triggers->setBinLabel(ib++,
"CSC 2mu",1);
422 regional_triggers->setBinLabel(ib++,
"CSC 3mu",1);
423 regional_triggers->setBinLabel(ib++,
"CSC 4mu",1);
425 regional_triggers->setBinLabel(ib++,
"RPCf 1mu",1);
426 regional_triggers->setBinLabel(ib++,
"RPCf 2mu",1);
427 regional_triggers->setBinLabel(ib++,
"RPCf 3mu",1);
428 regional_triggers->setBinLabel(ib++,
"RPCf 4mu",1);
430 regional_triggers->setBinLabel(ib++,
"DT & RPC",1);
431 regional_triggers->setBinLabel(ib++,
"DT & CSC",1);
432 regional_triggers->setBinLabel(ib++,
"CSC & RPC",1);
433 regional_triggers->setBinLabel(ib++,
"DT & CSC & RPC",1);
436 bx_number = ibooker.
book1D(
"Bx_Number",
"Bx number ROP chip", 3564, 0., 3564.);
439 dbx_chip = ibooker.
bookProfile(
"dbx_Chip",
"bx count difference wrt ROP chip", 5, 0., 5.,100,-4000.,4000.,
"i");
441 dbx_chip->setAxisTitle(
"delta bx",2);
442 dbx_chip->setBinLabel(1,
"IND",1);
443 dbx_chip->setBinLabel(2,
"INB",1);
444 dbx_chip->setBinLabel(3,
"INC",1);
445 dbx_chip->setBinLabel(4,
"INF",1);
446 dbx_chip->setBinLabel(5,
"SRT",1);
448 eta_dtcsc_and_rpc = ibooker.
book1D(
"eta_DTCSC_and_RPC",
"eta of confirmed GMT candidates", netascale[
GMT], etascale[GMT]);
451 eta_dtcsc_only = ibooker.
book1D(
"eta_DTCSC_only",
"eta of unconfirmed DT/CSC candidates", netascale[GMT], etascale[GMT]);
454 eta_rpc_only = ibooker.
book1D(
"eta_RPC_only",
"eta of unconfirmed RPC candidates", netascale[GMT], etascale[GMT]);
457 phi_dtcsc_and_rpc = ibooker.
book1D(
"phi_DTCSC_and_RPC",
"phi of confirmed GMT candidates",nphiscale, phiscale);
460 phi_dtcsc_only = ibooker.
book1D(
"phi_DTCSC_only",
"phi of unconfirmed DT/CSC candidates", nphiscale, phiscale);
463 phi_rpc_only = ibooker.
book1D(
"phi_RPC_only",
"phi of unconfirmed RPC candidates", nphiscale, phiscale);
466 etaphi_dtcsc_and_rpc = ibooker.
book2D(
"etaphi_DTCSC_and_RPC",
"eta vs phi map of confirmed GMT candidates", netascale[GMT], etascale[GMT], nphiscale, phiscale);
468 etaphi_dtcsc_and_rpc->setAxisTitle(
"phi (deg)",2);
470 etaphi_dtcsc_only = ibooker.
book2D(
"etaphi_DTCSC_only",
"eta vs phi map of unconfirmed DT/CSC candidates", netascale[GMT], etascale[GMT], nphiscale, phiscale);
472 etaphi_dtcsc_only->setAxisTitle(
"phi (deg)",2);
474 etaphi_rpc_only = ibooker.
book2D(
"etaphi_RPC_only",
"eta vs phi map of unconfirmed RPC candidates", netascale[GMT], etascale[GMT], nphiscale, phiscale);
476 etaphi_rpc_only->setAxisTitle(
"phi (deg)",2);
479 dist_phi_dt_rpc = ibooker.
book1D(
"dist_phi_DT_RPC",
"Dphi between DT and RPC candidates", 100, -125., 125.);
482 dist_phi_csc_rpc = ibooker.
book1D(
"dist_phi_CSC_RPC",
"Dphi between CSC and RPC candidates", 100, -125., 125.);
485 dist_phi_dt_csc = ibooker.
book1D(
"dist_phi_DT_CSC",
"Dphi between DT and CSC candidates", 100, -125., 125.);
489 dist_eta_dt_rpc = ibooker.
book1D(
"dist_eta_DT_RPC",
"Deta between DT and RPC candidates", 40, -1., 1.);
492 dist_eta_csc_rpc = ibooker.
book1D(
"dist_eta_CSC_RPC",
"Deta between CSC and RPC candidates", 40, -1., 1.);
495 dist_eta_dt_csc = ibooker.
book1D(
"dist_eta_DT_CSC",
"Deta between DT and CSC candidates", 40, -1., 1.);
499 n_rpcb_vs_dttf = ibooker.
book2D(
"n_RPCb_vs_DTTF",
"n cands RPCb vs DTTF", 5, -0.5, 4.5, 5, -0.5, 4.5);
501 n_rpcb_vs_dttf->setAxisTitle(
"barrel RPC candidates",2);
503 n_rpcf_vs_csctf = ibooker.
book2D(
"n_RPCf_vs_CSCTF",
"n cands RPCf vs CSCTF", 5, -0.5, 4.5, 5, -0.5, 4.5);
505 n_rpcf_vs_csctf->setAxisTitle(
"endcap RPC candidates",2);
507 n_csctf_vs_dttf = ibooker.
book2D(
"n_CSCTF_vs_DTTF",
"n cands CSCTF vs DTTF", 5, -0.5, 4.5, 5, -0.5, 4.5);
509 n_csctf_vs_dttf->setAxisTitle(
"CSCTF candidates",2);
511 bx_dt_rpc = ibooker.
book2D(
"bx_DT_vs_RPC",
"1st bx DT vs. RPC", 5, -2.5, 2.5, 5, -2.5, 2.5);
513 bx_dt_rpc->setAxisTitle(
"bx of 1st RPCb candidate",2);
515 bx_csc_rpc = ibooker.
book2D(
"bx_CSC_vs_RPC",
"1st bx CSC vs. RPC", 5, -2.5, 2.5, 5, -2.5, 2.5);
516 bx_csc_rpc->
setAxisTitle(
"bx of 1st CSCTF candidate",1);
517 bx_csc_rpc->setAxisTitle(
"bx of 1st RPCf candidate",2);
519 bx_dt_csc = ibooker.
book2D(
"bx_DT_vs_CSC",
"1st bx DT vs. CSC", 5, -2.5, 2.5, 5, -2.5, 2.5);
521 bx_dt_csc->setAxisTitle(
"bx of 1st CSCTF candidate",2);
524 for(
int i=0;
i<4;
i++) {
525 hname = subs[
i] +
"_dbx"; htitle =
"dBx " + subs[
i] +
" to previous event";
526 subs_dbx[
i] = ibooker.
book2D(hname.data(),htitle.data(), 1000, 0., 1000., 4, 0., 4.);
527 for(
int j=0;
j<4;
j++) {
L1TGMT(const edm::ParameterSet &ps)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const L1MuScale * getPtScale() const
get the Pt scale
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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)
double phiconv_(float phi)
void analyze(const edm::Event &e, const edm::EventSetup &c)
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
static const double piconv_
const L1MuScale * getPhiScale() const
get the phi scale
MonitorElement * book1D(Args &&...args)
virtual void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
virtual float getValue(unsigned i) const =0
get value of the underlying vector for bin i
virtual void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &, edm::EventSetup const &) override
void setCurrentFolder(const std::string &fullpath)
T const * product() const
MonitorElement * book2D(Args &&...args)
T const * product() const
virtual unsigned getNBins() const =0
get number of bins
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
char data[epos_bytes_allocation]
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)