CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Folder Class Reference

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 147 of file DQMStoreStats.cc.

Constructor & Destructor Documentation

◆ Folder()

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

Definition at line 149 of file DQMStoreStats.cc.

Referenced by cd().

150  : totalHistos_(0),
151  totalBins_(0),
152  totalEmptyBins_(0),
153  totalMemory_(0),
154  id_(10),
155  level_(0),
157  father_(nullptr) {}
unsigned int totalBins_
unsigned int totalMemory_
const std::string & name()
unsigned int totalEmptyBins_
Folder * father_
unsigned int totalHistos_
unsigned int level_
unsigned int id_
def move(src, dest)
Definition: eostools.py:511
std::string folderName_

◆ ~Folder()

Folder::~Folder ( )
inline

Definition at line 159 of file DQMStoreStats.cc.

References subfolders_.

159  {
160  for (auto& subfolder : subfolders_)
161  delete subfolder;
162  }
std::vector< Folder * > subfolders_

Member Function Documentation

◆ add()

void Folder::add ( Folder f)
inline

Definition at line 182 of file DQMStoreStats.cc.

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

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

182  {
183  f->setFather(this);
184  subfolders_.push_back(f);
185  f->setLevel(level_ + 1);
186  f->setId(getId());
187  }
std::vector< Folder * > subfolders_
double f[11][100]
unsigned int level_
static unsigned int getId()

◆ cd()

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

Definition at line 168 of file DQMStoreStats.cc.

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

168  {
169  for (auto& subfolder : subfolders_)
170  if (subfolder->name() == name)
171  return subfolder;
172  auto* tmp = new Folder(name);
173  this->add(tmp);
174  return tmp;
175  }
void add(Folder *f)
Folder(std::string name)
std::vector< Folder * > subfolders_
const std::string & name()
tmp
align.sh
Definition: createJobs.py:716

◆ children()

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

Definition at line 262 of file DQMStoreStats.cc.

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

Referenced by DQMStoreStats::calcIgProfDump().

262  {
263  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
264  std::stringstream s("");
265  s << "INSERT INTO children(self_id, parent_id, from_parent_count, from_parent_calls, from_parent_paths, pct) "
266  "VALUES("
267  << id_ << "," << parentid << "," << getMemory() << "," << getBins() - getEmptyBins() << "," << totalHistos_
268  << ",0"
269  << ");\n";
270  sql_statement.append(s.str());
271  for (auto& subfolder : subfolders_)
272  subfolder->children(sql_statement);
273  }
unsigned int getEmptyBins()
std::vector< Folder * > subfolders_
unsigned int getBins()
Folder * getFather()
unsigned int id()
unsigned int totalHistos_
unsigned int getMemory()
unsigned int id_

◆ CreateIterator()

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

Definition at line 227 of file DQMStoreStats.cc.

References subfolders_.

227 { return VIterator<Folder*>(&subfolders_); }
std::vector< Folder * > subfolders_

◆ dump()

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

Definition at line 219 of file DQMStoreStats.cc.

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

219  {
220  indent.append(" ");
221  std::cout << indent << "I'm a " << name() << " whose father is " << getFather() << " with ID: " << id_
222  << " Histo: " << getHistos() << " Bins: " << getBins() << " EmptyBins: " << getEmptyBins()
223  << " Memory: " << getMemory() << " and my children are: " << std::endl;
224  for (auto& subfolder : subfolders_)
225  subfolder->dump(indent);
226  }
unsigned int getHistos()
unsigned int getEmptyBins()
std::vector< Folder * > subfolders_
const std::string & name()
unsigned int getBins()
Folder * getFather()
unsigned int getMemory()
unsigned int id_

◆ files()

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

Definition at line 291 of file DQMStoreStats.cc.

References folderName_, id_, and alignCSCRings::s.

291  {
292  std::stringstream s("");
293  s << "INSERT INTO files(id, name) VALUES(" << id_ << ",\"" << folderName_ << "\");\n";
294  sql_statement.append(s.str());
295  }
unsigned int id_
std::string folderName_

