CMS 3D CMS Logo

HLTMuonIsoDQMSource Class Reference

* DQM Test Client More...

#include <DQM/HLTEvF/interface/HLTMuonIsoDQMSource.h>

Inheritance diagram for HLTMuonIsoDQMSource:

edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Fake Analyze.
void beginJob (const edm::EventSetup &c)
 BeginJob.
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun.
void endJob ()
 Endjob.
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 DQM Client Diagnostic.
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun.

Private Attributes

edm::InputTag candCollectionTag_
double coneSize_
int counterEvt_
DQMStoredbe_
MonitorElementhiso
edm::InputTag isolationTag_
int level_
 every n events
std::string monitorName_
std::string outputFile_
edm::ParameterSet parameters_
int prescaleEvt_
 counter
bool verbose_
float XMAX
float XMIN


Detailed Description

* DQM Test Client

Description: <one line="" class="" summary>="">.

Date
2008/06/25 10:46:58
Revision
1.1
Author:
M. Vander Donckt CERN
Implementation: <Notes on="" implementation>="">

Definition at line 25 of file HLTMuonIsoDQMSource.h.


Constructor & Destructor Documentation

HLTMuonIsoDQMSource::HLTMuonIsoDQMSource ( const edm::ParameterSet ps  ) 

Definition at line 44 of file HLTMuonIsoDQMSource.cc.

References candCollectionTag_, coneSize_, GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), edm::ParameterSet::getUntrackedParameter(), isolationTag_, level_, monitorName_, NULL, outputFile_, parameters_, prescaleEvt_, and verbose_.

00044                                                                     :counterEvt_(0)
00045 
00046 {
00047   parameters_ = ps;
00048   verbose_ = parameters_.getUntrackedParameter < bool > ("verbose", false);
00049   monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","HLT/HLTMuon");
00050   prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
00051   coneSize_ = parameters_.getUntrackedParameter<double>("coneSize", 0.24);
00052   candCollectionTag_ = parameters_.getUntrackedParameter<InputTag>("CandMuonTag",edm::InputTag("hltL2MuonCandidates"));
00053   isolationTag_ = parameters_.getUntrackedParameter<InputTag>("IsolationTag",edm::InputTag("hltL2MuonIsolations"));
00054   level_ = parameters_.getUntrackedParameter<int>("Level", 2);
00055   dbe_ = 0 ;
00056   if (parameters_.getUntrackedParameter < bool > ("DQMStore", false)) {
00057     dbe_ = Service < DQMStore > ().operator->();
00058     dbe_->setVerbose(0);
00059   }
00060  
00061    outputFile_ =
00062        parameters_.getUntrackedParameter < std::string > ("outputFile", "");
00063    if (outputFile_.size() != 0 && verbose_) {
00064      std::cout << "Muon HLT Monitoring histograms will be saved to " 
00065                << outputFile_ << std::endl;
00066    }
00067    else {
00068      outputFile_ = "HLTMuonDQM.root";
00069    }
00070  
00071    bool disable =
00072      parameters_.getUntrackedParameter < bool > ("disableROOToutput", true);
00073    if (disable) {
00074      outputFile_ = "";
00075    }
00076  
00077    if (dbe_ != NULL) {
00078      dbe_->setCurrentFolder("HLT/HLTMuon");
00079    }
00080 
00081 
00082 }

HLTMuonIsoDQMSource::~HLTMuonIsoDQMSource (  ) 

Definition at line 85 of file HLTMuonIsoDQMSource.cc.

00086 {
00087    
00088   // do anything here that needs to be done at desctruction time
00089   // (e.g. close files, deallocate resources etc.)
00090   
00091 }


Member Function Documentation

void HLTMuonIsoDQMSource::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 144 of file HLTMuonIsoDQMSource.cc.

References candCollectionTag_, coneSize_, counterEvt_, GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), edm::Handle< T >::failedToGet(), MonitorElement::Fill(), edm::Event::getByLabel(), hiso, edm::Ref< C, T, F >::id(), isolationTag_, prescaleEvt_, and verbose_.

00146 {  
00147   if ( !dbe_) return;
00148   counterEvt_++;
00149   if (prescaleEvt_ > 0 && counterEvt_%prescaleEvt_!=0) return;
00150   if (verbose_)cout << " processing conterEvt_: " << counterEvt_ <<endl;
00151 
00152   Handle<RecoChargedCandidateCollection> mucands;
00153   iEvent.getByLabel (candCollectionTag_,mucands);
00154   RecoChargedCandidateCollection::const_iterator cand; 
00155 
00156   if (!mucands.failedToGet()) {
00157     Handle<reco::IsoDepositMap> depMap;
00158     iEvent.getByLabel (isolationTag_,depMap);
00159     for (cand=mucands->begin(); cand!=mucands->end(); ++cand) {
00160       TrackRef tk = cand->get<TrackRef>();
00161       if (!depMap.failedToGet()) {
00162           if (verbose_)cout << " filling  Iso stuff " << endl;
00163           if ( depMap->contains(tk.id()) ){
00164             reco::IsoDepositMap::value_type calDeposit= (*depMap)[tk];
00165             double dephlt = calDeposit.depositWithin(coneSize_);
00166             hiso->Fill(dephlt);
00167           }
00168       }
00169     }
00170   }
00171 }

void HLTMuonIsoDQMSource::beginJob ( const edm::EventSetup c  )  [protected, virtual]

BeginJob.

book some histograms here

Reimplemented from edm::EDAnalyzer.

Definition at line 95 of file HLTMuonIsoDQMSource.cc.

