CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1ExtraTestAnalyzer Class Reference

Inheritance diagram for L1ExtraTestAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 L1ExtraTestAnalyzer (const edm::ParameterSet &)
 ~L1ExtraTestAnalyzer ()

Private Attributes

edm::InputTag cenJetSource_
edm::InputTag etMissSource_
TFile file_
edm::InputTag forJetSource_
edm::InputTag gtReadoutSource_
edm::InputTag hfRingsSource_
TH1F hist_
edm::InputTag htMissSource_
edm::InputTag isoEmSource_
edm::InputTag muonSource_
edm::InputTag nonIsoEmSource_
edm::InputTag particleMapSource_
edm::InputTag tauJetSource_

Detailed Description

L1TriggerOffline/L1ExtraTestAnalyzer/src/L1ExtraTestAnalyzer.cc

Author:
Werner Sun

Description: simple analyzer to print out L1Extra object information.

Definition at line 54 of file L1ExtraTestAnalyzer.cc.


Constructor & Destructor Documentation

L1ExtraTestAnalyzer::L1ExtraTestAnalyzer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 91 of file L1ExtraTestAnalyzer.cc.

   : isoEmSource_( iConfig.getParameter< edm::InputTag >(
      "isolatedEmSource" ) ),
     nonIsoEmSource_( iConfig.getParameter< edm::InputTag >(
      "nonIsolatedEmSource" ) ),
     cenJetSource_( iConfig.getParameter< edm::InputTag >(
      "centralJetSource" ) ),
     forJetSource_( iConfig.getParameter< edm::InputTag >(
      "forwardJetSource" ) ),
     tauJetSource_( iConfig.getParameter< edm::InputTag >(
      "tauJetSource" ) ),
     muonSource_( iConfig.getParameter< edm::InputTag >(
      "muonSource" ) ),
     etMissSource_( iConfig.getParameter< edm::InputTag >(
      "etMissSource" ) ),
     htMissSource_( iConfig.getParameter< edm::InputTag >(
      "htMissSource" ) ),
     hfRingsSource_( iConfig.getParameter< edm::InputTag >(
      "hfRingsSource" ) ),
     gtReadoutSource_( iConfig.getParameter< edm::InputTag >(
      "gtReadoutSource" ) ),
     particleMapSource_( iConfig.getParameter< edm::InputTag >(
      "particleMapSource" ) ),
     file_( "l1extra.root", "RECREATE" ),
     hist_( "triggers", "Triggers",
            2*l1extra::L1ParticleMap::kNumOfL1TriggerTypes + 1,
            -0.75,
            l1extra::L1ParticleMap::kNumOfL1TriggerTypes + 0.5 - 0.75 )
{
   //now do what ever initialization is needed

}
L1ExtraTestAnalyzer::~L1ExtraTestAnalyzer ( )

Definition at line 125 of file L1ExtraTestAnalyzer.cc.

References file_, and hist_.

{
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

   file_.cd() ;
   hist_.Write() ;
}

Member Function Documentation

void L1ExtraTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 141 of file L1ExtraTestAnalyzer.cc.

References cenJetSource_, gather_cfg::cout, etMissSource_, forJetSource_, edm::Event::getByLabel(), hfRingsSource_, htMissSource_, i, isoEmSource_, muonSource_, nonIsoEmSource_, and tauJetSource_.

