Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions geometries/CMS_Phase2/OT806_IT741.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@include-std CMS_Phase2/SimParms
@include OuterTracker/Tilted/OT_V806.cfg
@include Pixel/Pixel_V7/Pixel_V7_4_1.cfg
3 changes: 3 additions & 0 deletions geometries/CMS_Phase2/OT806_IT742.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@include-std CMS_Phase2/SimParms
@include OuterTracker/Tilted/OT_V806.cfg
@include Pixel/Pixel_V7/Pixel_V7_4_2.cfg
3 changes: 3 additions & 0 deletions geometries/CMS_Phase2/OT806_IT743.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@include-std CMS_Phase2/SimParms
@include OuterTracker/Tilted/OT_V806.cfg
@include Pixel/Pixel_V7/Pixel_V7_4_3.cfg
79 changes: 79 additions & 0 deletions geometries/CMS_Phase2/Pixel/Pixel_V7/BPIX_7_4_2.cfg
Original file line number Diff line number Diff line change
@@ -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
}
}
27 changes: 27 additions & 0 deletions geometries/CMS_Phase2/Pixel/Pixel_V7/Pixel_V7_4_2.cfg
Original file line number Diff line number Diff line change
@@ -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

}
13 changes: 13 additions & 0 deletions include/RodPair.hh
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class StraightRodPair : public RodPair, public Clonable<StraightRodPair> {
double computeNextZ(double newDsLength, double newDsDistance, double lastDsDistance, double lastZ, BuildDir direction, int parity);
template<typename Iterator> vector<double> computeZList(Iterator begin, Iterator end, double startZ, BuildDir direction, int smallParity, bool fixedStartZ);
template<typename Iterator> pair<vector<double>, vector<double>> computeZListPair(Iterator begin, Iterator end, double startZ, int recursionCounter);
// template<typename Iterator> pair<vector<double>, vector<double>> computeZListPair(Iterator begin, Iterator end,ReadonlyPropertyVector<std::vector<double> > zPlusList, ReadonlyPropertyVector<std::vector<double> > zMinusList);
void buildModules(Container& modules, const RodTemplate& rodTemplate, const vector<double>& posList, BuildDir direction, bool isPlusBigDeltaRod, int parity, int side);
void buildFull(const RodTemplate& rodTemplate, bool isPlusBigDeltaRod);
void buildMezzanine(const RodTemplate& rodTemplate, bool isPlusBigDeltaRod);
Expand All @@ -151,6 +152,8 @@ public:
Property<double, NoDefault> maxBuildRadius;

Property<double, Default> zOverlap;
Property<double, Default> zGap;
Property<double, Default> zCentral;
Property<double, NoDefault> zError;
Property<int, NoDefault> zPlusParity;
Property<int, NoDefault> buildNumModules;
Expand All @@ -163,10 +166,18 @@ public:

PropertyNode<int> ringNode;

//ReadonlyPropertyVector<std::vector<double>,',' > zPlusList;
// ReadonlyPropertyVector<std::vector<double>, ',' > zMinusList;

// std::vector<double> zPlusList ={0.70,45.10,89.50,133.90,178.30};
// std::vector<double> 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),
Expand All @@ -175,6 +186,8 @@ public:
allowCompressionCuts("allowCompressionCuts", parsedOnly(), true),
isFlatPart ("isFlatPart" , parsedOnly(), false),
ringNode ("Ring" , parsedOnly())
// zPlusList ("zPlusList" , parsedOnly()),
// zMinusList ("zMinusList" , parsedOnly())
{}


Expand Down
14 changes: 8 additions & 6 deletions include/tk2CMSSW_strings.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ 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 = "<?xml ";
static const std::string xml_preamble = "<?xml version=\"1.0\"?>\n";
static const std::string xml_definition = "<DDDefinition xmlns=\"http://www.cern.ch/cms/DDL\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.cern.ch/cms/DDL ../../../DetectorDescription/Schema/DDLSchema.xsd\">\n";
static const std::string xml_defclose = "</DDDefinition>\n";
static const std::string xml_general_inter = "\">\n";
static const std::string xml_general_endline = "\"/>\n";
static const std::string xml_const_section = "<ConstantsSection label=\"tracker.xml\" eval=\"true\">\n<Constant name=\"BackPlaneDz\" value=\"0.015*mm\"/>\n<Constant name=\"TrackerOutermostRadius\" value=\"" + xml_trackerOutermostRadius + "\"/>\n</ConstantsSection>\n";
//static const std::string xml_const_section = "<ConstantsSection label=\"tracker.xml\" eval=\"true\">\n<Constant name=\"BackPlaneDz\" value=\"0.015*mm\"/>\n<Constant name=\"TrackerOutermostRadius\" value=\"" + xml_trackerOutermostRadius + "\"/>\n</ConstantsSection>\n";
static const std::string xml_const_section = "<ConstantsSection label=\"tracker.xml\" eval=\"true\">\n<Constant name=\"BackPlaneDz\" value=\"0.015*mm\"/>\n<Constant name=\"TrackerMaximumZ\" value=\"" + xml_trackerMaximumZ +"\"/>\n<Constant name=\"TrackerMinimumZ\" value=\"-[TrackerMaximumZ]\"/>\n<Constant name=\"TrackerInnermostRadius\" value=\"" + xml_trackerInnermostRadius +"\"/>\n<Constant name=\"TrackerOutermostRadius\" value=\"" + xml_trackerOutermostRadius + "\"/>\n</ConstantsSection>\n";
static const std::string xml_new_const_section = "<ConstantsSection label=\"newtracker.xml\" eval=\"true\">\n<Constant name=\"newDummyBackPlaneDz\" value=\"0.015*mm\"/>\n</ConstantsSection>\n";
static const std::string xml_recomat_parameters = "<Parameter name=\"TrackerRadLength\" value=\"0.01\"/>\n<Parameter name=\"TrackerXi\" value=\"0.0001";
static const std::string xml_recomat_radlength = "TrackerRadLength";
Expand Down Expand Up @@ -102,7 +104,7 @@ namespace insur {
static const std::string xml_cone_fifth_inter = "*mm\" dz=\"";
static const std::string xml_cone_close = "*mm\" startPhi=\"0*deg\" deltaPhi=\"360*deg\"/>\n";
static const std::string xml_polycone_open = "<Polycone name=\"";
static const std::string xml_polycone_inter = "\" startPhi=\"0*deg\" deltaPhi=\"360*deg\">\n";
static const std::string xml_polycone_inter = "\" startPhi=\"0*deg\" deltaPhi=\"360*deg\">\n<ZSection z=\"[tracker:TrackerMinimumZ]\" rMin=\"[tracker:TrackerInnermostRadius]\" rMax=\"[tracker:TrackerOutermostRadius]\"/>\n<ZSection z=\"[tracker:TrackerMaximumZ]\" rMin=\"[tracker:TrackerInnermostRadius]\" rMax=\"[tracker:TrackerOutermostRadius]\"/>";
static const std::string xml_polycone_close = "</Polycone>\n";
static const std::string xml_rzpoint_open = "<RZPoint r=\"";
static const std::string xml_rzpoint_inter = "*mm\" z=\"";
Expand Down
4 changes: 2 additions & 2 deletions src/Extractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4749,7 +4749,7 @@ namespace insur {

// Dead area Front of centre (Inactive silicon around sensor)
if(module.numSensors()==2){
const double myDeadAreaFrontOfCentreWidth = modWidth + 2.* deadAreaExtraWidth;
const double myDeadAreaFrontOfCentreWidth = modWidth;
const double myDeadAreaFrontOfCentreLength = deadAreaExtraLength;//Assume the same silicon dead area as for the front - this could be made more general
const double myDeadAreaFrontOfCentreThickness = sensorThickness;
const double myDeadAreaFrontOfCentrePosX = 0.;
Expand All @@ -4775,7 +4775,7 @@ namespace insur {

// Dead area Back of centre (Inactive silicon around sensor)
if(module.numSensors()==2){
const double myDeadAreaBackOfCentreWidth = modWidth + 2*deadAreaExtraWidth;
const double myDeadAreaBackOfCentreWidth = modWidth;
const double myDeadAreaBackOfCentreLength = deadAreaExtraLength;//Assume the same silicon dead area as for the front - this could be made more general
const double myDeadAreaBackOfCentreThickness = sensorThickness;
const double myDeadAreaBackOfCentrePosX = 0.;
Expand Down
61 changes: 57 additions & 4 deletions src/RodPair.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,14 @@ double StraightRodPair::computeNextZ(double newDsLength, double newDsDistance, d
// Case A : zOverlap is considered for computing next Z
double lastRA;
double newRA;

if (parity > 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
Expand Down Expand Up @@ -246,6 +248,7 @@ double StraightRodPair::computeNextZ(double newDsLength, double newDsDistance, d
}
}
}
// std::cout << "next Z - " << newZ << std::endl;
return newZ;
}

Expand All @@ -254,6 +257,8 @@ double StraightRodPair::computeNextZ(double newDsLength, double newDsDistance, d
template<typename Iterator> vector<double> StraightRodPair::computeZList(Iterator begin, Iterator end, double startZ, BuildDir direction, int smallParity, bool fixedStartZ) {

vector<double> zList;
double zg = zGap();
double zc = zCentral();

double targetZ = maxZ.state() ? maxZ() : std::numeric_limits<double>::max(); // unreachable target in case maxZ not set
int targetMods = buildNumModules.state() ? buildNumModules() : std::numeric_limits<int>::max(); // unreachable target in case numModules not set
Expand All @@ -263,12 +268,15 @@ template<typename Iterator> vector<double> 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;
Expand All @@ -280,6 +288,7 @@ template<typename Iterator> vector<double> 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;
Expand All @@ -294,11 +303,48 @@ template<typename Iterator> vector<double> 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<typename Iterator> pair<vector<double>, vector<double>> StraightRodPair::computeZListPair(Iterator begin, Iterator end, ReadonlyPropertyVector<std::vector<double> > zPlusList, ReadonlyPropertyVector<std::vector<double> > zMinusList) {
bool fixedStartZ = true;
// vector<double> zPlusList = computeZList(begin, end, startZ, BuildDir::RIGHT, zPlusParity(), fixedStartZ);
// vector<double> 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<typename Iterator> pair<vector<double>, vector<double>> StraightRodPair::computeZListPair(Iterator begin, Iterator end, double startZ, int recursionCounter) {
bool fixedStartZ = true;
Expand Down Expand Up @@ -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<double>,vector<double>> 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
Expand All @@ -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<double> 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<double> zList;
// if (zPlusList.size() != 0) zList = zPlusList
// else
auto zList = computeZList(rodTemplate.rbegin(), rodTemplate.rend(), startZ(), BuildDir::LEFT, zPlusParity(), false);
vector<double> zListNeg;
std::transform(zList.begin(), zList.end(), std::back_inserter(zListNeg), std::negate<double>());

Expand Down
4 changes: 2 additions & 2 deletions src/Vizard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7337,15 +7337,15 @@ namespace insur {

RZCanvas.reset(new TCanvas("RZCanvas", "RZView Canvas", insur::vis_max_canvas_sizeX, insur::vis_min_canvas_sizeY));
RZCanvas->cd();
PlotDrawer<YZ, Type> yzDrawer;
PlotDrawer<YZFull, Type> yzDrawer;
yzDrawer.addModules(tracker);
yzDrawer.drawFrame<SummaryFrameStyle>(*RZCanvas.get());
yzDrawer.drawModules<ContourStyle>(*RZCanvas.get());

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<YZ, Type> yzDrawerBarrel(viewPortMax, viewPortMax);
PlotDrawer<YZFull, Type> yzDrawerBarrel(viewPortMax, viewPortMax);
yzDrawerBarrel.addModulesType(tracker, BARREL);
yzDrawerBarrel.drawFrame<SummaryFrameStyle>(*RZCanvasBarrel.get());
yzDrawerBarrel.drawModules<ContourStyle>(*RZCanvasBarrel.get());
Expand Down
Loading