CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/L1TriggerOffline/L1Analyzer/src/SimpleHistograms.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     L1Analyzer
00004 // Class  :     SimpleHistograms
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Alex Tapper 
00010 //         Created:  Tue Dec  5 10:07:30 CET 2006
00011 // $Id: SimpleHistograms.cc,v 1.2 2007/07/08 08:14:05 elmer Exp $
00012 //
00013 
00014 #include "L1TriggerOffline/L1Analyzer/interface/SimpleHistograms.h"
00015 
00016 SimpleHistograms::SimpleHistograms(const std::string name, const edm::ParameterSet & cfg): 
00017   m_dirName(name),
00018   m_etNBins(cfg.getUntrackedParameter<int>("etNBins")),
00019   m_etaNBins(cfg.getUntrackedParameter<int>("etaNBins")),
00020   m_phiNBins(cfg.getUntrackedParameter<int>("phiNBins")),
00021   m_etMin(cfg.getUntrackedParameter<double>("etMin")),
00022   m_etaMin(cfg.getUntrackedParameter<double>("etaMin")),
00023   m_phiMin(cfg.getUntrackedParameter<double>("phiMin")),
00024   m_etMax(cfg.getUntrackedParameter<double>("etMax")),
00025   m_etaMax(cfg.getUntrackedParameter<double>("etaMax")),
00026   m_phiMax(cfg.getUntrackedParameter<double>("phiMax"))
00027 {
00028 
00029   edm::Service<TFileService> fs;
00030 
00031   TFileDirectory dir = fs->mkdir(m_dirName);
00032 
00033   m_Et  = dir.make<TH1F>("Et", "E_{T}",m_etNBins,m_etMin,m_etMax); 
00034   m_Eta = dir.make<TH1F>("Eta","#eta", m_etaNBins,m_etaMin,m_etaMax); 
00035   m_Phi = dir.make<TH1F>("Phi","#phi", m_phiNBins,m_phiMin,m_phiMax); 
00036 
00037 }
00038 
00039 SimpleHistograms::~SimpleHistograms()
00040 {
00041 }
00042 
00043 void SimpleHistograms::Fill(const reco::CandidateRef cand)
00044 {
00045   m_Et->Fill(cand->et());
00046   m_Eta->Fill(cand->eta());
00047   m_Phi->Fill(cand->phi());
00048 }
00049 
00050