{
   using namespace edm ;
   using namespace l1extra ;

   static int iev = 0 ;
   cout << "EVENT " << ++iev << endl ;

   cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;

   // Isolated EM particles
   Handle< L1EmParticleCollection > isoEmColl ;
   iEvent.getByLabel( isoEmSource_, isoEmColl ) ;
   cout << "Number of isolated EM " << isoEmColl->size() << endl ;

   for( L1EmParticleCollection::const_iterator emItr = isoEmColl->begin() ;
        emItr != isoEmColl->end() ;
        ++emItr )
   {
      cout << "  p4 (" << emItr->px()
           << ", " << emItr->py()
           << ", " << emItr->pz()
           << ", " << emItr->energy()
           << ") et " << emItr->et()
           << " eta " << emItr->eta()
           << " phi " << emItr->phi()
           << endl ;
   }

   // Non-isolated EM particles
   Handle< L1EmParticleCollection > nonIsoEmColl ;
   iEvent.getByLabel( nonIsoEmSource_, nonIsoEmColl ) ;
   cout << "Number of non-isolated EM " << nonIsoEmColl->size() << endl ;

   for( L1EmParticleCollection::const_iterator emItr = nonIsoEmColl->begin() ;
        emItr != nonIsoEmColl->end() ;
        ++emItr )
   {
      cout << "  p4 (" << emItr->px()
           << ", " << emItr->py()
           << ", " << emItr->pz()
           << ", " << emItr->energy()
           << ") et " << emItr->et()
           << " eta " << emItr->eta()
           << " phi " << emItr->phi()
           << endl ;
   }

   // Jet particles
   Handle< L1JetParticleCollection > cenJetColl ;
   iEvent.getByLabel( cenJetSource_, cenJetColl ) ;
   cout << "Number of central jets " << cenJetColl->size() << endl ;

   for( L1JetParticleCollection::const_iterator jetItr = cenJetColl->begin() ;
        jetItr != cenJetColl->end() ;
        ++jetItr )
   {
      cout << "  p4 (" << jetItr->px()
           << ", " << jetItr->py()
           << ", " << jetItr->pz()
           << ", " << jetItr->energy()
           << ") et " << jetItr->et()
           << " eta " << jetItr->eta()
           << " phi " << jetItr->phi()
           << endl ;
   }

   Handle< L1JetParticleCollection > forJetColl ;
   iEvent.getByLabel( forJetSource_, forJetColl ) ;
   cout << "Number of forward jets " << forJetColl->size() << endl ;

   for( L1JetParticleCollection::const_iterator jetItr = forJetColl->begin() ;
        jetItr != forJetColl->end() ;
        ++jetItr )
   {
      cout << "  p4 (" << jetItr->px()
           << ", " << jetItr->py()
           << ", " << jetItr->pz()
           << ", " << jetItr->energy()
           << ") et " << jetItr->et()
           << " eta " << jetItr->eta()
           << " phi " << jetItr->phi()
           << endl ;
   }

   Handle< L1JetParticleCollection > tauColl ;
   iEvent.getByLabel( tauJetSource_, tauColl ) ;
   cout << "Number of tau jets " << tauColl->size() << endl ;

   for( L1JetParticleCollection::const_iterator tauItr = tauColl->begin() ;
        tauItr != tauColl->end() ;
        ++tauItr )
   {
      cout << "  p4 (" << tauItr->px()
           << ", " << tauItr->py()
           << ", " << tauItr->pz()
           << ", " << tauItr->energy()
           << ") et " << tauItr->et()
           << " eta " << tauItr->eta()
           << " phi " << tauItr->phi()
           << endl ;
   }

   // Muon particles
   Handle< L1MuonParticleCollection > muColl ;
   iEvent.getByLabel( muonSource_, muColl ) ;
   cout << "Number of muons " << muColl->size() << endl ;

   for( L1MuonParticleCollection::const_iterator muItr = muColl->begin() ;
        muItr != muColl->end() ;
        ++muItr )
   {
      cout << "  q " << muItr->charge()
           << " p4 (" << muItr->px()
           << ", " << muItr->py()
           << ", " << muItr->pz()
           << ", " << muItr->energy()
           << ") et " << muItr->et()
           << " eta " << muItr->eta() << endl
           << "    phi " << muItr->phi()
           << " iso " << muItr->isIsolated()
           << " mip " << muItr->isMip()
           << " fwd " << muItr->isForward()
           << " rpc " << muItr->isRPC()
           << endl ;
   }

   // MET
   Handle< L1EtMissParticleCollection > etMissColl ;
   iEvent.getByLabel( etMissSource_, etMissColl ) ;
   cout << "MET Coll (" << etMissColl->begin()->px()
        << ", " << etMissColl->begin()->py()
        << ", " << etMissColl->begin()->pz()
        << ", " << etMissColl->begin()->energy()
        << ") phi " << etMissColl->begin()->phi()
        << " EtTot " << etMissColl->begin()->etTotal()
        << endl ;

   // MHT
   Handle< L1EtMissParticleCollection > htMissColl ;
   iEvent.getByLabel( htMissSource_, htMissColl ) ;
   cout << "MHT Coll (" << htMissColl->begin()->px()
        << ", " << htMissColl->begin()->py()
        << ", " << htMissColl->begin()->pz()
        << ", " << htMissColl->begin()->energy()
        << ") phi " << htMissColl->begin()->phi()
        << " HtTot " << htMissColl->begin()->etTotal()
        << endl ;

   // HF Rings
   Handle< L1HFRingsCollection > hfRingsColl ;
   iEvent.getByLabel( hfRingsSource_, hfRingsColl ) ;
   cout << "HF Rings:" << endl ;
   for( int i = 0 ; i < L1HFRings::kNumRings ; ++i )
     {
       cout << "  " << i << ": et sum = "
            << hfRingsColl->begin()->hfEtSum( (L1HFRings::HFRingLabels) i )
            << ", bit count = "
            << hfRingsColl->begin()->hfBitCount( (L1HFRings::HFRingLabels) i )
            << endl ;
     }
   cout << endl ;

//    // L1GlobalTriggerReadoutRecord
//    Handle< L1GlobalTriggerReadoutRecord > gtRecord ;
//    iEvent.getByLabel( gtReadoutSource_, gtRecord ) ;
//    cout << "Global trigger decision " << gtRecord->decision() << endl ;

   cout << endl ;
}

Member Data Documentation

Definition at line 66 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 70 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

TFile L1ExtraTestAnalyzer::file_ [private]

Definition at line 76 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

Definition at line 67 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 73 of file L1ExtraTestAnalyzer.cc.

Definition at line 72 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 77 of file L1ExtraTestAnalyzer.cc.

Referenced by ~L1ExtraTestAnalyzer().

Definition at line 71 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 64 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 69 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 65 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().

Definition at line 74 of file L1ExtraTestAnalyzer.cc.

Definition at line 68 of file L1ExtraTestAnalyzer.cc.

Referenced by analyze().