CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ntuple._Object Class Reference
Inheritance diagram for ntuple._Object:
ntuple._HitObject ntuple.GluedHit ntuple.InvalidHit ntuple.Seed ntuple.SimHit ntuple.Track ntuple.TrackingParticle ntuple.TrackingParticleMatchInfo ntuple.TrackingVertex ntuple.TrackMatchInfo ntuple.Vertex

Public Member Functions

def __getattr__
 
def __init__
 
def index
 
def isValid
 

Private Member Functions

def _checkIsValid
 

Private Attributes

 _index
 
 _prefix
 
 _tree
 

Detailed Description

Adaptor class representing a single object in a collection.

The member variables of the object are obtained from the branches
with common prefix and a given index.

Concrete object classes should inherit from this class.

Definition at line 68 of file ntuple.py.

Constructor & Destructor Documentation

def ntuple._Object.__init__ (   self,
  tree,
  index,
  prefix 
)
Constructor.

Arguments:
tree   -- TTree object
index  -- Index for this object
prefix -- Prefix of the branchs

Definition at line 76 of file ntuple.py.

76 
77  def __init__(self, tree, index, prefix):
78  """Constructor.
79 
80  Arguments:
81  tree -- TTree object
82  index -- Index for this object
83  prefix -- Prefix of the branchs
84  """
85  super(_Object, self).__init__()
86  self._tree = tree
87  self._index = index
88  self._prefix = prefix
def __init__
Definition: ntuple.py:76

Member Function Documentation

def ntuple._Object.__getattr__ (   self,
  attr 
)
Return object member variable.

'attr' is translated as a branch in the TTree (<prefix>_<attr>).

Definition at line 89 of file ntuple.py.

References ntuple._Object._checkIsValid(), SeedingNode< DATA >._index, Vispa.Share.FindAlgorithm.FindAlgorithm._index, RPCMuonExtraStruct._index, python.cmstools.EventTree._index, ntuple._Object._index, python.cmstools.EventBranch._index, html.HtmlReport._index, CommonAnalyzer._prefix, ntuple._Object._prefix, html.PageSet._prefix, ntuple._Collection._tree, python.cmstools.EventTree._tree, and ntuple._Object._tree.

89 
90  def __getattr__(self, attr):
91  """Return object member variable.
92 
93  'attr' is translated as a branch in the TTree (<prefix>_<attr>).
94  """
95  self._checkIsValid()
96  return lambda: getattr(self._tree, self._prefix+"_"+attr)[self._index]
def __getattr__
Definition: ntuple.py:89
def _checkIsValid
Definition: ntuple.py:97
def ntuple._Object._checkIsValid (   self)
private
Raise an exception if the object index is not valid.

Definition at line 97 of file ntuple.py.

