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.

Referenced by compute().

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

◆ cexists()

def bookConverter.cexists (   s,
  c 
)

Definition at line 82 of file bookConverter.py.

Referenced by compute().

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 
def cexists(s, c)

◆ compute()

def bookConverter.compute (   min,
  max 
)

Definition at line 106 of file bookConverter.py.

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

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

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 
def kpermutation(vfrom, vto, min, max)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def cexists(s, c)
def compute(min, max)

◆ create_declaration()

def bookConverter.create_declaration (   cid)

Definition at line 76 of file bookConverter.py.

References print().

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 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def create_declaration(cid)

◆ 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.

References FastTimerService_cff.range.

Referenced by compute().

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 
def kpermutation(vfrom, vto, min, max)

◆ priorities()

def bookConverter.priorities ( )

Definition at line 119 of file bookConverter.py.

References mps_setup.append.

Referenced by TrackAlgoPriorityOrder.TrackAlgoPriorityOrder().

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 

◆ read_data()

def bookConverter.read_data ( )

Definition at line 17 of file bookConverter.py.

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

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 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47

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(), cms::alpakatools::detail::UniformElementsAlong< TAcc, Dim, typename >::const_iterator.const_iterator(), cms::alpakatools::detail::IndependentGroupElementsAlong< TAcc, Dim, typename >::const_iterator.const_iterator(), 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(), cms::alpakatools.make_workdiv(), reco::modules::HICaloCompatibleTrackSelector.matchPFCandToTrack(), PtIsolationAlgo< reco::Candidate, reco::CandidateCollection >.operator()(), TrkCalIsolationAlgo< T1, C2 >.operator()(), reco::tau::RecoTauElectronRejectionPlugin.operator()(), CalIsolationAlgo< T1, C2 >.operator()(), DTTPGParamsWriter.pharseLine(), cms::cuda::PortableDeviceCollection< PixelVertexWSSoALayout<> >.PortableDeviceCollection(), PortableDeviceCollection< TrackingRecHitLayout< TrackerTraits >, TDev >.PortableDeviceCollection(), PortableDeviceMultiCollection< TDev, T0, Args >.PortableDeviceMultiCollection(), cms::cuda::PortableHostCollection< PixelVertexWSSoALayout<> >.PortableHostCollection(), PortableHostCollection< TestSoA >.PortableHostCollection(), PortableHostMultiCollection< TestSoA, TestSoA2 >.PortableHostMultiCollection(), PFAlgo.processBlock(), ChargedHadronPFTrackIsolationProducer.produce(), PFElectronTranslator.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.

◆ 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.

◆ srcdoc

bookConverter.srcdoc

Definition at line 140 of file bookConverter.py.