CMS 3D CMS Logo

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

#include <DQMStoreStats.h>

Public Member Functions

void add (Folder *f)
 
Foldercd (const std::string &name)
 
void children (std::string &sql_statement)
 
VIterator< Folder * > CreateIterator ()
 
void dump (std::string indent)
 
void files (std::string &sql_statement)
 
 Folder (std::string name)
 
unsigned int getBins ()
 
unsigned int getEmptyBins ()
 
FoldergetFather ()
 
unsigned int getHistos ()
 
unsigned int getMemory ()
 
unsigned int id ()
 
unsigned int level ()
 
void mainrows (std::string &sql_statement)
 
void mainrows_cumulative (std::string &sql_statement)
 
const std::string & name ()
 
void parents (std::string &sql_statement)
 
void setFather (Folder *e)
 
void setId (unsigned int id)
 
void setLevel (unsigned int value)
 
void summary (std::string &sql_statement)
 
void symbols (std::string &sql_statement)
 
void update (unsigned int bins, unsigned int empty, unsigned int memory)
 
 ~Folder ()
 

Private Attributes

Folderfather_
 
std::string folderName_
 
unsigned int id_
 
unsigned int level_
 
std::vector< Folder * > subfolders_
 
unsigned int totalBins_
 
unsigned int totalEmptyBins_
 
unsigned int totalHistos_
 
unsigned int totalMemory_
 

Detailed Description

Definition at line 134 of file DQMStoreStats.h.

Constructor & Destructor Documentation

Folder::Folder ( std::string  name)
inline

Definition at line 136 of file DQMStoreStats.h.

Referenced by cd().

137  : totalHistos_(0),
138  totalBins_(0),
139  totalEmptyBins_(0),
140  totalMemory_(0),
141  id_(10),
142  level_(0),
144  father_(nullptr) {}
unsigned int totalBins_
unsigned int totalMemory_
const std::string & name()
unsigned int totalEmptyBins_
def move
Definition: eostools.py:511
Folder * father_
unsigned int totalHistos_
unsigned int level_
unsigned int id_
std::string folderName_
Folder::~Folder ( )
inline

Definition at line 146 of file DQMStoreStats.h.

References subfolders_.

146  {
147  for (auto& subfolder : subfolders_)
148  delete subfolder;
149  }
std::vector< Folder * > subfolders_

Member Function Documentation

void Folder::add ( Folder f)
inline

Definition at line 169 of file DQMStoreStats.h.

References getId(), level_, setFather(), setId(), setLevel(), and subfolders_.

Referenced by cd(), counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

169  {
170  f->setFather(this);
171  subfolders_.push_back(f);
172  f->setLevel(level_ + 1);
173  f->setId(getId());
174  }
static unsigned int getId()
std::vector< Folder * > subfolders_
void setLevel(unsigned int value)
void setFather(Folder *e)
unsigned int level_
void setId(unsigned int id)
Folder* Folder::cd ( const std::string &  name)
inline

Definition at line 155 of file DQMStoreStats.h.

References add(), Folder(), name(), subfolders_, and createJobs::tmp.

Referenced by DQMStoreStats::calcstats(), dqm_interfaces.DQMcommunicator::get_root_objects_list_recursive(), dqm_interfaces.DQMcommunicator::get_root_objects_names_list_recursive(), dqm_interfaces.DQMcommunicator::get_root_objects_recursive(), and dqm_interfaces.DirWalkerFile::walk().

155  {
156  for (auto& subfolder : subfolders_)
157  if (subfolder->name() == name)
158  return subfolder;
159  auto* tmp = new Folder(name);
160  this->add(tmp);
161  return tmp;
162  }
void add(Folder *f)
Folder(std::string name)
std::vector< Folder * > subfolders_
const std::string & name()
tmp
align.sh
Definition: createJobs.py:716
void Folder::children ( std::string &  sql_statement)
inline

Definition at line 249 of file DQMStoreStats.h.

References getBins(), getEmptyBins(), getFather(), getMemory(), id(), id_, alignCSCRings::s, subfolders_, and totalHistos_.

Referenced by DQMStoreStats::calcIgProfDump().

249  {
250  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
251  std::stringstream s("");
252  s << "INSERT INTO children(self_id, parent_id, from_parent_count, from_parent_calls, from_parent_paths, pct) "
253  "VALUES("
254  << id_ << "," << parentid << "," << getMemory() << "," << getBins() - getEmptyBins() << "," << totalHistos_
255  << ",0"
256  << ");\n";
257  sql_statement.append(s.str());
258  for (auto& subfolder : subfolders_)
259  subfolder->children(sql_statement);
260  }
unsigned int getEmptyBins()
std::vector< Folder * > subfolders_
unsigned int getBins()
Folder * getFather()
unsigned int id()
unsigned int totalHistos_
unsigned int getMemory()
unsigned int id_
VIterator<Folder*> Folder::CreateIterator ( )
inline

Definition at line 214 of file DQMStoreStats.h.

References subfolders_.

Referenced by DQMStoreStats::calcIgProfDump().

