CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

TTbar_GenLepAnalyzer Class Reference

#include <TTbar_GenLepAnalyzer.h>

Inheritance diagram for TTbar_GenLepAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

 TTbar_GenLepAnalyzer (const edm::ParameterSet &)
 ~TTbar_GenLepAnalyzer ()

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
virtual void endJob ()
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
virtual void endRun (edm::Run const &, edm::EventSetup const &)

Private Attributes

DQMStoredbe
 ME's "container".
bool do_e_
bool do_mu_
bool do_nu_e_
bool do_nu_mu_
bool do_nu_tau_
bool do_tau_
double eta_cut_
std::map< std::string,
MonitorElement * > 
hists_
edm::InputTag leps_
int pdgid
double pt_cut_

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 55 of file TTbar_GenLepAnalyzer.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file TTbar_GenLepAnalyzer.cc.

References dbe, and cppFunctionSkipper::operator.

                                                                        :
  leps_(iConfig.getParameter<edm::InputTag>("leptons"))
{
   //now do what ever initialization is needed
  dbe = 0;
  dbe = edm::Service<DQMStore>().operator->();

}
TTbar_GenLepAnalyzer::~TTbar_GenLepAnalyzer ( )

Definition at line 16 of file TTbar_GenLepAnalyzer.cc.

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

}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 31 of file TTbar_GenLepAnalyzer.cc.

References edm::Event::getByLabel(), hists_, edm::HandleBase::isValid(), and leps_.

{

  // Handle to the Leptons collections
  edm::Handle< edm::View<reco::Candidate> > leps;
  iEvent.getByLabel(leps_, leps);
  if(!leps.isValid()) return;

  // loop Jet collection and fill histograms
  int nleps = 0;
  for(edm::View<reco::Candidate>::const_iterator lep_it=leps->begin(); lep_it!=leps->end(); ++lep_it){

    ++nleps;

    if (nleps > 0) { hists_["lepPtAll" ]->Fill( lep_it->p4().pt()  );
      hists_["lepEtaAll"]->Fill( lep_it->p4().eta() );
    }
    if (nleps == 1) { hists_["lepPt1" ]->Fill( lep_it->p4().pt()  );
      hists_["lepEta1"]->Fill( lep_it->p4().eta() );
    }
    if (nleps == 2) { hists_["lepPt2" ]->Fill( lep_it->p4().pt()  );
      hists_["lepEta2"]->Fill( lep_it->p4().eta() );
    }
    if (nleps == 3) { hists_["lepPt3" ]->Fill( lep_it->p4().pt()  );
      hists_["lepEta3"]->Fill( lep_it->p4().eta() );
    }
    if (nleps == 4) { hists_["lepPt4" ]->Fill( lep_it->p4().pt()  );
      hists_["lepEta4"]->Fill( lep_it->p4().eta() );
    }
  }

  hists_["lepN"     ]->Fill( nleps ) ;


}
void TTbar_GenLepAnalyzer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file TTbar_GenLepAnalyzer.cc.

References DQMStore::book1D(), dbe, hists_, edm::InputTag::label(), leps_, and DQMStore::setCurrentFolder().

{
  if(!dbe) return;
  dbe->setCurrentFolder("Generator/TTbar");
  hists_["lepN"     ] = dbe->book1D("TTbar_lepN"     , "N"  ,   10, -.5,  9.5 );

  hists_["lepPtAll" ] = dbe->book1D("TTbar_lepPtAll_"+leps_.label() , "pt" , 1000,  0., 1000.);
  hists_["lepPt1"   ] = dbe->book1D("TTbar_lepPt1_"+leps_.label()   , "pt" , 1000,  0., 1000.);
  hists_["lepPt2"   ] = dbe->book1D("TTbar_lepPt2_"+leps_.label()   , "pt" , 1000,  0., 1000.);
  hists_["lepPt3"   ] = dbe->book1D("TTbar_lepPt3_"+leps_.label()   , "pt" , 1000,  0., 1000.);
  hists_["lepPt4"   ] = dbe->book1D("TTbar_lepPt4_"+leps_.label()   , "pt" , 1000,  0., 1000.);

  hists_["lepEtaAll"] = dbe->book1D("TTbar_lepEtaAll", "eta",  100, -5.,    5.);
  hists_["lepEta1"  ] = dbe->book1D("TTbar_lepEta1"  , "eta",  100, -5.,    5.);
  hists_["lepEta2"  ] = dbe->book1D("TTbar_lepEta2"  , "eta",  100, -5.,    5.);
  hists_["lepEta3"  ] = dbe->book1D("TTbar_lepEta3"  , "eta",  100, -5.,    5.);
  hists_["lepEta4"  ] = dbe->book1D("TTbar_lepEta4"  , "eta",  100, -5.,    5.);
}
void TTbar_GenLepAnalyzer::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file TTbar_GenLepAnalyzer.cc.

{
}
void TTbar_GenLepAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file TTbar_GenLepAnalyzer.cc.

{
}
void TTbar_GenLepAnalyzer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file TTbar_GenLepAnalyzer.cc.

{
}
void TTbar_GenLepAnalyzer::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 115 of file TTbar_GenLepAnalyzer.cc.

{
}
void TTbar_GenLepAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &   
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 103 of file TTbar_GenLepAnalyzer.cc.

{
}
void TTbar_GenLepAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDAnalyzer.

Definition at line 121 of file TTbar_GenLepAnalyzer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

                                                                                 {
  //The following says we do not know what parameters are allowed so do no validation
  // Please change this to state exactly what you do use, even if it is no parameters
  edm::ParameterSetDescription desc;
  desc.setUnknown();
  descriptions.addDefault(desc);
}

Member Data Documentation

ME's "container".

Definition at line 75 of file TTbar_GenLepAnalyzer.h.

Referenced by beginJob(), and TTbar_GenLepAnalyzer().

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

Definition at line 80 of file TTbar_GenLepAnalyzer.h.

Definition at line 81 of file TTbar_GenLepAnalyzer.h.

std::map<std::string, MonitorElement*> TTbar_GenLepAnalyzer::hists_ [private]

Definition at line 78 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 77 of file TTbar_GenLepAnalyzer.h.

Referenced by analyze(), and beginJob().

Definition at line 82 of file TTbar_GenLepAnalyzer.h.

Definition at line 81 of file TTbar_GenLepAnalyzer.h.