Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:00

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework includes
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/VolumeProcessor.h>
0017 
0018 using namespace dd4hep;
0019 
0020 /// Default destructor
0021 PlacedVolumeProcessor::~PlacedVolumeProcessor()  noexcept(false)  {
0022 }
0023 
0024 /// Callback to output PlacedVolume information of an entire DetElement
0025 int PlacedVolumeProcessor::process(PlacedVolume pv, int level, bool recursive)  {
0026   if ( pv.isValid() )  {
0027     int ret = (*this)(pv, level);
0028     TGeoNode* node = pv.ptr();
0029     if ( recursive )  {
0030       for (Int_t idau = 0, ndau = node->GetNdaughters(); idau < ndau; ++idau) {
0031         PlacedVolume placement(node->GetDaughter(idau));
0032         //if ( placement.data() ) {
0033           ret += process(placement,level+1,recursive);
0034       //}
0035       }
0036     }
0037     return ret;
0038   }
0039   except("PlacedVolume","Cannot process an invalid PlacedVolume element");
0040   return 0;
0041 }