CMS 3D CMS Logo

Functions | Variables
RemoveAddSevLevel Namespace Reference

Functions

def AddFlag (sevLevelComputer, flag="UserDefinedBit0", severity=10, verbose=True)
 
def PrintLevels (SLComp)
 
def RemoveFlag (sevLevelComputer, flag="HFLongShort")
 

Variables

 flag
 
 hcalRecAlgos
 
 severity
 

Function Documentation

◆ AddFlag()

def RemoveAddSevLevel.AddFlag (   sevLevelComputer,
  flag = "UserDefinedBit0",
  severity = 10,
  verbose = True 
)
Adds specified flag to severity level computer using specified severity level.
    If flag already exists at another severity level, it is removed from that level.

Definition at line 47 of file RemoveAddSevLevel.py.

References print(), and FastTimerService_cff.range.

47 def AddFlag(sevLevelComputer,flag="UserDefinedBit0",severity=10,verbose=True):
48  ''' Adds specified flag to severity level computer using specified severity level.
49  If flag already exists at another severity level, it is removed from that level.
50  '''
51 
52  AddedSeverity=False
53  removeSeverity=-1
54 
55  allowedflags=[]
56  for i in sevLevelComputer.SeverityLevels:
57  for j in i.RecHitFlags.value():
58  if j=="":
59  continue
60  allowedflags.append(j)
61 
62  #print "Allowed flags = ",allowedflags
63  if flag not in allowedflags and verbose:
64  print("\n\n")
65  for j in range(0,3):
66  print("###################################################")
67  print("\nWARNING!!!!!! You are adding a flag \n\t'%s' \nthat is not defined in the Severity Level Computer!"%flag)
68  print("This can be EXCEPTIONALLY dangerous if you do not \nknow what you are doing!\n")
69  print("Proceed with EXTREME caution!\n")
70  for j in range(0,3):
71  print("###################################################")
72  print("\n\n")
73 
74  #Loop over severity Levels
75  for i in range(len(sevLevelComputer.SeverityLevels)):
76  Level=sevLevelComputer.SeverityLevels[i].Level.value()
77  Flags=sevLevelComputer.SeverityLevels[i].RecHitFlags.value()
78  if Level==severity: # Found the specified level
79  if (Flags==['']):
80  Flags=[flag] # Create new vector for this flag
81  else:
82  if flag not in Flags: # don't need to add flag if it's already there
83  Flags.append(flag) # append flag to existing vector
84  sevLevelComputer.SeverityLevels[i].RecHitFlags=Flags # Set new RecHitFlags vector
85  AddedSeverity=True
86  else: # Found some other level; be sure to remove flag from it
87  if flag not in Flags:
88  continue
89  else:
90  Flags.remove(flag)
91  ChanStat=sevLevelComputer.SeverityLevels[i].ChannelStatus.value()
92  # Removing flag leaves nothing else: need to remove this level completely
93  if len(Flags)==0 and ChanStat==['']:
94  removeSeverity=i
95  else:
96  sevLevelComputer.SeverityLevels[i].RecHitFlags=Flags
97 
98  # Remove any newly-empty levels
99  if (removeSeverity>-1):
100  sevLevelComputer.SeverityLevels.remove(sevLevelComputer.SeverityLevels[removeSeverity])
101 
102  # No existing severity level for specified severity was found;
103  # add a new one
104  if (AddedSeverity==False):
105  sevLevelComputer.SeverityLevels.append(cms.PSet(Level=cms.int32(severity),
106  RecHitFlags=cms.vstring(flag),
107  ChannelStatus=cms.vstring("")))
108  return sevLevelComputer
109 
110 
111 
def AddFlag(sevLevelComputer, flag="UserDefinedBit0", severity=10, verbose=True)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ PrintLevels()

def RemoveAddSevLevel.PrintLevels (   SLComp)

Definition at line 37 of file RemoveAddSevLevel.py.

References print().

37 def PrintLevels(SLComp):
38  print("Severity Level Computer Levels and associated flags/Channel Status values:")
39  for i in SLComp.SeverityLevels:
40  print("\t Level = %i"%i.Level.value())
41  print("\t\t RecHit Flags = %s"%i.RecHitFlags.value())
42  print("\t\t Channel Status = %s"%i.ChannelStatus.value())
43  print()
44  return
45 
46 
def PrintLevels(SLComp)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

◆ RemoveFlag()

def RemoveAddSevLevel.RemoveFlag (   sevLevelComputer,
  flag = "HFLongShort" 
)
Removes the specified flag from the Severity Level Computer,
and returns the revised Computer.

