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

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 46 of file RemoveAddSevLevel.py.

References edm.print().

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

Definition at line 36 of file RemoveAddSevLevel.py.

References edm.print().

36 def PrintLevels(SLComp):
37  print("Severity Level Computer Levels and associated flags/Channel Status values:")
38  for i in SLComp.SeverityLevels:
39  print("\t Level = %i"%i.Level.value())
40  print("\t\t RecHit Flags = %s"%i.RecHitFlags.value())
41  print("\t\t Channel Status = %s"%i.ChannelStatus.value())
42  print()
43  return
44 
45 
def PrintLevels(SLComp)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def RemoveAddSevLevel.RemoveFlag (   sevLevelComputer,
  flag = "HFLongShort" 
)
Removes the specified flag from the Severity Level Computer,
and returns the revised Computer.

Definition at line 5 of file RemoveAddSevLevel.py.

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

Variable Documentation

RemoveAddSevLevel.flag

Definition at line 115 of file RemoveAddSevLevel.py.

Referenced by HcalOnlineHarvesting._dqmEndLuminosityBlock(), SiStripDcsInfo.addBadModules(), EcalSelectiveReadoutValidation.anaDigi(), SiStripBadComponentsDQMServiceReader.analyze(), EcalRecHitsValidation.analyze(), EcalSelectiveReadoutValidation.analyzeEB(), EcalSelectiveReadoutValidation.analyzeEE(), CTPPSDetId.armName(), AlCaIsoTracksProducerFilter.beginRun(), AlCaHBHEMuonFilter.beginRun(), IsoTrackCalibration.beginRun(), HcalIsoTrkAnalyzer.beginRun(), TangentApproachInRPhi.calculate(), DTTracoChip.calculateAngles(), l1t::CaloCluster.CaloCluster(), TotemTimingDetId.channelName(), CTPPSDiamondDetId.channelName(), check_files(), cond::service::DTHVCheckByAbsoluteValues.checkCurrentStatus(), cond::service::DTHVCheckWithHysteresis.checkCurrentStatus(), RPCDCSSummary.checkDCSbit(), RPCDataCertification.checkFED(), HIPplots.CheckFileExistence(), FTLUncalibratedRecHit.checkFlag(), HGCUncalibratedRecHit.checkFlag(), EcalUncalibratedRecHit.checkFlag(), FTLRecHit.checkFlag(), HGCRecHit.checkFlag(), EcalRecHit.checkFlag(), PFRecoTauAlgorithm.checkPos(), AlignmentTrackSelector.checkPrescaledHits(), EcalSelectiveReadoutValidation.checkSrApplication(), EgammaHLTNxNClusterProducer.checkStatusOfEcalRecHit(), HLTEcalResonanceFilter.checkStatusOfEcalRecHit(), HLTRegionalEcalResonanceFilter.checkStatusOfEcalRecHit(), TotemRPDetId.chipName(), StackingAction.ClassifyNewTrack(), RawFile.close(), ClosestApproachInRPhi.compute(), DTTime2DriftParametrization.computeDriftDistance_mean(), DTTime2DriftParametrization.computeDriftDistance_mode(), TShapeAnalysis.computeShape(), EcalDeadChannelRecoveryAlgos< DetIdT >.correct(), DTBtiChip.currentIntStep(), dccPhiIndexOfRU(), DDIsValid(), CSCValidation.doADCTiming(), CSCValidation.doGasGain(), SiStripPopConBadComponentsHandlerFromDQM.dqmEndJob(), DTDigitizer.driftTimeFromParametrization(), spr.eECALmatrix(), reco::PFCandidateElectronExtra.electronStatus(), reco::PFCandidateEGammaExtra.electronStatus(), EcalPerEvtLaserAnalyzer.endJob(), ZeeCalibration.endOfJob(), InvRingCalib.endOfLoop(), spr.energyECAL(), SiStripQualityChecker.fillDetectorStatus(), StudyHLT.fillEnergy(), MELaserPrim.fillHistograms(), HLXMonitor.FillHistograms(), HLTPathSelector.filter(), HGCalTBCheckGunPostion.filter(), FWFileEntry.filterEventsWithCustomParser(), SiStripDaqInfo.findExcludedModule(), EcalSrFlag.flagName(), ConversionFinder.getConversionInfo(), SiStripTrackerMapCreator.getDetectorFlagAndComment(), OMTFinputMaker.getFlag(), SiStripQualityChecker.getModuleStatus(), RPCBxTest.getMonitorElements(), SiStripBadStripFromASCIIFile.getNewObject(), DTTracoLUTs.getPhiRad(), OMTFReconstruction.getProcessorCandidates(), EcalSimRawData.getSrfs(), HLTAlphaTFilter< T >.hltFilter(), HcalDDDRecConstants.initialize(), ZMuMuAnalyzer_cynematics.isContained(), StackingAction.isItFromPrimary(), HCalSD.isItinFidVolume(), StackingAction.isItPrimaryDecayProductOrConversion(), isLooseMuonCustom(), SteppingAction.isLowEnergy(), reco::MuonSegmentMatch.isMask(), StackingAction.isThisRegion(), HcalLayerDepthMap.isValid(), listbadmodule(), ETLUncalibRecHitAlgo.makeRecHit(), FTLSimpleUncalibRecHitAlgo.makeRecHit(), BTLUncalibRecHitAlgo.makeRecHit(), EcalUncalibRecHitRecWeightsAlgo< EBDataFrame >.makeRecHit(), EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame >.makeRecHit(), HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame >.makeRecHit(), HcalDDDRecConstants.maxHFDepth(), L1MuGMTMerger.merge_rank(), HGCalDDDConstants.minSlope(), DQMStore.mtEnabled(), reco::PFCandidateElectronExtra.mvaStatus(), reco::PFCandidateEGammaExtra.mvaStatus(), spr.newECALIdEW(), spr.newECALIdNS(), DDFilteredView.nextSibling(), math::Graph< N, E >.nodeIndex(), DTHVStatusHandler.offlineList(), ZMuMuOverlap.operator()(), CSCValidation::ltrh.operator()(), MuScleFitUtils::byPt.operator()(), CTPPSPixelFramePosition.operator==(), TotemFramePosition.operator==(), SiStripTrackerMapCreator.paintTkMapFromAlarm(), Generator.particlePassesPrimaryCuts(), CastorPedestalAnalysis.per2CapsHists(), HcalPedestalAnalysis.per2CapsHists(), PFRecHitQTestHCALChannel.PFRecHitQTestHCALChannel(), pos::PixelFEDConfig.PixelFEDConfig(), 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(), HcalTopology.producerTag(), reco::tau.pt_weighted_dx_T(), read_badmodlist(), JetPlusTrackCorrector.rebuildJta(), HFSimpleTimeCheck.reconstruct(), reco::tau::RecoTauElectronRejectionPlugin.RecoTauElectronRejectionPlugin(), CTPPSDetId.rpName(), EcalSelectiveReadoutSuppressor.run(), ecaldqm::SelectiveReadoutTask.runOnDigis(), ecaldqm::SelectiveReadoutTask.runOnSrFlags(), reco::GsfElectron.setAmbiguous(), HGCUncalibratedRecHit.setAux(), EcalUncalibratedRecHit.setAux(), EcalFenixStripFgvbEE.setbadStripMissing(), EcalFenixStrip.setbadStripMissing(), DTStatusFlag.setCellDead(), DTStatusFlag.setCellNoHV(), DTStatusFlag.setCellNoise(), DTStatusFlag.setCellStatus(), DTDeadFlag.setCellStatus(), l1t::CaloCluster.setClusterFlag(), BPHBsToJPsiPhiBuilder.setConstr(), BPHBdToJPsiKxBuilder.setConstr(), BPHBuToJPsiKBuilder.setConstr(), AHCalSD.setDetUnitId(), 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(), OMTFinputMaker.setFlag(), FTLRecHit.setFlag(), HGCRecHit.setFlag(), EcalRecHit.setFlag(), DTHVStatus.setFlagA(), FTLUncalibratedRecHit.setFlagBit(), HGCUncalibratedRecHit.setFlagBit(), EcalUncalibratedRecHit.setFlagBit(), DTHVStatus.setFlagC(), DTLVStatus.setFlagCFE(), DTLVStatus.setFlagCMC(), DTLVStatus.setFlagDFE(), DTLVStatus.setFlagDMC(), DTHVStatus.setFlagS(), pat::Photon.setHasPixelSeed(), FTLUncalibratedRecHit.setId(), l1t::CaloParamsHelperO2O.setJetBypassPUS(), l1t::CaloParamsHelper.setJetBypassPUS(), l1t::CaloParamsHelperO2O.setJetPUSUsePhiRing(), l1t::CaloParamsHelper.setJetPUSUsePhiRing(), cond::persistency::ConnectionPool.setLogging(), reco::MuonSegmentMatch.setMask(), SiPixelFolderOrganizer.setModuleFolder(), InputGenJetsParticleSelector.setPartonicFinalState(), pat::Electron.setPassConversionVeto(), reco::GsfElectron.setPassCutBasedPreselection(), pat::Photon.setPassElectronVeto(), reco::GsfElectron.setPassMvaPreselection(), reco::GsfElectron.setPassPflowPreselection(), CaloTowersCreationAlgo.setRecoveredEcalHitsAreUsed(), CaloTowersCreationAlgo.setRecoveredHcalHitsAreUsed(), cond::payloadInspector::PlotBase.setSingleIov(), GflashHistogram.setStoreFlag(), InputGenJetsParticleSelector.setTausAsJets(), DatabasePDG.SetUseCharmParticles(), CaloTowersCreationAlgo.setUseRejectedHitsOnly(), CaloTowersCreationAlgo.setUseRejectedRecoveredEcalHits(), CaloTowersCreationAlgo.setUseRejectedRecoveredHcalHits(), sim::LocalFieldManager.SetVerbosity(), SiPixelPhase1Base.SiPixelPhase1Base(), SortMuonSegmentMatches.SortMuonSegmentMatches(), CTPPSDetId.stationName(), HGCalTBMB.stopAfter(), MaterialBudget.stopAfter(), MaterialBudgetForward.stopAfter(), HGCPassive.storeInfo(), CTPPSDetId.subDetectorName(), L1MuGMTLFMergeRankEtaQLUT.TheLookupFunction(), HistoryBase.traceSimHistory(), SimTrackManager.trackExists(), TangentApproachInRPhi.transverseCoord(), ClosestApproachInRPhi.transverseCoord(), FTLRecHit.unsetFlag(), HGCRecHit.unsetFlag(), EcalRecHit.unsetFlag(), L1TTestsSummary.updateL1TOccupancyMonitor(), L1TTestsSummary.updateL1TRateMonitor(), L1TTestsSummary.updateL1TSyncMonitor(), magfieldparam::BFit3D.UseSignedRad(), magfieldparam::BFit3D.UseSpline(), FastTimeTopology.valid(), HGCalTopology.valid(), HcalZDCDetId.validDetId(), and LMFCorrCoefDatComponent.~LMFCorrCoefDatComponent().

RemoveAddSevLevel.hcalRecAlgos

Definition at line 114 of file RemoveAddSevLevel.py.

RemoveAddSevLevel.severity

Definition at line 115 of file RemoveAddSevLevel.py.