CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes
HTMLExport.HTMLExport Class Reference
Inheritance diagram for HTMLExport.HTMLExport:

Public Member Functions

def __init__
 
def data_to_json
 
def export
 
def module_to_json
 
def path_to_json
 
def produce
 
def pset_to_json
 

Static Public Attributes

tuple file_types = ('html', )
 
string plugin_name = 'HTML Export'
 

Detailed Description

Definition at line 652 of file HTMLExport.py.

Constructor & Destructor Documentation

def HTMLExport.HTMLExport.__init__ (   self)

Definition at line 657 of file HTMLExport.py.

658  def __init__(self):
659  FileExportPlugin.__init__(self)

Member Function Documentation

def HTMLExport.HTMLExport.data_to_json (   self,
  data 
)

Definition at line 671 of file HTMLExport.py.

References HTMLExport.HTMLExport.module_to_json(), HTMLExport.HTMLExport.path_to_json(), HTMLExport.HTMLExport.pset_to_json(), and split.

Referenced by HTMLExport.HTMLExport.produce().

672  def data_to_json(self, data):
673  cmssw = None
674  if 'CMSSW_BASE' in os.environ:
675  cmssw = os.environ['CMSSW_BASE'].split('/')[-1]
676  elif 'CMSSW_RELEASE_BASE' in os.environ:
677  cmssw = os.environ['CMSSW_RELEASE_BASE'].split('/')[-1]
678  result = {'process': {'name': data.process().name_() if data.process() else '(no process)', 'src': data._filename, 'cmssw':cmssw}}
679  toplevel = data.children(data.topLevelObjects()[0]) if data.process() else data.topLevelObjects()
680  for tlo in toplevel:
681  children = data.children(tlo)
682  label = tlo._label
683  if label in ('source', 'services'):
684  result[label] = [{'class':data.classname(child), 'pset':self.pset_to_json(child.parameters_()), 'type':data.type(child), 'label':data.classname(child)} for child in children]
685  elif label in ('essources', 'esproducers', 'esprefers'):
686  result[label] = [self.module_to_json(data, child) for child in children]
687  elif label in ('paths', 'endpaths'):
688  result[label] = [self.path_to_json(data, child) for child in children]
689  return json.dumps(result, indent=4)
double split
Definition: MVATrainer.cc:139
def HTMLExport.HTMLExport.export (   self,
  data,
  filename,
  filetype 
)

Definition at line 660 of file HTMLExport.py.

