CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

PFMETAnalyzer Class Reference

#include <PFMETAnalyzer.h>

Inheritance diagram for PFMETAnalyzer:
PFMETAnalyzerBase

List of all members.

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
 Get the analysis.
void beginJob (DQMStore *dbe)
 Inizialize parameters for histo binning.
void beginRun (const edm::Run &, const edm::EventSetup &)
 Initialize run-based parameters.
void bookMESet (std::string)
void bookMonitorElement (std::string, bool)
void endJob ()
 Finish up a job.
void endRun (const edm::Run &iRun, const edm::EventSetup &iSetup, DQMStore *dbe)
 Finish up a run.
void fillMESet (const edm::Event &, std::string, const reco::PFMET &)
void fillMonitorElement (const edm::Event &, std::string, std::string, const reco::PFMET &, bool)
void makeRatePlot (std::string, double)
 PFMETAnalyzer (const edm::ParameterSet &)
 Constructor.
bool selectHighPtJetEvent (const edm::Event &)
bool selectLowPtJetEvent (const edm::Event &)
bool selectWElectronEvent (const edm::Event &)
bool selectWMuonEvent (const edm::Event &)
void setSource (std::string source)
void validateMET (const reco::PFMET &, edm::Handle< edm::View< reco::PFCandidate > >)
virtual ~PFMETAnalyzer ()
 Destructor.

Public Attributes

int evtCounter

Private Attributes

bool _allhist
bool _allSelection
bool _cleanupSelection
DQMStore_dbe
bool _doHLTPhysicsOn
bool _doPVCheck
GenericTriggerEventFlag_EleEventFlag
double _etThreshold
std::vector< std::string > _FolderNames
GenericTriggerEventFlag_HighMETEventFlag
double _highPFMETThreshold
GenericTriggerEventFlag_HighPtJetEventFlag
double _highPtPFJetThreshold
std::string _hlt_Ele
std::string _hlt_HighMET
std::string _hlt_HighPtJet
std::string _hlt_LowMET
std::string _hlt_LowPtJet
std::string _hlt_MinBias
std::string _hlt_Muon
std::string _hlt_PhysDec
GenericTriggerEventFlag_LowMETEventFlag
double _lowPFMETThreshold
GenericTriggerEventFlag_LowPtJetEventFlag
double _lowPtPFJetThreshold
GenericTriggerEventFlag_MinBiasEventFlag
GenericTriggerEventFlag_MuonEventFlag
int _nvtx_min
int _nvtxtrks_min
std::string _source
std::vector< unsigned > _techTrigsAND
std::vector< unsigned > _techTrigsNOT
std::vector< unsigned > _techTrigsOR
bool _tightBHFiltering
bool _tightHcalFiltering
int _tightJetIDFiltering
int _trig_Ele
int _trig_HighMET
int _trig_HighPtJet
int _trig_JetMB
int _trig_LowMET
int _trig_LowPtJet
int _trig_MinBias
int _trig_Muon
int _trig_PhysDec
int _verbose
double _vtxchi2_max
int _vtxndof_min
double _vtxz_max
edm::InputTag BeamHaloSummaryTag
JetMETDQMDCSFilterDCSFilter
edm::InputTag gtTag
edm::InputTag HcalNoiseRBXCollectionTag
edm::InputTag HcalNoiseSummaryTag
double hfCalibFactor_
std::vector< std::string > HLTPathsJetMBByName_
reco::helper::JetIDHelperjetID
MonitorElementmeNevents
MonitorElementmePfChargedEMFraction
MonitorElementmePfChargedHadFraction
MonitorElementmePfEz
MonitorElementmePfMET
MonitorElementmePfMET_logx
MonitorElementmePfMETHPDNoise
MonitorElementmePfMETIonFeedbck
MonitorElementmePfMETPhi
MonitorElementmePfMETRate
MonitorElementmePfMETRBXNoise
MonitorElementmePfMETSig
MonitorElementmePfMEx
MonitorElementmePfMExLS
MonitorElementmePfMEy
MonitorElementmePfMEyLS
MonitorElementmePfMuonFraction
MonitorElementmePfNeutralEMFraction
MonitorElementmePfNeutralHadFraction
MonitorElementmePfSumET
MonitorElementmePfSumET_logx
MonitorElementmetME
std::string metname
MonitorElementmeTriggerName_Ele
MonitorElementmeTriggerName_HighMET
MonitorElementmeTriggerName_HighPtJet
MonitorElementmeTriggerName_LowMET
MonitorElementmeTriggerName_LowPtJet
MonitorElementmeTriggerName_MinBias
MonitorElementmeTriggerName_Muon
MonitorElementmeTriggerName_PhysDec
edm::ParameterSet parameters
edm::InputTag PFCandidatesTag
edm::ParameterSet theCleaningParameters
edm::InputTag theJetCollectionLabel
edm::InputTag thePfJetCollectionLabel
edm::InputTag thePfMETCollectionLabel
edm::InputTag vertexTag

Detailed Description

DQM monitoring source for PFMET

Date:
2010/09/23 20:39:01
Revision:
1.21
Author:
K. Hatakeyama - Rockefeller University A.Apresyan - Caltech

Definition at line 51 of file PFMETAnalyzer.h.


Constructor & Destructor Documentation

PFMETAnalyzer::PFMETAnalyzer ( const edm::ParameterSet pSet)

Constructor.

Definition at line 37 of file PFMETAnalyzer.cc.

References Parameters::parameters.

                                                        {

  parameters = pSet;

  edm::ParameterSet highptjetparms = parameters.getParameter<edm::ParameterSet>("highPtJetTrigger");
  edm::ParameterSet lowptjetparms  = parameters.getParameter<edm::ParameterSet>("lowPtJetTrigger" );
  edm::ParameterSet minbiasparms   = parameters.getParameter<edm::ParameterSet>("minBiasTrigger"  );
  edm::ParameterSet highmetparms   = parameters.getParameter<edm::ParameterSet>("highMETTrigger"  );
  edm::ParameterSet lowmetparms    = parameters.getParameter<edm::ParameterSet>("lowMETTrigger"   );
  edm::ParameterSet eleparms       = parameters.getParameter<edm::ParameterSet>("eleTrigger"      );
  edm::ParameterSet muonparms      = parameters.getParameter<edm::ParameterSet>("muonTrigger"     );

  //genericTriggerEventFlag_( new GenericTriggerEventFlag( conf_ ) );
  _HighPtJetEventFlag = new GenericTriggerEventFlag( highptjetparms );
  _LowPtJetEventFlag  = new GenericTriggerEventFlag( lowptjetparms  );
  _MinBiasEventFlag   = new GenericTriggerEventFlag( minbiasparms   );
  _HighMETEventFlag   = new GenericTriggerEventFlag( highmetparms   );
  _LowMETEventFlag    = new GenericTriggerEventFlag( lowmetparms    );
  _EleEventFlag       = new GenericTriggerEventFlag( eleparms       );
  _MuonEventFlag      = new GenericTriggerEventFlag( muonparms      );


}
PFMETAnalyzer::~PFMETAnalyzer ( ) [virtual]

Destructor.

Definition at line 62 of file PFMETAnalyzer.cc.


Member Function Documentation

void PFMETAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const edm::TriggerResults triggerResults 
)

Get the analysis.

Definition at line 395 of file PFMETAnalyzer.cc.

