CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
bookConverter Namespace Reference

Classes

class  OptionParser
 

Functions

def ccopy
 
def cexists
 
def compute
 
def create_declaration
 
def create_xsd
 
def kpermutation
 
def priorities
 
def read_data
 

Variables

dictionary comb = {}
 
dictionary elements = {}
 
list histograms = []
 
dictionary keys = {}
 
int len_max = 0
 
int len_min = 1000000
 
 max = len_max
 
int min = 2
 
tuple optManager = OptionParser()
 
 opts = opts.__dict__
 
dictionary prior = {}
 
tuple resdoc = dom.Document()
 
dictionary results = {}
 
tuple srcdoc = dom.parse(opts['src'])
 

Function Documentation

def bookConverter.ccopy (   a)

Definition at line 90 of file bookConverter.py.

Referenced by compute().

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

Definition at line 82 of file bookConverter.py.

Referenced by compute().

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

Definition at line 106 of file bookConverter.py.

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

Referenced by ClosestApproachInRPhi.calculate(), Basic2DGenericPFlowPositionCalc.calculateAndSetPositionActual(), TrackCountingTagPlotter.finalize(), IPTagPlotter< Container, Base >.finalize(), TrackProbabilityTagPlotter.finalize(), GenXSecAnalyzer.globalEndRun(), magfieldparam::BCycl< float >.operator()(), and GsfMaterialEffectsUpdator.updateState().

107 def compute(min, max):
108  print("Computing permutations")
109  for v in kpermutation(0, len(keys), min, max):
110  ci = -1
111  for h in histograms:
112  if cexists(h, v):
113  if ci == -1:
114  ci = len(comb)
115  comb[ci] = ccopy(v)
116  results[ci] = [h]
117  else:
118  results[ci].append(h)
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def bookConverter.create_declaration (   cid)

Definition at line 76 of file bookConverter.py.

References print().

76 
77 def create_declaration(cid):
78  co = comb[cid]
79  print("Declaration to apply:", co)
80  for k in comb[cid]:
81  print(keys[k]['name'], '=', keys[k]['value'])
def create_declaration
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def bookConverter.create_xsd ( )

Definition at line 58 of file bookConverter.py.

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

Definition at line 96 of file bookConverter.py.

References sistrip::SpyUtilities.range().

Referenced by compute().

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

Definition at line 119 of file bookConverter.py.

References bitset_utilities.append().

Referenced by TrackAlgoPriorityOrder.TrackAlgoPriorityOrder().

120 def priorities():
121  for ci in comb.keys():
122  l = len(results[ci])
123  if l == 1:
124  continue
125  if l not in prior:
126  prior[l] = [ci]
127  else:
128  prior[l].append(ci)
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
def bookConverter.read_data ( )

Definition at line 17 of file bookConverter.py.

References print().

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

Variable Documentation

dictionary bookConverter.comb = {}

Definition at line 145 of file bookConverter.py.

Referenced by L1GtAnalyzer.analyzeObjectMap(), JetPartonMatching.calculate(), CombinationGenerator< T >.combinations(), L1RCTORCAMap.combVec(), JetPartonMatching.getNumberOfUnmatchedPartons(), JetPartonMatching.getSumDeltaE(), JetPartonMatching.getSumDeltaPt(), JetPartonMatching.getSumDeltaR(), JetPartonMatching.print(), CombinationGenerator< T >.separateOneElement(), and CombinationGenerator< T >.splitInTwoCollections().

dictionary bookConverter.elements = {}

Definition at line 147 of file bookConverter.py.

Referenced by DQMPFCandidateAnalyzer.analyze(), FWPFBlockProxyBuilder.buildViewType(), calo_filter(), dd4hep.createPlacement(), BrilClient.dqmEndLuminosityBlock(), reco::PFDisplacedVertexCandidate.Dump(), dumpObject_(), 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(), reco::tau::RecoTauElectronRejectionPlugin.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(), and PFAlgo.reconstructParticles().

list bookConverter.histograms = []

Definition at line 142 of file bookConverter.py.

Referenced by HistoAnalyzer< C >.HistoAnalyzer(), and HistogramManagerHolder.HistogramManagerHolder().

dictionary bookConverter.keys = {}

Definition at line 143 of file bookConverter.py.

int bookConverter.len_max = 0

Definition at line 149 of file bookConverter.py.

int bookConverter.len_min = 1000000

Definition at line 148 of file bookConverter.py.

bookConverter.max = len_max

Definition at line 167 of file bookConverter.py.

int bookConverter.min = 2

Definition at line 165 of file bookConverter.py.

tuple bookConverter.optManager = OptionParser()

Definition at line 131 of file bookConverter.py.

bookConverter.opts = opts.__dict__

Definition at line 133 of file bookConverter.py.

dictionary bookConverter.prior = {}

Definition at line 146 of file bookConverter.py.

Referenced by l1tpf_impl::LinearizedPuppiAlgo.computePuppiWeights(), fftjetcms.fftjet_BgFunctor_parser(), reco::SequentialGhostTrackFitter.fit(), and reco::GhostTrackFitter.fit().

tuple bookConverter.resdoc = dom.Document()

Definition at line 139 of file bookConverter.py.

dictionary bookConverter.results = {}

Definition at line 144 of file bookConverter.py.

Referenced by HLTriggerJSONMonitoring.analyze(), L1TriggerJSONMonitoring.analyze(), calo::multifit.calculateChiSq(), edm::storage::StatisticsSenderService.closedFile(), HcalTrigTowerGeometry.detIds(), L1TStage2CaloLayer2Offline.doesNotOverlapWithHLTObjects(), TriggerBxMonitor.dqmAnalyze(), TriggerRatesMonitor.dqmAnalyze(), ESElectronicsSim.encode(), LA_Filler_Fitter.ensemble_results(), TritonClient.evaluate(), StraightTrackAlignment.finish(), PulseShapeFitOOTPileupCorrection.fit(), MuScleFitUtils.fitMass(), MuScleFitUtils.fitReso(), dqmoffline::l1t.getFiredTriggerIndices(), dqmoffline::l1t.getHLTFilters(), CSCWireHitSim.getIonizationClusters(), edm::Run.getManyByType(), edm::LuminosityBlock.getManyByType(), edm::PrincipalGetAdapter.getManyByType(), edm::Event.getManyByType(), dqmoffline::l1t.getMatchedTriggerObjects(), OMTFReconstruction.getProcessorCandidates(), 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(), L1GtTriggerMaskTechTrigConfigOnlineProd.newObject(), L1GtPrescaleFactorsAlgoTrigConfigOnlineProd.newObject(), L1GtPrescaleFactorsTechTrigConfigOnlineProd.newObject(), L1GtTriggerMaskAlgoTrigConfigOnlineProd.newObject(), L1GtTriggerMaskVetoTechTrigConfigOnlineProd.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(), SiStripClusterInfo.stripNoisesRescaledByGain(), LA_Filler_Fitter.summarize_ensembles(), L1GtTriggerMenuConfigOnlineProd.tableMenuGeneralFromDB(), HcalTrigTowerGeometry.towerIds(), sistrip::MeasureLA.write_report_text(), MuIsolatorResultProducer< BT >.writeOut(), and XMLConfigWriter.writeResultsData().

tuple bookConverter.srcdoc = dom.parse(opts['src'])

Definition at line 140 of file bookConverter.py.