diff --git a/compact/display.xml b/compact/display.xml index 0459edc03..d08ad4fb8 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -62,10 +62,10 @@ Luminosity Visualisation - - - - + + + + diff --git a/compact/far_backward/definitions.xml b/compact/far_backward/definitions.xml index a46386324..c79112199 100644 --- a/compact/far_backward/definitions.xml +++ b/compact/far_backward/definitions.xml @@ -283,9 +283,9 @@ Rotation of modules wrt XY axis after construction. - - - + + + @@ -293,7 +293,7 @@ - + diff --git a/compact/far_backward/lumi/spec_ScFi_cal.xml b/compact/far_backward/lumi/spec_ScFi_cal.xml index aa79cb4b2..2219559c2 100644 --- a/compact/far_backward/lumi/spec_ScFi_cal.xml +++ b/compact/far_backward/lumi/spec_ScFi_cal.xml @@ -6,21 +6,21 @@ - + - + - - - + + - + diff --git a/src/EcalLumiSpecWScFi_geo.cpp b/src/EcalLumiSpecWScFi_geo.cpp index 2b29a792f..d0d6ae7a9 100644 --- a/src/EcalLumiSpecWScFi_geo.cpp +++ b/src/EcalLumiSpecWScFi_geo.cpp @@ -44,7 +44,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s double detSizeZ = getAttrOrDefault(x_det, _Unicode(sizeZ), 180 * mm); int nmod_perlayer = getAttrOrDefault(x_det, _Unicode(nmod_perlayer), 3); int nlayer = getAttrOrDefault(x_det, _Unicode(nlayer), 20); - + // Global detector position and resolution xml_comp_t pos = x_det.position(); xml_comp_t rot = x_det.rotation(); @@ -54,16 +54,16 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s //layer definition before rotation xml_comp_t x_layer = x_det.child(_Unicode(layer)); - - double laySizeX = getAttrOrDefault(x_layer, _Unicode(sizeX), 1.0*cm); - double laySizeY = getAttrOrDefault(x_layer, _Unicode(sizeY), 1.0*cm); - double laySizeZ = getAttrOrDefault(x_layer, _Unicode(sizeZ), 1.0*cm); - double layerCoatSizeX = getAttrOrDefault(x_layer, _Unicode(coatSizeX), 1.0*cm); - double layerCoatSizeY = getAttrOrDefault(x_layer, _Unicode(coatSizeY), 1.0*cm); - - Material layMat = description.material(x_layer.attr(_Unicode(material))); - - Box layerBox(laySizeX/2.0, laySizeY/2.0, laySizeZ/2.0); + + double laySizeX = getAttrOrDefault(x_layer, _Unicode(sizeX), 1.0 * cm); + double laySizeY = getAttrOrDefault(x_layer, _Unicode(sizeY), 1.0 * cm); + double laySizeZ = getAttrOrDefault(x_layer, _Unicode(sizeZ), 1.0 * cm); + double layerCoatSizeX = getAttrOrDefault(x_layer, _Unicode(coatSizeX), 1.0 * cm); + double layerCoatSizeY = getAttrOrDefault(x_layer, _Unicode(coatSizeY), 1.0 * cm); + + Material layMat = description.material(x_layer.attr(_Unicode(material))); + + Box layerBox(laySizeX / 2.0, laySizeY / 2.0, laySizeZ / 2.0); Volume layerVol("layer", layerBox, layMat); layerVol.setVisAttributes(description.visAttributes(x_det.attr(_Unicode(vis)))); @@ -91,19 +91,19 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s //Fill sector with layers (coated) for (int layer_id = 0; layer_id < nlayer; layer_id++) { - double lay_pos_z = -layer_id*(modSize.y() + 2.0*layerCoatSizeY) - layer_pos0; + double lay_pos_z = -layer_id * (modSize.y() + 2.0 * layerCoatSizeY) - layer_pos0; double lay_pos_y = 0.0 * cm; double lay_pos_x = 0.0 * cm; int orientation = layer_id % 2 == 0; - + //rotation RotationZYX lay_rot = RotationZYX(0, 0, -90.0 * degree); if (orientation) - lay_rot *= RotationY(-90.0 * degree); + lay_rot *= RotationY(-90.0 * degree); PlacedVolume layPV = sectorVol.placeVolume( layerVol, Transform3D(lay_rot, Position(lay_pos_x, lay_pos_y, lay_pos_z))); - layPV.addPhysVolID("layer", layer_id); + layPV.addPhysVolID("layer", layer_id); } //layer_id-loop close // loop over sectors(top, bottom) @@ -147,78 +147,81 @@ static tuple build_specScFiCAL_module(const Detector& descript Volume modVol("module_vol", modShape, modMat); modVol.setVisAttributes(description.visAttributes(mod_x.attr(_Unicode(vis)))); - + //--------------------------Block of fibers in a module------------------------------------------------------ - + //block fibers auto fiber_block = mod_x.child(_Unicode(block)); - auto fb_sx = fiber_block.attr(_Unicode(sizeX)); - auto fb_sy = fiber_block.attr(_Unicode(sizeY)); - auto fb_sz = fiber_block.attr(_Unicode(sizeZ)); + auto fb_sx = fiber_block.attr(_Unicode(sizeX)); + auto fb_sy = fiber_block.attr(_Unicode(sizeY)); + auto fb_sz = fiber_block.attr(_Unicode(sizeZ)); auto fb_SpaceXY = fiber_block.attr(_Unicode(SpaceXY)); Position fbSize(fb_sx, fb_sy, fb_sz); - //fibers + //fibers auto fiber_tube = mod_x.child(_Unicode(fiber)); - - auto fr = fiber_tube.attr(_Unicode(radius)); - auto fsx = fiber_tube.attr(_Unicode(spacex)); - auto fsy = fiber_tube.attr(_Unicode(spacey)); + + auto fr = fiber_tube.attr(_Unicode(radius)); + auto fsx = fiber_tube.attr(_Unicode(spacex)); + auto fsy = fiber_tube.attr(_Unicode(spacey)); //fiber block description and placement in module - Box fbShape(fbSize.x()/2.0, fbSize.y()/2.0, fbSize.z()/2.0); + Box fbShape(fbSize.x() / 2.0, fbSize.y() / 2.0, fbSize.z() / 2.0); Volume fbVol("fiberblock_volume", fbShape, modMat); - fbVol.setVisAttributes(description.visAttributes(mod_x.attr(_Unicode(vis)))); //same as module - - int num_fbX = int(modSize.x() / (fbSize.x() + 2.0*fb_SpaceXY) ); - int num_fbY = int(modSize.y() / (fbSize.y() + 2.0*fb_SpaceXY) ); + fbVol.setVisAttributes( + description.visAttributes(mod_x.attr(_Unicode(vis)))); //same as module + + int num_fbX = int(modSize.x() / (fbSize.x() + 2.0 * fb_SpaceXY)); + int num_fbY = int(modSize.y() / (fbSize.y() + 2.0 * fb_SpaceXY)); - double fb_xpos0 = -(modSize.x()/2.0) + (fbSize.x()/2.0) + fb_SpaceXY; - double fb_ypos0 = -(modSize.y()/2.0) + (fbSize.y()/2.0) + fb_SpaceXY; - int nblock = 0; + double fb_xpos0 = -(modSize.x() / 2.0) + (fbSize.x() / 2.0) + fb_SpaceXY; + double fb_ypos0 = -(modSize.y() / 2.0) + (fbSize.y() / 2.0) + fb_SpaceXY; + int nblock = 0; - for(int iy =0; iy(_Unicode(material))); + auto fiberMat = description.material(fiber_tube.attr(_Unicode(material))); Tube fiberShape(0., fr, fbSize.z() / 2.0); Volume fiberVol("fiber_vol", fiberShape, fiberMat); fiberVol.setVisAttributes(description.visAttributes(fiber_tube.attr(_Unicode(vis)))); fiberVol.setSensitiveDetector(sens); - int num_fX = int(fbSize.x() /(2 *fr + 2.0 *fsx)); - int num_fY = int(fbSize.y() /(2 *fr + 2.0 *fsy)); + int num_fX = int(fbSize.x() / (2 * fr + 2.0 * fsx)); + int num_fY = int(fbSize.y() / (2 * fr + 2.0 * fsy)); - double fiber_xpos0 = -(fbSize.x()/2.0) + fr + fsx; - double fiber_ypos0 = -(fbSize.y()/2.0) + fr + fsy; - int nfibers = 0; + double fiber_xpos0 = -(fbSize.x() / 2.0) + fr + fsx; + double fiber_ypos0 = -(fbSize.y() / 2.0) + fr + fsy; + int nfibers = 0; //Fiber Holder auto fiberholder_x = mod_x.child(_Unicode(fiberholder)); - double fh_dz = 0.6 *mm; //thickness of fiber holder + double fh_dz = 0.4 * mm; //thickness of fiber holder - double fh_outerbox_y = 2.0*fr + 2.0*fsy; - double fh_outerbox_x = 2.0*fr + 2.0*fsx; - Box fh_outerbox(fh_outerbox_x/2.0, fh_outerbox_y/2.0, fh_dz/2.0); + double fh_outerbox_y = 2.0 * fr + 2.0 * fsy; + double fh_outerbox_x = 2.0 * fr + 2.0 * fsx; + Box fh_outerbox(fh_outerbox_x / 2.0, fh_outerbox_y / 2.0, fh_dz / 2.0); - double fh_innerbox_y = 2.0*fr; - double fh_innerbox_x = 2.0*fr; - Box fh_innerbox(fh_innerbox_x/2.0, fh_innerbox_y/2.0, fh_dz/2.0); + double fh_innerbox_y = 2.0 * fr; + double fh_innerbox_x = 2.0 * fr; + Box fh_innerbox(fh_innerbox_x / 2.0, fh_innerbox_y / 2.0, fh_dz / 2.0); SubtractionSolid fiberholder_solid(fh_outerbox, fh_innerbox, Position(0.0, 0.0, 0.0)); auto fiberholderMat = description.material(fiberholder_x.attr(_Unicode(material))); Volume fiberholderVol("fiberholder_vol", fiberholder_solid, fiberholderMat); - fiberholderVol.setVisAttributes( description.visAttributes(fiberholder_x.attr(_Unicode(vis))) ); + fiberholderVol.setVisAttributes( + description.visAttributes(fiberholder_x.attr(_Unicode(vis)))); int nfh = 0; @@ -226,13 +229,13 @@ static tuple build_specScFiCAL_module(const Detector& descript for (int iy = 0; iy < num_fY; iy++) { for (int ix = 0; ix < num_fX; ix++) { - double fiber_pos_x = fiber_xpos0 + ix*(2.0*fr + 2.0*fsx); //mm - double fiber_pos_y = fiber_ypos0 + iy*(2.0*fr + 2.0*fsy); //mm - double fiber_pos_z = 0*mm; //mm + double fiber_pos_x = fiber_xpos0 + ix * (2.0 * fr + 2.0 * fsx); //mm + double fiber_pos_y = fiber_ypos0 + iy * (2.0 * fr + 2.0 * fsy); //mm + double fiber_pos_z = 0 * mm; //mm //placement of fiber - auto fiberPV = fbVol.placeVolume(fiberVol, nfibers++, - Position{fiber_pos_x, fiber_pos_y, fiber_pos_z}); + auto fiberPV = + fbVol.placeVolume(fiberVol, nfibers++, Position{fiber_pos_x, fiber_pos_y, fiber_pos_z}); fiberPV.addPhysVolID("fiber_x", ix + 1).addPhysVolID("fiber_y", iy + 1); //placement of fiber holder 6.6*cm apart c-to-c