CMS 3D CMS Logo

Classes | Functions | Variables
bookConverter Namespace Reference

Classes

class  OptionParser
 

Functions

def ccopy (a)
 
def cexists (s, c)
 
def compute (min, max)
 
def create_declaration (cid)
 
def create_xsd ()
 
def kpermutation (vfrom, vto, min, max)
 
def priorities ()
 
def read_data ()
 

Variables

 args
 
 comb
 
 elements
 
 histograms
 
 keys
 
 len_max
 
 len_min
 
 max
 
 min
 
 optManager
 
 opts
 
 prior
 
 resdoc
 
 results
 
 srcdoc
 

Function Documentation

◆ ccopy()

def bookConverter.ccopy (   a)

Definition at line 90 of file bookConverter.py.

90 def ccopy(a):
91  r = []
92  for v in a:
93  r.append(v)
94  return r
95 

Referenced by compute().

◆ cexists()

def bookConverter.cexists (   s,
  c 
)

Definition at line 82 of file bookConverter.py.

82 def cexists(s, c):
83  d = len(c)
84  for v1 in s:
85  for v2 in c:
86  if v1 == v2:
87  d = d - 1
88  return (d == 0)
89 

Referenced by compute().

◆ compute()

def bookConverter.compute (   min,
  max 
)

Definition at line 106 of file bookConverter.py.

106 def compute(min, max):
107  print("Computing permutations")
108  for v in kpermutation(0, len(keys), min, max):
109  ci = -1
110  for h in histograms:
111  if cexists(h, v):
112  if ci == -1:
113  ci = len(comb)
114  comb[ci] = ccopy(v)
115  results[ci] = [h]
116  else:
117  results[ci].append(h)
118 

References mps_setup.append, ccopy(), cexists(), kpermutation(), and print().

Referenced by DTCalibValidation.analyze(), DTCalibValidationFromMuons.analyze(), ClosestApproachInRPhi.calculate(), Basic2DGenericPFlowPositionCalc.calculateAndSetPositionActual(), DTParametrizedDriftAlgo.compute(), DTRecHitQuality.dqmAnalyze(), TrackCountingTagPlotter.finalize(), TrackProbabilityTagPlotter.finalize(), IPTagPlotter< Container, Base >.finalize(), and GsfMaterialEffectsUpdator.updateState().

◆ create_declaration()

def bookConverter.create_declaration (   cid)

Definition at line 76 of file bookConverter.py.

76 def create_declaration(cid):
77  co = comb[cid]
78  print("Declaration to apply:", co)
79  for k in comb[cid]:
80  print(keys[k]['name'], '=', keys[k]['value'])
81 

References print().

◆ create_xsd()

def bookConverter.create_xsd ( )

Definition at line 58 of file bookConverter.py.

58 def create_xsd():
59  for k in keys.keys():
60  name = keys[k]['name']
61 
62  root = resdoc.createElement("xs:complexType")
63  root.setAttribute("name", "HistogramType")
64  resdoc.appendChild(root)
65  seq = resdoc.createElement("xs:all")
66  root.appendChild(seq)
67  for e in sorted(elements.keys()):
68  el = resdoc.createElement("xs:element")
69  el.setAttribute("name", e)
70  el.setAttribute("type", elements[e]['type'])
71  if elements[e]['count'] < len(histograms):
72  el.setAttribute("minOccurs", '0')
73  el.setAttribute("maxOccurs", '1')
74  seq.appendChild(el)
75 

◆ kpermutation()

def bookConverter.kpermutation (   vfrom,
  vto,
  min,
  max 
)

Definition at line 96 of file bookConverter.py.

96 def kpermutation(vfrom, vto, min, max):
97  vto = vto + 1
98  queue = []
99  for i in range(vfrom, vto):
100  for j in range(i, vto):
101  queue.append(j)
102  if len(queue) >= min and len(queue) <= max:
103  yield queue
104  queue = []
105 

References FastTimerService_cff.range.

Referenced by compute().

◆ priorities()

def bookConverter.priorities ( )

Definition at line 119 of file bookConverter.py.

119 def priorities():
120  for ci in comb.keys():
121  l = len(results[ci])
122  if l == 1:
123  continue
124  if l not in prior:
125  prior[l] = [ci]
126  else:
127  prior[l].append(ci)
128 

References mps_setup.append.

Referenced by TrackAlgoPriorityOrder.TrackAlgoPriorityOrder().

◆ read_data()

def bookConverter.read_data ( )

Definition at line 17 of file bookConverter.py.

