CMS 3D CMS Logo

CentralityBins.cc
Go to the documentation of this file.
2 #include <iostream>
3 using namespace std;
4 
5 int CentralityBins::getBin(double value) const {
6  int bin = table_.size() - 1;
7  for (unsigned int i = 0; i < table_.size(); ++i) {
8  if (value >= table_[i].bin_edge) {
9  bin = i;
10  return bin;
11  }
12  }
13 
14  return bin;
15 }
16 
17 CentralityBins::RunMap getCentralityFromFile(TDirectoryFile* file, const char* tag, int firstRun, int lastRun) {
19 }
20 
22  TDirectoryFile* file, const char* dir, const char* tag, int firstRun, int lastRun) {
24  for (int run = firstRun; run <= lastRun; ++run) {
25  const CentralityBins* table = (const CentralityBins*)file->Get(Form("%s/run%d/%s", dir, run, tag));
26  if (table)
27  map.insert(std::pair<int, const CentralityBins*>(run, table));
28  }
29  return map;
30 }
31 
32 ClassImp(CBin);
dataset.firstRun
firstRun
Definition: dataset.py:940
ClassImp
ClassImp(CBin)
mps_fire.i
i
Definition: mps_fire.py:428
CentralityBins.h
CentralityBins::RunMap
std::map< int, const CentralityBins * > RunMap
Definition: CentralityBins.h:39
CBin
Definition: CentralityBins.h:9
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
CentralityBins
Definition: CentralityBins.h:37
BeamSpotPI::lastRun
Definition: BeamSpotPayloadInspectorHelper.h:40
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
value
Definition: value.py:1
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
genParticles_cff.map
map
Definition: genParticles_cff.py:11
TableParser.table
table
Definition: TableParser.py:111
table_
Table table_
Definition: ExceptionActions.cc:21
getCentralityFromFile
CentralityBins::RunMap getCentralityFromFile(TDirectoryFile *file, const char *tag, int firstRun, int lastRun)
Definition: CentralityBins.cc:17
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
CentralityBins::getBin
int getBin(double value) const
Definition: CentralityBins.cc:5