CMS 3D CMS Logo

Public Member Functions | Private Attributes

JetMETAnalyzer Class Reference

#include <JetMETAnalyzer.h>

Inheritance diagram for JetMETAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 Get the analysis.
void beginJob (void)
 Inizialize parameters for histo binning.
void beginRun (const edm::Run &, const edm::EventSetup &)
 Initialize run-based parameters.
void endJob (void)
 Save the histos.
void endRun (const edm::Run &, const edm::EventSetup &)
 Finish up a run.
 JetMETAnalyzer (const edm::ParameterSet &)
 Constructor.
virtual ~JetMETAnalyzer ()
 Destructor.

Private Attributes

bool _doHLTPhysicsOn
bool _doPVCheck
GenericTriggerEventFlag_HighPtJetEventFlag
bool _hlt_initialized
std::string _hlt_PhysDec
GenericTriggerEventFlag_LowPtJetEventFlag
int _LSBegin
int _LSEnd
int _nvtx_min
int _nvtxtrks_min
std::vector< unsigned > _techTrigsAND
std::vector< unsigned > _techTrigsNOT
std::vector< unsigned > _techTrigsOR
edm::InputTag _theGTLabel
edm::InputTag _theVertexLabel
bool _tightBHFiltering
bool _tightHcalFiltering
double _vtxchi2_max
int _vtxndof_min
double _vtxz_max
DQMStoredbe
JetMETDQMDCSFilterDCSFilterCalo
JetMETDQMDCSFilterDCSFilterJPT
JetMETDQMDCSFilterDCSFilterPF
std::string HiJetTrigger
HLTConfigProvider hltConfig_
MonitorElementhltpathME
std::string LoJetTrigger
MonitorElementlumisecME
std::string metname
edm::ParameterSet parameters
std::string processname_
JetAnalyzertheAKJetAnalyzer
edm::InputTag theAKJetCollectionLabel
edm::InputTag theCaloJetCollectionLabel
CaloMETAnalyzertheCaloMETAnalyzer
bool theCaloMETAnalyzerFlag
CaloMETAnalyzertheCaloMETHOAnalyzer
CaloMETAnalyzertheCaloMETNoHFAnalyzer
CaloMETAnalyzertheCaloMETNoHFHOAnalyzer
JetAnalyzertheCleanedAKJetAnalyzer
JetAnalyzertheCleanedICJetAnalyzer
JPTJetAnalyzertheCleanedJPTJetAnalyzer
PFJetAnalyzertheCleanedPFJetAnalyzer
JetPtAnalyzertheCleanedPtAKJetAnalyzer
JetPtAnalyzertheCleanedPtICJetAnalyzer
JetPtAnalyzertheCleanedPtSCJetAnalyzer
JetAnalyzertheCleanedSCJetAnalyzer
edm::ParameterSet theCleaningParameters
JetAnalyzertheDiJetAnalyzer
bool theDiJetSelectionFlag
HTMHTAnalyzertheHTMHTAnalyzer
bool theHTMHTAnalyzerFlag
JetAnalyzertheICJetAnalyzer
edm::InputTag theICJetCollectionLabel
bool theIConeJetAnalyzerFlag
JetAnalyzertheJetAnalyzer
bool theJetAnalyzerFlag
bool theJetCleaningFlag
bool theJetPtAnalyzerFlag
bool theJetPtCleaningFlag
JPTJetAnalyzertheJPTJetAnalyzer
bool theJPTJetAnalyzerFlag
bool theJPTJetCleaningFlag
edm::InputTag theJPTJetCollectionLabel
CaloMETAnalyzertheMuCorrMETAnalyzer
bool theMuCorrMETAnalyzerFlag
PFJetAnalyzerthePFJetAnalyzer
bool thePFJetAnalyzerFlag
bool thePFJetCleaningFlag
edm::InputTag thePFJetCollectionLabel
PFMETAnalyzerthePfMETAnalyzer
bool thePfMETAnalyzerFlag
JetPtAnalyzerthePtAKJetAnalyzer
JetPtAnalyzerthePtICJetAnalyzer
JetPtAnalyzerthePtSCJetAnalyzer
JetAnalyzertheSCJetAnalyzer
edm::InputTag theSCJetCollectionLabel
bool theSConeJetAnalyzerFlag
METAnalyzertheTcMETAnalyzer
bool theTcMETAnalyzerFlag
edm::InputTag theTriggerResultsLabel

Detailed Description

DQM jetMET analysis monitoring

Date:
2010/10/15 13:49:54
Revision:
1.23
Author:
F. Chlebana - Fermilab K. Hatakeyama - Rockefeller University

Definition at line 51 of file JetMETAnalyzer.h.


Constructor & Destructor Documentation

JetMETAnalyzer::JetMETAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 38 of file JetMETAnalyzer.cc.

