CMS 3D CMS Logo

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

#include <CSCValHists.h>

Classes

struct  posRecord
 

Public Member Functions

int crate_lookup (CSCDetId id)
 
 CSCValHists ()
 
void fill1DHist (float x, std::string name, std::string title, int bins, float xmin, float xmax, std::string folder)
 
void fill1DHistByChamber (float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
 
void fill1DHistByCrate (float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
 
void fill1DHistByLayer (float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
 
void fill1DHistByStation (float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
 
void fill1DHistByType (float x, std::string name, std::string title, CSCDetId id, int bins, float xmin, float xmax, std::string folder)
 
void fill2DHist (float x, float y, std::string name, std::string title, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
 
void fill2DHist (float z, std::string name, std::string title, CSCDetId id, std::string folder)
 
void fill2DHistByChamber (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
 
void fill2DHistByCrate (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
 
void fill2DHistByEvent (int run, int event, float x, std::string name, std::string title, CSCDetId id, std::string folder)
 
void fill2DHistByLayer (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
 
void fill2DHistByStation (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
 
void fill2DHistByType (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, std::string folder)
 
void fill2DProfile (float x, float y, float z, std::string name, std::string title, int binsx, float xmin, float xmax, int binsy, float ymin, float ymax, float zmin, float zmax, std::string folder)
 
void fillCalibHist (float x, std::string name, std::string title, int bins, float xmin, float xmax, int bin, std::string folder)
 
void fillProfile (float x, float y, std::string name, std::string title, int binsx, float xmin, float xmax, float ymin, float ymax, std::string folder)
 
void fillProfileByChamber (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, float ymin, float ymax, std::string folder)
 
void fillProfileByType (float x, float y, std::string name, std::string title, CSCDetId id, int binsx, float xmin, float xmax, float ymin, float ymax, std::string folder)
 
void fillRechitTree (float x, float y, float gx, float gy, int en, int st, int ri, int ch, int la)
 
void fillSegmentTree (float x, float y, float gx, float gy, int en, int st, int ri, int ch)
 
void insertPlot (TH1 *thePlot, std::string name, std::string folder)
 
void setupTrees ()
 
void writeHists (TFile *theFile)
 
void writeTrees (TFile *theFile)
 
 ~CSCValHists ()
 

Private Attributes

struct CSCValHists::posRecord rHpos
 
TTree * rHTree
 
struct CSCValHists::posRecord segpos
 
TTree * segTree
 
std::map< std::string,
std::pair< TH1 *, std::string > > 
theMap
 

Detailed Description

Manages Histograms for CSCValidation

Andy Kubik - Northwestern University

Definition at line 36 of file CSCValHists.h.

Constructor & Destructor Documentation

CSCValHists::CSCValHists ( )

Definition at line 7 of file CSCValHists.cc.

References gather_cfg::cout.

7  {
8 
9  std::cout << "Initializing Histogram Manager..." << std::endl;
10 
11  }
tuple cout
Definition: gather_cfg.py:145
CSCValHists::~CSCValHists ( )

Definition at line 14 of file CSCValHists.cc.

14  {
15 
16  }

Member Function Documentation

int CSCValHists::crate_lookup ( CSCDetId  id)

Definition at line 530 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, and relativeConstraints::station.

530  {
531 
532  int crate = 0;
533 
534  if (id.station() == 1){
535  if (id.chamber() == 36 || id.chamber() == 1 || id.chamber() == 2 ) crate = 1;
536  if (id.chamber() == 3 || id.chamber() == 4 || id.chamber() == 5 ) crate = 2;
537  if (id.chamber() == 6 || id.chamber() == 7 || id.chamber() == 8 ) crate = 3;
538  if (id.chamber() == 9 || id.chamber() == 10 || id.chamber() == 11 ) crate = 4;
539  if (id.chamber() == 12 || id.chamber() == 13 || id.chamber() == 14 ) crate = 5;
540  if (id.chamber() == 15 || id.chamber() == 16 || id.chamber() == 17 ) crate = 6;
541  if (id.chamber() == 18 || id.chamber() == 19 || id.chamber() == 20 ) crate = 7;
542  if (id.chamber() == 21 || id.chamber() == 22 || id.chamber() == 23 ) crate = 8;
543  if (id.chamber() == 24 || id.chamber() == 25 || id.chamber() == 26 ) crate = 9;
544  if (id.chamber() == 27 || id.chamber() == 28 || id.chamber() == 29 ) crate = 10;
545  if (id.chamber() == 30 || id.chamber() == 31 || id.chamber() == 32 ) crate = 11;
546  if (id.chamber() == 33 || id.chamber() == 34 || id.chamber() == 35 ) crate = 12;
547  }
548  else{
549  crate = 12 + id.triggerSector() + (id.station()-2)*6;
550  }
551 
552  if (id.endcap() == 2)
553  crate = crate+30;
554 
555  return crate;
556 
557 }
void CSCValHists::fill1DHist ( float  x,
std::string  name,
std::string  title,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 121 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

122  {
123 
124  std::map<std::string,std::pair<TH1*,string> >::iterator it;
125  it = theMap.find(name);
126  if (it == theMap.end()){
127  theMap[name] = std::pair<TH1*,string>(new TH1I(name.c_str(),title.c_str(),bins,xmin,xmax), folder);
128  }
129 
130 
131  theMap[name].first->Fill(x);
132 
133  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill1DHistByChamber ( float  x,
std::string  name,
std::string  title,
CSCDetId  id,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 293 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

294  {
295 
297  if (id.endcap() == 1) endcap = "+";
298  if (id.endcap() == 2) endcap = "-";
299 
300  std::map<std::string,std::pair<TH1*,string> >::iterator it;
301  ostringstream oss1;
302  ostringstream oss2;
303  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber();
304  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << ")";
305  name = oss1.str();
306  title = oss2.str();
307  it = theMap.find(name);
308  if (it == theMap.end()){
309  theMap[name] = std::pair<TH1*,string>(new TH1F(name.c_str(),title.c_str(),bins,xmin,xmax),folder);
310  }
311 
312  theMap[name].first->Fill(x);
313 
314  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill1DHistByCrate ( float  x,
std::string  name,
std::string  title,
CSCDetId  id,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 199 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

200  {
201 
202  int crate = crate_lookup(id);
203 
204  map<string,pair<TH1*,string> >::iterator it;
205  ostringstream oss1;
206  ostringstream oss2;
207  oss1 << name << "_crate_" << crate;
208  oss2 << title << " (crate " << crate << ")";
209  name = oss1.str();
210  title = oss2.str();
211  it = theMap.find(name);
212  if (it == theMap.end()){
213  theMap[name] = pair<TH1*,string>(new TH1F(name.c_str(),title.c_str(),bins,xmin,xmax), folder);
214  }
215 
216  theMap[name].first->Fill(x);
217 
218  }
int crate_lookup(CSCDetId id)
Definition: CSCValHists.cc:530
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill1DHistByLayer ( float  x,
std::string  name,
std::string  title,
CSCDetId  id,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 397 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

398  {
399 
401  if (id.endcap() == 1) endcap = "+";
402  if (id.endcap() == 2) endcap = "-";
403 
404  std::map<std::string,std::pair<TH1*,string> >::iterator it;
405  ostringstream oss1;
406  ostringstream oss2;
407  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber() << "_L" << id.layer();
408  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << "/L" << id.layer() << ")";
409  name = oss1.str();
410  title = oss2.str();
411  it = theMap.find(name);
412  if (it == theMap.end()){
413  theMap[name] = std::pair<TH1*,string>(new TH1F(name.c_str(),title.c_str(),bins,xmin,xmax),folder);
414  }
415 
416  theMap[name].first->Fill(x);
417 
418  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill1DHistByStation ( float  x,
std::string  name,
std::string  title,
CSCDetId  id,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 244 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

245  {
246 
247  string endcap;
248  if (id.endcap() == 1) endcap = "+";
249  if (id.endcap() == 2) endcap = "-";
250 
251  map<string,pair<TH1*,string> >::iterator it;
252  ostringstream oss1;
253  ostringstream oss2;
254  oss1 << name << endcap << id.station();
255  oss2 << title << " (Station " << endcap << id.station() << ")";
256  name = oss1.str();
257  title = oss2.str();
258  it = theMap.find(name);
259  if (it == theMap.end()){
260  theMap[name] = pair<TH1*,string>(new TH1F(name.c_str(),title.c_str(),bins,xmin,xmax), folder);
261  }
262 
263  theMap[name].first->Fill(x);
264 
265  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill1DHistByType ( float  x,
std::string  name,
std::string  title,
CSCDetId  id,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 151 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

152  {
153 
155  if (id.endcap() == 1) endcap = "+";
156  if (id.endcap() == 2) endcap = "-";
157 
158  std::map<std::string,std::pair<TH1*,string> >::iterator it;
159  ostringstream oss1;
160  ostringstream oss2;
161  oss1 << name << endcap << id.station() << id.ring();
162  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << ")";
163  name = oss1.str();
164  title = oss2.str();
165  it = theMap.find(name);
166  if (it == theMap.end()){
167  theMap[name] = std::pair<TH1*,string>(new TH1F(name.c_str(),title.c_str(),bins,xmin,xmax), folder);
168  }
169 
170  theMap[name].first->Fill(x);
171 
172  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DHist ( float  x,
float  y,
std::string  name,
std::string  title,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 136 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

138  {
139 
140  std::map<std::string,std::pair<TH1*,string> >::iterator it;
141  it = theMap.find(name);
142  if (it == theMap.end()){
143  theMap[name] = std::pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax),folder);
144  }
145 
146  theMap[name].first->Fill(x,y);
147 
148  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DHist ( float  z,
std::string  name,
std::string  title,
CSCDetId  id,
std::string  folder 
)
void CSCValHists::fill2DHistByChamber ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 317 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

319  {
320 
322  if (id.endcap() == 1) endcap = "+";
323  if (id.endcap() == 2) endcap = "-";
324 
325  std::map<std::string,std::pair<TH1*,string> >::iterator it;
326  ostringstream oss1;
327  ostringstream oss2;
328  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber();
329  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << ")";
330  name = oss1.str();
331  title = oss2.str();
332  it = theMap.find(name);
333  if (it == theMap.end()){
334  theMap[name] = std::pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax),folder);
335  }
336 
337  theMap[name].first->Fill(x,y);
338 
339  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DHistByCrate ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 220 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

222  {
223 
224  int crate = crate_lookup(id);
225 
226  map<string,pair<TH1*,string> >::iterator it;
227  ostringstream oss1;
228  ostringstream oss2;
229  oss1 << name << "_crate_" << crate;
230  oss2 << title << " (crate " << crate << ")";
231  name = oss1.str();
232  title = oss2.str();
233  it = theMap.find(name);
234  if (it == theMap.end()){
235  theMap[name] = pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax), folder);
236  }
237 
238  theMap[name].first->Fill(x,y);
239 
240  }
int crate_lookup(CSCDetId id)
Definition: CSCValHists.cc:530
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DHistByEvent ( int  run,
int  event,
float  x,
std::string  name,
std::string  title,
CSCDetId  id,
std::string  folder 
)

Definition at line 341 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, event(), HcalObjRepresent::Fill(), mergeVDriftHistosByStation::name, relativeConstraints::station, and x().

341  {
342 
343  string endcap;
344  if (id.endcap() == 1) endcap = "+";
345  if (id.endcap() == 2) endcap = "-";
346 
347  map<string,pair<TH1*,string> >::iterator it;
348  ostringstream oss1;
349  ostringstream oss2;
350  oss1 << name << "_" << run << "_" << event ;
351  oss2 << title << " ( Run: " << run << " Event: " << event << " )";
352  name = oss1.str();
353  title = oss2.str();
354  it = theMap.find(name);
355  if (it == theMap.end()){
356  theMap[name] = pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),36,0.5,36.5,18,0.5,18.5),folder);
357  }
358 
359  int x = id.chamber();
360  int y = id.ring();
361  if (y==4) y =1; //collapsing ME1/1a into ME1/1
362  if (id.station() >1)
363  y = y + 3 + (id.station()-2)*2;
364 
365  if (id.endcap()==1)
366  y = y+9;
367  else
368  y = -1*y+10;
369 
370  dynamic_cast<TH2F*>(theMap[name].first)->Fill(x,y,z);
371 
372  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void CSCValHists::fill2DHistByLayer ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 421 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

423  {
424 
426  if (id.endcap() == 1) endcap = "+";
427  if (id.endcap() == 2) endcap = "-";
428 
429  std::map<std::string,std::pair<TH1*,string> >::iterator it;
430  ostringstream oss1;
431  ostringstream oss2;
432  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber() << "_L" << id.layer();;
433  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << "/L" << id.layer() << ")";
434  name = oss1.str();
435  title = oss2.str();
436  it = theMap.find(name);
437  if (it == theMap.end()){
438  theMap[name] = std::pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax),folder);
439  }
440 
441  theMap[name].first->Fill(x,y);
442 
443  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DHistByStation ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 268 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

270  {
271 
273  if (id.endcap() == 1) endcap = "+";
274  if (id.endcap() == 2) endcap = "-";
275 
276  std::map<std::string,std::pair<TH1*,string> >::iterator it;
277  ostringstream oss1;
278  ostringstream oss2;
279  oss1 << name << endcap << id.station();
280  oss2 << title << " (Station " << endcap << id.station() << ")";
281  name = oss1.str();
282  title = oss2.str();
283  it = theMap.find(name);
284  if (it == theMap.end()){
285  theMap[name] = std::pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax), folder);
286  }
287 
288  theMap[name].first->Fill(x,y);
289 
290  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DHistByType ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 174 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

176  {
177 
179  if (id.endcap() == 1) endcap = "+";
180  if (id.endcap() == 2) endcap = "-";
181 
182  std::map<std::string,std::pair<TH1*,string> >::iterator it;
183  ostringstream oss1;
184  ostringstream oss2;
185  oss1 << name << endcap << id.station() << id.ring();
186  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << ")";
187  name = oss1.str();
188  title = oss2.str();
189  it = theMap.find(name);
190  if (it == theMap.end()){
191  theMap[name] = std::pair<TH1*,string>(new TH2F(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax), folder);
192  }
193 
194  theMap[name].first->Fill(x,y);
195 
196  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fill2DProfile ( float  x,
float  y,
float  z,
std::string  name,
std::string  title,
int  binsx,
float  xmin,
float  xmax,
int  binsy,
float  ymin,
float  ymax,
float  zmin,
float  zmax,
std::string  folder 
)

Definition at line 513 of file CSCValHists.cc.

References plotBeamSpotDB::first, mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, SiStripMonitorClusterAlca_cfi::ymin, SiStripMonitorClusterAlca_cfi::zmax, and SiStripMonitorClusterAlca_cfi::zmin.

516  {
517 
518  std::map<std::string,std::pair<TH1*,string> >::iterator it;
519 
520  it = theMap.find(name);
521  if (it == theMap.end()){
522  theMap[name] = std::pair<TProfile2D*,string>(new TProfile2D(name.c_str(),title.c_str(),binsx,xmin,xmax,binsy,ymin,ymax,zmin,zmax), folder);
523  }
524 
525  TProfile2D *tempp = (TProfile2D*)theMap[name].first;
526  tempp->Fill(x,y,z);
527 
528  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fillCalibHist ( float  x,
std::string  name,
std::string  title,
int  bins,
float  xmin,
float  xmax,
int  bin,
std::string  folder 
)

Definition at line 107 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, and SiStripMonitorClusterAlca_cfi::xmin.

108  {
109 
110  std::map<std::string,std::pair<TH1*,string> >::iterator it;
111  it = theMap.find(name);
112  if (it == theMap.end()){
113  theMap[name] = std::pair<TH1*,string>(new TH1I(name.c_str(),title.c_str(),bins,xmin,xmax), folder);
114  }
115 
116  theMap[name].first->SetBinContent(bin,x);
117 
118  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fillProfile ( float  x,
float  y,
std::string  name,
std::string  title,
int  binsx,
float  xmin,
float  xmax,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 446 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

448  {
449 
450  std::map<std::string,std::pair<TH1*,string> >::iterator it;
451  it = theMap.find(name);
452  if (it == theMap.end()){
453  theMap[name] = std::pair<TProfile*,string>(new TProfile(name.c_str(),title.c_str(),binsx,xmin,xmax,ymin,ymax), folder);
454  }
455 
456  theMap[name].first->Fill(x,y);
457 
458  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fillProfileByChamber ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 487 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

489  {
490 
491  std::map<std::string,std::pair<TH1*,string> >::iterator it;
493  if (id.endcap() == 1) endcap = "+";
494  if (id.endcap() == 2) endcap = "-";
495 
496  ostringstream oss1;
497  ostringstream oss2;
498  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber();
499  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << ")";
500  name = oss1.str();
501  title = oss2.str();
502 
503  it = theMap.find(name);
504  if (it == theMap.end()){
505  theMap[name] = std::pair<TProfile*,string>(new TProfile(name.c_str(),title.c_str(),binsx,xmin,xmax,ymin,ymax), folder);
506  }
507 
508  theMap[name].first->Fill(x,y);
509 
510  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fillProfileByType ( float  x,
float  y,
std::string  name,
std::string  title,
CSCDetId  id,
int  binsx,
float  xmin,
float  xmax,
float  ymin,
float  ymax,
std::string  folder 
)

Definition at line 461 of file CSCValHists.cc.

References Reference_intrackfit_cff::endcap, mergeVDriftHistosByStation::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

463  {
464 
465  std::map<std::string,std::pair<TH1*,string> >::iterator it;
467  if (id.endcap() == 1) endcap = "+";
468  if (id.endcap() == 2) endcap = "-";
469 
470  ostringstream oss1;
471  ostringstream oss2;
472  oss1 << name << endcap << id.station() << id.ring();
473  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << ")";
474  name = oss1.str();
475  title = oss2.str();
476 
477  it = theMap.find(name);
478  if (it == theMap.end()){
479  theMap[name] = std::pair<TProfile*,string>(new TProfile(name.c_str(),title.c_str(),binsx,xmin,xmax,ymin,ymax), folder);
480  }
481 
482  theMap[name].first->Fill(x,y);
483 
484  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::fillRechitTree ( float  x,
float  y,
float  gx,
float  gy,
int  en,
int  st,
int  ri,
int  ch,
int  la 
)

Definition at line 68 of file CSCValHists.cc.

68  {
69 
70  // Fill the rechit position branch
71  rHpos.localx = x;
72  rHpos.localy = y;
73  rHpos.globalx = gx;
74  rHpos.globaly = gy;
75  rHpos.endcap = en;
76  rHpos.ring = ri;
77  rHpos.station = st;
78  rHpos.chamber = ch;
79  rHpos.layer = la;
80  rHTree->Fill();
81 
82  }
TTree * rHTree
Definition: CSCValHists.h:191
struct CSCValHists::posRecord rHpos
void CSCValHists::fillSegmentTree ( float  x,
float  y,
float  gx,
float  gy,
int  en,
int  st,
int  ri,
int  ch 
)

Definition at line 84 of file CSCValHists.cc.

84  {
85 
86  // Fill the segment position branch
87  segpos.localx = x;
88  segpos.localy = y;
89  segpos.globalx = gx;
90  segpos.globaly = gy;
91  segpos.endcap = en;
92  segpos.ring = ri;
93  segpos.station = st;
94  segpos.chamber = ch;
95  segpos.layer = 0;
96  segTree->Fill();
97 
98  }
TTree * segTree
Definition: CSCValHists.h:192
struct CSCValHists::posRecord segpos
void CSCValHists::insertPlot ( TH1 *  thePlot,
std::string  name,
std::string  folder 
)

Definition at line 100 of file CSCValHists.cc.

References mergeVDriftHistosByStation::name.

100  {
101 
102  theMap[name] = std::pair<TH1*,string>(thePlot, folder);
103 
104  }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::setupTrees ( )

Definition at line 55 of file CSCValHists.cc.

55  {
56 
57  // Create the root tree to hold position info
58  rHTree = new TTree("rHPositions","Local and Global reconstructed positions for recHits");
59  segTree = new TTree("segPositions","Local and Global reconstructed positions for segments");
60 
61  // Create a branch on the tree
62  rHTree->Branch("rHpos",&rHpos,"endcap/I:station/I:ring/I:chamber/I:layer/I:localx/F:localy/F:globalx/F:globaly/F");
63  segTree->Branch("segpos",&segpos,"endcap/I:station/I:ring/I:chamber/I:layer/I:localx/F:localy/F:globalx/F:globaly/F");
64 
65  }
TTree * segTree
Definition: CSCValHists.h:192
TTree * rHTree
Definition: CSCValHists.h:191
struct CSCValHists::posRecord rHpos
struct CSCValHists::posRecord segpos
void CSCValHists::writeHists ( TFile *  theFile)

Definition at line 19 of file CSCValHists.cc.

References spr::find(), and AlCaHLTBitMon_QueryRunRegistry::string.

19  {
20 
21  std::vector<std::string> theFolders;
22  std::vector<std::string>::iterator fit;
23  theFile->cd();
24 
25  std::map<std::string,std::pair<TH1*,string> >::const_iterator mapit;
26  for (mapit = theMap.begin(); mapit != theMap.end(); mapit++){
27  std::string folder = (*mapit).second.second.c_str();
28  fit = find(theFolders.begin(), theFolders.end(), folder);
29  if (fit == theFolders.end()){
30  theFolders.push_back(folder);
31  theFile->mkdir(folder.c_str());
32  }
33  theFile->cd((*mapit).second.second.c_str());
34  (*mapit).second.first->Write();
35  theFile->cd();
36  }
37 
38  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:175
void CSCValHists::writeTrees ( TFile *  theFile)

Definition at line 41 of file CSCValHists.cc.

41  {
42 
43  theFile->cd("recHits");
44  rHTree->Write();
45  theFile->cd();
46 
47  theFile->cd("Segments");
48  segTree->Write();
49  theFile->cd();
50 
51 
52  }
TTree * segTree
Definition: CSCValHists.h:192
TTree * rHTree
Definition: CSCValHists.h:191

Member Data Documentation

struct CSCValHists::posRecord CSCValHists::rHpos
private
TTree* CSCValHists::rHTree
private

Definition at line 191 of file CSCValHists.h.

struct CSCValHists::posRecord CSCValHists::segpos
private
TTree* CSCValHists::segTree
private

Definition at line 192 of file CSCValHists.h.

std::map<std::string,std::pair<TH1*,std::string> > CSCValHists::theMap
private

Definition at line 175 of file CSCValHists.h.