References edm::HLTGlobalStatus::accept(), gather_cfg::cout, reco::BeamHaloSummary::CSCLooseHaloId(), reco::BeamHaloSummary::CSCTightHaloId(), cmsPerfPublish::DirName, reco::BeamHaloSummary::EcalLooseHaloId(), reco::BeamHaloSummary::EcalTightHaloId(), edm::Event::getByLabel(), reco::BeamHaloSummary::GlobalLooseHaloId(), reco::BeamHaloSummary::GlobalTightHaloId(), reco::BeamHaloSummary::HcalLooseHaloId(), reco::BeamHaloSummary::HcalTightHaloId(), i, edm::HandleBase::isValid(), LogDebug, LogTrace, metname, reco::tau::pfCandidates(), python::pfJets_cff::pfJets, edm::Handle< T >::product(), edm::HLTGlobalStatus::size(), edm::TriggerNames::size(), edm::TriggerNames::triggerIndex(), edm::Event::triggerNames(), v, and GoodVertex_cfg::vertexCollection.

                                                                     {

  if (_verbose) std::cout << "PfMETAnalyzer analyze" << std::endl;

  LogTrace(metname)<<"[PFMETAnalyzer] Analyze PFMET";

  metME->Fill(3);

  // ==========================================================  
  // Trigger information 
  //
  _trig_JetMB=0;
  _trig_HighPtJet=0;
  _trig_LowPtJet=0;
  _trig_MinBias=0;
  _trig_HighMET=0;
  _trig_LowMET=0;
  _trig_Ele=0;
  _trig_Muon=0;
  _trig_PhysDec=0;
  if(&triggerResults) {   


    //
    //
    // Check how many HLT triggers are in triggerResults 
    int ntrigs = triggerResults.size();
    if (_verbose) std::cout << "ntrigs=" << ntrigs << std::endl;
    
    //
    //
    // If index=ntrigs, this HLT trigger doesn't exist in the HLT table for this data.
    const edm::TriggerNames & triggerNames = iEvent.triggerNames(triggerResults);
    
    //
    //
    // count number of requested Jet or MB HLT paths which have fired
    for (unsigned int i=0; i!=HLTPathsJetMBByName_.size(); i++) {
      unsigned int triggerIndex = triggerNames.triggerIndex(HLTPathsJetMBByName_[i]);
      if (triggerIndex<triggerResults.size()) {
        if (triggerResults.accept(triggerIndex)) {
          _trig_JetMB++;
        }
      }
    }
    // for empty input vectors (n==0), take all HLT triggers!
    if (HLTPathsJetMBByName_.size()==0) _trig_JetMB=triggerResults.size()-1;

    //
    //if (_verbose) std::cout << "triggerNames size" << " " << triggerNames.size() << std::endl;
    //if (_verbose) std::cout << _hlt_HighPtJet << " " << triggerNames.triggerIndex(_hlt_HighPtJet) << std::endl;
    //if (_verbose) std::cout << _hlt_LowPtJet  << " " << triggerNames.triggerIndex(_hlt_LowPtJet)  << std::endl;
    //if (_verbose) std::cout << _hlt_MinBias   << " " << triggerNames.triggerIndex(_hlt_MinBias)   << std::endl;
    //if (_verbose) std::cout << _hlt_HighMET   << " " << triggerNames.triggerIndex(_hlt_HighMET)   << std::endl;
    //if (_verbose) std::cout << _hlt_LowMET    << " " << triggerNames.triggerIndex(_hlt_LowMET)    << std::endl;
    //if (_verbose) std::cout << _hlt_Ele       << " " << triggerNames.triggerIndex(_hlt_Ele)       << std::endl;
    //if (_verbose) std::cout << _hlt_Muon      << " " << triggerNames.triggerIndex(_hlt_Muon)      << std::endl;
    //if (_verbose) std::cout << _hlt_PhysDec   << " " << triggerNames.triggerIndex(_hlt_PhysDec)   << std::endl;

    if ( _HighPtJetEventFlag->on() && _HighPtJetEventFlag->accept( iEvent, iSetup ) ) 
      _trig_HighPtJet=1;

    if ( _LowPtJetEventFlag->on() && _LowPtJetEventFlag->accept( iEvent, iSetup ) ) 
      _trig_LowPtJet=1;
    
    if ( _MinBiasEventFlag->on() && _MinBiasEventFlag->accept( iEvent, iSetup ) ) 
      _trig_MinBias=1;
    
    if ( _HighMETEventFlag->on() && _HighMETEventFlag->accept( iEvent, iSetup ) ) 
      _trig_HighMET=1;
    
    if ( _LowMETEventFlag->on() && _LowMETEventFlag->accept( iEvent, iSetup ) ) 
      _trig_LowMET=1;
    
    if ( _EleEventFlag->on() && _EleEventFlag->accept( iEvent, iSetup ) ) 
      _trig_Ele=1;
    
    if ( _MuonEventFlag->on() && _MuonEventFlag->accept( iEvent, iSetup ) ) 
      _trig_Muon=1;
    
    if (triggerNames.triggerIndex(_hlt_PhysDec)   != triggerNames.size() &&
        triggerResults.accept(triggerNames.triggerIndex(_hlt_PhysDec)))   _trig_PhysDec=1;
    
  } else {

    edm::LogInfo("PFMetAnalyzer") << "TriggerResults::HLT not found, "
      "automatically select events"; 

    // TriggerResults object not found. Look at all events.    
    _trig_JetMB=1;
  }

  // ==========================================================
  // PfMET information
  
  // **** Get the MET container  
  edm::Handle<reco::PFMETCollection> pfmetcoll;
  iEvent.getByLabel(thePfMETCollectionLabel, pfmetcoll);
  
  if(!pfmetcoll.isValid()) return;

  const PFMETCollection *pfmetcol = pfmetcoll.product();
  const PFMET *pfmet;
  pfmet = &(pfmetcol->front());
    
  LogTrace(metname)<<"[PfMETAnalyzer] Call to the PfMET analyzer";

  // ==========================================================
  //
  edm::Handle<HcalNoiseRBXCollection> HRBXCollection;
  iEvent.getByLabel(HcalNoiseRBXCollectionTag,HRBXCollection);
  if (!HRBXCollection.isValid()) {
    LogDebug("") << "PfMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
    if (_verbose) std::cout << "PfMETAnalyzer: Could not find HcalNoiseRBX Collection" << std::endl;
  }
  
  edm::Handle<HcalNoiseSummary> HNoiseSummary;
  iEvent.getByLabel(HcalNoiseSummaryTag,HNoiseSummary);
  if (!HNoiseSummary.isValid()) {
    LogDebug("") << "PfMETAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
    if (_verbose) std::cout << "PfMETAnalyzer: Could not find Hcal NoiseSummary product" << std::endl;
  }

  edm::Handle<reco::CaloJetCollection> caloJets;
  iEvent.getByLabel(theJetCollectionLabel, caloJets);
  if (!caloJets.isValid()) {
    LogDebug("") << "PFMETAnalyzer: Could not find jet product" << std::endl;
    if (_verbose) std::cout << "PFMETAnalyzer: Could not find jet product" << std::endl;
  }

  edm::Handle<edm::View<PFCandidate> > pfCandidates;
  iEvent.getByLabel(PFCandidatesTag, pfCandidates);
  if (!pfCandidates.isValid()) {
    LogDebug("") << "PfMETAnalyzer: Could not find pfcandidates product" << std::endl;
    if (_verbose) std::cout << "PfMETAnalyzer: Could not find pfcandidates product" << std::endl;
  }

  edm::Handle<reco::PFJetCollection> pfJets;
  iEvent.getByLabel(thePfJetCollectionLabel, pfJets);
  if (!pfJets.isValid()) {
    LogDebug("") << "PFMETAnalyzer: Could not find pfjet product" << std::endl;
    if (_verbose) std::cout << "PFMETAnalyzer: Could not find pfjet product" << std::endl;
  }
  // ==========================================================
  // PfMET sanity check

  if (_source=="PfMET") validateMET(*pfmet, pfCandidates);
  
  // ==========================================================
  // JetID 

  if (_verbose) std::cout << "JetID starts" << std::endl;
  
  //
  // --- Minimal cuts
  //
  bool bJetIDMinimal=true;
  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin(); 
       cal!=caloJets->end(); ++cal){
    jetID->calculate(iEvent, *cal);
    if (cal->pt()>10.){
      if (fabs(cal->eta())<=2.6 && 
          cal->emEnergyFraction()<=0.01) bJetIDMinimal=false;
    }
  }

  //
  // --- Loose cuts, not PF specific for now!
  //
  bool bJetIDLoose=true;
  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin(); 
       cal!=caloJets->end(); ++cal){ 
    jetID->calculate(iEvent, *cal);
    if (_verbose) std::cout << jetID->n90Hits() << " " 
                            << jetID->restrictedEMF() << " "
                            << cal->pt() << std::endl;
    if (cal->pt()>10.){
      //
      // for all regions
      if (jetID->n90Hits()<2)  bJetIDLoose=false; 
      if (jetID->fHPD()>=0.98) bJetIDLoose=false; 
      //if (jetID->restrictedEMF()<0.01) bJetIDLoose=false; 
      //
      // for non-forward
      if (fabs(cal->eta())<2.55){
        if (cal->emEnergyFraction()<=0.01) bJetIDLoose=false; 
      }
      // for forward
      else {
        if (cal->emEnergyFraction()<=-0.9) bJetIDLoose=false; 
        if (cal->pt()>80.){
          if (cal->emEnergyFraction()>= 1.0) bJetIDLoose=false; 
        }
      } // forward vs non-forward
    }   // pt>10 GeV/c
  }     // calor-jets loop
 
  //
  // --- Tight cuts
  //
  bool bJetIDTight=true;
  bJetIDTight=bJetIDLoose;
  for (reco::CaloJetCollection::const_iterator cal = caloJets->begin(); 
       cal!=caloJets->end(); ++cal){
    jetID->calculate(iEvent, *cal);
    if (cal->pt()>25.){
      //
      // for all regions
      if (jetID->fHPD()>=0.95) bJetIDTight=false; 
      //
      // for 1.0<|eta|<1.75
      if (fabs(cal->eta())>=1.00 && fabs(cal->eta())<1.75){
        if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false; 
      }
      //
      // for 1.75<|eta|<2.55
      else if (fabs(cal->eta())>=1.75 && fabs(cal->eta())<2.55){
        if (cal->pt()>80. && cal->emEnergyFraction()>=1.) bJetIDTight=false; 
      }
      //
      // for 2.55<|eta|<3.25
      else if (fabs(cal->eta())>=2.55 && fabs(cal->eta())<3.25){
        if (cal->pt()< 50.                   && cal->emEnergyFraction()<=-0.3) bJetIDTight=false; 
        if (cal->pt()>=50. && cal->pt()< 80. && cal->emEnergyFraction()<=-0.2) bJetIDTight=false; 
        if (cal->pt()>=80. && cal->pt()<340. && cal->emEnergyFraction()<=-0.1) bJetIDTight=false; 
        if (cal->pt()>=340.                  && cal->emEnergyFraction()<=-0.1 
            && cal->emEnergyFraction()>=0.95) bJetIDTight=false; 
      }
      //
      // for 3.25<|eta|
      else if (fabs(cal->eta())>=3.25){
        if (cal->pt()< 50.                   && cal->emEnergyFraction()<=-0.3
            && cal->emEnergyFraction()>=0.90) bJetIDTight=false; 
        if (cal->pt()>=50. && cal->pt()<130. && cal->emEnergyFraction()<=-0.2
            && cal->emEnergyFraction()>=0.80) bJetIDTight=false; 
        if (cal->pt()>=130.                  && cal->emEnergyFraction()<=-0.1 
            && cal->emEnergyFraction()>=0.70) bJetIDTight=false; 
      }
    }   // pt>10 GeV/c
  }     // calor-jets loop
  
  if (_verbose) std::cout << "JetID ends" << std::endl;


  // ==========================================================
  // HCAL Noise filter
  
  bool bHcalNoiseFilter      = HNoiseSummary->passLooseNoiseFilter();
  bool bHcalNoiseFilterTight = HNoiseSummary->passTightNoiseFilter();

  // ==========================================================
  // Get BeamHaloSummary
  edm::Handle<BeamHaloSummary> TheBeamHaloSummary ;
  iEvent.getByLabel(BeamHaloSummaryTag, TheBeamHaloSummary) ;

  bool bBeamHaloIDTightPass = true;
  bool bBeamHaloIDLoosePass = true;

  if(!TheBeamHaloSummary.isValid()) {

    const BeamHaloSummary TheSummary = (*TheBeamHaloSummary.product() );

    if( !TheSummary.EcalLooseHaloId()  && !TheSummary.HcalLooseHaloId() && 
        !TheSummary.CSCLooseHaloId()   && !TheSummary.GlobalLooseHaloId() )
      bBeamHaloIDLoosePass = false;

    if( !TheSummary.EcalTightHaloId()  && !TheSummary.HcalTightHaloId() && 
        !TheSummary.CSCTightHaloId()   && !TheSummary.GlobalTightHaloId() )
      bBeamHaloIDTightPass = false;

  }

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

    iEvent.getByLabel(vertexTag, vertexHandle);

    if (!vertexHandle.isValid()) {
      LogDebug("") << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
      if (_verbose) std::cout << "CaloMETAnalyzer: Could not find vertex collection" << std::endl;
    }
    
    if ( vertexHandle.isValid() ){
      VertexCollection vertexCollection = *(vertexHandle.product());
      int vertex_number     = vertexCollection.size();
      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( gtTag, gtReadoutRecord);

  if (!gtReadoutRecord.isValid()) {
    LogDebug("") << "CaloMETAnalyzer: Could not find GT readout record" << std::endl;
    if (_verbose) std::cout << "CaloMETAnalyzer: 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;

  // ==========================================================
  // Reconstructed MET Information - fill MonitorElements
  
  bool bHcalNoise   = bHcalNoiseFilter;
  bool bBeamHaloID  = bBeamHaloIDLoosePass;
  bool bJetID       = bJetIDMinimal;

  bool bPhysicsDeclared = true;
  if(_doHLTPhysicsOn) bPhysicsDeclared =_trig_PhysDec;

  if      (_tightHcalFiltering)     bHcalNoise  = bHcalNoiseFilterTight;
  if      (_tightBHFiltering)       bBeamHaloID = bBeamHaloIDTightPass;

  if      (_tightJetIDFiltering==1)  bJetID      = bJetIDMinimal;
  else if (_tightJetIDFiltering==2)  bJetID      = bJetIDLoose;
  else if (_tightJetIDFiltering==3)  bJetID      = bJetIDTight;
  else if (_tightJetIDFiltering==-1) bJetID      = true;

  bool bBasicCleanup = bTechTriggers && bPrimaryVertex && bPhysicsDeclared;
  bool bExtraCleanup = bBasicCleanup && bHcalNoise && bJetID && bBeamHaloID;
  
  std::string DirName = "JetMET/MET/"+_source;
  
  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); 
       ic != _FolderNames.end(); ic++){
    if (*ic=="All")                                             fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
    if (DCSFilter->filter(iEvent, iSetup)) {
    if (_cleanupSelection){
    if (*ic=="BasicCleanup" && bBasicCleanup)                   fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
    if (*ic=="ExtraCleanup" && bExtraCleanup)                   fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
    }
    if (_allSelection) {
      if (*ic=="HcalNoiseFilter"      && bHcalNoiseFilter )       fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="HcalNoiseFilterTight" && bHcalNoiseFilterTight )  fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="JetIDMinimal"         && bJetIDMinimal)           fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="JetIDLoose"           && bJetIDLoose)             fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="JetIDTight"           && bJetIDTight)             fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="BeamHaloIDTightPass"  && bBeamHaloIDTightPass)    fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="BeamHaloIDLoosePass"  && bBeamHaloIDLoosePass)    fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="Triggers"             && bTechTriggers)           fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
      if (*ic=="PV"                   && bPrimaryVertex)          fillMESet(iEvent, DirName+"/"+*ic, *pfmet);
    }
    } // DCS
  }
}
void PFMETAnalyzer::beginJob ( DQMStore dbe) [virtual]

