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

#include <ESDaqInfoTask.h>

Inheritance diagram for ESDaqInfoTask:
edm::EDAnalyzer

Public Member Functions

 ESDaqInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~ESDaqInfoTask ()
 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 beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 BeginLuminosityBlock. More...
 
void cleanup (void)
 Cleanup. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 EndLuminosityBlock. More...
 
void reset (void)
 Reset. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

DQMStoredqmStore_
 
bool enableCleanup_
 
ESElectronicsMapperes_mapping_
 
int ESFedRangeMax_
 
int ESFedRangeMin_
 
bool ESOnFed_ [56]
 
MonitorElementmeESDaqActive_ [56]
 
MonitorElementmeESDaqActiveMap_
 
MonitorElementmeESDaqError_
 
MonitorElementmeESDaqFraction_
 
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)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 9 of file ESDaqInfoTask.h.

Constructor & Destructor Documentation

ESDaqInfoTask::ESDaqInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 30 of file ESDaqInfoTask.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, and cppFunctionSkipper::operator.

30  {
31 
33 
34  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");
35 
36  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
37 
38  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
39 
40  ESFedRangeMin_ = ps.getUntrackedParameter<int>("ESFedRangeMin", 520);
41  ESFedRangeMax_ = ps.getUntrackedParameter<int>("ESFedRangeMax", 575);
42 
43  meESDaqFraction_ = 0;
45  meESDaqError_ = 0;
46 
47  for (int i = 0; i < 56; i++) {
48  meESDaqActive_[i] = 0;
49  }
50 
51  if (ps.exists("esMapping")){
52  edm::ParameterSet esMap=ps.getParameter<edm::ParameterSet>("esMapping");
53  es_mapping_ = new ESElectronicsMapper(esMap);
54  }else{
55  edm::LogError("ESDaqInfoTask")<<"preshower mapping pointer not initialized. Temporary.";
56  es_mapping_=0;
57  }
58 
59 
60 
61 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::string prefixME_
Definition: ESDaqInfoTask.h:46
bool exists(std::string const &parameterName) const
checks if a parameter exists
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:54
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:56
DQMStore * dqmStore_
Definition: ESDaqInfoTask.h:44
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:53
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:52
ESElectronicsMapper * es_mapping_
Definition: ESDaqInfoTask.h:61
ESDaqInfoTask::~ESDaqInfoTask ( )
virtual

Destructor.

Definition at line 63 of file ESDaqInfoTask.cc.

63  {
64  delete es_mapping_;
65 }
ESElectronicsMapper * es_mapping_
Definition: ESDaqInfoTask.h:61

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 241 of file ESDaqInfoTask.cc.

241  {
242 
243 }
void ESDaqInfoTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file ESDaqInfoTask.cc.

References interpolateCardsSimple::histo, i, x, and detailsBasic3DVector::y.

67  {
68 
69  char histo[200];
70 
71  if ( dqmStore_ ) {
72 
73  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
74 
75  sprintf(histo, "DAQSummary");
77  meESDaqFraction_->Fill(0.0);
78 
79  sprintf(histo, "DAQSummaryMap");
80  meESDaqActiveMap_ = dqmStore_->book2D(histo,histo, 80, 0.5, 80.5, 80, 0.5, 80.5);
81  meESDaqActiveMap_->setAxisTitle("Si X", 1);
82  meESDaqActiveMap_->setAxisTitle("Si Y", 2);
83 
84  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
85 
86  for (int i = 0; i < 56; i++) {
87  sprintf(histo, "EcalPreshower_%d", ESFedRangeMin_+i);
89  meESDaqActive_[i]->Fill(0.0);
90 
91  ESOnFed_[i] = false;
92  for ( int x = 0; x < 80; x++ ) {
93  for ( int y = 0; y < 80; y++ ) {
94  int iz = (x<40)? 1:2;
95  int ip = (y>=40)? 1:2;
96  int ix = (x<40)? x:x-40;
97  int iy = (y<40)? y:y-40;
98  int ifed = (*es_mapping_).getFED( iz, ip, ix, iy);
99  if(ifed == ESFedRangeMin_+i){
100  ESOnFed_[i] = true;
101  break;
102  }
103  }
104  if(ESOnFed_[i] == true) break;
105  }
106  }
107 
108  dqmStore_->setCurrentFolder(prefixME_ + "/ESIntegrityTask");
109  sprintf(histo, "DAQError");
110  meESDaqError_ = dqmStore_->book1D(histo, histo, 56, ESFedRangeMin_-0.5, ESFedRangeMax_+0.5);
111  meESDaqError_->setAxisTitle("FedID", 1);
112 
113  }
114 
115 }
bool ESOnFed_[56]
Definition: ESDaqInfoTask.h:63
int i
Definition: DBlmapReader.cc:9
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string prefixME_
Definition: ESDaqInfoTask.h:46
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:54
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:56
DQMStore * dqmStore_
Definition: ESDaqInfoTask.h:44
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:53
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:52
Definition: DDAxes.h:10
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
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:429
void ESDaqInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 123 of file ESDaqInfoTask.cc.

References edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), i, reset(), x, and detailsBasic3DVector::y.