◆ getBins()

unsigned int Folder::getBins ( )
inline

Definition at line 195 of file DQMStoreStats.cc.

References mps_fire::result, subfolders_, and totalBins_.

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

195  {
196  unsigned int result = totalBins_;
197  for (auto& subfolder : subfolders_)
198  result += subfolder->getBins();
199  return result;
200  }
unsigned int totalBins_
std::vector< Folder * > subfolders_

◆ getEmptyBins()

unsigned int Folder::getEmptyBins ( )
inline

Definition at line 201 of file DQMStoreStats.cc.

References mps_fire::result, subfolders_, and totalEmptyBins_.

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

201  {
202  unsigned int result = totalEmptyBins_;
203  for (auto& subfolder : subfolders_)
204  result += subfolder->getEmptyBins();
205  return result;
206  }
std::vector< Folder * > subfolders_
unsigned int totalEmptyBins_

◆ getFather()

Folder* Folder::getFather ( )
inline

Definition at line 165 of file DQMStoreStats.cc.

References father_.

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

165 { return father_; }
Folder * father_

◆ getHistos()

unsigned int Folder::getHistos ( )
inline

Definition at line 189 of file DQMStoreStats.cc.

References mps_fire::result, subfolders_, and totalHistos_.

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

189  {
190  unsigned int result = totalHistos_;
191  for (auto& subfolder : subfolders_)
192  result += subfolder->getHistos();
193  return result;
194  }
std::vector< Folder * > subfolders_
unsigned int totalHistos_

◆ getMemory()

unsigned int Folder::getMemory ( )
inline

Definition at line 207 of file DQMStoreStats.cc.

References mps_fire::result, subfolders_, and totalMemory_.

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

207  {
208  unsigned int result = totalMemory_;
209  for (auto& subfolder : subfolders_)
210  result += subfolder->getMemory();
211  return result;
212  }
unsigned int totalMemory_
std::vector< Folder * > subfolders_

◆ id()

unsigned int Folder::id ( void  )
inline

Definition at line 178 of file DQMStoreStats.cc.

References id_.

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

178 { return id_; }
unsigned int id_

◆ level()

unsigned int Folder::level ( )
inline

Definition at line 180 of file DQMStoreStats.cc.

References level_.

180 { return level_; }
unsigned int level_

◆ mainrows()

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

Definition at line 229 of file DQMStoreStats.cc.

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

Referenced by DQMStoreStats::calcIgProfDump().

229  {
230  std::stringstream s("");
231  s << "INSERT INTO mainrows(id, symbol_id, self_count, cumulative_count, kids, self_calls, total_calls, self_paths, "
232  "total_paths, pct)"
233  " VALUES("
234  << id_ << ", " << id_ << ", " << getMemory() << ", " << getMemory() << ", " << subfolders_.size() << ", "
235  << getBins() - getEmptyBins() << ", " << getBins() << ", " << getHistos() << ", " << getHistos() << ", 0.0);\n";
236  sql_statement.append(s.str());
237  for (auto& subfolder : subfolders_)
238  subfolder->mainrows(sql_statement);
239  }
unsigned int getHistos()
unsigned int getEmptyBins()
std::vector< Folder * > subfolders_
unsigned int getBins()
unsigned int getMemory()
unsigned int id_

◆ mainrows_cumulative()

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

Definition at line 275 of file DQMStoreStats.cc.

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

275  {
276  std::stringstream s("");
277  s << "INSERT INTO mainrows(id, symbol_id, self_count, cumulative_count, kids, self_calls, total_calls, self_paths, "
278  "total_paths, pct)"
279  << " VALUES(" << id_ << "," << id_ << "," << 0 << "," << getMemory() << ", 0," << getBins() - getEmptyBins()
280  << "," << getBins() << ", 0, " << getHistos() << ", 0);\n";
281  sql_statement.append(s.str());
282  }
unsigned int getHistos()
unsigned int getEmptyBins()
unsigned int getBins()
unsigned int getMemory()
unsigned int id_