214 { return VIterator<Folder*>(&subfolders_); }
std::vector< Folder * > subfolders_
void Folder::dump ( std::string  indent)
inline

Definition at line 206 of file DQMStoreStats.h.

References gather_cfg::cout, getBins(), getEmptyBins(), getFather(), getHistos(), getMemory(), id_, name(), and subfolders_.

206  {
207  indent.append(" ");
208  std::cout << indent << "I'm a " << name() << " whose father is " << getFather() << " with ID: " << id_
209  << " Histo: " << getHistos() << " Bins: " << getBins() << " EmptyBins: " << getEmptyBins()
210  << " Memory: " << getMemory() << " and my children are: " << std::endl;
211  for (auto& subfolder : subfolders_)
212  subfolder->dump(indent);
213  }
unsigned int getHistos()
unsigned int getEmptyBins()
std::vector< Folder * > subfolders_
const std::string & name()
unsigned int getBins()
Folder * getFather()
tuple cout
Definition: gather_cfg.py:144
unsigned int getMemory()
unsigned int id_
void Folder::files ( std::string &  sql_statement)
inline

Definition at line 278 of file DQMStoreStats.h.

References folderName_, id_, and alignCSCRings::s.

Referenced by DQMStoreStats::calcIgProfDump().

278  {
279  std::stringstream s("");
280  s << "INSERT INTO files(id, name) VALUES(" << id_ << ",\"" << folderName_ << "\");\n";
281  sql_statement.append(s.str());
282  }
unsigned int id_
std::string folderName_
unsigned int Folder::getBins ( )
inline

Definition at line 182 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalBins_.

Referenced by children(), dump(), mainrows(), mainrows_cumulative(), and summary().

182  {
183  unsigned int result = totalBins_;
184  for (auto& subfolder : subfolders_)
185  result += subfolder->getBins();
186  return result;
187  }
unsigned int totalBins_
tuple result
Definition: mps_fire.py:311
std::vector< Folder * > subfolders_
unsigned int Folder::getEmptyBins ( )
inline

Definition at line 188 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalEmptyBins_.

Referenced by children(), dump(), mainrows(), and mainrows_cumulative().

188  {
189  unsigned int result = totalEmptyBins_;
190  for (auto& subfolder : subfolders_)
191  result += subfolder->getEmptyBins();
192  return result;
193  }
tuple result
Definition: mps_fire.py:311
std::vector< Folder * > subfolders_
unsigned int totalEmptyBins_
Folder* Folder::getFather ( )
inline

Definition at line 152 of file DQMStoreStats.h.

References father_.

Referenced by children(), dump(), parents(), and symbols().

152 { return father_; }
Folder * father_
unsigned int Folder::getHistos ( )
inline

Definition at line 176 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalHistos_.

Referenced by dump(), mainrows(), and mainrows_cumulative().

176  {
177  unsigned int result = totalHistos_;
178  for (auto& subfolder : subfolders_)
179  result += subfolder->getHistos();
180  return result;
181  }
tuple result
Definition: mps_fire.py:311
std::vector< Folder * > subfolders_
unsigned int totalHistos_
unsigned int Folder::getMemory ( )
inline

Definition at line 194 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalMemory_.

Referenced by children(), dump(), mainrows(), mainrows_cumulative(), and summary().

194  {
195  unsigned int result = totalMemory_;
196  for (auto& subfolder : subfolders_)
197  result += subfolder->getMemory();
198  return result;
199  }
unsigned int totalMemory_
tuple result
Definition: mps_fire.py:311
std::vector< Folder * > subfolders_
unsigned int Folder::id ( void  )
inline

Definition at line 165 of file DQMStoreStats.h.

References id_.

Referenced by children(), parents(), setId(), and symbols().

165 { return id_; }
unsigned int id_
unsigned int Folder::level ( )
inline

Definition at line 167 of file DQMStoreStats.h.

References level_.

167 { return level_; }
unsigned int level_
void Folder::mainrows ( std::string &  sql_statement)
inline

Definition at line 216 of file DQMStoreStats.h.

References getBins(), getEmptyBins(), getHistos(), getMemory(), id_, alignCSCRings::s, and subfolders_.

Referenced by DQMStoreStats::calcIgProfDump().

216  {
217  std::stringstream s("");
218  s << "INSERT INTO mainrows(id, symbol_id, self_count, cumulative_count, kids, self_calls, total_calls, self_paths, "
219  "total_paths, pct)"
220  " VALUES("
221  << id_ << ", " << id_ << ", " << getMemory() << ", " << getMemory() << ", " << subfolders_.size() << ", "
222  << getBins() - getEmptyBins() << ", " << getBins() << ", " << getHistos() << ", " << getHistos() << ", 0.0);\n";
223  sql_statement.append(s.str());
224  for (auto& subfolder : subfolders_)
225  subfolder->mainrows(sql_statement);
226  }
unsigned int getHistos()
unsigned int getEmptyBins()
std::vector< Folder * > subfolders_
unsigned int getBins()
unsigned int getMemory()
unsigned int id_
void Folder::mainrows_cumulative ( std::string &  sql_statement)
inline

