diff --git a/geometries/CMS_Phase2/OT806_IT741.cfg b/geometries/CMS_Phase2/OT806_IT741.cfg new file mode 100644 index 00000000..cf9d7540 --- /dev/null +++ b/geometries/CMS_Phase2/OT806_IT741.cfg @@ -0,0 +1,3 @@ +@include-std CMS_Phase2/SimParms +@include OuterTracker/Tilted/OT_V806.cfg +@include Pixel/Pixel_V7/Pixel_V7_4_1.cfg diff --git a/geometries/CMS_Phase2/OT806_IT742.cfg b/geometries/CMS_Phase2/OT806_IT742.cfg new file mode 100644 index 00000000..454229f2 --- /dev/null +++ b/geometries/CMS_Phase2/OT806_IT742.cfg @@ -0,0 +1,3 @@ +@include-std CMS_Phase2/SimParms +@include OuterTracker/Tilted/OT_V806.cfg +@include Pixel/Pixel_V7/Pixel_V7_4_2.cfg diff --git a/geometries/CMS_Phase2/OT806_IT743.cfg b/geometries/CMS_Phase2/OT806_IT743.cfg new file mode 100644 index 00000000..68e8162e --- /dev/null +++ b/geometries/CMS_Phase2/OT806_IT743.cfg @@ -0,0 +1,3 @@ +@include-std CMS_Phase2/SimParms +@include OuterTracker/Tilted/OT_V806.cfg +@include Pixel/Pixel_V7/Pixel_V7_4_3.cfg diff --git a/geometries/CMS_Phase2/Pixel/Pixel_V7/BPIX_7_4_2.cfg b/geometries/CMS_Phase2/Pixel/Pixel_V7/BPIX_7_4_2.cfg new file mode 100644 index 00000000..1b2c01f9 --- /dev/null +++ b/geometries/CMS_Phase2/Pixel/Pixel_V7/BPIX_7_4_2.cfg @@ -0,0 +1,79 @@ +Barrel PXB { // 7_4_2 implementing variable z gaps + trackingTags pixel,tracker + + @include-std CMS_Phase2/Pixel/Materials/MechanicalSupports/TBPX_Supports.cfg + @include-std CMS_Phase2/Pixel/Conversions/On_flange/flange_BPIX + @include-std CMS_Phase2/Pixel/Conversions/On_services_cylinder/stations_serving_TBPX_614 + + beamSpotCover false + smallDelta 0 + numLayers 4 + startZMode modulecenter + numModules 5 // 4 on the right and 4 on the left and a central one + compressed false + innerRadius 30 + outerRadius 146.5 + + smallParity 1 + bigParity 1 + + + isSkewedForInstallation true // Skewed mode. + skewedModuleEdgeShift 5 // Shift of the edge of each skewed module. + installationOverlapRatio 2 // Ratio between the angular overlap around the (X=0) plane and the angular overlap between 2 standard consecutive rods. + + Layer 1 { + bigDelta 2.5 + zOverlap -0.75 // 0.75 mm space between active areas: 0.175 mm dead area on each sensor side + 0.4 mm gap + // zOverlap -2.15 // 0.75 mm space between active areas: 0.175 mm dead area on each sensor side + 0.4 + 2*0.7 mm gap + zGap 0.7 + zCentral -21.125 + @include-std CMS_Phase2/Pixel/ModuleTypes/pixel_1x2_25x100_wide_2sens_3D + @include-std CMS_Phase2/Pixel/Materials/module_BPIX_L1_1x2_2500_3D + @include-std CMS_Phase2/Pixel/Materials/rod_BPIX_L1 + @include-std CMS_Phase2/Pixel/Resolutions/25x100 + destination BPIX1 + numRods 12 + } + //modZList -178.30,-133.90,-89.50,-45.10,0.7,45.10,89.50,133.90,178.30 + Layer 2 { + bigDelta 2.5 + zOverlap -1.3 // 1.3 mm space between active areas: 0.45 mm dead area on each sensor side + 0.4 mm gap + zGap 0.7 + zCentral -22.425 + @include-std CMS_Phase2/Pixel/ModuleTypes/pixel_1x2_25x100_v202305 + @include-std CMS_Phase2/Pixel/Materials/module_BPIX_L2_1x2_2500 + @include-std CMS_Phase2/Pixel/Materials/rod_BPIX_L2 + @include-std CMS_Phase2/Pixel/Resolutions/25x100 + destination BPIX2 + radiusMode fixed + placeRadiusHint 61.5 + numRods 24 + } + Layer 3 { + bigDelta 2.5 + zOverlap -1.3 // 1.3 mm space between active areas: 0.45 mm dead area on each sensor side + 0.4 mm gap + zGap 0.7 + zCentral -21.025 + @include-std CMS_Phase2/Pixel/ModuleTypes/pixel_2x2_25x100_v202305 + @include-std CMS_Phase2/Pixel/Materials/module_BPIX_L3_2x2_2500 + @include-std CMS_Phase2/Pixel/Materials/rod_BPIX_L3 + @include-std CMS_Phase2/Pixel/Resolutions/25x100 + destination BPIX3 + radiusMode fixed + placeRadiusHint 104.5 + numRods 20 + } + Layer 4 { + bigDelta 2.5 + zOverlap -1.3 // 1.3 mm space between active areas: 0.45 mm dead area on each sensor side + 0.4 mm gap + zGap 0.7 + zCentral -22.425 + @include-std CMS_Phase2/Pixel/ModuleTypes/pixel_2x2_25x100_v202305 + @include-std CMS_Phase2/Pixel/Materials/module_BPIX_L4_2x2_2500 + @include-std CMS_Phase2/Pixel/Materials/rod_BPIX_L4 + @include-std CMS_Phase2/Pixel/Resolutions/25x100 + destination BPIX4 + numRods 28 + } + } diff --git a/geometries/CMS_Phase2/Pixel/Pixel_V7/Pixel_V7_4_2.cfg b/geometries/CMS_Phase2/Pixel/Pixel_V7/Pixel_V7_4_2.cfg new file mode 100644 index 00000000..4c061705 --- /dev/null +++ b/geometries/CMS_Phase2/Pixel/Pixel_V7/Pixel_V7_4_2.cfg @@ -0,0 +1,27 @@ + +Tracker Pixels { + + etaCut 10 + zError 70 + + smallDelta 0 + bigDelta 3 + + servicesForcedUp false + + rotateBarrelByHalfPi true + + @include-std CMS_Phase2/Pixel/moduleOperatingParms + + barrelDetIdScheme Phase2Subdetector1 + endcapDetIdScheme Phase2Subdetector4 + + @include BPIX_7_4_2.cfg + @include ../Pixel_V6/FPIX1_6_4_0.cfg + @include ../Pixel_V6/FPIX2_6_1_3.cfg + + + @include-std CMS_Phase2/Pixel/Materials/MechanicalSupports/IT_Support_Tube.cfg + @include-std CMS_Phase2/Pixel/Materials/MechanicalSupports/IT_Service_Cylinder.cfg + +} diff --git a/include/RodPair.hh b/include/RodPair.hh index 270df3f6..08ae420b 100644 --- a/include/RodPair.hh +++ b/include/RodPair.hh @@ -139,6 +139,7 @@ class StraightRodPair : public RodPair, public Clonable { double computeNextZ(double newDsLength, double newDsDistance, double lastDsDistance, double lastZ, BuildDir direction, int parity); template vector computeZList(Iterator begin, Iterator end, double startZ, BuildDir direction, int smallParity, bool fixedStartZ); template pair, vector> computeZListPair(Iterator begin, Iterator end, double startZ, int recursionCounter); +// template pair, vector> computeZListPair(Iterator begin, Iterator end,ReadonlyPropertyVector > zPlusList, ReadonlyPropertyVector > zMinusList); void buildModules(Container& modules, const RodTemplate& rodTemplate, const vector& posList, BuildDir direction, bool isPlusBigDeltaRod, int parity, int side); void buildFull(const RodTemplate& rodTemplate, bool isPlusBigDeltaRod); void buildMezzanine(const RodTemplate& rodTemplate, bool isPlusBigDeltaRod); @@ -151,6 +152,8 @@ public: Property maxBuildRadius; Property zOverlap; + Property zGap; + Property zCentral; Property zError; Property zPlusParity; Property buildNumModules; @@ -163,10 +166,18 @@ public: PropertyNode ringNode; + //ReadonlyPropertyVector,',' > zPlusList; + // ReadonlyPropertyVector, ',' > zMinusList; + +// std::vector zPlusList ={0.70,45.10,89.50,133.90,178.30}; +// std::vector zMinusList={-45.10,-89.50,-133.90,-178.30}; + StraightRodPair(const std::string subdetectorName) : RodPair (subdetectorName), forbiddenRange ("forbiddenRange" , parsedOnly()), zOverlap ("zOverlap" , parsedAndChecked() , 1.), + zGap ("zGap" , parsedOnly() , 0.), + zCentral ("zCentral" , parsedOnly() , -999), zError ("zError" , parsedAndChecked()), zPlusParity ("smallParity" , parsedOnly()), mezzanine ("mezzanine" , parsedOnly(), false), @@ -175,6 +186,8 @@ public: allowCompressionCuts("allowCompressionCuts", parsedOnly(), true), isFlatPart ("isFlatPart" , parsedOnly(), false), ringNode ("Ring" , parsedOnly()) +// zPlusList ("zPlusList" , parsedOnly()), +// zMinusList ("zMinusList" , parsedOnly()) {} diff --git a/include/tk2CMSSW_strings.hh b/include/tk2CMSSW_strings.hh index 13a8a8dc..1732b9cf 100644 --- a/include/tk2CMSSW_strings.hh +++ b/include/tk2CMSSW_strings.hh @@ -22,10 +22,11 @@ namespace insur { static const double xml_outerTrackerEndcapsMinZ = 1250.; static const double xml_innerTrackerEndcapsMinZ = 227.; // from PIXEL 4_0_2_1 onwards // PIXEL 1_1_1 : 300. static const double xml_innerTiltedTrackerEndcapsMinZ = 415.; // 390. for IT_500 - static const std::string xml_trackerOutermostRadius = "122.15*cm"; // Outermost tracker volume boundary - - /** - * XML tags and attributes + // static const std::string xml_trackerOutermostRadius = "122.15*cm"; // Outermost tracker volume boundary + static const std::string xml_trackerOutermostRadius = "1233*mm"; + static const std::string xml_trackerInnermostRadius = "25*mm"; // Outermost tracker volume updated to reach CALO (https://github.com/cms-sw/cmssw/pull/43133) + static const std::string xml_trackerMaximumZ = "2935*mm"; + /* XML tags and attributes */ static const std::string xml_preamble_concise = "\n"; @@ -33,7 +34,8 @@ namespace insur { static const std::string xml_defclose = "\n"; static const std::string xml_general_inter = "\">\n"; static const std::string xml_general_endline = "\"/>\n"; - static const std::string xml_const_section = "\n\n\n\n"; + //static const std::string xml_const_section = "\n\n\n\n"; + static const std::string xml_const_section = "\n\n\n\n\n\n\n"; static const std::string xml_new_const_section = "\n\n\n"; static const std::string xml_recomat_parameters = "\n\n"; static const std::string xml_polycone_open = "\n"; + static const std::string xml_polycone_inter = "\" startPhi=\"0*deg\" deltaPhi=\"360*deg\">\n\n"; static const std::string xml_polycone_close = "\n"; static const std::string xml_rzpoint_open = " 0) { // Going upwards lastRA = maxr - d + lastDsDistance/2; newRA = maxr + d - newDsDistance/2; // use of maxr because outer rod wins, from -d to +d because going upwards } else { // Going downwards lastRA = minr + d + lastDsDistance/2; newRA = minr - d - newDsDistance/2; // use of minr because inner rod wins, from +d to -d because going downwards + } // Case B : zError is considered for computing next Z @@ -246,6 +248,7 @@ double StraightRodPair::computeNextZ(double newDsLength, double newDsDistance, d } } } + // std::cout << "next Z - " << newZ << std::endl; return newZ; } @@ -254,6 +257,8 @@ double StraightRodPair::computeNextZ(double newDsLength, double newDsDistance, d template vector StraightRodPair::computeZList(Iterator begin, Iterator end, double startZ, BuildDir direction, int smallParity, bool fixedStartZ) { vector zList; + double zg = zGap(); + double zc = zCentral(); double targetZ = maxZ.state() ? maxZ() : std::numeric_limits::max(); // unreachable target in case maxZ not set int targetMods = buildNumModules.state() ? buildNumModules() : std::numeric_limits::max(); // unreachable target in case numModules not set @@ -263,12 +268,15 @@ template vector StraightRodPair::computeZList(Iterato double newZ = startZ; // + lengthOffset/2; int parity = smallParity; + if (direction == BuildDir::RIGHT) newZ = newZ + zg; + else if (direction == BuildDir::LEFT) newZ = newZ - zg; BarrelModule* lastm = begin->get(); int n = 0; if (fixedStartZ) { zList.push_back(newZ); + // std::cout << newZ << std::endl; newZ += (direction == BuildDir::RIGHT ? (*begin)->length() : (*begin)->length()); parity = -parity; ++begin; @@ -280,6 +288,7 @@ template vector StraightRodPair::computeZList(Iterato newZ = computeNextZ(curm->length(), curm->dsDistance(), lastm->dsDistance(), newZ, direction, parity); zList.push_back(newZ); + // std::cout << newZ << std::endl; newZ += (direction == BuildDir::RIGHT ? curm->length() : -curm->length()); lastm = curm.get(); parity = -parity; @@ -294,11 +303,48 @@ template vector StraightRodPair::computeZList(Iterato newZ += (direction == BuildDir::RIGHT ? lastm->length() : -lastm->length()); parity = -parity; } - + + if (direction == BuildDir::RIGHT && zc!= -999) zList[0] = zc; + for (int i=0; i< int(zList.size());i++){ + std::cout << zList[i] << std::endl; + } return zList; } +/* +template pair, vector> StraightRodPair::computeZListPair(Iterator begin, Iterator end, ReadonlyPropertyVector > zPlusList, ReadonlyPropertyVector > zMinusList) { + bool fixedStartZ = true; +// vector zPlusList = computeZList(begin, end, startZ, BuildDir::RIGHT, zPlusParity(), fixedStartZ); +// vector zMinusList = computeZList(begin, end, startZ, BuildDir::LEFT, -zPlusParity(), !fixedStartZ); + + double zUnbalance = 0.; + //if (zPlusList.size()!=0 && zMinusList.size()!=0) { zUnbalance = (zPlusList.back()+(*(end-1))->length()/2) + (zMinusList.back()-(*(end-1))->length()/2); } // balancing uneven pos/neg strings + + if (++recursionCounter == 100) { // this stops infinite recursion if the balancing doesn't converge + std::ostringstream tempSS; + tempSS << "Balanced module placement in rod pair at avg build radius " << (maxBuildRadius()+minBuildRadius())/2. << " didn't converge!! Layer is skewed"; + tempSS << "Unbalance is " << zUnbalance << " mm"; + logWARNING(tempSS); + + return std::make_pair(zPlusList, zMinusList); + } + if (fabs(zUnbalance) > 0.1) { // 0.1 mm unbalance is tolerated + return computeZListPair(begin, end, + startZ-zUnbalance/2, // countering the unbalance by displacing the startZ (by half the inverse unbalance, to improve convergence) + recursionCounter); + } else { + std::ostringstream tempSS; + tempSS << "Balanced module placement in rod pair at avg build radius " << (maxBuildRadius()+minBuildRadius())/2. << " converged after " << recursionCounter << " step(s).\n" + << " Residual Z unbalance is " << zUnbalance << ".\n" + << " Positive string has " << zPlusList.size() << " modules, negative string has " << zMinusList.size() << " modules.\n"; + if (!zPlusList.empty()) { tempSS << "Z+ rod starts at " << zPlusList.front() << ".\n"; } + if (!zMinusList.empty()) { tempSS << "Z- rod starts at " << zMinusList.front() << ".\n"; } + logINFO(tempSS); + return std::make_pair(zPlusList, zMinusList); + } + return std::make_pair(zPlusList, zMinusList); +}*/ template pair, vector> StraightRodPair::computeZListPair(Iterator begin, Iterator end, double startZ, int recursionCounter) { bool fixedStartZ = true; @@ -358,7 +404,11 @@ void StraightRodPair::buildFull(const RodTemplate& rodTemplate, bool isPlusBigDe double startZ = startZMode() == StartZMode::MODULECENTER ? -(*rodTemplate.begin())->length()/2. : 0.; /*std::cout << "startZ = " << startZ << std::endl; std::cout << "rodTemplate.size() = " << rodTemplate.size() << std::endl;*/ - auto zListPair = computeZListPair(rodTemplate.begin(), rodTemplate.end(), startZ, 0); + std::pair,vector> zListPair; + //if (zPlusList.size() != 0 and zMinusList.size() != 0 ) + // zListPair = computeZListPair(rodTemplate.begin(), rodTemplate.end(), zPlusList,zMinusList); +// else + zListPair = computeZListPair(rodTemplate.begin(), rodTemplate.end(), startZ, 0); // actual module creation // CUIDADO log rod balancing effort @@ -377,8 +427,11 @@ void StraightRodPair::buildFull(const RodTemplate& rodTemplate, bool isPlusBigDe } void StraightRodPair::buildMezzanine(const RodTemplate& rodTemplate, bool isPlusBigDeltaRod) { - // compute Z list (only once since the second mezzanine has just inverted signs for z) - vector zList = computeZList(rodTemplate.rbegin(), rodTemplate.rend(), startZ(), BuildDir::LEFT, zPlusParity(), false); + // compute Z list (only once since the second mezzanine has just inverted signs for z) +// vector zList; +// if (zPlusList.size() != 0) zList = zPlusList +// else + auto zList = computeZList(rodTemplate.rbegin(), rodTemplate.rend(), startZ(), BuildDir::LEFT, zPlusParity(), false); vector zListNeg; std::transform(zList.begin(), zList.end(), std::back_inserter(zListNeg), std::negate()); diff --git a/src/Vizard.cc b/src/Vizard.cc index ff4fd5e6..616d6608 100644 --- a/src/Vizard.cc +++ b/src/Vizard.cc @@ -7337,7 +7337,7 @@ namespace insur { RZCanvas.reset(new TCanvas("RZCanvas", "RZView Canvas", insur::vis_max_canvas_sizeX, insur::vis_min_canvas_sizeY)); RZCanvas->cd(); - PlotDrawer yzDrawer; + PlotDrawer yzDrawer; yzDrawer.addModules(tracker); yzDrawer.drawFrame(*RZCanvas.get()); yzDrawer.drawModules(*RZCanvas.get()); @@ -7345,7 +7345,7 @@ namespace insur { double viewPortMax = MAX(tracker.barrels().at(0).maxR() * 1.1, tracker.barrels().at(0).maxZ() * 1.1); // Style to improve. Calculate (with margin) the barrel geometric extremum RZCanvasBarrel.reset(new TCanvas("RZCanvasBarrel", "RZView CanvasBarrel", vis_min_canvas_sizeX, vis_min_canvas_sizeY)); RZCanvasBarrel->cd(); - PlotDrawer yzDrawerBarrel(viewPortMax, viewPortMax); + PlotDrawer yzDrawerBarrel(viewPortMax, viewPortMax); yzDrawerBarrel.addModulesType(tracker, BARREL); yzDrawerBarrel.drawFrame(*RZCanvasBarrel.get()); yzDrawerBarrel.drawModules(*RZCanvasBarrel.get()); diff --git a/xml/trackerVolumeTemplate.xml b/xml/trackerVolumeTemplate.xml index 9fe6a926..4b4c235d 100644 --- a/xml/trackerVolumeTemplate.xml +++ b/xml/trackerVolumeTemplate.xml @@ -2,21 +2,29 @@ Tracker volume contains Inner Tracker + Outer Tracker + (BTL) + OTST. (BTL) is in parentheses as it is not included in all geometry scenarios. See Configuration/Geometry/README.md for more details. + 15-11-23 - Configuration of Tracker volume changed (Polycone -> cylinder) following https://github.com/cms-sw/cmssw/pull/43133 --> - + + + + + + - - - + This is for Pixel 4_0_2_5. For Tilted Inner Tracker 501 : z="-41.50*cm" + This is for Pixel 4_0_2_5. For Tilted Inner Tracker 501 : z="-41.50*cm" + + This is for Pixel 4_0_2_5. For Tilted Inner Tracker 501 : z="41.50*cm" + +This is for Pixel 4_0_2_5. For Tilted Inner Tracker 501 : z="41.50*cm" - - + --> +