CMS 3D CMS Logo

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

original author: Andy Kubik (Northwestern University)

contact CSC DPG

Definition at line 36 of file CSCValHists.h.

Constructor & Destructor Documentation

◆ CSCValHists()

CSCValHists::CSCValHists ( )

Definition at line 6 of file CSCValHists.cc.

References gather_cfg::cout.

6 { std::cout << "Initializing Histogram Manager..." << std::endl; }

◆ ~CSCValHists()

CSCValHists::~CSCValHists ( )

Definition at line 8 of file CSCValHists.cc.

8 {}

Member Function Documentation

◆ crate_lookup()

int CSCValHists::crate_lookup ( CSCDetId  id)

Definition at line 575 of file CSCValHists.cc.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, and relativeConstraints::station.

575  {
576  int crate = 0;
577 
578  if (id.station() == 1) {
579  if (id.chamber() == 36 || id.chamber() == 1 || id.chamber() == 2)
580  crate = 1;
581  if (id.chamber() == 3 || id.chamber() == 4 || id.chamber() == 5)
582  crate = 2;
583  if (id.chamber() == 6 || id.chamber() == 7 || id.chamber() == 8)
584  crate = 3;
585  if (id.chamber() == 9 || id.chamber() == 10 || id.chamber() == 11)
586  crate = 4;
587  if (id.chamber() == 12 || id.chamber() == 13 || id.chamber() == 14)
588  crate = 5;
589  if (id.chamber() == 15 || id.chamber() == 16 || id.chamber() == 17)
590  crate = 6;
591  if (id.chamber() == 18 || id.chamber() == 19 || id.chamber() == 20)
592  crate = 7;
593  if (id.chamber() == 21 || id.chamber() == 22 || id.chamber() == 23)
594  crate = 8;
595  if (id.chamber() == 24 || id.chamber() == 25 || id.chamber() == 26)
596  crate = 9;
597  if (id.chamber() == 27 || id.chamber() == 28 || id.chamber() == 29)
598  crate = 10;
599  if (id.chamber() == 30 || id.chamber() == 31 || id.chamber() == 32)
600  crate = 11;
601  if (id.chamber() == 33 || id.chamber() == 34 || id.chamber() == 35)
602  crate = 12;
603  } else {
604  crate = 12 + id.triggerSector() + (id.station() - 2) * 6;
605  }
606 
607  if (id.endcap() == 2)
608  crate = crate + 30;
609 
610  return crate;
611 }

◆ fill1DHist()

void CSCValHists::fill1DHist ( float  x,
std::string  name,
std::string  title,
int  bins,
float  xmin,
float  xmax,
std::string  folder 
)

Definition at line 93 of file CSCValHists.cc.

References trigObjTnPSource_cfi::bins, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

