CMS 3D CMS Logo

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.

00089             :
00090   r = []
00091   for v in a:
00092     r.append(v)
00093   return r
00094 
def kpermutation(vfrom, vto, min, max):

def bookConverter::cexists (   s,
  c 
)

Definition at line 81 of file bookConverter.py.

00081                  :
00082   d = len(c)
00083   for v1 in s:
00084     for v2 in c:
00085       if v1 == v2:
00086         d = d - 1
00087   return (d == 0)
00088 
def ccopy(a):

def bookConverter::compute (   min,
  max 
)

Definition at line 105 of file bookConverter.py.

Referenced by lat::BitOps< T >::ceil2(), lat::BitOpsRZero< B >::Op< T >::compute(), lat::BitOpsReverse< B >::Op< T >::compute(), lat::BitOpsMortonExtract< B >::Op< T >::compute(), lat::BitOpsCeil2< B >::Op< T >::compute(), lat::BitOpsLog2< B >::Op< T >::compute(), lat::BitOpsMortonInterleave< B >::Op< T >::compute(), lat::BitOpsParity< B >::Op< T >::compute(), lat::BitOpsCount< B >::Op< T >::compute(), lat::BitOps< T >::count(), VisG4TwigOps::doApplyFilter(), drawVolumeTwig(), TrackCountingTagPlotter::finalize(), TrackProbabilityTagPlotter::finalize(), TrackIPTagPlotter::finalize(), PhysicsTools::MVATrainer::getTrainCalibration(), lat::BitOps< T >::log2(), lat::BitOps< T >::mortonInterleave(), lat::BitOps< T >::mortonSplit(), lat::BitOps< T >::parity(), lat::BitOps< T >::reverse(), and lat::BitOps< T >::rzero().

00105                      :
00106   print "Computing permutations"
00107   for v in kpermutation(0, len(keys), min, max):
00108     ci = -1
00109     for h in histograms:
00110       if cexists(h, v):
00111         if ci == -1:
00112           ci = len(comb)
00113           comb[ci] = ccopy(v)
00114           results[ci] = [h]
00115         else:
00116           results[ci].append(h) 
00117 
def priorities():

def bookConverter::create_declaration (   cid  ) 

Definition at line 75 of file bookConverter.py.

00075                            :
00076   co = comb[cid]
00077   print "Declaration to apply:", co
00078   for k in comb[cid]:
00079     print keys[k]['name'], '=', keys[k]['value']
00080 
def cexists(s, c):

def bookConverter::create_xsd (  ) 

Definition at line 57 of file bookConverter.py.

00057                 :
00058   for k in keys.keys():
00059     name = keys[k]['name']
00060 
00061   root = resdoc.createElement("xs:complexType")
00062   root.setAttribute("name", "HistogramType")
00063   resdoc.appendChild(root)
00064   seq = resdoc.createElement("xs:all")
00065   root.appendChild(seq)
00066   for e in sorted(elements.keys()):
00067     el = resdoc.createElement("xs:element")
00068     el.setAttribute("name", e)
00069     el.setAttribute("type", elements[e]['type'])
00070     if elements[e]['count'] < len(histograms):
00071       el.setAttribute("minOccurs", '0')
00072       el.setAttribute("maxOccurs", '1')
00073     seq.appendChild(el)
00074 
def create_declaration(cid):

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

Definition at line 95 of file bookConverter.py.

00095                                       :
00096   vto = vto + 1
00097   queue = []
00098   for i in range(vfrom, vto):
00099     for j in range(i, vto):
00100       queue.append(j)
00101       if len(queue) >= min and len(queue) <= max:
00102         yield queue
00103     queue = []
00104 
def compute(min, max):

def bookConverter::priorities (  ) 

Definition at line 118 of file bookConverter.py.

00118                 :
00119   for ci in comb.keys():
00120     l = len(results[ci])
00121     if l == 1: 
00122       continue
00123     if not prior.has_key(l):
00124       prior[l] = [ci]
00125     else:
00126       prior[l].append(ci)
00127 
if __name__ == "__main__":

def bookConverter::read_data (  ) 

Definition at line 16 of file bookConverter.py.

00016                :
00017   print "Reading histogram file"
00018   n = 0
00019   histos = srcdoc.getElementsByTagName("Histogram")
00020   for histo in histos:
00021     h = []
00022     for key in histo.childNodes:
00023       if key.nodeType == key.ELEMENT_NODE:
00024         name = key.localName
00025         value = key.childNodes[0].nodeValue
00026         found = 0
00027 
00028         if not elements.has_key(name):
00029           elements[name] = {'type': '', 'count': 0}
00030         elements[name]['count'] = elements[name]['count'] + 1
00031 
00032         try:
00033           i = int(value)
00034           if elements[name]['type'] == '':
00035             elements[name]['type'] = 'xs:integer'
00036         except ValueError:
00037           try:
00038             i = float(value)  
00039             if elements[name]['type'] in ('', 'xs:integer'):
00040               elements[name]['type'] = 'xs:double'
00041           except ValueError:
00042             elements[name]['type'] = 'xs:string'
00043 
00044         for k in keys.keys():
00045           if keys[k]['name'] == name and keys[k]['value'] == value:
00046             keys[k]['count'] = keys[k]['count'] + 1
00047             h.append(k)
00048             found = 1
00049             break
00050         if found == 0:
00051           keys[n] = {'name': name, 'value': value, 'count': 1}
00052           h.append(n)
00053           n += 1
00054     h.sort()
00055     histograms.append(h)
00056 
def create_xsd():


