CMS 3D CMS Logo

ClusterSummary.cc
Go to the documentation of this file.
3 
4 const std::vector<std::string> ClusterSummary::subDetNames{
5  "STRIP", "TOB", "TIB", "TID", "TEC", "PIXEL", "BPIX", "FPIX"};
6 const std::vector<std::vector<std::string> > ClusterSummary::subDetSelections{
7  {"0x1e000000-0x1A000000", "0x1e000000-0x16000000", "0x1e000000-0x18000000", "0x1e000000-0x1C000000"},
8  {"0x1e000000-0x1A000000"},
9  {"0x1e000000-0x16000000"},
10  {"0x1e000000-0x18000000"},
11  {"0x1e000000-0x1C000000"},
12  {"0x1e000000-0x12000000", "0x1e000000-0x14000000"},
13  {"0x1e000000-0x12000000"},
14  {"0x1e000000-0x14000000"}};
15 const std::vector<std::string> ClusterSummary::variableNames{"NCLUSTERS", "CLUSTERSIZE", "CLUSTERCHARGE"};
16 
18 
19 ClusterSummary::ClusterSummary(const int nSelections)
20  : modules(nSelections), nClus(nSelections), clusSize(nSelections), clusCharge(nSelections) {
21  for (int i = 0; i < nSelections; ++i)
22  modules[i] = i;
23 }
24 
26  modules = rhs.modules;
27  nClus = rhs.nClus;
28  clusSize = rhs.clusSize;
29  clusCharge = rhs.clusCharge;
30  return *this;
31 }
32 
33 // move ctor
35 
37  : modules(src.getModules()),
38  nClus(src.getNClusVector()),
39  clusSize(src.getClusSizeVector()),
40  clusCharge(src.getClusChargeVector()) {}
41 
43  int iM = -1;
44  for (auto m : modules) {
45  ++iM;
46  if (m == mod)
47  return iM;
48  }
49 
50  if (warn)
51  edm::LogWarning("NoModule") << "No information for requested module " << mod
52  << ". Please check in the Provinence Infomation for proper modules.";
53 
54  return -1;
55 }
56 
58  modules.clear();
59  nClus.clear();
60  clusSize.clear();
61  clusCharge.clear();
62 
63  const std::vector<int>& src_modules = src.getModules();
64  const std::vector<int>& src_nClus = src.getNClusVector();
65  const std::vector<int>& src_clusSize = src.getClusSizeVector();
66  const std::vector<float>& src_clusCharge = src.getClusChargeVector();
67 
68  modules.reserve(src_modules.size());
69  nClus.reserve(src_modules.size());
70  clusSize.reserve(src_modules.size());
71  clusCharge.reserve(src_modules.size());
72 
73  for (unsigned int iM = 0; iM < src_nClus.size(); ++iM) {
74  if (src.nClus[iM] != 0) {
75  modules.push_back(src_modules[iM]);
76  nClus.push_back(src_nClus[iM]);
77  clusSize.push_back(src_clusSize[iM]);
78  clusCharge.push_back(src_clusCharge[iM]);
79  }
80  }
81 }
82 
84  for (unsigned int iM = 0; iM < modules.size(); ++iM) {
85  nClus[iM] = 0;
86  clusSize[iM] = 0;
87  clusCharge[iM] = 0;
88  }
89 }
ClusterSummary::variableNames
static const std::vector< std::string > variableNames
Definition: ClusterSummary.h:100
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
ClusterSummary::clusCharge
std::vector< float > clusCharge
Definition: ClusterSummary.h:156
ClusterSummary::operator=
ClusterSummary & operator=(const ClusterSummary &rhs)
Definition: ClusterSummary.cc:25
modules
Definition: MuonCleanerBySegments.cc:35
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
ClusterSummary::modules
std::vector< int > modules
Definition: ClusterSummary.h:153
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ClusterSummary::getModuleLocation
int getModuleLocation(int mod, bool warn=true) const
Definition: ClusterSummary.cc:42
ClusterSummary::ClusterSummary
ClusterSummary()
Definition: ClusterSummary.cc:17
ClusterSummary.h
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
trackingPlots.other
other
Definition: trackingPlots.py:1460
ClusterSummary::subDetNames
static const std::vector< std::string > subDetNames
Definition: ClusterSummary.h:95
ClusterSummary::nClus
std::vector< int > nClus
Definition: ClusterSummary.h:154
python.warn
def warn(*args, **kwargs)
Definition: __init__.py:21
ClusterSummary::reset
void reset()
Definition: ClusterSummary.cc:83
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
ClusterSummary::clusSize
std::vector< int > clusSize
Definition: ClusterSummary.h:155
ClusterSummary
Definition: ClusterSummary.h:59
ClusterSummary::copyNonEmpty
void copyNonEmpty(const ClusterSummary &src)
Definition: ClusterSummary.cc:57
ClusterSummary::subDetSelections
static const std::vector< std::vector< std::string > > subDetSelections
Definition: ClusterSummary.h:96