From e2d4061acb72377b037edff3b5576b6cdb4745c1 Mon Sep 17 00:00:00 2001 From: Markus Frank <markus.frank@cern.ch> Date: Fri, 21 Jun 2013 21:16:16 +0000 Subject: [PATCH] Fix visualization attributes of world volume --- DDCore/include/DD4hep/Detector.h | 4 +- DDCore/include/DD4hep/Printout.h | 74 +++++++++++++++++- DDCore/include/XML/Conversions.h | 53 ------------- DDCore/src/LCDDImp.cpp | 6 +- DDCore/src/MatrixHelpers.cpp | 4 + DDCore/src/MatrixHelpers.h | 1 + DDCore/src/Printout.cpp | 118 +++++++++++++++++++++++++++++ DDCore/src/Shapes.cpp | 4 - DDCore/src/Volumes.cpp | 4 - DDCore/src/plugins/LCDD2Output.cpp | 117 +--------------------------- DDG4/src/Geant4Converter.cpp | 44 +++-------- doc/display.mac | 2 +- 12 files changed, 218 insertions(+), 213 deletions(-) diff --git a/DDCore/include/DD4hep/Detector.h b/DDCore/include/DD4hep/Detector.h index 271c2bdee..d943e9300 100644 --- a/DDCore/include/DD4hep/Detector.h +++ b/DDCore/include/DD4hep/Detector.h @@ -383,5 +383,5 @@ namespace DD4hep { }; } /* End namespace Geometry */ -} /* End namespace DD4hep */ -#endif /* DD4hep_LCDD_DETECTOR_H */ +} /* End namespace DD4hep */ +#endif /* DD4hep_LCDD_DETECTOR_H */ diff --git a/DDCore/include/DD4hep/Printout.h b/DDCore/include/DD4hep/Printout.h index 930d48c22..9eee1dbb0 100644 --- a/DDCore/include/DD4hep/Printout.h +++ b/DDCore/include/DD4hep/Printout.h @@ -10,15 +10,29 @@ #ifndef DD4HEP_PRINTOUT_H #define DD4HEP_PRINTOUT_H +// Framework include files +//#include "DD4hep/Handle.h" + // C/C++ include files #include <cstdio> #include <cstdlib> +#include <iostream> +#include <map> /* * DD4hep namespace declaration */ namespace DD4hep { + /// Forward declarations + namespace Geometry { + template <typename T> struct Handle; + class LCDD; + class VisAttr; + class DetElement; + class PlacedVolume; + } + enum PrintLevel { NOLOG=0, VERBOSE, @@ -46,5 +60,63 @@ namespace DD4hep { /// Customize printer function void setPrinter(void* print_arg, output_function_t fcn); -} /* End namespace DD4hep */ + /** @class Printer Conversions.h DD4hep/compact/Conversions.h + * + * Small helper class to print objects + * + * @author M.Frank + * @version 1.0 + */ + template <typename T> struct Printer { + /// Reference to the detector description object + const Geometry::LCDD* lcdd; + /// Reference to the output stream object, the Printer object should write + std::ostream& os; + /// Optional text prefix when formatting the output + std::string prefix; + /// Initializing constructor of the functor + Printer(const Geometry::LCDD* l, std::ostream& stream, const std::string& p="") + : lcdd(l), os(stream), prefix(p) {} + /// Callback operator to be specialized depending on the element type + void operator()(const T& value) const; + }; + + template <typename T> inline + std::ostream& print(const T& object,std::ostream& os=std::cout,const std::string& indent="") { + Printer<T>(0,os,indent)(object); + return os; + } + + /** @class PrintMap Conversions.h DD4hep/compact/Conversions.h + * + * Small helper class to print maps of objects + * + * @author M.Frank + * @version 1.0 + */ + template <typename T> struct PrintMap { + typedef T item_type; + typedef const std::map<std::string,Geometry::Handle<TNamed> > cont_type; + + /// Reference to the detector description object + const Geometry::LCDD* lcdd; + /// Reference to the output stream object, the Printer object should write + std::ostream& os; + /// Optional text prefix when formatting the output + std::string text; + /// Reference to the container data of the map. + cont_type& cont; + /// Initializing constructor of the functor + PrintMap(const Geometry::LCDD* l, std::ostream& stream, cont_type& c, const std::string& t="") + : lcdd(l), os(stream), text(t), cont(c) {} + /// Callback operator to be specialized depending on the element type + void operator()() const; + }; + + /// Helper function to print booleans in format YES/NO + inline const char* yes_no(bool value) { return value ? "YES" : "NO "; } + /// Helper function to print booleans in format true/false + inline const char* true_false(bool value) { return value ? "true " : "false"; } + +} /* End namespace DD4hep */ #endif /* DD4HEP_PRINTOUT_H */ diff --git a/DDCore/include/XML/Conversions.h b/DDCore/include/XML/Conversions.h index 48023dacc..9dca1d186 100644 --- a/DDCore/include/XML/Conversions.h +++ b/DDCore/include/XML/Conversions.h @@ -43,58 +43,5 @@ namespace DD4hep { /// Callback operator to be specialized depending on the element type void operator()(XML::Handle_t xml) const; }; - - /** @class PrintMap Conversions.h DD4hep/compact/Conversions.h - * - * Small helper class to print maps of objects - * - * @author M.Frank - * @version 1.0 - */ - template <typename T> struct PrintMap { - typedef T item_type; - typedef const Geometry::LCDD::HandleMap cont_type; - - /// Reference to the detector description object - const Geometry::LCDD& lcdd; - /// Reference to the output stream object, the Printer object should write - std::ostream& os; - /// Optional text prefix when formatting the output - std::string text; - /// Reference to the container data of the map. - cont_type& cont; - /// Initializing constructor of the functor - PrintMap(const Geometry::LCDD& l, std::ostream& stream, cont_type& c, const std::string& t="") - : lcdd(l), os(stream), text(t), cont(c) {} - /// Callback operator to be specialized depending on the element type - void operator()() const; - }; - - /** @class Printer Conversions.h DD4hep/compact/Conversions.h - * - * Small helper class to print objects - * - * @author M.Frank - * @version 1.0 - */ - template <typename T> struct Printer { - /// Reference to the detector description object - const Geometry::LCDD& lcdd; - /// Reference to the output stream object, the Printer object should write - std::ostream& os; - /// Optional text prefix when formatting the output - std::string prefix; - /// Initializing constructor of the functor - Printer(const Geometry::LCDD& l, std::ostream& stream, const std::string& p="") - : lcdd(l), os(stream), prefix(p) {} - /// Callback operator to be specialized depending on the element type - void operator()(const T& value) const; - }; - - /// Helper function to print booleans in format YES/NO - inline const char* yes_no(bool value) { return value ? "YES" : "NO "; } - /// Helper function to print booleans in format true/false - inline const char* true_false(bool value) { return value ? "true " : "false"; } - } /* End namespace DD4hep */ #endif /* DD4hep_COMPACT_CONVERSION_H */ diff --git a/DDCore/src/LCDDImp.cpp b/DDCore/src/LCDDImp.cpp index a148fad28..8b3d74f07 100644 --- a/DDCore/src/LCDDImp.cpp +++ b/DDCore/src/LCDDImp.cpp @@ -246,8 +246,12 @@ void LCDDImp::endDocument() { #endif // Set the world volume to invisible. VisAttr worldVis("WorldVis"); + worldVis.setAlpha(1.0); worldVis.setVisible(false); - worldVis.setShowDaughters(true) ; + worldVis.setShowDaughters(true); + worldVis.setColor(1.0,1.0,1.0); + worldVis.setLineStyle(VisAttr::SOLID); + worldVis.setDrawingStyle(VisAttr::WIREFRAME); m_worldVol.setVisAttributes(worldVis); add(worldVis); diff --git a/DDCore/src/MatrixHelpers.cpp b/DDCore/src/MatrixHelpers.cpp index acee92ff4..3064cf71b 100644 --- a/DDCore/src/MatrixHelpers.cpp +++ b/DDCore/src/MatrixHelpers.cpp @@ -13,6 +13,10 @@ // ROOT includes #include "TGeoMatrix.h" +TGeoIdentity* DD4hep::Geometry::identityTransform() { + return gGeoIdentity; +} + TGeoTranslation* DD4hep::Geometry::_translation(const Position& pos) { return new TGeoTranslation("",pos.X()*MM_2_CM,pos.Y()*MM_2_CM,pos.Z()*MM_2_CM); } diff --git a/DDCore/src/MatrixHelpers.h b/DDCore/src/MatrixHelpers.h index b2db58442..7f2506c18 100644 --- a/DDCore/src/MatrixHelpers.h +++ b/DDCore/src/MatrixHelpers.h @@ -28,6 +28,7 @@ namespace DD4hep { */ namespace Geometry { + TGeoIdentity* identityTransform(); TGeoTranslation* _translation(const Position& pos); TGeoRotation* _rotation(const Rotation& rot); TGeoRotation* _rotation3D(const Rotation3D& rot); diff --git a/DDCore/src/Printout.cpp b/DDCore/src/Printout.cpp index 99a3ee1ee..33b839059 100644 --- a/DDCore/src/Printout.cpp +++ b/DDCore/src/Printout.cpp @@ -7,6 +7,8 @@ // //==================================================================== +#include "DD4hep/LCDD.h" +#include "DD4hep/Objects.h" #include "DD4hep/Printout.h" #include <cstdarg> @@ -55,3 +57,119 @@ void DD4hep::setPrinter(void* arg, output_function_t fcn) { print_func = fcn; } +#include "TMap.h" +#include "TROOT.h" +#include "TColor.h" +using namespace std; +namespace DD4hep { + using namespace Geometry; + + template <typename T> void PrintMap<T>::operator()() const { + Printer<T> p(lcdd,os); + os << "++" << endl << "++ " << text << endl << "++" << endl; + for (LCDD::HandleMap::const_iterator i=cont.begin(); i != cont.end(); ++i) + p((*i).second); + } + + template <> void Printer<Handle<TNamed> >::operator()(const Handle<TNamed>& val) const { + printout(INFO,"Printer","%s ++ Handle:%s %s", + prefix.c_str(),val->GetName(),val->GetTitle()); + } + + template <> void Printer<Constant>::operator()(const Constant& val) const { + printout(INFO,"Printer","%s ++ Constant:%s %s", + prefix.c_str(),val->GetName(),val.toString().c_str()); + } + + template <> void Printer<Material>::operator()(const Material& val) const { + printout(INFO,"Printer","%s ++ Material:%s %s", + prefix.c_str(),val->GetName(),val.toString().c_str()); + } + + template <> void Printer<VisAttr>::operator()(const VisAttr& val) const { + printout(INFO,"Printer","%s ++ VisAttr: %s",prefix.c_str(),val.toString().c_str()); + } + + template <> void Printer<Readout>::operator()(const Readout& val) const { + printout(INFO,"Printer","%s ++ Readout: %s of type %s", + prefix.c_str(),val->GetName(),val->GetTitle()); + } + + template <> void Printer<Region>::operator()(const Region& val) const { + printout(INFO,"Printer","%s ++ Region: %s of type %s", + prefix.c_str(),val->GetName(),val->GetTitle()); + } + + template <> void Printer<Rotation>::operator()(const Rotation& val) const { + printout(INFO,"Printer","%s ++ ZYXRotation: phi: %7.3 rad theta: %7.3 rad psi: %7.3 rad", + prefix.c_str(),val.Phi(),val.Theta(),val.Psi()); + } + + template <> void Printer<Position>::operator()(const Position& val) const { + printout(INFO,"Printer","%s ++ Position: x: %9.3 mm y: %9.3 mm z: %9.3 mm", + prefix.c_str(),val.X(),val.Y(),val.Z()); + } + + template <> void Printer<LimitSet>::operator()(const LimitSet& val) const { + const set<Limit>& o = val.limits(); + printout(INFO,"Printer","%s ++ LimitSet: %s",prefix.c_str(),val.name()); + val->TNamed::Print(); + for(set<Limit>::const_iterator i=o.begin(); i!=o.end(); ++i) { + os << "++ Limit:" << (*i).name << " " << (*i).particles + << " [" << (*i).unit << "] " << (*i).content << " " << (*i).value << endl; + } + } + + template <> void Printer<DetElement>::operator()(const DetElement& val) const { + DetElement::Object* obj = val.data<DetElement::Object>(); + if ( obj ) { + char text[256]; + const DetElement& sd = val; + PlacedVolume plc = sd.placement(); + bool vis = plc.isValid(); + bool env = plc.isValid(); + bool mat = plc.isValid(); + ::snprintf(text,sizeof(text),"ID:%-3d Combine Hits:%3s Material:%s Envelope:%s VisAttr:%s", + sd.id(), yes_no(sd.combineHits()), + mat ? plc.material()->GetName() : yes_no(mat), + env ? plc.motherVol()->GetName() : yes_no(env), + yes_no(vis) + ); + os << prefix << "+= DetElement: " << val->GetName() << " " << val.type() << endl; + os << prefix << "| " << text << endl; + + if ( vis ) { + VisAttr attr = plc.volume().visAttributes(); + VisAttr::Object* v = attr.data<VisAttr::Object>(); + TColor* col = gROOT->GetColor(v->color); + char text[256]; + ::snprintf(text,sizeof(text)," RGB:%-8s [%d] %7.2f Style:%d %d ShowDaughters:%3s Visible:%3s", + col->AsHexString(), v->color, col->GetAlpha(), int(v->drawingStyle), int(v->lineStyle), + v->showDaughters ? "YES" : "NO", v->visible ? "YES" : "NO"); + os << prefix << "| VisAttr: " << setw(32) << left << attr.name() << text << endl; + } + if ( plc.isValid() ) { + Volume vol = plc.volume(); + Solid s = vol.solid(); + Material m = vol.material(); + ::snprintf(text,sizeof(text),"Volume:%s Shape:%s Material:%s", + vol->GetName(), s.isValid() ? s.name() : "Unknonw", m.isValid() ? m->GetName() : "Unknown" + ); + os << prefix << "+------------- " << text << endl; + } + const DetElement::Children& ch = sd.children(); + for(DetElement::Children::const_iterator i=ch.begin(); i!=ch.end(); ++i) + Printer<DetElement>(lcdd,os,prefix+"| ")((*i).second); + return; + } + } + + template <> void Printer<const LCDD*>::operator()(const LCDD*const&) const { + //Header(lcdd.header()).fromCompact(doc,compact.child(Tag_info),Strng_t("In memory")); + PrintMap<Constant > (lcdd,os,lcdd->constants(), "List of Constants")(); + PrintMap<VisAttr > (lcdd,os,lcdd->visAttributes(),"List of Visualization attributes")(); + PrintMap<LimitSet > (lcdd,os,lcdd->readouts(), "List of Readouts")(); + PrintMap<Region > (lcdd,os,lcdd->regions(), "List of Regions")(); + PrintMap<DetElement> (lcdd,os,lcdd->detectors(), "List of DetElements")(); + } +} diff --git a/DDCore/src/Shapes.cpp b/DDCore/src/Shapes.cpp index 6b72b6f41..1824e6ed8 100644 --- a/DDCore/src/Shapes.cpp +++ b/DDCore/src/Shapes.cpp @@ -31,10 +31,6 @@ using namespace std; using namespace DD4hep::Geometry; -TGeoIdentity* DD4hep::Geometry::identityTransform() { - return gGeoIdentity; -} - template<typename T> void Solid_type<T>::_setDimensions(double* param) { this->ptr()->SetDimensions(param); this->ptr()->ComputeBBox(); diff --git a/DDCore/src/Volumes.cpp b/DDCore/src/Volumes.cpp index 96f789940..f3e863ece 100644 --- a/DDCore/src/Volumes.cpp +++ b/DDCore/src/Volumes.cpp @@ -31,10 +31,6 @@ using namespace std; using namespace DD4hep::Geometry; -namespace DD4hep { namespace Geometry { - TGeoIdentity* identityTransform(); -}} - namespace DD4hep { namespace Geometry { template <> struct Value<TGeoNodeMatrix,PlacedVolume::Object> diff --git a/DDCore/src/plugins/LCDD2Output.cpp b/DDCore/src/plugins/LCDD2Output.cpp index f3ad97ed4..9d03dca7c 100644 --- a/DDCore/src/plugins/LCDD2Output.cpp +++ b/DDCore/src/plugins/LCDD2Output.cpp @@ -10,6 +10,7 @@ #include "XML/Conversions.h" #include "DD4hep/LCDD.h" #include "DD4hep/Objects.h" +#include "DD4hep/Printout.h" #include "DD4hep/IDDescriptor.h" #include "TMap.h" @@ -20,104 +21,10 @@ #include <iostream> #include <iomanip> -using namespace std; -using namespace DD4hep::Geometry; +using namespace std; namespace DD4hep { - - template <> void Printer<Constant>::operator()(const Constant& val) const { - os << "++ Constant:" << val.toString() << endl; - } - - template <> void Printer<Material>::operator()(const Material& mat) const { - os << "++ Medium: " << mat.toString() << "| " << endl; - mat->Print(); - } - - template <> void Printer<VisAttr>::operator()(const VisAttr& val) const { - os << "++ VisAttr: " << val.toString() << endl; - } - - template <> void Printer<Readout>::operator()(const Readout& val) const { - os << "++ Readout: "; - val->Print(); - } - - template <> void Printer<Region>::operator()(const Region& val) const { - os << "++ Region: "; - val->Print(); - } - - template <> void Printer<Rotation>::operator()(const Rotation& val) const { - os << "++ Rotation: "; - //val->Print(); - } - - template <> void Printer<Position>::operator()(const Position& val) const { - os << "++ Position: "; - //val->Print(); - } - - template <> void Printer<LimitSet>::operator()(const LimitSet& val) const { - const set<Limit>& o = val.limits(); - os << "++ LimitSet: " << val.name() << endl; - val->TNamed::Print(); - for(set<Limit>::const_iterator i=o.begin(); i!=o.end(); ++i) { - os << "++ Limit:" << (*i).name << " " << (*i).particles - << " [" << (*i).unit << "] " << (*i).content << " " << (*i).value << endl; - } - } - - template <> void Printer<DetElement>::operator()(const DetElement& val) const { - DetElement::Object* obj = val.data<DetElement::Object>(); - if ( obj ) { - char text[256]; - const DetElement& sd = val; - PlacedVolume plc = sd.placement(); - bool vis = plc.isValid(); - bool env = plc.isValid(); - bool mat = plc.isValid(); - ::snprintf(text,sizeof(text),"ID:%-3d Combine Hits:%3s Material:%s Envelope:%s VisAttr:%s", - sd.id(), yes_no(sd.combineHits()), - mat ? plc.material()->GetName() : yes_no(mat), - env ? plc.motherVol()->GetName() : yes_no(env), - yes_no(vis) - ); - os << prefix << "+= DetElement: " << val->GetName() << " " << val.type() << endl; - os << prefix << "| " << text << endl; - - if ( vis ) { - VisAttr attr = plc.volume().visAttributes(); - VisAttr::Object* v = attr.data<VisAttr::Object>(); - TColor* col = gROOT->GetColor(v->color); - char text[256]; - ::snprintf(text,sizeof(text)," RGB:%-8s [%d] %7.2f Style:%d %d ShowDaughters:%3s Visible:%3s", - col->AsHexString(), v->color, col->GetAlpha(), int(v->drawingStyle), int(v->lineStyle), - v->showDaughters ? "YES" : "NO", v->visible ? "YES" : "NO"); - os << prefix << "| VisAttr: " << setw(32) << left << attr.name() << text << endl; - } - if ( plc.isValid() ) { - Volume vol = plc.volume(); - Solid s = vol.solid(); - Material m = vol.material(); - ::snprintf(text,sizeof(text),"Volume:%s Shape:%s Material:%s", - vol->GetName(), s.isValid() ? s.name() : "Unknonw", m.isValid() ? m->GetName() : "Unknown" - ); - os << prefix << "+------------- " << text << endl; - } - const DetElement::Children& ch = sd.children(); - for(DetElement::Children::const_iterator i=ch.begin(); i!=ch.end(); ++i) - Printer<DetElement>(lcdd,os,prefix+"| ")((*i).second); - return; - } - } - - template <typename T> void PrintMap<T>::operator()() const { - Printer<T> p(lcdd,os); - os << "++" << endl << "++ " << text << endl << "++" << endl; - for (LCDD::HandleMap::const_iterator i=cont.begin(); i != cont.end(); ++i) - p((*i).second); - } + using namespace Geometry; void dumpNode(TGeoNode* n, int level) { TGeoMatrix* mat = n->GetMatrix(); @@ -176,22 +83,4 @@ namespace DD4hep { void dumpTopVolume(const LCDD& lcdd) { dumpVolume(lcdd.manager().GetTopVolume(),0); } - - template <> void Printer<const LCDD*>::operator()(const LCDD*const&) const { - //Header(lcdd.header()).fromCompact(doc,compact.child(Tag_info),Strng_t("In memory")); -#if 0 - PrintMap<Constant > (lcdd,os,lcdd.constants(), "List of Constants")(); - PrintMap<Material > (lcdd,os,lcdd.materials(), "List of Materials")(); - PrintMap<VisAttr > (lcdd,os,lcdd.visAttributes(),"List of Visualization attributes")(); - PrintMap<Position > (lcdd,os,lcdd.positions(), "List of Positions")(); - PrintMap<Rotation > (lcdd,os,lcdd.rotations(), "List of Rotations")(); - PrintMap<LimitSet > (lcdd,os,lcdd.readouts(), "List of Readouts")(); - PrintMap<Region > (lcdd,os,lcdd.regions(), "List of Regions")(); - PrintMap<DetElement> (lcdd,os,lcdd.detectors(), "List of DetElements")(); -#endif - //PrintMap<DetElement>(lcdd,os,lcdd.detectors(), "List of DetElements")(); - //PrintMap<VisAttr > (lcdd,os,lcdd.visAttributes(),"List of Visualization attributes")(); - dumpTopVolume(lcdd); - } - } diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index 1f13ebc09..27a4762fd 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -252,7 +252,7 @@ void* Geant4Converter::handleSolid(const string& name, const TGeoShape* shape) rmax.push_back(s->GetRmax(i)*CM_2_MM); z.push_back(s->GetZ(i)*CM_2_MM); } - solid = new G4Polyhedra(name,phi_start,phi_total,s->GetNedges()-1,s->GetNz(),&z[0],&rmin[0],&rmax[0]); + solid = new G4Polyhedra(name,phi_start,phi_total,s->GetNedges(),s->GetNz(),&z[0],&rmin[0],&rmax[0]); } else if ( shape->IsA() == TGeoPcon::Class() ) { const TGeoPcon* s = (const TGeoPcon*)shape; @@ -348,21 +348,15 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume if ( !vol ) { const TGeoVolume* v = volume; Volume _v = Ref_t(v); - VisAttr vis = _v.visAttributes(); string n = v->GetName(); TGeoMedium* m = v->GetMedium(); TGeoShape* s = v->GetShape(); G4VSolid* solid = (G4VSolid*)handleSolid(s->GetName(),s); G4Material* medium = 0; - SensitiveDetector det = _v.sensitiveDetector(); bool assembly = s->IsA() == TGeoShapeAssembly::Class(); - Geant4SensitiveDetector* sd = 0; - G4VisAttributes* vis_attr = 0; - - printout(DEBUG,"Geant4Converter","++ Convert Volume %-32s: %p %s/%s assembly:%s sensitive:%s", - n.c_str(),v,s->IsA()->GetName(),v->IsA()->GetName(),(assembly ? "YES" : "NO"), - (det.isValid() ? "YES" : "NO")); + SensitiveDetector det = _v.sensitiveDetector(); + Geant4SensitiveDetector* sd = 0; if ( det.isValid() ) { sd = info.g4SensDets[det.ptr()]; if ( !sd ) { @@ -380,25 +374,10 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume "access Geant4 user limits."); } } + VisAttr vis = _v.visAttributes(); + G4VisAttributes* vis_attr = 0; if ( vis.isValid() ) { - vis_attr = (G4VisAttributes*)handleVis(vis.name(),vis.ptr()); - - - static bool runDaughterVisibilityWorkaround = true ; //FIXME ! - if( runDaughterVisibilityWorkaround ) { - - printout(WARNING,"Geant4Converter","******************* Workaround for issue with visualization attributes: " - "call vis_attr->SetDaughtersInvisible(false) for all volumes !!!!" ) ; - - vis_attr->SetDaughtersInvisible(false) ; - - } - printout(INFO,"Geant4Converter","************** (G4VisAttributes*)handleVis( %s , 0x%x ) = %d - daughters: %d ", vis.name() , - vis.ptr(), vis_attr->IsVisible() , !vis_attr->IsDaughtersInvisible() ) ; - - - } Region reg = _v.region(); G4Region* region = 0; @@ -410,6 +389,11 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume } } + printout(DEBUG,"Geant4Converter","++ Convert Volume %-32s: %p %s/%s assembly:%s sensitive:%s", + n.c_str(),v,s->IsA()->GetName(),v->IsA()->GetName(),(assembly ? "YES" : "NO"), + (det.isValid() ? "YES" : "NO")); + + if ( assembly ) { vol = (G4LogicalVolume*)new G4AssemblyVolume(); info.g4Volumes[v] = vol; @@ -433,12 +417,6 @@ void* Geant4Converter::handleVolume(const string& name, const TGeoVolume* volume } if ( vis_attr ) { vol->SetVisAttributes(vis_attr); - - std::stringstream ss ; - ss << *vis_attr ; - printout(INFO,"Geant4Converter","************** vol->SetVisAttributes(vis_attr) %s ", ss.str().c_str() ) ;// vis_attr->IsVisible() ) ; - - } if ( sd ) { printout(DEBUG,"Geant4Converter","++ Volume: + %s <> %s Solid:%s Mat:%s SD:%s", @@ -675,7 +653,7 @@ void* Geant4Converter::handleVis(const string& /* name */, const TNamed* vis) co attr.rgb(r,g,b); g4 = new G4VisAttributes(attr.visible(),G4Colour(r,g,b,attr.alpha())); //g4->SetLineWidth(attr->GetLineWidth()); - g4->SetDaughtersInvisible(attr.showDaughters()); + g4->SetDaughtersInvisible(!attr.showDaughters()); if ( style == VisAttr::SOLID ) { g4->SetLineStyle(G4VisAttributes::unbroken); g4->SetForceWireframe(false); diff --git a/doc/display.mac b/doc/display.mac index f11b75269..13d6d677c 100644 --- a/doc/display.mac +++ b/doc/display.mac @@ -3,4 +3,4 @@ /vis/scene/add/trajectories /vis/open OGLSX /vis/viewer/panTo 0 0 -/vis/viewer/zoom 5.0 + -- GitLab