test
CMS 3D CMS Logo

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

#include <msegala/ClusterSummary/src/ClusterSummary.cc>

Public Types

enum  CMSTracker {
  STRIP = 0, TIB = 1, TOB = 2, TID = 3,
  TEC = 4, PIXEL = 5, FPIX = 6, BPIX = 7,
  NVALIDENUMS = 8, NTRACKERENUMS = 100
}
 
enum  VariablePlacement { NCLUSTERS, CLUSTERSIZE, CLUSTERCHARGE, NVARIABLES }
 

Public Member Functions

void addClusCharge (const CMSTracker mod, const float val)
 
void addClusChargeByIndex (const int mod, const float val)
 
void addClusSize (const CMSTracker mod, const int val)
 
void addClusSizeByIndex (const int mod, const int val)
 
void addNClus (const CMSTracker mod, const int val)
 
void addNClusByIndex (const int mod, const int val)
 
 ClusterSummary ()
 
 ClusterSummary (const int nSelections)
 
 ClusterSummary (const ClusterSummary &src)
 
 ClusterSummary (ClusterSummary &&other)
 
void copyNonEmpty (const ClusterSummary &src)
 
float getClusCharge (const CMSTracker mod) const
 
float getClusChargeByIndex (const int mod) const
 
const std::vector< float > & getClusChargeVector () const
 
int getClusSize (const CMSTracker mod) const
 
int getClusSizeByIndex (const int mod) const
 
const std::vector< int > & getClusSizeVector () const
 
int getModule (const int index) const
 
int getModuleLocation (int mod, bool warn=true) const
 
const std::vector< int > & getModules () const
 
int getNClus (const CMSTracker mod) const
 
int getNClusByIndex (const int mod) const
 
const std::vector< int > & getNClusVector () const
 
unsigned int getNumberOfModules () const
 
ClusterSummaryoperator= (const ClusterSummary &rhs)
 
void reset ()
 
 ~ClusterSummary ()
 

Static Public Attributes

static const std::vector
< std::string > 
subDetNames {"STRIP","TOB","TIB","TID","TEC","PIXEL","BPIX","FPIX"}
 
static const std::vector
< std::vector< std::string > > 
subDetSelections
 
static const std::vector
< std::string > 
variableNames {"NCLUSTERS","CLUSTERSIZE","CLUSTERCHARGE"}
 

Private Attributes

std::vector< float > clusCharge
 
std::vector< int > clusSize
 
std::vector< int > modules
 
std::vector< int > nClus
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 69 of file ClusterSummary.h.

Member Enumeration Documentation

Enumerator
STRIP 
TIB 
TOB 
TID 
TEC 
PIXEL 
FPIX 
BPIX 
NVALIDENUMS 
NTRACKERENUMS 

Definition at line 85 of file ClusterSummary.h.

Constructor & Destructor Documentation

ClusterSummary::ClusterSummary ( )
ClusterSummary::ClusterSummary ( const int  nSelections)

Definition at line 15 of file ClusterSummary.cc.

References i, and modules.

