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

#include <EBTriggerTowerClient.h>

Inheritance diagram for EBTriggerTowerClient:
EBClient

Public Member Functions

void analyze (void)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (void)
 BeginRun. More...
 
void cleanup (void)
 Cleanup. More...
 
 EBTriggerTowerClient (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 ~EBTriggerTowerClient ()
 Destructor. More...
 
- Public Member Functions inherited from EBClient
virtual ~EBClient (void)
 

Private Attributes

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

Friends

class EBSummaryClient
 

Detailed Description

Definition at line 35 of file EBTriggerTowerClient.h.

Constructor & Destructor Documentation

EBTriggerTowerClient::EBTriggerTowerClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 26 of file EBTriggerTowerClient.cc.

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

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

Destructor.

Definition at line 71 of file EBTriggerTowerClient.cc.

71  {
72 
73 }

Member Function Documentation

void EBTriggerTowerClient::analyze ( void  )
virtual

Analyze.

Implements EBClient.

Definition at line 206 of file EBTriggerTowerClient.cc.

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

206  {
207 
208  ievt_++;
209  jevt_++;
210  if ( ievt_ % 10 == 0 ) {
211  if ( debug_ ) std::cout << "EBTriggerTowerClient: 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_ + "/EBTriggerTowerTask/EBTTT EmulError " + Numbers::sEB(ism) );
221  l01_[ism-1] = UtilsClient::getHisto<TH2F*>( me, cloneME_, l01_[ism-1] );
222  mel01_[ism-1] = me;
223 
224  me = dqmStore_->get( prefixME_ + "/EBTriggerTowerTask/EBTTT EmulFineGrainVetoError " + Numbers::sEB(ism) );
225  l02_[ism-1] = UtilsClient::getHisto<TH2F*>( me, cloneME_, l02_[ism-1] );
226  mel02_[ism-1] = me;
227 
228  me = dqmStore_->get( prefixME_ + "/EBTriggerTowerTask/EBTTT EmulMatch " + Numbers::sEB(ism) );
229  o01_[ism-1] = UtilsClient::getHisto<TH3F*>( 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 ie = 1; ie <= 17; ie++) {
236  for (int ip = 1; ip <= 4; ip++) {
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(ie, ip, 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  me_o01_[ism-1]->setBinContent(ie, ip, -1);
254  } else {
255  me_o01_[ism-1]->setBinContent(ie, ip, index );
256  }
257  }
258  double fraction = (total > 0) ? 1.0 - max/total : 0.;
259  if ( me_o02_[ism-1] ) me_o02_[ism-1]->setBinContent(ie, ip, fraction);
260  }
261 
262  }
263  }
264 
265  }
266 
267 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * me_o02_[36]
MonitorElement * mel01_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
MonitorElement * mel02_[36]
MonitorElement * meo01_[36]
const T & max(const T &a, const T &b)
std::vector< int > superModules_
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:1468
MonitorElement * me_o01_[36]
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 EBTriggerTowerClient::beginJob ( void  )
virtual

BeginJob.

Implements EBClient.

Definition at line 75 of file EBTriggerTowerClient.cc.

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

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

BeginRun.

Implements EBClient.

Definition at line 86 of file EBTriggerTowerClient.cc.

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

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

Cleanup.

Implements EBClient.

Definition at line 148 of file EBTriggerTowerClient.cc.

References cloneME_, dqmStore_, enableCleanup_, edm::getName(), 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_ + "/EBTriggerTowerClient" );
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 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_o02_[36]
MonitorElement * mel01_[36]
MonitorElement * meo01_[36]
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
MonitorElement * me_o01_[36]
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void EBTriggerTowerClient::endJob ( void  )
virtual

EndJob.

Implements EBClient.

Definition at line 96 of file EBTriggerTowerClient.cc.

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

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

EndRun.

Implements EBClient.

Definition at line 104 of file EBTriggerTowerClient.cc.

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

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

Get Functions.

Implements EBClient.

Definition at line 74 of file EBTriggerTowerClient.h.

References ievt_.

74 { return ievt_; }
int EBTriggerTowerClient::getEvtPerRun ( void  )
inlinevirtual

Returns the number of processed events in this Run.

Implements EBClient.

Definition at line 75 of file EBTriggerTowerClient.h.

References jevt_.

