CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
EETriggerTowerClient Class Reference

#include <EETriggerTowerClient.h>

Inheritance diagram for EETriggerTowerClient:
EEClient

Public Member Functions

void analyze (void)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (void)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
 EETriggerTowerClient (const edm::ParameterSet &ps)
 Constructor. More...
 
void endJob (void)
 EndJob. More...
 
void endRun (void)
 EndRun. More...
 
int getEvtPerJob ()
 Get Functions. More...
 
int getEvtPerRun ()
 Returns the number of processed events in this Run. More...
 
void setup (void)
 Setup. More...
 
virtual ~EETriggerTowerClient ()
 Destructor. More...
 
- Public Member Functions inherited from EEClient
virtual ~EEClient (void)
 

Private Attributes

bool cloneME_
 
bool debug_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
int ievt_
 
int jevt_
 
TH2F * l01_ [18]
 
TH2F * l02_ [18]
 
MonitorElementme_o01_ [18]
 
MonitorElementme_o02_ [18]
 
MonitorElementmel01_ [18]
 
MonitorElementmel02_ [18]
 
MonitorElementmeo01_ [18]
 
TH3F * o01_ [18]
 
std::string prefixME_
 
std::vector< int > superModules_
 
bool verbose_
 

Friends

class EESummaryClient
 

Detailed Description

Definition at line 33 of file EETriggerTowerClient.h.

Constructor & Destructor Documentation

EETriggerTowerClient::EETriggerTowerClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 24 of file EETriggerTowerClient.cc.

References cloneME_, debug_, enableCleanup_, edm::ParameterSet::getUntrackedParameter(), i, ecalpyutils::ism(), l01_, me_o01_, me_o02_, mel01_, meo01_, o01_, prefixME_, AlCaHLTBitMon_QueryRunRegistry::string, superModules_, and verbose_.

24  {
25 
26  // cloneME switch
27  cloneME_ = ps.getUntrackedParameter<bool>("cloneME", true);
28 
29  // verbose switch
30  verbose_ = ps.getUntrackedParameter<bool>("verbose", true);
31 
32  // debug switch
33  debug_ = ps.getUntrackedParameter<bool>("debug", false);
34 
35  // prefixME path
36  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
37 
38  // enableCleanup_ switch
39  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
40 
41  // vector of selected Super Modules (Defaults to all 18).
42  superModules_.reserve(18);
43  for ( unsigned int i = 1; i <= 18; i++ ) superModules_.push_back(i);
44  superModules_ = ps.getUntrackedParameter<std::vector<int> >("superModules", superModules_);
45 
46  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
47 
48  int ism = superModules_[i];
49 
50  l01_[ism-1] = 0;
51  o01_[ism-1] = 0;
52 
53  mel01_[ism-1] = 0;
54  meo01_[ism-1] = 0;
55 
56  }
57 
58  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
59 
60  int ism = superModules_[i];
61 
62  me_o01_[ism-1] = 0;
63  me_o02_[ism-1] = 0;
64 
65  }
66 
67 }
MonitorElement * meo01_[18]
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_o01_[18]
std::vector< int > superModules_
MonitorElement * me_o02_[18]
MonitorElement * mel01_[18]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
EETriggerTowerClient::~EETriggerTowerClient ( )
virtual

Destructor.

Definition at line 69 of file EETriggerTowerClient.cc.

69  {
70 
71 }

Member Function Documentation

void EETriggerTowerClient::analyze ( void  )
virtual

Analyze.

Implements EEClient.

Definition at line 206 of file EETriggerTowerClient.cc.

References cloneME_, gather_cfg::cout, debug_, dqmStore_, DQMStore::get(), UtilsClient::getHisto(), i, ievt_, getHLTprescales::index, j, jevt_, l01_, l02_, max(), me_o01_, me_o02_, mel01_, mel02_, meo01_, o01_, prefixME_, MonitorElement::Reset(), Numbers::sEE(), MonitorElement::setBinContent(), superModules_, and pileupDistInMC::total.

