CMS 3D CMS Logo

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

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

Classes

class  ModuleSelection
 

Public Types

enum  CMSTracker {
  TRACKER = 0, TIB = 1, TIB_1 = 11, TIB_2 = 12,
  TIB_3 = 13, TIB_4 = 14, TOB = 2, TOB_1 = 21,
  TOB_2 = 22, TOB_3 = 23, TOB_4 = 24, TOB_5 = 25,
  TOB_6 = 26, TID = 3, TIDM = 31, TIDP = 32,
  TIDM_1 = 311, TIDM_2 = 312, TIDM_3 = 313, TIDP_1 = 321,
  TIDP_2 = 322, TIDP_3 = 323, TIDMR_1 = 3110, TIDMR_2 = 3120,
  TIDMR_3 = 3130, TIDPR_1 = 3210, TIDPR_2 = 3220, TIDPR_3 = 3230,
  TEC = 4, TECM = 41, TECP = 42, TECM_1 = 411,
  TECM_2 = 412, TECM_3 = 413, TECM_4 = 414, TECM_5 = 415,
  TECM_6 = 416, TECM_7 = 417, TECM_8 = 418, TECM_9 = 419,
  TECP_1 = 421, TECP_2 = 422, TECP_3 = 423, TECP_4 = 424,
  TECP_5 = 425, TECP_6 = 426, TECP_7 = 427, TECP_8 = 428,
  TECP_9 = 429, TECMR_1 = 4110, TECMR_2 = 4120, TECMR_3 = 4130,
  TECMR_4 = 4140, TECMR_5 = 4150, TECMR_6 = 4160, TECMR_7 = 4170,
  TECPR_1 = 4210, TECPR_2 = 4220, TECPR_3 = 4230, TECPR_4 = 4240,
  TECPR_5 = 4250, TECPR_6 = 4260, TECPR_7 = 4270, PIXEL = 5,
  FPIX = 6, FPIX_1 = 61, FPIX_2 = 62, FPIX_3 = 63,
  FPIXM = 611, FPIXP = 612, FPIXM_1 = 6110, FPIXM_2 = 6120,
  FPIXM_3 = 6130, FPIXP_1 = 6210, FPIXP_2 = 6220, FPIXP_3 = 6230,
  BPIX = 7, BPIX_1 = 71, BPIX_2 = 72, BPIX_3 = 73
}
 
enum  VariablePlacement {
  NMODULES = 0, CLUSTERSIZE = 1, CLUSTERCHARGE = 2, NMODULESPIXELS = 3,
  CLUSTERSIZEPIXELS = 4, CLUSTERCHARGEPIXELS = 5
}
 

Public Member Functions

void ClearGenericVariable ()
 
void ClearUserIterator ()
 
void ClearUserModules ()
 
 ClusterSummary ()
 
std::vector< std::string > DecodeProvInfo (std::string ProvInfo) const
 
double GetGenericVariable (int variableLocation, int module) const
 
double GetGenericVariable (std::string variableName, int module) const
 
std::vector< double > GetGenericVariable (std::string variableName) const
 
std::vector< double > GetGenericVariable (int variableLocation) const
 
std::vector< std::vector
< double > > 
GetGenericVariable () const
 
int GetModuleLocation (int mod) const
 
std::vector< std::string > GetUserContent ()
 
void GetUserContentInfo () const
 
int GetUserContentSize ()
 
std::vector< int > GetUserIterator () const
 
std::vector< int > GetUserModules () const
 
int GetVariableLocation (std::string var) const
 
void PrepairGenericVariable ()
 
void SetGenericVariable (int variableLocation, int module, double value)
 
void SetGenericVariable (std::string variableName, int module, double value)
 
void SetUserContent (const std::vector< std::string > &Content) const
 
void SetUserIterator ()
 
void SetUserModules (int value)
 

Private Attributes

std::vector< std::vector
< double > > 
genericVariables_
 
std::vector< std::vector
< double > > 
genericVariablesTmp_
 
std::vector< int > iterator_
 
std::vector< int > modules_
 
std::vector< std::string > userContent
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 121 of file ClusterSummary.h.

Member Enumeration Documentation

