CMS 3D CMS Logo

HcalPedestalAnalyzer Class Reference

#include <CalibCalorimetry/HcalStandardModules/interface/HcalPedestalAnalyzer.h>

Inheritance diagram for HcalPedestalAnalyzer:

edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

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

Private Attributes

int m_endSample
int m_ievt
int m_inputPedestals_run
std::string m_inputPedestals_source
std::string m_inputPedestals_tag
int m_inputPedestalWidths_run
std::string m_inputPedestalWidths_source
std::string m_inputPedestalWidths_tag
std::string m_outputPedestals_dest
int m_outputPedestals_run
std::string m_outputPedestals_tag
std::string m_outputPedestalWidths_dest
int m_outputPedestalWidths_run
std::string m_outputPedestalWidths_tag
HcalPedestalAnalysism_pedAnal
int m_startSample
int ped_sample


Detailed Description

Definition at line 41 of file HcalPedestalAnalyzer.h.


Constructor & Destructor Documentation

HcalPedestalAnalyzer::HcalPedestalAnalyzer ( const edm::ParameterSet ps  ) 

Constructor.

Definition at line 105 of file HcalPedestalAnalyzer.cc.

References edm::ParameterSet::getUntrackedParameter(), m_endSample, m_inputPedestals_run, m_inputPedestals_source, m_inputPedestals_tag, m_inputPedestalWidths_run, m_inputPedestalWidths_source, m_inputPedestalWidths_tag, m_outputPedestals_dest, m_outputPedestals_run, m_outputPedestals_tag, m_outputPedestalWidths_dest, m_outputPedestalWidths_run, m_outputPedestalWidths_tag, m_pedAnal, m_startSample, and HcalPedestalAnalysis::setup().

00105                                                                    {
00106 
00107   m_pedAnal = new HcalPedestalAnalysis(ps);
00108   m_pedAnal->setup(ps.getUntrackedParameter<std::string>("outputFileHist", "HcalPedestalAnalyzer.root"));
00109 
00110   m_startSample = ps.getUntrackedParameter<int>("firstSample", 0);
00111   m_endSample = ps.getUntrackedParameter<int>("lastSample", 19);
00112   m_inputPedestals_source = ps.getUntrackedParameter<std::string>("inputPedestalsSource", "");
00113   m_inputPedestals_tag = ps.getUntrackedParameter<std::string>("inputPedestalsTag", "");
00114   m_inputPedestals_run = ps.getUntrackedParameter<int>("inputPedestalsRun", 1);
00115   m_inputPedestalWidths_source = ps.getUntrackedParameter<std::string>("inputPedestalWidthsSource", "");
00116   m_inputPedestalWidths_tag = ps.getUntrackedParameter<std::string>("inputPedestalWidthsTag", "");
00117   m_inputPedestalWidths_run = ps.getUntrackedParameter<int>("inputPedestalWidthsRun", 1);
00118   m_outputPedestals_dest = ps.getUntrackedParameter<std::string>("outputPedestalsDest", "");
00119   m_outputPedestals_tag = ps.getUntrackedParameter<std::string>("outputPedestalsTag", "");
00120   m_outputPedestals_run = ps.getUntrackedParameter<int>("outputPedestalsRun", 99999);
00121   m_outputPedestalWidths_dest = ps.getUntrackedParameter<std::string>("outputPedestalWidthsDest", "");
00122   m_outputPedestalWidths_tag = ps.getUntrackedParameter<std::string>("outputPedestalWidthsTag", "");
00123   m_outputPedestalWidths_run = ps.getUntrackedParameter<int>("outputPedestalWidthsRun", 99999);
00124 
00125   // CORAL required variables to be set, even if not needed
00126   if (!::getenv("CORAL_AUTH_USER")) ::putenv("CORAL_AUTH_USER=blah");
00127   if (!::getenv("CORAL_AUTH_PASSWORD")) ::putenv("CORAL_AUTH_PASSWORD=blah"); 
00128 }

HcalPedestalAnalyzer::~HcalPedestalAnalyzer (  ) 

Destructor.

Definition at line 130 of file HcalPedestalAnalyzer.cc.

00130                                            {
00131 //  delete m_pedAnal;
00132 }


Member Function Documentation

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

Analyze.

get digis

Implements edm::EDAnalyzer.

Definition at line 192 of file HcalPedestalAnalyzer.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), edm::EventSetup::get(), edm::Event::getByType(), m_ievt, m_pedAnal, and HcalPedestalAnalysis::processEvent().

