CMS 3D CMS Logo

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

SUSYDQMAnalyzer Class Reference

#include <SUSYDQMAnalyzer.h>

Inheritance diagram for SUSYDQMAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginRun (const edm::Run &, const edm::EventSetup &iSetup)
virtual void endRun (const edm::Run &, const edm::EventSetup &)

Private Attributes

double _maxAbsEta
double _maxNJets
double _ptThreshold
DQMStoredqm
MonitorElementhCaloAlpha_T
MonitorElementhCaloHT
MonitorElementhCaloMET
MonitorElementhCaloMHT
MonitorElementhJPTAlpha_T
MonitorElementhJPTHT
MonitorElementhJPTMHT
MonitorElementhPFAlpha_T
MonitorElementhPFHT
MonitorElementhPFMET
MonitorElementhPFMHT
MonitorElementhTCMET
edm::ParameterSet iConfig
std::string SUSYFolder
edm::InputTag theCaloJetCollectionLabel
edm::InputTag theCaloMETCollectionLabel
edm::InputTag theJPTJetCollectionLabel
edm::InputTag thePFJetCollectionLabel
edm::InputTag thePFMETCollectionLabel
edm::InputTag theTCMETCollectionLabel

Static Private Attributes

static const char * messageLoggerCatregory = "SUSYDQM"

Detailed Description

Definition at line 18 of file SUSYDQMAnalyzer.h.


Constructor & Destructor Documentation

SUSYDQMAnalyzer::SUSYDQMAnalyzer ( const edm::ParameterSet pSet) [explicit]

Definition at line 72 of file SUSYDQMAnalyzer.cc.

References edm::ParameterSet::getParameter(), and cppFunctionSkipper::operator.

{
  iConfig = pSet;
  
  SUSYFolder = iConfig.getParameter<std::string>("folderName");
  dqm = edm::Service<DQMStore>().operator->();
}
SUSYDQMAnalyzer::~SUSYDQMAnalyzer ( )

Definition at line 275 of file SUSYDQMAnalyzer.cc.

                                 {
}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 141 of file SUSYDQMAnalyzer.cc.

References abs, edm::Event::getByLabel(), edm::HandleBase::isValid(), metsig::jet, edm::Handle< T >::product(), reco::LeafCandidate::pt(), HT< T >::ScalarSum, and HT< T >::v.

