CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 89 of file bookConverter.py.

Referenced by compute().

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

Definition at line 81 of file bookConverter.py.

Referenced by compute().

81 
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)
def bookConverter.compute (   min,
  max 
)

Definition at line 105 of file bookConverter.py.

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

Referenced by magfieldparam::BCycl< float >.operator()(), DTRecHitBaseAlgo.reconstruct(), 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)
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.create_declaration (   cid)

Definition at line 75 of file bookConverter.py.

75 
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']
def create_declaration
def bookConverter.create_xsd ( )

Definition at line 57 of file bookConverter.py.

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

Definition at line 95 of file bookConverter.py.

Referenced by compute().

95 
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 = []
def bookConverter.priorities ( )

Definition at line 118 of file bookConverter.py.

References bitset_utilities.append().

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)
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 16 of file bookConverter.py.

16 
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)

Variable Documentation

dictionary bookConverter.comb = {}

Definition at line 144 of file bookConverter.py.

Referenced by L1RCTORCAMap.combVec(), JetPartonMatching.getNumberOfUnmatchedPartons(), JetPartonMatching.getSumDeltaE(), JetPartonMatching.getSumDeltaPt(), JetPartonMatching.getSumDeltaR(), and SequentialCombinationGenerator< T >.next_combination().

dictionary bookConverter.elements = {}

Definition at line 146 of file bookConverter.py.

Referenced by ora::MappingRawData.addElement(), calo_filter(), BrilClient.dqmEndLuminosityBlock(), ElementsInCone< math::XYZVector, DeltaR< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > >.operator()(), ElementsInEllipse< reco::PFCandidate, reco::PFCandidate >.operator()(), ElementsInAnnulus< math::XYZVector, DeltaR< math::XYZVector, math::XYZPoint >, Angle< math::XYZVector, math::XYZPoint >, std::pair< math::XYZPoint, float > >.operator()(), ElementsInAnnulus< T, M, N, std::pair< math::XYZPoint, float > >.operator()(), ElementsInAnnulusRef< T, M, N, std::pair< math::XYZPoint, float > >.operator()(), ElementsInConeRef< T, M, std::pair< math::XYZPoint, float > >.operator()(), ElementsInCone< T, M, std::pair< math::XYZPoint, float > >.operator()(), DTTPGParamsWriter.pharseLine(), IsolationProducer< C1, C2, Alg, OutputCollection, Setup >.produce(), and reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >.produce().

list bookConverter.histograms = []

Definition at line 141 of file bookConverter.py.

Referenced by HistoAnalyzer< C >.HistoAnalyzer().

dictionary bookConverter.keys = {}

Definition at line 142 of file bookConverter.py.

int bookConverter.len_max = 0

Definition at line 148 of file bookConverter.py.

int bookConverter.len_min = 1000000

Definition at line 147 of file bookConverter.py.

bookConverter.max = len_max

Definition at line 166 of file bookConverter.py.