15  : modules(nSelections),nClus(nSelections),clusSize(nSelections),clusCharge(nSelections)
16 {
17  for(int i = 0; i < nSelections; ++i) modules[i] = i;
18 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > clusCharge
std::vector< int > modules
std::vector< int > clusSize
std::vector< int > nClus
ClusterSummary::~ClusterSummary ( )
inline

Definition at line 75 of file ClusterSummary.h.

75 {}
ClusterSummary::ClusterSummary ( const ClusterSummary src)

Definition at line 35 of file ClusterSummary.cc.

35  :
36  modules (src.getModules() ),
37  nClus (src.getNClusVector() ),
38  clusSize (src.getClusSizeVector() ),
40 {}
const std::vector< int > & getClusSizeVector() const
const std::vector< float > & getClusChargeVector() const
std::vector< float > clusCharge
std::vector< int > modules
const std::vector< int > & getNClusVector() const
const std::vector< int > & getModules() const
std::vector< int > clusSize
std::vector< int > nClus
ClusterSummary::ClusterSummary ( ClusterSummary &&  other)

Definition at line 30 of file ClusterSummary.cc.

30  : ClusterSummary()
31 {
32  *this = other;
33 }

Member Function Documentation

void ClusterSummary::addClusCharge ( const CMSTracker  mod,
const float  val 
)
inline

Definition at line 122 of file ClusterSummary.h.

References clusCharge, and getModuleLocation().

122 {clusCharge.at(getModuleLocation(mod))+=val;}
std::vector< float > clusCharge
int getModuleLocation(int mod, bool warn=true) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void ClusterSummary::addClusChargeByIndex ( const int  mod,
const float  val 
)
inline

Definition at line 118 of file ClusterSummary.h.

References clusCharge.

Referenced by ClusterSummaryProducer::produce().

118 {clusCharge.at(mod)+=val;}
std::vector< float > clusCharge
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void ClusterSummary::addClusSize ( const CMSTracker  mod,
const int  val 
)
inline

Definition at line 121 of file ClusterSummary.h.

References clusSize, and getModuleLocation().

121 {clusSize .at(getModuleLocation(mod))+=val;}
int getModuleLocation(int mod, bool warn=true) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > clusSize
void ClusterSummary::addClusSizeByIndex ( const int  mod,
const int  val 
)
inline

Definition at line 117 of file ClusterSummary.h.

References clusSize.

Referenced by ClusterSummaryProducer::produce().

117 {clusSize .at(mod)+=val;}
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > clusSize
void ClusterSummary::addNClus ( const CMSTracker  mod,
const int  val 
)
inline

Definition at line 120 of file ClusterSummary.h.

References getModuleLocation(), and nClus.

120 {nClus .at(getModuleLocation(mod))+=val;}
int getModuleLocation(int mod, bool warn=true) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > nClus
void ClusterSummary::addNClusByIndex ( const int  mod,
const int  val 
)
inline

Definition at line 116 of file ClusterSummary.h.

References nClus.

Referenced by ClusterSummaryProducer::produce().

116 {nClus .at(mod)+=val;}
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > nClus
void ClusterSummary::copyNonEmpty ( const ClusterSummary src)

Definition at line 52 of file ClusterSummary.cc.

References clusCharge, clusSize, getClusChargeVector(), getClusSizeVector(), getModules(), getNClusVector(), modules, and nClus.

52  {
53  modules .clear();
54  nClus .clear();
55  clusSize .clear();
56  clusCharge.clear();
57 
58  const std::vector<int> & src_modules = src.getModules();
59  const std::vector<int> & src_nClus = src.getNClusVector();
60  const std::vector<int> & src_clusSize = src.getClusSizeVector();
61  const std::vector<float>& src_clusCharge = src.getClusChargeVector();
62 
63  modules .reserve(src_modules.size());
64  nClus .reserve(src_modules.size());
65  clusSize .reserve(src_modules.size());
66  clusCharge.reserve(src_modules.size());
67 
68  for(unsigned int iM = 0; iM < src_nClus.size(); ++iM){
69  if(src.nClus[iM] != 0){
70  modules .push_back(src_modules [iM]);
71  nClus .push_back(src_nClus [iM]);
72  clusSize .push_back(src_clusSize [iM]);
73  clusCharge.push_back(src_clusCharge[iM]);
74  }
75  }
76 }
const std::vector< int > & getClusSizeVector() const
const std::vector< float > & getClusChargeVector() const
std::vector< float > clusCharge
std::vector< int > modules
const std::vector< int > & getNClusVector() const
const std::vector< int > & getModules() const
std::vector< int > clusSize
std::vector< int > nClus
float ClusterSummary::getClusCharge ( const CMSTracker  mod) const
inline

Definition at line 110 of file ClusterSummary.h.

References clusCharge, and getModuleLocation().

110 {int pos = getModuleLocation(mod); return pos < 0 ? 0. : clusCharge[pos];}
std::vector< float > clusCharge
int getModuleLocation(int mod, bool warn=true) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
float ClusterSummary::getClusChargeByIndex ( const int  mod) const
inline

Definition at line 106 of file ClusterSummary.h.

References clusCharge.

Referenced by ClusterSummaryProducer::produce().

106 {return clusCharge.at(mod);}
std::vector< float > clusCharge
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
const std::vector<float>& ClusterSummary::getClusChargeVector ( ) const
inline

Definition at line 114 of file ClusterSummary.h.

References clusCharge.

Referenced by copyNonEmpty().

114 {return clusCharge;}
std::vector< float > clusCharge
int ClusterSummary::getClusSize ( const CMSTracker  mod) const
inline

Definition at line 109 of file ClusterSummary.h.

References clusSize, and getModuleLocation().

109 {int pos = getModuleLocation(mod); return pos < 0 ? 0. : clusSize [pos];}
int getModuleLocation(int mod, bool warn=true) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > clusSize
int ClusterSummary::getClusSizeByIndex ( const int  mod) const
inline

Definition at line 105 of file ClusterSummary.h.

References clusSize.

Referenced by ClusterSummaryProducer::produce().

105 {return clusSize .at(mod);}
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > clusSize
const std::vector<int>& ClusterSummary::getClusSizeVector ( ) const
inline

Definition at line 113 of file ClusterSummary.h.

References clusSize.

Referenced by copyNonEmpty().

113 {return clusSize;}
std::vector< int > clusSize
int ClusterSummary::getModule ( const int  index) const
inline

Definition at line 128 of file ClusterSummary.h.

References cmsHarvester::index, and modules.

128 { return modules[index];}
std::vector< int > modules
int ClusterSummary::getModuleLocation ( int  mod,
bool  warn = true 
) const

Definition at line 42 of file ClusterSummary.cc.

References visualization-live-secondInstance_cfg::m, and modules.

Referenced by addClusCharge(), addClusSize(), addNClus(), getClusCharge(), getClusSize(), and getNClus().

42  {
43  int iM = -1;
44  for (auto m : modules){++iM; if (m==mod) return iM;}
45 
46  if(warn)
47  edm::LogWarning("NoModule") << "No information for requested module "<<mod<<". Please check in the Provinence Infomation for proper modules.";
48 
49  return -1;
50 }
std::vector< int > modules
def warn
Definition: __init__.py:20
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
const std::vector<int>& ClusterSummary::getModules ( ) const
inline

Definition at line 124 of file ClusterSummary.h.

References modules.

Referenced by copyNonEmpty().

124 { return modules; }
std::vector< int > modules
int ClusterSummary::getNClus ( const CMSTracker  mod) const
inline

Definition at line 108 of file ClusterSummary.h.

References getModuleLocation(), and nClus.

108 {int pos = getModuleLocation(mod); return pos < 0 ? 0. : nClus [pos];}
int getModuleLocation(int mod, bool warn=true) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > nClus
int ClusterSummary::getNClusByIndex ( const int  mod) const
inline

Definition at line 104 of file ClusterSummary.h.

References nClus.

Referenced by ClusterSummaryProducer::produce().

104 {return nClus .at(mod);}
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > nClus
const std::vector<int>& ClusterSummary::getNClusVector ( ) const
inline

Definition at line 112 of file ClusterSummary.h.

References nClus.

Referenced by copyNonEmpty().

112 {return nClus;}
std::vector< int > nClus
unsigned int ClusterSummary::getNumberOfModules ( ) const
inline

Definition at line 127 of file ClusterSummary.h.

References modules.

127 {return modules.size();}
std::vector< int > modules
ClusterSummary & ClusterSummary::operator= ( const ClusterSummary rhs)

Definition at line 20 of file ClusterSummary.cc.

References clusCharge, clusSize, modules, and nClus.

21 {
22  modules = rhs.modules ;
23  nClus = rhs.nClus ;
24  clusSize = rhs.clusSize ;
25  clusCharge = rhs.clusCharge ;
26  return *this;
27 }
std::vector< float > clusCharge
std::vector< int > modules
std::vector< int > clusSize
std::vector< int > nClus
void ClusterSummary::reset ( void  )

Definition at line 78 of file ClusterSummary.cc.

References clusCharge, clusSize, modules, and nClus.

Referenced by ClusterSummaryProducer::produce().

78  {
79  for(unsigned int iM = 0; iM < modules.size(); ++iM){
80  nClus [iM] = 0;
81  clusSize [iM] = 0;
82  clusCharge[iM] = 0;
83  }
84 }
std::vector< float > clusCharge
std::vector< int > modules
std::vector< int > clusSize
std::vector< int > nClus

Member Data Documentation

std::vector<float> ClusterSummary::clusCharge
private
std::vector<int> ClusterSummary::clusSize
private
std::vector<int> ClusterSummary::modules
private
std::vector<int> ClusterSummary::nClus
private
const std::vector< std::string > ClusterSummary::subDetNames {"STRIP","TOB","TIB","TID","TEC","PIXEL","BPIX","FPIX"}
static

Definition at line 86 of file ClusterSummary.h.

Referenced by ClusterSummaryProducer::ClusterSummaryProducer().

const std::vector< std::vector< std::string > > ClusterSummary::subDetSelections
static
Initial value:
{
{"0x1e000000-0x1A000000","0x1e000000-0x16000000","0x1e000000-0x18000000","0x1e000000-0x1C000000"},
{"0x1e000000-0x1A000000"},{"0x1e000000-0x16000000"},{"0x1e000000-0x18000000"},{"0x1e000000-0x1C000000"},
{"0x1e000000-0x12000000","0x1e000000-0x14000000"},
{"0x1e000000-0x12000000"},{"0x1e000000-0x14000000"}
}

Definition at line 87 of file ClusterSummary.h.

Referenced by ClusterSummaryProducer::ClusterSummaryProducer().

const std::vector< std::string > ClusterSummary::variableNames {"NCLUSTERS","CLUSTERSIZE","CLUSTERCHARGE"}
static

Definition at line 91 of file ClusterSummary.h.