Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DumpMom.h File Reference

#include <string>
#include <iosfwd>

Go to the source code of this file.

Namespaces

namespace  DataUtil

Functions

bool dump_mom (const MomNavigator *, std::ostream &os)
 Dump the contents of mom ot give ostream.
bool dump_cand (const CandHandle *ch, std::ostream &os, std::string prefix="", int recurse_depth=1, int max_daughters=5)


Function Documentation

bool DataUtil::dump_cand const CandHandle ch,
std::ostream &  os,
std::string  prefix = "",
int  recurse_depth = 1,
int  max_daughters = 5
 

Definition at line 22 of file DumpMom.cxx.

References Form(), CandHandle::GetDaughterIterator(), CandHandle::GetName(), CandHandle::GetNDaughters(), and CandHandle::GetTitle().

Referenced by DataUtil::dump_mom().

00027 {
00028   // Add name and title if it's a CandHandle.
00029   if(ch) {
00030     os << prefix 
00031        << Form("%s \t\"%s\" %s",ch->ClassName(),ch->GetName(), ch->GetTitle()) 
00032        << std::endl;
00033     int n = ch->GetNDaughters();
00034     if( max_daughters < n ) n = max_daughters;
00035     if( recurse_depth <=0) n = 0;
00036     if(n > 0) {
00037       TIter iter = ch->GetDaughterIterator();
00038       for(int i=0;i<n;i++) {
00039         const CandHandle* next = dynamic_cast<const CandHandle*>(iter.Next());
00040         if(next)
00041           if(! next->InheritsFrom("CandDigitHandle") )
00042             dump_cand(next,
00043                       os,
00044                       prefix+"  ",
00045                       recurse_depth-1,
00046                       max_daughters);
00047         
00048       } 
00049     }
00050     if(ch->GetNDaughters() > 0) {
00051       os << prefix << ".. Total daughters:" <<  ch->GetNDaughters() << endl;
00052     }
00053     
00054     return true;
00055   }
00056   return false;
00057 }


Generated on Sat Nov 21 22:48:19 2009 for loon by  doxygen 1.3.9.1