123  {
124 
125  this->reset();
126 
127  for (int x = 0; x < 80; ++x) {
128  for (int y = 0; y < 80; ++y) {
129  int iz = (x<40) ? 1:2;
130  int ip = (y>=40) ? 1:2;
131  int ix = (x<40) ? x:x-40;
132  int iy = (y<40) ? y:y-40;
133  int ifed = (*es_mapping_).getFED( iz, ip, ix+1, iy+1);
134  if( ifed > 0 ) meESDaqActiveMap_->setBinContent( x+1, y+1, 0.0 );
135  else meESDaqActiveMap_->setBinContent( x+1, y+1, -1.0 );
136  }
137  }
138 
139  for (int i = 0; i < 56; i++) {
141  }
142 
144 
145  if( iSetup.find( recordKey ) ) {
146 
147  edm::ESHandle<RunInfo> sumFED;
148  iSetup.get<RunInfoRcd>().get(sumFED);
149 
150  std::vector<int> FedsInIds= sumFED->m_fed_in;
151 
152  float ESFedCount = 0.;
153 
154  for( unsigned int fedItr=0; fedItr<FedsInIds.size(); ++fedItr ) {
155 
156  int fedID=FedsInIds[fedItr];
157 
158  if ( fedID >= ESFedRangeMin_ && fedID <= ESFedRangeMax_ ) {
159 
160  if( ESOnFed_[fedID - ESFedRangeMin_] ) ESFedCount++;
161 
163 
164  if( meESDaqActiveMap_ ) {
165 
166  for( int x = 0; x < 80; x++ ) {
167  for( int y = 0; y < 80; y++ ) {
168  int iz = (x<40)? 1:2;
169  int ip = (y>=40)? 1:2;
170  int ix = (x<40) ? x:x-40;
171  int iy = (x<40) ? y:y-40;
172  int ifed = es_mapping_->getFED(iz, ip, ix, iy);
173  if( fedID==ifed ) meESDaqActiveMap_->setBinContent( x+1, y+1, 1.0 );
174  }
175  }
176 
177  }
178 
179  if( meESDaqFraction_ ) meESDaqFraction_->Fill( ESFedCount/40. );
180 
181  if( meESDaqError_ ){
182  for( int i = 0; i < 56; i++){
183  if( ESOnFed_[fedID-ESFedRangeMin_] ) meESDaqError_->setBinContent(i+1, 1.0);
184  else meESDaqError_->setBinContent(i+1, 2.0);
185  }
186  }
187 
188  }
189 
190  }
191 
192  } else {
193 
194  LogWarning("ESDaqInfoTask") << "Cannot find any RunInfoRcd" << endl;
195 
196  }
197 
198 }
bool ESOnFed_[56]
Definition: ESDaqInfoTask.h:63
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:54
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void Fill(long long x)
void reset(void)
Reset.
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:56
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:53
const T & get() const
Definition: EventSetup.h:55
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:52
ESElectronicsMapper * es_mapping_
Definition: ESDaqInfoTask.h:61
Definition: DDAxes.h:10
int getFED(const ESDetId &id)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:129
void ESDaqInfoTask::cleanup ( void  )
protected

Cleanup.

Definition at line 219 of file ESDaqInfoTask.cc.

References edm::getName(), and i.

219  {
220 
221  if ( dqmStore_ ) {
222 
223  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");
224 
226 
228 
230 
231  dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo/DAQContents");
232 
233  for (int i = 0; i < 56; i++) {
235  }
236 
237  }
238 
239 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
std::string prefixME_
Definition: ESDaqInfoTask.h:46
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:54
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:56
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
DQMStore * dqmStore_
Definition: ESDaqInfoTask.h:44
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:53
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:52
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void ESDaqInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file ESDaqInfoTask.cc.

References edm::cleanup().

117  {
118 
119  if ( enableCleanup_ ) this->cleanup();
120 
121 }
void cleanup(void)
Cleanup.
void ESDaqInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
protectedvirtual

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 200 of file ESDaqInfoTask.cc.

200  {
201 
202 }
void ESDaqInfoTask::reset ( void  )
protected

Reset.

Definition at line 204 of file ESDaqInfoTask.cc.

References i.

204  {
205 
207 
208  for (int i = 0; i < 56; i++) {
209  if ( meESDaqActive_[i] ) meESDaqActive_[i]->Reset();
210  }
211 
213 
215 
216 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meESDaqActiveMap_
Definition: ESDaqInfoTask.h:54
MonitorElement * meESDaqError_
Definition: ESDaqInfoTask.h:56
MonitorElement * meESDaqActive_[56]
Definition: ESDaqInfoTask.h:53
MonitorElement * meESDaqFraction_
Definition: ESDaqInfoTask.h:52
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

DQMStore* ESDaqInfoTask::dqmStore_
private

Definition at line 44 of file ESDaqInfoTask.h.

bool ESDaqInfoTask::enableCleanup_
private

Definition at line 48 of file ESDaqInfoTask.h.

ESElectronicsMapper* ESDaqInfoTask::es_mapping_
private

Definition at line 61 of file ESDaqInfoTask.h.

int ESDaqInfoTask::ESFedRangeMax_
private

Definition at line 59 of file ESDaqInfoTask.h.

int ESDaqInfoTask::ESFedRangeMin_
private

Definition at line 58 of file ESDaqInfoTask.h.

bool ESDaqInfoTask::ESOnFed_[56]
private

Definition at line 63 of file ESDaqInfoTask.h.

MonitorElement* ESDaqInfoTask::meESDaqActive_[56]
private

Definition at line 53 of file ESDaqInfoTask.h.

MonitorElement* ESDaqInfoTask::meESDaqActiveMap_
private

Definition at line 54 of file ESDaqInfoTask.h.

MonitorElement* ESDaqInfoTask::meESDaqError_
private

Definition at line 56 of file ESDaqInfoTask.h.

MonitorElement* ESDaqInfoTask::meESDaqFraction_
private

Definition at line 52 of file ESDaqInfoTask.h.

bool ESDaqInfoTask::mergeRuns_
private

Definition at line 50 of file ESDaqInfoTask.h.

std::string ESDaqInfoTask::prefixME_
private

Definition at line 46 of file ESDaqInfoTask.h.