Inizialize parameters for histo binning.

Implements PFMETAnalyzerBase.

Definition at line 74 of file PFMETAnalyzer.cc.

References DQMStore::book1D(), cmsPerfPublish::DirName, edm::ParameterSet::getParameter(), LogTrace, metname, Parameters::parameters, MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

                                           {

  evtCounter = 0;
  metname = "pfMETAnalyzer";

  // trigger information
  HLTPathsJetMBByName_ = parameters.getParameter<std::vector<std::string > >("HLTPathsJetMB");

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

  //Trigger parameters
  gtTag          = theCleaningParameters.getParameter<edm::InputTag>("gtLabel");
  _techTrigsAND  = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsAND");
  _techTrigsOR   = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsOR");
  _techTrigsNOT  = theCleaningParameters.getParameter<std::vector<unsigned > >("techTrigsNOT");

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

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

  // ==========================================================
  //DCS information
  // ==========================================================
  DCSFilter = new JetMETDQMDCSFilter(parameters.getParameter<ParameterSet>("DCSFilter"));

  //Vertex requirements
  _doPVCheck          = theCleaningParameters.getParameter<bool>("doPrimaryVertexCheck");
  vertexTag  = theCleaningParameters.getParameter<edm::InputTag>("vertexLabel");

  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");
  }


  // PFMET information
  thePfMETCollectionLabel       = parameters.getParameter<edm::InputTag>("METCollectionLabel");
  thePfJetCollectionLabel       = parameters.getParameter<edm::InputTag>("PfJetCollectionLabel");
  _source                       = parameters.getParameter<std::string>("Source");

  // Other data collections
  theJetCollectionLabel       = parameters.getParameter<edm::InputTag>("JetCollectionLabel");
  PFCandidatesTag             = parameters.getParameter<edm::InputTag>("PFCandidates");
  HcalNoiseRBXCollectionTag   = parameters.getParameter<edm::InputTag>("HcalNoiseRBXCollection");
  HcalNoiseSummaryTag         = parameters.getParameter<edm::InputTag>("HcalNoiseSummary");
  BeamHaloSummaryTag          = parameters.getParameter<edm::InputTag>("BeamHaloSummaryLabel");

  // misc
  _verbose     = parameters.getParameter<int>("verbose");
  _etThreshold = parameters.getParameter<double>("etThreshold"); // MET threshold
  _allhist     = parameters.getParameter<bool>("allHist");       // Full set of monitoring histograms
  _allSelection= parameters.getParameter<bool>("allSelection");  // Plot with all sets of event selection
  _cleanupSelection= parameters.getParameter<bool>("cleanupSelection");  // Plot with all sets of event selection

  _highPtPFJetThreshold = parameters.getParameter<double>("HighPtJetThreshold"); // High Pt Jet threshold
  _lowPtPFJetThreshold  = parameters.getParameter<double>("LowPtJetThreshold");   // Low Pt Jet threshold
  _highPFMETThreshold   = parameters.getParameter<double>("HighMETThreshold");     // High MET threshold
  _lowPFMETThreshold    = parameters.getParameter<double>("LowMETThreshold");       // Low MET threshold

  //
  jetID = new reco::helper::JetIDHelper(parameters.getParameter<ParameterSet>("JetIDParams"));

  // DQStore stuff
  LogTrace(metname)<<"[PFMETAnalyzer] Parameters initialization";
  std::string DirName = "JetMET/MET/"+_source;
  dbe->setCurrentFolder(DirName);

  metME = dbe->book1D("metReco", "metReco", 4, 1, 5);
  metME->setBinLabel(3,"PFMET",1);

  _dbe = dbe;

  _FolderNames.push_back("All");
  _FolderNames.push_back("BasicCleanup");
  _FolderNames.push_back("ExtraCleanup");
  _FolderNames.push_back("HcalNoiseFilter");
  _FolderNames.push_back("HcalNoiseFilterTight");
  _FolderNames.push_back("JetIDMinimal");
  _FolderNames.push_back("JetIDLoose");
  _FolderNames.push_back("JetIDTight");
  _FolderNames.push_back("BeamHaloIDTightPass");
  _FolderNames.push_back("BeamHaloIDLoosePass");
  _FolderNames.push_back("Triggers");
  _FolderNames.push_back("PV");

  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); 
       ic != _FolderNames.end(); ic++){
    if (*ic=="All")             bookMESet(DirName+"/"+*ic);
    if (_cleanupSelection){
    if (*ic=="BasicCleanup")    bookMESet(DirName+"/"+*ic);
    if (*ic=="ExtraCleanup")    bookMESet(DirName+"/"+*ic);
    }
    if (_allSelection){
      if (*ic=="HcalNoiseFilter")      bookMESet(DirName+"/"+*ic);
      if (*ic=="HcalNoiseFilterTight") bookMESet(DirName+"/"+*ic);
      if (*ic=="JetIDMinimal")         bookMESet(DirName+"/"+*ic);
      if (*ic=="JetIDLoose")           bookMESet(DirName+"/"+*ic);
      if (*ic=="JetIDTight")           bookMESet(DirName+"/"+*ic);
      if (*ic=="BeamHaloIDTightPass")  bookMESet(DirName+"/"+*ic);
      if (*ic=="BeamHaloIDLoosePass")  bookMESet(DirName+"/"+*ic);
      if (*ic=="Triggers")             bookMESet(DirName+"/"+*ic);
      if (*ic=="PV")                   bookMESet(DirName+"/"+*ic);
    }
  }
}
void PFMETAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)