References DQMStore::book1D(), GenMuonPlsPt100GeV_cfg::cout, dbe_, lat::endl(), hiso, level_, monitorName_, name, NBINS, prescaleEvt_, MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), DQMStore::showDirStructure(), DQMStore::tagContents(), indexGen::title, verbose_, XMAX, and XMIN.

00095                                                            {
00096 
00097  
00098    if (dbe_) {
00099      dbe_->setCurrentFolder("monitorName_");
00100      if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ;
00101      if (verbose_)cout << "===>DQM event prescale = " << prescaleEvt_ << " events "<< endl;
00102      
00103      
00105      const int NBINS = 100; XMIN = 0; XMAX = 50;
00106 
00107      // create and cd into new folder
00108      char name[512], title[512];
00109      sprintf(name,"Level%i",level_);
00110      dbe_->setCurrentFolder(monitorName_+name);
00111      sprintf(name,"HLTMuonL%i_iso",level_);
00112      if (level_==2)sprintf(title,"L%i Muon Energy in Isolation cone",level_);         
00113      else if (level_==3)sprintf(title,"L%i Muon SumPt in Isolation cone",level_);               
00114      hiso  = dbe_->book1D(name,title, NBINS, 0., 10./(level_-2));
00115      if ( level_==2)hiso->setAxisTitle("Calo Energy in Iso Cone (GeV)", 1);
00116      else if ( level_==3)hiso->setAxisTitle("Sum Pt in Iso Cone (GeV)", 1);
00117 
00118      if(verbose_)dbe_->showDirStructure();
00119   
00120      // Muon det id is 2 pushed in bits 28:31
00121      const unsigned int detector_id = 2<<28;
00122      dbe_->tagContents(monitorName_, detector_id);
00123    } 
00124 }

void HLTMuonIsoDQMSource::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file HLTMuonIsoDQMSource.cc.

00139                                                                  {
00140   
00141 }

void HLTMuonIsoDQMSource::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file HLTMuonIsoDQMSource.cc.

References dbe_, DQMStore::getAllContents(), me, and monitorName_.

00127                                                                              {
00128   // reset all me's
00129   vector<MonitorElement*> AllME=dbe_->getAllContents(monitorName_);
00130   vector<MonitorElement*>::iterator me=AllME.begin();
00131   for ( ; me != AllME.end() ; ++me ){
00132     (*me)->Reset();
00133   }
00134 
00135 }

void HLTMuonIsoDQMSource::endJob ( void   )  [protected, virtual]

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 184 of file HLTMuonIsoDQMSource.cc.

References counterEvt_, dbe_, outputFile_, and DQMStore::save().

00184                                 {
00185    LogInfo("HLTMonMuon") << "analyzed " << counterEvt_ << " events";
00186    if (outputFile_.size() != 0 && dbe_)
00187     dbe_->save(outputFile_);
00188    return;
00189 }

void HLTMuonIsoDQMSource::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [protected, virtual]

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 177 of file HLTMuonIsoDQMSource.cc.

00178                                                                {
00179 }

void HLTMuonIsoDQMSource::endRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 181 of file HLTMuonIsoDQMSource.cc.

00181                                                                        {
00182 }


Member Data Documentation

edm::InputTag HLTMuonIsoDQMSource::candCollectionTag_ [private]

Definition at line 66 of file HLTMuonIsoDQMSource.h.

Referenced by analyze(), and HLTMuonIsoDQMSource().

double HLTMuonIsoDQMSource::coneSize_ [private]

Definition at line 64 of file HLTMuonIsoDQMSource.h.

Referenced by analyze(), and HLTMuonIsoDQMSource().

int HLTMuonIsoDQMSource::counterEvt_ [private]

Definition at line 61 of file HLTMuonIsoDQMSource.h.

Referenced by analyze(), and endJob().

DQMStore* HLTMuonIsoDQMSource::dbe_ [private]

Definition at line 58 of file HLTMuonIsoDQMSource.h.

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

MonitorElement* HLTMuonIsoDQMSource::hiso [private]

Definition at line 71 of file HLTMuonIsoDQMSource.h.

Referenced by analyze(), and beginJob().

edm::InputTag HLTMuonIsoDQMSource::isolationTag_ [private]

Definition at line 65 of file HLTMuonIsoDQMSource.h.

Referenced by analyze(), and HLTMuonIsoDQMSource().

int HLTMuonIsoDQMSource::level_ [private]

every n events

Definition at line 63 of file HLTMuonIsoDQMSource.h.

Referenced by beginJob(), and HLTMuonIsoDQMSource().

std::string HLTMuonIsoDQMSource::monitorName_ [private]

Definition at line 59 of file HLTMuonIsoDQMSource.h.

Referenced by beginJob(), beginRun(), and HLTMuonIsoDQMSource().

std::string HLTMuonIsoDQMSource::outputFile_ [private]

Definition at line 60 of file HLTMuonIsoDQMSource.h.

Referenced by endJob(), and HLTMuonIsoDQMSource().

edm::ParameterSet HLTMuonIsoDQMSource::parameters_ [private]

Definition at line 56 of file HLTMuonIsoDQMSource.h.

Referenced by HLTMuonIsoDQMSource().

int HLTMuonIsoDQMSource::prescaleEvt_ [private]

counter

Definition at line 62 of file HLTMuonIsoDQMSource.h.

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

bool HLTMuonIsoDQMSource::verbose_ [private]

Definition at line 69 of file HLTMuonIsoDQMSource.h.

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

float HLTMuonIsoDQMSource::XMAX [private]

Definition at line 72 of file HLTMuonIsoDQMSource.h.

Referenced by beginJob().

float HLTMuonIsoDQMSource::XMIN [private]

Definition at line 72 of file HLTMuonIsoDQMSource.h.

Referenced by beginJob().


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