Enumerator
TRACKER 
TIB 
TIB_1 
TIB_2 
TIB_3 
TIB_4 
TOB 
TOB_1 
TOB_2 
TOB_3 
TOB_4 
TOB_5 
TOB_6 
TID 
TIDM 
TIDP 
TIDM_1 
TIDM_2 
TIDM_3 
TIDP_1 
TIDP_2 
TIDP_3 
TIDMR_1 
TIDMR_2 
TIDMR_3 
TIDPR_1 
TIDPR_2 
TIDPR_3 
TEC 
TECM 
TECP 
TECM_1 
TECM_2 
TECM_3 
TECM_4 
TECM_5 
TECM_6 
TECM_7 
TECM_8 
TECM_9 
TECP_1 
TECP_2 
TECP_3 
TECP_4 
TECP_5 
TECP_6 
TECP_7 
TECP_8 
TECP_9 
TECMR_1 
TECMR_2 
TECMR_3 
TECMR_4 
TECMR_5 
TECMR_6 
TECMR_7 
TECPR_1 
TECPR_2 
TECPR_3 
TECPR_4 
TECPR_5 
TECPR_6 
TECPR_7 
PIXEL 
FPIX 
FPIX_1 
FPIX_2 
FPIX_3 
FPIXM 
FPIXP 
FPIXM_1 
FPIXM_2 
FPIXM_3 
FPIXP_1 
FPIXP_2 
FPIXP_3 
BPIX 
BPIX_1 
BPIX_2 
BPIX_3 

Definition at line 128 of file ClusterSummary.h.

128  { TRACKER = 0,
129  TIB = 1,
130  TIB_1 = 11, TIB_2 = 12, TIB_3 = 13, TIB_4 = 14, //TIB layer 1-4
131  TOB = 2,
132  TOB_1 = 21, TOB_2 = 22, TOB_3 = 23, TOB_4 = 24, TOB_5 = 25, TOB_6 = 26, //TOB layer 1-6
133  TID = 3,
134  TIDM = 31, TIDP = 32, //TID minus and plus
135  TIDM_1 = 311, TIDM_2 = 312, TIDM_3 = 313, //TID minus layer 1-3
136  TIDP_1 = 321, TIDP_2 = 322, TIDP_3 = 323, //TID plus layer 1-3
137  TIDMR_1 = 3110, TIDMR_2 = 3120, TIDMR_3 = 3130, //TID minus ring 1-3
138  TIDPR_1 = 3210, TIDPR_2 = 3220, TIDPR_3 = 3230, //TID plus ring 1-3
139  TEC = 4,
140  TECM = 41, TECP = 42, //TEC minus and plus
141  TECM_1 = 411, TECM_2 = 412, TECM_3 = 413, TECM_4 = 414, TECM_5 = 415, TECM_6 = 416, TECM_7 = 417, TECM_8 = 418, TECM_9 = 419, //TEC minus layer 1-9
142  TECP_1 = 421, TECP_2 = 422, TECP_3 = 423, TECP_4 = 424, TECP_5 = 425, TECP_6 = 426, TECP_7 = 427, TECP_8 = 428, TECP_9 = 429, //TEC plus layer 1-9
143  TECMR_1 = 4110, TECMR_2 = 4120, TECMR_3 = 4130, TECMR_4 = 4140, TECMR_5 = 4150, TECMR_6 = 4160, TECMR_7 = 4170, //TEC minus ring 1-9
144  TECPR_1 = 4210, TECPR_2 = 4220, TECPR_3 = 4230, TECPR_4 = 4240, TECPR_5 = 4250, TECPR_6 = 4260, TECPR_7 = 4270, //TEC plus ring 1-9
145  //PIXELS
146  PIXEL = 5,
147  FPIX = 6, // Pixel endcaps
148  FPIX_1 = 61,FPIX_2 = 62,FPIX_3 = 63, // Endcaps disks 1-3
149  FPIXM = 611, FPIXP = 612, // Pixel endcaps minus and plus side
150  FPIXM_1 = 6110, FPIXM_2 = 6120, FPIXM_3 = 6130, // Endcap minus disk 1-3
151  FPIXP_1 = 6210, FPIXP_2 = 6220, FPIXP_3 = 6230, // Endcap plus disk 1-3
152  BPIX = 7, //Pixel barrel
153  BPIX_1 = 71, BPIX_2 = 72, BPIX_3 = 73 //Pixel barrel layer 1-3
154 
155  };
Enumerator
NMODULES 
CLUSTERSIZE 
CLUSTERCHARGE 
NMODULESPIXELS 
CLUSTERSIZEPIXELS 
CLUSTERCHARGEPIXELS 

