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

Phase 2 tracker: template CPE #28448

Merged
merged 10 commits into from Dec 6, 2019
6 changes: 3 additions & 3 deletions CondFormats/SiPixelTransient/interface/SiPixelGenError.h
Expand Up @@ -77,12 +77,12 @@ struct SiPixelGenErrorStore { //!< template storage structure
SiPixelGenErrorHeader head;
#ifndef SI_PIXEL_TEMPLATE_USE_BOOST
float cotbetaY[60];
float cotbetaX[5];
float cotalphaX[29];
float cotbetaX[60];
float cotalphaX[60];
//!< 60 Barrel y templates spanning cluster lengths from 0px to +18px [28 entries for fpix]
SiPixelGenErrorEntry enty[60];
//!< 29 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 5 slices [3x29 for fpix]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One should update also the comment with the modified dimensions
Even better if the number of templates is saved into a named constant, that can be addressed from whenever needed (therefore, one could define it in SiPixelTemplate.h, or in SiPixelTemplateDefs.h, and access it here and whenever else is needed)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@perrotta Ok, I implemented your suggested changes here: ef2998b

SiPixelGenErrorEntry entx[5][29];
SiPixelGenErrorEntry entx[60][60];
#else
float* cotbetaY;
float* cotbetaX;
Expand Down
6 changes: 3 additions & 3 deletions CondFormats/SiPixelTransient/interface/SiPixelTemplate.h
Expand Up @@ -207,12 +207,12 @@ struct SiPixelTemplateStore { //!< template storage structure
SiPixelTemplateHeader head;
#ifndef SI_PIXEL_TEMPLATE_USE_BOOST
float cotbetaY[60];
float cotbetaX[5];
float cotalphaX[29];
float cotbetaX[60];
float cotalphaX[60];
//!< 60 Barrel y templates spanning cluster lengths from 0px to +18px [28 entries for fpix]
SiPixelTemplateEntry enty[60];
//!< 29 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 5 slices [3x29 for fpix]
SiPixelTemplateEntry entx[5][29];
SiPixelTemplateEntry entx[60][60];
Copy link
Contributor

@makortel makortel Nov 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the impact on memory? (my quick estimate would indicate that the sizeof(SiPixelTemplateStore) would be something like 7.4 MB, but I could have missed someting) Is an SiPixelTemplateStore object stored in stack anywhere? (just wondering if there is any risk to hit stack size issues like in #22458)

Copy link
Contributor Author

@cmantill cmantill Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@makortel do you have a specific memory check you would like to see? I am not sure if SiPixelTemplateStore is stored in stack. Maybe @mmusich is more familiar with this.

I ran the time and memory module comparison here:
Before PR:

Max VSIZ 6816.91 on evt 4 ; max RSS 3721.88 on evt 7
Time av 12.284 s/evt   max 26.0459 s on evt 4
CPU av 0 s/evt   max 0 s on evt -1
M1 Time av 11.3868 s/evt   max 26.0459 s on evt 4
M1 CPU av 0 s/evt   max 0 s on evt -1
M8 Time av 5.38321 s/evt   max 5.44807 s on evt 9

After PR:

Max VSIZ 7344.61 on evt 6 ; max RSS 3759.03 on evt 7
Time av 16.4558 s/evt   max 33.244 s on evt 4
CPU av 0 s/evt   max 0 s on evt -1
M1 Time av 14.9319 s/evt   max 33.244 s on evt 4
M1 CPU av 0 s/evt   max 0 s on evt -1
M8 Time av 8.26217 s/evt   max 8.43981 s on evt 9

I also ran the profile igprof, this shows the CPU use:
After PR:
https://cmantill.web.cern.ch/cmantill/cgi-bin//igprof-navigator/ig_phase2pr_Nov21_cpu/
or maybe more specifically:
https://cmantill.web.cern.ch/cmantill/cgi-bin//igprof-navigator/ig_phase2pr_Nov21_cpu/1283

And this shows the memory use (but I can't really tell anything from these logs so maybe you are more familiar navigating them):
Before PR:
https://cmantill.web.cern.ch/cmantill/cgi-bin//igprof-navigator/ig_phase2_nopr_Nov21
After PR:
https://cmantill.web.cern.ch/cmantill/cgi-bin//igprof-navigator/ig_phase2pr_Nov21

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you have a specific memory check you would like to see?

Mainly if I estimated the object size correctly or not.

I am not sure if SiPixelTemplateStore is stored in stack. Maybe @mmusich is more familiar with this.

According to dxr
https://cmssdt.cern.ch/dxr/CMSSW/search?q=%2Btype-ref%3ASiPixelTemplateStore
the only place where the object is in stack is in

SiPixelTemplateStore theCurrentTemp;

which I suppose is fine as that code path is not run within CMSSW. And I see the corresponding piece in the code path run within CMSSW
/// SiPixelTemplateStore theCurrentTemp; // large, don't allocate it on the stack
auto tmpPtr = std::make_unique<SiPixelTemplateStore>(); // must be allocated on the heap instead

was already change to heap allocation in #22458.

Good, sorry for the noise.

void destroy(){};
#else
float* cotbetaY = nullptr;
Expand Down
48 changes: 27 additions & 21 deletions Configuration/AlCa/python/autoCondPhase2.py
Expand Up @@ -13,39 +13,45 @@


allTags["LA"] = {
'T6' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T6_v0_mc' ,SiPixelLARecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T14' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T14_v0_mc' ,SiPixelLARecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v0_mc' ,SiPixelLARecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T6' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T6_v2_mc' ,SiPixelLARecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), #uH = 0.106/T (TBPX), uH=0.0/T (TEPX+TFPX)
'T14' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T14_v2_mc' ,SiPixelLARecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), #uH = 0.106/T (TBPX), uH=0.0/T (TEPX+TFPX)
'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_v2_mc' ,SiPixelLARecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), #uH = 0.053/T (TBPX), uH=0.0/T (TEPX+TFPX)
}

allTags["LAWidth"] = {
'T6' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_forWidth_T6_v0_mc' ,SiPixelLARecord,connectionString, "forWidth", "2019-07-15 12:00:00.000"] ), ),
'T14' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_forWidth_T14_v0_mc' ,SiPixelLARecord,connectionString, "forWidth", "2019-07-15 12:00:00.000"] ), ),
'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_forWidth_T15_v0_mc' ,SiPixelLARecord,connectionString, "forWidth", "2019-07-15 12:00:00.000"] ), ),
'T6' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T6_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset)
'T14' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T14_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset)
'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "forWidth", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (fall-back to offset)
}