17 def read_data():
18  print("Reading histogram file")
19  n = 0
20  histos = srcdoc.getElementsByTagName("Histogram")
21  for histo in histos:
22  h = []
23  for key in histo.childNodes:
24  if key.nodeType == key.ELEMENT_NODE:
25  name = key.localName
26  value = key.childNodes[0].nodeValue
27  found = 0
28 
29  if name not in elements:
30  elements[name] = {'type': '', 'count': 0}
31  elements[name]['count'] = elements[name]['count'] + 1
32 
33  try:
34  i = int(value)
35  if elements[name]['type'] == '':
36  elements[name]['type'] = 'xs:integer'
37  except ValueError:
38  try:
39  i = float(value)
40  if elements[name]['type'] in ('', 'xs:integer'):
41  elements[name]['type'] = 'xs:double'
42  except ValueError:
43  elements[name]['type'] = 'xs:string'
44 
45  for k in keys.keys():
46  if keys[k]['name'] == name and keys[k]['value'] == value:
47  keys[k]['count'] = keys[k]['count'] + 1
48  h.append(k)
49  found = 1
50  break
51  if found == 0:
52  keys[n] = {'name': name, 'value': value, 'count': 1}
53  h.append(n)
54  n += 1
55  h.sort()
56  histograms.append(h)
57 

References dqmMemoryStats.float, createfilelist.int, and print().

Variable Documentation

◆ args

bookConverter.args

Definition at line 132 of file bookConverter.py.

◆ comb

bookConverter.comb

◆ elements

bookConverter.elements

Definition at line 147 of file bookConverter.py.

Referenced by DQMPFCandidateAnalyzer.analyze(), PFAlgo.associatePSClusters(), FWPFBlockProxyBuilder.buildViewType(), calo_filter(), PFAlgo.checkAndReconstructSecondaryInteraction(), PFAlgo.conversionAlgo(), PFAlgo.createCandidatesECAL(), PFAlgo.createCandidatesHCAL(), PFAlgo.createCandidatesHCALUnlinked(), PFAlgo.createCandidatesHF(), dd4hep.createPlacement(), PFAlgo.decideType(), BrilClient.dqmEndLuminosityBlock(), reco::PFDisplacedVertexCandidate.Dump(), dumpObject_(), PFAlgo.elementLoop(), PFEGammaAlgo.evaluateSingleLegMVA(), edm::eventsetup::EventSetupsController.getESProducerAndRegisterProcess(), edm::eventsetup::EventSetupsController.getESProducerPSet(), edm::eventsetup::EventSetupsController.getESSourceAndRegisterProcess(), l1t::Parameter.getVector(), init_filter(), edm::eventsetup::EventSetupsController.isFirstMatch(), edm::eventsetup::EventSetupsController.isLastMatch(), edm::eventsetup::EventSetupsController.isMatchingESProducer(), edm::eventsetup::EventSetupsController.isMatchingESSource(), PFEGammaAlgo.isMuon(), edm::eventsetup::EventSetupsController.lookForMatches(), reco::modules::HICaloCompatibleTrackSelector.matchPFCandToTrack(), TrkCalIsolationAlgo< T1, C2 >.operator()(), PtIsolationAlgo< reco::Candidate, reco::CandidateCollection >.operator()(), reco::tau::RecoTauElectronRejectionPlugin.operator()(), CalIsolationAlgo< T1, C2 >.operator()(), DTTPGParamsWriter.pharseLine(), PFAlgo.processBlock(), ChargedHadronPFTrackIsolationProducer.produce(), PFElectronTranslator.produce(), PFPhotonTranslator.produce(), PFEGammaProducer.produce(), IsolationProducer< C1, C2, Alg, OutputCollection, Setup >.produce(), reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >.produce(), SimPFProducer.produce(), PFAlgo.reconstructParticles(), PFAlgo.recoTracksNotHCAL(), and ElectronEnergyCalibrator.splitString().

◆ histograms

bookConverter.histograms

Definition at line 142 of file bookConverter.py.

Referenced by DTRecHitQuality.dqmAnalyze().

◆ keys

bookConverter.keys

Definition at line 143 of file bookConverter.py.

◆ len_max

bookConverter.len_max

Definition at line 149 of file bookConverter.py.

◆ len_min

bookConverter.len_min

Definition at line 148 of file bookConverter.py.

◆ max

bookConverter.max

Definition at line 167 of file bookConverter.py.

◆ min

bookConverter.min

Definition at line 165 of file bookConverter.py.

◆ optManager

bookConverter.optManager

Definition at line 131 of file bookConverter.py.

◆ opts

bookConverter.opts

Definition at line 132 of file bookConverter.py.

◆ prior

bookConverter.prior

◆ resdoc

bookConverter.resdoc

Definition at line 139 of file bookConverter.py.

◆ results

bookConverter.results

Definition at line 144 of file bookConverter.py.