Definition at line 158 of file ClusterSummary.h.

Constructor & Destructor Documentation

ClusterSummary::ClusterSummary ( )
inline

Definition at line 125 of file ClusterSummary.h.

125 :genericVariablesTmp_(6, std::vector<double>(100,0) ){}
std::vector< std::vector< double > > genericVariablesTmp_

Member Function Documentation

void ClusterSummary::ClearGenericVariable ( )
inline

Definition at line 234 of file ClusterSummary.h.

References genericVariablesTmp_, i, and j.

Referenced by ClusterSummaryProducer::produce().

234  {
235 
236  //genericVariablesTmp_.clear();
237 
238  for (unsigned int i = 0; i < genericVariablesTmp_.size(); ++i){
239  for (unsigned int j = 0; j < genericVariablesTmp_[i].size(); ++j){
240  genericVariablesTmp_[i][j] = 0;
241  }
242  }
243  }
int i
Definition: DBlmapReader.cc:9
std::vector< std::vector< double > > genericVariablesTmp_
int j
Definition: DBlmapReader.cc:9
void ClusterSummary::ClearUserIterator ( )
inline

Definition at line 270 of file ClusterSummary.h.

References iterator_.

270 { iterator_.clear(); }
std::vector< int > iterator_
void ClusterSummary::ClearUserModules ( )
inline

Definition at line 262 of file ClusterSummary.h.

References modules_.

Referenced by ClusterSummaryProducer::produce().

262 { modules_.clear(); }
std::vector< int > modules_
std::vector< std::string > ClusterSummary::DecodeProvInfo ( std::string  ProvInfo) const

Definition at line 101 of file ClusterSummary.cc.

References i, j, mod(), and AlCaHLTBitMon_QueryRunRegistry::string.

101  {
102 
103  std::vector<std::string> v_moduleTypes;
104 
105  std::string mod = ProvInfo;
107  std::string::size_type j = mod.find(',');
108 
109  if ( j == std::string::npos ){
110  v_moduleTypes.push_back(mod);
111  }
112  else{
113 
114  while (j != std::string::npos) {
115  v_moduleTypes.push_back(mod.substr(i, j-i));
116  i = ++j;
117  j = mod.find(',', j);
118  if (j == std::string::npos)
119  v_moduleTypes.push_back(mod.substr(i, mod.length( )));
120  }
121 
122  }
123 
124  return v_moduleTypes;
125 
126 }
int i
Definition: DBlmapReader.cc:9
uint16_t size_type
int j
Definition: DBlmapReader.cc:9
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
double ClusterSummary::GetGenericVariable ( int  variableLocation,
int  module 
) const
inline

Definition at line 175 of file ClusterSummary.h.

References genericVariables_, and GetModuleLocation().

Referenced by ClusterSummaryProducer::produce().

175  {
176  return GetModuleLocation(module) < 0 ? 0. : genericVariables_[variableLocation][GetModuleLocation(module)]; }
std::vector< std::vector< double > > genericVariables_
int GetModuleLocation(int mod) const
Definition: vlib.h:208
double ClusterSummary::GetGenericVariable ( std::string  variableName,
int  module 
) const
inline

Definition at line 179 of file ClusterSummary.h.

References genericVariables_, GetModuleLocation(), GetVariableLocation(), and position.

179  {
180 
181  int position = GetVariableLocation(variableName);
182  int mposition = GetModuleLocation(module);
183 
184  return mposition < 0 ? 0. : genericVariables_[position][mposition];
185  }
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
std::vector< std::vector< double > > genericVariables_
int GetVariableLocation(std::string var) const
int GetModuleLocation(int mod) const
Definition: vlib.h:208
std::vector<double> ClusterSummary::GetGenericVariable ( std::string  variableName) const
inline

Definition at line 188 of file ClusterSummary.h.

References genericVariables_, and GetVariableLocation().

