CMS 3D CMS Logo

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::Folder ( std::string  name)
inline

Definition at line 136 of file DQMStoreStats.h.

137  : totalHistos_(0),
138  totalBins_(0),
139  totalEmptyBins_(0),
140  totalMemory_(0),
141  id_(10),
142  level_(0),
144  father_(nullptr) {}

Referenced by cd().

◆ ~Folder()

Folder::~Folder ( )
inline

Definition at line 146 of file DQMStoreStats.h.

146  {
147  for (auto& subfolder : subfolders_)
148  delete subfolder;
149  }

References subfolders_.

Member Function Documentation

◆ add()

void Folder::add ( Folder f)
inline

Definition at line 169 of file DQMStoreStats.h.

169  {
170  f->setFather(this);
171  subfolders_.push_back(f);
172  f->setLevel(level_ + 1);
173  f->setId(getId());
174  }

References f, getId(), level_, and subfolders_.

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

◆ cd()

Folder* Folder::cd ( const std::string &  name)
inline

Definition at line 155 of file DQMStoreStats.h.

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  }

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().

◆ children()

void Folder::children ( std::string &  sql_statement)
inline

Definition at line 249 of file DQMStoreStats.h.

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  }

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

Referenced by DQMStoreStats::calcIgProfDump().

◆ CreateIterator()

VIterator<Folder*> Folder::CreateIterator ( )
inline

Definition at line 214 of file DQMStoreStats.h.

214 { return VIterator<Folder*>(&subfolders_); }

References subfolders_.

◆ dump()

void Folder::dump ( std::string  indent)
inline

Definition at line 206 of file DQMStoreStats.h.

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  }

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

◆ files()

void Folder::files ( std::string &  sql_statement)
inline

Definition at line 278 of file DQMStoreStats.h.

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

References folderName_, id_, and alignCSCRings::s.

◆ getBins()

unsigned int Folder::getBins ( )
inline

Definition at line 182 of file DQMStoreStats.h.

182  {
183  unsigned int result = totalBins_;
184  for (auto& subfolder : subfolders_)
185  result += subfolder->getBins();
186  return result;
187  }

References mps_fire::result, subfolders_, and totalBins_.

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

◆ getEmptyBins()

unsigned int Folder::getEmptyBins ( )
inline

Definition at line 188 of file DQMStoreStats.h.

188  {
189  unsigned int result = totalEmptyBins_;
190  for (auto& subfolder : subfolders_)
191  result += subfolder->getEmptyBins();
192  return result;
193  }

References mps_fire::result, subfolders_, and totalEmptyBins_.

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

◆ getFather()

Folder* Folder::getFather ( )
inline

Definition at line 152 of file DQMStoreStats.h.

152 { return father_; }

References father_.

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

◆ getHistos()

unsigned int Folder::getHistos ( )
inline

Definition at line 176 of file DQMStoreStats.h.

176  {
177  unsigned int result = totalHistos_;
178  for (auto& subfolder : subfolders_)
179  result += subfolder->getHistos();
180  return result;
181  }

References mps_fire::result, subfolders_, and totalHistos_.

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

◆ getMemory()

unsigned int Folder::getMemory ( )
inline

Definition at line 194 of file DQMStoreStats.h.

194  {
195  unsigned int result = totalMemory_;
196  for (auto& subfolder : subfolders_)
197  result += subfolder->getMemory();
198  return result;
199  }

References mps_fire::result, subfolders_, and totalMemory_.

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

◆ id()

unsigned int Folder::id ( void  )
inline

Definition at line 165 of file DQMStoreStats.h.

165 { return id_; }

References id_.

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

◆ level()

unsigned int Folder::level ( )
inline

Definition at line 167 of file DQMStoreStats.h.

167 { return level_; }

References level_.

◆ mainrows()

void Folder::mainrows ( std::string &  sql_statement)
inline

Definition at line 216 of file DQMStoreStats.h.

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  }

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

Referenced by DQMStoreStats::calcIgProfDump().

◆ mainrows_cumulative()

void Folder::mainrows_cumulative ( std::string &  sql_statement)
inline

Definition at line 262 of file DQMStoreStats.h.

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  }

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

◆ name()

const std::string& Folder::name ( void  )
inline

◆ parents()

void Folder::parents ( std::string &  sql_statement)
inline

Definition at line 238 of file DQMStoreStats.h.

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  }

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

