CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

HcalLedAnalyzer Class Reference

#include <HcalLedAnalyzer.h>

Inheritance diagram for HcalLedAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

 HcalLedAnalyzer (const edm::ParameterSet &ps)
 Constructor.
 ~HcalLedAnalyzer ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob ()
void endJob (void)

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

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.

                                                         {
  m_ledAnal = new HcalLedAnalysis(ps);
  m_ledAnal->LedSetup(ps.getUntrackedParameter<std::string>("outputFileHist", "HcalLedAnalyzer.root"));
//  m_startSample = ps.getUntrackedParameter<int>("firstSample", 0);
//  m_endSample = ps.getUntrackedParameter<int>("lastSample", 19);
  m_inputPedestals_source = ps.getUntrackedParameter<std::string>("inputPedestalsSource", "");
  m_inputPedestals_tag = ps.getUntrackedParameter<std::string>("inputPedsTag", "");
  m_inputPedestals_run = ps.getUntrackedParameter<int>("inputPedsRun", 1);

  // CORAL required variables to be set, even if not needed
  const char* foo1 = "CORAL_AUTH_USER=blah";
  const char* foo2 = "CORAL_AUTH_PASSWORD=blah";
  if (!::getenv("CORAL_AUTH_USER")) ::putenv(const_cast<char*>(foo1));
  if (!::getenv("CORAL_AUTH_PASSWORD")) ::putenv(const_cast<char*>(foo2)); 
}
HcalLedAnalyzer::~HcalLedAnalyzer ( )

Destructor.

Definition at line 68 of file HcalLedAnalyzer.cc.

                                 {
//  delete m_ledAnal;
}

Member Function Documentation

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

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().

                                                                               {

  m_ievt++;

  edm::Handle<HBHEDigiCollection> hbhe; e.getByType(hbhe);
  edm::Handle<HODigiCollection> ho;     e.getByType(ho);
  edm::Handle<HFDigiCollection> hf;     e.getByType(hf);

  // get calib digis
  edm::Handle<HcalCalibDigiCollection> calib;  e.getByType(calib);

  // get testbeam specific laser info from the TDC.  This probably will not work
  // outside of the testbeam, but it should be easy to modify the Handle/getByType
  // to get the correct stuff 

  //edm::Handle<HcalTBTiming> timing; e.getByType(timing);

  // get conditions
  edm::ESHandle<HcalDbService> conditions;
  eventSetup.get<HcalDbRecord>().get(conditions);

//  int runNumber = e.id().run();
//  m_ledAnal->processLedEvent(*hbhe, *ho, *hf, *calib, *conditions, *runNumber);

  m_ledAnal->processLedEvent(*hbhe, *ho, *hf, *calib, *conditions);


  if(m_ievt%1000 == 0)
    std::cout << "HcalLedAnalyzer: analyzed " << m_ievt << " events" << std::endl;

  return;
}
void HcalLedAnalyzer::beginJob ( void  ) [protected, virtual]

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.

                              {
  m_ievt = 0;
  led_sample = 1;
  HcalPedestals* inputPeds=0;
// get pedestals
  if (!m_inputPedestals_source.empty ()) {
    inputPeds = new HcalPedestals ();
    if (!getObject (inputPeds, m_inputPedestals_source, m_inputPedestals_tag, m_inputPedestals_run)) {
      std::cerr << "HcalLedAnalyzer-> Failed to get pedestal values" << std::endl;
    }
    //m_ledAnal->doPeds(inputPeds);
    delete inputPeds;
  }
}
void HcalLedAnalyzer::endJob ( void  ) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file HcalLedAnalyzer.cc.

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

                                 {
  m_ledAnal->LedDone();
  std::cout<<"Getting out"<<std::endl;
}

Member Data Documentation

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().

Definition at line 55 of file HcalLedAnalyzer.h.

Referenced by beginJob(), and HcalLedAnalyzer().

Definition at line 53 of file HcalLedAnalyzer.h.

Referenced by beginJob(), and HcalLedAnalyzer().

Definition at line 54 of file HcalLedAnalyzer.h.

Referenced by beginJob(), and HcalLedAnalyzer().

Definition at line 48 of file HcalLedAnalyzer.h.

Definition at line 47 of file HcalLedAnalyzer.h.

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