CMS 3D CMS Logo

JetMETAnalyzer Class Reference

DQM jetMET analysis monitoring. More...

#include <DQMOffline/JetMET/src/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 (edm::EventSetup const &iSetup)
 Inizialize parameters for histo binning.
void endJob (void)
 Save the histos.
 JetMETAnalyzer (const edm::ParameterSet &)
 Constructor.
virtual ~JetMETAnalyzer ()
 Destructor.

Private Attributes

DQMStoredbe
std::string HiJetTrigger
std::string LoJetTrigger
std::string metname
edm::ParameterSet parameters
edm::InputTag theCaloJetCollectionLabel
CaloMETAnalyzertheCaloMETAnalyzer
bool theCaloMETAnalyzerFlag
edm::InputTag theCaloMETCollectionLabel
edm::InputTag theCaloMETNoHFCollectionLabel
JetAnalyzertheICJetAnalyzer
edm::InputTag theICJetCollectionLabel
JetAnalyzertheJetAnalyzer
bool theJetAnalyzerFlag
PFJetAnalyzerthePFJetAnalyzer
bool thePFJetAnalyzerFlag
edm::InputTag thePFJetCollectionLabel
JetAnalyzertheSCJetAnalyzer
edm::InputTag theSCJetCollectionLabel
edm::InputTag theTriggerResultsLabel


Detailed Description

DQM jetMET analysis monitoring.

Date
2008/10/21 13:47:35
Revision
1.5
Author:
F. Chlebana - Fermilab

Definition at line 29 of file JetMETAnalyzer.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 30 of file JetMETAnalyzer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HiJetTrigger, LoJetTrigger, parameters, JetAnalyzer::setSource(), theCaloMETAnalyzer, theCaloMETAnalyzerFlag, theCaloMETCollectionLabel, theCaloMETNoHFCollectionLabel, theICJetAnalyzer, theICJetCollectionLabel, theJetAnalyzerFlag, thePFJetAnalyzer, thePFJetAnalyzerFlag, thePFJetCollectionLabel, theSCJetAnalyzer, theSCJetCollectionLabel, and theTriggerResultsLabel.

00030                                                           {
00031 
00032   parameters = pSet;
00033   
00034   // Calo Jet Collection Label
00035   theSCJetCollectionLabel   = parameters.getParameter<edm::InputTag>("SCJetsCollectionLabel");
00036   theICJetCollectionLabel   = parameters.getParameter<edm::InputTag>("ICJetsCollectionLabel");
00037 //theCaloJetCollectionLabel = parameters.getParameter<edm::InputTag>("CaloJetsCollectionLabel");
00038 
00039   thePFJetCollectionLabel   = parameters.getParameter<edm::InputTag>("PFJetsCollectionLabel");
00040 
00041   theCaloMETCollectionLabel     = parameters.getParameter<edm::InputTag>("CaloMETCollectionLabel");
00042   theCaloMETNoHFCollectionLabel = parameters.getParameter<edm::InputTag>("CaloMETNoHFCollectionLabel");
00043 
00044   theTriggerResultsLabel    = parameters.getParameter<edm::InputTag>("TriggerResultsLabel");
00045   
00046 //theSCJetAnalyzerFlag      = parameters.getUntrackedParameter<bool>("DoSCJetAnalysis",true);
00047 //theICJetAnalyzerFlag      = parameters.getUntrackedParameter<bool>("DoICJetAnalysis",true);
00048   theJetAnalyzerFlag        = parameters.getUntrackedParameter<bool>("DoJetAnalysis",true);
00049 
00050   thePFJetAnalyzerFlag      = parameters.getUntrackedParameter<bool>("DoPFJetAnalysis",true);
00051   theCaloMETAnalyzerFlag    = parameters.getUntrackedParameter<bool>("DoCaloMETAnalysis",true);
00052 
00053   // --- do the analysis on the Jets
00054   if(theJetAnalyzerFlag) {
00055     //    theJetAnalyzer    = new JetAnalyzer(parameters.getParameter<ParameterSet>("jetAnalysis"));
00056     //    theJetAnalyzer->setSource("CaloJets");
00057     theSCJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("jetAnalysis"));
00058     theSCJetAnalyzer->setSource("SISConeJets");
00059     theICJetAnalyzer  = new JetAnalyzer(parameters.getParameter<ParameterSet>("jetAnalysis"));
00060     theICJetAnalyzer->setSource("IterativeConeJets");
00061   }
00062 
00063   // --- do the analysis on the PFJets
00064   if(thePFJetAnalyzerFlag)
00065     thePFJetAnalyzer = new PFJetAnalyzer(parameters.getParameter<ParameterSet>("pfJetAnalysis"));
00066 
00067   // --- do the analysis on the MET
00068   if(theCaloMETAnalyzerFlag)
00069     theCaloMETAnalyzer = new CaloMETAnalyzer(parameters.getParameter<ParameterSet>("caloMETAnalysis"));
00070 
00071   LoJetTrigger = parameters.getParameter<std::string>("JetLo");
00072   HiJetTrigger = parameters.getParameter<std::string>("JetHi");
00073 
00074 }