Initialize run-based parameters.

Definition at line 298 of file PFMETAnalyzer.cc.

{
  if ( _HighPtJetEventFlag->on() ) _HighPtJetEventFlag->initRun( iRun, iSetup );
  if ( _LowPtJetEventFlag ->on() ) _LowPtJetEventFlag ->initRun( iRun, iSetup );
  if ( _MinBiasEventFlag  ->on() ) _MinBiasEventFlag  ->initRun( iRun, iSetup );
  if ( _HighMETEventFlag  ->on() ) _HighMETEventFlag  ->initRun( iRun, iSetup );
  if ( _LowMETEventFlag   ->on() ) _LowMETEventFlag   ->initRun( iRun, iSetup );
  if ( _EleEventFlag      ->on() ) _EleEventFlag      ->initRun( iRun, iSetup );
  if ( _MuonEventFlag     ->on() ) _MuonEventFlag     ->initRun( iRun, iSetup );

}
void PFMETAnalyzer::bookMESet ( std::string  DirName)

Definition at line 195 of file PFMETAnalyzer.cc.

{

  bool bLumiSecPlot=false;
  if (DirName.find("All")!=std::string::npos) bLumiSecPlot=true;

  bookMonitorElement(DirName,bLumiSecPlot);

  if ( _HighPtJetEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"HighPtJet",false);
    meTriggerName_HighPtJet = _dbe->bookString("triggerName_HighPtJet", _hlt_HighPtJet);
  }  

  if ( _LowPtJetEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"LowPtJet",false);
    meTriggerName_LowPtJet = _dbe->bookString("triggerName_LowPtJet", _hlt_LowPtJet);
  }

  if ( _MinBiasEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"MinBias",false);
    meTriggerName_MinBias = _dbe->bookString("triggerName_MinBias", _hlt_MinBias);
  }

  if ( _HighMETEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"HighMET",false);
    meTriggerName_HighMET = _dbe->bookString("triggerName_HighMET", _hlt_HighMET);
  }

  if ( _LowMETEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"LowMET",false);
    meTriggerName_LowMET = _dbe->bookString("triggerName_LowMET", _hlt_LowMET);
  }

  if ( _EleEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"Ele",false);
    meTriggerName_Ele = _dbe->bookString("triggerName_Ele", _hlt_Ele);
  }

  if ( _MuonEventFlag->on() ) {
    bookMonitorElement(DirName+"/"+"Muon",false);
    meTriggerName_Muon = _dbe->bookString("triggerName_Muon", _hlt_Muon);
  }
}
void PFMETAnalyzer::bookMonitorElement ( std::string  DirName,
bool  bLumiSecPlot = false 
)

