diff --git a/DDCore/include/DD4hep/Detector.h b/DDCore/include/DD4hep/Detector.h index 271c2bdee30e42b4cc66c3c46657a8cbf861e84f..d943e930005f578f414a7f2a1ecf730c16f52ffc 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 930d48c2233d5acab40e8f1a6cbbf03547548e8d..9eee1dbb0d334337bf2618391d46c4b84c4681ee 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 48023dacc60d390e0ce60767b91f7036931342b6..9dca1d1863c02d6cabe068d07f39167e45f101c6 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 a148fad283d22dfc2e9164861d0772462c0ba526..8b3d74f07a646fd7b99d1867d75fd04119e68b93 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 acee92ff4cc84bb077dc3598e1838545a36cfe8c..3064cf71b915ebfdefd9961845f12879afd625c4 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 b2db5844284b5d55a49167b9dcbdf690ba239a41..7f2506c18ceba6ffac12002cce4b6cd428051b66 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 99a3ee1eeda17e46cc39d83a1e1d7b66db1fc170..33b83905954837ad5c9feeba3d3c75ef9efdc3a3 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 6b72b6f4125f7800f605f599b77c347e4b9e59b8..1824e6ed88865b76ce57286f2e1974f1c4a5cf8e 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 96f789940b9027535d67ade03f8f90937174a2ad..f3e863ecee3f940d55494c1adecc39ca08339da9 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 f3ad97ed4dc71bd84f2f3317a4e1ef553a524d88..9d03dca7c895c89c8e2b6ba828b7ff6dcc23ee01 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 1f13ebc098bd3588c4fe5f242bc0d3e103b01cbf..27a4762fdf36b6847b997c24f9e2b67d4bf6fff0 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 f11b752692517599243552d7263e362162b030f1..13d6d677c50b492d78973169d4062d37bf8255bc 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 +