30 if(verbose_)
cout <<
"L1TGMT: constructor...." << endl;
41 if ( outputFile_.size() != 0 ) {
42 cout <<
"L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
52 dbe->setCurrentFolder(
"L1T/L1TGMT");
82 if(verbose_)
cout <<
"L1TGMT: end job...." << endl;
83 LogInfo(
"EndJob") <<
"analyzed " << nev_ <<
" events";
85 if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_);
94 if(verbose_)
cout <<
"L1TGMT: analyze...." << endl;
101 edm::LogInfo(
"DataNotFound") <<
"can't find L1MuGMTReadoutCollection" ;
106 int bx1st[4] = {9, 9, 9, 9};
111 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->
getRecords();
113 vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
115 for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ )
118 vector<L1MuRegionalCand> INPCands[4] = {
119 RRItr->getDTBXCands(),
120 RRItr->getBrlRPCCands(),
121 RRItr->getCSCCands(),
122 RRItr->getFwdRPCCands()
124 vector<L1MuGMTExtendedCand> GMTCands = RRItr->getGMTCands();
126 vector<L1MuRegionalCand>::const_iterator INPItr;
127 vector<L1MuGMTExtendedCand>::const_iterator GMTItr;
128 vector<L1MuGMTExtendedCand>::const_iterator GMTItr2;
130 int BxInEvent = RRItr->getBxInEvent();
133 int nSUBS[5] = {0, 0, 0, 0, 0};
134 for(
int i=0;
i<4;
i++) {
135 for( INPItr = INPCands[
i].
begin(); INPItr != INPCands[
i].end(); ++INPItr ) {
136 if(!INPItr->empty()) {
138 if(bx1st[
i]==9) bx1st[
i]=BxInEvent;
141 subs_nbx[
i]->Fill(
float(nSUBS[
i]),
float(BxInEvent));
144 for( GMTItr = GMTCands.begin(); GMTItr != GMTCands.end(); ++GMTItr ) {
145 if(!GMTItr->empty()) nSUBS[
GMT]++;
147 subs_nbx[
GMT]->Fill(
float(nSUBS[
GMT]),
float(BxInEvent));
151 if(BxInEvent!=0)
continue;
154 int Bx = RRItr->getBxNr();
155 int Ev = RRItr->getEvNr();
157 bx_number->Fill(
double(Bx));
159 for(
int i=0;
i<4;
i++) {
160 for( INPItr = INPCands[
i].
begin(); INPItr != INPCands[
i].end(); ++INPItr ) {
161 if(INPItr->empty())
continue;
162 subs_eta[
i]->Fill(INPItr->etaValue());
163 subs_phi[
i]->Fill(phiconv_(INPItr->phiValue()));
164 subs_pt[
i]->Fill(INPItr->ptValue());
165 subs_qty[
i]->Fill(INPItr->quality());
166 subs_etaphi[
i]->Fill(INPItr->etaValue(),phiconv_(INPItr->phiValue()));
167 subs_etaqty[
i]->Fill(INPItr->etaValue(),INPItr->quality());
168 int word = INPItr->getDataWord();
169 for(
int j=0;
j<32;
j++ ) {
170 if( word&(1<<
j) ) subs_bits[
i]->Fill(
float(
j));
175 for( GMTItr = GMTCands.begin(); GMTItr != GMTCands.end(); ++GMTItr ) {
176 if(GMTItr->empty())
continue;
177 subs_eta[
GMT]->Fill(GMTItr->etaValue());
178 subs_phi[
GMT]->Fill(phiconv_(GMTItr->phiValue()));
179 subs_pt[
GMT]->Fill(GMTItr->ptValue());
180 subs_qty[
GMT]->Fill(GMTItr->quality());
181 subs_etaphi[
GMT]->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
182 subs_etaqty[
GMT]->Fill(GMTItr->etaValue(),GMTItr->quality());
183 int word = GMTItr->getDataWord();
184 for(
int j=0;
j<32;
j++ ) {
185 if( word&(1<<
j) ) subs_bits[
GMT]->Fill(
float(
j));
188 if(GMTItr->isMatchedCand()) {
189 if(GMTItr->quality()>3) {
190 eta_dtcsc_and_rpc->Fill(GMTItr->etaValue());
191 phi_dtcsc_and_rpc->Fill(phiconv_(GMTItr->phiValue()));
192 etaphi_dtcsc_and_rpc->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
194 }
else if(GMTItr->isRPC()) {
195 if(GMTItr->quality()>3) {
196 eta_rpc_only->Fill(GMTItr->etaValue());
197 phi_rpc_only->Fill(phiconv_(GMTItr->phiValue()));
198 etaphi_rpc_only->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
201 if(GMTItr->quality()>3) {
202 eta_dtcsc_only->Fill(GMTItr->etaValue());
203 phi_dtcsc_only->Fill(phiconv_(GMTItr->phiValue()));
204 etaphi_dtcsc_only->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
207 if(GMTItr != GMTCands.end()){
208 for( GMTItr2 = GMTCands.begin(); GMTItr2 != GMTCands.end(); ++GMTItr2 ) {
209 if(GMTItr2==GMTItr)
continue;
210 if(GMTItr2->empty())
continue;
211 if(GMTItr2->isRPC()) {
212 if(GMTItr->isFwd()) {
213 dist_eta_csc_rpc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
214 dist_phi_csc_rpc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
216 dist_eta_dt_rpc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
217 dist_phi_dt_rpc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
220 if(!(GMTItr->isFwd()) && GMTItr2->isFwd()) {
221 dist_eta_dt_csc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
222 dist_phi_dt_csc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
223 }
else if(GMTItr->isFwd() && !(GMTItr2->isFwd())){
224 dist_eta_dt_csc->Fill( GMTItr2->etaValue() - GMTItr->etaValue() );
225 dist_phi_dt_csc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
235 n_rpcb_vs_dttf ->Fill(
float(nSUBS[DTTF]),
float(nSUBS[RPCb]));
236 n_rpcf_vs_csctf->Fill(
float(nSUBS[CSCTF]),
float(nSUBS[RPCf]));
237 n_csctf_vs_dttf->Fill(
float(nSUBS[DTTF]),
float(nSUBS[CSCTF]));
239 regional_triggers->Fill(-1.);
240 if(nSUBS[GMT]) regional_triggers->Fill(0.);
242 for(
int i=0;
i<4;
i++) {
243 if(nSUBS[
i]) regional_triggers->Fill(
float(5*i+nSUBS[i]+ioff));
245 if(nSUBS[DTTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(22.);
246 if(nSUBS[DTTF] && nSUBS[CSCTF]) regional_triggers->Fill(23.);
247 if(nSUBS[CSCTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(24.);
248 if(nSUBS[DTTF] && nSUBS[CSCTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(25.);
253 if( bxnum_old_ > -1 ) {
254 int dBx = Bx - bxnum_old_ + 3564*(e.
orbitNumber() - obnum_old_);
255 for(
int id = 0;
id<4;
id++) {
256 if( trsrc_old_&(1<<
id) ) {
257 for(
int i=0;
i<4;
i++) {
258 if(nSUBS[
i]) subs_dbx[
i]->Fill(
float(dBx),
float(
id));
270 for(
int i=0;
i<4;
i++) {
271 if(nSUBS[
i]) trsrc_old_ |= (1<<
i);
275 if(bx1st[DTTF]<9 && bx1st[RPCb]<9) bx_dt_rpc->Fill(bx1st[DTTF], bx1st[RPCb]);
276 if(bx1st[CSCTF]<9 && bx1st[RPCf]<9) bx_csc_rpc->Fill(bx1st[CSCTF],bx1st[RPCf]);
277 if(bx1st[DTTF]<9 && bx1st[CSCTF]<9) bx_dt_csc->Fill(bx1st[DTTF], bx1st[CSCTF]);
282 double phiout = double(phi);
291 std::string subs[5] = {
"DTTF",
"RPCb",
"CSCTF",
"RPCf",
"GMT" };
306 dbe->setCurrentFolder(
"L1T/L1TGMT");
307 dbe->rmdir(
"L1T/L1TGMT");
313 dbe->setCurrentFolder(
"L1T/L1TGMT");
315 int nqty=8;
double qtymin=-0.5;
double qtymax=7.5;
321 if(nbins>144) nbins=144;
330 for(
int j=0;
j<9;
j++) {
331 qscale[
j] = -0.5 +
j;
340 if(nbins>31) nbins=31;
344 ptscale[
nbins]=ptscale[nbins-1]+10.;
348 float etascale[5][66];
353 if(nbins>65) nbins = 65;
357 netascale[DTTF]=
nbins;
362 if(nbins>65) nbins = 65;
366 netascale[RPCb]=
nbins;
372 if(nbins>32) nbins = 32;
375 for(
int j=nbins;
j>=0;
j--,i++) {
381 netascale[CSCTF]=i-1;
386 if(nbins>65) nbins = 65;
390 netascale[RPCf]=
nbins;
395 if(nbins>32) nbins = 32;
398 for(
int j=nbins;
j>0;
j--,i++) {
411 for(
int i=0;
i<5;
i++) {
413 hname = subs[
i] +
"_nbx"; htitle = subs[
i] +
" multiplicity in bx";
414 subs_nbx[
i] = dbe->book2D(hname.data(),htitle.data(), 4, 1., 5., 5, -2.5, 2.5);
415 subs_nbx[
i]->setAxisTitle(subs[
i] +
" candidates",1);
416 subs_nbx[
i]->setAxisTitle(
"bx wrt L1A",2);
418 hname = subs[
i] +
"_eta"; htitle = subs[
i] +
" eta value";
419 subs_eta[
i] = dbe->book1D(hname.data(),htitle.data(), netascale[
i], etascale[
i]);
420 subs_eta[
i]->setAxisTitle(
"eta",1);
422 hname = subs[
i] +
"_phi"; htitle = subs[
i] +
" phi value";
423 subs_phi[
i] = dbe->book1D(hname.data(),htitle.data(), nphiscale, phiscale);
424 subs_phi[
i]->setAxisTitle(
"phi (deg)",1);
426 hname = subs[
i] +
"_pt"; htitle = subs[
i] +
" pt value";
427 subs_pt[
i] = dbe->book1D(hname.data(),htitle.data(), nptscale, ptscale);
428 subs_pt[
i]->setAxisTitle(
"L1 pT (GeV)",1);
430 hname = subs[
i] +
"_qty"; htitle = subs[
i] +
" qty value";
431 subs_qty[
i] = dbe->book1D(hname.data(),htitle.data(), nqty, qtymin, qtymax);
432 subs_qty[
i]->setAxisTitle(subs[
i] +
" quality",1);
434 hname = subs[
i] +
"_etaphi"; htitle = subs[
i] +
" phi vs eta";
435 subs_etaphi[
i] = dbe->book2D(hname.data(),htitle.data(), netascale[
i], etascale[
i], nphiscale, phiscale);
436 subs_etaphi[
i]->setAxisTitle(
"eta",1);
437 subs_etaphi[
i]->setAxisTitle(
"phi (deg)",2);
439 hname = subs[
i] +
"_etaqty"; htitle = subs[
i] +
" qty vs eta";
440 subs_etaqty[
i] = dbe->book2D(hname.data(),htitle.data(), netascale[
i], etascale[
i], nqty, qscale);
441 subs_etaqty[
i]->setAxisTitle(
"eta",1);
442 subs_etaqty[
i]->setAxisTitle(subs[
i] +
" quality",2);
444 hname = subs[
i] +
"_bits"; htitle = subs[
i] +
" bit population";
445 subs_bits[
i] = dbe->book1D(hname.data(),htitle.data(), 32, -0.5, 31.5);
446 subs_bits[
i]->setAxisTitle(
"bit number",1);
449 regional_triggers = dbe->book1D(
"Regional_trigger",
"Muon trigger contribution", 27, 0., 27.);
450 regional_triggers->setAxisTitle(
"regional trigger",1);
452 regional_triggers->setBinLabel(ib++,
"All muons",1);
454 regional_triggers->setBinLabel(ib++,
"DT 1mu",1);
455 regional_triggers->setBinLabel(ib++,
"DT 2mu",1);
456 regional_triggers->setBinLabel(ib++,
"DT 3mu",1);
457 regional_triggers->setBinLabel(ib++,
"DT 4mu",1);
459 regional_triggers->setBinLabel(ib++,
"RPCb 1mu",1);
460 regional_triggers->setBinLabel(ib++,
"RPCb 2mu",1);
461 regional_triggers->setBinLabel(ib++,
"RPCb 3mu",1);
462 regional_triggers->setBinLabel(ib++,
"RPCb 4mu",1);
464 regional_triggers->setBinLabel(ib++,
"CSC 1mu",1);
465 regional_triggers->setBinLabel(ib++,
"CSC 2mu",1);
466 regional_triggers->setBinLabel(ib++,
"CSC 3mu",1);
467 regional_triggers->setBinLabel(ib++,
"CSC 4mu",1);
469 regional_triggers->setBinLabel(ib++,
"RPCf 1mu",1);
470 regional_triggers->setBinLabel(ib++,
"RPCf 2mu",1);
471 regional_triggers->setBinLabel(ib++,
"RPCf 3mu",1);
472 regional_triggers->setBinLabel(ib++,
"RPCf 4mu",1);
474 regional_triggers->setBinLabel(ib++,
"DT & RPC",1);
475 regional_triggers->setBinLabel(ib++,
"DT & CSC",1);
476 regional_triggers->setBinLabel(ib++,
"CSC & RPC",1);
477 regional_triggers->setBinLabel(ib++,
"DT & CSC & RPC",1);
480 bx_number = dbe->book1D(
"Bx_Number",
"Bx number ROP chip", 3564, 0., 3564.);
481 bx_number->setAxisTitle(
"bx number",1);
483 dbx_chip = dbe->bookProfile(
"dbx_Chip",
"bx count difference wrt ROP chip", 5, 0., 5.,100,-4000.,4000.,
"i");
484 dbx_chip->setAxisTitle(
"chip name",1);
485 dbx_chip->setAxisTitle(
"delta bx",2);
486 dbx_chip->setBinLabel(1,
"IND",1);
487 dbx_chip->setBinLabel(2,
"INB",1);
488 dbx_chip->setBinLabel(3,
"INC",1);
489 dbx_chip->setBinLabel(4,
"INF",1);
490 dbx_chip->setBinLabel(5,
"SRT",1);
492 eta_dtcsc_and_rpc = dbe->book1D(
"eta_DTCSC_and_RPC",
"eta of confirmed GMT candidates",
493 netascale[
GMT], etascale[GMT]);
494 eta_dtcsc_and_rpc->setAxisTitle(
"eta",1);
496 eta_dtcsc_only = dbe->book1D(
"eta_DTCSC_only",
"eta of unconfirmed DT/CSC candidates",
497 netascale[GMT], etascale[GMT]);
498 eta_dtcsc_only->setAxisTitle(
"eta",1);
500 eta_rpc_only = dbe->book1D(
"eta_RPC_only",
"eta of unconfirmed RPC candidates",
501 netascale[GMT], etascale[GMT]);
502 eta_rpc_only->setAxisTitle(
"eta",1);
504 phi_dtcsc_and_rpc = dbe->book1D(
"phi_DTCSC_and_RPC",
"phi of confirmed GMT candidates",
505 nphiscale, phiscale);
506 phi_dtcsc_and_rpc->setAxisTitle(
"phi (deg)",1);
508 phi_dtcsc_only = dbe->book1D(
"phi_DTCSC_only",
"phi of unconfirmed DT/CSC candidates",
509 nphiscale, phiscale);
510 phi_dtcsc_only->setAxisTitle(
"phi (deg)",1);
512 phi_rpc_only = dbe->book1D(
"phi_RPC_only",
"phi of unconfirmed RPC candidates",
513 nphiscale, phiscale);
514 phi_rpc_only->setAxisTitle(
"phi (deg)",1);
516 etaphi_dtcsc_and_rpc = dbe->book2D(
"etaphi_DTCSC_and_RPC",
"eta vs phi map of confirmed GMT candidates",
517 netascale[GMT], etascale[GMT], nphiscale, phiscale);
518 etaphi_dtcsc_and_rpc->setAxisTitle(
"eta",1);
519 etaphi_dtcsc_and_rpc->setAxisTitle(
"phi (deg)",2);
521 etaphi_dtcsc_only = dbe->book2D(
"etaphi_DTCSC_only",
"eta vs phi map of unconfirmed DT/CSC candidates",
522 netascale[GMT], etascale[GMT], nphiscale, phiscale);
523 etaphi_dtcsc_only->setAxisTitle(
"eta",1);
524 etaphi_dtcsc_only->setAxisTitle(
"phi (deg)",2);
526 etaphi_rpc_only = dbe->book2D(
"etaphi_RPC_only",
"eta vs phi map of unconfirmed RPC candidates",
527 netascale[GMT], etascale[GMT], nphiscale, phiscale);
528 etaphi_rpc_only->setAxisTitle(
"eta",1);
529 etaphi_rpc_only->setAxisTitle(
"phi (deg)",2);
532 dist_phi_dt_rpc = dbe->book1D(
"dist_phi_DT_RPC",
"Dphi between DT and RPC candidates", 100, -125., 125.);
533 dist_phi_dt_rpc->setAxisTitle(
"delta phi (deg)",1);
535 dist_phi_csc_rpc = dbe->book1D(
"dist_phi_CSC_RPC",
"Dphi between CSC and RPC candidates", 100, -125., 125.);
536 dist_phi_csc_rpc->setAxisTitle(
"delta phi (deg)",1);
538 dist_phi_dt_csc = dbe->book1D(
"dist_phi_DT_CSC",
"Dphi between DT and CSC candidates", 100, -125., 125.);
539 dist_phi_dt_csc->setAxisTitle(
"delta phi (deg)",1);
542 dist_eta_dt_rpc = dbe->book1D(
"dist_eta_DT_RPC",
"Deta between DT and RPC candidates", 40, -1., 1.);
543 dist_eta_dt_rpc->setAxisTitle(
"delta eta",1);
545 dist_eta_csc_rpc = dbe->book1D(
"dist_eta_CSC_RPC",
"Deta between CSC and RPC candidates", 40, -1., 1.);
546 dist_eta_csc_rpc->setAxisTitle(
"delta eta",1);
548 dist_eta_dt_csc = dbe->book1D(
"dist_eta_DT_CSC",
"Deta between DT and CSC candidates", 40, -1., 1.);
549 dist_eta_dt_csc->setAxisTitle(
"delta eta",1);
552 n_rpcb_vs_dttf = dbe->book2D(
"n_RPCb_vs_DTTF",
"n cands RPCb vs DTTF", 5, -0.5, 4.5, 5, -0.5, 4.5);
553 n_rpcb_vs_dttf->setAxisTitle(
"DTTF candidates",1);
554 n_rpcb_vs_dttf->setAxisTitle(
"barrel RPC candidates",2);
556 n_rpcf_vs_csctf = dbe->book2D(
"n_RPCf_vs_CSCTF",
"n cands RPCf vs CSCTF", 5, -0.5, 4.5, 5, -0.5, 4.5);
557 n_rpcf_vs_csctf->setAxisTitle(
"CSCTF candidates",1);
558 n_rpcf_vs_csctf->setAxisTitle(
"endcap RPC candidates",2);
560 n_csctf_vs_dttf = dbe->book2D(
"n_CSCTF_vs_DTTF",
"n cands CSCTF vs DTTF", 5, -0.5, 4.5, 5, -0.5, 4.5);
561 n_csctf_vs_dttf->setAxisTitle(
"DTTF candidates",1);
562 n_csctf_vs_dttf->setAxisTitle(
"CSCTF candidates",2);
564 bx_dt_rpc = dbe->book2D(
"bx_DT_vs_RPC",
"1st bx DT vs. RPC", 5, -2.5, 2.5, 5, -2.5, 2.5);
565 bx_dt_rpc->setAxisTitle(
"bx of 1st DTTF candidate",1);
566 bx_dt_rpc->setAxisTitle(
"bx of 1st RPCb candidate",2);
568 bx_csc_rpc = dbe->book2D(
"bx_CSC_vs_RPC",
"1st bx CSC vs. RPC", 5, -2.5, 2.5, 5, -2.5, 2.5);
569 bx_csc_rpc->setAxisTitle(
"bx of 1st CSCTF candidate",1);
570 bx_csc_rpc->setAxisTitle(
"bx of 1st RPCf candidate",2);
572 bx_dt_csc = dbe->book2D(
"bx_DT_vs_CSC",
"1st bx DT vs. CSC", 5, -2.5, 2.5, 5, -2.5, 2.5);
573 bx_dt_csc->setAxisTitle(
"bx of 1st DTTF candidate",1);
574 bx_dt_csc->setAxisTitle(
"bx of 1st CSCTF candidate",2);
577 for(
int i=0;
i<4;
i++) {
578 hname = subs[
i] +
"_dbx"; htitle =
"dBx " + subs[
i] +
" to previous event";
579 subs_dbx[
i] = dbe->book2D(hname.data(),htitle.data(), 1000, 0., 1000., 4, 0., 4.);
580 for(
int j=0;
j<4;
j++) {
581 subs_dbx[
i]->setBinLabel((
j+1),subs[
j].
data(),2);
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
void beginRun(const edm::Run &r, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double phiconv_(float phi)
void analyze(const edm::Event &e, const edm::EventSetup &c)
static const double piconv_
const L1MuScale * getPhiScale() const
get the phi scale
virtual float getValue(unsigned i) const =0
get value of the underlying vector for bin i
void book_(const edm::EventSetup &c)
T const * product() const
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