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
EEPedestalOnlineTask Class Reference

#include <EEPedestalOnlineTask.h>

Inheritance diagram for EEPedestalOnlineTask:
edm::EDAnalyzer

Public Member Functions

 EEPedestalOnlineTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~EEPedestalOnlineTask ()
 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)
 BeginJob. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun. More...
 
void reset (void)
 Reset. More...
 
void setup (void)
 Setup. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStoredqmStore_
 
edm::InputTag EEDigiCollection_
 
bool enableCleanup_
 
int ievt_
 
bool init_
 
MonitorElementmePedMapG12_ [18]
 
bool mergeRuns_
 
std::string prefixME_
 

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)
 

Detailed Description

Definition at line 20 of file EEPedestalOnlineTask.h.

Constructor & Destructor Documentation

EEPedestalOnlineTask::EEPedestalOnlineTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file EEPedestalOnlineTask.cc.

References dqmStore_, EEDigiCollection_, enableCleanup_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, init_, mePedMapG12_, mergeRuns_, cmsCodeRules.cppFunctionSkipper::operator, and prefixME_.

28  {
29 
30  init_ = false;
31 
33 
34  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
35 
36  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
37 
38  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
39 
40  EEDigiCollection_ = ps.getParameter<edm::InputTag>("EEDigiCollection");
41 
42  for (int i = 0; i < 18; i++) {
43  mePedMapG12_[i] = 0;
44  }
45 
46 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
edm::InputTag EEDigiCollection_
EEPedestalOnlineTask::~EEPedestalOnlineTask ( )
virtual

Destructor.

Definition at line 48 of file EEPedestalOnlineTask.cc.

48  {
49 
50 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 133 of file EEPedestalOnlineTask.cc.

References ecalMGPA::adc(), EcalMGPASample::adc(), EEDigiCollection_, MonitorElement::Fill(), EcalMGPASample::gainId(), edm::Event::getByLabel(), i, ievt_, init_, ecalpyutils::ism(), Numbers::iSM(), EEDetId::ix(), LogDebug, mePedMapG12_, EcalDataFrame::sample(), and setup().

133  {
134 
135  if ( ! init_ ) this->setup();
136 
137  ievt_++;
138 
140 
141  if ( e.getByLabel(EEDigiCollection_, digis) ) {
142 
143  int need = digis->size();
144  LogDebug("EEPedestalOnlineTask") << "event " << ievt_ << " digi collection size " << need;
145 
146  for ( EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr ) {
147 
148  EEDetId id = digiItr->id();
149 
150  int ix = id.ix();
151  int iy = id.iy();
152 
153  int ism = Numbers::iSM( id );
154 
155  if ( ism >= 1 && ism <= 9 ) ix = 101 - ix;
156 
157  float xix = ix - 0.5;
158  float xiy = iy - 0.5;
159 
160  EEDataFrame dataframe = (*digiItr);
161 
162  for (int i = 0; i < 3; i++) {
163 
164  int adc = dataframe.sample(i).adc();
165 
166  MonitorElement* mePedMap = 0;
167 
168  if ( dataframe.sample(i).gainId() == 1 ) mePedMap = mePedMapG12_[ism-1];
169  if ( dataframe.sample(i).gainId() == 2 ) mePedMap = 0;
170  if ( dataframe.sample(i).gainId() == 3 ) mePedMap = 0;
171 
172  float xval = float(adc);
173 
174  if ( mePedMap ) mePedMap->Fill(xix, xiy, xval);
175 
176  }
177 
178  }
179 
180  } else {
181 
182  edm::LogWarning("EEPedestalOnlineTask") << EEDigiCollection_ << " not available";
183 
184  }
185 
186 }
int adc(sample_type sample)
get the ADC sample (12 bits)
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int ix() const
Definition: EEDetId.h:71
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:28
int gainId() const
get the gainId (2 bits)
MonitorElement * mePedMapG12_[18]
void Fill(long long x)
static int iSM(const int ism, const EcalSubdetector subdet)
Definition: Numbers.cc:216
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
edm::InputTag EEDigiCollection_
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:47
int adc() const
get the ADC sample (12 bits)
void EEPedestalOnlineTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 52 of file EEPedestalOnlineTask.cc.

References dqmStore_, ievt_, prefixME_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().

52  {
53 
54  ievt_ = 0;
55 
56  if ( dqmStore_ ) {
57  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineTask");
58  dqmStore_->rmdir(prefixME_ + "/EEPedestalOnlineTask");
59  }
60 
61 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2296
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void EEPedestalOnlineTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file EEPedestalOnlineTask.cc.

References Numbers::initGeometry(), mergeRuns_, and reset().

63  {
64 
65  Numbers::initGeometry(c, false);
66 
67  if ( ! mergeRuns_ ) this->reset();
68 
69 }
static void initGeometry(const edm::EventSetup &setup, bool verbose=false)
Definition: Numbers.cc:43
void EEPedestalOnlineTask::cleanup ( void  )
protected

Cleanup.

Definition at line 106 of file EEPedestalOnlineTask.cc.

References dqmStore_, edm::getName(), i, init_, mePedMapG12_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().

Referenced by endJob().

106  {
107 
108  if ( ! init_ ) return;
109 
110  if ( dqmStore_ ) {
111  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineTask");
112 
113  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineTask/Gain12");
114  for ( int i = 0; i < 18; i++ ) {
116  mePedMapG12_[i] = 0;
117  }
118 
119  }
120 
121  init_ = false;
122 
123 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
void removeElement(const std::string &name)
Definition: DQMStore.cc:2338
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void EEPedestalOnlineTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 125 of file EEPedestalOnlineTask.cc.

References cleanup(), enableCleanup_, and ievt_.

125  {
126 
127  edm::LogInfo("EEPedestalOnlineTask") << "analyzed " << ievt_ << " events";
128 
129  if ( enableCleanup_ ) this->cleanup();
130 
131 }
void cleanup(void)
Cleanup.
void EEPedestalOnlineTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 71 of file EEPedestalOnlineTask.cc.

71  {
72 
73 }
void EEPedestalOnlineTask::reset ( void  )
protected

Reset.

Definition at line 75 of file EEPedestalOnlineTask.cc.

References i, mePedMapG12_, and MonitorElement::Reset().

Referenced by beginRun().

75  {
76 
77  for (int i = 0; i < 18; i++) {
78  if ( mePedMapG12_[i] ) mePedMapG12_[i]->Reset();
79  }
80 
81 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * mePedMapG12_[18]
void Reset(void)
reset ME (ie. contents, errors, etc)
void EEPedestalOnlineTask::setup ( void  )
protected

Setup.

Definition at line 83 of file EEPedestalOnlineTask.cc.

References DQMStore::bookProfile2D(), dqmStore_, trackerHits::histo, i, init_, Numbers::ix0EE(), Numbers::iy0EE(), mePedMapG12_, prefixME_, Numbers::sEE(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and DQMStore::tag().

Referenced by analyze().

83  {
84 
85  init_ = true;
86 
87  char histo[200];
88 
89  if ( dqmStore_ ) {
90  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineTask");
91 
92  dqmStore_->setCurrentFolder(prefixME_ + "/EEPedestalOnlineTask/Gain12");
93  for (int i = 0; i < 18; i++) {
94  sprintf(histo, "EEPOT pedestal %s G12", Numbers::sEE(i+1).c_str());
95  mePedMapG12_[i] = dqmStore_->bookProfile2D(histo, histo, 50, Numbers::ix0EE(i+1)+0., Numbers::ix0EE(i+1)+50., 50, Numbers::iy0EE(i+1)+0., Numbers::iy0EE(i+1)+50., 4096, 0., 4096., "s");
96  mePedMapG12_[i]->setAxisTitle("ix", 1);
97  if ( i+1 >= 1 && i+1 <= 9 ) mePedMapG12_[i]->setAxisTitle("101-ix", 1);
98  mePedMapG12_[i]->setAxisTitle("iy", 2);
99  dqmStore_->tag(mePedMapG12_[i], i+1);
100  }
101 
102  }
103 
104 }
int i
Definition: DBlmapReader.cc:9
static int iy0EE(const int ism)
Definition: Numbers.cc:964
static std::string sEE(const int ism)
Definition: Numbers.cc:199
tuple histo
Definition: trackerHits.py:12
MonitorElement * mePedMapG12_[18]
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1156
static int ix0EE(const int ism)
Definition: Numbers.cc:946
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:977

Member Data Documentation

DQMStore* EEPedestalOnlineTask::dqmStore_
private

Definition at line 60 of file EEPedestalOnlineTask.h.

Referenced by beginJob(), cleanup(), EEPedestalOnlineTask(), and setup().

edm::InputTag EEPedestalOnlineTask::EEDigiCollection_
private

Definition at line 68 of file EEPedestalOnlineTask.h.

Referenced by analyze(), and EEPedestalOnlineTask().

bool EEPedestalOnlineTask::enableCleanup_
private

Definition at line 64 of file EEPedestalOnlineTask.h.

Referenced by EEPedestalOnlineTask(), and endJob().

int EEPedestalOnlineTask::ievt_
private

Definition at line 58 of file EEPedestalOnlineTask.h.

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

bool EEPedestalOnlineTask::init_
private

Definition at line 72 of file EEPedestalOnlineTask.h.

Referenced by analyze(), cleanup(), EEPedestalOnlineTask(), and setup().

MonitorElement* EEPedestalOnlineTask::mePedMapG12_[18]
private

Definition at line 70 of file EEPedestalOnlineTask.h.

Referenced by analyze(), cleanup(), EEPedestalOnlineTask(), reset(), and setup().

bool EEPedestalOnlineTask::mergeRuns_
private

Definition at line 66 of file EEPedestalOnlineTask.h.

Referenced by beginRun(), and EEPedestalOnlineTask().

std::string EEPedestalOnlineTask::prefixME_
private

Definition at line 62 of file EEPedestalOnlineTask.h.

Referenced by beginJob(), cleanup(), EEPedestalOnlineTask(), and setup().