CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQM/L1TMonitor/src/L1TGMT.cc

Go to the documentation of this file.
00001 /*
00002  * \file L1TGMT.cc
00003  *
00004  * $Date: 2010/01/14 09:16:16 $
00005  * $Revision: 1.28 $
00006  * \author J. Berryhill, I. Mikulec
00007  *
00008  */
00009 
00010 #include "DQM/L1TMonitor/interface/L1TGMT.h"
00011 #include "DQMServices/Core/interface/DQMStore.h"
00012 
00013 #include "FWCore/Framework/interface/EventSetup.h"
00014 #include "FWCore/Framework/interface/ESHandle.h"
00015 #include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
00016 #include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
00017 #include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
00018 #include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
00019 
00020 using namespace std;
00021 using namespace edm;
00022 
00023 const double L1TGMT::piconv_ = 180. / acos(-1.);
00024 
00025 L1TGMT::L1TGMT(const ParameterSet& ps)
00026   : gmtSource_( ps.getParameter< InputTag >("gmtSource") )
00027  {
00028 
00029   // verbosity switch
00030   verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
00031 
00032   if(verbose_) cout << "L1TGMT: constructor...." << endl;
00033 
00034 
00035   dbe = NULL;
00036   if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) 
00037   {
00038     dbe = Service<DQMStore>().operator->();
00039     dbe->setVerbose(0);
00040   }
00041 
00042   outputFile_ = ps.getUntrackedParameter<string>("outputFile", "");
00043   if ( outputFile_.size() != 0 ) {
00044     cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl;
00045   }
00046 
00047   bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false);
00048   if(disable){
00049     outputFile_="";
00050   }
00051 
00052 
00053   if ( dbe !=NULL ) {
00054     dbe->setCurrentFolder("L1T/L1TGMT");
00055   }
00056 
00057 }
00058 
00059 L1TGMT::~L1TGMT()
00060 {
00061 }
00062 
00063 void L1TGMT::beginJob()
00064 {
00065 
00066   nev_ = 0;
00067   evnum_old_ = -1;
00068   bxnum_old_ = -1;
00069 
00070 }
00071 
00072 void L1TGMT::beginRun(const edm::Run& r, const edm::EventSetup& c)
00073 {
00074   
00075   if(nev_==0) {
00076       book_(c);
00077     }
00078 
00079 }
00080 
00081 
00082 void L1TGMT::endJob(void)
00083 {
00084   if(verbose_) cout << "L1TGMT: end job...." << endl;
00085   LogInfo("EndJob") << "analyzed " << nev_ << " events"; 
00086 
00087  if ( outputFile_.size() != 0  && dbe ) dbe->save(outputFile_);
00088 
00089  return;
00090 }
00091 
00092 void L1TGMT::analyze(const Event& e, const EventSetup& c)
00093 {
00094   
00095   nev_++; 
00096   if(verbose_) cout << "L1TGMT: analyze...." << endl;
00097 
00098 
00099   edm::Handle<L1MuGMTReadoutCollection> pCollection;
00100   e.getByLabel(gmtSource_,pCollection);
00101   
00102   if (!pCollection.isValid()) {
00103     edm::LogInfo("DataNotFound") << "can't find L1MuGMTReadoutCollection with label "
00104     << gmtSource_.label() ;
00105     return;
00106   }
00107 
00108   // remember the bx of 1st candidate of each system (9=none)
00109   int bx1st[4] = {9, 9, 9, 9};
00110 
00111   // get GMT readout collection
00112   L1MuGMTReadoutCollection const* gmtrc = pCollection.product();
00113   // get record vector
00114   vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
00115   // loop over records of individual bx's
00116   vector<L1MuGMTReadoutRecord>::const_iterator RRItr;
00117   
00118   for( RRItr = gmt_records.begin(); RRItr != gmt_records.end(); RRItr++ ) 
00119   {
00120     
00121     vector<L1MuRegionalCand> INPCands[4] = {
00122         RRItr->getDTBXCands(),
00123         RRItr->getBrlRPCCands(),
00124         RRItr->getCSCCands(),
00125         RRItr->getFwdRPCCands()
00126     };
00127     vector<L1MuGMTExtendedCand> GMTCands   = RRItr->getGMTCands();
00128     
00129     vector<L1MuRegionalCand>::const_iterator INPItr;
00130     vector<L1MuGMTExtendedCand>::const_iterator GMTItr;
00131     vector<L1MuGMTExtendedCand>::const_iterator GMTItr2;
00132     
00133     int BxInEvent = RRItr->getBxInEvent();
00134     
00135     // count non-empty candidates in this bx
00136     int nSUBS[5] = {0, 0, 0, 0, 0};
00137     for(int i=0; i<4; i++) {
00138       for( INPItr = INPCands[i].begin(); INPItr != INPCands[i].end(); ++INPItr ) {
00139         if(!INPItr->empty()) {
00140           nSUBS[i]++;
00141           if(bx1st[i]==9) bx1st[i]=BxInEvent;
00142         }
00143       }      
00144       subs_nbx[i]->Fill(float(nSUBS[i]),float(BxInEvent));
00145     }
00146 
00147     for( GMTItr = GMTCands.begin(); GMTItr != GMTCands.end(); ++GMTItr ) {
00148       if(!GMTItr->empty()) nSUBS[GMT]++;
00149     }
00150     subs_nbx[GMT]->Fill(float(nSUBS[GMT]),float(BxInEvent));
00151     
00153     // from here care only about the L1A bunch crossing
00154     if(BxInEvent!=0) continue;
00155     
00156     // get the absolute bx number of the L1A
00157     int Bx = RRItr->getBxNr();
00158     int Ev = RRItr->getEvNr();
00159     
00160     bx_number->Fill(double(Bx));
00161  
00162     for(int i=0; i<4; i++) {
00163       for( INPItr = INPCands[i].begin(); INPItr != INPCands[i].end(); ++INPItr ) {
00164         if(INPItr->empty()) continue;
00165         subs_eta[i]->Fill(INPItr->etaValue());
00166         subs_phi[i]->Fill(phiconv_(INPItr->phiValue()));
00167         subs_pt[i]->Fill(INPItr->ptValue());
00168         subs_qty[i]->Fill(INPItr->quality());
00169         subs_etaphi[i]->Fill(INPItr->etaValue(),phiconv_(INPItr->phiValue()));
00170         subs_etaqty[i]->Fill(INPItr->etaValue(),INPItr->quality());
00171         int word = INPItr->getDataWord();
00172         for( int j=0; j<32; j++ ) {
00173           if( word&(1<<j) ) subs_bits[i]->Fill(float(j));
00174         }
00175       }
00176     }
00177         
00178     for( GMTItr = GMTCands.begin(); GMTItr != GMTCands.end(); ++GMTItr ) {
00179       if(GMTItr->empty()) continue;
00180       subs_eta[GMT]->Fill(GMTItr->etaValue());
00181       subs_phi[GMT]->Fill(phiconv_(GMTItr->phiValue()));
00182       subs_pt[GMT]->Fill(GMTItr->ptValue());
00183       subs_qty[GMT]->Fill(GMTItr->quality());
00184       subs_etaphi[GMT]->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
00185       subs_etaqty[GMT]->Fill(GMTItr->etaValue(),GMTItr->quality());
00186       int word = GMTItr->getDataWord();
00187       for( int j=0; j<32; j++ ) {
00188         if( word&(1<<j) ) subs_bits[GMT]->Fill(float(j));
00189       }
00190       
00191       if(GMTItr->isMatchedCand()) {
00192         if(GMTItr->quality()>3) {
00193           eta_dtcsc_and_rpc->Fill(GMTItr->etaValue());
00194           phi_dtcsc_and_rpc->Fill(phiconv_(GMTItr->phiValue()));
00195           etaphi_dtcsc_and_rpc->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
00196         }
00197       } else if(GMTItr->isRPC()) {
00198         if(GMTItr->quality()>3) {
00199           eta_rpc_only->Fill(GMTItr->etaValue());
00200           phi_rpc_only->Fill(phiconv_(GMTItr->phiValue()));
00201           etaphi_rpc_only->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));        
00202         }
00203       } else {
00204         if(GMTItr->quality()>3) {
00205           eta_dtcsc_only->Fill(GMTItr->etaValue());
00206           phi_dtcsc_only->Fill(phiconv_(GMTItr->phiValue()));
00207           etaphi_dtcsc_only->Fill(GMTItr->etaValue(),phiconv_(GMTItr->phiValue()));
00208         }
00209         
00210         if(GMTItr != GMTCands.end()){
00211           for( GMTItr2 = GMTCands.begin(); GMTItr2 != GMTCands.end(); ++GMTItr2 ) {
00212             if(GMTItr2==GMTItr) continue;
00213             if(GMTItr2->empty()) continue;
00214             if(GMTItr2->isRPC()) {
00215               if(GMTItr->isFwd()) {
00216                 dist_eta_csc_rpc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
00217                 dist_phi_csc_rpc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
00218               } else {
00219                 dist_eta_dt_rpc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
00220                 dist_phi_dt_rpc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );                
00221               }
00222             } else {
00223               if(!(GMTItr->isFwd()) && GMTItr2->isFwd()) {
00224                 dist_eta_dt_csc->Fill( GMTItr->etaValue() - GMTItr2->etaValue() );
00225                 dist_phi_dt_csc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );
00226               } else if(GMTItr->isFwd() && !(GMTItr2->isFwd())){
00227                 dist_eta_dt_csc->Fill( GMTItr2->etaValue() - GMTItr->etaValue() );
00228                 dist_phi_dt_csc->Fill( phiconv_(GMTItr->phiValue()) - phiconv_(GMTItr2->phiValue()) );                
00229               }
00230             }
00231           }     
00232         }
00233         
00234       }
00235       
00236     }
00237     
00238     n_rpcb_vs_dttf ->Fill(float(nSUBS[DTTF]),float(nSUBS[RPCb]));
00239     n_rpcf_vs_csctf->Fill(float(nSUBS[CSCTF]),float(nSUBS[RPCf]));
00240     n_csctf_vs_dttf->Fill(float(nSUBS[DTTF]),float(nSUBS[CSCTF]));
00241     
00242     regional_triggers->Fill(-1.); // fill underflow for normalization
00243     if(nSUBS[GMT]) regional_triggers->Fill(0.); // fill all muon bin
00244     int ioff=1;
00245     for(int i=0; i<4; i++) {
00246       if(nSUBS[i]) regional_triggers->Fill(float(5*i+nSUBS[i]+ioff));
00247     }
00248     if(nSUBS[DTTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(22.);
00249     if(nSUBS[DTTF] && nSUBS[CSCTF]) regional_triggers->Fill(23.);
00250     if(nSUBS[CSCTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(24.);
00251     if(nSUBS[DTTF] && nSUBS[CSCTF] && (nSUBS[RPCb] || nSUBS[RPCf])) regional_triggers->Fill(25.);
00252         
00253     // fill only if previous event corresponds to previous trigger
00254 //    if( (Ev - evnum_old_) == 1 && bxnum_old_ > -1 ) {
00255     // assume getting all events in a sequence (usefull only from reco data)
00256       if( bxnum_old_ > -1 ) {
00257       int dBx = Bx - bxnum_old_ + 3564*(e.orbitNumber() - obnum_old_);
00258       for(int id = 0; id<4; id++) {
00259         if( trsrc_old_&(1<<id) ) {
00260           for(int i=0; i<4; i++) {
00261             if(nSUBS[i]) subs_dbx[i]->Fill(float(dBx),float(id));
00262           }
00263         }
00264       }
00265       
00266     }
00267     
00268     // save quantities for the next event
00269     evnum_old_ = Ev;
00270     bxnum_old_ = Bx;
00271     obnum_old_ = e.orbitNumber();
00272     trsrc_old_ = 0;
00273     for(int i=0; i<4; i++) {
00274       if(nSUBS[i])  trsrc_old_ |= (1<<i);
00275     }
00276   }
00277   
00278   if(bx1st[DTTF]<9  && bx1st[RPCb]<9)  bx_dt_rpc->Fill(bx1st[DTTF], bx1st[RPCb]);
00279   if(bx1st[CSCTF]<9 && bx1st[RPCf]<9) bx_csc_rpc->Fill(bx1st[CSCTF],bx1st[RPCf]);
00280   if(bx1st[DTTF]<9 && bx1st[CSCTF]<9)  bx_dt_csc->Fill(bx1st[DTTF], bx1st[CSCTF]);
00281 
00282 }
00283 
00284 double L1TGMT::phiconv_(float phi) {
00285   double phiout = double(phi);
00286   phiout *= piconv_;
00287   phiout += 0.001; // add a small value to get off the bin edge
00288   return phiout;
00289 }
00290 
00291 void L1TGMT::book_(const EventSetup& c)
00292 {
00293 
00294   std::string subs[5] = { "DTTF", "RPCb", "CSCTF", "RPCf", "GMT" };
00295 
00296   edm::ESHandle< L1MuTriggerScales > trigscales_h;
00297   c.get< L1MuTriggerScalesRcd >().get( trigscales_h );
00298   const L1MuTriggerScales* scales = trigscales_h.product();
00299 
00300   edm::ESHandle< L1MuTriggerPtScale > trigptscale_h;
00301   c.get< L1MuTriggerPtScaleRcd >().get( trigptscale_h );
00302   const L1MuTriggerPtScale* scalept = trigptscale_h.product();  
00303 
00304   // get hold of back-end interface
00305   DQMStore* dbe = 0;
00306   dbe = Service<DQMStore>().operator->();
00307 
00308   if ( dbe ) {
00309     dbe->setCurrentFolder("L1T/L1TGMT");
00310     dbe->rmdir("L1T/L1TGMT");
00311   }
00312 
00313 
00314   if ( dbe ) 
00315   {
00316     dbe->setCurrentFolder("L1T/L1TGMT");
00317     
00318     int nqty=8; double qtymin=-0.5; double qtymax=7.5;
00319 
00320     float phiscale[145];
00321     int nphiscale;
00322     {
00323       int nbins = scales->getPhiScale()->getNBins();
00324       if(nbins>144) nbins=144;
00325       for(int j=0; j<=nbins; j++) {
00326         phiscale[j] = piconv_ * scales->getPhiScale()->getValue(j);
00327       }
00328       nphiscale = nbins;
00329     }
00330 
00331     float qscale[9];
00332     {
00333       for(int j=0; j<9; j++) {
00334         qscale[j] = -0.5 + j;
00335       }
00336     } 
00337     
00338     // pt scale first bin reserved for empty muon
00339     float ptscale[32];
00340     int nptscale;
00341     {
00342       int nbins = scalept->getPtScale()->getNBins() - 1;
00343       if(nbins>31) nbins=31;
00344       for(int j=1; j<=nbins; j++) {
00345         ptscale[j-1] = scalept->getPtScale()->getValue(j);
00346       }
00347       ptscale[nbins]=ptscale[nbins-1]+10.; // make reasonable size last bin
00348       nptscale = nbins;
00349     }
00350       
00351     float etascale[5][66];
00352     int netascale[5];
00353     // DTTF eta scale
00354     {
00355       int nbins = scales->getRegionalEtaScale(DTTF)->getNBins();
00356       if(nbins>65) nbins = 65;
00357       for(int j=0; j<=nbins; j++) {
00358         etascale[DTTF][j] = scales->getRegionalEtaScale(DTTF)->getValue(j);
00359       }
00360       netascale[DTTF]=nbins;
00361     }
00362     // RPCb etascale
00363     {
00364       int nbins = scales->getRegionalEtaScale(RPCb)->getNBins();
00365       if(nbins>65) nbins = 65;
00366       for(int j=0; j<=nbins; j++) {
00367         etascale[RPCb][j] = scales->getRegionalEtaScale(RPCb)->getValue(j);
00368       }
00369       netascale[RPCb]=nbins;
00370     }
00371     // CSCTF etascale
00372     // special case - need to mirror 2*32 bins
00373     {
00374       int nbins = scales->getRegionalEtaScale(CSCTF)->getNBins();
00375       if(nbins>32) nbins = 32;
00376       
00377       int i=0;
00378       for(int j=nbins; j>=0; j--,i++) {
00379         etascale[CSCTF][i] = (-1) * scales->getRegionalEtaScale(CSCTF)->getValue(j);
00380       }
00381       for(int j=0; j<=nbins; j++,i++) {
00382         etascale[CSCTF][i] = scales->getRegionalEtaScale(CSCTF)->getValue(j);
00383       }
00384       netascale[CSCTF]=i-1;
00385     }
00386     // RPCf etascale
00387     {
00388       int nbins = scales->getRegionalEtaScale(RPCf)->getNBins();
00389       if(nbins>65) nbins = 65;
00390       for(int j=0; j<=nbins; j++) {
00391         etascale[RPCf][j] = scales->getRegionalEtaScale(RPCf)->getValue(j);
00392       }
00393       netascale[RPCf]=nbins;
00394     }
00395     // GMT etascale
00396     {
00397       int nbins = scales->getGMTEtaScale()->getNBins();
00398       if(nbins>32) nbins = 32;
00399       
00400       int i=0;
00401       for(int j=nbins; j>0; j--,i++) {
00402         etascale[GMT][i] = (-1) * scales->getGMTEtaScale()->getValue(j);
00403       }
00404       for(int j=0; j<=nbins; j++,i++) {
00405         etascale[GMT][i] = scales->getGMTEtaScale()->getValue(j);
00406       }
00407       netascale[GMT]=i-1;
00408     }
00409     
00410     
00411     std::string hname("");
00412     std::string htitle("");
00413     
00414     for(int i=0; i<5; i++) {
00415       
00416       hname = subs[i] + "_nbx"; htitle = subs[i] + " multiplicity in bx";
00417       subs_nbx[i] = dbe->book2D(hname.data(),htitle.data(), 4, 1., 5., 5, -2.5, 2.5);
00418       subs_nbx[i]->setAxisTitle(subs[i] + " candidates",1);
00419       subs_nbx[i]->setAxisTitle("bx wrt L1A",2);
00420       
00421       hname = subs[i] + "_eta"; htitle = subs[i] + " eta value";
00422       subs_eta[i] = dbe->book1D(hname.data(),htitle.data(), netascale[i], etascale[i]);
00423       subs_eta[i]->setAxisTitle("eta",1);
00424       
00425       hname = subs[i] + "_phi"; htitle = subs[i] + " phi value";
00426       subs_phi[i] = dbe->book1D(hname.data(),htitle.data(), nphiscale, phiscale);
00427       subs_phi[i]->setAxisTitle("phi (deg)",1);
00428       
00429       hname = subs[i] + "_pt"; htitle = subs[i] + " pt value";
00430       subs_pt[i]  = dbe->book1D(hname.data(),htitle.data(), nptscale, ptscale);
00431       subs_pt[i]->setAxisTitle("L1 pT (GeV)",1);
00432       
00433       hname = subs[i] + "_qty"; htitle = subs[i] + " qty value";
00434       subs_qty[i] = dbe->book1D(hname.data(),htitle.data(), nqty, qtymin, qtymax);
00435       subs_qty[i]->setAxisTitle(subs[i] + " quality",1);
00436       
00437       hname = subs[i] + "_etaphi"; htitle = subs[i] + " phi vs eta";
00438       subs_etaphi[i] = dbe->book2D(hname.data(),htitle.data(), netascale[i], etascale[i], nphiscale, phiscale);
00439       subs_etaphi[i]->setAxisTitle("eta",1);
00440       subs_etaphi[i]->setAxisTitle("phi (deg)",2);
00441       
00442       hname = subs[i] + "_etaqty"; htitle = subs[i] + " qty vs eta";
00443       subs_etaqty[i] = dbe->book2D(hname.data(),htitle.data(), netascale[i], etascale[i], nqty, qscale);
00444       subs_etaqty[i]->setAxisTitle("eta",1);
00445       subs_etaqty[i]->setAxisTitle(subs[i] + " quality",2);
00446       
00447       hname = subs[i] + "_bits"; htitle = subs[i] + " bit population";
00448       subs_bits[i] = dbe->book1D(hname.data(),htitle.data(), 32, -0.5, 31.5);
00449       subs_bits[i]->setAxisTitle("bit number",1);
00450     }
00451     
00452     regional_triggers = dbe->book1D("Regional_trigger","Muon trigger contribution", 27, 0., 27.);
00453     regional_triggers->setAxisTitle("regional trigger",1);
00454     int ib=1;
00455     regional_triggers->setBinLabel(ib++,"All muons",1);
00456     ib++;
00457     regional_triggers->setBinLabel(ib++,"DT 1mu",1);
00458     regional_triggers->setBinLabel(ib++,"DT 2mu",1);
00459     regional_triggers->setBinLabel(ib++,"DT 3mu",1);
00460     regional_triggers->setBinLabel(ib++,"DT 4mu",1);
00461     ib++;
00462     regional_triggers->setBinLabel(ib++,"RPCb 1mu",1);
00463     regional_triggers->setBinLabel(ib++,"RPCb 2mu",1);
00464     regional_triggers->setBinLabel(ib++,"RPCb 3mu",1);
00465     regional_triggers->setBinLabel(ib++,"RPCb 4mu",1);
00466     ib++;
00467     regional_triggers->setBinLabel(ib++,"CSC 1mu",1);
00468     regional_triggers->setBinLabel(ib++,"CSC 2mu",1);
00469     regional_triggers->setBinLabel(ib++,"CSC 3mu",1);
00470     regional_triggers->setBinLabel(ib++,"CSC 4mu",1);
00471     ib++;
00472     regional_triggers->setBinLabel(ib++,"RPCf 1mu",1);
00473     regional_triggers->setBinLabel(ib++,"RPCf 2mu",1);
00474     regional_triggers->setBinLabel(ib++,"RPCf 3mu",1);
00475     regional_triggers->setBinLabel(ib++,"RPCf 4mu",1);
00476     ib++;
00477     regional_triggers->setBinLabel(ib++,"DT & RPC",1);
00478     regional_triggers->setBinLabel(ib++,"DT & CSC",1);
00479     regional_triggers->setBinLabel(ib++,"CSC & RPC",1);
00480     regional_triggers->setBinLabel(ib++,"DT & CSC & RPC",1);
00481 
00482     
00483     bx_number = dbe->book1D("Bx_Number","Bx number ROP chip", 3564, 0., 3564.);
00484     bx_number->setAxisTitle("bx number",1);
00485     
00486     dbx_chip = dbe->bookProfile("dbx_Chip","bx count difference wrt ROP chip", 5, 0., 5.,100,-4000.,4000.,"i");
00487     dbx_chip->setAxisTitle("chip name",1);
00488     dbx_chip->setAxisTitle("delta bx",2);
00489     dbx_chip->setBinLabel(1,"IND",1);
00490     dbx_chip->setBinLabel(2,"INB",1);
00491     dbx_chip->setBinLabel(3,"INC",1);
00492     dbx_chip->setBinLabel(4,"INF",1);
00493     dbx_chip->setBinLabel(5,"SRT",1);
00494     
00495     eta_dtcsc_and_rpc = dbe->book1D("eta_DTCSC_and_RPC","eta of confirmed GMT candidates",
00496         netascale[GMT], etascale[GMT]);
00497     eta_dtcsc_and_rpc->setAxisTitle("eta",1);
00498     
00499     eta_dtcsc_only = dbe->book1D("eta_DTCSC_only","eta of unconfirmed DT/CSC candidates",
00500         netascale[GMT], etascale[GMT]);
00501     eta_dtcsc_only->setAxisTitle("eta",1);
00502     
00503     eta_rpc_only = dbe->book1D("eta_RPC_only","eta of unconfirmed RPC candidates",
00504         netascale[GMT], etascale[GMT]);
00505     eta_rpc_only->setAxisTitle("eta",1);
00506     
00507     phi_dtcsc_and_rpc = dbe->book1D("phi_DTCSC_and_RPC","phi of confirmed GMT candidates",
00508         nphiscale, phiscale);
00509     phi_dtcsc_and_rpc->setAxisTitle("phi (deg)",1);
00510     
00511     phi_dtcsc_only = dbe->book1D("phi_DTCSC_only","phi of unconfirmed DT/CSC candidates",
00512         nphiscale, phiscale);
00513     phi_dtcsc_only->setAxisTitle("phi (deg)",1);
00514     
00515     phi_rpc_only = dbe->book1D("phi_RPC_only","phi of unconfirmed RPC candidates",
00516         nphiscale, phiscale);
00517     phi_rpc_only->setAxisTitle("phi (deg)",1);
00518     
00519     etaphi_dtcsc_and_rpc = dbe->book2D("etaphi_DTCSC_and_RPC","eta vs phi map of confirmed GMT candidates",
00520         netascale[GMT], etascale[GMT], nphiscale, phiscale);
00521     etaphi_dtcsc_and_rpc->setAxisTitle("eta",1);
00522     etaphi_dtcsc_and_rpc->setAxisTitle("phi (deg)",2);
00523     
00524     etaphi_dtcsc_only = dbe->book2D("etaphi_DTCSC_only","eta vs phi map of unconfirmed DT/CSC candidates",
00525         netascale[GMT], etascale[GMT], nphiscale, phiscale);
00526     etaphi_dtcsc_only->setAxisTitle("eta",1);
00527     etaphi_dtcsc_only->setAxisTitle("phi (deg)",2);
00528     
00529     etaphi_rpc_only = dbe->book2D("etaphi_RPC_only","eta vs phi map of unconfirmed RPC candidates",
00530         netascale[GMT], etascale[GMT], nphiscale, phiscale);
00531     etaphi_rpc_only->setAxisTitle("eta",1);
00532     etaphi_rpc_only->setAxisTitle("phi (deg)",2);
00533     
00534     
00535     dist_phi_dt_rpc = dbe->book1D("dist_phi_DT_RPC","Dphi between DT and RPC candidates", 100, -125., 125.);
00536     dist_phi_dt_rpc->setAxisTitle("delta phi (deg)",1);
00537 
00538     dist_phi_csc_rpc = dbe->book1D("dist_phi_CSC_RPC","Dphi between CSC and RPC candidates", 100, -125., 125.);
00539     dist_phi_csc_rpc->setAxisTitle("delta phi (deg)",1);
00540 
00541     dist_phi_dt_csc = dbe->book1D("dist_phi_DT_CSC","Dphi between DT and CSC candidates", 100, -125., 125.);
00542     dist_phi_dt_csc->setAxisTitle("delta phi (deg)",1);
00543        
00544 
00545     dist_eta_dt_rpc = dbe->book1D("dist_eta_DT_RPC","Deta between DT and RPC candidates", 40, -1., 1.);
00546     dist_eta_dt_rpc->setAxisTitle("delta eta",1);
00547 
00548     dist_eta_csc_rpc = dbe->book1D("dist_eta_CSC_RPC","Deta between CSC and RPC candidates", 40, -1., 1.);
00549     dist_eta_csc_rpc->setAxisTitle("delta eta",1);
00550 
00551     dist_eta_dt_csc = dbe->book1D("dist_eta_DT_CSC","Deta between DT and CSC candidates", 40, -1., 1.);
00552     dist_eta_dt_csc->setAxisTitle("delta eta",1);
00553 
00554        
00555     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);
00556     n_rpcb_vs_dttf->setAxisTitle("DTTF candidates",1);
00557     n_rpcb_vs_dttf->setAxisTitle("barrel RPC candidates",2);
00558     
00559     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);
00560     n_rpcf_vs_csctf->setAxisTitle("CSCTF candidates",1);
00561     n_rpcf_vs_csctf->setAxisTitle("endcap RPC candidates",2);
00562     
00563     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);
00564     n_csctf_vs_dttf->setAxisTitle("DTTF candidates",1);
00565     n_csctf_vs_dttf->setAxisTitle("CSCTF candidates",2);
00566     
00567     bx_dt_rpc  = dbe->book2D("bx_DT_vs_RPC",  "1st bx DT vs. RPC",  5, -2.5, 2.5, 5, -2.5, 2.5);
00568     bx_dt_rpc->setAxisTitle("bx of 1st DTTF candidate",1);
00569     bx_dt_rpc->setAxisTitle("bx of 1st RPCb candidate",2);
00570     
00571     bx_csc_rpc  = dbe->book2D("bx_CSC_vs_RPC",  "1st bx CSC vs. RPC",  5, -2.5, 2.5, 5, -2.5, 2.5);
00572     bx_csc_rpc->setAxisTitle("bx of 1st CSCTF candidate",1);
00573     bx_csc_rpc->setAxisTitle("bx of 1st RPCf candidate",2);
00574     
00575     bx_dt_csc  = dbe->book2D("bx_DT_vs_CSC",  "1st bx DT vs. CSC",  5, -2.5, 2.5, 5, -2.5, 2.5);
00576     bx_dt_csc->setAxisTitle("bx of 1st DTTF candidate",1);
00577     bx_dt_csc->setAxisTitle("bx of 1st CSCTF candidate",2);
00578     
00579     
00580     for(int i=0; i<4; i++) {
00581       hname = subs[i] + "_dbx"; htitle = "dBx " + subs[i] + " to previous event";
00582       subs_dbx[i] = dbe->book2D(hname.data(),htitle.data(), 1000, 0., 1000., 4, 0., 4.);
00583       for(int j=0; j<4; j++) {
00584         subs_dbx[i]->setBinLabel((j+1),subs[j].data(),2);
00585       }
00586     }        
00587   }  
00588 }
00589 
00590