206  {
207 
208  ievt_++;
209  jevt_++;
210  if ( ievt_ % 10 == 0 ) {
211  if ( debug_ ) std::cout << "EETriggerTowerClient: ievt/jevt = " << ievt_ << "/" << jevt_ << std::endl;
212  }
213 
214  MonitorElement* me;
215 
216  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
217 
218  int ism = superModules_[i];
219 
220  me = dqmStore_->get( prefixME_ + "/EETriggerTowerTask/EETTT EmulError " + Numbers::sEE(ism) );
221  l01_[ism-1] = UtilsClient::getHisto( me, cloneME_, l01_[ism-1] );
222  mel01_[ism-1] = me;
223 
224  me = dqmStore_->get( prefixME_ + "/EETriggerTowerTask/EETTT EmulFineGrainVetoError " + Numbers::sEE(ism) );
225  l02_[ism-1] = UtilsClient::getHisto( me, cloneME_, l02_[ism-1] );
226  mel02_[ism-1] = me;
227 
228  me = dqmStore_->get( prefixME_ + "/EETriggerTowerTask/EETTT EmulMatch " + Numbers::sEE(ism) );
229  o01_[ism-1] = UtilsClient::getHisto( me, cloneME_, o01_[ism-1] );
230  meo01_[ism-1] = me;
231 
232  if ( me_o01_[ism-1] ) me_o01_[ism-1]->Reset();
233  if ( me_o02_[ism-1] ) me_o02_[ism-1]->Reset();
234 
235  for (int ix = 1; ix <= 50; ix++) {
236  for (int iy = 1; iy <= 50; iy++) {
237 
238  if ( o01_[ism-1] ) {
239  // find the most frequent TP timing that matches the emulator
240  float index=-1;
241  double max=0;
242  double total=0;
243  for (int j=0; j<6; j++) {
244  double sampleEntries = o01_[ism-1]->GetBinContent(ix, iy, j+1);
245  if(sampleEntries > max) {
246  index=j;
247  max = sampleEntries;
248  }
249  total += sampleEntries;
250  }
251  if ( max > 0 ) {
252  if ( index == 0 ) {
253  if(me_o01_[ism-1]) me_o01_[ism-1]->setBinContent(ix, iy, -1);
254  } else {
255  if(me_o01_[ism-1]) me_o01_[ism-1]->setBinContent(ix, iy, index );
256  }
257  }
258  double fraction = (total > 0) ? 1.0 - max/total : 0.;
259  if ( me_o02_[ism-1] ) me_o02_[ism-1]->setBinContent(ix, iy, fraction);
260  }
261 
262  }
263  }
264 
265  }
266 
267 }
MonitorElement * meo01_[18]
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:89
MonitorElement * me_o01_[18]
std::vector< int > superModules_
const T & max(const T &a, const T &b)
int j
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
MonitorElement * me_o02_[18]
MonitorElement * mel02_[18]
MonitorElement * mel01_[18]
tuple cout
Definition: gather_cfg.py:121
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void Reset(void)
reset ME (ie. contents, errors, etc)
void EETriggerTowerClient::beginJob ( void  )
virtual

BeginJob.

Implements EEClient.

Definition at line 73 of file EETriggerTowerClient.cc.

References gather_cfg::cout, debug_, dqmStore_, ievt_, jevt_, and cppFunctionSkipper::operator.

73  {
74 
76 
77  if ( debug_ ) std::cout << "EETriggerTowerClient: beginJob" << std::endl;
78 
79  ievt_ = 0;
80  jevt_ = 0;
81 
82 }
tuple cout
Definition: gather_cfg.py:121
void EETriggerTowerClient::beginRun ( void  )
virtual

BeginRun.

Implements EEClient.

Definition at line 84 of file EETriggerTowerClient.cc.

References gather_cfg::cout, debug_, jevt_, and setup().

84  {
85 
86  if ( debug_ ) std::cout << "EETriggerTowerClient: beginRun" << std::endl;
87 
88  jevt_ = 0;
89 
90  this->setup();
91 
92 }
tuple cout
Definition: gather_cfg.py:121
void EETriggerTowerClient::cleanup ( void  )
virtual

Cleanup.

Implements EEClient.