References cond::EmptyIOVSource.produce(), DimuonMCMatcher.produce(), ShallowEventDataProducer.produce(), ShallowExampleProducer.produce(), WeakEffectsWeightProducer.produce(), MagneticFieldMapESProducer.produce(), TrackerInteractionGeometryESProducer.produce(), DoubleProducer.produce(), PixelToFEDAssociateFromAsciiESProducer.produce(), PixelToLNKAssociateFromAsciiESProducer.produce(), ShallowTracksProducer.produce(), PatElectronEAIsoCorrectionProducer.produce(), ShallowRechitClustersProducer.produce(), HcalLaserEventFiltProducer2012.produce(), ShallowTrackClustersProducer.produce(), SiPixelFedCablingMapBuilder.produce(), RazorVarProducer.produce(), ShallowSimhitClustersProducer.produce(), ConversionTrackRefFix.produce(), SiPixelFakeCPEGenericErrorParmESSource.produce(), AlphaTVarProducer.produce(), Phase2TrackerCablingESProducer.produce(), sistrip::MeasureLA.produce(), ElectronSqPtTkIsolationProducer.produce(), reco::modules::CaloRecHitCandidateProducer< HitCollection >.produce(), CSCIndexerESProducer.produce(), DummyModule.produce(), MFProducer.produce(), DistortedMETProducer.produce(), CSCChannelMapperESProducer.produce(), SiPixelFakeGenErrorDBObjectESSource.produce(), SiPixelFakeTemplateDBObjectESSource.produce(), ShallowSimTracksProducer.produce(), EventVtxInfoNtupleDumper.produce(), DTDigiToRawModule.produce(), ParticleDecayProducer.produce(), CandPtrProjector.produce(), Phase2Tracker::Phase2TrackerCommissioningDigiProducer.produce(), AssociationMapOneToOne2Association< CKey, CVal >.produce(), EmptySimHits.produce(), AssociationVectorSelector< KeyRefProd, CVal, KeySelector, ValSelector >.produce(), DiJetVarProducer.produce(), DistortedMuonProducerFromDB.produce(), MuonWithPFIsoProducer.produce(), ESRawToDigi.produce(), FSPFProducer.produce(), CastorFastTowerProducer.produce(), AssociationVector2ValueMap< KeyRefProd, CVal >.produce(), DistortedMuonProducer.produce(), DistortedPFCandProducer.produce(), evf::EvFFEDSelector.produce(), CandViewRefMerger.produce(), RawDataCollectorByLabel.produce(), IPTCorrector.produce(), CastorDbProducer.produce(), FamosProducer.produce(), CastorFastClusterProducer.produce(), SiStripFedCablingESProducer.produce(), CalibratedPatElectronProducer.produce(), SiStripGainESSource.produce(), SiStripHashedDetIdESProducer.produce(), RegressionEnergyPatElectronProducer.produce(), HcalCalibFEDSelector.produce(), RPCPerformanceESSource.produce(), ElectronSeedTrackRefFix.produce(), CollectionAdder< C >.produce(), ShallowClustersProducer.produce(), SiStripPedestalsESSource.produce(), SiStripNoiseESSource.produce(), ISRGammaWeightProducer.produce(), SiStripDelayESProducer.produce(), SiStripQualityESProducer.produce(), SimTrackIdProducer.produce(), FSRWeightProducer.produce(), SiStripBackPlaneCorrectionDepESProducer.produce(), ISRWeightProducer.produce(), EcalLaserCorrectionService.produce(), SiStripLorentzAngleDepESProducer.produce(), DTUnpackingModule.produce(), IsolatedEcalPixelTrackCandidateProducer.produce(), FWRecoGeometryESProducer.produce(), PdfWeightProducer.produce(), CSCDCCUnpacker.produce(), ESDigiToRaw.produce(), JetTracksAssociationToTrackRefs.produce(), PixelTracksProducer.produce(), SiStripTemplateEmptyFakeESSource< TObject, TRecord >.produce(), FastTSGFromL2Muon.produce(), NtpProducer< C >.produce(), CastorHardcodeCalibrations.produce(), SiStripTemplateDepFakeESSource< TObject, TRecord, TService, DepTRecord, DepTObj >.produce(), SiStripTemplateFakeESSource< TObject, TRecord, TService >.produce(), LmfSource.produce(), SiStripProcessedRawDigiProducer.produce(), AlignmentPrescaler.produce(), SiPixelGenErrorDBObjectESProducer.produce(), SiPixelTemplateDBObjectESProducer.produce(), ZMuMuTrackUserData.produce(), SiStripGainESProducerTemplate< TDependentRecord, TInputRecord >.produce(), CastorDigiToRaw.produce(), CandReducer.produce(), FRDStreamSource.produce(), CandidateTriggerObjectProducer.produce(), reco::modules::MatcherBase< C1, C2, M >.produce(), reco::modulesNew::Matcher< C1, C2, S, D >.produce(), SiPixelFedFillerWordEventNumber.produce(), TriggerMatchProducer< object >.produce(), CalibratedElectronProducer.produce(), ElectronPATIdMVAProducer.produce(), ZMuMuMuonUserData.produce(), SiStripQualityFakeESSource.produce(), CloneProducer< C >.produce(), ShallowCloneProducer< C >.produce(), HcalDigiToRaw.produce(), HcalHistogramRawToDigi.produce(), RawDataSelector.produce(), AlcaBeamSpotFromDB.produce(), ShallowDigisProducer.produce(), TrackInfoProducer.produce(), PFCandIsolatorFromDeposits.produce(), Phase2Tracker::Phase2TrackerDigiProducer.produce(), RPCPackingModule.produce(), sistrip::RawToDigiModule.produce(), sistrip::DigiToRawModule.produce(), ElectronRecalibSuperClusterAssociator.produce(), ZMuMuUserDataOneTrack.produce(), ZMuMuUserData.produce(), CastorRawToDigi.produce(), EcalDCCTBUnpackingModule.produce(), DeltaBetaWeights.produce(), TkAlCaOverlapTagger.produce(), RPCUnpackingModule.produce(), sistrip::ExcludedFEDListProducer.produce(), CastorTextCalibrations.produce(), EcalDCCTB07UnpackingModule.produce(), HcalRawToDigi.produce(), edm::ThinningProducer< Collection, Selector >.produce(), PiZeroDiscriminatorProducer.produce(), LaserAlignmentProducer.produce(), MillePedeFileConverter.produce(), L1GctInternJetProducer.produce(), SubdetFEDSelector.produce(), AlcaBeamSpotProducer.produce(), PuppiProducer.produce(), edm::FwdPtrProducer< T, H >.produce(), EventCountProducer.produce(), Type1PFMET.produce(), SiPixelDigiToRaw.produce(), HcalOmdsCalibrations.produce(), PFMET.produce(), SiPixelRawToDigi.produce(), PileUpProducer.produce(), edm::ProductFromFwdPtrProducer< T, H >.produce(), CSCDigiToRawModule.produce(), CSCTFPacker.produce(), pf2pat::PFMETAlgo.produce(), SiStripRegFEDSelector.produce(), sistrip::SpyEventSummaryProducer.produce(), FWTGeoRecoGeometryESProducer.produce(), EcalGlobalShowerContainmentCorrectionsVsEtaESProducer.produce(), DaqFakeReader.produce(), EcalRegionCablingESProducer.produce(), DTFakeT0ESProducer.produce(), Merger< InputCollection, OutputCollection, P >.produce(), EcalShowerContainmentCorrectionsESProducer.produce(), DTTFFEDSim.produce(), HcalDbProducer.produce(), MatchedProbeMaker< T >.produce(), EcalIsolatedParticleCandidateProducer.produce(), TagProbeMassProducer.produce(), sistrip::SpyDigiConverterModule.produce(), WMuNuProducer.produce(), CSCTFUnpacker.produce(), LaserAlignmentT0Producer.produce(), edm::TriggerResultInserter.produce(), L1TriggerKeyListDummyProd.produce(), AlCaEcalHcalReadoutsProducer.produce(), DTTFFEDReader.produce(), FastElectronSeedProducer.produce(), SiPixelFakeGainESSource.produce(), SiPixelFakeGainForHLTESSource.produce(), PileUpSimulator.produce(), SiPixelFakeGainOfflineESSource.produce(), TrackCandidateProducer.produce(), HcalRecHitRecalib.produce(), AlCaElectronTracksReducer.produce(), BufferedBoostIOESProducer< DataType, MyRecord >.produce(), L1TriggerKeyDummyProd.produce(), pf2pat::PFIsoDepositAlgo.produce(), EcalRecHitRecalib.produce(), ZToLLEdmNtupleDumper.produce(), PrimaryVertexSorter< ParticlesCollection >.produce(), SiPixelFakeQualityESSource.produce(), L1SubsystemKeysOnlineProd.produce(), SiPixelFakeLorentzAngleESSource.produce(), PFCand_AssoMap.produce(), SiStripFineDelayHit.produce(), AlCaDiJetsProducer.produce(), ECALRegFEDSelector.produce(), L1TriggerKeyOnlineProd.produce(), PFPileUp.produce(), AlCaGammaJetProducer.produce(), L1ObjectKeysOnlineProdBase.produce(), SiPixelQualityESProducer.produce(), cms::HitReCalibrator.produce(), HBHENoiseFilterResultProducer.produce(), ScalersRawToDigi.produce(), EventWithHistoryProducer.produce(), GctDigiToRaw.produce(), L1GlobalTriggerRecordProducer.produce(), HcalTextCalibrations.produce(), LTCRawToDigi.produce(), PF_PU_AssoMap.produce(), FromClusterSummaryMultiplicityProducer.produce(), MisalignedTrackerESProducer.produce(), HcalTPGCoderULUT.produce(), EventWithHistoryProducerFromL1ABC.produce(), AlCaHcalNoiseProducer.produce(), HITSiStripRawToClustersRoI.produce(), IsolatedPixelTrackCandidateProducer.produce(), pf2pat::TopProjectorAlgo< Top, Bottom >.produce(), CaloTPGTranscoderULUTs.produce(), HcalHardcodeCalibrations.produce(), l1t::L1TRawToDigi.produce(), RctRawToDigi.produce(), EcalRawToDigi.produce(), EcalFEDWithCRCErrorProducer.produce(), ConfigurableAPVCyclePhaseProducer.produce(), ValueMapTraslator.produce(), MisalignedMuonESProducer.produce(), MuonMillepedeTrackRefitter.produce(), PF_PU_FirstVertexTracks.produce(), GctRawToDigi.produce(), SoftKillerProducer.produce(), EcalDigiToRaw.produce(), AlCaECALRecHitReducer.produce(), l1t::L1TDigiToRaw.produce(), CaloMiscalibToolsMC.produce(), CaloMiscalibTools.produce(), MultiplicityProducer< T >.produce(), AlCaHBHEMuonProducer.produce(), L1GlobalTriggerEvmRawToDigi.produce(), ConditionDumperInEdm.produce(), TcdsRawToDigi.produce(), L1ConfigOnlineProdBase< TRcd, TData >.produce(), HLTTauRefProducer.produce(), L1GTEvmDigiToRaw.produce(), L1GtTextToRaw.produce(), SiTrackerGaussianSmearingRecHitConverter.produce(), PFCand_NoPU_WithAM.produce(), JetDeltaRTagInfoValueMapProducer< T, I >.produce(), l1t::AMC13DumpToRaw.produce(), AlignmentMuonHIPTrajectorySelector.produce(), TGeoMgrFromDdd.produce(), l1t::AMCDumpToRaw.produce(), reco::modules::TrackFullCloneSelectorBase< Selector >.produce(), L1GTDigiToRaw.produce(), sistrip::SpyUnpackerModule.produce(), SiPixelCalibDigiProducer.produce(), L1GtTriggerMenuLiteProducer.produce(), APVCyclePhaseProducerFromL1ABC.produce(), L1GlobalTriggerRawToDigi.produce(), APVCyclePhaseProducerFromL1TS.produce(), MEtoEDMConverter.produce(), l1t::MP7BufferDumpToRaw.produce(), sistrip::FEDEmulatorModule.produce(), ShallowGainCalibration.produce(), edm::stream::EDProducerBase.produce(), TrackerToMuonPropagator.produce(), Pi0FixedMassWindowCalibration.produce(), TkLasBeamFitter.produce(), CSCOverlapsTrackPreparation.produce(), reco::PhysObjectMatcher< C1, C2, S, D, Q >.produce(), JetDeltaRValueMapProducer< T >.produce(), edm::EDProducer.produce(), MuonSimHitProducer.produce(), TrajectorySeedProducer.produce(), ZeeCalibration.produce(), LaserAlignment.produce(), CandidateProducer< TColl, CColl, Selector, Conv, Creator, Init >.produce(), SelectedElectronFEDListProducer< TEle, TCand >.produce(), AlCaIsoTracksProducer.produce(), edm::one::EDProducerBase.produce(), edm::global::EDProducerBase.produce(), reco::modules::NamedCandCombiner< Selector, PairSelector, Cloner, Setup, Init >.produce(), MatacqProducer.produce(), reco::modules::CandCombiner< Selector, PairSelector, Cloner, OutputCollection, Setup, Init >.produce(), TopProjector< Top, Bottom, Matcher >.produce(), AlCaHOCalibProducer.produce(), edm::stream::CallBeginRunProduceImpl< T, bool >.produce(), edm::stream::CallBeginRunProduceImpl< T, false >.produce(), edm::stream::CallEndRunProduceImpl< T, bProduce, bSummary >.produce(), edm::stream::CallEndRunProduceImpl< T, true, false >.produce(), edm::stream::CallEndRunProduceImpl< T, true, true >.produce(), edm::stream::CallBeginLuminosityBlockProduceImpl< T, bool >.produce(), edm::stream::CallBeginLuminosityBlockProduceImpl< T, false >.produce(), edm::stream::CallEndLuminosityBlockProduceImpl< T, bProduce, bSummary >.produce(), edm::stream::CallEndLuminosityBlockProduceImpl< T, true, false >.produce(), edm::stream::CallEndLuminosityBlockProduceImpl< T, true, true >.produce(), and HTMLExport.HTMLExport.produce().