Definition at line 262 of file DQMStoreStats.h.

References getBins(), getEmptyBins(), getHistos(), getMemory(), id_, and alignCSCRings::s.

Referenced by DQMStoreStats::calcIgProfDump().

262  {
263  std::stringstream s("");
264  s << "INSERT INTO mainrows(id, symbol_id, self_count, cumulative_count, kids, self_calls, total_calls, self_paths, "
265  "total_paths, pct)"
266  << " VALUES(" << id_ << "," << id_ << "," << 0 << "," << getMemory() << ", 0," << getBins() - getEmptyBins()
267  << "," << getBins() << ", 0, " << getHistos() << ", 0);\n";
268  sql_statement.append(s.str());
269  }
unsigned int getHistos()
unsigned int getEmptyBins()
unsigned int getBins()
unsigned int getMemory()
unsigned int id_
const std::string& Folder::name ( void  )
inline
void Folder::parents ( std::string &  sql_statement)
inline

Definition at line 238 of file DQMStoreStats.h.

References getFather(), id(), id_, alignCSCRings::s, subfolders_, totalBins_, totalHistos_, and totalMemory_.

Referenced by DQMStoreStats::calcIgProfDump().

238  {
239  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
240  std::stringstream s("");
241  s << "INSERT INTO parents(self_id, child_id, to_child_count, to_child_calls, to_child_paths, pct) VALUES("
242  << parentid << "," << id_ << "," << totalMemory_ << "," << totalBins_ << "," << totalHistos_ << ",0"
243  << ");\n";
244  sql_statement.append(s.str());
245  for (auto& subfolder : subfolders_)
246  subfolder->parents(sql_statement);
247  }
unsigned int totalBins_
unsigned int totalMemory_
std::vector< Folder * > subfolders_
Folder * getFather()
unsigned int id()
unsigned int totalHistos_
unsigned int id_
void Folder::setFather ( Folder e)
inline

Definition at line 151 of file DQMStoreStats.h.

References alignCSCRings::e, and father_.

Referenced by add().

151 { father_ = e; }
Folder * father_
void Folder::setId ( unsigned int  id)
inline

Definition at line 164 of file DQMStoreStats.h.

References id(), and id_.

Referenced by add().

164 { id_ = id; }
unsigned int id()
unsigned int id_
void Folder::setLevel ( unsigned int  value)
inline

Definition at line 166 of file DQMStoreStats.h.

References level_, and relativeConstraints::value.

Referenced by add().

166 { level_ = value; }
unsigned int level_
void Folder::summary ( std::string &  sql_statement)
inline

Definition at line 271 of file DQMStoreStats.h.

References getBins(), getMemory(), and alignCSCRings::s.

Referenced by DQMStoreStats::calcIgProfDump().

271  {
272  std::stringstream s("");
273  s << "INSERT INTO summary(counter, total_count, total_freq, tick_period) VALUES (\"BINS_LIVE\"," << getMemory()
274  << "," << getBins() << ", 1);\n";
275  sql_statement.append(s.str());
276  }
unsigned int getBins()
unsigned int getMemory()
void Folder::symbols ( std::string &  sql_statement)
inline

Definition at line 228 of file DQMStoreStats.h.

References folderName_, getFather(), id(), id_, alignCSCRings::s, and subfolders_.

Referenced by DQMStoreStats::calcIgProfDump().

228  {
229  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
230  std::stringstream s("");
231  s << "INSERT INTO symbols(id, name, filename_id) VALUES (" << id_ << ",\"" << folderName_ << "\", " << parentid
232  << ");\n";
233  sql_statement.append(s.str());
234  for (auto& subfolder : subfolders_)
235  subfolder->symbols(sql_statement);
236  }
std::vector< Folder * > subfolders_
Folder * getFather()
unsigned int id()
unsigned int id_
std::string folderName_
void Folder::update ( unsigned int  bins,
unsigned int  empty,
unsigned int  memory 
)
inline

Member Data Documentation

Folder* Folder::father_
private

Definition at line 292 of file DQMStoreStats.h.

Referenced by getFather(), and setFather().

std::string Folder::folderName_
private

Definition at line 291 of file DQMStoreStats.h.

Referenced by files(), name(), and symbols().

unsigned int Folder::id_
private
unsigned int Folder::level_
private

Definition at line 290 of file DQMStoreStats.h.

Referenced by add(), level(), and setLevel().

std::vector<Folder*> Folder::subfolders_
private
unsigned int Folder::totalBins_
private

Definition at line 286 of file DQMStoreStats.h.

Referenced by getBins(), parents(), and update().

unsigned int Folder::totalEmptyBins_
private

Definition at line 287 of file DQMStoreStats.h.

Referenced by getEmptyBins(), and update().

unsigned int Folder::totalHistos_
private

Definition at line 285 of file DQMStoreStats.h.

Referenced by children(), getHistos(), parents(), and update().

unsigned int Folder::totalMemory_
private

Definition at line 288 of file DQMStoreStats.h.

Referenced by getMemory(), parents(), and update().