Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport in 14_1_X of PR#45993: bug-fix: remove DoubleSensGeomDet (ph-2 InnerTracker) #45996

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import copy, sys, os

import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
GLOBAL_TAG, ERA = _settings.get_era_and_conditions("2026D107") # this should really be _settings.DEFAULT_VERSION :(
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)
process = cms.Process("Misaligner", ERA)

###################################################################
Expand Down Expand Up @@ -48,7 +48,7 @@
###################################################################
# Ideal geometry producer and standard includes
###################################################################
process.load('Configuration.Geometry.GeometryExtended2026D107Reco_cff')
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff')
process.trackerGeometry.applyAlignment = True

###################################################################
Expand Down
16 changes: 8 additions & 8 deletions Configuration/AlCa/python/autoCondPhase2.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@
'T21' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T21_design_v0' ,TkAlRecord, connectionString, "", "2023-03-16 15:30:00"] ), ),
'T25' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T25_design_v0' ,TkAlRecord, connectionString, "", "2023-03-16 15:30:00"] ), ),
'T30' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T30_design_v0' ,TkAlRecord, connectionString, "", "2023-03-16 15:30:00"] ), ),
'T33' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T33_design_v0' ,TkAlRecord, connectionString, "", "2023-06-07 21:00:00"] ), ),
'T36' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T36_design_v0' ,TkAlRecord, connectionString, "", "2024-04-14 15:19:00"] ), ),
'T37' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T37_design_v0' ,TkAlRecord, connectionString, "", "2024-04-14 15:19:00"] ), ),
'T38' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T38_design_v0' ,TkAlRecord, connectionString, "", "2024-04-14 15:19:00"] ), ),
'T33' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T33_design_v1' ,TkAlRecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
'T36' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T36_design_v1' ,TkAlRecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
'T37' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T37_design_v1' ,TkAlRecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
'T38' : ( ','.join( [ 'TrackerAlignment_Upgrade2026_T38_design_v1' ,TkAlRecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
}

allTags["TkAPE"] = {
'T21' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T21_design_v0' ,TkAPERecord, connectionString, "", "2023-03-16 15:30:00"] ), ),
'T25' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T25_design_v0' ,TkAPERecord, connectionString, "", "2023-03-16 15:30:00"] ), ),
'T30' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T30_design_v0' ,TkAPERecord, connectionString, "", "2023-03-16 15:30:00"] ), ),
'T33' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T33_design_v0' ,TkAPERecord, connectionString, "", "2023-06-07 21:00:00"] ), ),
'T36' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T36_design_v0' ,TkAPERecord, connectionString, "", "2024-04-14 13:10:00"] ), ),
'T37' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T36_design_v0' ,TkAPERecord, connectionString, "", "2024-04-14 13:10:00"] ), ),
'T38' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T36_design_v0' ,TkAPERecord, connectionString, "", "2024-04-14 13:10:00"] ), ),
'T33' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T33_design_v1' ,TkAPERecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
'T36' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T36_design_v1' ,TkAPERecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
'T37' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T36_design_v1' ,TkAPERecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
'T38' : ( ','.join( [ 'TrackerAlignmentErrorsExtended_Upgrade2026_T36_design_v1' ,TkAPERecord, connectionString, "", "2024-09-12 15:37:00"] ), ),
}

allTags["TkSurf"] = {
Expand Down
62 changes: 49 additions & 13 deletions Fireworks/Geometry/python/dumpRecoGeometry_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def versionCheck(ver):
print("")
help()

def recoGeoLoad(score):
def recoGeoLoad(score, properties):
print("Loading configuration for tag ", options.tag ,"...\n")

if score == "Run1":
Expand All @@ -64,7 +64,7 @@ def recoGeoLoad(score):
process.GlobalTag.globaltag = autoCond['upgrade2017']
process.load('Configuration.Geometry.GeometryExtended2017Reco_cff')

elif score == "2021":
elif score == "2021":
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.autoCond import autoCond
process.GlobalTag.globaltag = autoCond['upgrade2021']
Expand All @@ -78,10 +78,32 @@ def recoGeoLoad(score):
elif "2026" in score:
versionCheck(options.version)
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
from Configuration.AlCa.autoCond import autoCond
process.GlobalTag.globaltag = autoCond['phase2_realistic']

# Import the required configuration from the CMSSW module
from Configuration.AlCa.autoCond import autoCond # Ensure autoCond is imported

# Ensure options.version is defined and set correctly
version_key = '2026' + options.version # This constructs the key for accessing the properties dictionary
print(f"Constructed version key: {version_key}")

# Check if the key exists in properties for 2026
if version_key in properties[2026]:
# Get the specific global tag for this version
global_tag_key = properties[2026][version_key]['GT']
print(f"Global tag key from properties: {global_tag_key}")

# Check if this key exists in autoCond
if global_tag_key.replace("auto:", "") in autoCond:
# Set the global tag
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, global_tag_key, '')
else:
raise KeyError(f"Global tag key '{global_tag_key}' not found in autoCond.")
else:
raise KeyError(f"Version key '{version_key}' not found in properties[2026].")
process.load('Configuration.Geometry.GeometryExtended2026'+options.version+'Reco_cff')

process.trackerGeometry.applyAlignment = cms.bool(False)

elif score == "MaPSA":
process.load('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff')
process.load('Geometry.TrackerCommonData.mapsaGeometryXML_cfi')
Expand Down Expand Up @@ -114,11 +136,8 @@ def recoGeoLoad(score):
help()




options = VarParsing.VarParsing ()


defaultOutputFileName="cmsRecoGeom.root"

options.register ('tag',
Expand Down Expand Up @@ -171,16 +190,33 @@ def recoGeoLoad(score):

options.parseArguments()




process = cms.Process("DUMP")
from Configuration.PyReleaseValidation.upgradeWorkflowComponents import upgradeProperties as properties
# Determine version_key based on the value of options.tag
if options.tag == "2026" or options.tag == "MaPSA":
prop_key = 2026
version_key = options.tag + options.version
elif options.tag == "2017" or options.tag == "2021": #(this leads to crashes in tests ?)
prop_key = 2017
version_key = options.tag
else:
prop_key = None
version_key = None

if(prop_key and version_key):
print(f"Constructed version key: {version_key}")
era_key = properties[prop_key][str(version_key)]['Era']
print(f"Constructed era key: {era_key}")
from Configuration.StandardSequences.Eras import eras
era = getattr(eras, era_key)
process = cms.Process("DUMP",era)
else:
process = cms.Process("DUMP")
process.add_(cms.Service("InitRootHandlers", ResetRootErrHandler = cms.untracked.bool(False)))
process.source = cms.Source("EmptySource")
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))


recoGeoLoad(options.tag)
recoGeoLoad(options.tag,properties)

if ( options.tgeo == True):
if (options.out == defaultOutputFileName ):
Expand Down
8 changes: 0 additions & 8 deletions Geometry/TrackerGeometryBuilder/src/PixelTopologyMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ void PixelTopologyMap::buildTopologyMaps() {
for (auto det : m_trackerGeom->detsPXB()) {
const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);

// discard dets that are not a geomDetUnit
if (!pixelDet)
continue;

const auto& layer = m_trackerTopo->pxbLayer(pixelDet->geographicalId());
const auto& ladder = m_trackerTopo->pxbLadder(pixelDet->geographicalId());
const auto& module = m_trackerTopo->pxbModule(pixelDet->geographicalId());
Expand Down Expand Up @@ -60,10 +56,6 @@ void PixelTopologyMap::buildTopologyMaps() {
for (auto det : m_trackerGeom->detsPXF()) {
const PixelGeomDetUnit* pixelDet = dynamic_cast<const PixelGeomDetUnit*>(det);

// discard dets that are not a geomDetUnit
if (!pixelDet)
continue;

const auto& disk = m_trackerTopo->pxfDisk(pixelDet->geographicalId());
const auto& blade = m_trackerTopo->pxfBlade(pixelDet->geographicalId());
const auto& pxf_module = m_trackerTopo->pxfModule(pixelDet->geographicalId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonDetUnit/interface/GluedGeomDet.h"
#include "Geometry/CommonDetUnit/interface/StackGeomDet.h"
#include "Geometry/CommonDetUnit/interface/DoubleSensGeomDet.h"
#include "Geometry/CommonDetUnit/interface/PixelGeomDetType.h"
#include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
Expand Down Expand Up @@ -312,13 +311,6 @@ void TrackerGeomBuilderFromGeometricDet::buildGeomDet(TrackerGeometry* tracker)
StackGeomDet* stackDet = new StackGeomDet(&(*plane), dus, dum, composedDetId);
tracker->addDet((GeomDet*)stackDet);
tracker->addDetId(composedDetId);
} else if (gduTypeName.find("One") != std::string::npos) {
//The plane is *not* built in the middle, but on the First surface
Plane* plane = new Plane(dus->surface());
composedDetId = theTopo->doubleSensor(gduId[i]);
DoubleSensGeomDet* doubleSensDet = new DoubleSensGeomDet(&(*plane), dus, dum, composedDetId);
tracker->addDet((GeomDet*)doubleSensDet);
tracker->addDetId(composedDetId);
}
}
}
Expand Down
33 changes: 2 additions & 31 deletions RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonDetUnit/interface/GluedGeomDet.h"
#include "Geometry/CommonDetUnit/interface/StackGeomDet.h"
#include "Geometry/CommonDetUnit/interface/DoubleSensGeomDet.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"

#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
Expand All @@ -32,7 +31,6 @@
#include "TkPhase2OTMeasurementDet.h"
#include "TkGluedMeasurementDet.h"
#include "TkStackMeasurementDet.h"
#include "TkDoubleSensMeasurementDet.h"

#include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
#include "CondFormats/DataRecord/interface/SiStripNoisesRcd.h"
Expand Down Expand Up @@ -172,11 +170,6 @@ void MeasurementTrackerImpl::initialize(const TrackerTopology* trackerTopology)
for (unsigned int i = 0; i != theStackDets.size(); ++i)
initStackDet(theStackDets[i]);

// and then the double sensor dets
sortTKD(theDoubleSensGeomDets);
for (unsigned int i = 0; i != theDoubleSensGeomDets.size(); ++i)
initDoubleSensDet(theDoubleSensGeomDets[i]);

if (!checkDets())
throw MeasurementDetException("Number of dets in MeasurementTracker not consistent with TrackerGeometry!");
}
Expand Down Expand Up @@ -240,19 +233,14 @@ void MeasurementTrackerImpl::addDets(const TrackingGeometry::DetContainer& dets,
//Glued or Stack GeomDet
const GluedGeomDet* gluedDet = dynamic_cast<const GluedGeomDet*>(*gd);
const StackGeomDet* stackDet = dynamic_cast<const StackGeomDet*>(*gd);
const DoubleSensGeomDet* doubleSensGeomDet = dynamic_cast<const DoubleSensGeomDet*>(*gd);

if ((gluedDet == nullptr && stackDet == nullptr && doubleSensGeomDet == nullptr) ||
(gluedDet != nullptr && stackDet != nullptr && doubleSensGeomDet != nullptr)) {
throw MeasurementDetException(
"MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet nor DoubleSensGeomDet");
if ((gluedDet == nullptr && stackDet == nullptr) || (gluedDet != nullptr && stackDet != nullptr)) {
throw MeasurementDetException("MeasurementTracker ERROR: GeomDet neither DetUnit nor GluedDet nor StackDet");
}
if (gluedDet != nullptr)
addGluedDet(gluedDet);
else if (stackDet != nullptr)
addStackDet(stackDet);
else
addDoubleSensGeomDet(doubleSensGeomDet);
}
}
}
Expand Down Expand Up @@ -297,10 +285,6 @@ void MeasurementTrackerImpl::addStackDet(const StackGeomDet* gd) {
theStackDets.push_back(TkStackMeasurementDet(gd, thePxDetConditions.pixelCPE()));
}

