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

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

Definition at line 35 of file RemoveAddSevLevel.py.

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

Definition at line 4 of file RemoveAddSevLevel.py.

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

Variable Documentation

RemoveAddSevLevel.flag

Definition at line 114 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(), TangentApproachInRPhi.calculate(), DTTracoChip.calculateAngles(), l1t::CaloCluster.CaloCluster(), CTPPSDiamondDetId.channelName(), check_files(), cond::service::DTHVCheckWithHysteresis.checkCurrentStatus(), cond::service::DTHVCheckByAbsoluteValues.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(), DreamSD.getStepInfo(), CaloSD.getStepInfo(), ECalSD.getTrackID(), 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(), FTLSimpleUncalibRecHitAlgo.makeRecHit(), EcalUncalibRecHitRecWeightsAlgo< EBDataFrame >.makeRecHit(), EcalUncalibRecHitRecAnalFitAlgo< EBDataFrame >.makeRecHit(), HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame >.makeRecHit(), HcalDDDRecConstants.maxHFDepth(), L1MuGMTMerger.merge_rank(), 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(), TotemRPDetId.planeName(), HFFibreFiducial.PMTNumber(), 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(), TauIdMVAAuxiliaries.pt_weighted_dx(), 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.setEgBypassEGVetos(), l1t::CaloParamsHelper.setEgBypassEGVetos(), l1t::CaloParamsHelperO2O.setEgBypassExtHOverE(), l1t::CaloParamsHelper.setEgBypassExtHOverE(), L1MuDTTrackSegPhi.setEtaFlag(), L1MuBMTrackSegPhi.setEtaFlag(), l1t::CaloParamsHelper.setEtSumBypassEcalSumPUS(), l1t::CaloParamsHelperO2O.setEtSumBypassEcalSumPUS(), l1t::CaloParamsHelper.setEtSumBypassEttPUS(), l1t::CaloParamsHelperO2O.setEtSumBypassEttPUS(), l1t::CaloParamsHelper.setEtSumBypassMetPUS(), l1t::CaloParamsHelperO2O.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(), 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(), MaterialBudgetForward.stopAfter(), MaterialBudget.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 113 of file RemoveAddSevLevel.py.

RemoveAddSevLevel.severity

Definition at line 114 of file RemoveAddSevLevel.py.