References edm::FileFormatVersion.isValid(), MeasurementDetWithData.isValid(), reco::PFMultiLinksTC.isValid, edm::FileID.isValid(), GlobalParametersWithPath.isValid(), TtSemiLepJetCombMaxSumPtWMass.isValid(), DetIdSelector.isValid(), ExtendedPerigeeTrajectoryError.isValid(), TtSemiLepJetCombGeom.isValid(), TtSemiLepJetCombWMassMaxSumPt.isValid(), edm::BranchID.isValid(), fftjetcms::EtaAndPtDependentPeakSelector.isValid(), DataFormats_MuonReco::dictionary::edm::BranchID.isValid(), SeedFromProtoTrack.isValid(), reco::TrackGhostTrackState.isValid(), TtSemiLepJetCombWMassDeltaTopMass.isValid(), l1t::HGCalCluster.isValid(), SubLayerCrossings.isValid(), CSCALCTDigi.isValid(), CSCCLCTDigi.isValid(), ExtendedPerigeeTrajectoryParameters.isValid(), ApvTimingAnalysis.isValid(), TwoBodyDecayTrajectoryState.isValid(), NoiseAnalysis.isValid(), OptoScanAnalysis.isValid(), PedestalsAnalysis.isValid(), MediumProperties.isValid(), PedsOnlyAnalysis.isValid(), VpspScanAnalysis.isValid(), FiducialVolume.isValid(), BeamConfiguration.isValid(), PedsFullNoiseAnalysis.isValid(), CSCCorrelatedLCTDigi.isValid(), cms::MD5Result.isValid(), FastLine.isValid(), edm::ProductID.isValid(), FastFedCablingAnalysis.isValid(), FedCablingAnalysis.isValid(), ConversionFastHelix.isValid(), MillePedeVariables.isValid(), DTOccupancyCluster.isValid(), DataFormats_MuonReco::dictionary::edm::ProductID.isValid(), PFGsfHelper.isValid(), SiStripNullKey.isValid(), HLTTauDQMPlotter.isValid(), L1MuonPixelTrackFitter::Circle.isValid(), LMFRunTag.isValid(), GenericProjectedRecHit2D.isValid(), gbl::GblTrajectory.isValid(), PerigeeKinematicState.isValid(), HLTTauDQMPath.isValid(), GammaNumericalGenerator.isValid(), HGCalDDDConstants.isValid(), PixelKeys.isValid(), reco::GhostTrackState.isValid(), PixelForwardLayer::SubTurbineCrossings.isValid, AlgoMuon.isValid(), reco::BasicGhostTrackState.isValid(), fwlite::ESHandle< T >.isValid(), PixelForwardLayerPhase1::SubTurbineCrossings.isValid, LumiDetails.isValid(), KinematicParametersError.isValid(), CommissioningAnalysis.isValid(), LMFUnique.isValid(), edm::ESHandleBase.isValid(), cond::persistency::BasePayloadProxy.isValid(), TwoBodyDecay.isValid(), LMFColor.isValid(), TangentCircle.isValid(), LMFSeqDat.isValid(), edm::RefToBaseVector< T >.isValid(), l1t::CaloCluster.isValid(), cond::Iov_t.isValid(), HcalHPDRBXMap.isValid(), SeedFromNuclearInteraction.isValid(), KinematicTree.isValid(), FWRepresentationInfo.isValid(), edmNew::DetSet< T >.isValid(), BasicVertexState.isValid(), TtFullHadHypothesis.isValid(), edm::TriggerResultsByName.isValid(), HGCalDetId.isValid(), FastCircle.isValid(), TtFullLepHypothesis.isValid(), edm::OrphanHandleBase.isValid(), DataFormats_MuonReco::dictionary::edm::OrphanHandleBase.isValid(), npstat::ArrayNDScanner.isValid(), TrajectoryStateClosestToBeamLine.isValid(), SummaryPlot.isValid(), L1TwinMux::PrimitiveCombiner.isValid(), LMFRunIOV.isValid(), edm::Hash< I >.isValid(), DataFormats_MuonReco::dictionary::edm::Hash< I >.isValid(), fwlite::Handle< T >.isValid(), TrajectoryStateOnSurface.isValid(), FastHelix.isValid(), TtSemiLepHypothesis.isValid(), edm::RootOutputTree.isValid(), LMFClsDat.isValid(), ProxyBase11< T >.isValid(), KinematicParameters.isValid(), npstat::BoxNDScanner< Numeric >.isValid(), reco::Vertex.isValid(), sistrip::SpyUtilities.isValid(), SteppingHelixStateInfo.isValid(), StripKeys.isValid(), LMFLaserPulseDat.isValid(), BasicSingleVertexState.isValid(), SiStripKey.isValid(), L1TBeamConfiguration.isValid(), LMFPnPrimDat.isValid(), edm::HandleBase.isValid(), OmniClusterRef.isValid(), DataFormats_MuonReco::dictionary::edm::HandleBase.isValid(), python.Handle.isValid(), SurveyPxbImage.isValid(), ProxyBase< T, Cloner >.isValid(), fwlite::ChainEvent.isValid(), KinematicState.isValid(), fwlite::Run.isValid(), reco::PFTrajectoryPoint.isValid(), edm::BasicHandle.isValid(), fwlite::LuminosityBlock.isValid(), edm::RootTree.isValid(), UCTDAQRawData.isValid(), METCorrectorParameters.isValid(), pat::JetCorrFactors.isValid(), SiStripDetKey.isValid(), fwlite::MultiChainEvent.isValid(), MEtXYcorrectParameters.isValid(), BasicMultiVertexState.isValid(), LMFPrimDat.isValid(), JetCorrectorParameters.isValid(), edm::Handle< GenericObject >.isValid(), reco::PFDisplacedVertexCandidate.isValid(), ntuple._Object.isValid(), edm::Handle< FWGenericObject >.isValid(), PlotCompareUtility.isValid(), AlignmentParameters.isValid(), edmNew::dstvdetails::DetSetVectorTrans::Item.isValid(), DDBase< N, C >.isValid(), LumiSummary.isValid(), TrajectoryStateClosestToPoint.isValid(), fwlite::Event.isValid(), SiStripFecKey.isValid(), SiStripFedKey.isValid(), VertexState.isValid(), CachingVertex< N >.isValid(), TotemRPLocalTrack.isValid(), LMFDat.isValid(), ReferenceTrajectoryBase.isValid(), TrackingRecHit.isValid(), edm::reftobase::BaseVectorHolder< T >::const_iterator.isValid(), PerigeeLinearizedTrackState.isValid(), L1GtUtils::LogicalExpressionL1Results.isValid(), LinearizedTrackState< N >.isValid(), edm::reftobase::RefVectorHolderBase::const_iterator.isValid(), reco::TransientTrack.isValid(), TransientVertex.isValid(), BasicTrajectoryState.isValid(), cmdline::OneShotIStream.isValid(), TempTrajectory.isValid(), Trajectory.isValid(), and edmNew::DetSetVector< T >.isValid().