Definition at line 6 of file RemoveAddSevLevel.py.

References FastTimerService_cff.range.

6 def RemoveFlag(sevLevelComputer,flag="HFLongShort"):
7  ''' Removes the specified flag from the Severity Level Computer,
8  and returns the revised Computer.'''
9 
10  removeSeverity=-1 # Track which Severity Level has been modified
11 
12 
13 
14  # Loop over all levels
15  for i in range(len(sevLevelComputer.SeverityLevels)):
16  Flags=sevLevelComputer.SeverityLevels[i].RecHitFlags.value()
17  if flag not in Flags: # Flag not present for this level
18  continue
19  #Remove flag
20  Flags.remove(flag)
21  ChanStat=sevLevelComputer.SeverityLevels[i].ChannelStatus.value()
22  # Check to see if Severity Level no longer contains any useful information
23  if len(Flags)==0 and ChanStat==['']:
24  removeSeverity=i
25  else:
26  # Set revised list of flags for this severity level
27  sevLevelComputer.SeverityLevels[i].RecHitFlags=Flags
28  break
29 
30  # Removing flag results in empty severity level; remove it
31  if (removeSeverity>-1):
32  sevLevelComputer.SeverityLevels.remove(sevLevelComputer.SeverityLevels[removeSeverity])
33 
34  return sevLevelComputer
35 
36 
def RemoveFlag(sevLevelComputer, flag="HFLongShort")

Variable Documentation

◆ flag

RemoveAddSevLevel.flag

Definition at line 117 of file RemoveAddSevLevel.py.