JetMETAnalyzer::~JetMETAnalyzer (  )  [virtual]

Destructor.

Definition at line 77 of file JetMETAnalyzer.cc.

References theCaloMETAnalyzer, theCaloMETAnalyzerFlag, theICJetAnalyzer, theJetAnalyzerFlag, thePFJetAnalyzer, thePFJetAnalyzerFlag, and theSCJetAnalyzer.

00077                                 {   
00078   if(theJetAnalyzerFlag) {
00079     //    delete theJetAnalyzer;
00080     delete theSCJetAnalyzer;
00081     delete theICJetAnalyzer;
00082   }
00083   if(thePFJetAnalyzerFlag)   delete thePFJetAnalyzer;
00084   if(theCaloMETAnalyzerFlag) delete theCaloMETAnalyzer;
00085 }


Member Function Documentation

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

Get the analysis.

Implements edm::EDAnalyzer.

Definition at line 109 of file JetMETAnalyzer.cc.

References CaloMETAnalyzer::analyze(), PFJetAnalyzer::analyze(), JetAnalyzer::analyze(), GenMuonPlsPt100GeV_cfg::cout, DEBUG, lat::endl(), edm::Event::getByLabel(), HiJetTrigger, i, edm::TriggerNames::init(), edm::Handle< T >::isValid(), LogTrace, LoJetTrigger, metname, n, pfJetBenchmark_cfi::pfJets, edm::Handle< T >::product(), JetAnalyzer::setJetHiPass(), JetAnalyzer::setJetLoPass(), JetAnalyzer::setLeadJetFlag(), JetAnalyzer::setNJets(), theCaloMETAnalyzer, theCaloMETAnalyzerFlag, theCaloMETCollectionLabel, theCaloMETNoHFCollectionLabel, theICJetAnalyzer, theICJetCollectionLabel, theJetAnalyzerFlag, thePFJetAnalyzer, thePFJetAnalyzerFlag, thePFJetCollectionLabel, theSCJetAnalyzer, theSCJetCollectionLabel, theTriggerResultsLabel, and edm::TriggerNames::triggerName().