{
  //###########################################################
  // HTand MHT
  
  //===========================================================
  // Calo HT, MHT and alpha_T

  edm::Handle<reco::CaloJetCollection> CaloJetcoll;

  iEvent.getByLabel(theCaloJetCollectionLabel, CaloJetcoll);

  if(!CaloJetcoll.isValid()) return;
  
  std::vector<math::XYZTLorentzVector> Ps;
  for (reco::CaloJetCollection::const_iterator jet = CaloJetcoll->begin(); jet!=CaloJetcoll->end(); ++jet){
    if ((jet->pt()>_ptThreshold) && (abs(jet->eta()) < _maxAbsEta)){
      if(Ps.size()>_maxNJets) {
        edm::LogWarning(messageLoggerCatregory)<<"NMax Jets exceded..";
        break;
      }
      Ps.push_back(jet->p4());
    }
  }

  hCaloAlpha_T->Fill( alpha_T()(Ps));

  HT< reco::CaloJetCollection > CaloHT(CaloJetcoll, _ptThreshold, _maxAbsEta);

  hCaloHT->Fill(CaloHT.ScalarSum);
  hCaloMHT->Fill(CaloHT.v.Mod());

  //===========================================================
  // PF HT, MHT and alpha_T

  edm::Handle<reco::PFJetCollection> PFjetcoll;

  iEvent.getByLabel(thePFJetCollectionLabel, PFjetcoll);

  if(!PFjetcoll.isValid()) return;

  Ps.clear();
  for (reco::PFJetCollection::const_iterator jet = PFjetcoll->begin(); jet!=PFjetcoll->end(); ++jet){
    if ((jet->pt()>_ptThreshold) && (abs(jet->eta()) < _maxAbsEta)){
      if(Ps.size()>_maxNJets) {
        edm::LogWarning(messageLoggerCatregory)<<"NMax Jets exceded..";
        break;
      }
      Ps.push_back(jet->p4());
    }
  }
  hPFAlpha_T->Fill( alpha_T()(Ps));

  HT<reco::PFJetCollection> PFHT(PFjetcoll, _ptThreshold, _maxAbsEta);

  hPFHT->Fill(PFHT.ScalarSum);
  hPFMHT->Fill(PFHT.v.Mod());
  
  //===========================================================
  // JPT HT, MHT and alpha_T

  edm::Handle<reco::JPTJetCollection> JPTjetcoll;

  iEvent.getByLabel(theJPTJetCollectionLabel, JPTjetcoll);

  if(!JPTjetcoll.isValid()) return;

  Ps.clear();
  for (reco::JPTJetCollection::const_iterator jet = JPTjetcoll->begin(); jet!=JPTjetcoll->end(); ++jet){
    if ((jet->pt()>_ptThreshold) && (abs(jet->eta())<_maxAbsEta)){
      if(Ps.size()>_maxNJets) {
        edm::LogWarning(messageLoggerCatregory)<<"NMax Jets exceded..";
        break;
      }
      Ps.push_back(jet->p4());
    }
  }
  hJPTAlpha_T->Fill( alpha_T()(Ps));

  HT<reco::JPTJetCollection> JPTHT(JPTjetcoll, _ptThreshold, _maxAbsEta);

  hJPTHT->Fill(JPTHT.ScalarSum);
  hJPTMHT->Fill(JPTHT.v.Mod());

  //###########################################################
  // MET

  //===========================================================  
  // Calo MET

  edm::Handle<reco::CaloMETCollection> calometcoll;
  iEvent.getByLabel(theCaloMETCollectionLabel, calometcoll);

  if(!calometcoll.isValid()) return;

  const CaloMETCollection *calometcol = calometcoll.product();
  const CaloMET *calomet;
  calomet = &(calometcol->front());
  
  hCaloMET->Fill(calomet->pt());

  //===========================================================
  // PF MET

  edm::Handle<reco::PFMETCollection> pfmetcoll;
  iEvent.getByLabel(thePFMETCollectionLabel, pfmetcoll);
  
  if(!pfmetcoll.isValid()) return;

  const PFMETCollection *pfmetcol = pfmetcoll.product();
  const PFMET *pfmet;
  pfmet = &(pfmetcol->front());

  hPFMET->Fill(pfmet->pt());

  //===========================================================
  // TC MET

  edm::Handle<reco::METCollection> tcmetcoll;
  iEvent.getByLabel(theTCMETCollectionLabel, tcmetcoll);
  
  if(!tcmetcoll.isValid()) return;

  const METCollection *tcmetcol = tcmetcoll.product();
  const MET *tcmet;
  tcmet = &(tcmetcol->front());

  hTCMET->Fill(tcmet->pt());

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

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file SUSYDQMAnalyzer.cc.

                                  {
  // Load parameters 
  thePFMETCollectionLabel     = iConfig.getParameter<edm::InputTag>("PFMETCollectionLabel");
  theCaloMETCollectionLabel   = iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel");
  theTCMETCollectionLabel     = iConfig.getParameter<edm::InputTag>("TCMETCollectionLabel");

  theCaloJetCollectionLabel   = iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel");
  theJPTJetCollectionLabel    = iConfig.getParameter<edm::InputTag>("JPTJetCollectionLabel");
  thePFJetCollectionLabel     = iConfig.getParameter<edm::InputTag>("PFJetCollectionLabel");

  _ptThreshold = iConfig.getParameter<double>("ptThreshold");
  _maxNJets = iConfig.getParameter<double>("maxNJets");
  _maxAbsEta = iConfig.getParameter<double>("maxAbsEta");
}
void SUSYDQMAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 97 of file SUSYDQMAnalyzer.cc.

References dir.

                                                                             {
  if( dqm ) {
    //===========================================================  
    // book HT histos.

    std::string dir=SUSYFolder;
    dir+="HT";
    dqm->setCurrentFolder(dir);
    hCaloHT = dqm->book1D("Calo_HT", "", 500, 0., 2000);
    hPFHT   = dqm->book1D("PF_HT"  , "", 500, 0., 2000);
    hJPTHT  = dqm->book1D("JPT_HT" , "", 500, 0., 2000);

    //===========================================================  
    // book MET histos.

    dir=SUSYFolder;
    dir+="MET";
    dqm->setCurrentFolder(dir);
    hCaloMET = dqm->book1D("Calo_MET", "", 500, 0., 1000);
    hPFMET   = dqm->book1D("PF_MET"  , "", 500, 0., 1000);
    hTCMET   = dqm->book1D("TC_MET"  , "", 500, 0., 1000);

    //===========================================================  
    // book MHT histos.

    dir=SUSYFolder;
    dir+="MHT"; 
    dqm->setCurrentFolder(dir);
    hCaloMHT = dqm->book1D("Calo_MHT", "", 500, 0., 1000);
    hPFMHT   = dqm->book1D("PF_MHT"  , "", 500, 0., 1000);
    hJPTMHT  = dqm->book1D("JPT_MHT" , "", 500, 0., 1000);
   
    //===========================================================  
    // book alpha_T histos.

    dir=SUSYFolder;
    dir+="Alpha_T";
    dqm->setCurrentFolder(dir);
    hCaloAlpha_T = dqm->book1D("Calo_AlphaT", "", 100, 0., 1.);
    hJPTAlpha_T  = dqm->book1D("PF_AlphaT"  , "", 100, 0., 1.);
    hPFAlpha_T   = dqm->book1D("JPT_AlphaT"  , "", 100, 0., 1.);
  }
}
void SUSYDQMAnalyzer::endRun ( const edm::Run ,
const edm::EventSetup  
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 272 of file SUSYDQMAnalyzer.cc.

                                                               {  
}

Member Data Documentation

double SUSYDQMAnalyzer::_maxAbsEta [private]

Definition at line 41 of file SUSYDQMAnalyzer.h.

double SUSYDQMAnalyzer::_maxNJets [private]

Definition at line 40 of file SUSYDQMAnalyzer.h.

Definition at line 39 of file SUSYDQMAnalyzer.h.

Definition at line 46 of file SUSYDQMAnalyzer.h.

Definition at line 62 of file SUSYDQMAnalyzer.h.

Definition at line 50 of file SUSYDQMAnalyzer.h.

Definition at line 54 of file SUSYDQMAnalyzer.h.

Definition at line 58 of file SUSYDQMAnalyzer.h.

Definition at line 63 of file SUSYDQMAnalyzer.h.

Definition at line 51 of file SUSYDQMAnalyzer.h.

Definition at line 59 of file SUSYDQMAnalyzer.h.

Definition at line 64 of file SUSYDQMAnalyzer.h.

Definition at line 52 of file SUSYDQMAnalyzer.h.

Definition at line 55 of file SUSYDQMAnalyzer.h.

Definition at line 60 of file SUSYDQMAnalyzer.h.

Definition at line 56 of file SUSYDQMAnalyzer.h.

Definition at line 24 of file SUSYDQMAnalyzer.h.

const char * SUSYDQMAnalyzer::messageLoggerCatregory = "SUSYDQM" [static, private]

Definition at line 44 of file SUSYDQMAnalyzer.h.

std::string SUSYDQMAnalyzer::SUSYFolder [private]

Definition at line 43 of file SUSYDQMAnalyzer.h.

Definition at line 35 of file SUSYDQMAnalyzer.h.

Definition at line 31 of file SUSYDQMAnalyzer.h.

Definition at line 37 of file SUSYDQMAnalyzer.h.

Definition at line 36 of file SUSYDQMAnalyzer.h.

Definition at line 32 of file SUSYDQMAnalyzer.h.

Definition at line 33 of file SUSYDQMAnalyzer.h.