Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-28 23:48:25

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from DQM.SiPixelPhase1Common.SpecificationBuilder_cfi import Specification, parent
0004 
0005 SiPixelPhase1Geometry = cms.PSet(
0006   # SPixel*Name and friends use the isUpgrade flag, so we also have it as a setting here.
0007   upgradePhase = cms.int32(1),
0008 
0009   # module geometry. The phase1 detector has only one sort, so this is easy.
0010   # the values are assumed to be 0-based, unlike most others.
0011   # TODO: maybe we can use the SiPixelFrameReverter and friends to do these
0012   # conversions without these parameters here.
0013   module_rows = cms.int32(160),
0014   module_cols = cms.int32(416),
0015   roc_rows = cms.int32(80),
0016   roc_cols = cms.int32(52),
0017   n_rocs = cms.int32(16), # two-row geometry is assumed
0018 
0019   # "time geometry" parameters
0020   max_lumisection = cms.int32(5000),
0021   max_bunchcrossing = cms.int32(3600),
0022 
0023   # to select a different cabling map (for pilotBlade)
0024   CablingMapLabel = cms.string(""),
0025 
0026   # online-specific things
0027   onlineblock = cms.int32(20),    # #LS after which histograms are reset
0028   n_onlineblocks = cms.int32(100),  # #blocks to keep for histograms with history
0029 
0030   # lumiblock -  for coarse temporal splitting 
0031   lumiblock = cms.int32(10),       # Number of LS to include in a block
0032 
0033   # other geometry parameters (n_layers, n_ladders per layer, etc.) are inferred.
0034   # there are lots of geometry assuptions in the code.
0035 )
0036 
0037 # the wrapping here is necessary to switch 'enabled' later.
0038 PerModule = cms.PSet(enabled = cms.bool(True)) # normal histos per module
0039 PerLadder = cms.PSet(enabled = cms.bool(True)) # histos per ladder, profiles
0040 PerLayer2D = cms.PSet(enabled = cms.bool(True)) # 2D maps/profiles of layers
0041 PerLayer1D = cms.PSet(enabled = cms.bool(True)) # normal histos per layer
0042 PerReadout = cms.PSet(enabled = cms.bool(False)) # "Readout view", also for initial timing
0043 OverlayCurvesForTiming= cms.PSet(enabled = cms.bool(False)) #switch to overlay digi/clusters curves for timing scan
0044 IsOffline = cms.PSet(enabled = cms.bool(True)) # should be switch off for Online
0045 
0046 # Default histogram configuration. This is _not_ used automatically, but you
0047 # can import and pass this (or clones of it) in the plugin config.
0048 DefaultHisto = cms.PSet(
0049   # Setting this to False hides all plots of this HistogramManager. It does not even record any data.
0050   enabled = cms.bool(True),
0051 
0052   # If this is set to False Overflows will not be used for statistics evaluation (i.e. Mean,RMS)
0053   statsOverflows = cms.bool(True),
0054 
0055   # a.k.a. online harvesting. Might be useful in offline for custom harvesting,
0056   # but the main purpose is online, where this is on by default.
0057   perLumiHarvesting = cms.bool(False),
0058 
0059   # If False, no histograms are booked for DetIds where any column is undefined.
0060   # since or-columns are not supported any longer, this has to be False, otherwise
0061   # you will see a PXBarrel_UNDEFINED with endcap modules and the other way round.
0062   # It could still be useful for debugging, to see if there is more UNDEFINED
0063   # than expected.
0064   bookUndefined = cms.bool(False),
0065 
0066   # where the plots should go.
0067   topFolderName = cms.string("PixelPhase1"),
0068 
0069   # Histogram parameters
0070   name = cms.string("unnamed"),
0071   title = cms.string("Histogram of Something"),
0072   xlabel = cms.string("something"),
0073   ylabel = cms.string("count"),
0074   dimensions = cms.int32(1),
0075   range_min = cms.double(0),
0076   range_max = cms.double(100),
0077   range_nbins = cms.int32(100),
0078   range_y_min = cms.double(0),
0079   range_y_max = cms.double(100),
0080   range_y_nbins = cms.int32(100),
0081 
0082   # This structure is output by the SpecficationBuilder.
0083   specs = cms.VPSet()
0084   #  cms.PSet(spec =
0085   #    cms.VPset(
0086   #      cms.PSet(
0087   #        type = GROUPBY,
0088   #        stage = FIRST,
0089   #        columns = cms.vstring("P1PXBBarrel|P1PXECEndcap", "DetId"),
0090   #        arg = cms.string("")
0091   #      ),
0092   #     cms.PSet(
0093   #       type = SAVE,
0094   #       stage = STAGE1,
0095   #       columns = cms.vstring(),
0096   #       arg = cms.string("")
0097   #     )
0098   #   )
0099   # )
0100   #)
0101 )
0102 
0103 DefaultHistoDigiCluster=DefaultHisto.clone(
0104     topFolderName = "PixelPhase1/Phase1_MechanicalView"
0105 )
0106 
0107 DefaultHistoSummary=DefaultHisto.clone(
0108     topFolderName = "PixelPhase1/Summary"
0109 )
0110 
0111 DefaultHistoTrack=DefaultHisto.clone(
0112     topFolderName = "PixelPhase1/Tracks"
0113 )
0114 
0115 DefaultHistoReadout=DefaultHisto.clone(
0116     topFolderName = "PixelPhase1/FED/Readout"
0117 )
0118 
0119 # Commonly used specifications.
0120 StandardSpecifications1D = [
0121     # The column names are either defined in the GeometryInterface.cc or read from TrackerTopology.
0122     # Endcap names side by side. The "/" separates columns and also defines how the output folders are nested.
0123 
0124     # per-ladder and profiles
0125     Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder")
0126                             .save()
0127                             .reduce("MEAN")
0128                             .groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
0129                             .save(),
0130     Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade")
0131                             .save()
0132                             .reduce("MEAN")
0133                             .groupBy("PXForward/HalfCylinder/PXRing/PXDisk", "EXTEND_X")
0134                             .save()
0135                             .groupBy("PXForward/HalfCylinder/PXRing/", "EXTEND_X")
0136                             .save(),
0137     Specification().groupBy("PXBarrel").save(),
0138     Specification().groupBy("PXForward").save(),
0139     Specification(PerLayer1D).groupBy("PXBarrel/Shell/PXLayer").save(),
0140     Specification(PerLayer1D).groupBy("PXForward/HalfCylinder/PXRing/PXDisk").save(),
0141 
0142     Specification(PerModule).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName").save(),
0143     Specification(PerModule).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName").save(),
0144 
0145     Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel")
0146                             .reduce("MEAN")
0147                             .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade","EXTEND_X")
0148                             .save(),
0149     Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/SignedModule")
0150                             .reduce("MEAN")
0151                             .groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
0152                             .save(),
0153     Specification().groupBy("PXBarrel/PXLayer")
0154                             .save(),
0155     Specification().groupBy("PXForward/PXDisk")
0156                             .save()
0157 
0158 
0159 ]
0160 
0161 StandardSpecificationTrend = [
0162     Specification(PerModule).groupBy("PXBarrel/Lumisection")
0163                    .reduce("MEAN")
0164                    .groupBy("PXBarrel", "EXTEND_X")
0165                    .save(),
0166     Specification(PerModule).groupBy("PXForward/Lumisection")
0167                    .reduce("MEAN")
0168                    .groupBy("PXForward", "EXTEND_X")
0169                    .save(),
0170     Specification(IsOffline).groupBy("PXBarrel/LumiBlock")
0171                     .reduce("MEAN")
0172                     .groupBy("PXBarrel", "EXTEND_X")
0173                     .save(),
0174     Specification(IsOffline).groupBy("PXForward/LumiBlock")
0175                    .reduce("MEAN")
0176                    .groupBy("PXForward", "EXTEND_X")
0177                    .save()
0178 ]
0179 
0180 StandardSpecificationTrend2D = [
0181     Specification(PerModule).groupBy("PXBarrel/PXLayer/Lumisection")
0182                    .reduce("MEAN")
0183                    .groupBy("PXBarrel/PXLayer", "EXTEND_X")
0184                    .groupBy("PXBarrel", "EXTEND_Y")
0185                    .save(),
0186     Specification(PerModule).groupBy("PXForward/PXDisk/Lumisection")
0187                    .reduce("MEAN")
0188                    .groupBy("PXForward/PXDisk","EXTEND_X")
0189                    .groupBy("PXForward", "EXTEND_Y")
0190                    .save(),
0191     Specification(IsOffline).groupBy("PXBarrel/PXLayer/LumiBlock")
0192                    .reduce("MEAN")
0193                    .groupBy("PXBarrel/PXLayer", "EXTEND_X")
0194                    .groupBy("PXBarrel", "EXTEND_Y")
0195                    .save(),
0196     Specification(IsOffline).groupBy("PXForward/PXDisk/LumiBlock")
0197                    .reduce("MEAN")
0198                    .groupBy("PXForward/PXDisk","EXTEND_X")
0199                    .groupBy("PXForward", "EXTEND_Y")
0200                    .save()
0201 ]
0202 
0203 StandardSpecification2DProfile = [
0204     Specification(PerLayer2D)
0205        .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
0206        .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
0207        .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
0208        .reduce("MEAN")
0209        .save(),
0210     Specification(PerLayer2D)
0211        .groupBy("PXForward/PXRing/SignedBladePanel/PXDisk")
0212        .groupBy("PXForward/PXRing/SignedBladePanel", "EXTEND_X")
0213        .groupBy("PXForward/PXRing", "EXTEND_Y")
0214        .reduce("MEAN")
0215        .save(),
0216 ]
0217 
0218 StandardSpecification2DOccupancy = [
0219     Specification(PerLayer2D)
0220        .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
0221        .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
0222        .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
0223        .save(),
0224     Specification(PerLayer2D)
0225        .groupBy("PXForward/PXRing/SignedBladePanel/PXDisk")
0226        .groupBy("PXForward/PXRing/SignedBladePanel", "EXTEND_X")
0227        .groupBy("PXForward/PXRing", "EXTEND_Y")
0228        .save(),
0229 ]
0230 
0231 StandardSpecificationPixelmapProfile = [#produces pixel map with the mean (TProfile)
0232     Specification(PerLayer2D)
0233        .groupBy("PXBarrel/PXLayer/SignedLadderCoord/SignedModuleCoord")
0234        .groupBy("PXBarrel/PXLayer/SignedLadderCoord", "EXTEND_X")
0235        .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
0236        .reduce("MEAN")
0237        .save(),
0238     Specification(PerLayer2D)
0239        .groupBy("PXForward/PXRing/SignedBladePanelCoord/SignedDiskCoord")
0240        .groupBy("PXForward/PXRing/SignedBladePanelCoord", "EXTEND_X")
0241        .groupBy("PXForward/PXRing", "EXTEND_Y")
0242        .reduce("MEAN")
0243        .save(),
0244 ]
0245 
0246 StandardSpecificationOccupancy = [ #this produces pixel maps with counting
0247     Specification(PerLayer2D)
0248        .groupBy("PXBarrel/PXLayer/SignedLadderCoord/SignedModuleCoord")
0249        .groupBy("PXBarrel/PXLayer/SignedLadderCoord", "EXTEND_X")
0250        .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
0251        .save(),
0252     Specification(PerLayer2D)
0253        .groupBy("PXForward/PXRing/SignedBladePanelCoord/SignedDiskCoord")
0254        .groupBy("PXForward/PXRing/SignedBladePanelCoord", "EXTEND_X")
0255        .groupBy("PXForward/PXRing", "EXTEND_Y")
0256        .save()
0257     #Specification(PerLayer2D) # FPIX as one plot
0258     #   .groupBy("PXForward/SignedShiftedBladePanelCoord/SignedDiskRingCoord")
0259     #   .groupBy("PXForward/SignedShiftedBladePanelCoord", "EXTEND_X")
0260     #   .groupBy("PXForward", "EXTEND_Y")
0261     #   .save(),
0262 ]
0263 
0264 # the same for NDigis and friends. Needed due to technical limitations...
0265 StandardSpecifications1D_Num = [
0266     Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/DetId/Event")
0267                             .reduce("COUNT") # per-event counting
0268                             .groupBy("PXBarrel/Shell/PXLayer/SignedLadder").save()
0269                             .reduce("MEAN")
0270                             .groupBy("PXBarrel/Shell/PXLayer", "EXTEND_X")
0271                             .save(),
0272     Specification(PerModule).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName/Event")
0273                             .reduce("COUNT")
0274                             .groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXModuleName")
0275                             .save(),
0276     Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/DetId/Event")
0277                             .reduce("COUNT") # per-event counting
0278                             .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade").save()
0279                             .reduce("MEAN")
0280                             .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/", "EXTEND_X")
0281                             .save()
0282                             .groupBy("PXForward/HalfCylinder/PXRing/", "EXTEND_X")
0283                             .save(),
0284     Specification(PerModule).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName/Event")
0285                             .reduce("COUNT")
0286                             .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXModuleName")
0287                             .save(),
0288 
0289     Specification(PerLadder).groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel/Event")
0290                              .reduce("COUNT")
0291                              .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade/PXPanel")
0292                              .reduce("MEAN")
0293                              .groupBy("PXForward/HalfCylinder/PXRing/PXDisk/SignedBlade","EXTEND_X")
0294                              .save(),
0295     Specification(PerLadder).groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXBModule/Event")
0296                              .reduce("COUNT")
0297                              .groupBy("PXBarrel/Shell/PXLayer/SignedLadder/PXBModule")
0298                              .reduce("MEAN")
0299                              .groupBy("PXBarrel/Shell/PXLayer/SignedLadder", "EXTEND_X")
0300                              .save(),
0301 ]
0302 
0303 
0304 StandardSpecificationInclusive_Num = [#to count inclusively objects in substructures (BPix, FPix)
0305     Specification().groupBy("PXBarrel/Event")
0306                    .reduce("COUNT")
0307                    .groupBy("PXBarrel")
0308                    .save(),
0309     Specification().groupBy("PXForward/Event")
0310                    .reduce("COUNT")
0311                    .groupBy("PXForward")
0312                    .save(),
0313     Specification().groupBy("PXAll/Event")
0314                    .reduce("COUNT")
0315                    .groupBy("PXAll")
0316                    .save(),
0317 ]
0318 
0319 StandardSpecificationTrend_Num = [
0320     Specification(PerModule).groupBy("PXBarrel/PXLayer/Event")
0321                    .reduce("COUNT")
0322                    .groupBy("PXBarrel/PXLayer/Lumisection")
0323                    .reduce("MEAN")
0324                    .groupBy("PXBarrel/PXLayer","EXTEND_X")
0325                    .groupBy("PXBarrel", "EXTEND_Y")
0326                    .save(),
0327     Specification(PerModule).groupBy("PXBarrel/Event")
0328                    .reduce("COUNT")
0329                    .groupBy("PXBarrel/Lumisection")
0330                    .reduce("MEAN")
0331                    .groupBy("PXBarrel", "EXTEND_X")
0332                    .save(),
0333     Specification(PerModule).groupBy("PXForward/PXDisk/Event")
0334                    .reduce("COUNT")
0335                    .groupBy("PXForward/PXDisk/Lumisection")
0336                    .reduce("MEAN")
0337                    .groupBy("PXForward/PXDisk","EXTEND_X")
0338                    .groupBy("PXForward", "EXTEND_Y")
0339                    .save(),
0340     Specification(PerModule).groupBy("PXForward/Event")
0341                    .reduce("COUNT")
0342                    .groupBy("PXForward/Lumisection")
0343                    .reduce("MEAN")
0344                    .groupBy("PXForward", "EXTEND_X")
0345                    .save(),
0346     Specification(PerModule).groupBy("PXAll/Event")
0347                    .reduce("COUNT")
0348                    .groupBy("PXAll/Lumisection")
0349                    .reduce("MEAN")
0350                    .groupBy("PXAll", "EXTEND_X")
0351                    .save(),
0352     Specification(IsOffline).groupBy("PXBarrel/PXLayer/Event")
0353                    .reduce("COUNT")
0354                    .groupBy("PXBarrel/PXLayer/LumiBlock")
0355                    .reduce("MEAN")
0356                    .groupBy("PXBarrel/PXLayer","EXTEND_X")
0357                    .groupBy("PXBarrel", "EXTEND_Y")
0358                    .save(),
0359     Specification(IsOffline).groupBy("PXBarrel/Event")
0360                    .reduce("COUNT")
0361                    .groupBy("PXBarrel/LumiBlock")
0362                    .reduce("MEAN")
0363                    .groupBy("PXBarrel", "EXTEND_X")
0364                    .save(),
0365     Specification(IsOffline).groupBy("PXForward/PXDisk/Event")
0366                    .reduce("COUNT")
0367                    .groupBy("PXForward/PXDisk/LumiBlock")
0368                    .reduce("MEAN")
0369                    .groupBy("PXForward/PXDisk","EXTEND_X")
0370                    .groupBy("PXForward", "EXTEND_Y")
0371                    .save(),
0372     Specification(IsOffline).groupBy("PXForward/Event")
0373                    .reduce("COUNT")
0374                    .groupBy("PXForward/LumiBlock")
0375                    .reduce("MEAN")
0376                    .groupBy("PXForward", "EXTEND_X")
0377                    .save(),
0378     Specification(IsOffline).groupBy("PXAll/Event")
0379                    .reduce("COUNT")
0380                    .groupBy("PXAll/LumiBlock")
0381                    .reduce("MEAN")
0382                    .groupBy("PXAll", "EXTEND_X")
0383                    .save(),
0384 ]
0385 
0386 
0387 StandardSpecification2DProfile_Num = [
0388 
0389     Specification(PerLayer2D)
0390        .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule" + "/DetId/Event")
0391        .reduce("COUNT")
0392        .groupBy("PXBarrel/PXLayer/SignedLadder/SignedModule")
0393        .reduce("MEAN")
0394        .groupBy("PXBarrel/PXLayer/SignedLadder", "EXTEND_X")
0395        .groupBy("PXBarrel/PXLayer", "EXTEND_Y")
0396        .save(),
0397     Specification(PerLayer2D)
0398        .groupBy("DetId/Event")
0399        .reduce("COUNT")
0400        .groupBy("PXForward/PXRing/PXDisk/SignedBladePanel")
0401        .reduce("MEAN")
0402        .groupBy("PXForward/PXRing/PXDisk", "EXTEND_Y")
0403        .groupBy("PXForward/PXRing", "EXTEND_X")
0404        .save(),
0405 ]
0406 
0407 # function that makes a VPSet but flattens the argument list if needed
0408 def VPSet(*args):
0409     l = []
0410     for a in args:
0411         if isinstance(a, cms.VPSet) or isinstance(a, Specification):
0412             e = [a]
0413         else:
0414             e = list(a)
0415         l = l+e
0416     return cms.VPSet(l)