CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
HcalLedAnalyzer Class Reference

#include <HcalLedAnalyzer.h>

Inheritance diagram for HcalLedAnalyzer:
edm::EDAnalyzer

Public Member Functions

 HcalLedAnalyzer (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~HcalLedAnalyzer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 
void endJob (void)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

int led_sample
 
int m_ievt
 
int m_inputPedestals_run
 
std::string m_inputPedestals_source
 
std::string m_inputPedestals_tag
 
HcalPedestalsm_inputPeds
 
HcalLedAnalysism_ledAnal
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 21 of file HcalLedAnalyzer.h.

Constructor & Destructor Documentation

HcalLedAnalyzer::HcalLedAnalyzer ( const edm::ParameterSet ps)

Constructor.

Definition at line 52 of file HcalLedAnalyzer.cc.

References edm::ParameterSet::getUntrackedParameter(), HcalLedAnalysis::LedSetup(), m_inputPedestals_run, m_inputPedestals_source, m_inputPedestals_tag, and m_ledAnal.

52  {
53  m_ledAnal = new HcalLedAnalysis(ps);
54  m_ledAnal->LedSetup(ps.getUntrackedParameter<std::string>("outputFileHist", "HcalLedAnalyzer.root"));
55 // m_startSample = ps.getUntrackedParameter<int>("firstSample", 0);
56 // m_endSample = ps.getUntrackedParameter<int>("lastSample", 19);
57  m_inputPedestals_source = ps.getUntrackedParameter<std::string>("inputPedestalsSource", "");
58  m_inputPedestals_tag = ps.getUntrackedParameter<std::string>("inputPedsTag", "");
59  m_inputPedestals_run = ps.getUntrackedParameter<int>("inputPedsRun", 1);
60 
61  // CORAL required variables to be set, even if not needed
62  const char* foo1 = "CORAL_AUTH_USER=blah";
63  const char* foo2 = "CORAL_AUTH_PASSWORD=blah";
64  if (!::getenv("CORAL_AUTH_USER")) ::putenv(const_cast<char*>(foo1));
65  if (!::getenv("CORAL_AUTH_PASSWORD")) ::putenv(const_cast<char*>(foo2));
66 }
std::string m_inputPedestals_source
T getUntrackedParameter(std::string const &, T const &) const
HcalLedAnalysis * m_ledAnal
void LedSetup(const std::string &m_outputFileROOT)
std::string m_inputPedestals_tag
HcalLedAnalyzer::~HcalLedAnalyzer ( )

Destructor.

Definition at line 68 of file HcalLedAnalyzer.cc.

68  {
69 // delete m_ledAnal;
70 }

Member Function Documentation

void HcalLedAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

get digis

Implements edm::EDAnalyzer.

Definition at line 92 of file HcalLedAnalyzer.cc.

References calib, gather_cfg::cout, edm::EventSetup::get(), edm::Event::getByType(), m_ievt, m_ledAnal, and HcalLedAnalysis::processLedEvent().

92  {
93 
94  m_ievt++;
95 
100 
101  // get calib digis
103 
104  // get testbeam specific laser info from the TDC. This probably will not work
105  // outside of the testbeam, but it should be easy to modify the Handle/getByType
106  // to get the correct stuff
107 
108  //edm::Handle<HcalTBTiming> timing; e.getByType(timing);
109 
110  // get conditions
111  edm::ESHandle<HcalDbService> conditions;
112  eventSetup.get<HcalDbRecord>().get(conditions);
113 
114 // int runNumber = e.id().run();
115 // m_ledAnal->processLedEvent(*hbhe, *ho, *hf, *calib, *conditions, *runNumber);
116 
117  m_ledAnal->processLedEvent(*hbhe, *ho, *hf, *calib, *conditions);
118 
119 
120  if(m_ievt%1000 == 0)
121  std::cout << "HcalLedAnalyzer: analyzed " << m_ievt << " events" << std::endl;
122 
123  return;
124 }
HcalLedAnalysis * m_ledAnal
void processLedEvent(const HBHEDigiCollection &hbhe, const HODigiCollection &ho, const HFDigiCollection &hf, const HcalCalibDigiCollection calib, const HcalDbService &cond)
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
tuple cout
Definition: gather_cfg.py:121
void HcalLedAnalyzer::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file HcalLedAnalyzer.cc.

References dtNoiseDBValidation_cfg::cerr, getObject(), led_sample, m_ievt, m_inputPedestals_run, m_inputPedestals_source, and m_inputPedestals_tag.

72  {
73  m_ievt = 0;
74  led_sample = 1;
75  HcalPedestals* inputPeds=0;
76 // get pedestals
77  if (!m_inputPedestals_source.empty ()) {
78  inputPeds = new HcalPedestals ();
80  std::cerr << "HcalLedAnalyzer-> Failed to get pedestal values" << std::endl;
81  }
82  //m_ledAnal->doPeds(inputPeds);
83  delete inputPeds;
84  }
85 }
std::string m_inputPedestals_source
TObject * getObject(TDirectory *fDir, const std::vector< std::string > &fObjectName)
Definition: compareHists.cc:44
std::string m_inputPedestals_tag
void HcalLedAnalyzer::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file HcalLedAnalyzer.cc.

References gather_cfg::cout, HcalLedAnalysis::LedDone(), and m_ledAnal.

87  {
88  m_ledAnal->LedDone();
89  std::cout<<"Getting out"<<std::endl;
90 }
HcalLedAnalysis * m_ledAnal
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

int HcalLedAnalyzer::led_sample
private

Definition at line 45 of file HcalLedAnalyzer.h.

Referenced by beginJob().

int HcalLedAnalyzer::m_ievt
private

Definition at line 44 of file HcalLedAnalyzer.h.

Referenced by analyze(), and beginJob().

int HcalLedAnalyzer::m_inputPedestals_run
private

Definition at line 55 of file HcalLedAnalyzer.h.

Referenced by beginJob(), and HcalLedAnalyzer().

std::string HcalLedAnalyzer::m_inputPedestals_source
private

Definition at line 53 of file HcalLedAnalyzer.h.

Referenced by beginJob(), and HcalLedAnalyzer().

std::string HcalLedAnalyzer::m_inputPedestals_tag
private

Definition at line 54 of file HcalLedAnalyzer.h.

Referenced by beginJob(), and HcalLedAnalyzer().

HcalPedestals* HcalLedAnalyzer::m_inputPeds
private

Definition at line 48 of file HcalLedAnalyzer.h.

HcalLedAnalysis* HcalLedAnalyzer::m_ledAnal
private

Definition at line 47 of file HcalLedAnalyzer.h.

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