188  {
189  return genericVariables_[GetVariableLocation(variableName)];
190  }
std::vector< std::vector< double > > genericVariables_
int GetVariableLocation(std::string var) const
std::vector<double> ClusterSummary::GetGenericVariable ( int  variableLocation) const
inline

Definition at line 193 of file ClusterSummary.h.

References genericVariables_.

193  {
194  return genericVariables_[variableLocation];
195  }
std::vector< std::vector< double > > genericVariables_
std::vector< std::vector<double> > ClusterSummary::GetGenericVariable ( ) const
inline

Definition at line 198 of file ClusterSummary.h.

References genericVariables_.

198 { return genericVariables_; }
std::vector< std::vector< double > > genericVariables_
int ClusterSummary::GetModuleLocation ( int  mod) const

Definition at line 4 of file ClusterSummary.cc.

References modules_.

Referenced by GetGenericVariable(), and SetGenericVariable().

4  {
5 
6  int placeInModsVector = -1;
7 
8  int cnt = 0;
9  int pixelcnt = 0;
10  for(std::vector<int>::const_iterator it = modules_.begin(); it != modules_.end(); ++it) {
11  /*
12  if ( mod == (*it) ) {
13  placeInModsVector = cnt;
14  break;
15  }
16  else ++cnt;
17  */
18 
19  int mod_tmp = *it;
20  while (mod_tmp > 9 ){
21  mod_tmp /= 10;
22  }
23 
24  if ( mod_tmp < 5 ){
25 
26  if ( mod == (*it) ) {
27  placeInModsVector = cnt;
28  break;
29  }
30  else ++cnt;
31  }
32  else{
33  if ( mod == (*it) ) {
34  placeInModsVector = pixelcnt;
35  break;
36  }
37  else ++pixelcnt;
38  }
39  }
40 
41  if (placeInModsVector == -1){
42 
43  edm::LogWarning("NoModule") << "No information for requested module "<<mod<<". Please check in the Provinence Infomation for proper modules.";
44 
45  return -1;
46 
47  }
48 
49  return placeInModsVector;
50 
51 }
std::vector< int > modules_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector<std::string> ClusterSummary::GetUserContent ( )
inline

Definition at line 249 of file ClusterSummary.h.

References userContent.

249 { return userContent;}
std::vector< std::string > userContent
void ClusterSummary::GetUserContentInfo ( ) const
inline

Definition at line 251 of file ClusterSummary.h.

References gather_cfg::cout, i, and userContent.

251  {
252  std::cout << "Saving info for " ;
253  for (unsigned int i = 0; i < userContent.size(); ++i){ std::cout << userContent.at(i) << " " ;}
254  std::cout << std::endl;
255  }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > userContent
tuple cout
Definition: gather_cfg.py:121
int ClusterSummary::GetUserContentSize ( )
inline

Definition at line 250 of file ClusterSummary.h.

References userContent.

Referenced by SetUserIterator().

250 { return userContent.size(); }
std::vector< std::string > userContent
std::vector<int> ClusterSummary::GetUserIterator ( ) const
inline

Definition at line 269 of file ClusterSummary.h.

References iterator_.

269 { return iterator_; }
std::vector< int > iterator_
std::vector<int> ClusterSummary::GetUserModules ( ) const
inline

Definition at line 261 of file ClusterSummary.h.

References modules_.

Referenced by ClusterSummaryProducer::produce().

261 { return modules_; }
std::vector< int > modules_
int ClusterSummary::GetVariableLocation ( std::string  var) const

Definition at line 55 of file ClusterSummary.cc.

References edm::hlt::Exception, and userContent.

Referenced by GetGenericVariable(), and SetGenericVariable().

