221 {
222
224
225 std::string inspace =
spacer;
226
228
229 int deptht =
depth-1;
230
232
233
234
235
236
238 if ( deptht>=0 &&
size_t(deptht)<
directories.size() ) {
239
241 !(
243 }
244 }
245
246
247
248
249 if ( !accept ) return;
250
251
252
254
255
257
258
259 TList*
tl =
m_dir->GetListOfKeys();
260
261
262 for (
int i=
tl->GetSize() ; i-- ; ) {
263
264 TKey* tobj = (TKey*)
tl->At(i);
265 if ( tobj ) {
266 TDirectory* tnd = 0;
267 std::vector<inode> nodes;
268
269
270
271
272
273 if ( std::string(tobj->GetClassName()).find("TDirectory")!=std::string::npos ) {
274 tnd = (TDirectory*)tobj->ReadObj();
276 m_nodes.push_back( inode( tobj->GetName(), tobj->GetClassName(), tobj, tnd, nodes ) );
277 }
278 else {
279
281
283 else {
284 for (
unsigned ip=
patterns.size() ; ip-- ; ) {
285 if ( std::string( tobj->GetName()).find(
patterns[ip] )!=std::string::npos )
accept =
true;
286
287 }
288 }
289
290 for (
unsigned ip=
Patterns.size() ; ip-- ; ) {
291 if ( std::string( tobj->GetName()).find(
Patterns[ip] )==std::string::npos )
accept =
false;
292
293 }
294
296
297 if ( accept ) {
298 m_nodes.push_back( inode( tobj->GetName(), tobj->GetClassName(), tobj ) );
299
300
301
302
304
305 if ( std::string( tobj->GetClassName()).find("TH1")!=std::string::npos ) {
306 TH1*
h = (TH1*)tobj->ReadObj();
308
310 std::cout <<
"\tentries " <<
h->GetEntries() <<
" \tmean " <<
h->GetMean() <<
"\tplot " <<
plot <<
"\t";
311 }
312
313
315
317
319 h->SetMaximum(
hmax(h)*1.2 );
320
321 std::string
t = tobj->GetName();
322
323 if (
t.find(
"____")!=std::string::npos )
t.erase( 0,
t.find(
"___")+4);
324 if (
t.find(
"_FirstTime")!=std::string::npos )
t.erase(
t.find(
"_FirstTime"),
t.size());
325
326 h->SetTitle(
t.c_str());
327
329
332
334
338 h->SetMaximum(
ymax );
340 }
342 }
343
344 h->DrawCopy(
"samehist");
345
346
348
349 if (
logy ) gPad->SetLogy(
true);
350 gPad->Print( (std::string(tobj->GetName())+".pdf").c_str() );
351
352
354
356 }
357 }
358
359 std::cout << std::endl;
360
361
362
364 std::string cckname = tobj->GetName();
367
368 std::string tdir =
chop( cckname,
"____" );
369
370 if ( cckname.size()==0 ) {
371 h->SetName( tdir.c_str() );
373 }
374 else {
375 TIDDirectory dcck(tdir);
376 dcck.push();
377
378 h->SetName( cckname.c_str() );
380 dcck.pop();
381 }
382 cck->cd();
383 }
384 }
385 else {
386 std::cout << std::endl;
387 }
388 }
389 }
390 }
391 }
392
393 if ( cck ) cck->cd();
394
395 spacer = std::move(inspace);
396 }
static std::string spacer
std::vector< inode > m_nodes
TCck(TDirectory *d, int depth=0)
std::string chop(std::string &s1, const std::string &s2)
std::string label(const std::string &format, int i)
double minmean
these patterns are vetoed
std::vector< std::string > directories
std::vector< std::string > Patterns
these patterns are ored
bool contains(const std::string &s, const std::string ®ex)
does a string contain the substring
bool isvetoed(const std::string &s)
std::vector< std::string > patterns
StatusCode accept(const xAOD::Muon *mu)