allTags["SimLA"] = {
'T6' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T6_v0_mc' ,SiPixelSimLARecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T14' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T14_v0_mc' ,SiPixelSimLARecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T15' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v0_mc' ,SiPixelSimLARecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
allTags["LAfromAlignment"] = {
'T6' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T6_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use)
'T14' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T14_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use)
'T15' : ( ','.join( [ 'SiPixelLorentzAngle_phase2_T15_mc_forWidthEmpty' ,SiPixelLARecord,connectionString, "fromAlignment", "2019-11-05 20:00:00.000"] ), ), # uH=0.0/T (not in use)
}

##
## All of the following conditions are not yet in active use, but will be activated in GT along the way
##
allTags["SimLA"] = {
'T6' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T6_v2_mc' ,SiPixelSimLARecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), #uH = 0.0431/T (TBPX), uH=0.0/T (TEPX+TFPX)
'T14' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T14_v2_mc' ,SiPixelSimLARecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), #uH = 0.0431/T (TBPX), uH=0.0/T (TEPX+TFPX)
'T15' : ( ','.join( [ 'SiPixelSimLorentzAngle_phase2_T15_v2_mc' ,SiPixelSimLARecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), #uH = 0.0431/T (TBPX), uH=0.0/T (TEPX+TFPX)
}

allTags["GenError"] = {
'T6' : ( ','.join( [ 'SiPixelGenErrorDBOject_phase2_T6_v0_mc' ,SiPixelGenErrorRecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T14' : ( ','.join( [ 'SiPixelGenErrorDBOject_phase2_T14_v0_mc' ,SiPixelGenErrorRecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T15' : ( ','.join( [ 'SiPixelGenErrorDBOject_phase2_T15_v0_mc' ,SiPixelGenErrorRecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T6' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_T6_v2_mc' ,SiPixelGenErrorRecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T14' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_T14_v2_mc' ,SiPixelGenErrorRecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T15' : ( ','.join( [ 'SiPixelGenErrorDBObject_phase2_T15_v2_mc' ,SiPixelGenErrorRecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
}

allTags["Template"] = {
'T6' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_T6_v0_mc' ,SiPixelTemplatesRecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T14' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_T14_v0_mc' ,SiPixelTemplatesRecord,connectionString, "", "2019-07-15 12:00:00.000"] ), ),
'T15' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_T15_v0_mc' ,SiPixelTemplatesRecord,connectionString, "" , "2019-07-15 12:00:00.000"] ), ),
'T6' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_T6_v2_mc' ,SiPixelTemplatesRecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T14' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_T14_v2_mc' ,SiPixelTemplatesRecord,connectionString, "", "2019-11-05 20:00:00.000"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
'T15' : ( ','.join( [ 'SiPixelTemplateDBObject_phase2_T15_v2_mc' ,SiPixelTemplatesRecord,connectionString, "" , "2019-11-05 20:00:00.000"] ), ), # cell is 25um (local-x) x 100um (local-y) , VBias=350V
}

##
## All of the following conditions are not yet in active use, but will be activated in GT along the way
##

allTags["Template2Dnum"] = {
'T6' : ( ','.join( [ 'SiPixel2DTemplateDBObject_phase2_T6_v0_num' ,SiPixel2DTemplatesRecord,connectionString, "numerator", "2019-07-15 12:00:00.000"] ), ),
'T14' : ( ','.join( [ 'SiPixel2DTemplateDBObject_phase2_T14_v0_num' ,SiPixel2DTemplatesRecord,connectionString, "numerator", "2019-07-15 12:00:00.000"] ), ),
Expand All @@ -59,7 +65,7 @@
}

# list of active tags to be replaced
activeKeys = ["LA","LAWidth","SimLA"]
activeKeys = ["LA","LAWidth","SimLA","LAfromAlignment","GenError","Template"]

# list of geometries supported
activeDets = ["T6","T14","T15"]
Expand All @@ -70,7 +76,7 @@
appendedTags += allTags[key][det]
phase2GTs["phase2_realistic_"+det] = ('phase2_realistic', appendedTags)

# method called in autoAlCa
# method called in autoCond
def autoCondPhase2(autoCond):
for key,val in six.iteritems(phase2GTs):
if len(val)==1 :
Expand Down
Expand Up @@ -20,9 +20,6 @@
PropagatorOpposite = cms.string("RungeKuttaTrackerPropagatorOpposite")
)

from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(materialDumperAnalyzer, TrackerRecHitBuilder='WithTrackAngle')

materialDumper = cms.Sequence(materialDumperAnalyzer)
materialDumper_step = cms.Path(materialDumper)

Expand Up @@ -43,10 +43,6 @@ def thresholds( wp ) :
_fastSim_lowPtGsfElectronSeeds.PreGsfLabel = cms.string("")
fastSim.toReplaceWith(lowPtGsfElectronSeeds,_fastSim_lowPtGsfElectronSeeds)

# Modifiers for Phase2
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(lowPtGsfElectronSeeds, TTRHBuilder = 'WithTrackAngle')

# Modifiers for BParking
from Configuration.Eras.Modifier_bParking_cff import bParking
bParking.toModify(lowPtGsfElectronSeeds, ModelThresholds = thresholds("VL") )
Expand Down
Expand Up @@ -3,10 +3,3 @@
from RecoLocalTracker.SiPixelRecHits._templates2_default_cfi import _templates2_default
templates2 = _templates2_default.clone()

# This customization will be removed once we get the templates for phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(templates2,
LoadTemplatesFromDB = False,
DoLorentz = False,
)

11 changes: 0 additions & 11 deletions RecoLocalTracker/SiPixelRecHits/python/PixelCPEGeneric_cfi.py
Expand Up @@ -8,14 +8,3 @@
from Configuration.Eras.Modifier_run3_common_cff import run3_common
run3_common.toModify(PixelCPEGenericESProducer, IrradiationBiasCorrection = True)

# This customization will be removed once we get the templates for phase2 pixel
# FIXME::Is the Upgrade variable actually used?
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(PixelCPEGenericESProducer,
UseErrorsFromTemplates = False,
LoadTemplatesFromDB = False,
TruncatePixelCharge = False,
IrradiationBiasCorrection = False,
DoCosmics = False,
Upgrade = cms.bool(True)
)
Expand Up @@ -3,10 +3,3 @@
from RecoLocalTracker.SiPixelRecHits._templates_default_cfi import _templates_default
templates = _templates_default.clone()

# This customization will be removed once we get the templates for phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(templates,
LoadTemplatesFromDB = False,
DoLorentz = False,
)

Expand Up @@ -55,7 +55,3 @@
)
displacedTracksSequence = cms.Sequence(displacedTracksTask)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(duplicateDisplacedTrackCandidates, ttrhBuilderName = "WithTrackAngle") # FIXME
5 changes: 0 additions & 5 deletions RecoMuon/GlobalTrackingTools/python/GlobalMuonRefitter_cff.py
Expand Up @@ -53,11 +53,6 @@
RefitFlag = cms.bool( True )
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(GlobalMuonRefitter, TrackerRecHitBuilder = 'WithTrackAngle') # FIXME

from Configuration.Eras.Modifier_fastSim_cff import fastSim
# FastSim doesn't use Runge Kute for propagation
fastSim.toModify(GlobalMuonRefitter, Propagator = "SmartPropagatorAny")
Expand Up @@ -79,11 +79,3 @@
),
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(GlobalTrajectoryBuilderCommon, # FIXME
TrackerRecHitBuilder = 'WithTrackAngle',
TrackTransformer = dict(TrackerRecHitBuilder = 'WithTrackAngle'),
GlbRefitterParameters = dict(TrackerRecHitBuilder = 'WithTrackAngle'),
)
5 changes: 0 additions & 5 deletions RecoMuon/MuonIdentification/python/TrackerKinkFinder_cfi.py
Expand Up @@ -19,8 +19,3 @@
)
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(TrackerKinkFinderParametersBlock, TrackerKinkFinderParameters = dict(TrackerRecHitBuilder = 'WithTrackAngle')) # FIXME

5 changes: 0 additions & 5 deletions RecoMuon/TrackingTools/python/MuonTrackLoader_cff.py
Expand Up @@ -88,8 +88,3 @@
)
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(MuonTrackLoaderForGLB, TrackLoaderParameters = dict(TTRHBuilder = 'WithTrackAngle')) # FIXME

Expand Up @@ -49,11 +49,6 @@
Min_dr = cms.double(0.2)
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(trackerDrivenElectronSeeds, TTRHBuilder = 'WithTrackAngle') # FIXME

from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
for e in [pp_on_XeXe_2017, pp_on_AA_2018]:
Expand Down
Expand Up @@ -30,10 +30,6 @@
duplicateTrackClassifier.mva.minLayers = [0,0,0]
duplicateTrackClassifier.mva.min3DLayers = [0,0,0]
duplicateTrackClassifier.mva.maxLostLayers = [99,99,99]
# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(duplicateTrackCandidates, ttrhBuilderName = "WithTrackAngle") # FIXME

generalTracks = DuplicateListMerger.clone()
generalTracks.originalSource = cms.InputTag("preDuplicateMergingGeneralTracks")
Expand Down
Expand Up @@ -21,9 +21,3 @@
RefitRPCHits = cms.bool(True),
Propagator = cms.string('SmartPropagatorAnyRKOpposite'),
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(inOutSeedsFromTrackerMuons, TrackerRecHitBuilder = 'WithTrackAngle') # FIXME

6 changes: 0 additions & 6 deletions RecoTracker/TrackProducer/python/TrackProducer_cfi.py
Expand Up @@ -26,9 +26,3 @@
MeasurementTracker = cms.string(''),
MeasurementTrackerEvent = cms.InputTag('MeasurementTrackerEvent'),
)

# This customization will be removed once we get the templates for
# phase2 pixel
from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
phase2_tracker.toModify(TrackProducer, TTRHBuilder = 'WithTrackAngle') # FIXME