661  def export(self, data, filename, filetype):
662  with open(filename, 'w') as f:
663  f.write(self.produce(data))
def HTMLExport.HTMLExport.module_to_json (   self,
  data,
  module 
)

Definition at line 723 of file HTMLExport.py.

References HTMLExport.HTMLExport.pset_to_json().

Referenced by HTMLExport.HTMLExport.data_to_json(), and HTMLExport.HTMLExport.path_to_json().

724  def module_to_json(self, data, module):
725  return {
726  'label':data.label(module),
727  'class':data.classname(module),
728  'file':data.pypath(module),
729  'line':data.lineNumber(module),
730  #'package':data.pypackage(module),
731  'pset':self.pset_to_json(module.parameters_()),
732  'type':data.type(module),
733  'uses':data.uses(module),
734  'usedby':data.usedBy(module),
735  'memberof':data.foundIn(module)
736  }
def HTMLExport.HTMLExport.path_to_json (   self,
  data,
  path 
)

Definition at line 737 of file HTMLExport.py.

References HTMLExport.HTMLExport.module_to_json(), and HTMLExport.HTMLExport.path_to_json().

Referenced by HTMLExport.HTMLExport.data_to_json(), and HTMLExport.HTMLExport.path_to_json().

738  def path_to_json(self, data, path):
739  children = data.children(path)
740  if data.isContainer(path):
741  json_children = [self.path_to_json(data, child) for child in children]
742  return {'type':data.type(path), 'label':data.label(path),
743  'path':json_children, 'memberof': data.foundIn(path),
744  'file': data.pypath(path), 'line': data.lineNumber(path)}
745  #'package': data.pypackage(path)}
746  else:
747  return self.module_to_json(data, path)
748 
749 
750 
def HTMLExport.HTMLExport.produce (   self,
  data 
)