Referenced by HLTriggerJSONMonitoring.analyze(), L1TriggerJSONMonitoring.analyze(), calo::multifit.calculateChiSq(), CosmicMuonSeedGenerator.createSeeds(), HcalTrigTowerGeometry.detIds(), L1TStage2CaloLayer2Offline.doesNotOverlapWithHLTObjects(), TriggerBxMonitor.dqmAnalyze(), TriggerRatesMonitor.dqmAnalyze(), ESElectronicsSim.encode(), LA_Filler_Fitter.ensemble_results(), ESRecHitSimAlgo.evalAmplitude(), TritonClient.evaluate(), edm::storage::StatisticsSenderService.filePreCloseEvent(), L1RCTParametersOnlineProd.fillScaleFactors(), edm::Principal.findProducts(), StraightTrackAlignment.finish(), PulseShapeFitOOTPileupCorrection.fit(), MuScleFitUtils.fitMass(), MuScleFitUtils.fitReso(), dqmoffline::l1t.getFiredTriggerIndices(), dqmoffline::l1t.getHLTFilters(), CSCWireHitSim.getIonizationClusters(), edm::Run.getManyByType(), edm::LuminosityBlock.getManyByType(), edm::Principal.getManyByType(), edm::PrincipalGetAdapter.getManyByType(), edm::Event.getManyByType(), edm::PrincipalGetAdapter.getManyByType_(), dqmoffline::l1t.getMatchedTriggerObjects(), OMTFReconstruction.getProcessorCandidates(), TritonClient.getResults(), GlobalMuonRefitter.getRidOfSelectStationHits(), dqmoffline::l1t.getTriggerObjects(), dqmoffline::l1t.getTriggerResults(), LA_Filler_Fitter.layer_results(), L1TEGammaOffline.matchesAnHLTObject(), LA_Filler_Fitter.module_results(), CSCTFAlignmentOnlineProd.newObject(), CSCTFConfigOnlineProd.newObject(), L1MuCSCPtLutConfigOnlineProd.newObject(), L1GctJetFinderParamsOnlineProd.newObject(), L1MuGMTChannelMaskOnlineProducer.newObject(), L1GtParametersConfigOnlineProd.newObject(), L1GtTriggerMaskVetoTechTrigConfigOnlineProd.newObject(), L1GtPrescaleFactorsAlgoTrigConfigOnlineProd.newObject(), L1GtPrescaleFactorsTechTrigConfigOnlineProd.newObject(), L1GtTriggerMaskAlgoTrigConfigOnlineProd.newObject(), L1GtTriggerMaskTechTrigConfigOnlineProd.newObject(), ESRecHitSimAlgo.oldEvalAmplitude(), ESRecHitSimAlgo.oldreconstruct(), dqmoffline::l1t.passesAnyTriggerFromList(), StraightTrackAlignment.printAlgorithmsLine(), StraightTrackAlignment.printLineSeparator(), StraightTrackAlignment.printQuantitiesLine(), CalibratedPhotonProducerT< T >.produce(), CalibratedElectronProducerT< T >.produce(), MuIsolatorResultProducer< BT >.produce(), NuclearInteractionSimulator.read(), fastsim::NuclearInteraction.read(), ESRecHitSimAlgo.reconstruct(), ESRecHitAnalyticAlgo.reconstruct(), ESRecHitFitAlgo.reconstruct(), PVFitter.runFitter(), TotemTimingRecHitProducerAlgorithm.simplifiedLinearRegression(), IdealResult.solve(), JanAlignmentAlgorithm.solve(), cscdqm::Utility.splitString(), SiStripClusterInfo.stripNoisesRescaledByGain(), LA_Filler_Fitter.summarize_ensembles(), L1GtTriggerMenuConfigOnlineProd.tableMenuGeneralFromDB(), HcalTrigTowerGeometry.towerIds(), sistrip::MeasureLA.write_report_text(), MuIsolatorResultProducer< BT >.writeOut(), MuIsolatorResultProducer< BT >.writeOutImpl(), XMLConfigWriter.writeResultsData(), OMTFReconstruction.writeResultToXML(), PPSAlignmentHarvester.xAlignment(), PPSAlignmentHarvester.xAlignmentRelative(), and PPSAlignmentHarvester.yAlignment().

◆ srcdoc

bookConverter.srcdoc

Definition at line 140 of file bookConverter.py.

bookConverter.kpermutation
def kpermutation(vfrom, vto, min, max)
Definition: bookConverter.py:96
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
bookConverter.cexists
def cexists(s, c)
Definition: bookConverter.py:82
bookConverter.compute
def compute(min, max)
Definition: bookConverter.py:106
bookConverter.ccopy
def ccopy(a)
Definition: bookConverter.py:90
bookConverter.create_declaration
def create_declaration(cid)
Definition: bookConverter.py:76
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
mps_setup.append
append
Definition: mps_setup.py:85
createfilelist.int
int
Definition: createfilelist.py:10
bookConverter.read_data
def read_data()
Definition: bookConverter.py:17
bookConverter.priorities
def priorities()
Definition: bookConverter.py:119
bookConverter.create_xsd
def create_xsd()
Definition: bookConverter.py:58