◆ name()

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

Definition at line 166 of file DQMStoreStats.cc.

References folderName_.

Referenced by config.CFG::__str__(), cd(), validation.Sample::digest(), dump(), and VIDSelectorBase.VIDSelectorBase::initialize().

166 { return folderName_; }
std::string folderName_

◆ parents()

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

Definition at line 251 of file DQMStoreStats.cc.

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

Referenced by DQMStoreStats::calcIgProfDump().

251  {
252  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
253  std::stringstream s("");
254  s << "INSERT INTO parents(self_id, child_id, to_child_count, to_child_calls, to_child_paths, pct) VALUES("
255  << parentid << "," << id_ << "," << totalMemory_ << "," << totalBins_ << "," << totalHistos_ << ",0"
256  << ");\n";
257  sql_statement.append(s.str());
258  for (auto& subfolder : subfolders_)
259  subfolder->parents(sql_statement);
260  }
unsigned int totalBins_
unsigned int totalMemory_
std::vector< Folder * > subfolders_
Folder * getFather()
unsigned int id()
unsigned int totalHistos_
unsigned int id_

◆ setFather()

void Folder::setFather ( Folder e)
inline

Definition at line 164 of file DQMStoreStats.cc.

References MillePedeFileConverter_cfg::e, and father_.

◆ setId()

void Folder::setId ( unsigned int  id)
inline

Definition at line 177 of file DQMStoreStats.cc.

References id(), and id_.

177 { id_ = id; }
unsigned int id()
unsigned int id_

◆ setLevel()

void Folder::setLevel ( unsigned int  value)
inline

Definition at line 179 of file DQMStoreStats.cc.

References level_, and relativeConstraints::value.

179 { level_ = value; }
unsigned int level_

◆ summary()

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

Definition at line 284 of file DQMStoreStats.cc.

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

284  {
285  std::stringstream s("");
286  s << "INSERT INTO summary(counter, total_count, total_freq, tick_period) VALUES (\"BINS_LIVE\"," << getMemory()
287  << "," << getBins() << ", 1);\n";
288  sql_statement.append(s.str());
289  }
unsigned int getBins()
unsigned int getMemory()

◆ symbols()

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

Definition at line 241 of file DQMStoreStats.cc.

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

241  {
242  unsigned int parentid = this->getFather() ? this->getFather()->id() : id_;
243  std::stringstream s("");
244  s << "INSERT INTO symbols(id, name, filename_id) VALUES (" << id_ << ",\"" << folderName_ << "\", " << parentid
245  << ");\n";
246  sql_statement.append(s.str());
247  for (auto& subfolder : subfolders_)
248  subfolder->symbols(sql_statement);
249  }
std::vector< Folder * > subfolders_
Folder * getFather()
unsigned int id()
unsigned int id_
std::string folderName_

◆ 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 305 of file DQMStoreStats.cc.

Referenced by getFather(), and setFather().

◆ folderName_

std::string Folder::folderName_
private

Definition at line 304 of file DQMStoreStats.cc.

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

◆ id_

unsigned int Folder::id_
private

◆ level_

unsigned int Folder::level_
private

Definition at line 303 of file DQMStoreStats.cc.

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

◆ subfolders_

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

◆ totalBins_

unsigned int Folder::totalBins_
private

Definition at line 299 of file DQMStoreStats.cc.

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

◆ totalEmptyBins_

unsigned int Folder::totalEmptyBins_
private

Definition at line 300 of file DQMStoreStats.cc.

Referenced by getEmptyBins(), and update().

◆ totalHistos_

unsigned int Folder::totalHistos_
private

Definition at line 298 of file DQMStoreStats.cc.

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

◆ totalMemory_

unsigned int Folder::totalMemory_
private

Definition at line 301 of file DQMStoreStats.cc.

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