Definition at line 664 of file HTMLExport.py.

References HTMLExport.HTMLExport.data_to_json(), python.multivaluedict.dict, and HTMLExport.get_jquery().

Referenced by JSONExport.JsonExport.export(), HTMLExport.HTMLExport.export(), and HTMLExport.HTMLExportStatic.export().

665  def produce(self, data):
666  return PAGE_TEMPLATE % dict(title=data._filename, jquery=get_jquery(),
667  css=CSS_TEMPLATE, js=JS_TEMPLATE, dirname='.',
668  filename=data._filename, json=self.data_to_json(data),
669  cmslogo=CMSLOGO)
670 
def get_jquery
Definition: HTMLExport.py:27
def HTMLExport.HTMLExport.pset_to_json (   self,
  pset 
)

Definition at line 690 of file HTMLExport.py.

References HTMLExport.HTMLExport.pset_to_json(), and split.

Referenced by HTMLExport.HTMLExport.data_to_json(), HTMLExport.HTMLExport.module_to_json(), and HTMLExport.HTMLExport.pset_to_json().

691  def pset_to_json(self, pset):
692  result = []
693  for k, v in pset.items():
694  typename = v.pythonTypeName().split('.')[-1]
695  item = {'label': k, 'type': typename}
696  if not v.isTracked():
697  item['untracked'] = True
698  if typename == 'PSet':
699  item['value'] = self.pset_to_json(v.parameters_())
700  elif typename == 'VPSet':
701  item['value'] = [self.pset_to_json(vv.parameters_()) for vv in v]
702  item['list'] = True
703  elif typename == 'VInputTag':
704  v_it = []
705  for vv in v:
706  if type(vv) == cms.InputTag:
707  v_it.append(vv)
708  elif type(vv) == str:
709  v_it.append(cms.InputTag(vv))
710  else:
711  raise "Unsupported type in VInputTag", type(vv)
712  item['value'] = [(vv.moduleLabel, vv.productInstanceLabel, vv.processName) for vv in v_it]
713  item['list'] = True
714  elif typename == 'InputTag':
715  item['value'] = [v.moduleLabel, v.productInstanceLabel, v.processName]
716  elif isinstance(v, mix._ValidatingListBase):
717  item['value'] = [str(vv) for vv in v]
718  item['list'] = True
719  else:
720  item['value'] = v.pythonValue()
721  result += [item]
722  return result
double split
Definition: MVATrainer.cc:139

Member Data Documentation

tuple HTMLExport.HTMLExport.file_types = ('html', )
static

Definition at line 655 of file HTMLExport.py.

string HTMLExport.HTMLExport.plugin_name = 'HTML Export'
static

Definition at line 654 of file HTMLExport.py.