00109                                                                                 {
00110 
00111   LogTrace(metname)<<"[JetMETAnalyzer] Analysis of event # ";
00112 
00113   // **** Get the TriggerResults container
00114   edm::Handle<TriggerResults> triggerResults;
00115   iEvent.getByLabel(theTriggerResultsLabel, triggerResults);
00116 
00117   if (DEBUG)  std::cout << "trigger label " << theTriggerResultsLabel << std::endl;
00118 
00119   Int_t JetLoPass = 0;
00120   Int_t JetHiPass = 0;
00121 
00122   if (triggerResults.isValid()) {
00123     if (DEBUG) std::cout << "trigger valid " << std::endl;
00124     edm::TriggerNames triggerNames;    // TriggerNames class
00125     triggerNames.init(*triggerResults);
00126     unsigned int n = triggerResults->size();
00127     for (unsigned int i=0; i!=n; i++) {
00128 
00129       //      std::cout << ">>> Trigger Name = " << triggerNames.triggerName(i)
00130       //                << " Accept = " << triggerResults.accept(i)
00131       //                << std::endl;
00132       
00133 
00134       if ( triggerNames.triggerName(i) == LoJetTrigger ) {
00135         JetLoPass =  triggerResults->accept(i);
00136         if (DEBUG) std::cout << "Found  HLT_Jet30" << std::endl;
00137       }
00138       //      if ( triggerNames.triggerName(i) == "HLT_L1Jet15" ) {
00139       //        JetLoPass =  triggerResults->accept(i);
00140       //      }
00141       if ( triggerNames.triggerName(i) == HiJetTrigger ) {
00142         JetHiPass =  triggerResults->accept(i);
00143       }
00144     }
00145 
00146     //     std::cout << "triggerResults is valid" << std::endl;
00147     //     std::cout << triggerResults << std::endl;
00148     //     std::cout << triggerResults.isValid() << std::endl;
00149 
00150   } else {
00151 
00152     edm::Handle<TriggerResults> *tr = new edm::Handle<TriggerResults>;
00153     triggerResults = (*tr);
00154     //     std::cout << "triggerResults is not valid" << std::endl;
00155     //     std::cout << triggerResults << std::endl;
00156     //     std::cout << triggerResults.isValid() << std::endl;
00157 
00158     if (DEBUG) std::cout << "trigger not valid " << std::endl;
00159     edm::LogInfo("JetAnalyzer") << "TriggerResults::HLT not found, "
00160       "automatically select events";
00161     //return;
00162   }
00163 
00164   if (DEBUG) {
00165     std::cout << ">>> Trigger  Lo = " <<  JetLoPass
00166               << " Hi = " <<    JetHiPass
00167               << std::endl;
00168   }
00169 
00170   // **** Get the Calo Jet container
00171   edm::Handle<reco::CaloJetCollection> caloJets;
00172 
00173   /****
00174   iEvent.getByLabel(theCaloJetCollectionLabel, caloJets);
00175   if(caloJets.isValid()){
00176     for (reco::CaloJetCollection::const_iterator cal = caloJets->begin(); cal!=caloJets->end(); ++cal){
00177       if(theJetAnalyzerFlag){
00178         LogTrace(metname)<<"[JetMETAnalyzer] Call to the Jet analyzer";
00179         theJetAnalyzer->analyze(iEvent, iSetup, *cal);
00180       }
00181     }
00182   }
00183   ****/
00184 
00185   // **** Get the SISCone Jet container
00186   iEvent.getByLabel(theSCJetCollectionLabel, caloJets);
00187 
00188 
00189   if(caloJets.isValid()){
00190     theSCJetAnalyzer->setJetHiPass(JetHiPass);
00191     theSCJetAnalyzer->setJetLoPass(JetLoPass);
00192     for (reco::CaloJetCollection::const_iterator cal = caloJets->begin(); cal!=caloJets->end(); ++cal){
00193       if(theJetAnalyzerFlag){
00194         LogTrace(metname)<<"[JetMETAnalyzer] Call to the SC Jet analyzer";
00195         if (cal == caloJets->begin()) {   
00196           theSCJetAnalyzer->setNJets(caloJets->size());
00197           theSCJetAnalyzer->setLeadJetFlag(1);
00198         } else {
00199           theSCJetAnalyzer->setLeadJetFlag(0);
00200         }
00201         //      theSCJetAnalyzer->analyze(iEvent, iSetup, *triggerResults, *cal);
00202         theSCJetAnalyzer->analyze(iEvent, iSetup, *cal);
00203       }
00204     }
00205   }
00206 
00207   // **** Get the Iterative Cone  Jet container
00208   iEvent.getByLabel(theICJetCollectionLabel, caloJets);
00209 
00210   if(caloJets.isValid()){
00211     theICJetAnalyzer->setJetHiPass(JetHiPass);
00212     theICJetAnalyzer->setJetLoPass(JetLoPass);
00213     for (reco::CaloJetCollection::const_iterator cal = caloJets->begin(); cal!=caloJets->end(); ++cal){
00214       if(theJetAnalyzerFlag){
00215         LogTrace(metname)<<"[JetMETAnalyzer] Call to the IC Jet analyzer";
00216         if (cal == caloJets->begin()) {
00217           theICJetAnalyzer->setNJets(caloJets->size());
00218           theICJetAnalyzer->setLeadJetFlag(1);
00219         } else {
00220           theICJetAnalyzer->setLeadJetFlag(0);
00221         }
00222         //      theICJetAnalyzer->analyze(iEvent, iSetup, *triggerResults, *cal);       
00223         theICJetAnalyzer->analyze(iEvent, iSetup, *cal);        
00224       }
00225     }
00226   }
00227   
00228 
00229   // **** Get the PFlow Jet container
00230   edm::Handle<reco::PFJetCollection> pfJets;
00231   iEvent.getByLabel(thePFJetCollectionLabel, pfJets);
00232 
00233   if(pfJets.isValid()){
00234     for (reco::PFJetCollection::const_iterator cal = pfJets->begin(); cal!=pfJets->end(); ++cal){
00235       if(thePFJetAnalyzerFlag){
00236         LogTrace(metname)<<"[JetMETAnalyzer] Call to the PFJet analyzer";
00237         thePFJetAnalyzer->analyze(iEvent, iSetup, *cal);
00238       }
00239     }
00240   }
00241 
00242 
00243   // **** Get the MET container  
00244   edm::Handle<reco::CaloMETCollection> calometcoll;
00245   iEvent.getByLabel(theCaloMETCollectionLabel, calometcoll);
00246   edm::Handle<reco::CaloMETCollection> calometNoHFcoll;
00247   iEvent.getByLabel(theCaloMETNoHFCollectionLabel, calometNoHFcoll);
00248 
00249   if(calometcoll.isValid() && calometNoHFcoll.isValid()){
00250     const CaloMETCollection *calometcol = calometcoll.product();
00251     const CaloMET *calomet;
00252     calomet = &(calometcol->front());
00253     const CaloMETCollection *calometNoHFcol = calometNoHFcoll.product();
00254     const CaloMET *calometNoHF;
00255     calometNoHF = &(calometNoHFcol->front());
00256 
00257     if(theCaloMETAnalyzerFlag){
00258       LogTrace(metname)<<"[JetMETAnalyzer] Call to the CaloMET analyzer";
00259       theCaloMETAnalyzer->analyze(iEvent, iSetup,
00260                                   *triggerResults,
00261                                   *calomet, *calometNoHF);
00262     }
00263   }
00264 
00265 }