Referenced by DQMStoreStats::calcIgProfDump().

◆ setFather()

void Folder::setFather ( Folder e)
inline

Definition at line 151 of file DQMStoreStats.h.

151 { father_ = e; }

References MillePedeFileConverter_cfg::e, and father_.

◆ setId()

void Folder::setId ( unsigned int  id)
inline

Definition at line 164 of file DQMStoreStats.h.

164 { id_ = id; }

References id(), and id_.

◆ setLevel()

void Folder::setLevel ( unsigned int  value)
inline

Definition at line 166 of file DQMStoreStats.h.

166 { level_ = value; }

References level_, and relativeConstraints::value.

◆ summary()

void Folder::summary ( std::string &  sql_statement)
inline

Definition at line 271 of file DQMStoreStats.h.

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  }

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

◆ symbols()

void Folder::symbols ( std::string &  sql_statement)
inline

Definition at line 228 of file DQMStoreStats.h.

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  }

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

◆ update()

void Folder::update ( unsigned int  bins,
unsigned int  empty,
unsigned int  memory 
)
inline

Member Data Documentation

◆ father_

Folder* Folder::father_
private

Definition at line 292 of file DQMStoreStats.h.

Referenced by getFather(), and setFather().

◆ folderName_

std::string Folder::folderName_
private

Definition at line 291 of file DQMStoreStats.h.

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

◆ id_

unsigned int Folder::id_
private

◆ level_

unsigned int Folder::level_
private

Definition at line 290 of file DQMStoreStats.h.

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

◆ subfolders_

std::vector<Folder*> Folder::subfolders_
private

◆ totalBins_

unsigned int Folder::totalBins_
private

Definition at line 286 of file DQMStoreStats.h.

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

◆ totalEmptyBins_

unsigned int Folder::totalEmptyBins_
private

Definition at line 287 of file DQMStoreStats.h.

Referenced by getEmptyBins(), and update().

◆ totalHistos_

unsigned int Folder::totalHistos_
private

Definition at line 285 of file DQMStoreStats.h.

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

◆ totalMemory_

unsigned int Folder::totalMemory_
private

Definition at line 288 of file DQMStoreStats.h.

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

Folder::totalEmptyBins_
unsigned int totalEmptyBins_
Definition: DQMStoreStats.h:287
Folder::level_
unsigned int level_
Definition: DQMStoreStats.h:290
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
Folder::id
unsigned int id()
Definition: DQMStoreStats.h:165
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Folder::totalHistos_
unsigned int totalHistos_
Definition: DQMStoreStats.h:285
Folder::getBins
unsigned int getBins()
Definition: DQMStoreStats.h:182
Folder::name
const std::string & name()
Definition: DQMStoreStats.h:153
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
VIterator
Definition: DQMStoreStats.h:107
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Folder::getMemory
unsigned int getMemory()
Definition: DQMStoreStats.h:194
Folder::Folder
Folder(std::string name)
Definition: DQMStoreStats.h:136
Folder::father_
Folder * father_
Definition: DQMStoreStats.h:292
Folder::totalBins_
unsigned int totalBins_
Definition: DQMStoreStats.h:286
Folder::getEmptyBins
unsigned int getEmptyBins()
Definition: DQMStoreStats.h:188
Folder::folderName_
std::string folderName_
Definition: DQMStoreStats.h:291
Folder::totalMemory_
unsigned int totalMemory_
Definition: DQMStoreStats.h:288
Folder::getHistos
unsigned int getHistos()
Definition: DQMStoreStats.h:176
eostools.move
def move(src, dest)
Definition: eostools.py:511
mps_setup.memory
memory
Definition: mps_setup.py:156
Folder::id_
unsigned int id_
Definition: DQMStoreStats.h:289
relativeConstraints.value
value
Definition: relativeConstraints.py:53
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
util.rrClient.indent
indent
Definition: rrClient.py:41
Folder::add
void add(Folder *f)
Definition: DQMStoreStats.h:169
mps_fire.result
result
Definition: mps_fire.py:311
Folder::subfolders_
std::vector< Folder * > subfolders_
Definition: DQMStoreStats.h:293
trigObjTnPSource_cfi.bins
bins
Definition: trigObjTnPSource_cfi.py:20
getId
static unsigned int getId()
Definition: DQMStoreStats.h:129
Folder::getFather
Folder * getFather()
Definition: DQMStoreStats.h:152
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37