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 edm::EDConsumerBase

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 ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

edm::InputTag hbheDigiCollectionTag_
 
edm::InputTag hcalCalibDigiCollectionTag_
 
edm::InputTag hfDigiCollectionTag_
 
edm::InputTag hoDigiCollectionTag_
 
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 22 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, m_ledAnal, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Destructor.

Definition at line 73 of file HcalLedAnalyzer.cc.

73  {
74 // delete m_ledAnal;
75 }

Member Function Documentation

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

Analyze.

get digis

Implements edm::EDAnalyzer.

Definition at line 87 of file HcalLedAnalyzer.cc.

References calib, gather_cfg::cout, edm::EventSetup::get(), edm::Event::getByLabel(), hbheDigiCollectionTag_, hcalCalibDigiCollectionTag_, hfDigiCollectionTag_, hoDigiCollectionTag_, m_ievt, m_ledAnal, and HcalLedAnalysis::processLedEvent().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file HcalLedAnalyzer.cc.

References led_sample, and m_ievt.

77  {
78  m_ievt = 0;
79  led_sample = 1;
80 }
void HcalLedAnalyzer::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file HcalLedAnalyzer.cc.

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

82  {
83  m_ledAnal->LedDone();
84  std::cout<<"Getting out"<<std::endl;
85 }
HcalLedAnalysis * m_ledAnal
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

edm::InputTag HcalLedAnalyzer::hbheDigiCollectionTag_
private

Definition at line 58 of file HcalLedAnalyzer.h.

Referenced by analyze().

edm::InputTag HcalLedAnalyzer::hcalCalibDigiCollectionTag_
private

Definition at line 61 of file HcalLedAnalyzer.h.

Referenced by analyze().

edm::InputTag HcalLedAnalyzer::hfDigiCollectionTag_
private

Definition at line 60 of file HcalLedAnalyzer.h.

Referenced by analyze().

edm::InputTag HcalLedAnalyzer::hoDigiCollectionTag_
private

Definition at line 59 of file HcalLedAnalyzer.h.

Referenced by analyze().

int HcalLedAnalyzer::led_sample
private

Definition at line 46 of file HcalLedAnalyzer.h.

Referenced by beginJob().

int HcalLedAnalyzer::m_ievt
private

Definition at line 45 of file HcalLedAnalyzer.h.

Referenced by analyze(), and beginJob().

int HcalLedAnalyzer::m_inputPedestals_run
private

Definition at line 56 of file HcalLedAnalyzer.h.

Referenced by HcalLedAnalyzer().

std::string HcalLedAnalyzer::m_inputPedestals_source
private

Definition at line 54 of file HcalLedAnalyzer.h.

Referenced by HcalLedAnalyzer().

std::string HcalLedAnalyzer::m_inputPedestals_tag
private

Definition at line 55 of file HcalLedAnalyzer.h.

Referenced by HcalLedAnalyzer().

HcalPedestals* HcalLedAnalyzer::m_inputPeds
private

Definition at line 49 of file HcalLedAnalyzer.h.

HcalLedAnalysis* HcalLedAnalyzer::m_ledAnal
private

Definition at line 48 of file HcalLedAnalyzer.h.

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