diff --git a/DDCore/src/Evaluator/Evaluator.cpp b/DDCore/src/Evaluator/Evaluator.cpp index 20121036ef7656097d421dbfae37efcc36773532..14cd8b46d81158f0b36c3d3220835db04d3511eb 100644 --- a/DDCore/src/Evaluator/Evaluator.cpp +++ b/DDCore/src/Evaluator/Evaluator.cpp @@ -592,17 +592,17 @@ namespace XmlTools { //--------------------------------------------------------------------------- Evaluator::~Evaluator() { - Struct * s = (Struct *)(p); + Struct * s = reinterpret_cast<Struct*>(p); if (s->theExpression != 0) { delete[] s->theExpression; s->theExpression = 0; } - delete (Struct *)(p); + delete reinterpret_cast<Struct*>(p); } //--------------------------------------------------------------------------- double Evaluator::evaluate(const char * expression) { - Struct * s = (Struct *)(p); + Struct * s = reinterpret_cast<Struct*>(p); if (s->theExpression != 0) { delete[] s->theExpression; } s->theExpression = 0; s->thePosition = 0; @@ -622,18 +622,18 @@ namespace XmlTools { //--------------------------------------------------------------------------- int Evaluator::status() const { - return ((Struct *)(p))->theStatus; + return (reinterpret_cast<Struct*>(p))->theStatus; } //--------------------------------------------------------------------------- int Evaluator::error_position() const { - return ((Struct *)(p))->thePosition - ((Struct *)(p))->theExpression; + return (reinterpret_cast<Struct*>(p))->thePosition - (reinterpret_cast<Struct*>(p))->theExpression; } //--------------------------------------------------------------------------- void Evaluator::print_error() const { char prefix[] = "Evaluator : "; - Struct * s = (Struct *) p; + Struct * s = reinterpret_cast<Struct*>(p); switch (s->theStatus) { case ERROR_NOT_A_NAME: std::cerr << prefix << "invalid name" << std::endl; @@ -667,7 +667,7 @@ namespace XmlTools { //--------------------------------------------------------------------------- void Evaluator::setEnviron(const char* name, const char* value) { - Struct* s = (Struct *)p; + Struct* s = reinterpret_cast<Struct*>(p); string prefix = "${"; string item_name = prefix + string(name) + string("}"); dic_type::iterator iter = (s->theDictionary).find(item_name); @@ -691,7 +691,7 @@ namespace XmlTools { } //--------------------------------------------------------------------------- const char* Evaluator::getEnviron(const char* name) { - Struct* s = (Struct *)p; + Struct* s = reinterpret_cast<Struct*>(p); string item_name = name; //std::cout << " ++++++++++++++++++++++++++++ Try to resolve env:" << name << std::endl; dic_type::iterator iter = (s->theDictionary).find(item_name); @@ -714,40 +714,40 @@ namespace XmlTools { //--------------------------------------------------------------------------- void Evaluator::setVariable(const char * name, double value) - { setItem("", name, Item(value), (Struct *)p); } + { setItem("", name, Item(value), reinterpret_cast<Struct*>(p)); } void Evaluator::setVariable(const char * name, const char * expression) - { setItem("", name, Item(expression), (Struct *)p); } + { setItem("", name, Item(expression), reinterpret_cast<Struct*>(p)); } //--------------------------------------------------------------------------- void Evaluator::setFunction(const char * name,double (*fun)()) { FCN fcn(fun); - setItem("0", name, Item(fcn.ptr), (Struct *)p); + setItem("0", name, Item(fcn.ptr), reinterpret_cast<Struct*>(p)); } void Evaluator::setFunction(const char * name,double (*fun)(double)) { FCN fcn(fun); - setItem("1", name, Item(fcn.ptr), (Struct *)p); + setItem("1", name, Item(fcn.ptr), reinterpret_cast<Struct*>(p)); } void Evaluator::setFunction(const char * name, double (*fun)(double,double)) { FCN fcn(fun); - setItem("2", name, Item(fcn.ptr), (Struct *)p); + setItem("2", name, Item(fcn.ptr), reinterpret_cast<Struct*>(p)); } void Evaluator::setFunction(const char * name, double (*fun)(double,double,double)) { FCN fcn(fun); - setItem("3", name, Item(fcn.ptr), (Struct *)p); + setItem("3", name, Item(fcn.ptr), reinterpret_cast<Struct*>(p)); } void Evaluator::setFunction(const char * name, double (*fun)(double,double,double,double)) { FCN fcn(fun); - setItem("4", name, Item(fcn.ptr), (Struct *)p); + setItem("4", name, Item(fcn.ptr), reinterpret_cast<Struct*>(p)); } void Evaluator::setFunction(const char * name, double (*fun)(double,double,double,double,double)) { FCN fcn(fun); - setItem("5", name, Item(fcn.ptr), (Struct *)p); + setItem("5", name, Item(fcn.ptr), reinterpret_cast<Struct*>(p)); } //--------------------------------------------------------------------------- @@ -755,7 +755,7 @@ namespace XmlTools { if (name == 0 || *name == '\0') return false; const char * pointer; int n; REMOVE_BLANKS; if (n == 0) return false; - Struct * s = (Struct *)(p); + Struct * s = reinterpret_cast<Struct*>(p); return ((s->theDictionary).find(string(pointer,n)) == (s->theDictionary).end()) ? false : true; @@ -767,7 +767,7 @@ namespace XmlTools { if (npar < 0 || npar > MAX_N_PAR) return false; const char * pointer; int n; REMOVE_BLANKS; if (n == 0) return false; - Struct * s = (Struct *)(p); + Struct * s = reinterpret_cast<Struct*>(p); return ((s->theDictionary).find(sss[npar]+string(pointer,n)) == (s->theDictionary).end()) ? false : true; } @@ -777,7 +777,7 @@ namespace XmlTools { if (name == 0 || *name == '\0') return; const char * pointer; int n; REMOVE_BLANKS; if (n == 0) return; - Struct * s = (Struct *)(p); + Struct * s = reinterpret_cast<Struct*>(p); (s->theDictionary).erase(string(pointer,n)); } @@ -787,13 +787,13 @@ namespace XmlTools { if (npar < 0 || npar > MAX_N_PAR) return; const char * pointer; int n; REMOVE_BLANKS; if (n == 0) return; - Struct * s = (Struct *)(p); + Struct * s = reinterpret_cast<Struct*>(p); (s->theDictionary).erase(sss[npar]+string(pointer,n)); } //--------------------------------------------------------------------------- void Evaluator::clear() { - Struct * s = (Struct *) p; + Struct * s = reinterpret_cast<Struct*>(p); s->theDictionary.clear(); s->theExpression = 0; s->thePosition = 0; diff --git a/DDEve/src/GenericEventHandler.cpp b/DDEve/src/GenericEventHandler.cpp index acd63390e73e355c77a8660289cb40aab39913a9..1e4b2a59cfbf912fc021197f7dd58f22915a179a 100644 --- a/DDEve/src/GenericEventHandler.cpp +++ b/DDEve/src/GenericEventHandler.cpp @@ -69,12 +69,12 @@ long GenericEventHandler::numEvents() const { } /// Access the data source name -std::string GenericEventHandler::datasourceName() const { +string GenericEventHandler::datasourceName() const { return current()->datasourceName(); } /// Access to the collection type by name -EventHandler::CollectionType GenericEventHandler::collectionType(const std::string& collection) const { +EventHandler::CollectionType GenericEventHandler::collectionType(const string& collection) const { if ( m_current && m_current->hasEvent() ) { return m_current->collectionType(collection); } @@ -82,7 +82,7 @@ EventHandler::CollectionType GenericEventHandler::collectionType(const std::stri } /// Loop over collection and extract data -size_t GenericEventHandler::collectionLoop(const std::string& collection, DDEveHitActor& actor) { +size_t GenericEventHandler::collectionLoop(const string& collection, DDEveHitActor& actor) { if ( m_current && m_current->hasEvent() ) { return m_current->collectionLoop(collection,actor); } @@ -90,7 +90,7 @@ size_t GenericEventHandler::collectionLoop(const std::string& collection, DDEveH } /// Loop over collection and extract particle data -size_t GenericEventHandler::collectionLoop(const std::string& collection, DDEveParticleActor& actor) { +size_t GenericEventHandler::collectionLoop(const string& collection, DDEveParticleActor& actor) { if ( m_current && m_current->hasEvent() ) { return m_current->collectionLoop(collection,actor); } @@ -100,6 +100,7 @@ size_t GenericEventHandler::collectionLoop(const std::string& collection, DDEveP /// Open a new event data file bool GenericEventHandler::Open(const string& file_type, const string& file_name) { size_t idx = file_name.find("lcio"); + size_t idr = file_name.find("root"); string err; m_hasFile = false; m_hasEvent = false; @@ -108,9 +109,12 @@ bool GenericEventHandler::Open(const string& file_type, const string& file_name) if ( idx != string::npos ) { m_current = (EventHandler*)PluginService::Create<void*>("DDEve_LCIOEventHandler",(const char*)0); } - else if ( (idx=file_name.find("root")) != string::npos ) { + else if ( idr != string::npos ) { m_current = (EventHandler*)PluginService::Create<void*>("DDEve_DDG4EventHandler",(const char*)0); } + else { + throw runtime_error("Attempt to open file:"+file_name+" of unknown type:"+file_type); + } if ( m_current ) { if ( m_current->Open(file_type, file_name) ) { m_hasFile = true; @@ -124,7 +128,7 @@ bool GenericEventHandler::Open(const string& file_type, const string& file_name) err = "+++ Failed to create fikle reader for file '"+file_name+"' of type '"+file_type+"'"; } } - catch(const std::exception& e) { + catch(const exception& e) { err = "\nAn exception occurred \n" "while opening event data:\n" + string(e.what()) + "\n\n"; } @@ -148,7 +152,7 @@ bool GenericEventHandler::NextEvent() { } throw runtime_error("+++ EventHandler::readEvent: No file open!"); } - catch(const std::exception& e) { + catch(const exception& e) { string path = TString::Format("%s/icons/stop_t.xpm", gSystem->Getenv("ROOTSYS")).Data(); string err = "\nAn exception occurred \n" "while reading a new event:\n" + string(e.what()) + "\n\n"; diff --git a/DDG4/examples/initAClick.C b/DDG4/examples/initAClick.C index d88fdf01a27ab007f521cb15507622a3a2bfca80..ed7dde7e3408284c43ca00133b5e944b1da14acd 100644 --- a/DDG4/examples/initAClick.C +++ b/DDG4/examples/initAClick.C @@ -21,14 +21,12 @@ #include <iostream> #include <string> -using namespace std; - -string make_str(const char* data) { +std::string make_str(const char* data) { if ( !data ) { - cout << "make_str: '" << (data ? data : "Bad-Pointer") << "'" << endl; - return string(""); + std::cout << "make_str: '" << (data ? data : "Bad-Pointer") << "'" << std::endl; + return std::string(""); } - return string(data); + return std::string(data); } /// Process a single command in the ROOT interpreter @@ -51,8 +49,7 @@ int processCommand(const char* command, bool end_process) { /// Process a ROOT AClick given a file int processMacro(const char* macro, bool end_process) { - int status; - string cmd = ".X "; + std::string cmd = ".X "; cmd += macro; cmd += ".C+()"; return processCommand(cmd.c_str(), end_process); @@ -60,11 +57,11 @@ int processMacro(const char* macro, bool end_process) { /// Initialize the ROOT environment to compile and execute a ROOT AClick int initAClick(const char* command=0) { - string rootsys = make_str(gSystem->Getenv("ROOTSYS")); - string g4_base = make_str(gSystem->Getenv("G4INSTALL")); - string dd4hep = make_str(gSystem->Getenv("DD4hepINSTALL")); - string libs = (" -L"+rootsys+"/lib"); - string inc = " -I"+dd4hep+"/examples/DDG4/examples" + + std::string rootsys = make_str(gSystem->Getenv("ROOTSYS")); + std::string g4_base = make_str(gSystem->Getenv("G4INSTALL")); + std::string dd4hep = make_str(gSystem->Getenv("DD4hepINSTALL")); + std::string libs = (" -L"+rootsys+"/lib"); + std::string inc = " -I"+dd4hep+"/examples/DDG4/examples" + " -I"+dd4hep + " -I"+dd4hep+"/include" + " -I"+g4_base+"/include/Geant4" + @@ -78,8 +75,8 @@ int initAClick(const char* command=0) { libs += (" -L"+g4_base+"/lib -L"+g4_base+"/lib64 -lG4event -lG4tracking -lG4particles"); gSystem->AddIncludePath(inc.c_str()); gSystem->AddLinkedLibs(libs.c_str()); - cout << "+++ Includes: " << gSystem->GetIncludePath() << endl; - cout << "+++ Linked libs:" << gSystem->GetLinkedLibs() << endl; + std::cout << "+++ Includes: " << gSystem->GetIncludePath() << std::endl; + std::cout << "+++ Linked libs:" << gSystem->GetLinkedLibs() << std::endl; int ret = gSystem->Load("libDDG4Plugins"); if ( 0 == ret ) { if ( command ) { diff --git a/DDG4/plugins/Geant4TrackerWeightedSD.cpp b/DDG4/plugins/Geant4TrackerWeightedSD.cpp index d965d06900c8a5f3eed3b35f020ebedbedeabd35..9f2f70e126fdf222b67cc194e8858a3ff37e75d2 100644 --- a/DDG4/plugins/Geant4TrackerWeightedSD.cpp +++ b/DDG4/plugins/Geant4TrackerWeightedSD.cpp @@ -209,13 +209,13 @@ namespace DD4hep { pre.truth.trackID,int(collection->GetSize()), combined,pre.truth.deposit/CLHEP::keV, pos.X()/CLHEP::mm,pos.Y()/CLHEP::mm,pos.Z()/CLHEP::mm, - hit_flag&Geant4Tracker::Hit::HIT_STARTED_SURFACE ? "SURFACE" : "", - hit_flag&Geant4Tracker::Hit::HIT_STARTED_OUTSIDE ? "OUTSIDE" : "", - hit_flag&Geant4Tracker::Hit::HIT_STARTED_INSIDE ? "INSIDE " : "", + (hit_flag&Geant4Tracker::Hit::HIT_STARTED_SURFACE ? "SURFACE" : ""), + (hit_flag&Geant4Tracker::Hit::HIT_STARTED_OUTSIDE ? "OUTSIDE" : ""), + (hit_flag&Geant4Tracker::Hit::HIT_STARTED_INSIDE ? "INSIDE " : ""), dist_in, - hit_flag&Geant4Tracker::Hit::HIT_ENDED_SURFACE ? "SURFACE" : "", - hit_flag&Geant4Tracker::Hit::HIT_ENDED_OUTSIDE ? "OUTSIDE" : "", - hit_flag&Geant4Tracker::Hit::HIT_ENDED_INSIDE ? "INSIDE " : "", + (hit_flag&Geant4Tracker::Hit::HIT_ENDED_SURFACE ? "SURFACE" : ""), + (hit_flag&Geant4Tracker::Hit::HIT_ENDED_OUTSIDE ? "OUTSIDE" : ""), + (hit_flag&Geant4Tracker::Hit::HIT_ENDED_INSIDE ? "INSIDE " : ""), dist_out); collection->add(hit); } diff --git a/DDG4/src/Geant4ParticleHandler.cpp b/DDG4/src/Geant4ParticleHandler.cpp index d15bca5dbc5808b8576ea5afe1081ea207e4e7a9..5650d0793a976c7abe2a5653eac4096140972318 100644 --- a/DDG4/src/Geant4ParticleHandler.cpp +++ b/DDG4/src/Geant4ParticleHandler.cpp @@ -521,8 +521,6 @@ int Geant4ParticleHandler::recombineParents() { for(ParticleMap::reverse_iterator i=m_particleMap.rbegin(); i!=m_particleMap.rend(); ++i) { Particle* p = (*i).second; PropertyMask mask(p->reason); - bool remove_me = false; - // Allow the user to force the particle handling either by // or the reason mask with G4PARTICLE_KEEP_USER or // to set the reason mask to NULL in order to drop it. @@ -531,7 +529,7 @@ int Geant4ParticleHandler::recombineParents() { // or is set to NULL, the particle is ALWAYS removed // // Note: This may override all other decisions! - remove_me = m_userHandler ? m_userHandler->keepParticle(*p) : defaultKeepParticle(*p); + bool remove_me = m_userHandler ? m_userHandler->keepParticle(*p) : defaultKeepParticle(*p); // Now look at the property mask of the particle if ( mask.isNull() || mask.isSet(G4PARTICLE_FORCE_KILL) ) { diff --git a/doc/gdml_root.C b/doc/gdml_root.C index 81340439ec266234d2f15af1f74d2aa25d318c01..4c0524df93628aeb32ef341741fd44003e7bd1f4 100644 --- a/doc/gdml_root.C +++ b/doc/gdml_root.C @@ -51,7 +51,7 @@ TGeoVolume* gdml_root(const char* sys_name) { if ( !in.good() ) cout << "++ Failed to open visualization file:" << vis_file - << " :: " << strerror(errno) << endl; + << " :: " << strerror(errno) << endl; else cout << "++ Processing visualization file:" << vis_file << endl; @@ -70,85 +70,85 @@ TGeoVolume* gdml_root(const char* sys_name) { debug << line << " "; switch(count) { case 0: - vol_name = line+::strlen("vol:"); - break; + vol_name = line+::strlen("vol:"); + break; case 1: - break; + break; case 2: - line += ::strlen("visible:"); - visible = *line=='1'; - break; + line += ::strlen("visible:"); + visible = *line=='1'; + break; case 3: - line += ::strlen("r:"); - red = atof(line); - break; + line += ::strlen("r:"); + red = atof(line); + break; case 4: - line += ::strlen("g:"); - green = atof(line); - break; + line += ::strlen("g:"); + green = atof(line); + break; case 5: - line += ::strlen("b:"); - blue = atof(line); - break; + line += ::strlen("b:"); + blue = atof(line); + break; case 6: - line += ::strlen("alpha:"); - //alpha = atof(line); - break; + line += ::strlen("alpha:"); + //alpha = atof(line); + break; case 7: - line_style = line+::strlen("line_style:"); - break; + line_style = line+::strlen("line_style:"); + break; case 8: - drawing_style = line+::strlen("drawing_style:"); - break; + drawing_style = line+::strlen("drawing_style:"); + break; case 9: - line += ::strlen("show_daughters:"); - show_daughters = *line=='1'; - break; + line += ::strlen("show_daughters:"); + show_daughters = *line=='1'; + break; default: - break; + break; } } if ( debug_processing ) cout << debug.str() << endl; debug.str(""); - TGeoVolume* volume = 0; if ( vol_name && ::strlen(vol_name) ) { + TGeoVolume* volume = 0; for(int i=0;i<num_volumes;++i) { - TGeoVolume* v=(TGeoVolume*)vols->At(i); - if ( 0 == ::strcmp(vol_name,v->GetName()) ) { - volume = v; - break; - } + TGeoVolume* v=(TGeoVolume*)vols->At(i); + if ( 0 == ::strcmp(vol_name,v->GetName()) ) { + volume = v; + break; + } } if ( volume ) { - int color = TColor::GetColor(red,green,blue); - Color_t bright = TColor::GetColorBright(color); - Color_t dark = TColor::GetColorDark(color); - debug << "+ \tr:" << red << " g:" << green << " b:" << blue << " col:" << color - << " line_style:" << line_style << " drawing_style:" << drawing_style - << " visible:" << visible << " show_daughters:" << show_daughters; - volume->SetLineColor(dark); - if ( drawing_style == "solid" ) { - volume->SetFillColor(bright); - volume->SetFillStyle(1001); // Root: solid - } - else { - //volume->SetFillColor(bright); - volume->SetFillColor(0); - volume->SetFillStyle(0); // Root: hollow - } - if ( line_style == "unbroken" ) - volume->SetFillStyle(1); - else - volume->SetFillStyle(2); + int color = TColor::GetColor(red,green,blue); + Color_t bright = TColor::GetColorBright(color); + Color_t dark = TColor::GetColorDark(color); + debug << "+ \tr:" << red << " g:" << green << " b:" << blue << " col:" << color + << " line_style:" << line_style << " drawing_style:" << drawing_style + << " visible:" << visible << " show_daughters:" << show_daughters; + volume->SetLineColor(dark); + if ( drawing_style == "solid" ) { + volume->SetFillColor(bright); + volume->SetFillStyle(1001); // Root: solid + } + else { + //volume->SetFillColor(bright); + volume->SetFillColor(0); + volume->SetFillStyle(0); // Root: hollow + } + if ( line_style == "unbroken" ) + volume->SetFillStyle(1); + else + volume->SetFillStyle(2); - volume->SetLineWidth(10); - volume->SetVisibility(visible ? kTRUE : kFALSE); - volume->SetAttBit(TGeoAtt::kVisContainers,kTRUE); - volume->SetVisDaughters(show_daughters ? kTRUE : kFALSE); + volume->SetLineWidth(10); + volume->SetVisibility(visible ? kTRUE : kFALSE); + volume->SetAttBit(TGeoAtt::kVisContainers,kTRUE); + volume->SetVisDaughters(show_daughters ? kTRUE : kFALSE); } else { - cout << endl << "++ Failed to find volume with name:" << vol_name; + cout << endl << "++ Failed to find volume with name:" << vol_name; } } if ( debug_processing ) cout << debug.str() << endl; diff --git a/examples/CLICSiD/scripts/CLICSiDAClick.C b/examples/CLICSiD/scripts/CLICSiDAClick.C index 9506748ecc063b2a290728b72ebd93e842e760aa..830687ece4041699c2ba3943a323fb9b4e9ebb6a 100644 --- a/examples/CLICSiD/scripts/CLICSiDAClick.C +++ b/examples/CLICSiD/scripts/CLICSiDAClick.C @@ -44,7 +44,6 @@ SensitiveSeq::handled_type* setupDetector(Geant4Kernel& kernel, const std::strin int setupG4_CINT(bool interactive) { Geant4Kernel& kernel = Geant4Kernel::instance(Geometry::LCDD::getInstance()); string install_dir = getenv("DD4hepINSTALL"); - string ddg4_examples = install_dir+"/examples/DDG4/examples"; Phase p; kernel.loadGeometry(("file:"+install_dir+"/examples/CLICSiD/compact/compact.xml").c_str()); diff --git a/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp b/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp index 77b441b5cc57cbb32367d2eff67125f5d77830a9..49dd3747ab3d28c3ab5e3bc20928b1bdc4d7db15 100644 --- a/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp +++ b/examples/ClientTests/src/LheD_tracker_SiVertexBarrel_geo.cpp @@ -18,10 +18,9 @@ using namespace DD4hep::Geometry; function to calculate path in a given theta **************************************************************/ static double computeDpt( double ra, double rb, double theta ) { - double dp = 0.0; double dpt_sin = std::pow(ra * std::sin(theta), 2.0); double dpt_cos = std::pow(rb * std::cos(theta), 2.0); - dp = std::sqrt(dpt_sin + dpt_cos); + double dp = std::sqrt(dpt_sin + dpt_cos); return dp; } @@ -153,14 +152,12 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { double deltaTheta = 0.0001; double numIntegrals = (thetaMax-thetaMin) / deltaTheta; double cell = 0.; - double dpt = 0.; // integrate over the elipse to get the circumference for( int i=0; i < numIntegrals; i++ ) { if (i==0) theta = thetaMin; else theta += deltaTheta; - dpt = computeDpt( a, b, theta); - cell += dpt; + cell += computeDpt( a, b, theta); } // number of modules along semi-ellipse path diff --git a/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp b/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp index 11a7d2d1ecb79f0457760d5289328ba64854abab..7a19c864a54f90dd3231ce13d5d936dbdcecc303 100644 --- a/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp +++ b/examples/ClientTests/src/SectorBarrelCalorimeter_geo.cpp @@ -51,12 +51,8 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { //xml_comp_t staves = x_det.staves(); xml_dim_t dim = x_det.dimensions(); string det_name = x_det.nameStr(); - string det_type = x_det.typeStr(); Material air = lcdd.air(); double totalThickness = layering.totalThickness(); - int totalRepeat = 0; - int totalSlices = 0; - //double gap = xml_dim_t(x_det).gap(); int numSides = dim.numsides(); double detZ = dim.z(); double rmin = dim.rmin(); @@ -64,23 +60,9 @@ static Ref_t create_detector(LCDD& lcdd, xml_h e, SensitiveDetector sens) { DetElement sdet(det_name,x_det.id()); DetElement stave("stave1",x_det.id()); Volume motherVol = lcdd.pickMotherVolume(sdet); - - for(xml_coll_t c(x_det,_U(layer)); c; ++c) { - xml_comp_t x_layer = c; - int repeat = x_layer.repeat(); - totalRepeat += repeat; - totalSlices += x_layer.numChildren(_U(slice)); - } - -// PolyhedraRegular polyhedra(numSides,rmin,rmin+totalThickness,detZ); -// Volume envelopeVol(det_name+"_envelope",polyhedra,air); -// Assembly envelopeVol(det_name+"_envelope"); - PolyhedraRegular polyhedron(numSides,0.,rmin,detZ+10); Tube tube(0.,rmin+totalThickness,detZ/2,0,2*M_PI); - - SubtractionSolid sub(tube,polyhedron); - + SubtractionSolid sub(tube,polyhedron); Volume envelopeVol(det_name+"_envelope",sub,air); // Add the subdetector envelope to the structure.