void MeasurementTrackerImpl::addDoubleSensGeomDet(const DoubleSensGeomDet* gd) {
theDoubleSensGeomDets.push_back(TkDoubleSensMeasurementDet(gd, thePxDetConditions.pixelCPE()));
}

void MeasurementTrackerImpl::initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology) {
const GluedGeomDet& gd = det.specificGeomDet();
const MeasurementDet* monoDet = findDet(gd.monoDet()->geographicalId());
Expand All @@ -325,19 +309,6 @@ void MeasurementTrackerImpl::initStackDet(TkStackMeasurementDet& det) {
theDetMap[gd.geographicalId()] = &det;
}

void MeasurementTrackerImpl::initDoubleSensDet(TkDoubleSensMeasurementDet& det) {
const DoubleSensGeomDet& gd = det.specificGeomDet();
const MeasurementDet* firstDet = findDet(gd.firstDet()->geographicalId());
const MeasurementDet* secondDet = findDet(gd.secondDet()->geographicalId());
if (firstDet == nullptr || secondDet == nullptr) {
edm::LogError("MeasurementDet")
<< "MeasurementTracker ERROR: DoubleSensDet components not found as MeasurementDets ";
throw MeasurementDetException("MeasurementTracker ERROR: DoubleSensDet components not found as MeasurementDets");
}
det.init(firstDet, secondDet);
theDetMap[gd.geographicalId()] = &det;
}

void MeasurementTrackerImpl::initializeStripStatus(const BadStripCutsDet& badStripCuts,
const SiStripQuality* quality,
int qualityFlags,
Expand Down
6 changes: 0 additions & 6 deletions RecoTracker/MeasurementDet/plugins/MeasurementTrackerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ class TkPixelMeasurementDet;
class TkPhase2OTMeasurementDet;
class TkGluedMeasurementDet;
class TkStackMeasurementDet;
class TkDoubleSensMeasurementDet;
class GeometricSearchTracker;
class SiStripRecHitMatcher;
class GluedGeomDet;
class StackGeomDet;
class DoubleSensGeomDet;
class SiPixelFedCabling;
class TrackerGeometry;

Expand Down Expand Up @@ -102,7 +100,6 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker {
const std::vector<TkPixelMeasurementDet>& pixelDets() const { return thePixelDets; }
const std::vector<TkGluedMeasurementDet>& gluedDets() const { return theGluedDets; }
const std::vector<TkStackMeasurementDet>& stackDets() const { return theStackDets; }
const std::vector<TkDoubleSensMeasurementDet>& doubleSensGeomDets() const { return theDoubleSensGeomDets; }

const StMeasurementConditionSet& stripDetConditions() const override { return theStDetConditions; }
const PxMeasurementConditionSet& pixelDetConditions() const override { return thePxDetConditions; }
Expand All @@ -120,7 +117,6 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker {
std::vector<TkPhase2OTMeasurementDet> thePhase2Dets;
std::vector<TkGluedMeasurementDet> theGluedDets;
std::vector<TkStackMeasurementDet> theStackDets;
std::vector<TkDoubleSensMeasurementDet> theDoubleSensGeomDets;

const SiPixelFedCabling* thePixelCabling;

Expand All @@ -135,11 +131,9 @@ class dso_hidden MeasurementTrackerImpl final : public MeasurementTracker {

void addGluedDet(const GluedGeomDet* gd);
void addStackDet(const StackGeomDet* gd);
void addDoubleSensGeomDet(const DoubleSensGeomDet* gd);

void initGluedDet(TkGluedMeasurementDet& det, const TrackerTopology* trackerTopology);
void initStackDet(TkStackMeasurementDet& det);
void initDoubleSensDet(TkDoubleSensMeasurementDet& det);

void addDets(const TrackingGeometry::DetContainer& dets, bool subIsPixel, bool subIsOT);

Expand Down
Loading