Referenced by ntuple._Object.__getattr__(), ntuple.TrackingVertex.daughterTrackingParticles(), ntuple.TrackingParticle.decayVertices(), ntuple._RecoHitAdaptor.gluedHits(), ntuple.Seed.indexWithinAlgo(), ntuple._RecoHitAdaptor.invalidHits(), ntuple._LayerStrAdaptor.layerStr(), ntuple.TrackingParticle.matchedTrackInfos(), ntuple._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntuple.GluedHit.monoHit(), ntuple.TrackingVertex.nDaughterTrackingParticles(), ntuple._TrackingParticleMatchAdaptor.nMatchedTrackingParticles(), ntuple.TrackingParticle.nMatchedTracks(), ntuple.SimHit.nRecHits(), ntuple._HitObject.nseeds(), ntuple.GluedHit.nseeds(), ntuple._SimHitAdaptor.nSimHits(), ntuple.TrackingVertex.nSourceTrackingParticles(), ntuple._HitObject.ntracks(), ntuple.Vertex.nTracks(), ntuple.TrackingParticle.parentVertex(), ntuple._RecoHitAdaptor.pixelHits(), ntuple.Track.seed(), ntuple._HitObject.seeds(), ntuple.GluedHit.seeds(), ntuple._SimHitAdaptor.simHits(), ntuple.TrackingVertex.sourceTrackingParticles(), ntuple.GluedHit.stereoHit(), ntuple._RecoHitAdaptor.stripHits(), ntuple.TrackMatchInfo.track(), ntuple.Seed.track(), ntuple.TrackingParticleMatchInfo.trackingParticle(), ntuple.SimHit.trackingParticle(), ntuple._HitObject.tracks(), ntuple.Vertex.tracks(), and ntuple.Track.vertex().

97 
98  def _checkIsValid(self):
99  """Raise an exception if the object index is not valid."""
100  if not self.isValid():
101  raise Exception("%s is not valid" % self.__class__.__name__)
def _checkIsValid
Definition: ntuple.py:97
def ntuple._Object.index (   self)
Return object index.

Definition at line 106 of file ntuple.py.

References SeedingNode< DATA >._index, Vispa.Share.FindAlgorithm.FindAlgorithm._index, RPCMuonExtraStruct._index, python.cmstools.EventTree._index, ntuple._Object._index, python.cmstools.EventBranch._index, and html.HtmlReport._index.

Referenced by BeautifulSoup.PageElement._invert().

107  def index(self):
108  """Return object index."""
109  return self._index
def ntuple._Object.isValid (   self)
Check if object index is valid.

Definition at line 102 of file ntuple.py.

References SeedingNode< DATA >._index, Vispa.Share.FindAlgorithm.FindAlgorithm._index, RPCMuonExtraStruct._index, python.cmstools.EventTree._index, ntuple._Object._index, python.cmstools.EventBranch._index, and html.HtmlReport._index.

Referenced by ntuple._Object._checkIsValid(), and core.AutoHandle.AutoHandle.ReallyLoad().