void JetMETAnalyzer::beginJob ( edm::EventSetup const &  iSetup  )  [virtual]

Inizialize parameters for histo binning.

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file JetMETAnalyzer.cc.

References PFJetAnalyzer::beginJob(), JetAnalyzer::beginJob(), CaloMETAnalyzer::beginJob(), dbe, LogTrace, metname, theCaloMETAnalyzer, theCaloMETAnalyzerFlag, theICJetAnalyzer, theJetAnalyzerFlag, thePFJetAnalyzer, thePFJetAnalyzerFlag, and theSCJetAnalyzer.

00089                                                          {
00090 
00091   metname = "JetMETAnalyzer";
00092 
00093   LogTrace(metname)<<"[JetMETAnalyzer] Parameters initialization";
00094   dbe = edm::Service<DQMStore>().operator->();
00095 
00096   if(theJetAnalyzerFlag) { 
00097     //    theJetAnalyzer->beginJob(iSetup, dbe);
00098     theSCJetAnalyzer->beginJob(iSetup, dbe);
00099     theICJetAnalyzer->beginJob(iSetup, dbe);
00100   }
00101 
00102   if(thePFJetAnalyzerFlag)    thePFJetAnalyzer->beginJob(iSetup, dbe);
00103   if(theCaloMETAnalyzerFlag)  theCaloMETAnalyzer->beginJob(iSetup, dbe);
00104 
00105 }