Definition at line 240 of file PFMETAnalyzer.cc.

References gather_cfg::cout, and Pi.

{

  if (_verbose) std::cout << "booMonitorElement " << DirName << std::endl;
  _dbe->setCurrentFolder(DirName);
 
  meNevents              = _dbe->book1D("METTask_Nevents", "METTask_Nevents"   ,1,0,1);
  mePfMEx                = _dbe->book1D("METTask_PfMEx",   "METTask_PfMEx"   ,500,-500,500);
  mePfMEx->setAxisTitle("MEx [GeV]",1);
  mePfMEy                = _dbe->book1D("METTask_PfMEy",   "METTask_PfMEy"   ,500,-500,500);
  mePfMEy->setAxisTitle("MEy [GeV]",1);
  mePfEz                 = _dbe->book1D("METTask_PfEz",    "METTask_PfEz"    ,500,-500,500);
  mePfEz->setAxisTitle("MEz [GeV]",1);
  mePfMETSig             = _dbe->book1D("METTask_PfMETSig","METTask_PfMETSig",51,0,51);
  mePfMETSig->setAxisTitle("METSig",1);
  mePfMET                = _dbe->book1D("METTask_PfMET",   "METTask_PfMET"   ,500,0,1000);
  mePfMET->setAxisTitle("MET [GeV]",1);
  mePfMETPhi             = _dbe->book1D("METTask_PfMETPhi","METTask_PfMETPhi",80,-TMath::Pi(),TMath::Pi());
  mePfMETPhi->setAxisTitle("METPhi [rad]",1);
  mePfSumET              = _dbe->book1D("METTask_PfSumET", "METTask_PfSumET" ,500,0,2000);
  mePfSumET->setAxisTitle("SumET [GeV]",1);

  mePfMET_logx           = _dbe->book1D("METTask_PfMET_logx",   "METTask_PfMET_logx"   ,40,-1.,7.);
  mePfMET_logx->setAxisTitle("log(MET) [GeV]",1);
  mePfSumET_logx         = _dbe->book1D("METTask_PfSumET_logx", "METTask_PfSumET_logx" ,40,-1.,7.);
  mePfSumET_logx->setAxisTitle("log(SumET) [GeV]",1);

  mePfNeutralEMFraction  = _dbe->book1D("METTask_PfNeutralEMFraction", "METTask_PfNeutralEMFraction" ,50,0.,1.);
  mePfNeutralEMFraction->setAxisTitle("Pf Neutral EM Fraction",1);
  mePfNeutralHadFraction = _dbe->book1D("METTask_PfNeutralHadFraction","METTask_PfNeutralHadFraction",50,0.,1.);
  mePfNeutralHadFraction->setAxisTitle("Pf Neutral Had Fraction",1);
  mePfChargedEMFraction  = _dbe->book1D("METTask_PfChargedEMFraction", "METTask_PfChargedEMFraction" ,50,0.,1.);
  mePfChargedEMFraction->setAxisTitle("Pf Charged EM Fraction",1);
  mePfChargedHadFraction = _dbe->book1D("METTask_PfChargedHadFraction","METTask_PfChargedHadFraction",50,0.,1.);
  mePfChargedHadFraction->setAxisTitle("Pf Charged Had Fraction",1);
  mePfMuonFraction       = _dbe->book1D("METTask_PfMuonFraction",      "METTask_PfMuonFraction"      ,50,0.,1.);
  mePfMuonFraction->setAxisTitle("Pf Muon Fraction",1);

  mePfMETIonFeedbck      = _dbe->book1D("METTask_PfMETIonFeedbck", "METTask_PfMETIonFeedbck" ,500,0,1000);
  mePfMETIonFeedbck->setAxisTitle("MET [GeV]",1);
  mePfMETHPDNoise        = _dbe->book1D("METTask_PfMETHPDNoise",   "METTask_PfMETHPDNoise"   ,500,0,1000);
  mePfMETHPDNoise->setAxisTitle("MET [GeV]",1);
  mePfMETRBXNoise        = _dbe->book1D("METTask_PfMETRBXNoise",   "METTask_PfMETRBXNoise"   ,500,0,1000);
  mePfMETRBXNoise->setAxisTitle("MET [GeV]",1);

  if (_allhist){
    if (bLumiSecPlot){
      mePfMExLS              = _dbe->book2D("METTask_PfMEx_LS","METTask_PfMEx_LS",200,-200,200,50,0.,500.);
      mePfMExLS->setAxisTitle("MEx [GeV]",1);
      mePfMExLS->setAxisTitle("Lumi Section",2);
      mePfMEyLS              = _dbe->book2D("METTask_PfMEy_LS","METTask_PfMEy_LS",200,-200,200,50,0.,500.);
      mePfMEyLS->setAxisTitle("MEy [GeV]",1);
      mePfMEyLS->setAxisTitle("Lumi Section",2);
    }
  }
}
void PFMETAnalyzer::endJob ( void  )

Finish up a job.

Definition at line 187 of file PFMETAnalyzer.cc.

                           {

  delete jetID;
  delete DCSFilter;

}
void PFMETAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup,
DQMStore dbe 
)

Finish up a run.

Definition at line 311 of file PFMETAnalyzer.cc.

References cmsPerfPublish::DirName, TrackerOfflineValidation_Dqm_cff::dirName, MonitorElement::getRootObject(), MonitorElement::getTH1F(), and i.

