7 #include "TDirectory.h"
11 using namespace sistrip;
19 TFile(fname,option,ftitle,compress),
43 std::stringstream ss(
"");
51 std::stringstream run_type_label;
52 std::stringstream run_type_title;
55 TNamed run_type_description(run_type_label.str().c_str(),run_type_title.str().c_str());
61 <<
"[CommissioningFile::setDQMFormat]: Currently only implemented for Control View."
87 TObject*
obj = keylist->First();
91 if (obj == keylist->Last()) {loop =
false;}
99 obj = keylist->After(obj);
124 <<
"[SiStripTFile::dqm]: Error requested dqm directory when not in dqm format."
137 <<
"[SiStripTFile::dqm]: Error requested dqm directory when not in dqm format."
161 std::string directory_path = control_path.
path();
168 <<
"[CommissioningFile::addDevice]: Currently only implemented for Control View."
185 std::vector<std::string> directories; directories.reserve(10);
188 std::string::const_iterator it, previous_dir, latest_dir;
190 it = previous_dir = latest_dir = path.begin();}
191 else {it = previous_dir = latest_dir = path.begin()-1;}
193 while (it != path.end()) {
196 previous_dir = latest_dir;
198 directories.push_back(std::string(previous_dir+1, latest_dir));
202 if (latest_dir != (path.end()-1)) {
203 directories.push_back(std::string(latest_dir+1, path.end()));}
206 TDirectory*
child = gDirectory;
207 for (std::vector<std::string>::const_iterator
dir = directories.begin();
dir != directories.end();
dir++) {
208 if (!dynamic_cast<TDirectory*>(child->Get(
dir->c_str()))) {
209 child = child->mkdir(
dir->c_str());
211 else {child->Cd(
dir->c_str()); child = gDirectory;}
220 std::vector< TDirectory* > dirs;
226 while ( !dirs.empty() ) {
228 dirs.erase(dirs.begin());
236 std::vector<TDirectory*>* dirs,
239 TList* keylist = dir->GetListOfKeys();
242 TObject*
obj = keylist->First();
247 if (obj == keylist->Last()) {loop =
false;}
249 if (dynamic_cast<TDirectory*>(dir->Get(obj->GetName()))) {
250 TDirectory*
child =
dynamic_cast<TDirectory*
>(dir->Get(obj->GetName()));
253 dirs->push_back(child);
256 TH1* his =
dynamic_cast<TH1*
>( dir->Get(obj->GetName()) );
259 std::vector<TH1*>::iterator ihis = (*histos)[std::string(dir->GetPath())].
begin();
260 for ( ; ihis != (*histos)[std::string(dir->GetPath())].
end(); ihis++ ) {
261 if ( (*ihis)->GetName() == his->GetName() ) { found =
true; }
263 if ( !found ) { (*histos)[std::string(dir->GetPath())].push_back(his); }
265 obj = keylist->After(obj);
void dirContent(TDirectory *, std::vector< TDirectory * > *, std::map< std::string, std::vector< TH1 * > > *)
TDirectory * setDQMFormat(sistrip::RunType, sistrip::View)
static const char mlDqmClient_[]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
TDirectory * addPath(const std::string &)
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
static std::string runType(const sistrip::RunType &)
TDirectory * readDQMFormat()
static const char controlView_[]
static const char taskId_[]
static const char dqmRoot_[]
const std::string & path() const
sistrip::RunType runType_
sistrip::RunType & runType()
void findHistos(TDirectory *, std::map< std::string, std::vector< TH1 * > > *)
TDirectory * sistripTop()
SiStripTFile(const char *fname, Option_t *option="UPDATE", const char *ftitle="", Int_t compress=1)
static const char root_[]
void addDevice(unsigned int key)