Referenced by HcalOnlineHarvesting._dqmEndLuminosityBlock(), MuonSensitiveDetector.acceptHit(), SiStripDcsInfo.addBadModules(), EcalSelectiveReadoutValidation.anaDigi(), SiStripBadComponentsDQMServiceReader.analyze(), EcalRecHitsValidation.analyze(), EcalSelectiveReadoutValidation.analyzeEB(), EcalSelectiveReadoutValidation.analyzeEE(), HitParentTest.analyzeHits(), CTPPSDetId.armName(), AlCaIsoTracksProducerFilter.beginRun(), AlCaHBHEMuonFilter.beginRun(), AlCaHEMuonFilter.beginRun(), AlCaLowPUHBHEMuonFilter.beginRun(), IsoTrackCalibration.beginRun(), HcalIsoTrkSimAnalyzer.beginRun(), AlCaHcalHBHEMuonProducer.beginRun(), HcalIsoTrkAnalyzer.beginRun(), CSCAFEBConnectAnalysis.bookForId(), CSCAFEBThrAnalysis.bookForId(), Phase2TrackerValidateDigi.bookLayerHistos(), TangentApproachInRPhi.calculate(), DTTracoChip.calculateAngles(), TotemT2DetId.channelName(), CTPPSDiamondDetId.channelName(), TotemTimingDetId.channelName(), check_files(), l1t::CaloCluster.checkClusterFlag(), cond::service::DTHVCheckByAbsoluteValues.checkCurrentStatus(), cond::service::DTHVCheckWithHysteresis.checkCurrentStatus(), RPCDCSSummary.checkDCSbit(), RPCDataCertification.checkFED(), HIPplots.CheckFileExistence(), HGCUncalibratedRecHit.checkFlag(), EcalUncalibratedRecHit.checkFlag(), FTLUncalibratedRecHit.checkFlag(), FTLRecHit.checkFlag(), HGCRecHit.checkFlag(), EcalRecHit.checkFlag(), FlagsCleanerECAL.checkFlags(), AlignmentTrackSelector.checkPrescaledHits(), EcalSelectiveReadoutValidation.checkSrApplication(), EgammaHLTNxNClusterProducer.checkStatusOfEcalRecHit(), HLTEcalResonanceFilter.checkStatusOfEcalRecHit(), HLTRegionalEcalResonanceFilter.checkStatusOfEcalRecHit(), CTPPSPixelFramePosition.checkXMLAttributeFlag(), TotemT2FramePosition.checkXMLAttributeFlag(), TotemFramePosition.checkXMLAttributeFlag(), TotemRPDetId.chipName(), StackingAction.ClassifyNewTrack(), RawFile.close(), SiStripMonitorTrack.clusterInfos(), ClosestApproachInRPhi.compute(), DTTime2DriftParametrization.computeDriftDistance_mean(), DTTime2DriftParametrization.computeDriftDistance_mode(), TShapeAnalysis.computeShape(), SiStripHistoId.createHistoLayer(), DreamSD.curve_LY(), EcalRecHitParametersGPU::DBStatus.DBStatus(), dccPhiIndexOfRU(), DDIsValid(), SRBlockFormatter.DigiToRaw(), FWRPZView.doCompression(), SiStripPopConBadComponentsHandlerFromDQM.dqmEndJob(), DTDigitizer.driftTimeFromParametrization(), EcalDumpGeometry.dumpTouch(), EBSrFlag.EBSrFlag(), spr.eECALmatrix(), EESrFlag.EESrFlag(), reco::PFCandidateElectronExtra.electronStatus(), reco::PFCandidateEGammaExtra.electronStatus(), SiStripBadStrip.encode(), SiStripBadStrip.encodePhase2(), EcalPerEvtLaserAnalyzer.endJob(), ZeeCalibration.endOfJob(), InvRingCalib.endOfLoop(), spr.energyECAL(), tnp::BaseTreeFiller.fill(), SiStripQualityChecker.fillDetectorStatus(), StudyCaloResponse.fillEnergy(), HGCROCChannelDataFrame< D >.fillFlag1(), HGCROCChannelDataFrame< D >.fillFlag2(), MELaserPrim.fillHistograms(), HLXMonitor.FillHistograms(), CaloSteppingAction.fillHit(), HLTPathSelector.filter(), HGCalTBCheckGunPostion.filter(), FWFileEntry.filterEventsWithCustomParser(), SiStripDaqInfo.findExcludedModule(), EcalSrFlag.flagName(), TrackingUtility.getBadModuleStatus(), SiStripUtility.getBadModuleStatus(), DTTracoLUTs.getBendAng(), CSCDCCFormatStatusDigi.getCSCErrorFlag(), CSCDCCFormatStatusDigi.getCSCPayloadFlag(), CSCDCCFormatStatusDigi.getCSCStatusFlag(), CSCDCCFormatStatusDigi.getDDUErrorFlag(), CSCDCCFormatStatusDigi.getDDUSummaryFlag(), CaloSteppingAction.getDepth(), SiStripTrackerMapCreator.getDetectorFlagAndComment(), Phase2TrackerMonitorDigi.getHistoId(), Phase2TrackerValidateDigi.getHistoId(), SiStripQualityChecker.getModuleStatus(), SiStripBadStripFromASCIIFile.getNewObject(), DTTracoLUTs.getPhiRad(), OMTFReconstruction.getProcessorCandidates(), AlCaHcalIsotrkProducer.getProducts(), EcalSimRawData.getSrfs(), cms::DDFilteredView.getValuesNS(), EgammaHcalIsolation.goodHitEnergy(), CSCAFEBConnectAnalysis.hf1ForId(), CSCAFEBThrAnalysis.hf1ForId(), CSCAFEBConnectAnalysis.hf2ForId(), CSCAFEBThrAnalysis.hf2ForId(), HLTAlphaTFilter< T >.hltFilter(), HcalDDDRecConstants.initialize(), StackingAction.isItFromPrimary(), HCalSD.isItinFidVolume(), StackingAction.isItPrimaryDecayProductOrConversion(), isLooseMuonCustom(), reco::MuonSegmentMatch.isMask(), StackingAction.isThisRegion(), HcalLayerDepthMap.isValid(), DTBtiChip.keepTrigPatt(), listbadmodule(), cms::SiPixelCondObjBuilder.loadFromFile(), cms::SiPixelCondObjOfflineBuilder.loadFromFile(), cms::SiPixelCondObjForHLTBuilder.loadFromFile(), MaterialBudgetVolume.loadLV(), ETLUncalibRecHitAlgo.makeRecHit(), EcalUncalibRecHitRecWeightsAlgo< EBDataFrame >.makeRecHit(), BTLUncalibRecHitAlgo.makeRecHit(), EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame >.makeRecHit(), HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame >.makeRecHit(), CaloHitID.markAsFinecaloTrackID(), L1MuGMTMerger.merge_rank(), reco::PFCandidateElectronExtra.mvaStatus(), reco::PFCandidateEGammaExtra.mvaStatus(), spr.newECALIdEW(), spr.newECALIdNS(), DDFilteredView.nextSibling(), math::Graph< Node2, AnotherDummy2 >.nodeIndex(), HcalIsoTrkSimAnalyzer.notaMuon(), HcalIsoTrkAnalyzer.notaMuon(), AlCaHcalIsotrkProducer.notaMuon(), HGCalDDDConstants.numberCellsHexagon(), DTHVStatusHandler.offlineList(), LegacyIOHelper.open(), cms.openssl_init(), SiStripTrackerMapCreator.paintTkMapFromAlarm(), Generator.particlePassesPrimaryCuts(), PileupJetIdentifier.passJetId(), HcalPedestalAnalysis.per2CapsHists(), CastorPedestalAnalysis.per2CapsHists(), PFRecHitQTestHCALChannel.PFRecHitQTestHCALChannel(), pos::PixelFEDConfig.PixelFEDConfig(), TotemT2DetId.planeName(), CTPPSDiamondDetId.planeName(), TotemTimingDetId.planeName(), TotemRPDetId.planeName(), HFFibreFiducial.PMTNumber(), BPHMonitor.Prescale(), SiStripActionExecutor.printFaultyModuleList(), EcalSelectiveReadoutProducer.printSrFlags(), SiStripTrackerMapCreator.printTopModules(), EgammaHLTPixelMatchElectronAlgo.process(), VertexClassifier.processesAtSimulation(), TrackClassifier.processesAtSimulation(), HcalPedestalAnalysis.processEvent(), CastorPedestalAnalysis.processEvent(), DTDataIntegrityTask.processuROS(), EcalDetIdToBeRecoveredProducer.produce(), OniaPhotonConversionProducer.produce(), l1t::L1ComparatorRun2.produce(), EcalDigiToRaw.produce(), reco::tau.pt_weighted_dx_T(), HGCalGeomTools.radius(), read_badmodlist(), JetPlusTrackCorrector.rebuildJta(), HFSimpleTimeCheck.reconstruct(), CTPPSDetId.rpName(), EcalSelectiveReadoutSuppressor.run(), ecaldqm::SelectiveReadoutTask.runOnDigis(), ecaldqm::SelectiveReadoutTask.runOnSrFlags(), MCTruthUtil.secondary(), AllInOneConfig.set_silent(), AllInOneConfig.set_verbose(), reco::GsfElectron.setAmbiguous(), EcalFenixStripFgvbEE.setbadStripMissing(), EcalFenixStrip.setbadStripMissing(), HGCalSiNoiseMap< HGCSiliconDetId >.setCachedOp(), DTStatusFlag.setCellDead(), DTDeadFlag.setCellDead_HV(), DTDeadFlag.setCellDead_RO(), DTDeadFlag.setCellDead_TP(), DTDeadFlag.setCellDiscCat(), DTStatusFlag.setCellNoHV(), DTStatusFlag.setCellNoise(), DTHVStatusHandler.setChannelFlag(), l1t::CaloCluster.setClusterFlag(), BPHDecayConstrainedBuilderBase.setConstr(), AHCalSD.setDetUnitId(), trklet::Track.setDuplicate(), L1Analysis::L1AnalysisRecoMet.SetECALFlags(), l1t::CaloParamsHelperO2O.setEgBypassECALFG(), l1t::CaloParamsHelper.setEgBypassECALFG(), l1t::CaloParamsHelperO2O.setEgBypassEGVetos(), l1t::CaloParamsHelper.setEgBypassEGVetos(), l1t::CaloParamsHelperO2O.setEgBypassExtHOverE(), l1t::CaloParamsHelper.setEgBypassExtHOverE(), l1t::CaloParamsHelper.setEgBypassHoE(), l1t::CaloParamsHelperO2O.setEgBypassShape(), l1t::CaloParamsHelper.setEgBypassShape(), L1MuDTTrackSegPhi.setEtaFlag(), L1MuBMTrackSegPhi.setEtaFlag(), l1t::CaloParamsHelperO2O.setEtSumBypassEcalSumPUS(), l1t::CaloParamsHelper.setEtSumBypassEcalSumPUS(), l1t::CaloParamsHelperO2O.setEtSumBypassEttPUS(), l1t::CaloParamsHelper.setEtSumBypassEttPUS(), l1t::CaloParamsHelperO2O.setEtSumBypassMetPUS(), l1t::CaloParamsHelper.setEtSumBypassMetPUS(), InputGenJetsParticleSelector.setExcludeResonances(), LMFCorrCoefDat.setFlag(), LMFCorrCoefDatComponent.setFlag(), FTLRecHit.setFlag(), HGCRecHit.setFlag(), EcalRecHit.setFlag(), DTHVStatus.setFlagA(), HGCUncalibratedRecHit.setFlagBit(), EcalUncalibratedRecHit.setFlagBit(), FTLUncalibratedRecHit.setFlagBit(), DTHVStatus.setFlagC(), DTLVStatus.setFlagCFE(), DTLVStatus.setFlagCMC(), DTLVStatus.setFlagDFE(), DTLVStatus.setFlagDMC(), DTHVStatus.setFlagS(), SiPixelRecHitQuality::Packing.setHasBadPixels(), SiPixelRecHitQuality::Packing.setHasFilledProb(), pat::Photon.setHasPixelSeed(), BPHKinematicFit.setIndependentFit(), SiPixelRecHitQuality::Packing.setIsOnEdge(), l1t::CaloParamsHelperO2O.setJetBypassPUS(), l1t::CaloParamsHelper.setJetBypassPUS(), l1t::CaloParamsHelperO2O.setJetPUSUsePhiRing(), l1t::CaloParamsHelper.setJetPUSUsePhiRing(), cond::persistency::ConnectionPool.setLogging(), reco::MuonSegmentMatch.setMask(), SiPixelFolderOrganizer.setModuleFolder(), CMSFieldManager.setMonopoleTracking(), InputGenJetsParticleSelector.setPartonicFinalState(), pat::Electron.setPassConversionVeto(), reco::GsfElectron.setPassCutBasedPreselection(), pat::Photon.setPassElectronVeto(), reco::GsfElectron.setPassMvaPreselection(), reco::GsfElectron.setPassPflowPreselection(), CaloTowersCreationAlgo.setRecoveredEcalHitsAreUsed(), CaloTowersCreationAlgo.setRecoveredHcalHitsAreUsed(), cond::payloadInspector::PlotImpl< UNSPECIFIED_IOV, NTAGS >.setSingleIov(), cond::payloadInspector::PlotImpl< UNSPECIFIED_IOV, 0 >.setSingleIov(), cond::payloadInspector::PlotImpl< UNSPECIFIED_IOV, 1 >.setSingleIov(), SiPixelRecHitQuality::Packing.setSpansTwoROCs(), TrackInformation.setStartedInFineVolume(), GflashHistogram.setStoreFlag(), InputGenJetsParticleSelector.setTausAsJets(), cond::payloadInspector::PlotImpl< MULTI_IOV, 0 >.setTwoTags(), cond::payloadInspector::PlotImpl< SINGLE_IOV, 0 >.setTwoTags(), cond::payloadInspector::PlotImpl< UNSPECIFIED_IOV, 0 >.setTwoTags(), CaloTowersCreationAlgo.setUseRejectedHitsOnly(), CaloTowersCreationAlgo.setUseRejectedRecoveredEcalHits(), CaloTowersCreationAlgo.setUseRejectedRecoveredHcalHits(), EcalSrFlag.setValue(), sim::LocalFieldManager.SetVerbosity(), CTPPSPixelFramePosition.setXMLAttribute(), TotemT2FramePosition.setXMLAttribute(), TotemFramePosition.setXMLAttribute(), SiPixelPhase1Base.SiPixelPhase1Base(), SortMuonSegmentMatches.SortMuonSegmentMatches(), CTPPSDetId.stationName(), HGCalTBMB.stopAfter(), HGCalTBMBProducer.stopAfter(), MaterialBudget.stopAfter(), MaterialBudgetForward.stopAfter(), HGCPassive.storeInfo(), CTPPSDetId.subDetectorName(), L1MuGMTLFMergeRankEtaQLUT.TheLookupFunction(), HistoryBase.traceSimHistory(), SimTrackManager.trackExists(), TangentApproachInRPhi.transverseCoord(), ClosestApproachInRPhi.transverseCoord(), CSCOfflineMonitor.typeIndex(), FTLRecHit.unsetFlag(), HGCRecHit.unsetFlag(), EcalRecHit.unsetFlag(), CaloSteppingAction.update(), L1TTestsSummary.updateL1TOccupancyMonitor(), L1TTestsSummary.updateL1TRateMonitor(), L1TTestsSummary.updateL1TSyncMonitor(), magfieldparam::BFit3D.UseSignedRad(), magfieldparam::BFit3D.UseSpline(), HGCalTopology.valid(), HGCalTBTopology.valid(), HcalZDCDetId.validDetId(), and HcalTopology.validHcal().

◆ hcalRecAlgos

RemoveAddSevLevel.hcalRecAlgos

Definition at line 116 of file RemoveAddSevLevel.py.

◆ severity

RemoveAddSevLevel.severity

Definition at line 117 of file RemoveAddSevLevel.py.