00001
00002
00003
00004
00005
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <memory>
00020 #include <string>
00021
00022
00023 #include "FWCore/Framework/interface/Frameworkfwd.h"
00024 #include "FWCore/Framework/interface/EDAnalyzer.h"
00025
00026 #include "FWCore/Framework/interface/Event.h"
00027 #include "FWCore/Framework/interface/MakerMacros.h"
00028
00029 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00030 #include "FWCore/ParameterSet/interface/InputTag.h"
00031
00032 #include "DataFormats/Common/interface/Handle.h"
00033 #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
00034 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
00035 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
00036 #include "DataFormats/L1Trigger/interface/L1EtMissParticle.h"
00037 #include "DataFormats/L1Trigger/interface/L1ParticleMap.h"
00038 #include "DataFormats/L1Trigger/interface/L1ParticleMapFwd.h"
00039 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
00040
00041 #include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h"
00042
00043 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00044
00045 #include "TH1.h"
00046 #include "TFile.h"
00047
00048 using namespace std ;
00049
00050
00051
00052
00053
00054 class L1ExtraTestAnalyzer : public edm::EDAnalyzer {
00055 public:
00056 explicit L1ExtraTestAnalyzer(const edm::ParameterSet&);
00057 ~L1ExtraTestAnalyzer();
00058
00059
00060 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00061 private:
00062
00063
00064 edm::InputTag isoEmSource_ ;
00065 edm::InputTag nonIsoEmSource_ ;
00066 edm::InputTag cenJetSource_ ;
00067 edm::InputTag forJetSource_ ;
00068 edm::InputTag tauJetSource_ ;
00069 edm::InputTag muonSource_ ;
00070 edm::InputTag etMissSource_ ;
00071 edm::InputTag gtReadoutSource_ ;
00072 edm::InputTag particleMapSource_ ;
00073
00074 TFile file_ ;
00075 TH1F hist_ ;
00076 };
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 L1ExtraTestAnalyzer::L1ExtraTestAnalyzer(const edm::ParameterSet& iConfig)
00090 : isoEmSource_( iConfig.getParameter< edm::InputTag >(
00091 "isolatedEmSource" ) ),
00092 nonIsoEmSource_( iConfig.getParameter< edm::InputTag >(
00093 "nonIsolatedEmSource" ) ),
00094 cenJetSource_( iConfig.getParameter< edm::InputTag >(
00095 "centralJetSource" ) ),
00096 forJetSource_( iConfig.getParameter< edm::InputTag >(
00097 "forwardJetSource" ) ),
00098 tauJetSource_( iConfig.getParameter< edm::InputTag >(
00099 "tauJetSource" ) ),
00100 muonSource_( iConfig.getParameter< edm::InputTag >(
00101 "muonSource" ) ),
00102 etMissSource_( iConfig.getParameter< edm::InputTag >(
00103 "etMissSource" ) ),
00104 gtReadoutSource_( iConfig.getParameter< edm::InputTag >(
00105 "gtReadoutSource" ) ),
00106 particleMapSource_( iConfig.getParameter< edm::InputTag >(
00107 "particleMapSource" ) ),
00108 file_( "l1extra.root", "RECREATE" ),
00109 hist_( "triggers", "Triggers",
00110 2*l1extra::L1ParticleMap::kNumOfL1TriggerTypes + 1,
00111 -0.75,
00112 l1extra::L1ParticleMap::kNumOfL1TriggerTypes + 0.5 - 0.75 )
00113 {
00114
00115
00116 }
00117
00118
00119 L1ExtraTestAnalyzer::~L1ExtraTestAnalyzer()
00120 {
00121
00122
00123
00124 file_.cd() ;
00125 hist_.Write() ;
00126 }
00127
00128
00129
00130
00131
00132
00133
00134 void
00135 L1ExtraTestAnalyzer::analyze(const edm::Event& iEvent,
00136 const edm::EventSetup& iSetup)
00137 {
00138 using namespace edm ;
00139 using namespace l1extra ;
00140
00141 static int iev = 0 ;
00142 cout << "EVENT " << ++iev << endl ;
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;
00166
00167
00168 Handle< L1EmParticleCollection > isoEmColl ;
00169 iEvent.getByLabel( isoEmSource_, isoEmColl ) ;
00170 cout << "Number of isolated EM " << isoEmColl->size() << endl ;
00171
00172 for( L1EmParticleCollection::const_iterator emItr = isoEmColl->begin() ;
00173 emItr != isoEmColl->end() ;
00174 ++emItr )
00175 {
00176 cout << " p4 (" << emItr->px()
00177 << ", " << emItr->py()
00178 << ", " << emItr->pz()
00179 << ", " << emItr->energy()
00180 << ") et " << emItr->et()
00181 << " eta " << emItr->eta()
00182 << " phi " << emItr->phi()
00183 << endl ;
00184 }
00185
00186
00187 Handle< L1EmParticleCollection > nonIsoEmColl ;
00188 iEvent.getByLabel( nonIsoEmSource_, nonIsoEmColl ) ;
00189 cout << "Number of non-isolated EM " << nonIsoEmColl->size() << endl ;
00190
00191 for( L1EmParticleCollection::const_iterator emItr = nonIsoEmColl->begin() ;
00192 emItr != nonIsoEmColl->end() ;
00193 ++emItr )
00194 {
00195 cout << " p4 (" << emItr->px()
00196 << ", " << emItr->py()
00197 << ", " << emItr->pz()
00198 << ", " << emItr->energy()
00199 << ") et " << emItr->et()
00200 << " eta " << emItr->eta()
00201 << " phi " << emItr->phi()
00202 << endl ;
00203 }
00204
00205
00206 Handle< L1JetParticleCollection > cenJetColl ;
00207 iEvent.getByLabel( cenJetSource_, cenJetColl ) ;
00208 cout << "Number of central jets " << cenJetColl->size() << endl ;
00209
00210 for( L1JetParticleCollection::const_iterator jetItr = cenJetColl->begin() ;
00211 jetItr != cenJetColl->end() ;
00212 ++jetItr )
00213 {
00214 cout << " p4 (" << jetItr->px()
00215 << ", " << jetItr->py()
00216 << ", " << jetItr->pz()
00217 << ", " << jetItr->energy()
00218 << ") et " << jetItr->et()
00219 << " eta " << jetItr->eta()
00220 << " phi " << jetItr->phi()
00221 << endl ;
00222 }
00223
00224 Handle< L1JetParticleCollection > forJetColl ;
00225 iEvent.getByLabel( forJetSource_, forJetColl ) ;
00226 cout << "Number of forward jets " << forJetColl->size() << endl ;
00227
00228 for( L1JetParticleCollection::const_iterator jetItr = forJetColl->begin() ;
00229 jetItr != forJetColl->end() ;
00230 ++jetItr )
00231 {
00232 cout << " p4 (" << jetItr->px()
00233 << ", " << jetItr->py()
00234 << ", " << jetItr->pz()
00235 << ", " << jetItr->energy()
00236 << ") et " << jetItr->et()
00237 << " eta " << jetItr->eta()
00238 << " phi " << jetItr->phi()
00239 << endl ;
00240 }
00241
00242 Handle< L1JetParticleCollection > tauColl ;
00243 iEvent.getByLabel( tauJetSource_, tauColl ) ;
00244 cout << "Number of tau jets " << tauColl->size() << endl ;
00245
00246 for( L1JetParticleCollection::const_iterator tauItr = tauColl->begin() ;
00247 tauItr != tauColl->end() ;
00248 ++tauItr )
00249 {
00250 cout << " p4 (" << tauItr->px()
00251 << ", " << tauItr->py()
00252 << ", " << tauItr->pz()
00253 << ", " << tauItr->energy()
00254 << ") et " << tauItr->et()
00255 << " eta " << tauItr->eta()
00256 << " phi " << tauItr->phi()
00257 << endl ;
00258 }
00259
00260
00261 Handle< L1MuonParticleCollection > muColl ;
00262 iEvent.getByLabel( muonSource_, muColl ) ;
00263 cout << "Number of muons " << muColl->size() << endl ;
00264
00265 for( L1MuonParticleCollection::const_iterator muItr = muColl->begin() ;
00266 muItr != muColl->end() ;
00267 ++muItr )
00268 {
00269 cout << " q " << muItr->charge()
00270 << " p4 (" << muItr->px()
00271 << ", " << muItr->py()
00272 << ", " << muItr->pz()
00273 << ", " << muItr->energy()
00274 << ") et " << muItr->et()
00275 << " eta " << muItr->eta() << endl
00276 << " phi " << muItr->phi()
00277 << " iso " << muItr->isIsolated()
00278 << " mip " << muItr->isMip()
00279 << " fwd " << muItr->isForward()
00280 << " rpc " << muItr->isRPC()
00281 << endl ;
00282 }
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296 Handle< L1EtMissParticleCollection > etMissColl ;
00297 iEvent.getByLabel( etMissSource_, etMissColl ) ;
00298 cout << "MET Coll (" << etMissColl->begin()->px()
00299 << ", " << etMissColl->begin()->py()
00300 << ", " << etMissColl->begin()->pz()
00301 << ", " << etMissColl->begin()->energy()
00302 << ") phi " << etMissColl->begin()->phi()
00303 << " EtTot " << etMissColl->begin()->etTotal()
00304 << " EtHad " << etMissColl->begin()->etHad()
00305 << endl ;
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 cout << endl ;
00385 }
00386
00387
00388 DEFINE_FWK_MODULE(L1ExtraTestAnalyzer);