References edm::ParameterSet::getParameter(), and Parameters::parameters.

                                                          {

  parameters = pSet;
  
  // Jet Collection Label 
  theAKJetCollectionLabel       = parameters.getParameter<edm::InputTag>("AKJetsCollectionLabel");
  theSCJetCollectionLabel       = parameters.getParameter<edm::InputTag>("SCJetsCollectionLabel");
  theICJetCollectionLabel       = parameters.getParameter<edm::InputTag>("ICJetsCollectionLabel");
  theJPTJetCollectionLabel      = parameters.getParameter<edm::InputTag>("JPTJetsCollectionLabel");
  thePFJetCollectionLabel       = parameters.getParameter<edm::InputTag>("PFJetsCollectionLabel");

  theTriggerResultsLabel        = parameters.getParameter<edm::InputTag>("TriggerResultsLabel");
  
  theJetAnalyzerFlag            = parameters.getUntrackedParameter<bool>("DoJetAnalysis",    true);
  theJetCleaningFlag            = parameters.getUntrackedParameter<bool>("DoJetCleaning",    true);
  theIConeJetAnalyzerFlag       = parameters.getUntrackedParameter<bool>("DoIterativeCone",  false);
  theSConeJetAnalyzerFlag       = parameters.getUntrackedParameter<bool>("DoSisCone",  false);
  theJetPtAnalyzerFlag          = parameters.getUntrackedParameter<bool>("DoJetPtAnalysis",  false);
  theJetPtCleaningFlag          = parameters.getUntrackedParameter<bool>("DoJetPtCleaning",  false);
  theJPTJetAnalyzerFlag         = parameters.getUntrackedParameter<bool>("DoJPTJetAnalysis", false);
  theJPTJetCleaningFlag         = parameters.getUntrackedParameter<bool>("DoJPTJetCleaning", true);
  thePFJetAnalyzerFlag          = parameters.getUntrackedParameter<bool>("DoPFJetAnalysis",  false);
  thePFJetCleaningFlag          = parameters.getUntrackedParameter<bool>("DoPFJetCleaning",  true);
  //
  theDiJetSelectionFlag         = parameters.getUntrackedParameter<bool>("DoDiJetSelection", true);
  //
  theCaloMETAnalyzerFlag        = parameters.getUntrackedParameter<bool>("DoCaloMETAnalysis",true);
  theTcMETAnalyzerFlag          = parameters.getUntrackedParameter<bool>("DoTcMETAnalysis",  true);
  theMuCorrMETAnalyzerFlag      = parameters.getUntrackedParameter<bool>("DoMuCorrMETAnalysis",  true);
  thePfMETAnalyzerFlag          = parameters.getUntrackedParameter<bool>("DoPfMETAnalysis",  true);
  theHTMHTAnalyzerFlag          = parameters.getUntrackedParameter<bool>("DoHTMHTAnalysis",  true);

  // ==========================================================
  //DCS information
  // ==========================================================
  DCSFilterCalo = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilterCalo"));
  DCSFilterPF   = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilterPF"));
  DCSFilterJPT  = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilterJPT"));
  // Used for Jet DQM - For MET DQM, DCS selection applied in ***METAnalyzer

  // --- do the analysis on the Jets
  if(theJetAnalyzerFlag) {
    theAKJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("jetAnalysis"));
    theAKJetAnalyzer->setSource("AntiKtJets");    
    if(theSConeJetAnalyzerFlag) {
      theSCJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("jetAnalysis"));
      theSCJetAnalyzer->setSource("SISConeJets");
    }
    if(theIConeJetAnalyzerFlag){
      theICJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("jetAnalysis"));
      theICJetAnalyzer->setSource("IterativeConeJets");  
    }
  }

  if(theJetCleaningFlag) {
    theCleanedAKJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("CleanedjetAnalysis"));
    theCleanedAKJetAnalyzer->setSource("CleanedAntiKtJets");
    if(theSConeJetAnalyzerFlag){
      theCleanedSCJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("CleanedjetAnalysis"));
      theCleanedSCJetAnalyzer->setSource("CleanedSISConeJets");
    }
    if(theIConeJetAnalyzerFlag){
      theCleanedICJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("CleanedjetAnalysis"));
      theCleanedICJetAnalyzer->setSource("CleanedIterativeConeJets");
    }
  }

  if(theDiJetSelectionFlag){
    theDiJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("DijetAnalysis"));
    theDiJetAnalyzer->setSource("DiJets");
  }

  // Do Pt analysis
  if(theJetPtAnalyzerFlag ) {
    thePtAKJetAnalyzer  = new JetPtAnalyzer(parameters.getParameter<ParameterSet>("PtAnalysis"));
    thePtAKJetAnalyzer->setSource("PtAnalysisAntiKtJets");
    if(theSConeJetAnalyzerFlag){
      thePtSCJetAnalyzer  = new JetPtAnalyzer(parameters.getParameter<ParameterSet>("PtAnalysis"));
      thePtSCJetAnalyzer->setSource("PtAnalysisSISConeJets");
    }
    if(theIConeJetAnalyzerFlag){
      thePtICJetAnalyzer  = new JetPtAnalyzer(parameters.getParameter<ParameterSet>("PtAnalysis"));
      thePtICJetAnalyzer->setSource("PtAnalysisIterativeConeJets");
    }
  }
  // Do Cleaned Pt analysis
  if(theJetPtCleaningFlag ) {
    theCleanedPtAKJetAnalyzer  = new JetPtAnalyzer(parameters.getParameter<ParameterSet>("CleanedPtAnalysis"));
    theCleanedPtAKJetAnalyzer->setSource("PtAnalysisCleanedAntiKtJets");
    if(theSConeJetAnalyzerFlag){
      theCleanedPtSCJetAnalyzer  = new JetPtAnalyzer(parameters.getParameter<ParameterSet>("CleanedPtAnalysis"));
      theCleanedPtSCJetAnalyzer->setSource("PtAnalysisCleanedSISConeJets");
    }
    if(theIConeJetAnalyzerFlag){
      theCleanedPtICJetAnalyzer  = new JetPtAnalyzer(parameters.getParameter<ParameterSet>("CleanedPtAnalysis"));
      theCleanedPtICJetAnalyzer->setSource("PtAnalysisCleanedIterativeConeJets");
    }
  }

  // --- do the analysis on JPT Jets
  if(theJPTJetAnalyzerFlag) {
    theJPTJetAnalyzer  = new JPTJetAnalyzer(parameters.getParameter<ParameterSet>("JPTJetAnalysis"));
  }
  // --- do the analysis on JPT Cleaned Jets
  if(theJPTJetCleaningFlag) {
    theCleanedJPTJetAnalyzer  = new JPTJetAnalyzer(parameters.getParameter<ParameterSet>("CleanedJPTJetAnalysis"));
  }

  // --- do the analysis on the PFJets
  if(thePFJetAnalyzerFlag){ 
    thePFJetAnalyzer = new PFJetAnalyzer(parameters.getParameter<ParameterSet>("pfJetAnalysis"));
    thePFJetAnalyzer->setSource("uncPFJets");
  }
  // --- do the analysis on the CleanedPFJets
  if(thePFJetCleaningFlag) {
    theCleanedPFJetAnalyzer = new PFJetAnalyzer(parameters.getParameter<ParameterSet>("CleanedpfJetAnalysis"));
    theCleanedPFJetAnalyzer->setSource("PFJets");
  }
  //Trigger selectoin
  edm::ParameterSet highptjetparms = parameters.getParameter<edm::ParameterSet>("highPtJetTrigger");
  edm::ParameterSet lowptjetparms  = parameters.getParameter<edm::ParameterSet>("lowPtJetTrigger" );

  LoJetTrigger = highptjetparms.getParameter<std::string>("hltDBKey");
  HiJetTrigger = lowptjetparms .getParameter<std::string>("hltDBKey");

  _HighPtJetEventFlag = new GenericTriggerEventFlag( highptjetparms );
  _LowPtJetEventFlag  = new GenericTriggerEventFlag( lowptjetparms  );


  // --- do the analysis on the MET
  if(theCaloMETAnalyzerFlag){
    theCaloMETAnalyzer       = new CaloMETAnalyzer(parameters.getParameter<ParameterSet>("caloMETAnalysis"));
    theCaloMETNoHFAnalyzer   = new CaloMETAnalyzer(parameters.getParameter<ParameterSet>("caloMETNoHFAnalysis"));
    theCaloMETHOAnalyzer     = new CaloMETAnalyzer(parameters.getParameter<ParameterSet>("caloMETHOAnalysis"));
    theCaloMETNoHFHOAnalyzer = new CaloMETAnalyzer(parameters.getParameter<ParameterSet>("caloMETNoHFHOAnalysis"));
  }
  if(theTcMETAnalyzerFlag){
    theTcMETAnalyzer = new METAnalyzer(parameters.getParameter<ParameterSet>("tcMETAnalysis"));
  }
  if(theMuCorrMETAnalyzerFlag){
    theMuCorrMETAnalyzer = new CaloMETAnalyzer(parameters.getParameter<ParameterSet>("mucorrMETAnalysis"));
  }
  if(thePfMETAnalyzerFlag){
    thePfMETAnalyzer = new PFMETAnalyzer(parameters.getParameter<ParameterSet>("pfMETAnalysis"));
  }
  if(theHTMHTAnalyzerFlag){
    theHTMHTAnalyzer         = new HTMHTAnalyzer(parameters.getParameter<ParameterSet>("HTMHTAnalysis"));
  }

  _LSBegin     = parameters.getParameter<int>("LSBegin");
  _LSEnd       = parameters.getParameter<int>("LSEnd");

  processname_ = parameters.getParameter<std::string>("processname");

  //jet cleanup parameters
  theCleaningParameters = parameters.getParameter<ParameterSet>("CleaningParameters"),

  _hlt_PhysDec   = theCleaningParameters.getParameter<std::string>("HLT_PhysDec");

  _techTrigsAND  = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsAND");
  _techTrigsOR   = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsOR");
  _techTrigsNOT  = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsNOT");

  _doPVCheck          = theCleaningParameters.getParameter<bool>("doPrimaryVertexCheck");
  _doHLTPhysicsOn     = theCleaningParameters.getParameter<bool>("doHLTPhysicsOn");

  _tightBHFiltering   = theCleaningParameters.getParameter<bool>("tightBHFiltering");
  _tightHcalFiltering = theCleaningParameters.getParameter<bool>("tightHcalFiltering");

  _theVertexLabel     = theCleaningParameters.getParameter<edm::InputTag>("vertexLabel");
  _theGTLabel         = theCleaningParameters.getParameter<edm::InputTag>("gtLabel");

  //Vertex requirements
  if (_doPVCheck) {
    _nvtx_min        = theCleaningParameters.getParameter<int>("nvtx_min");
    _nvtxtrks_min    = theCleaningParameters.getParameter<int>("nvtxtrks_min");
    _vtxndof_min     = theCleaningParameters.getParameter<int>("vtxndof_min");
    _vtxchi2_max     = theCleaningParameters.getParameter<double>("vtxchi2_max");
    _vtxz_max        = theCleaningParameters.getParameter<double>("vtxz_max");
  }

}
JetMETAnalyzer::~JetMETAnalyzer ( ) [virtual]