Referenced by counter.Counter.__add__(), hcaldqm::DQTask._getCalibType(), Lepton.Lepton.absIsoFromEA(), Lepton.Lepton.absIsoR(), TMom.addEntry(), FedCablingAlgorithm.analyse(), TriggerSummaryAnalyzerAOD.analyze(), ThreeThresholdAlgorithm.appendBadNeighbors(), FWProxyBuilderConfiguration.assertParam(), OuterHitPhiPrediction.asym(), Vispa.Gui.ZoomableScrollArea.ZoomableScrollArea.autosizeScrollWidget(), PeriodicBinFinderInZ< float >.binIndex(), GeneralBinFinderInR< T >.binIndex(), GeneralBinFinderInZforGeometricSearchDet< float >.binIndex(), GenericBinFinderInZ< float, GeomDet >.binIndex(), MagBinFinders::GeneralBinFinderInR< double >.binIndex(), MagBinFinders::GeneralBinFinderInZ< double >.binIndex(), HcalDigisClient.book1D(), FWLongParameterSetter.build(), FWDoubleParameterSetter.build(), Traj2TrackHits.build(), MagGeoBuilderFromDDD::eLayer.buildMagELayer(), FWCaloTauProxyBuilder.buildViewType(), Averages.calc(), HcalPulseContainmentAlgo.calcpair(), RecoFCcorFactorAlgo< S >.calcpair(), TBPositionCalc.CalculateCMSPos(), tkDetUtil.calculatePhiWindow(), Quantile.calculateQ(), SiStripClusterInfo.chargeLR(), SimpleDAFHitCollector.clone(), Traj2TrackHits.clone(), Grid1D.closestNode(), npstat.closeWithinTolerance(), ForwardDetLayer.compatible(), PairProductionSimulator.compute(), EnergyLossSimulator.compute(), BremsstrahlungSimulator.compute(), ForwardDiskSectorBuilderFromWedges.computeBounds(), ForwardRingDiskBuilderFromDet.computeBounds(), BarrelDetLayer.computeSurface(), ForwardDetLayer.computeSurface(), convertPackedEtaToPackedY(), Conv.convolution(), HPDIonFeedbackSim.correctPE(), Qjets.d_ij(), BTagLikeDeDxDiscriminator.dedx(), StripCPEgeometric::WrappedCluster.deformed(), dEtaInSeed(), ClusterizingHistogram.dump(), edm::Timestamp.endOfTime(), EtaMultiRangeCut.EtaMultiRangeCut(), SimHitsValidationHcal::etaRange.etaRange(), ThroughputServiceClient.fillSummaryPlots(), ZtoMMEventSelector.filter(), ZtoEEEventSelector.filter(), LA_Filler_Fitter.find_rebin(), SymmetryFit.findUsableMinMax(), tauImpactParameter::Chi2VertexFitter.fit(), LA_Filler_Fitter.fit_width_profile(), CaloRecHit.flagField(), genlkupmap(), TMom.getMax(), reco::PFRecHit.getNeighbour(), TMom.getPeak(), HcalTB02HcalNumberingScheme.getUnitID(), gen::BaseHadronizer.gridpackPath(), GsfEleSCEtaMultiRangeCut.GsfEleSCEtaMultiRangeCut(), edm::BranchIDListHelper.hasProducedProducts(), l1t.HICaloRingSubtraction(), FedTimingHistograms.histoAnalysis(), MSLayersKeeperX0AtEta.idxBin(), dataformats.indent(), tablePrinter.indent(), Grid1D.index(), MSLayersKeeperX0AtEta.init(), TMom.init(), PixelDigi.init(), ThirdHitPredictionFromInvParabola.init(), ztail.Decoder.initial_synchronize(), Thrust.initialAxis(), ExpressionHisto< T >.initialize(), SimpleDiskBounds.inside(), DiskSectorBounds.inside(), funct.integral_f(), MatacqTBDataFormatter.interpretRawData(), MatacqDataFormatter.interpretRawData(), reco::helper::VirtualJetProducerHelper.intersection(), edm::ModuleDescription.invalidID(), GeomDetCompatibilityChecker.isCompatible(), npstat::ArrayRange.isCompatible(), DTSegmentExtendedCand.isCompatible(), DTHitPairForFit.isCompatible(), HcalDetDiagTimingMonitor.isSignal(), reco::TrackProbabilityTagInfo.jetProbability(), TemplatedJetProbabilityComputer< Container, Base >.jetProbability(), StripCPEgeometric.localParameters(), CSCCrossGap.logGamma(), HLTPerformanceInfo.longestModuleCPUTime(), HLTPerformanceInfo.longestModuleTime(), main(), LA_Filler_Fitter.make_and_fit_symmchi2(), EcalUncalibRecHitMultiFitAlgo.makeRecHit(), edm::debugging_allocator< T >.max_size(), AlignableBuilder.maxComponent(), maxDiff(), OuterDetCompatibility.maximalLocalDisplacement(), l1t::LUT.maxSize(), FWTableManagerBase.maxWidthForColumns(), FlatEvtVtxGenerator.maxX(), FlatEvtVtxGenerator.maxY(), FlatEvtVtxGenerator.maxZ(), reco::HcalNoiseRBX.maxZeros(), normalizedGsfChi2(), StripCPEgeometric.offset_from_firstStrip(), GsfEleEffAreaPFIsoCut.operator()(), PhoAnyPFIsoWithEACut.operator()(), GsfEleDeltaBetaIsoCutStandalone.operator()(), GsfEleCalPFClusterIsoCut.operator()(), RK4PreciseStep.operator()(), GsfEleDEtaInLinearCut.operator()(), reco::parser::max_f.operator()(), TtHadSimpleBestJetComb.operator()(), CylinderBuilderFromDet.operator()(), TtSemiSimpleBestJetComb.operator()(), hcaldqm::flag::Flag.operator+(), hcaldqm::flag::Flag.operator+=(), operator<<(), pat::PackedGenParticle.pack(), PairProductionSimulator.PairProductionSimulator(), CmsTrackerPhase1DiskBuilder.PhiPosNegSplit_innerOuter(), PhoSCEtaMultiRangeCut.PhoSCEtaMultiRangeCut(), PFTauRenderPlugin.preDraw(), Overlayer.print(), sipixelobjects::PixelFEDLink.printForMap(), gen.LHEAnalyzer.LHEAnalyzer.process(), edm::ExpoRandomPtGunProducer.produce(), ProbeMulteplicityProducer.produce(), ShiftedJetProducerByMatchedObjectT< T >.produce(), CorrectedECALPFClusterProducer.produce(), rangeIntersection(), ThirdHitPredictionFromInvParabola.rangeRPhi(), l1t::LUT.read(), edmplugin::CacheParser.readline(), reco::tau::RecoTauDiscriminantFromDiscriminator.RecoTauDiscriminantFromDiscriminator(), l1t.RegionCorrection(), GlobalTrackingRegionProducerFromBeamSpot.regions(), IMACalibBlock.riempiMtr(), IMACalibBlock.riempiVtr(), HGCHEbackDigitizer.runCaliceLikeDigitizer(), ecaldqm::TestPulseTask.runOnPnDigis(), HGCDigitizerBase< DFr >.runSimple(), HIProtoTrackSelector.select(), L1Analysis::L1AnalysisRecoElectron.SetElectron(), CaloRecHit.setFlagField(), Py8toJetInput.setJetEtaMax(), HistoDef.setMaximum(), ConfigurableTrimmedVertexFinder.setMaxNbOfVertices(), reco::PhiWedge.SetMinMaxTime(), L1Analysis::L1AnalysisRecoMuon2.SetMuon(), Plane.setPosPrec(), MatacqTBRawEvent.setRawData(), egHLT::BinData::Data1D.setup(), Vispa.Gui.Zoomable.Zoomable.setZoom(), CSCStripHitSim.simulate(), cond::TimeTypeTraits< type >.specs(), stat_RMS(), PixelRecoRange< float >.sum(), ConeIsolationAlgorithm.tag(), Cylinder.tangentPlane(), TrackWithVertexSelector.testTrack(), EcalUncalibRecHitTimeWeightsAlgo< EBDataFrame >.time(), HcalNumberingFromDDD.unitID(), l1t::stage2::CaloTowerUnpacker.unpack(), pat::PackedGenParticle.unpack(), npstat::ArrayRange.upperLimits(), GsfEleDeltaBetaIsoCutStandalone.value(), PhoAnyPFIsoWithEACut.value(), GsfEleEffAreaPFIsoCut.value(), GsfEleCalPFClusterIsoCut.value(), AlphaT.value_(), SimpleConeBounds.vertex(), TrapezoidalPlaneBounds.width(), SimpleConeBounds.width(), and Overlayer.withLegend().

int bookConverter.min = 2

Definition at line 164 of file bookConverter.py.

tuple bookConverter.optManager = OptionParser()

Definition at line 130 of file bookConverter.py.

bookConverter.opts = opts.__dict__

Definition at line 132 of file bookConverter.py.

dictionary bookConverter.prior = {}

Definition at line 145 of file bookConverter.py.

Referenced by reco::SequentialGhostTrackFitter.fit(), reco::GhostTrackFitter.fit(), LikelihoodSpecies.LikelihoodSpecies(), and LikelihoodSpecies.setPrior().

tuple bookConverter.resdoc = dom.Document()

Definition at line 138 of file bookConverter.py.

dictionary bookConverter.results = {}

Definition at line 143 of file bookConverter.py.

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

Definition at line 139 of file bookConverter.py.