/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Member Functions | Private Attributes
XddDumpAlg Class Reference

#include <XddDumpAlg.h>

List of all members.

Public Member Functions

 XddDumpAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~XddDumpAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()

Private Member Functions

void dump (DataObject *d)
void dump (LVolume *lv)
void dump (LAssembly *la)
void dump (DetectorElement *de)
void dump (Material *me)
void dump_children (DataObject *d)

Private Attributes

int m_depth
std::vector< std::string > m_paths

Detailed Description

Definition at line 16 of file XddDumpAlg.h.


Constructor & Destructor Documentation

XddDumpAlg::XddDumpAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 18 of file XddDumpAlg.cc.

    : GaudiAlgorithm(name,pSvcLocator)
    , m_depth(0)
{
    declareProperty("Paths",m_paths,"TDS paths to dump");
}
XddDumpAlg::~XddDumpAlg ( ) [virtual]

Definition at line 25 of file XddDumpAlg.cc.

{
}

Member Function Documentation

StatusCode XddDumpAlg::initialize ( ) [virtual]

Definition at line 29 of file XddDumpAlg.cc.

{
    this->GaudiAlgorithm::initialize();

    //msgSvc()->setOutputLevel("GeometryInfoPlus",1);

    return StatusCode::SUCCESS;
}
StatusCode XddDumpAlg::execute ( ) [virtual]

Definition at line 38 of file XddDumpAlg.cc.

{
    //detSvc()->addPreLoadItem("/dd/Structure");
    //detSvc()->preLoad();

    if (!m_paths.size()) {
        warning() << "No TDS paths given, defaulting to /dd" << endreq;
        m_paths.push_back("/dd");
    }

    for (size_t ind=0; ind<m_paths.size(); ++ind) {
        const char* path = m_paths[ind].c_str();
        cout << "Dumping " << path << endl;
        DataObject *d = getDet<DataObject>(path);
        this->dump(d);
    }

    return StatusCode::SUCCESS;
}
StatusCode XddDumpAlg::finalize ( ) [virtual]

Definition at line 145 of file XddDumpAlg.cc.

{

    return this->GaudiAlgorithm::finalize();
}
void XddDumpAlg::dump ( DataObject *  d) [private]

Definition at line 91 of file XddDumpAlg.cc.

{
    cout << string(m_depth,' ') << d->name() << ": " << *d << endl;

    LVolume* lv = dynamic_cast<LVolume*>(d);
    if (lv) this->dump(lv);

    LAssembly* la = dynamic_cast<LAssembly*>(d);
    if (la) this->dump(la);

    DetectorElement* de = dynamic_cast<DetectorElement*>(d);
    if (de) this->dump(de);

    Material* me = dynamic_cast<Material*>(d);
    if (me) this->dump(me);

    this->dump_children(d);
}
void XddDumpAlg::dump ( LVolume *  lv) [private]

Definition at line 110 of file XddDumpAlg.cc.

{
    cout << string(m_depth,' ');
    lv->printOut(cout) << endl;
}
void XddDumpAlg::dump ( LAssembly *  la) [private]

Definition at line 115 of file XddDumpAlg.cc.

{
    cout << string(m_depth,' ');
    la->printOut(cout) << endl;
}
void XddDumpAlg::dump ( DetectorElement *  de) [private]

Definition at line 120 of file XddDumpAlg.cc.

{
    cout << string(m_depth,' ');
    de->printOut(cout) << endl;
    IGeometryInfo* gi = de->geometry();
    Gaudi::XYZPoint zero(0,0,0);
    Gaudi::XYZPoint whereami = gi->toGlobal(zero);
    cout << "\t" << string(m_depth,' ') 
         << "GeometryInfo @ " << (void*)gi << "\n"
         << "\t" << string(m_depth,' ') 
         << "globally @ " << whereami << " mm"
         << endl;

    IDetectorElement::IDEContainer& dechild = de->childIDetectorElements();
    size_t nchildren = dechild.size();
    cout << "\t" << string(m_depth,' ') << nchildren << " children:" << endl;
    for (size_t ind=0; ind<nchildren; ++ind) {
        cout << "\t" << string(m_depth,' ') << dechild[ind]->name() << endl;
    }
}
void XddDumpAlg::dump ( Material *  me) [private]

Definition at line 140 of file XddDumpAlg.cc.

{
    cout << string(m_depth,' ') << *me << endl;
}
void XddDumpAlg::dump_children ( DataObject *  d) [private]

Definition at line 58 of file XddDumpAlg.cc.

{
    IRegistry* dr = d->registry();
    using namespace DataSvcHelpers;
    RegistryEntry* dre = dynamic_cast<RegistryEntry*>(dr);
    if (!dre) {
        cerr << "Failed to get RegistryEntry\n";
        return;
    }

    RegistryEntry::Iterator it = dre->begin(), done = dre->end();
    size_t siz = done-it;
    cout << string(m_depth,' ') << siz << " sub-directories:" << endl;
    ++m_depth;
    for (; it != done; ++it) {
        string id = (*it)->identifier();

        cout << string(m_depth,' ')
             << "Registry: name=" << (*it)->name() 
             << ", identifier=" << id << endl;

        DataObject* child = getDet<DataObject>(id);
        if (!child) {
            cout << string(m_depth,' ') << " failed to retrieve " << id << endl;
            break;
        }
        ++m_depth;
        this->dump(child);
        --m_depth;
    }
    --m_depth;
    return;
}

Member Data Documentation

int XddDumpAlg::m_depth [private]

Definition at line 35 of file XddDumpAlg.h.

std::vector<std::string> XddDumpAlg::m_paths [private]

Definition at line 37 of file XddDumpAlg.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:34 for XmlDetDescChecks by doxygen 1.7.4