Destructor.

Definition at line 222 of file JetMETAnalyzer.cc.


Member Function Documentation

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

Get the analysis.

Implements edm::EDAnalyzer.

Definition at line 406 of file JetMETAnalyzer.cc.

References gather_cfg::cout, DEBUG, edm::Event::getByLabel(), edm::HandleBase::isValid(), j, LogTrace, edm::EventBase::luminosityBlock(), metname, python::pfJets_cff::pfJets, edm::Handle< T >::product(), edm::TriggerNames::size(), edm::TriggerNames::triggerIndex(), edm::Event::triggerNames(), v, and GoodVertex_cfg::vertexCollection.

                                                                                {

  LogTrace(metname)<<"[JetMETAnalyzer] Analysis of event # ";

  // *** Fill lumisection ME
  int myLuminosityBlock;
  myLuminosityBlock = iEvent.luminosityBlock();
  lumisecME->Fill(myLuminosityBlock);

  if (myLuminosityBlock<_LSBegin) return;
  if (myLuminosityBlock>_LSEnd && _LSEnd>0) return;

  // **** Get the TriggerResults container
  edm::Handle<TriggerResults> triggerResults;
  iEvent.getByLabel(theTriggerResultsLabel, triggerResults);

  bool bPhysicsDeclared = false;
  if(!_doHLTPhysicsOn) bPhysicsDeclared = true;

  if (triggerResults.isValid()){
    const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
    
    if( triggerNames.triggerIndex("HLT_PhysicsDeclared") != triggerNames.size() )
      if (triggerResults->accept(triggerNames.triggerIndex("HLT_PhysicsDeclared"))) {
        if(_doHLTPhysicsOn) bPhysicsDeclared = true;
      }

    //sanity check
    if (_hlt_initialized && hltConfig_.size() && triggerResults->size()==hltConfig_.size()){
      //check the trigger results
      for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
        if (triggerResults->accept(j)){
          if (hltpathME) hltpathME->Fill(j);
        }
      }
    }
  }
  
  if (DEBUG)  std::cout << "trigger label " << theTriggerResultsLabel << std::endl;

  Int_t JetLoPass = 0;
  Int_t JetHiPass = 0;

  if ( _HighPtJetEventFlag->on() && _HighPtJetEventFlag->accept( iEvent, iSetup ) ) 
    JetHiPass=1;
  
  if ( _LowPtJetEventFlag->on() && _LowPtJetEventFlag->accept( iEvent, iSetup ) ) 
    JetLoPass=1;
  
  //if (triggerResults.isValid()) {
  //
  //  if (DEBUG) std::cout << "trigger valid " << std::endl;
  //  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
  //  unsigned int n = triggerResults->size();
  //  for (unsigned int i=0; i!=n; i++) {
  //
  //    if ( triggerNames.triggerName(i) == LoJetTrigger ) {
  //    JetLoPass =  triggerResults->accept(i);
  //    if (DEBUG) std::cout << "Found  HLT_Jet30" << std::endl;
  //    }
  //    if ( triggerNames.triggerName(i) == HiJetTrigger ) {
  //    JetHiPass =  triggerResults->accept(i);
  //    }
  //  }
  //
  //} else {
  //
  //  //
  //  triggerResults = edm::Handle<TriggerResults>(); 
  //
  //  if (DEBUG) std::cout << "trigger not valid " << std::endl;
  //  edm::LogInfo("JetMETAnalyzer") << "TriggerResults::HLT not found, "
  //    "automatically select events";
  //
  //}
  if (DEBUG) {
    std::cout << ">>> Trigger  Lo = " <<  JetLoPass
              <<             " Hi = " <<  JetHiPass
              << std::endl;
  }

  // ==========================================================
  //Vertex information
  
  bool bPrimaryVertex = true;
  if(_doPVCheck){
    bPrimaryVertex = false;
    Handle<reco::VertexCollection> vertexHandle;

    iEvent.getByLabel(_theVertexLabel, vertexHandle);

    if (!vertexHandle.isValid()) {
      LogInfo("JetMETAnalyzer") << "JetMETAnalyzer: Could not find vertex collection" << std::endl;
      if (DEBUG) std::cout << "JetMETAnalyzer: Could not find vertex collection" << std::endl;
    }
    
    if ( vertexHandle.isValid() ){
      reco::VertexCollection vertexCollection = *(vertexHandle.product());
      int vertex_number     = vertexCollection.size();
      reco::VertexCollection::const_iterator v = vertexCollection.begin();
      double vertex_chi2    = v->normalizedChi2();
      double vertex_ndof    = v->ndof();
      bool   fakeVtx        = v->isFake();
      double vertex_Z       = v->z();
      
      if (  !fakeVtx
            && vertex_number>=_nvtx_min
            && vertex_ndof   >_vtxndof_min
            && vertex_chi2   <_vtxchi2_max
            && fabs(vertex_Z)<_vtxz_max ) bPrimaryVertex = true;
    }
  }
  // ==========================================================

  edm::Handle< L1GlobalTriggerReadoutRecord > gtReadoutRecord;
  iEvent.getByLabel( _theGTLabel, gtReadoutRecord);

  if (!gtReadoutRecord.isValid()) {
    LogInfo("JetMETAnalyzer") << "JetMETAnalyzer: Could not find GT readout record" << std::endl;
    if (DEBUG) std::cout << "JetMETAnalyzer: Could not find GT readout record product" << std::endl;
  }
  
  bool bTechTriggers    = true;
  bool bTechTriggersAND = true;
  bool bTechTriggersOR  = false;
  bool bTechTriggersNOT = false;

  if (gtReadoutRecord.isValid()) {
    const TechnicalTriggerWord&  technicalTriggerWordBeforeMask = gtReadoutRecord->technicalTriggerWord();

    if (_techTrigsAND.size() == 0)
      bTechTriggersAND = true;
    else
      for (unsigned ttr = 0; ttr != _techTrigsAND.size(); ttr++) {
        bTechTriggersAND = bTechTriggersAND && technicalTriggerWordBeforeMask.at(_techTrigsAND.at(ttr));
      }
    
    if (_techTrigsAND.size() == 0)
      bTechTriggersOR = true;
    else
      for (unsigned ttr = 0; ttr != _techTrigsOR.size(); ttr++) {
        bTechTriggersOR = bTechTriggersOR || technicalTriggerWordBeforeMask.at(_techTrigsOR.at(ttr));
      }
    if (_techTrigsNOT.size() == 0)
      bTechTriggersNOT = false;
    else
      for (unsigned ttr = 0; ttr != _techTrigsNOT.size(); ttr++) {
        bTechTriggersNOT = bTechTriggersNOT || technicalTriggerWordBeforeMask.at(_techTrigsNOT.at(ttr));
      }
  }
  else
    {
      bTechTriggersAND = true;
      bTechTriggersOR  = true;
      bTechTriggersNOT = false;
    }  

  if (_techTrigsAND.size()==0)
    bTechTriggersAND = true;
  if (_techTrigsOR.size()==0)
    bTechTriggersOR = true;
  if (_techTrigsNOT.size()==0)
    bTechTriggersNOT = false;
  
  bTechTriggers = bTechTriggersAND && bTechTriggersOR && !bTechTriggersNOT;
    
  bool bJetCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;


  // **** Get the Calo Jet container
  edm::Handle<reco::CaloJetCollection> caloJets;
  

  // **** Get the AntiKt Jet container
  iEvent.getByLabel(theAKJetCollectionLabel, caloJets);    
  if(caloJets.isValid()) {

  if(theJetAnalyzerFlag){
    theAKJetAnalyzer->setJetHiPass(JetHiPass);
    theAKJetAnalyzer->setJetLoPass(JetLoPass);
    theAKJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
  }
  if(theJetPtAnalyzerFlag){
    LogTrace(metname)<<"[JetMETAnalyzer] Call to the Jet Pt anti-Kt analyzer";
    thePtAKJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
  }

  }

  if(caloJets.isValid() && bJetCleanup) {
  if(DCSFilterCalo->filter(iEvent, iSetup)){
  if(theJetCleaningFlag){
    theCleanedAKJetAnalyzer->setJetHiPass(JetHiPass);
    theCleanedAKJetAnalyzer->setJetLoPass(JetLoPass);
    theCleanedAKJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
  }
  if(theJetPtCleaningFlag){
    LogTrace(metname)<<"[JetMETAnalyzer] Call to the Cleaned Jet Pt anti-Kt analyzer";
    theCleanedPtAKJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
  }
  } // DCS
  } // caloJets.isValid()

  if(caloJets.isValid() && bJetCleanup){
  if(DCSFilterCalo->filter(iEvent, iSetup)){
    if(theDiJetSelectionFlag){
    theDiJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
    }
  } // DCS
  } // caloJets.isValid()


  if(caloJets.isValid()){
    if(theJetPtAnalyzerFlag){
      LogTrace(metname)<<"[JetMETAnalyzer] Call to the Jet Pt anti-Kt analyzer";
      thePtAKJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
    }
  }

  if(caloJets.isValid() && bJetCleanup){
  if(DCSFilterCalo->filter(iEvent, iSetup)){
    if(theJetPtCleaningFlag){
      LogTrace(metname)<<"[JetMETAnalyzer] Call to the Cleaned Jet Pt anti-Kt analyzer";
      theCleanedPtAKJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
    }
  } // DCS
  } // caloJets.isValid() 
  
  // **** Get the SISCone Jet container
  iEvent.getByLabel(theSCJetCollectionLabel, caloJets);    
  if(theSConeJetAnalyzerFlag){
    if(caloJets.isValid()){
      if(theJetAnalyzerFlag){
        theSCJetAnalyzer->setJetHiPass(JetHiPass);
        theSCJetAnalyzer->setJetLoPass(JetLoPass);
        theSCJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
      if(theJetPtAnalyzerFlag){
        LogTrace(metname)<<"[JetMETAnalyzer] Call to the Jet Pt SisCone analyzer";
        thePtSCJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
    }
    
    if(caloJets.isValid() && bJetCleanup){
    if(DCSFilterCalo->filter(iEvent, iSetup)){
      if(theJetCleaningFlag){
        theCleanedSCJetAnalyzer->setJetHiPass(JetHiPass);
        theCleanedSCJetAnalyzer->setJetLoPass(JetLoPass);
        theCleanedSCJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
      if(theJetPtCleaningFlag){
        LogTrace(metname)<<"[JetMETAnalyzer] Call to the Cleaned Jet Pt SisCone analyzer";
        theCleanedPtSCJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
    } // DCS
    } // caloJets.isValid()
  }
  // **** Get the Iterative Cone Jet container  
  iEvent.getByLabel(theICJetCollectionLabel, caloJets);
  if(theIConeJetAnalyzerFlag) {
    if(caloJets.isValid()){
      if(theJetAnalyzerFlag){
        theICJetAnalyzer->setJetHiPass(JetHiPass);
        theICJetAnalyzer->setJetLoPass(JetLoPass);
        theICJetAnalyzer->analyze(iEvent, iSetup, *caloJets);   
      }
      if(theJetPtAnalyzerFlag){
        LogTrace(metname)<<"[JetMETAnalyzer] Call to the Jet Pt ICone analyzer";
        thePtICJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
    }
    
    if(caloJets.isValid() && bJetCleanup){
    if(DCSFilterCalo->filter(iEvent, iSetup)){
      if(theJetCleaningFlag){
        theCleanedICJetAnalyzer->setJetHiPass(JetHiPass);
        theCleanedICJetAnalyzer->setJetLoPass(JetLoPass);
        theCleanedICJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
      if(theJetPtCleaningFlag){
        LogTrace(metname)<<"[JetMETAnalyzer] Call to the Cleaned Jet Pt ICone analyzer";
        theCleanedPtICJetAnalyzer->analyze(iEvent, iSetup, *caloJets);
      }
    } // DCS
    } // isValid
  }

  // **** Get the JPT Jet container
  edm::Handle<reco::JPTJetCollection> jptJets;
  iEvent.getByLabel(theJPTJetCollectionLabel, jptJets);
  if(jptJets.isValid() && theJPTJetAnalyzerFlag){
    //theJPTJetAnalyzer->setJetHiPass(JetHiPass);
    //theJPTJetAnalyzer->setJetLoPass(JetLoPass);
    theJPTJetAnalyzer->analyze(iEvent, iSetup, *jptJets);
  }
  
  if(jptJets.isValid() && bJetCleanup && theJPTJetCleaningFlag){
    if(DCSFilterJPT->filter(iEvent, iSetup)){
    //theCleanedJPTJetAnalyzer->setJetHiPass(JetHiPass);
    //theCleanedJPTJetAnalyzer->setJetLoPass(JetLoPass);
    theCleanedJPTJetAnalyzer->analyze(iEvent, iSetup, *jptJets);
    }
  }
  
  // **** Get the PFlow Jet container
  edm::Handle<reco::PFJetCollection> pfJets;
  iEvent.getByLabel(thePFJetCollectionLabel, pfJets);

  if(pfJets.isValid()){
    if(thePFJetAnalyzerFlag){
      thePFJetAnalyzer->setJetHiPass(JetHiPass);
      thePFJetAnalyzer->setJetLoPass(JetLoPass);
      LogTrace(metname)<<"[JetMETAnalyzer] Call to the PFJet analyzer";
      thePFJetAnalyzer->analyze(iEvent, iSetup, *pfJets);
      }
    if(thePFJetCleaningFlag){
    if(DCSFilterPF->filter(iEvent, iSetup)){
      theCleanedPFJetAnalyzer->setJetHiPass(JetHiPass);
      theCleanedPFJetAnalyzer->setJetLoPass(JetLoPass);
      LogTrace(metname)<<"[JetMETAnalyzer] Call to the Cleaned PFJet analyzer";
      theCleanedPFJetAnalyzer->analyze(iEvent, iSetup, *pfJets);
    } // DCS
    }  
  } else {
    if (DEBUG) LogTrace(metname)<<"[JetMETAnalyzer] pfjets NOT VALID!!";
  }
   
  //
  // **** CaloMETAnalyzer **** //
  //
  if(theCaloMETAnalyzerFlag){
     
    theCaloMETAnalyzer->analyze(iEvent,       iSetup, *triggerResults);
    theCaloMETNoHFAnalyzer->analyze(iEvent,   iSetup, *triggerResults);
    theCaloMETHOAnalyzer->analyze(iEvent,     iSetup, *triggerResults);
    theCaloMETNoHFHOAnalyzer->analyze(iEvent, iSetup, *triggerResults);
  }

  //
  // **** TcMETAnalyzer **** //
  //
  if(theTcMETAnalyzerFlag){
     
    theTcMETAnalyzer->analyze(iEvent, iSetup, *triggerResults);
     
  }

  //
  // **** MuCorrMETAnalyzer **** //
  //
  if(theMuCorrMETAnalyzerFlag){
     
    theMuCorrMETAnalyzer->analyze(iEvent, iSetup, *triggerResults);
     
  }
   
  //
  // **** PfMETAnalyzer **** //
  //
  if(thePfMETAnalyzerFlag){
     
    thePfMETAnalyzer->analyze(iEvent, iSetup, *triggerResults);
     
  }
   
  //
  // **** HTMHTAnalyzer **** //
  //
  if(theHTMHTAnalyzerFlag){
    
    theHTMHTAnalyzer->analyze(iEvent, iSetup, *triggerResults);
    
  }

}
void JetMETAnalyzer::beginJob ( void  ) [virtual]

Inizialize parameters for histo binning.

Reimplemented from edm::EDAnalyzer.

Definition at line 276 of file JetMETAnalyzer.cc.

References LogTrace, metname, and cmsCodeRules::cppFunctionSkipper::operator.

                                  {

  metname = "JetMETAnalyzer";

  LogTrace(metname)<<"[JetMETAnalyzer] Parameters initialization";
  dbe = edm::Service<DQMStore>().operator->();

  //
  //--- Jet
  if(theJetAnalyzerFlag) { 
    theAKJetAnalyzer->beginJob(dbe);
    if(theSConeJetAnalyzerFlag) theSCJetAnalyzer->beginJob(dbe); 
    if(theIConeJetAnalyzerFlag) theICJetAnalyzer->beginJob(dbe);
  }
  if(theJetCleaningFlag) {
    theCleanedAKJetAnalyzer->beginJob(dbe);
    if(theSConeJetAnalyzerFlag) theCleanedSCJetAnalyzer->beginJob(dbe); 
    if(theIConeJetAnalyzerFlag) theCleanedICJetAnalyzer->beginJob(dbe);
  }
  if(theDiJetSelectionFlag) theDiJetAnalyzer->beginJob(dbe); 
  if(theJetPtAnalyzerFlag ) {
    thePtAKJetAnalyzer->beginJob(dbe);
    if(theSConeJetAnalyzerFlag) thePtSCJetAnalyzer->beginJob(dbe);
    if(theIConeJetAnalyzerFlag) thePtICJetAnalyzer->beginJob(dbe);
  }
  if(theJetPtCleaningFlag ) {
    theCleanedPtAKJetAnalyzer->beginJob(dbe);
    if(theSConeJetAnalyzerFlag) theCleanedPtSCJetAnalyzer->beginJob(dbe);
    if(theIConeJetAnalyzerFlag) theCleanedPtICJetAnalyzer->beginJob(dbe);
  }

  if(theJPTJetAnalyzerFlag) theJPTJetAnalyzer->beginJob(dbe);
  if(theJPTJetCleaningFlag) theCleanedJPTJetAnalyzer->beginJob(dbe);

  if(thePFJetAnalyzerFlag)  thePFJetAnalyzer->beginJob(dbe);
  if(thePFJetCleaningFlag)  theCleanedPFJetAnalyzer->beginJob(dbe);

  //
  //--- MET
  if(theCaloMETAnalyzerFlag){
    theCaloMETAnalyzer->beginJob(dbe);
    theCaloMETNoHFAnalyzer->beginJob(dbe);
    theCaloMETHOAnalyzer->beginJob(dbe);
    theCaloMETNoHFHOAnalyzer->beginJob(dbe);
  }
  if(theTcMETAnalyzerFlag) theTcMETAnalyzer->beginJob(dbe);
  if(theMuCorrMETAnalyzerFlag) theMuCorrMETAnalyzer->beginJob(dbe);
  if(thePfMETAnalyzerFlag) thePfMETAnalyzer->beginJob(dbe);
  if(theHTMHTAnalyzerFlag) theHTMHTAnalyzer->beginJob(dbe);
  
  dbe->setCurrentFolder("JetMET");
  lumisecME = dbe->book1D("lumisec", "lumisec", 500, 0., 500.);

}
void JetMETAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Initialize run-based parameters.

Reimplemented from edm::EDAnalyzer.

Definition at line 332 of file JetMETAnalyzer.cc.

References j, and LogDebug.

{
  //LogDebug("JetMETAnalyzer") << "beginRun, run " << run.id();
  //

  if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
  if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
  //--- htlConfig_
  //processname_="HLT";
  bool changed(true);
  _hlt_initialized = hltConfig_.init(iRun,iSetup,processname_,changed);
  if (!_hlt_initialized) {
  //if (!hltConfig_.init(iRun,iSetup,processname_,changed)) {
    processname_ = "FU";
    _hlt_initialized = hltConfig_.init(iRun,iSetup,processname_,changed);
    if(!_hlt_initialized){
      //if (!hltConfig_.init(iRun,iSetup,processname_,changed)){
      LogDebug("JetMETAnalyzer") << "HLTConfigProvider failed to initialize.";
    }
  }

  hltpathME = 0;
  if (_hlt_initialized) {
  //if (hltConfig_.init(iRun,iSetup,processname_,changed)) {
    if (hltConfig_.size()){
      dbe->setCurrentFolder("JetMET");
      hltpathME = dbe->book1D("hltpath", "hltpath", 300, 0., 300.);
    }
    
    for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
      if (hltpathME) hltpathME->setBinLabel(j+1,hltConfig_.triggerName(j));
      // if (hltConfig_.triggerName(j)=="HLT_PhysicsDeclared") 
    }
  }  
  //
  //--- Jet

  //
  //--- MET
  if(theCaloMETAnalyzerFlag){
    theCaloMETAnalyzer->beginRun(iRun, iSetup);
    theCaloMETNoHFAnalyzer->beginRun(iRun, iSetup);
    theCaloMETHOAnalyzer->beginRun(iRun, iSetup);
    theCaloMETNoHFHOAnalyzer->beginRun(iRun, iSetup);
  }
  if(theTcMETAnalyzerFlag) theTcMETAnalyzer->beginRun(iRun, iSetup);
  if(theMuCorrMETAnalyzerFlag) theMuCorrMETAnalyzer->beginRun(iRun, iSetup);
  if(thePfMETAnalyzerFlag) thePfMETAnalyzer->beginRun(iRun, iSetup);
  //if(theHTMHTAnalyzerFlag) theHTMHTAnalyzer->beginRun(iRun, iSetup);

}
void JetMETAnalyzer::endJob ( void  ) [virtual]

Save the histos.

Reimplemented from edm::EDAnalyzer.

Definition at line 783 of file JetMETAnalyzer.cc.

References LogTrace, metname, dumpDBToFile_GT_ttrig_cfg::outputFileName, and Parameters::parameters.

                                {
  LogTrace(metname)<<"[JetMETAnalyzer] Saving the histos";
  bool outputMEsInRootFile   = parameters.getParameter<bool>("OutputMEsInRootFile");
  std::string outputFileName = parameters.getParameter<std::string>("OutputFileName");


  //--- MET
  if(theCaloMETAnalyzerFlag){
    theCaloMETAnalyzer->endJob();
    theCaloMETNoHFAnalyzer->endJob();
    theCaloMETHOAnalyzer->endJob();
    theCaloMETNoHFHOAnalyzer->endJob();
  }
  if(theTcMETAnalyzerFlag) theTcMETAnalyzer->endJob();
  if(theMuCorrMETAnalyzerFlag) theMuCorrMETAnalyzer->endJob();
  if(thePfMETAnalyzerFlag)   thePfMETAnalyzer->endJob();
  //if(theHTMHTAnalyzerFlag) theHTMHTAnalyzer->endJob();
  
  //--- Jet
  if(theJetAnalyzerFlag) { 
    theAKJetAnalyzer->endJob();
    if(theSConeJetAnalyzerFlag) theSCJetAnalyzer->endJob(); 
    if(theIConeJetAnalyzerFlag) theICJetAnalyzer->endJob();
  }

  if(theJetCleaningFlag) {
    theCleanedAKJetAnalyzer->endJob();
    if(theSConeJetAnalyzerFlag) theCleanedSCJetAnalyzer->endJob(); 
    if(theIConeJetAnalyzerFlag) theCleanedICJetAnalyzer->endJob();
  }

  if(theDiJetSelectionFlag) theDiJetAnalyzer->endJob();

  if(theJetPtAnalyzerFlag ) {
    thePtAKJetAnalyzer->endJob();
    if(theSConeJetAnalyzerFlag) thePtSCJetAnalyzer->endJob();
    if(theIConeJetAnalyzerFlag) thePtICJetAnalyzer->endJob();
  }

  if(theJetPtCleaningFlag ) {
    theCleanedPtAKJetAnalyzer->endJob();
    if(theSConeJetAnalyzerFlag) theCleanedPtSCJetAnalyzer->endJob();
    if(theIConeJetAnalyzerFlag) theCleanedPtICJetAnalyzer->endJob();
  }

  if(theJPTJetAnalyzerFlag) theJPTJetAnalyzer->endJob();
  if(theJPTJetCleaningFlag) theCleanedJPTJetAnalyzer->endJob();

  if(outputMEsInRootFile){
    dbe->save(outputFileName);
  }
  
}
void JetMETAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
) [virtual]

Finish up a run.

Reimplemented from edm::EDAnalyzer.

Definition at line 385 of file JetMETAnalyzer.cc.

{
  //
  //--- Jet

  //
  //--- MET
  if(theCaloMETAnalyzerFlag){
    theCaloMETAnalyzer->endRun(iRun, iSetup, dbe);
    theCaloMETNoHFAnalyzer->endRun(iRun, iSetup, dbe);
    theCaloMETHOAnalyzer->endRun(iRun, iSetup, dbe);
    theCaloMETNoHFHOAnalyzer->endRun(iRun, iSetup, dbe);
  }
  if(theTcMETAnalyzerFlag)     theTcMETAnalyzer->endRun(iRun, iSetup, dbe);
  if(theMuCorrMETAnalyzerFlag) theMuCorrMETAnalyzer->endRun(iRun, iSetup, dbe);
  if(thePfMETAnalyzerFlag)     thePfMETAnalyzer->endRun(iRun, iSetup, dbe);
  //if(theHTMHTAnalyzerFlag)    theHTMHTAnalyzer->endRun(iRun, iSetup, dbe);

}

Member Data Documentation

Definition at line 104 of file JetMETAnalyzer.h.

Definition at line 103 of file JetMETAnalyzer.h.

Definition at line 125 of file JetMETAnalyzer.h.

Definition at line 97 of file JetMETAnalyzer.h.

std::string JetMETAnalyzer::_hlt_PhysDec [private]

Definition at line 95 of file JetMETAnalyzer.h.

Definition at line 126 of file JetMETAnalyzer.h.

int JetMETAnalyzer::_LSBegin [private]

Definition at line 116 of file JetMETAnalyzer.h.

int JetMETAnalyzer::_LSEnd [private]

Definition at line 117 of file JetMETAnalyzer.h.

Definition at line 109 of file JetMETAnalyzer.h.

Definition at line 111 of file JetMETAnalyzer.h.

std::vector<unsigned > JetMETAnalyzer::_techTrigsAND [private]

Definition at line 99 of file JetMETAnalyzer.h.

std::vector<unsigned > JetMETAnalyzer::_techTrigsNOT [private]

Definition at line 101 of file JetMETAnalyzer.h.

std::vector<unsigned > JetMETAnalyzer::_techTrigsOR [private]

Definition at line 100 of file JetMETAnalyzer.h.

Definition at line 94 of file JetMETAnalyzer.h.

Definition at line 93 of file JetMETAnalyzer.h.

Definition at line 106 of file JetMETAnalyzer.h.

Definition at line 107 of file JetMETAnalyzer.h.

double JetMETAnalyzer::_vtxchi2_max [private]

Definition at line 112 of file JetMETAnalyzer.h.

Definition at line 110 of file JetMETAnalyzer.h.

double JetMETAnalyzer::_vtxz_max [private]

Definition at line 113 of file JetMETAnalyzer.h.

Definition at line 78 of file JetMETAnalyzer.h.

Definition at line 192 of file JetMETAnalyzer.h.

Definition at line 194 of file JetMETAnalyzer.h.

Definition at line 193 of file JetMETAnalyzer.h.

std::string JetMETAnalyzer::HiJetTrigger [private]

Definition at line 129 of file JetMETAnalyzer.h.

Definition at line 119 of file JetMETAnalyzer.h.

Definition at line 122 of file JetMETAnalyzer.h.

std::string JetMETAnalyzer::LoJetTrigger [private]

Definition at line 128 of file JetMETAnalyzer.h.

Definition at line 123 of file JetMETAnalyzer.h.

std::string JetMETAnalyzer::metname [private]

Definition at line 80 of file JetMETAnalyzer.h.

Definition at line 79 of file JetMETAnalyzer.h.

std::string JetMETAnalyzer::processname_ [private]

Definition at line 120 of file JetMETAnalyzer.h.

Definition at line 159 of file JetMETAnalyzer.h.

Definition at line 83 of file JetMETAnalyzer.h.

Definition at line 82 of file JetMETAnalyzer.h.

Definition at line 180 of file JetMETAnalyzer.h.

Definition at line 147 of file JetMETAnalyzer.h.

Definition at line 182 of file JetMETAnalyzer.h.

Definition at line 181 of file JetMETAnalyzer.h.

Definition at line 183 of file JetMETAnalyzer.h.

Definition at line 162 of file JetMETAnalyzer.h.

Definition at line 164 of file JetMETAnalyzer.h.

Definition at line 168 of file JetMETAnalyzer.h.

Definition at line 171 of file JetMETAnalyzer.h.

Definition at line 176 of file JetMETAnalyzer.h.

Definition at line 178 of file JetMETAnalyzer.h.

Definition at line 177 of file JetMETAnalyzer.h.

Definition at line 163 of file JetMETAnalyzer.h.

Definition at line 92 of file JetMETAnalyzer.h.

Definition at line 165 of file JetMETAnalyzer.h.

Definition at line 142 of file JetMETAnalyzer.h.

Definition at line 190 of file JetMETAnalyzer.h.

Definition at line 155 of file JetMETAnalyzer.h.

Definition at line 161 of file JetMETAnalyzer.h.

Definition at line 85 of file JetMETAnalyzer.h.

Definition at line 132 of file JetMETAnalyzer.h.

Definition at line 158 of file JetMETAnalyzer.h.

Definition at line 131 of file JetMETAnalyzer.h.

Definition at line 134 of file JetMETAnalyzer.h.

Definition at line 136 of file JetMETAnalyzer.h.

Definition at line 137 of file JetMETAnalyzer.h.

Definition at line 167 of file JetMETAnalyzer.h.

Definition at line 144 of file JetMETAnalyzer.h.

Definition at line 145 of file JetMETAnalyzer.h.

Definition at line 87 of file JetMETAnalyzer.h.

Definition at line 184 of file JetMETAnalyzer.h.

Definition at line 151 of file JetMETAnalyzer.h.

Definition at line 170 of file JetMETAnalyzer.h.

Definition at line 139 of file JetMETAnalyzer.h.

Definition at line 140 of file JetMETAnalyzer.h.

Definition at line 86 of file JetMETAnalyzer.h.

Definition at line 188 of file JetMETAnalyzer.h.

Definition at line 153 of file JetMETAnalyzer.h.

Definition at line 173 of file JetMETAnalyzer.h.

Definition at line 175 of file JetMETAnalyzer.h.

Definition at line 174 of file JetMETAnalyzer.h.

Definition at line 160 of file JetMETAnalyzer.h.

Definition at line 84 of file JetMETAnalyzer.h.

Definition at line 133 of file JetMETAnalyzer.h.

Definition at line 186 of file JetMETAnalyzer.h.

Definition at line 149 of file JetMETAnalyzer.h.

Definition at line 88 of file JetMETAnalyzer.h.