00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "DQM/L1TMonitor/interface/L1TRCT.h"
00011 #include "DataFormats/Provenance/interface/EventAuxiliary.h"
00012
00013
00014 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
00015 #include "DQMServices/Core/interface/DQMStore.h"
00016
00017
00018
00019
00020 using namespace edm;
00021
00022 const unsigned int PHIBINS = 18;
00023 const float PHIMIN = -0.5;
00024 const float PHIMAX = 17.5;
00025
00026
00027 const unsigned int R6BINS = 64;
00028 const float R6MIN = -0.5;
00029 const float R6MAX = 63.5;
00030 const unsigned int R10BINS = 1024;
00031 const float R10MIN = -0.5;
00032 const float R10MAX = 1023.5;
00033 const unsigned int R12BINS = 4096;
00034 const float R12MIN = -0.5;
00035 const float R12MAX = 4095.5;
00036
00037 const unsigned int ETABINS = 22;
00038 const float ETAMIN = -0.5;
00039 const float ETAMAX = 21.5;
00040
00041
00042
00043 L1TRCT::L1TRCT(const ParameterSet & ps) :
00044 rctSource_( ps.getParameter< InputTag >("rctSource") ),
00045 filterTriggerType_ (ps.getParameter< int >("filterTriggerType"))
00046 {
00047
00048
00049 verbose_ = ps.getUntrackedParameter < bool > ("verbose", false);
00050
00051 if (verbose_)
00052 std::cout << "L1TRCT: constructor...." << std::endl;
00053
00054
00055 dbe = NULL;
00056 if (ps.getUntrackedParameter < bool > ("DQMStore", false)) {
00057 dbe = Service < DQMStore > ().operator->();
00058 dbe->setVerbose(0);
00059 }
00060
00061 outputFile_ =
00062 ps.getUntrackedParameter < std::string > ("outputFile", "");
00063 if (outputFile_.size() != 0) {
00064 std::
00065 cout << "L1T Monitoring histograms will be saved to " <<
00066 outputFile_.c_str() << std::endl;
00067 }
00068
00069 bool disable =
00070 ps.getUntrackedParameter < bool > ("disableROOToutput", false);
00071 if (disable) {
00072 outputFile_ = "";
00073 }
00074
00075
00076 if (dbe != NULL) {
00077 dbe->setCurrentFolder("L1T/L1TRCT");
00078 }
00079
00080
00081 }
00082
00083 L1TRCT::~L1TRCT()
00084 {
00085 }
00086
00087 void L1TRCT::beginJob(void)
00088 {
00089
00090
00091 nev_ = 0;
00092
00093
00094 DQMStore *dbe = 0;
00095 dbe = Service < DQMStore > ().operator->();
00096
00097 if (dbe) {
00098 dbe->setCurrentFolder("L1T/L1TRCT");
00099 dbe->rmdir("L1T/L1TRCT");
00100 }
00101
00102
00103 if (dbe) {
00104 dbe->setCurrentFolder("L1T/L1TRCT");
00105
00106 triggerType_ =
00107 dbe->book1D("TriggerType", "TriggerType", 17, -0.5, 16.5);
00108
00109 rctIsoEmEtEtaPhi_ =
00110 dbe->book2D("RctEmIsoEmEtEtaPhi", "ISO EM E_{T}", ETABINS, ETAMIN,
00111 ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00112 rctIsoEmOccEtaPhi_ =
00113 dbe->book2D("RctEmIsoEmOccEtaPhi", "ISO EM OCCUPANCY", ETABINS,
00114 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00115 rctNonIsoEmEtEtaPhi_ =
00116 dbe->book2D("RctEmNonIsoEmEtEtaPhi", "NON-ISO EM E_{T}", ETABINS,
00117 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00118 rctNonIsoEmOccEtaPhi_ =
00119 dbe->book2D("RctEmNonIsoEmOccEtaPhi", "NON-ISO EM OCCUPANCY",
00120 ETABINS, ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00121
00122
00123 rctRegionsEtEtaPhi_ =
00124 dbe->book2D("RctRegionsEtEtaPhi", "REGION E_{T}", ETABINS, ETAMIN,
00125 ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00126 rctRegionsOccEtaPhi_ =
00127 dbe->book2D("RctRegionsOccEtaPhi", "REGION OCCUPANCY", ETABINS,
00128 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00129
00130 rctOverFlowEtaPhi_ =
00131 dbe->book2D("RctBitOverFlowEtaPhi", "OVER FLOW OCCUPANCY", ETABINS,
00132 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00133
00134 rctTauVetoEtaPhi_ =
00135 dbe->book2D("RctBitTauVetoEtaPhi", "TAU VETO OCCUPANCY", ETABINS,
00136 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00137
00138 rctMipEtaPhi_ =
00139 dbe->book2D("RctBitMipEtaPhi", "MIP OCCUPANCY", ETABINS,
00140 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00141
00142 rctQuietEtaPhi_ =
00143 dbe->book2D("RctBitQuietEtaPhi", "QUIET OCCUPANCY", ETABINS,
00144 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00145
00146 rctHfPlusTauEtaPhi_ =
00147 dbe->book2D("RctBitHfPlusTauEtaPhi", "HF plus Tau OCCUPANCY", ETABINS,
00148 ETAMIN, ETAMAX, PHIBINS, PHIMIN, PHIMAX);
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172 rctRegionRank_ =
00173 dbe->book1D("RctRegionRank", "REGION RANK", R10BINS, R10MIN,
00174 R10MAX);
00175 rctIsoEmRank_ =
00176 dbe->book1D("RctEmIsoEmRank", "ISO EM RANK", R6BINS, R6MIN, R6MAX);
00177 rctNonIsoEmRank_ =
00178 dbe->book1D("RctEmNonIsoEmRank", "NON-ISO EM RANK", R6BINS, R6MIN,
00179 R6MAX);
00180
00181
00182
00183
00184
00185 rctRegionBx_ = dbe->book1D("RctRegionBx", "Region BX", 256, -0.5, 4095.5);
00186 rctEmBx_ = dbe->book1D("RctEmBx", "EM BX", 256, -0.5, 4095.5);
00187
00188
00189
00190 }
00191 }
00192
00193
00194 void L1TRCT::endJob(void)
00195 {
00196 if (verbose_)
00197 std::cout << "L1TRCT: end job...." << std::endl;
00198 LogInfo("EndJob") << "analyzed " << nev_ << " events";
00199
00200 if (outputFile_.size() != 0 && dbe)
00201 dbe->save(outputFile_);
00202
00203 return;
00204 }
00205
00206 void L1TRCT::analyze(const Event & e, const EventSetup & c)
00207 {
00208 nev_++;
00209 if (verbose_) {
00210 std::cout << "L1TRCT: analyze...." << std::endl;
00211 }
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226 double triggerType = static_cast<double> (e.experimentType()) + 0.001;
00227 double triggerTypeLast = static_cast<double> (edm::EventAuxiliary::ExperimentType::ErrorTrigger)
00228 + 0.001;
00229 triggerType_->Fill(triggerType);
00230 triggerType_->Fill(triggerTypeLast + 1);
00231
00232
00233 if (filterTriggerType_ >= 0) {
00234
00235
00236 if (e.isRealData()) {
00237 if (!(e.experimentType() == filterTriggerType_)) {
00238
00239 edm::LogInfo("L1TRCT") << "\n Event of TriggerType "
00240 << e.experimentType() << " rejected" << std::endl;
00241 return;
00242
00243 }
00244 }
00245
00246 }
00247
00248
00249 edm::Handle < L1CaloEmCollection > em;
00250 edm::Handle < L1CaloRegionCollection > rgn;
00251
00252 bool doEm = true;
00253 bool doHd = true;
00254
00255 e.getByLabel(rctSource_,rgn);
00256
00257 if (!rgn.isValid()) {
00258 edm::LogInfo("DataNotFound") << "can't find L1CaloRegionCollection with label "
00259 << rctSource_.label() ;
00260 doHd = false;
00261 }
00262
00263 if ( doHd ) {
00264
00265
00266
00267 for (L1CaloRegionCollection::const_iterator ireg = rgn->begin();
00268 ireg != rgn->end(); ireg++) {
00269 if(ireg->et()>0)
00270 {
00271 rctRegionRank_->Fill(ireg->et());
00272 if(ireg->et()>5){
00273 rctRegionsOccEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
00274 }
00275 rctRegionsEtEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi(), ireg->et());
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285 rctRegionBx_->Fill(ireg->bx());
00286 }
00287
00288 if(ireg->overFlow()) rctOverFlowEtaPhi_ ->Fill(ireg->gctEta(), ireg->gctPhi());
00289 if(ireg->tauVeto()) rctTauVetoEtaPhi_ ->Fill(ireg->gctEta(), ireg->gctPhi());
00290 if(ireg->mip()) rctMipEtaPhi_ ->Fill(ireg->gctEta(), ireg->gctPhi());
00291 if(ireg->quiet()) rctQuietEtaPhi_ ->Fill(ireg->gctEta(), ireg->gctPhi());
00292 if(ireg->fineGrain()) rctHfPlusTauEtaPhi_->Fill(ireg->gctEta(), ireg->gctPhi());
00293
00294 }
00295 }
00296
00297
00298 e.getByLabel(rctSource_,em);
00299
00300 if (!em.isValid()) {
00301 edm::LogInfo("DataNotFound") << "can't find L1CaloEmCollection with label "
00302 << rctSource_.label() ;
00303 doEm = false;
00304 }
00305 if ( ! doEm ) return;
00306
00307 for (L1CaloEmCollection::const_iterator iem = em->begin();
00308 iem != em->end(); iem++) {
00309
00310
00311
00312 if (iem->isolated()) {
00313 if(iem->rank()>0)
00314 {
00315 rctIsoEmRank_->Fill(iem->rank());
00316 rctIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(),
00317 iem->regionId().iphi(), iem->rank());
00318 if(iem->rank()>10){
00319 rctIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(),
00320 iem->regionId().iphi());
00321 }
00322 rctEmBx_->Fill(iem->bx());
00323 }
00324 }
00325 else {
00326 if(iem->rank()>0)
00327 {
00328 rctNonIsoEmRank_->Fill(iem->rank());
00329 rctNonIsoEmEtEtaPhi_->Fill(iem->regionId().ieta(),
00330 iem->regionId().iphi(), iem->rank());
00331 if(iem->rank()>10){
00332 rctNonIsoEmOccEtaPhi_->Fill(iem->regionId().ieta(),
00333 iem->regionId().iphi());
00334 }
00335 rctEmBx_->Fill(iem->bx());
00336 }
00337 }
00338
00339 }
00340
00341 }