void JetMETAnalyzer::endJob ( void   )  [virtual]

Save the histos.

Reimplemented from edm::EDAnalyzer.

Definition at line 269 of file JetMETAnalyzer.cc.

References dbe, edm::ParameterSet::getParameter(), LogTrace, metname, iggi_31X_cfg::outputFileName, parameters, DQMStore::save(), and DQMStore::showDirStructure().

00269                                 {
00270   LogTrace(metname)<<"[JetMETAnalyzer] Saving the histos";
00271   bool outputMEsInRootFile   = parameters.getParameter<bool>("OutputMEsInRootFile");
00272   std::string outputFileName = parameters.getParameter<std::string>("OutputFileName");
00273 
00274   if(outputMEsInRootFile){
00275     dbe->showDirStructure();
00276     dbe->save(outputFileName);
00277   }
00278 }


Member Data Documentation

DQMStore* JetMETAnalyzer::dbe [private]

Definition at line 50 of file JetMETAnalyzer.h.

Referenced by beginJob(), and endJob().

std::string JetMETAnalyzer::HiJetTrigger [private]

Definition at line 63 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

std::string JetMETAnalyzer::LoJetTrigger [private]

Definition at line 62 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

std::string JetMETAnalyzer::metname [private]

Definition at line 52 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), and endJob().

edm::ParameterSet JetMETAnalyzer::parameters [private]

Definition at line 51 of file JetMETAnalyzer.h.

Referenced by endJob(), and JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::theCaloJetCollectionLabel [private]

Definition at line 54 of file JetMETAnalyzer.h.

CaloMETAnalyzer* JetMETAnalyzer::theCaloMETAnalyzer [private]

Definition at line 74 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

bool JetMETAnalyzer::theCaloMETAnalyzerFlag [private]

Definition at line 67 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::theCaloMETCollectionLabel [private]

Definition at line 58 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::theCaloMETNoHFCollectionLabel [private]

Definition at line 59 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

JetAnalyzer* JetMETAnalyzer::theICJetAnalyzer [private]

Definition at line 72 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::theICJetCollectionLabel [private]

Definition at line 56 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

JetAnalyzer* JetMETAnalyzer::theJetAnalyzer [private]

Definition at line 70 of file JetMETAnalyzer.h.

bool JetMETAnalyzer::theJetAnalyzerFlag [private]

Definition at line 65 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

PFJetAnalyzer* JetMETAnalyzer::thePFJetAnalyzer [private]

Definition at line 73 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

bool JetMETAnalyzer::thePFJetAnalyzerFlag [private]

Definition at line 66 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::thePFJetCollectionLabel [private]

Definition at line 57 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

JetAnalyzer* JetMETAnalyzer::theSCJetAnalyzer [private]

Definition at line 71 of file JetMETAnalyzer.h.

Referenced by analyze(), beginJob(), JetMETAnalyzer(), and ~JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::theSCJetCollectionLabel [private]

Definition at line 55 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().

edm::InputTag JetMETAnalyzer::theTriggerResultsLabel [private]

Definition at line 60 of file JetMETAnalyzer.h.

Referenced by analyze(), and JetMETAnalyzer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:03 2009 for CMSSW by  doxygen 1.5.4