55  {
56 
57  int placeInUserVector = -1;
58 
59 
60  int cnt = 0;
61  for(std::vector<std::string>::const_iterator it = userContent.begin(); it != userContent.end(); ++it) {
62 
63  if ( var == (*it) ) {
64  placeInUserVector = cnt;
65  break;
66  }
67  else ++cnt;
68 
69  }
70 
71 
72  /*
73  if ( var == "cHits" )
74  placeInUserVector = NMODULES;
75  else if (var == "cSize" )
76  placeInUserVector = CLUSTERSIZE;
77  else if (var == "cCharge" )
78  placeInUserVector = CLUSTERCHARGE;
79  else if (var == "pHits" )
80  placeInUserVector = NMODULESPIXELS;
81  else if (var == "pSize" )
82  placeInUserVector = CLUSTERSIZEPIXELS;
83  else if (var == "pCharge" )
84  placeInUserVector = CLUSTERCHARGEPIXELS;
85  else
86  placeInUserVector = -1;
87  */
88  if (placeInUserVector == -1){
89  std::ostringstream err;
90  err<<"No information for requested var "<<var<<". Please check if you have chosen a proper variable.";
91 
92  throw cms::Exception( "Missing Variable", err.str());
93  }
94 
95  return placeInUserVector;
96 
97 }
std::vector< std::string > userContent
void ClusterSummary::PrepairGenericVariable ( )
inline

Definition at line 224 of file ClusterSummary.h.

References begin, end, genericVariables_, genericVariablesTmp_, i, python.multivaluedict::remove(), and userContent.

Referenced by ClusterSummaryProducer::produce().

224  {
225 
227 
228  for (unsigned int i = 0; i < userContent.size(); ++i){
230  }
231  }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > userContent
std::vector< std::vector< double > > genericVariablesTmp_
std::vector< std::vector< double > > genericVariables_
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
void ClusterSummary::SetGenericVariable ( int  variableLocation,
int  module,
double  value 
)
inline

Definition at line 201 of file ClusterSummary.h.

References genericVariablesTmp_, GetModuleLocation(), and relativeConstraints::value.

Referenced by ClusterSummaryProducer::produce().

201  {
202  if(GetModuleLocation(module) >=0) genericVariablesTmp_[variableLocation][GetModuleLocation(module)] += value; }
std::vector< std::vector< double > > genericVariablesTmp_
int GetModuleLocation(int mod) const
Definition: vlib.h:208
void ClusterSummary::SetGenericVariable ( std::string  variableName,
int  module,
double  value 
)
inline

Definition at line 205 of file ClusterSummary.h.

References genericVariablesTmp_, GetModuleLocation(), GetVariableLocation(), position, and relativeConstraints::value.

205  {
206 
207  /*
208  genericVariablesTmp[ variable ][ module ]
209 
210  This will fill the values in the order as they are filled in the produced.
211 
212  1) Find where the variableName lives in userContent
213  2) Find where module lives in modules_
214 
215  */
216 
217  int position = GetVariableLocation(variableName);
218  int mposition = GetModuleLocation(module);
219 
220  if(mposition >=0) genericVariablesTmp_[position][mposition] += value;
221  }
std::vector< std::vector< double > > genericVariablesTmp_
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
int GetVariableLocation(std::string var) const
int GetModuleLocation(int mod) const
Definition: vlib.h:208
void ClusterSummary::SetUserContent ( const std::vector< std::string > &  Content) const
inline

Definition at line 248 of file ClusterSummary.h.

References userContent.

Referenced by ClusterSummaryProducer::beginJob().

248 { userContent = Content;}
std::vector< std::string > userContent
void ClusterSummary::SetUserIterator ( )
inline

Definition at line 268 of file ClusterSummary.h.

References GetUserContentSize(), and iterator_.

Referenced by ClusterSummaryProducer::beginJob().

268 { iterator_.push_back( GetUserContentSize() );}
int GetUserContentSize()
std::vector< int > iterator_
void ClusterSummary::SetUserModules ( int  value)
inline

Definition at line 260 of file ClusterSummary.h.

References modules_.

Referenced by ClusterSummaryProducer::produce().

260 { modules_.push_back( value ); }
std::vector< int > modules_

Member Data Documentation

std::vector< std::vector<double> > ClusterSummary::genericVariables_
private

Definition at line 298 of file ClusterSummary.h.

Referenced by GetGenericVariable(), and PrepairGenericVariable().

std::vector< std::vector<double> > ClusterSummary::genericVariablesTmp_
mutableprivate
std::vector<int> ClusterSummary::iterator_
private

Definition at line 295 of file ClusterSummary.h.

Referenced by ClearUserIterator(), GetUserIterator(), and SetUserIterator().

std::vector<int> ClusterSummary::modules_
private
std::vector<std::string> ClusterSummary::userContent
mutableprivate