{
  
  //
  //--- Check the time length of the Run from the lumi section plots

  std::string dirName = "JetMET/MET/"+_source+"/";
  _dbe->setCurrentFolder(dirName);

  TH1F* tlumisec;

  MonitorElement *meLumiSec = _dbe->get("aaa");
  meLumiSec = _dbe->get("JetMET/lumisec");

  int totlsec=0;
  double totltime=0.;
  if ( meLumiSec->getRootObject() ) {
    tlumisec = meLumiSec->getTH1F();
    for (int i=0; i<500; i++){
      if (tlumisec->GetBinContent(i+1)) totlsec++;
    }
    totltime = double(totlsec*90); // one lumi sec ~ 90 (sec)
  }

  if (totltime==0.) totltime=1.; 

  //
  //--- Make the integrated plots with rate (Hz)

  for (std::vector<std::string>::const_iterator ic = _FolderNames.begin(); ic != _FolderNames.end(); ic++)
    {

      std::string DirName;
      DirName = dirName+*ic;

      makeRatePlot(DirName,totltime);
      if ( _HighPtJetEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_HighJetPt",totltime);
      if ( _LowPtJetEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_LowJetPt",totltime);
      if ( _MinBiasEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_MinBias",totltime);
      if ( _HighMETEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_HighMET",totltime);
      if ( _LowMETEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_LowMET",totltime);
      if ( _EleEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_Ele",totltime);
      if ( _MuonEventFlag->on() ) 
        makeRatePlot(DirName+"/"+"triggerName_Muon",totltime);
    }
}
void PFMETAnalyzer::fillMESet ( const edm::Event iEvent,
std::string  DirName,
const reco::PFMET pfmet 
)

Definition at line 849 of file PFMETAnalyzer.cc.

{

  _dbe->setCurrentFolder(DirName);

  bool bLumiSecPlot=false;
  if (DirName.find("All")) bLumiSecPlot=true;

  if (_trig_JetMB) fillMonitorElement(iEvent,DirName,"",pfmet, bLumiSecPlot);
  if (_trig_HighPtJet)
    fillMonitorElement(iEvent,DirName,"HighPtJet",pfmet,false);
  if (_trig_LowPtJet)
    fillMonitorElement(iEvent,DirName,"LowPtJet",pfmet,false);
  if (_trig_MinBias)
    fillMonitorElement(iEvent,DirName,"MinBias",pfmet,false);
  if (_trig_HighMET)
    fillMonitorElement(iEvent,DirName,"HighMET",pfmet,false);
  if (_trig_LowMET)
    fillMonitorElement(iEvent,DirName,"LowMET",pfmet,false);
  if (_trig_Ele)
    fillMonitorElement(iEvent,DirName,"Ele",pfmet,false);
  if (_trig_Muon)
    fillMonitorElement(iEvent,DirName,"Muon",pfmet,false);

}
void PFMETAnalyzer::fillMonitorElement ( const edm::Event iEvent,
std::string  DirName,
std::string  TriggerTypeName,
const reco::PFMET pfmet,
bool  bLumiSecPlot 
)

Definition at line 877 of file PFMETAnalyzer.cc.

References reco::PFMET::ChargedEMFraction(), reco::PFMET::ChargedHadFraction(), gather_cfg::cout, reco::MET::e_longitudinal(), edm::EventBase::luminosityBlock(), reco::MET::mEtSig(), reco::PFMET::MuonFraction(), reco::PFMET::NeutralEMFraction(), reco::PFMET::NeutralHadFraction(), python::pfMET_cfi::pfMET, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::MET::sumEt().

{

  if (TriggerTypeName=="HighPtJet") {
    if (!selectHighPtJetEvent(iEvent)) return;
  }
  else if (TriggerTypeName=="LowPtJet") {
    if (!selectLowPtJetEvent(iEvent)) return;
  }
  else if (TriggerTypeName=="HighMET") {
    if (pfmet.pt()<_highPFMETThreshold) return;
  }
  else if (TriggerTypeName=="LowMET") {
    if (pfmet.pt()<_lowPFMETThreshold) return;
  }
  else if (TriggerTypeName=="Ele") {
    if (!selectWElectronEvent(iEvent)) return;
  }
  else if (TriggerTypeName=="Muon") {
    if (!selectWMuonEvent(iEvent)) return;
  }
  
  // Reconstructed MET Information
  double pfSumET  = pfmet.sumEt();
  double pfMETSig = pfmet.mEtSig();
  double pfEz     = pfmet.e_longitudinal();
  double pfMET    = pfmet.pt();
  double pfMEx    = pfmet.px();
  double pfMEy    = pfmet.py();
  double pfMETPhi = pfmet.phi();

  double pfNeutralEMFraction  = pfmet.NeutralEMFraction();
  double pfNeutralHadFraction = pfmet.NeutralHadFraction();
  double pfChargedEMFraction  = pfmet.ChargedEMFraction();
  double pfChargedHadFraction = pfmet.ChargedHadFraction();
  double pfMuonFraction       = pfmet.MuonFraction();

  
  //
  int myLuminosityBlock;
  //  myLuminosityBlock = (evtCounter++)/1000;
  myLuminosityBlock = iEvent.luminosityBlock();
  //

  if (TriggerTypeName!="") DirName = DirName +"/"+TriggerTypeName;

  if (_verbose) std::cout << "_etThreshold = " << _etThreshold << std::endl;
  if (pfSumET>_etThreshold){
    
    mePfMEx    = _dbe->get(DirName+"/"+"METTask_PfMEx");    if (mePfMEx    && mePfMEx->getRootObject())    mePfMEx->Fill(pfMEx);
    mePfMEy    = _dbe->get(DirName+"/"+"METTask_PfMEy");    if (mePfMEy    && mePfMEy->getRootObject())    mePfMEy->Fill(pfMEy);
    mePfMET    = _dbe->get(DirName+"/"+"METTask_PfMET");    if (mePfMET    && mePfMET->getRootObject())    mePfMET->Fill(pfMET);
    mePfMETPhi = _dbe->get(DirName+"/"+"METTask_PfMETPhi"); if (mePfMETPhi && mePfMETPhi->getRootObject()) mePfMETPhi->Fill(pfMETPhi);
    mePfSumET  = _dbe->get(DirName+"/"+"METTask_PfSumET");  if (mePfSumET  && mePfSumET->getRootObject())  mePfSumET->Fill(pfSumET);
    mePfMETSig = _dbe->get(DirName+"/"+"METTask_PfMETSig"); if (mePfMETSig && mePfMETSig->getRootObject()) mePfMETSig->Fill(pfMETSig);
    mePfEz     = _dbe->get(DirName+"/"+"METTask_PfEz");     if (mePfEz     && mePfEz->getRootObject())     mePfEz->Fill(pfEz);

    mePfMET_logx    = _dbe->get(DirName+"/"+"METTask_PfMET_logx");    if (mePfMET_logx    && mePfMET_logx->getRootObject())    mePfMET_logx->Fill(log10(pfMET));
    mePfSumET_logx  = _dbe->get(DirName+"/"+"METTask_PfSumET_logx");  if (mePfSumET_logx  && mePfSumET_logx->getRootObject())  mePfSumET_logx->Fill(log10(pfSumET));

    mePfMETIonFeedbck = _dbe->get(DirName+"/"+"METTask_PfMETIonFeedbck");  if (mePfMETIonFeedbck && mePfMETIonFeedbck->getRootObject()) mePfMETIonFeedbck->Fill(pfMET);
    mePfMETHPDNoise   = _dbe->get(DirName+"/"+"METTask_PfMETHPDNoise");    if (mePfMETHPDNoise   && mePfMETHPDNoise->getRootObject())   mePfMETHPDNoise->Fill(pfMET);
    mePfMETRBXNoise   = _dbe->get(DirName+"/"+"METTask_PfMETRBXNoise");    if (mePfMETRBXNoise   && mePfMETRBXNoise->getRootObject())   mePfMETRBXNoise->Fill(pfMET);
    
    mePfNeutralEMFraction = _dbe->get(DirName+"/"+"METTask_mePfNeutralEMFraction"); 
    if (mePfNeutralEMFraction   && mePfNeutralEMFraction->getRootObject()) mePfNeutralEMFraction->Fill(pfNeutralEMFraction);
    mePfNeutralHadFraction = _dbe->get(DirName+"/"+"METTask_mePfNeutralHadFraction"); 
    if (mePfNeutralHadFraction   && mePfNeutralHadFraction->getRootObject()) mePfNeutralHadFraction->Fill(pfNeutralHadFraction);
    mePfChargedEMFraction = _dbe->get(DirName+"/"+"METTask_mePfChargedEMFraction"); 
    if (mePfChargedEMFraction   && mePfChargedEMFraction->getRootObject()) mePfChargedEMFraction->Fill(pfChargedEMFraction);
    mePfChargedHadFraction = _dbe->get(DirName+"/"+"METTask_mePfChargedHadFraction"); 
    if (mePfChargedHadFraction   && mePfChargedHadFraction->getRootObject()) mePfChargedHadFraction->Fill(pfChargedHadFraction);
    mePfMuonFraction = _dbe->get(DirName+"/"+"METTask_mePfMuonFraction"); 
    if (mePfMuonFraction   && mePfMuonFraction->getRootObject()) mePfMuonFraction->Fill(pfMuonFraction);
    
    if (_allhist){
      if (bLumiSecPlot){
        mePfMExLS = _dbe->get(DirName+"/"+"METTask_PfMExLS"); if (mePfMExLS && mePfMExLS->getRootObject()) mePfMExLS->Fill(pfMEx,myLuminosityBlock);
        mePfMEyLS = _dbe->get(DirName+"/"+"METTask_PfMEyLS"); if (mePfMEyLS && mePfMEyLS->getRootObject()) mePfMEyLS->Fill(pfMEy,myLuminosityBlock);
      }
    } // _allhist
  } // et threshold cut
}
void PFMETAnalyzer::makeRatePlot ( std::string  DirName,
double  totltime 
)

Definition at line 365 of file PFMETAnalyzer.cc.

References MonitorElement::getRootObject(), MonitorElement::getTH1F(), and i.

{

  _dbe->setCurrentFolder(DirName);
  MonitorElement *mePfMET = _dbe->get(DirName+"/"+"METTask_PfMET");

  TH1F* tPfMET;
  TH1F* tPfMETRate;

  if ( mePfMET )
    if ( mePfMET->getRootObject() ) {
      tPfMET     = mePfMET->getTH1F();
      
      // Integral plot & convert number of events to rate (hz)
      tPfMETRate = (TH1F*) tPfMET->Clone("METTask_PfMETRate");
      for (int i = tPfMETRate->GetNbinsX()-1; i>=0; i--){
        tPfMETRate->SetBinContent(i+1,tPfMETRate->GetBinContent(i+2)+tPfMET->GetBinContent(i+1));
      }
      for (int i = 0; i<tPfMETRate->GetNbinsX(); i++){
        tPfMETRate->SetBinContent(i+1,tPfMETRate->GetBinContent(i+1)/double(totltime));
      }

      tPfMETRate->SetName("METTask_PfMETRate");
      tPfMETRate->SetTitle("METTask_PfMETRate");
      mePfMETRate      = _dbe->book1D("METTask_PfMETRate",tPfMETRate);
      
    }
}
bool PFMETAnalyzer::selectHighPtJetEvent ( const edm::Event iEvent)

Definition at line 964 of file PFMETAnalyzer.cc.

References gather_cfg::cout, edm::Event::getByLabel(), edm::HandleBase::isValid(), LogDebug, and python::pfJets_cff::pfJets.

                                                              {

  bool return_value=false;

  edm::Handle<reco::PFJetCollection> pfJets;
  iEvent.getByLabel(thePfJetCollectionLabel, pfJets);
  if (!pfJets.isValid()) {
    LogDebug("") << "PFMETAnalyzer: Could not find pfjet product" << std::endl;
    if (_verbose) std::cout << "PFMETAnalyzer: Could not find pfjet product" << std::endl;
  }

  for (reco::PFJetCollection::const_iterator pf = pfJets->begin(); 
       pf!=pfJets->end(); ++pf){
    if (pf->pt()>_highPtPFJetThreshold){
      return_value=true;
    }
  }
  
  return return_value;
}
bool PFMETAnalyzer::selectLowPtJetEvent ( const edm::Event iEvent)

Definition at line 986 of file PFMETAnalyzer.cc.

References gather_cfg::cout, edm::Event::getByLabel(), edm::HandleBase::isValid(), LogDebug, and python::pfJets_cff::pfJets.

                                                             {

  bool return_value=false;

  edm::Handle<reco::PFJetCollection> pfJets;
  iEvent.getByLabel(thePfJetCollectionLabel, pfJets);
  if (!pfJets.isValid()) {
    LogDebug("") << "PFMETAnalyzer: Could not find jet product" << std::endl;
    if (_verbose) std::cout << "PFMETAnalyzer: Could not find jet product" << std::endl;
  }

  for (reco::PFJetCollection::const_iterator cal = pfJets->begin(); 
       cal!=pfJets->end(); ++cal){
    if (cal->pt()>_lowPtPFJetThreshold){
      return_value=true;
    }
  }

  return return_value;

}
bool PFMETAnalyzer::selectWElectronEvent ( const edm::Event iEvent)

Definition at line 1009 of file PFMETAnalyzer.cc.

                                                              {

  bool return_value=true;

  /*
    W-electron event selection comes here
  */

  return return_value;

}
bool PFMETAnalyzer::selectWMuonEvent ( const edm::Event iEvent)

Definition at line 1022 of file PFMETAnalyzer.cc.

                                                          {

  bool return_value=true;

  /*
    W-muon event selection comes here
  */

  return return_value;

}
void PFMETAnalyzer::setSource ( std::string  source) [inline]

Definition at line 92 of file PFMETAnalyzer.h.

References _source, and LaserTracksInput_cfi::source.

                                   {
    _source = source;
  }
void PFMETAnalyzer::validateMET ( const reco::PFMET pfmet,
edm::Handle< edm::View< reco::PFCandidate > >  pfCandidates 
)

HF calibration factor (in 31X applied by PFProducer)

Definition at line 801 of file PFMETAnalyzer.cc.

References funct::cos(), gather_cfg::cout, reco::LeafCandidate::energy(), i, reco::tau::pfCandidates(), reco::LeafCandidate::phi(), phi, reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), funct::sin(), mathSSE::sqrt(), reco::MET::sumEt(), theta(), and reco::LeafCandidate::theta().

{          
  double sumEx = 0;
  double sumEy = 0;
  double sumEt = 0;
      
  for( unsigned i=0; i<pfCandidates->size(); i++ ) {
        
    const reco::PFCandidate& cand = (*pfCandidates)[i];
        
    double E = cand.energy();
        
    //  if( cand.particleId()==PFCandidate::h_HF || 
    //      cand.particleId()==PFCandidate::egamma_HF )
    //    E *= hfCalibFactor_;
        
    double phi = cand.phi();
    double cosphi = cos(phi);
    double sinphi = sin(phi);
        
    double theta = cand.theta();
    double sintheta = sin(theta);
        
    double et = E*sintheta;
    double ex = et*cosphi;
    double ey = et*sinphi;
        
    sumEx += ex;
    sumEy += ey;
    sumEt += et;
  }
      
  double Et = sqrt( sumEx*sumEx + sumEy*sumEy);
  XYZTLorentzVector missingEt( -sumEx, -sumEy, 0, Et);
      
  if(_verbose) 
    if (sumEt!=pfmet.sumEt() || sumEx!=pfmet.px() || sumEy!=pfmet.py() || missingEt.T()!=pfmet.pt() )   
      {
        std::cout<<"PFSumEt: " << sumEt         <<", "<<"PFMETBlock: "<<pfmet.pt()<<std::endl;
        std::cout<<"PFMET: "   << missingEt.T() <<", "<<"PFMETBlock: "<<pfmet.pt()<<std::endl;
        std::cout<<"PFMETx: "  << missingEt.X() <<", "<<"PFMETBlockx: "<<pfmet.pt()<<std::endl;
        std::cout<<"PFMETy: "  << missingEt.Y() <<", "<<"PFMETBlocky: "<<pfmet.pt()<<std::endl;
      }
}

Member Data Documentation

bool PFMETAnalyzer::_allhist [private]

Definition at line 186 of file PFMETAnalyzer.h.

Definition at line 187 of file PFMETAnalyzer.h.

Definition at line 188 of file PFMETAnalyzer.h.

Definition at line 194 of file PFMETAnalyzer.h.

Definition at line 145 of file PFMETAnalyzer.h.

bool PFMETAnalyzer::_doPVCheck [private]

Definition at line 144 of file PFMETAnalyzer.h.

Definition at line 126 of file PFMETAnalyzer.h.

double PFMETAnalyzer::_etThreshold [private]

Definition at line 174 of file PFMETAnalyzer.h.

std::vector<std::string> PFMETAnalyzer::_FolderNames [private]

Definition at line 191 of file PFMETAnalyzer.h.

Definition at line 124 of file PFMETAnalyzer.h.

Definition at line 170 of file PFMETAnalyzer.h.

Definition at line 121 of file PFMETAnalyzer.h.

Definition at line 168 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_Ele [private]

Definition at line 134 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_HighMET [private]

Definition at line 132 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_HighPtJet [private]

Definition at line 129 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_LowMET [private]

Definition at line 133 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_LowPtJet [private]

Definition at line 130 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_MinBias [private]

Definition at line 131 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_Muon [private]

Definition at line 135 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_hlt_PhysDec [private]

Definition at line 138 of file PFMETAnalyzer.h.

Definition at line 125 of file PFMETAnalyzer.h.

Definition at line 171 of file PFMETAnalyzer.h.

Definition at line 122 of file PFMETAnalyzer.h.

Definition at line 169 of file PFMETAnalyzer.h.

Definition at line 123 of file PFMETAnalyzer.h.

Definition at line 127 of file PFMETAnalyzer.h.

int PFMETAnalyzer::_nvtx_min [private]

Definition at line 151 of file PFMETAnalyzer.h.

Definition at line 152 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::_source [private]

Definition at line 106 of file PFMETAnalyzer.h.

Referenced by setSource().

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

Definition at line 140 of file PFMETAnalyzer.h.

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

Definition at line 142 of file PFMETAnalyzer.h.

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

Definition at line 141 of file PFMETAnalyzer.h.

Definition at line 147 of file PFMETAnalyzer.h.

Definition at line 149 of file PFMETAnalyzer.h.

Definition at line 148 of file PFMETAnalyzer.h.

int PFMETAnalyzer::_trig_Ele [private]

Definition at line 163 of file PFMETAnalyzer.h.

Definition at line 161 of file PFMETAnalyzer.h.

Definition at line 158 of file PFMETAnalyzer.h.

Definition at line 157 of file PFMETAnalyzer.h.

Definition at line 162 of file PFMETAnalyzer.h.

Definition at line 159 of file PFMETAnalyzer.h.

Definition at line 160 of file PFMETAnalyzer.h.

Definition at line 164 of file PFMETAnalyzer.h.

Definition at line 165 of file PFMETAnalyzer.h.

int PFMETAnalyzer::_verbose [private]

Definition at line 103 of file PFMETAnalyzer.h.

double PFMETAnalyzer::_vtxchi2_max [private]

Definition at line 154 of file PFMETAnalyzer.h.

Definition at line 153 of file PFMETAnalyzer.h.

double PFMETAnalyzer::_vtxz_max [private]

Definition at line 155 of file PFMETAnalyzer.h.

Definition at line 114 of file PFMETAnalyzer.h.

Definition at line 183 of file PFMETAnalyzer.h.

Definition at line 96 of file PFMETAnalyzer.h.

Definition at line 116 of file PFMETAnalyzer.h.

Definition at line 109 of file PFMETAnalyzer.h.

Definition at line 110 of file PFMETAnalyzer.h.

Definition at line 177 of file PFMETAnalyzer.h.

std::vector<std::string > PFMETAnalyzer::HLTPathsJetMBByName_ [private]

Definition at line 119 of file PFMETAnalyzer.h.

Definition at line 180 of file PFMETAnalyzer.h.

Definition at line 214 of file PFMETAnalyzer.h.

Definition at line 210 of file PFMETAnalyzer.h.

Definition at line 211 of file PFMETAnalyzer.h.

Definition at line 217 of file PFMETAnalyzer.h.

Definition at line 219 of file PFMETAnalyzer.h.

Definition at line 225 of file PFMETAnalyzer.h.

Definition at line 229 of file PFMETAnalyzer.h.

Definition at line 228 of file PFMETAnalyzer.h.

Definition at line 220 of file PFMETAnalyzer.h.

Definition at line 232 of file PFMETAnalyzer.h.

Definition at line 230 of file PFMETAnalyzer.h.

Definition at line 218 of file PFMETAnalyzer.h.

Definition at line 215 of file PFMETAnalyzer.h.

Definition at line 222 of file PFMETAnalyzer.h.

Definition at line 216 of file PFMETAnalyzer.h.

Definition at line 223 of file PFMETAnalyzer.h.

Definition at line 212 of file PFMETAnalyzer.h.

Definition at line 208 of file PFMETAnalyzer.h.

Definition at line 209 of file PFMETAnalyzer.h.

Definition at line 221 of file PFMETAnalyzer.h.

Definition at line 226 of file PFMETAnalyzer.h.

Definition at line 197 of file PFMETAnalyzer.h.

std::string PFMETAnalyzer::metname [private]

Definition at line 105 of file PFMETAnalyzer.h.

Definition at line 204 of file PFMETAnalyzer.h.

Definition at line 202 of file PFMETAnalyzer.h.

Definition at line 199 of file PFMETAnalyzer.h.

Definition at line 203 of file PFMETAnalyzer.h.

Definition at line 200 of file PFMETAnalyzer.h.

Definition at line 201 of file PFMETAnalyzer.h.

Definition at line 205 of file PFMETAnalyzer.h.

Definition at line 206 of file PFMETAnalyzer.h.

Definition at line 101 of file PFMETAnalyzer.h.

Definition at line 113 of file PFMETAnalyzer.h.

Definition at line 137 of file PFMETAnalyzer.h.

Definition at line 111 of file PFMETAnalyzer.h.

Definition at line 112 of file PFMETAnalyzer.h.

Definition at line 108 of file PFMETAnalyzer.h.

Definition at line 115 of file PFMETAnalyzer.h.