Definition at line 148 of file EETriggerTowerClient.cc.

References cloneME_, dqmStore_, enableCleanup_, i, ecalpyutils::ism(), l01_, me_o01_, me_o02_, mel01_, meo01_, o01_, prefixME_, DQMStore::removeElement(), DQMStore::setCurrentFolder(), and superModules_.

Referenced by endJob(), and endRun().

148  {
149 
150  if ( ! enableCleanup_ ) return;
151 
152  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
153 
154  int ism = superModules_[i];
155 
156  if ( cloneME_ ) {
157  if ( l01_[ism-1] ) delete l01_[ism-1];
158  if ( o01_[ism-1] ) delete o01_[ism-1];
159  }
160 
161  l01_[ism-1] = 0;
162  o01_[ism-1] = 0;
163 
164  mel01_[ism-1] = 0;
165  meo01_[ism-1] = 0;
166 
167  }
168 
169  dqmStore_->setCurrentFolder( prefixME_ + "/EETriggerTowerClient" );
170 
171  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
172 
173  int ism = superModules_[i];
174 
175  if ( me_o01_[ism-1] ) dqmStore_->removeElement( me_o01_[ism-1]->getName() );
176  me_o01_[ism-1] = 0;
177  if ( me_o02_[ism-1] ) dqmStore_->removeElement( me_o02_[ism-1]->getName() );
178  me_o02_[ism-1] = 0;
179 
180  }
181 
182 }
MonitorElement * meo01_[18]
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_o01_[18]
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * me_o02_[18]
MonitorElement * mel01_[18]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EETriggerTowerClient::endJob ( void  )
virtual

EndJob.

Implements EEClient.

Definition at line 94 of file EETriggerTowerClient.cc.

References cleanup(), gather_cfg::cout, debug_, and ievt_.

94  {
95 
96  if ( debug_ ) std::cout << "EETriggerTowerClient: endJob, ievt = " << ievt_ << std::endl;
97 
98  this->cleanup();
99 
100 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
void EETriggerTowerClient::endRun ( void  )
virtual

EndRun.

Implements EEClient.

Definition at line 102 of file EETriggerTowerClient.cc.

References cleanup(), gather_cfg::cout, debug_, and jevt_.

102  {
103 
104  if ( debug_ ) std::cout << "EETriggerTowerClient: endRun, jevt = " << jevt_ << std::endl;
105 
106  this->cleanup();
107 
108 }
void cleanup(void)
Cleanup.
tuple cout
Definition: gather_cfg.py:121
int EETriggerTowerClient::getEvtPerJob ( void  )
inlinevirtual

Get Functions.

Implements EEClient.

Definition at line 72 of file EETriggerTowerClient.h.

References ievt_.

72 { return ievt_; }
int EETriggerTowerClient::getEvtPerRun ( void  )
inlinevirtual

Returns the number of processed events in this Run.

Implements EEClient.

Definition at line 73 of file EETriggerTowerClient.h.

References jevt_.

73 { return jevt_; }
void EETriggerTowerClient::setup ( void  )
virtual

Setup.

Implements EEClient.

Definition at line 110 of file EETriggerTowerClient.cc.

References DQMStore::book2D(), dqmStore_, i, ecalpyutils::ism(), Numbers::ix0EE(), Numbers::iy0EE(), me_o01_, me_o02_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEE(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and superModules_.

Referenced by beginRun().

110  {
111 
113 
114  dqmStore_->setCurrentFolder( prefixME_ + "/EETriggerTowerClient" );
115 
116  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
117 
118  int ism = superModules_[i];
119 
120  if ( me_o01_[ism-1] ) dqmStore_->removeElement( me_o01_[ism-1]->getName() );
121  name = "EETTT Trigger Primitives Timing " + Numbers::sEE(ism);
122  me_o01_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
123  me_o01_[ism-1]->setAxisTitle("ix", 1);
124  if ( ism >= 1 && ism <= 9 ) me_o01_[ism-1]->setAxisTitle("101-ix", 1);
125  me_o01_[ism-1]->setAxisTitle("iy", 2);
126 
127  if ( me_o02_[ism-1] ) dqmStore_->removeElement( me_o02_[ism-1]->getName() );
128  name = "EETTT Non Single Timing " + Numbers::sEE(ism);
129  me_o02_[ism-1] = dqmStore_->book2D(name, name, 50, Numbers::ix0EE(ism)+0., Numbers::ix0EE(ism)+50., 50, Numbers::iy0EE(ism)+0., Numbers::iy0EE(ism)+50.);
130  me_o02_[ism-1]->setAxisTitle("ix", 1);
131  if ( ism >= 1 && ism <= 9 ) me_o02_[ism-1]->setAxisTitle("101-ix", 1);
132  me_o02_[ism-1]->setAxisTitle("iy", 2);
133  me_o02_[ism-1]->setAxisTitle("fraction", 3);
134 
135  }
136 
137  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
138 
139  int ism = superModules_[i];
140 
141  if ( me_o01_[ism-1] ) me_o01_[ism-1]->Reset();
142  if ( me_o02_[ism-1] ) me_o02_[ism-1]->Reset();
143 
144  }
145 
146 }
static std::string sEE(const unsigned ism)
Definition: Numbers.cc:223
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_o01_[18]
static int ix0EE(const unsigned ism)
Definition: Numbers.cc:770
static int iy0EE(const unsigned ism)
Definition: Numbers.cc:809
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * me_o02_[18]
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:1000
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584