00192                                                                                     {
00193 
00194   m_ievt++;
00195 
00197   edm::Handle<HBHEDigiCollection> hbhe; e.getByType(hbhe);
00198   edm::Handle<HODigiCollection> ho;     e.getByType(ho);
00199   edm::Handle<HFDigiCollection> hf;     e.getByType(hf);
00200 
00201   // get conditions
00202   edm::ESHandle<HcalDbService> conditions;
00203   eventSetup.get<HcalDbRecord>().get(conditions);
00204 
00205   m_pedAnal->processEvent(*hbhe, *ho, *hf, *conditions);
00206 
00207   if(m_ievt%1000 == 0)
00208     std::cout << "HcalPedestalAnalyzer: analyzed " << m_ievt << " events" << std::endl;
00209 
00210   return;
00211 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file HcalPedestalAnalyzer.cc.

References m_ievt, and ped_sample.

00134                                                          {
00135   m_ievt = 0;
00136   ped_sample = 1;
00137 }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 139 of file HcalPedestalAnalyzer.cc.

References TestMuL1L2Filter_cff::cerr, HcalPedestalAnalysis::done(), dumpXmlPedestals(), lat::endl(), getObject(), m_inputPedestals_run, m_inputPedestals_source, m_inputPedestals_tag, m_inputPedestalWidths_run, m_inputPedestalWidths_source, m_inputPedestalWidths_tag, m_outputPedestals_dest, m_outputPedestals_run, m_outputPedestals_tag, m_outputPedestalWidths_dest, m_outputPedestalWidths_run, m_outputPedestalWidths_tag, m_pedAnal, putObject(), and xmlFile().

00139                                       {
00140   // get input objects
00141   HcalPedestals* inputPeds = 0;
00142   if (!m_inputPedestals_source.empty ()) {
00143     inputPeds = new HcalPedestals ();
00144     if (!getObject (inputPeds, m_inputPedestals_source, m_inputPedestals_tag, m_inputPedestals_run)) {
00145       std::cerr << "HcalPedestalAnalyzer-> Failed to get input Pedestals" << std::endl;
00146     }
00147   }
00148   HcalPedestalWidths* inputPedWids = 0;
00149   if (!m_inputPedestalWidths_source.empty ()) {
00150     inputPedWids = new HcalPedestalWidths ();
00151     if (!getObject (inputPedWids, m_inputPedestalWidths_source, m_inputPedestalWidths_tag, m_inputPedestalWidths_run)) {
00152       std::cerr << "HcalPedestalAnalyzer-> Failed to get input PedestalWidths" << std::endl;
00153     }
00154   }
00155 
00156   // make output objects
00157   HcalPedestals* outputPeds = (m_outputPedestals_dest.empty () && !xmlFile (m_outputPedestals_dest)) ? 0 : new HcalPedestals ();
00158   HcalPedestalWidths* outputPedWids = (m_outputPedestalWidths_dest.empty () && !xmlFile (m_outputPedestals_dest)) ? 0 : new HcalPedestalWidths ();
00159 
00160   // run algorithm
00161   int Flag=m_pedAnal->done(inputPeds, inputPedWids, outputPeds, outputPedWids);
00162 
00163   delete inputPeds;
00164   delete inputPedWids;
00165 
00166 
00167   // store new objects
00168   // Flag=-2 indicates there were less than 100 events and output is meaningless
00169   if (Flag>-2) {
00170     if (xmlFile (m_outputPedestals_dest)) { // output pedestals and widths together
00171       if (!dumpXmlPedestals (*outputPeds, *outputPedWids, m_outputPedestals_dest, m_outputPedestals_tag, m_outputPedestals_run)) {
00172         std::cerr << "HcalPedestalAnalyzer-> Failed to put output Pedestals & Widths" << std::endl;
00173       }
00174     }
00175     else {
00176       if (outputPeds) {
00177         if (!putObject (&outputPeds, m_outputPedestals_dest, m_outputPedestals_tag, m_outputPedestals_run)) {
00178           std::cerr << "HcalPedestalAnalyzer-> Failed to put output Pedestals" << std::endl;
00179         }
00180       }
00181       if (outputPedWids) {
00182         if (!putObject (&outputPedWids, m_outputPedestalWidths_dest, m_outputPedestalWidths_tag, m_outputPedestalWidths_run)) {
00183           std::cerr << "HcalPedestalAnalyzer-> Failed to put output PedestalWidths" << std::endl;
00184         }
00185       }
00186     }
00187   }
00188   delete outputPeds;
00189   delete outputPedWids;
00190 }


Member Data Documentation

int HcalPedestalAnalyzer::m_endSample [private]

Definition at line 74 of file HcalPedestalAnalyzer.h.

Referenced by HcalPedestalAnalyzer().

int HcalPedestalAnalyzer::m_ievt [private]

Definition at line 66 of file HcalPedestalAnalyzer.h.

Referenced by analyze(), and beginJob().

int HcalPedestalAnalyzer::m_inputPedestals_run [private]

Definition at line 78 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_inputPedestals_source [private]

Definition at line 76 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_inputPedestals_tag [private]

Definition at line 77 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

int HcalPedestalAnalyzer::m_inputPedestalWidths_run [private]

Definition at line 81 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_inputPedestalWidths_source [private]

Definition at line 79 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_inputPedestalWidths_tag [private]

Definition at line 80 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_outputPedestals_dest [private]

Definition at line 82 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

int HcalPedestalAnalyzer::m_outputPedestals_run [private]

Definition at line 84 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_outputPedestals_tag [private]

Definition at line 83 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_outputPedestalWidths_dest [private]

Definition at line 85 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

int HcalPedestalAnalyzer::m_outputPedestalWidths_run [private]

Definition at line 87 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

std::string HcalPedestalAnalyzer::m_outputPedestalWidths_tag [private]

Definition at line 86 of file HcalPedestalAnalyzer.h.

Referenced by endJob(), and HcalPedestalAnalyzer().

HcalPedestalAnalysis* HcalPedestalAnalyzer::m_pedAnal [private]

Definition at line 71 of file HcalPedestalAnalyzer.h.

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

int HcalPedestalAnalyzer::m_startSample [private]

Definition at line 73 of file HcalPedestalAnalyzer.h.

Referenced by HcalPedestalAnalyzer().

int HcalPedestalAnalyzer::ped_sample [private]

Definition at line 67 of file HcalPedestalAnalyzer.h.

Referenced by beginJob().


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