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 140 of file DQMStoreStats.h.

Constructor & Destructor Documentation

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

Definition at line 142 of file DQMStoreStats.h.

Referenced by cd().

143  : totalHistos_(0),
144  totalBins_(0),
145  totalEmptyBins_(0),
146  totalMemory_(0),
147  id_(10),
148  level_(0),
150  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 152 of file DQMStoreStats.h.

References subfolders_.

152  {
153  for (auto& subfolder : subfolders_)
154  delete subfolder;
155  }
std::vector< Folder * > subfolders_

Member Function Documentation

void Folder::add ( Folder f)
inline

Definition at line 175 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().

175  {
176  f->setFather(this);
177  subfolders_.push_back(f);
178  f->setLevel(level_ + 1);
179  f->setId(getId());
180  }
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 161 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().

161  {
162  for (auto& subfolder : subfolders_)
163  if (subfolder->name() == name)
164  return subfolder;
165  auto* tmp = new Folder(name);
166  this->add(tmp);
167  return tmp;
168  }
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 255 of file DQMStoreStats.h.

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

Referenced by DQMStoreStats::calcIgProfDump().

255  {
256  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
257  std::stringstream s("");
258  s << "INSERT INTO children(self_id, parent_id, from_parent_count, from_parent_calls, from_parent_paths, pct) "
259  "VALUES("
260  << id_ << "," << parentid << "," << getMemory() << "," << getBins() - getEmptyBins() << "," << totalHistos_
261  << ",0"
262  << ");\n";
263  sql_statement.append(s.str());
264  for (auto& subfolder : subfolders_)
265  subfolder->children(sql_statement);
266  }
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 220 of file DQMStoreStats.h.

References subfolders_.

Referenced by DQMStoreStats::calcIgProfDump().

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

Definition at line 212 of file DQMStoreStats.h.

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

212  {
213  indent.append(" ");
214  std::cout << indent << "I'm a " << name() << " whose father is " << getFather() << " with ID: " << id_
215  << " Histo: " << getHistos() << " Bins: " << getBins() << " EmptyBins: " << getEmptyBins()
216  << " Memory: " << getMemory() << " and my children are: " << std::endl;
217  for (auto& subfolder : subfolders_)
218  subfolder->dump(indent);
219  }
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 284 of file DQMStoreStats.h.

References folderName_, id_, and alignCSCRings::s.

Referenced by DQMStoreStats::calcIgProfDump().

284  {
285  std::stringstream s("");
286  s << "INSERT INTO files(id, name) VALUES(" << id_ << ",\"" << folderName_ << "\");\n";
287  sql_statement.append(s.str());
288  }
unsigned int id_
std::string folderName_
unsigned int Folder::getBins ( )
inline

Definition at line 188 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalBins_.

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

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

Definition at line 194 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalEmptyBins_.

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

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

Definition at line 158 of file DQMStoreStats.h.

References father_.

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

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

Definition at line 182 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalHistos_.

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

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

Definition at line 200 of file DQMStoreStats.h.

References mps_fire::result, subfolders_, and totalMemory_.

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

200  {
201  unsigned int result = totalMemory_;
202  for (auto& subfolder : subfolders_)
203  result += subfolder->getMemory();
204  return result;
205  }
unsigned int totalMemory_
tuple result
Definition: mps_fire.py:311
std::vector< Folder * > subfolders_
unsigned int Folder::id ( void  )
inline

Definition at line 171 of file DQMStoreStats.h.

References id_.

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

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

Definition at line 173 of file DQMStoreStats.h.

References level_.

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

Definition at line 222 of file DQMStoreStats.h.

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

Referenced by DQMStoreStats::calcIgProfDump().

222  {
223  std::stringstream s("");
224  s << "INSERT INTO mainrows(id, symbol_id, self_count, cumulative_count, kids, self_calls, total_calls, self_paths, "
225  "total_paths, pct)"
226  " VALUES("
227  << id_ << ", " << id_ << ", " << getMemory() << ", " << getMemory() << ", " << subfolders_.size() << ", "
228  << getBins() - getEmptyBins() << ", " << getBins() << ", " << getHistos() << ", " << getHistos() << ", 0.0);\n";
229  sql_statement.append(s.str());
230  for (auto& subfolder : subfolders_)
231  subfolder->mainrows(sql_statement);
232  }
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 268 of file DQMStoreStats.h.

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

Referenced by DQMStoreStats::calcIgProfDump().

268  {
269  std::stringstream s("");
270  s << "INSERT INTO mainrows(id, symbol_id, self_count, cumulative_count, kids, self_calls, total_calls, self_paths, "
271  "total_paths, pct)"
272  << " VALUES(" << id_ << "," << id_ << "," << 0 << "," << getMemory() << ", 0," << getBins() - getEmptyBins()
273  << "," << getBins() << ", 0, " << getHistos() << ", 0);\n";
274  sql_statement.append(s.str());
275  }
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 244 of file DQMStoreStats.h.

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

Referenced by DQMStoreStats::calcIgProfDump().

244  {
245  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
246  std::stringstream s("");
247  s << "INSERT INTO parents(self_id, child_id, to_child_count, to_child_calls, to_child_paths, pct) VALUES("
248  << parentid << "," << id_ << "," << totalMemory_ << "," << totalBins_ << "," << totalHistos_ << ",0"
249  << ");\n";
250  sql_statement.append(s.str());
251  for (auto& subfolder : subfolders_)
252  subfolder->parents(sql_statement);
253  }
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 157 of file DQMStoreStats.h.

References alignCSCRings::e, and father_.

Referenced by add().

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

Definition at line 170 of file DQMStoreStats.h.

References id(), and id_.

Referenced by add().

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

Definition at line 172 of file DQMStoreStats.h.

References level_, and relativeConstraints::value.

Referenced by add().

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

Definition at line 277 of file DQMStoreStats.h.

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

Referenced by DQMStoreStats::calcIgProfDump().

277  {
278  std::stringstream s("");
279  s << "INSERT INTO summary(counter, total_count, total_freq, tick_period) VALUES (\"BINS_LIVE\"," << getMemory()
280  << "," << getBins() << ", 1);\n";
281  sql_statement.append(s.str());
282  }
unsigned int getBins()
unsigned int getMemory()
void Folder::symbols ( std::string &  sql_statement)
inline

Definition at line 234 of file DQMStoreStats.h.

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

Referenced by DQMStoreStats::calcIgProfDump().

234  {
235  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
236  std::stringstream s("");
237  s << "INSERT INTO symbols(id, name, filename_id) VALUES (" << id_ << ",\"" << folderName_ << "\", " << parentid
238  << ");\n";
239  sql_statement.append(s.str());
240  for (auto& subfolder : subfolders_)
241  subfolder->symbols(sql_statement);
242  }
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 298 of file DQMStoreStats.h.

Referenced by getFather(), and setFather().

std::string Folder::folderName_
private

Definition at line 297 of file DQMStoreStats.h.

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

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

Definition at line 296 of file DQMStoreStats.h.

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

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

Definition at line 292 of file DQMStoreStats.h.

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

unsigned int Folder::totalEmptyBins_
private

Definition at line 293 of file DQMStoreStats.h.

Referenced by getEmptyBins(), and update().

unsigned int Folder::totalHistos_
private

Definition at line 291 of file DQMStoreStats.h.

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

unsigned int Folder::totalMemory_
private

Definition at line 294 of file DQMStoreStats.h.

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