Friends And Related Function Documentation

friend class EESummaryClient
friend

Definition at line 35 of file EETriggerTowerClient.h.

Member Data Documentation

bool EETriggerTowerClient::cloneME_
private

Definition at line 80 of file EETriggerTowerClient.h.

Referenced by analyze(), cleanup(), and EETriggerTowerClient().

bool EETriggerTowerClient::debug_
private

Definition at line 83 of file EETriggerTowerClient.h.

Referenced by analyze(), beginJob(), beginRun(), EETriggerTowerClient(), endJob(), and endRun().

DQMStore* EETriggerTowerClient::dqmStore_
private

Definition at line 91 of file EETriggerTowerClient.h.

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

bool EETriggerTowerClient::enableCleanup_
private

Definition at line 87 of file EETriggerTowerClient.h.

Referenced by cleanup(), and EETriggerTowerClient().

int EETriggerTowerClient::ievt_
private

Definition at line 77 of file EETriggerTowerClient.h.

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

int EETriggerTowerClient::jevt_
private

Definition at line 78 of file EETriggerTowerClient.h.

Referenced by analyze(), beginJob(), beginRun(), endRun(), and getEvtPerRun().

TH2F* EETriggerTowerClient::l01_[18]
private
TH2F* EETriggerTowerClient::l02_[18]
private

Definition at line 98 of file EETriggerTowerClient.h.

Referenced by EESummaryClient::analyze(), and analyze().

MonitorElement* EETriggerTowerClient::me_o01_[18]
private
MonitorElement* EETriggerTowerClient::me_o02_[18]
private
MonitorElement* EETriggerTowerClient::mel01_[18]
private

Definition at line 93 of file EETriggerTowerClient.h.

Referenced by analyze(), cleanup(), and EETriggerTowerClient().

MonitorElement* EETriggerTowerClient::mel02_[18]
private

Definition at line 94 of file EETriggerTowerClient.h.

Referenced by analyze().

MonitorElement* EETriggerTowerClient::meo01_[18]
private

Definition at line 95 of file EETriggerTowerClient.h.

Referenced by analyze(), cleanup(), and EETriggerTowerClient().

TH3F* EETriggerTowerClient::o01_[18]
private

Definition at line 99 of file EETriggerTowerClient.h.

Referenced by analyze(), cleanup(), and EETriggerTowerClient().

std::string EETriggerTowerClient::prefixME_
private

Definition at line 85 of file EETriggerTowerClient.h.

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

std::vector<int> EETriggerTowerClient::superModules_
private

Definition at line 89 of file EETriggerTowerClient.h.

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

bool EETriggerTowerClient::verbose_
private

Definition at line 82 of file EETriggerTowerClient.h.

Referenced by EETriggerTowerClient().