75 { return jevt_; }
void EBTriggerTowerClient::setup ( void  )
virtual

Setup.

Implements EBClient.

Definition at line 112 of file EBTriggerTowerClient.cc.

References DQMStore::book2D(), dqmStore_, edm::getName(), i, ecalpyutils::ism(), me_o01_, me_o02_, mergeVDriftHistosByStation::name, prefixME_, DQMStore::removeElement(), MonitorElement::Reset(), Numbers::sEB(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and superModules_.

Referenced by beginRun().

112  {
113 
114  std::string name;
115 
116  dqmStore_->setCurrentFolder( prefixME_ + "/EBTriggerTowerClient" );
117 
118  for ( unsigned int i=0; i<superModules_.size(); i++ ) {
119 
120  int ism = superModules_[i];
121 
122  if ( me_o01_[ism-1] ) dqmStore_->removeElement( me_o01_[ism-1]->getName() );
123  name = "EBTTT Trigger Primitives Timing " + Numbers::sEB(ism);
124  me_o01_[ism-1] = dqmStore_->book2D(name, name, 17, 0., 17., 4, 0., 4.);
125  me_o01_[ism-1]->setAxisTitle("ieta'", 1);
126  me_o01_[ism-1]->setAxisTitle("iphi'", 2);
127 
128  if ( me_o02_[ism-1] ) dqmStore_->removeElement( me_o02_[ism-1]->getName() );
129  name = "EBTTT Non Single Timing " + Numbers::sEB(ism);
130  me_o02_[ism-1] = dqmStore_->book2D(name, name, 17, 0., 17., 4, 0., 4.);
131  me_o02_[ism-1]->setAxisTitle("ieta'", 1);
132  me_o02_[ism-1]->setAxisTitle("iphi'", 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 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * me_o02_[36]
static std::string sEB(const unsigned ism)
Definition: Numbers.cc:94
std::vector< int > superModules_
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
std::string getName(Reflex::Type &cc)
Definition: ClassFiller.cc:18
MonitorElement * me_o01_[36]
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
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:429

Friends And Related Function Documentation

friend class EBSummaryClient
friend

Definition at line 37 of file EBTriggerTowerClient.h.

Member Data Documentation

bool EBTriggerTowerClient::cloneME_
private

Definition at line 82 of file EBTriggerTowerClient.h.

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

bool EBTriggerTowerClient::debug_
private

Definition at line 85 of file EBTriggerTowerClient.h.

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

DQMStore* EBTriggerTowerClient::dqmStore_
private

Definition at line 93 of file EBTriggerTowerClient.h.

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

bool EBTriggerTowerClient::enableCleanup_
private

Definition at line 89 of file EBTriggerTowerClient.h.

Referenced by cleanup(), and EBTriggerTowerClient().

int EBTriggerTowerClient::ievt_
private

Definition at line 79 of file EBTriggerTowerClient.h.

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

int EBTriggerTowerClient::jevt_
private

Definition at line 80 of file EBTriggerTowerClient.h.

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

TH2F* EBTriggerTowerClient::l01_[36]
private
TH2F* EBTriggerTowerClient::l02_[36]
private

Definition at line 99 of file EBTriggerTowerClient.h.

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

MonitorElement* EBTriggerTowerClient::me_o01_[36]
private
MonitorElement* EBTriggerTowerClient::me_o02_[36]
private
MonitorElement* EBTriggerTowerClient::mel01_[36]
private

Definition at line 95 of file EBTriggerTowerClient.h.

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

MonitorElement* EBTriggerTowerClient::mel02_[36]
private

Definition at line 96 of file EBTriggerTowerClient.h.

Referenced by analyze().

MonitorElement* EBTriggerTowerClient::meo01_[36]
private

Definition at line 97 of file EBTriggerTowerClient.h.

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

TH3F* EBTriggerTowerClient::o01_[36]
private

Definition at line 100 of file EBTriggerTowerClient.h.

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

std::string EBTriggerTowerClient::prefixME_
private

Definition at line 87 of file EBTriggerTowerClient.h.

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

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

Definition at line 91 of file EBTriggerTowerClient.h.

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

bool EBTriggerTowerClient::verbose_
private

Definition at line 84 of file EBTriggerTowerClient.h.

Referenced by EBTriggerTowerClient().