Variable Documentation

dictionary bookConverter::comb = {} [static]

Definition at line 144 of file bookConverter.py.

Referenced by JetPartonMatching::calculate(), CombinationGenerator< T >::combinations(), RPCSeedHits::computePtWithoutVtx(), JetPartonMatching::getNumberOfUnmatchedPartons(), JetPartonMatching::getSumDeltaE(), JetPartonMatching::getSumDeltaPt(), JetPartonMatching::getSumDeltaR(), SequentialCombinationGenerator< T >::next_combination(), JetPartonMatching::print(), CombinationGenerator< T >::separateOneElement(), and CombinationGenerator< T >::splitInTwoCollections().

dictionary bookConverter::elements = {} [static]

Definition at line 146 of file bookConverter.py.

Referenced by PFRecoTauAlgorithm::buildPFTau(), dumpObject_(), pftools::TreeUtility::extractParticles(), PFElectronAlgo::MultipleGsfTrackAssociation(), ElementsInAnnulus< T, M, N, std::pair< math::XYZPoint, float > >::operator()(), ElementsInCone< T, M, std::pair< math::XYZPoint, float > >::operator()(), reco::operator<<(), PFRootEventManagerColin::processHIGH_E_TAUS(), reco::modulesNew::IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce(), IsolationProducer< C1, C2, Alg, OutputCollection, Setup >::produce(), PFAlgo::reconstructParticles(), pftools::TreeUtility::recreateFromRootFile(), PFElectronAlgo::SetActive(), PFElectronAlgo::SetCandidates(), PFConversionAlgo::setCandidates(), PFElectronAlgo::SetIDOutputs(), PFConversionAlgo::setLinks(), and PFElectronAlgo::SetLinks().

list bookConverter::histograms = [] [static]

Definition at line 141 of file bookConverter.py.

Referenced by HistoAnalyzer< C >::HistoAnalyzer().

dictionary bookConverter::keys = {} [static]

Definition at line 142 of file bookConverter.py.

Referenced by IgQtApplicationCategory::addQApplicationTab(), HLTMuonGenericRate::analyze(), edm::EventSetupRecordDataGetter::analyze(), IgStateKey::create(), IgStateKey::index(), L1TriggerKeyDummyProd::L1TriggerKeyDummyProd(), IgStateKey::label(), pat::ObjectResolutionCalc::ObjectResolutionCalc(), edm::EDLooper::prepareForNextLoop(), pat::PATTriggerProducer::produce(), magneticfield::VolumeBasedMagneticFieldESProducer::produce(), and IgStateKey::remove().

int bookConverter::len_max = 0 [static]

Definition at line 148 of file bookConverter.py.

int bookConverter::len_min = 1000000 [static]

Definition at line 147 of file bookConverter.py.

bookConverter::max = len_max [static]

Definition at line 166 of file bookConverter.py.

int bookConverter::min = 2 [static]

Definition at line 164 of file bookConverter.py.

tuple bookConverter::optManager = OptionParser() [static]

Definition at line 130 of file bookConverter.py.

bookConverter::opts = opts.__dict__ [static]

Definition at line 132 of file bookConverter.py.

Referenced by IgProf::initialize(), initialize(), edm::install(), edm::Schedule::Schedule(), RFIOStorageMaker::stagein(), and edm::service::TriggerNamesService::TriggerNamesService().

dictionary bookConverter::prior = {} [static]

Definition at line 145 of file bookConverter.py.

tuple bookConverter::resdoc = dom.Document() [static]

Definition at line 138 of file bookConverter.py.

dictionary bookConverter::results = {} [static]

Definition at line 143 of file bookConverter.py.

Referenced by HcalTrigTowerGeometry::detIds(), ESElectronicsSim::encode(), ESElectronicsSimFast::fastEncode(), edm::Principal::getByLabel(), edm::Principal::getBySelector(), edm::Principal::getByType(), CSCWireHitSim::getIonizationClusters(), edm::DataViewImpl::getMany(), edm::Event::getMany(), edm::DataViewImpl::getManyByType(), edm::Event::getManyByType(), PhysicsTools::LeastSquares::getMeans(), PhysicsTools::LeastSquares::getWeights(), pftools::Utils::Glob(), Utils::Glob(), Utils::myGlob(), MuIsolatorResultProducer< BT >::produce(), edm::TriggerResultInserter::produce(), ESElectronicsSimFast::standEncode(), CSCCathodeLCTProcessor::testPatterns(), and HcalTrigTowerGeometry::towerIds().

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

Definition at line 139 of file bookConverter.py.


Generated on Tue Jun 9 18:36:16 2009 for CMSSW by  doxygen 1.5.4