CMS 3D CMS Logo

Public Member Functions | Private Member Functions | 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

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 cmsCodeRules::cppFunctionSkipper::operator.

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

Definition at line 304 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 149 of file SUSYDQMAnalyzer.cc.

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

{
  //std::cout<<"here 7!"<<std::endl;
  EventID TheEvent = iEvent.id();
  //int BXN = iEvent.bunchCrossing() ;
  //bool Dump = TextFileName.size();
  //int TheEventNumber = TheEvent.event();
  //int Lumi = iEvent.luminosityBlock();
  //int Run  = iEvent.run();

  //###########################################################
  // 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) {
        std::cout<<"NMax Jets exceded.."<<std::endl;
        break;
      }
      Ps.push_back(jet->p4());
    }
  }

  hCaloAlpha_T->Fill( alpha_T()(Ps));
  //std::cout<<"Calo Alpha_T "<<alpha_T()(Ps)<<std::endl;

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

  //std::cout << "Calo MHT " << CaloHT.v.Mod() << std::endl;
  //std::cout << "Calo HT " << CaloHT.ScalarSum << std::endl;
  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) {
        std::cout<<"NMax Jets exceded.."<<std::endl;
        break;
      }
      Ps.push_back(jet->p4());
    }
  }
  //std::cout<<Ps.size()<<" "<<Ps.max_size()<<std::endl;
  hPFAlpha_T->Fill( alpha_T()(Ps));
  //std::cout<<"PF Alpha_T "<<alpha_T()(Ps)<<std::endl;

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

  //std::cout << "PF MHT " << PFHT.v.Mod() << std::endl;
  //std::cout << "PF HT " << PFHT.ScalarSum << std::endl;
  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) {
        std::cout<<"NMax Jets exceded..."<<std::endl;
        break;
      }
      Ps.push_back(jet->p4());
    }
  }
  hJPTAlpha_T->Fill( alpha_T()(Ps));
  //std::cout<<"JPT Alpha_T "<<alpha_T()(Ps)<<std::endl;

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

  //std::cout << "JPT MHT " << JPTHT.v.Mod() << std::endl;
  //std::cout << "JPT HT " << JPTHT.ScalarSum << std::endl;
  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());
  //std::cout<<"Calo MET "<<calomet->pt()<<std::endl;

  //===========================================================
  // 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());
  //std::cout<<"PF MET "<<pfmet->pt()<<std::endl;

  //===========================================================
  // 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());
  //std::cout<<"TC MET "<<tcmet->pt()<<std::endl;

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

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file SUSYDQMAnalyzer.cc.

                                  {

  // Load parameters
  //std::cout<<"here 2!"<<std::endl;
  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");

  //std::cout<<"here 3!"<<std::endl;
  //std::cout<<thePFJetCollectionLabel<<std::endl;
}
void SUSYDQMAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file SUSYDQMAnalyzer.cc.

References dir.

                                                                             {
  //std::cout<<"here 4!"<<std::endl;
  if( dqm ) {
    //std::cout<<"here 5!"<<std::endl;
    //===========================================================  
    // 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.);
    //std::cout<<"here 6!"<<std::endl;
  }
}
void SUSYDQMAnalyzer::endRun ( const edm::Run ,
const edm::EventSetup  
) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 301 of file SUSYDQMAnalyzer.cc.

                                                               {  
}

Member Data Documentation

double SUSYDQMAnalyzer::_maxAbsEta [private]

Definition at line 44 of file SUSYDQMAnalyzer.h.

double SUSYDQMAnalyzer::_maxNJets [private]

Definition at line 43 of file SUSYDQMAnalyzer.h.

Definition at line 42 of file SUSYDQMAnalyzer.h.

Definition at line 57 of file SUSYDQMAnalyzer.h.

Definition at line 74 of file SUSYDQMAnalyzer.h.

Definition at line 62 of file SUSYDQMAnalyzer.h.

Definition at line 66 of file SUSYDQMAnalyzer.h.

Definition at line 70 of file SUSYDQMAnalyzer.h.

Definition at line 75 of file SUSYDQMAnalyzer.h.

Definition at line 63 of file SUSYDQMAnalyzer.h.

Definition at line 71 of file SUSYDQMAnalyzer.h.

Definition at line 76 of file SUSYDQMAnalyzer.h.

Definition at line 64 of file SUSYDQMAnalyzer.h.

Definition at line 67 of file SUSYDQMAnalyzer.h.

Definition at line 72 of file SUSYDQMAnalyzer.h.

Definition at line 68 of file SUSYDQMAnalyzer.h.

Definition at line 24 of file SUSYDQMAnalyzer.h.

std::string SUSYDQMAnalyzer::SUSYFolder [private]

Definition at line 48 of file SUSYDQMAnalyzer.h.

Definition at line 38 of file SUSYDQMAnalyzer.h.

Definition at line 34 of file SUSYDQMAnalyzer.h.

Definition at line 40 of file SUSYDQMAnalyzer.h.

Definition at line 39 of file SUSYDQMAnalyzer.h.

Definition at line 35 of file SUSYDQMAnalyzer.h.

Definition at line 36 of file SUSYDQMAnalyzer.h.