94  {
95  std::map<std::string, std::pair<TH1*, string> >::iterator it;
96  it = theMap.find(name);
97  if (it == theMap.end()) {
98  theMap[name] = std::pair<TH1*, string>(new TH1I(name.c_str(), title.c_str(), bins, xmin, xmax), folder);
99  }
100 
101  theMap[name].first->Fill(x);
102 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill1DHistByChamber()

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 288 of file CSCValHists.cc.

References trigObjTnPSource_cfi::bins, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

◆ fill1DHistByCrate()

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 182 of file CSCValHists.cc.

References trigObjTnPSource_cfi::bins, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

183  {
184  int crate = crate_lookup(id);
185 
186  map<string, pair<TH1*, string> >::iterator it;
187  ostringstream oss1;
188  ostringstream oss2;
189  oss1 << name << "_crate_" << crate;
190  oss2 << title << " (crate " << crate << ")";
191  name = oss1.str();
192  title = oss2.str();
193  it = theMap.find(name);
194  if (it == theMap.end()) {
195  theMap[name] = pair<TH1*, string>(new TH1F(name.c_str(), title.c_str(), bins, xmin, xmax), folder);
196  }
197 
198  theMap[name].first->Fill(x);
199 }
int crate_lookup(CSCDetId id)
Definition: CSCValHists.cc:575
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill1DHistByLayer()

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 401 of file CSCValHists.cc.

References trigObjTnPSource_cfi::bins, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

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

◆ fill1DHistByStation()

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 231 of file CSCValHists.cc.

References trigObjTnPSource_cfi::bins, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

232  {
233  string endcap;
234  if (id.endcap() == 1)
235  endcap = "+";
236  if (id.endcap() == 2)
237  endcap = "-";
238 
239  map<string, pair<TH1*, string> >::iterator it;
240  ostringstream oss1;
241  ostringstream oss2;
242  oss1 << name << endcap << id.station();
243  oss2 << title << " (Station " << endcap << id.station() << ")";
244  name = oss1.str();
245  title = oss2.str();
246  it = theMap.find(name);
247  if (it == theMap.end()) {
248  theMap[name] = pair<TH1*, string>(new TH1F(name.c_str(), title.c_str(), bins, xmin, xmax), folder);
249  }
250 
251  theMap[name].first->Fill(x);
252 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill1DHistByType()

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 125 of file CSCValHists.cc.

References trigObjTnPSource_cfi::bins, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

126  {
128  if (id.endcap() == 1)
129  endcap = "+";
130  if (id.endcap() == 2)
131  endcap = "-";
132 
133  std::map<std::string, std::pair<TH1*, string> >::iterator it;
134  ostringstream oss1;
135  ostringstream oss2;
136  oss1 << name << endcap << id.station() << id.ring();
137  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << ")";
138  name = oss1.str();
139  title = oss2.str();
140  it = theMap.find(name);
141  if (it == theMap.end()) {
142  theMap[name] = std::pair<TH1*, string>(new TH1F(name.c_str(), title.c_str(), bins, xmin, xmax), folder);
143  }
144 
145  theMap[name].first->Fill(x);
146 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill2DHist() [1/2]

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 104 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

114  {
115  std::map<std::string, std::pair<TH1*, string> >::iterator it;
116  it = theMap.find(name);
117  if (it == theMap.end()) {
118  theMap[name] =
119  std::pair<TH1*, string>(new TH2F(name.c_str(), title.c_str(), binsx, xmin, xmax, binsy, ymin, ymax), folder);
120  }
121 
122  theMap[name].first->Fill(x, y);
123 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill2DHist() [2/2]

void CSCValHists::fill2DHist ( float  z,
std::string  name,
std::string  title,
CSCDetId  id,
std::string  folder 
)

◆ fill2DHistByChamber()

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 311 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

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

◆ fill2DHistByCrate()

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 201 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

212  {
213  int crate = crate_lookup(id);
214 
215  map<string, pair<TH1*, string> >::iterator it;
216  ostringstream oss1;
217  ostringstream oss2;
218  oss1 << name << "_crate_" << crate;
219  oss2 << title << " (crate " << crate << ")";
220  name = oss1.str();
221  title = oss2.str();
222  it = theMap.find(name);
223  if (it == theMap.end()) {
224  theMap[name] =
225  pair<TH1*, string>(new TH2F(name.c_str(), title.c_str(), binsx, xmin, xmax, binsy, ymin, ymax), folder);
226  }
227 
228  theMap[name].first->Fill(x, y);
229 }
int crate_lookup(CSCDetId id)
Definition: CSCValHists.cc:575
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill2DHistByEvent()

void CSCValHists::fill2DHistByEvent ( int  run,
int  event,
float  x,
std::string  name,
std::string  title,
CSCDetId  id,
std::string  folder 
)

Definition at line 345 of file CSCValHists.cc.

References makeMuonMisalignmentScenario::endcap, edmPickEvents::event, HcalObjRepresent::Fill(), printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, writedatasetfile::run, relativeConstraints::station, runGCPTkAlMap::title, and x.

345  {
346  string endcap;
347  if (id.endcap() == 1)
348  endcap = "+";
349  if (id.endcap() == 2)
350  endcap = "-";
351 
352  map<string, pair<TH1*, string> >::iterator it;
353  ostringstream oss1;
354  ostringstream oss2;
355  oss1 << name << "_" << run << "_" << event;
356  oss2 << title << " ( Run: " << run << " Event: " << event << " )";
357  name = oss1.str();
358  title = oss2.str();
359  it = theMap.find(name);
360  if (it == theMap.end()) {
361  theMap[name] = pair<TH1*, string>(new TH2F(name.c_str(), title.c_str(), 36, 0.5, 36.5, 18, 0.5, 18.5), folder);
362  }
363 
364  int x = id.chamber();
365  int y = id.ring();
366  if (y == 4)
367  y = 1; //collapsing ME1/1a into ME1/1
368  if (id.station() > 1)
369  y = y + 3 + (id.station() - 2) * 2;
370 
371  if (id.endcap() == 1)
372  y = y + 9;
373  else
374  y = -1 * y + 10;
375 
376  dynamic_cast<TH2F*>(theMap[name].first)->Fill(x, y, z);
377 }
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill2DHistByLayer()

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 425 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

436  {
438  if (id.endcap() == 1)
439  endcap = "+";
440  if (id.endcap() == 2)
441  endcap = "-";
442 
443  std::map<std::string, std::pair<TH1*, string> >::iterator it;
444  ostringstream oss1;
445  ostringstream oss2;
446  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber() << "_L" << id.layer();
447  ;
448  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << "/L" << id.layer()
449  << ")";
450  name = oss1.str();
451  title = oss2.str();
452  it = theMap.find(name);
453  if (it == theMap.end()) {
454  theMap[name] =
455  std::pair<TH1*, string>(new TH2F(name.c_str(), title.c_str(), binsx, xmin, xmax, binsy, ymin, ymax), folder);
456  }
457 
458  theMap[name].first->Fill(x, y);
459 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill2DHistByStation()

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 254 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

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

◆ fill2DHistByType()

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 148 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

159  {
161  if (id.endcap() == 1)
162  endcap = "+";
163  if (id.endcap() == 2)
164  endcap = "-";
165 
166  std::map<std::string, std::pair<TH1*, string> >::iterator it;
167  ostringstream oss1;
168  ostringstream oss2;
169  oss1 << name << endcap << id.station() << id.ring();
170  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << ")";
171  name = oss1.str();
172  title = oss2.str();
173  it = theMap.find(name);
174  if (it == theMap.end()) {
175  theMap[name] =
176  std::pair<TH1*, string>(new TH2F(name.c_str(), title.c_str(), binsx, xmin, xmax, binsy, ymin, ymax), folder);
177  }
178 
179  theMap[name].first->Fill(x, y);
180 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fill2DProfile()

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 549 of file CSCValHists.cc.

References alignmentValidation::binsx, alignmentValidation::binsy, dqmdumpme::first, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, L1TOccupancyClient_cfi::ymin, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

562  {
563  std::map<std::string, std::pair<TH1*, string> >::iterator it;
564 
565  it = theMap.find(name);
566  if (it == theMap.end()) {
567  theMap[name] = std::pair<TProfile2D*, string>(
568  new TProfile2D(name.c_str(), title.c_str(), binsx, xmin, xmax, binsy, ymin, ymax, zmin, zmax), folder);
569  }
570 
571  TProfile2D* tempp = (TProfile2D*)theMap[name].first;
572  tempp->Fill(x, y, z);
573 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fillCalibHist()

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 82 of file CSCValHists.cc.

References newFWLiteAna::bin, trigObjTnPSource_cfi::bins, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

83  {
84  std::map<std::string, std::pair<TH1*, string> >::iterator it;
85  it = theMap.find(name);
86  if (it == theMap.end()) {
87  theMap[name] = std::pair<TH1*, string>(new TH1I(name.c_str(), title.c_str(), bins, xmin, xmax), folder);
88  }
89 
90  theMap[name].first->SetBinContent(bin, x);
91 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fillProfile()

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 
)

◆ fillProfileByChamber()

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 515 of file CSCValHists.cc.

References alignmentValidation::binsx, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

525  {
526  std::map<std::string, std::pair<TH1*, string> >::iterator it;
528  if (id.endcap() == 1)
529  endcap = "+";
530  if (id.endcap() == 2)
531  endcap = "-";
532 
533  ostringstream oss1;
534  ostringstream oss2;
535  oss1 << name << "_" << endcap << id.station() << "_" << id.ring() << "_" << id.chamber();
536  oss2 << title << " (ME " << endcap << id.station() << "/" << id.ring() << "/" << id.chamber() << ")";
537  name = oss1.str();
538  title = oss2.str();
539 
540  it = theMap.find(name);
541  if (it == theMap.end()) {
542  theMap[name] =
543  std::pair<TProfile*, string>(new TProfile(name.c_str(), title.c_str(), binsx, xmin, xmax, ymin, ymax), folder);
544  }
545 
546  theMap[name].first->Fill(x, y);
547 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ fillProfileByType()

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 481 of file CSCValHists.cc.

References alignmentValidation::binsx, makeMuonMisalignmentScenario::endcap, printsummarytable::folder, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, x, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

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

◆ fillRechitTree()

void CSCValHists::fillRechitTree ( float  x,
float  y,
float  gx,
float  gy,
int  en,
int  st,
int  ri,
int  ch,
int  la 
)

Definition at line 50 of file CSCValHists.cc.

References x.

50  {
51  // Fill the rechit position branch
52  rHpos.localx = x;
53  rHpos.localy = y;
54  rHpos.globalx = gx;
55  rHpos.globaly = gy;
56  rHpos.endcap = en;
57  rHpos.ring = ri;
58  rHpos.station = st;
59  rHpos.chamber = ch;
60  rHpos.layer = la;
61  rHTree->Fill();
62 }
TTree * rHTree
Definition: CSCValHists.h:269
struct CSCValHists::posRecord rHpos

◆ fillSegmentTree()

void CSCValHists::fillSegmentTree ( float  x,
float  y,
float  gx,
float  gy,
int  en,
int  st,
int  ri,
int  ch 
)

Definition at line 64 of file CSCValHists.cc.

References x.

64  {
65  // Fill the segment position branch
66  segpos.localx = x;
67  segpos.localy = y;
68  segpos.globalx = gx;
69  segpos.globaly = gy;
70  segpos.endcap = en;
71  segpos.ring = ri;
72  segpos.station = st;
73  segpos.chamber = ch;
74  segpos.layer = 0;
75  segTree->Fill();
76 }
TTree * segTree
Definition: CSCValHists.h:270
struct CSCValHists::posRecord segpos

◆ insertPlot()

void CSCValHists::insertPlot ( TH1 *  thePlot,
std::string  name,
std::string  folder 
)

Definition at line 78 of file CSCValHists.cc.

References printsummarytable::folder, and Skims_PA_cff::name.

78  {
79  theMap[name] = std::pair<TH1*, string>(thePlot, folder);
80 }
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ setupTrees()

void CSCValHists::setupTrees ( )

Definition at line 39 of file CSCValHists.cc.

39  {
40  // Create the root tree to hold position info
41  rHTree = new TTree("rHPositions", "Local and Global reconstructed positions for recHits");
42  segTree = new TTree("segPositions", "Local and Global reconstructed positions for segments");
43 
44  // Create a branch on the tree
45  rHTree->Branch("rHpos", &rHpos, "endcap/I:station/I:ring/I:chamber/I:layer/I:localx/F:localy/F:globalx/F:globaly/F");
46  segTree->Branch(
47  "segpos", &segpos, "endcap/I:station/I:ring/I:chamber/I:layer/I:localx/F:localy/F:globalx/F:globaly/F");
48 }
TTree * segTree
Definition: CSCValHists.h:270
TTree * rHTree
Definition: CSCValHists.h:269
struct CSCValHists::posRecord rHpos
struct CSCValHists::posRecord segpos

◆ writeHists()

void CSCValHists::writeHists ( TFile *  theFile)

Definition at line 10 of file CSCValHists.cc.

References spr::find(), l1tPhase2CaloJetEmulator_cfi::fit, printsummarytable::folder, AlCaHLTBitMon_QueryRunRegistry::string, and makeListRunsInFiles::theFile.

10  {
11  std::vector<std::string> theFolders;
12  std::vector<std::string>::iterator fit;
13  theFile->cd();
14 
15  std::map<std::string, std::pair<TH1*, string> >::const_iterator mapit;
16  for (mapit = theMap.begin(); mapit != theMap.end(); mapit++) {
17  std::string folder = (*mapit).second.second;
18  fit = find(theFolders.begin(), theFolders.end(), folder);
19  if (fit == theFolders.end()) {
20  theFolders.push_back(folder);
21  theFile->mkdir(folder.c_str());
22  }
23  theFile->cd((*mapit).second.second.c_str());
24  (*mapit).second.first->Write();
25  theFile->cd();
26  }
27 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::map< std::string, std::pair< TH1 *, std::string > > theMap
Definition: CSCValHists.h:253

◆ writeTrees()

void CSCValHists::writeTrees ( TFile *  theFile)

Definition at line 29 of file CSCValHists.cc.

References makeListRunsInFiles::theFile.

29  {
30  theFile->cd("recHits");
31  rHTree->Write();
32  theFile->cd();
33 
34  theFile->cd("Segments");
35  segTree->Write();
36  theFile->cd();
37 }
TTree * segTree
Definition: CSCValHists.h:270
TTree * rHTree
Definition: CSCValHists.h:269

Member Data Documentation

◆ rHpos

struct CSCValHists::posRecord CSCValHists::rHpos
private

◆ rHTree

TTree* CSCValHists::rHTree
private

Definition at line 269 of file CSCValHists.h.

◆ segpos

struct CSCValHists::posRecord CSCValHists::segpos
private

◆ segTree

TTree* CSCValHists::segTree
private

Definition at line 270 of file CSCValHists.h.

◆ theMap

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

Definition at line 253 of file CSCValHists.h.