103  def isValid(self):
104  """Check if object index is valid."""
105  return self._index != -1

Member Data Documentation

ntuple._Object._index
private

Definition at line 86 of file ntuple.py.

Referenced by ntuple._Object.__getattr__(), ntuple._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntuple.TrackingParticle._nMatchedTracks(), ntuple.TrackingVertex.daughterTrackingParticles(), ntuple.TrackingParticle.decayVertices(), ntuple._Object.index(), ntuple.Seed.indexWithinAlgo(), ntuple._Object.isValid(), ntuple._LayerStrAdaptor.layerStr(), ntuple.InvalidHit.layerStr(), ntuple.TrackingParticle.matchedTrackInfos(), ntuple._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntuple.GluedHit.monoHit(), ntuple.TrackingVertex.nDaughterTrackingParticles(), ntuple.SimHit.nRecHits(), ntuple._HitObject.nseeds(), ntuple.GluedHit.nseeds(), ntuple.TrackingVertex.nSourceTrackingParticles(), ntuple._HitObject.ntracks(), ntuple.Vertex.nTracks(), ntuple.TrackingParticle.parentVertex(), ntuple.Track.seed(), ntuple._HitObject.seeds(), ntuple.GluedHit.seeds(), ntuple.TrackingVertex.sourceTrackingParticles(), ntuple.GluedHit.stereoHit(), ntuple.TrackMatchInfo.track(), ntuple.Seed.track(), ntuple.TrackingParticleMatchInfo.trackingParticle(), ntuple.SimHit.trackingParticle(), ntuple._HitObject.tracks(), ntuple.Vertex.tracks(), and ntuple.Track.vertex().

ntuple._Object._prefix
private

Definition at line 87 of file ntuple.py.

Referenced by ntuple._Object.__getattr__(), ntuple.BeamSpot.__getattr__(), ntuple._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntuple._LayerStrAdaptor.layerStr(), ntuple.TrackingParticle.matchedTrackInfos(), ntuple._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntuple._HitObject.nseeds(), ntuple._HitObject.ntracks(), ntuple._HitObject.seeds(), ntuple.TrackMatchInfo.track(), ntuple.TrackingParticleMatchInfo.trackingParticle(), ntuple.SimHit.trackingParticle(), and ntuple._HitObject.tracks().

ntuple._Object._tree
private

Definition at line 85 of file ntuple.py.

Referenced by ntuple._Object.__getattr__(), ntuple.BeamSpot.__getattr__(), ntuple.TrackingNtuple.__iter__(), ntuple._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntuple.Event.beamspot(), ntuple.TrackingVertex.daughterTrackingParticles(), ntuple.TrackingParticle.decayVertices(), ntuple._RecoHitAdaptor.gluedHits(), ntuple.Event.gluedHits(), ntuple.TrackingNtuple.hasHits(), ntuple.TrackingNtuple.hasSeeds(), ntuple._RecoHitAdaptor.hits(), ntuple.Seed.indexWithinAlgo(), ntuple._RecoHitAdaptor.invalidHits(), ntuple._LayerStrAdaptor.layerStr(), ntuple.TrackingParticle.matchedTrackInfos(), ntuple._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntuple.GluedHit.monoHit(), ntuple._HitObject.nseeds(), ntuple._HitObject.ntracks(), ntuple.TrackingParticle.parentVertex(), ntuple._RecoHitAdaptor.pixelHits(), ntuple.Event.pixelHits(), ntuple.Track.seed(), ntuple._HitObject.seeds(), ntuple.Event.seeds(), ntuple.GluedHit.seeds(), ntuple._SimHitAdaptor.simHits(), ntuple.TrackingVertex.sourceTrackingParticles(), ntuple.GluedHit.stereoHit(), ntuple._RecoHitAdaptor.stripHits(), ntuple.Event.stripHits(), ntuple.TrackMatchInfo.track(), ntuple.Seed.track(), ntuple.TrackingParticleMatchInfo.trackingParticle(), ntuple.SimHit.trackingParticle(), ntuple.Event.trackingParticles(), ntuple.Event.trackingVertices(), ntuple._HitObject.tracks(), ntuple.Event.tracks(), ntuple.Vertex.tracks(), ntuple.TrackingNtuple.tree(), ntuple.Track.vertex(), and ntuple.Event.vertices().