CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
output.OutputTree Class Reference
Inheritance diagram for output.OutputTree:
output.FriendOutput output.FullOutput

Public Member Functions

def __init__ (self, tfile, ttree, intree)
 
def branch (self, name, rootBranchType, n=1, lenVar=None, title=None, limitedPrecision=False)
 
def fill (self)
 
def fillBranch (self, name, val)
 
def tree (self)
 
def write (self)
 

Private Attributes

 _branches
 
 _file
 
 _intree
 
 _tree
 

Detailed Description

Definition at line 68 of file output.py.

Constructor & Destructor Documentation

◆ __init__()

def output.OutputTree.__init__ (   self,
  tfile,
  ttree,
  intree 
)

Definition at line 69 of file output.py.

69  def __init__(self, tfile, ttree, intree):
70  self._file = tfile
71  self._tree = ttree
72  self._intree = intree
73  self._branches = {}
74 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ branch()

def output.OutputTree.branch (   self,
  name,
  rootBranchType,
  n = 1,
  lenVar = None,
  title = None,
  limitedPrecision = False 
)

Definition at line 78 of file output.py.

References output.OutputTree._branches, datamodel.Event._tree, and output.OutputTree._tree.

Referenced by python.cmstools.EventTree.__getattr__().

78  ):
79  # and (not self._tree.GetBranch(lenVar)):
80  if (lenVar != None) and (lenVar not in self._branches):
81  self._branches[lenVar] = OutputBranch(self._tree, lenVar, "i")
82  self._branches[name] = OutputBranch(
83  self._tree, name, rootBranchType, n=n,
84  lenVar=lenVar, title=title, limitedPrecision=limitedPrecision
85  )
86  return self._branches[name]
87 

◆ fill()

def output.OutputTree.fill (   self)

Definition at line 99 of file output.py.

References datamodel.Event._tree, output.OutputTree._tree, and HcalObjRepresent.Fill().

99  def fill(self):
100  self._tree.Fill()
101 
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)

◆ fillBranch()

def output.OutputTree.fillBranch (   self,
  name,
  val 
)

Definition at line 88 of file output.py.

References output.OutputTree._branches, output.OutputTree._intree, and treeReaderArrayTools.setExtraBranch().

88  def fillBranch(self, name, val):
89  br = self._branches[name]
90  if br.lenVar and (br.lenVar in self._branches):
91  self._branches[br.lenVar].buff[0] = len(val)
92  setExtraBranch(self._intree, br.lenVar, len(val))
93  br.fill(val)
94  setExtraBranch(self._intree, name, val)
95 
def setExtraBranch(tree, name, val)

◆ tree()

def output.OutputTree.tree (   self)

◆ write()

def output.OutputTree.write (   self)

Definition at line 102 of file output.py.

References CommonAnalyzer._file, output.OutputTree._file, dqm-mbProfile.Profile._file, datamodel.Event._tree, output.OutputTree._tree, and hippyaddtobaddatafiles.cd().

102  def write(self):
103  self._file.cd()
104  self._tree.Write()
105 
106 

Member Data Documentation

◆ _branches

output.OutputTree._branches
private

Definition at line 73 of file output.py.

Referenced by output.OutputTree.branch(), and output.OutputTree.fillBranch().

◆ _file

output.OutputTree._file
private

Definition at line 70 of file output.py.

Referenced by ntupleDataFormat.TrackingNtuple.file(), and output.OutputTree.write().

◆ _intree

output.OutputTree._intree
private

Definition at line 72 of file output.py.

Referenced by output.OutputTree.fillBranch().

◆ _tree

output.OutputTree._tree
private

Definition at line 71 of file output.py.

Referenced by ntupleDataFormat._Object.__getattr__(), ntupleDataFormat.BeamSpot.__getattr__(), ntupleDataFormat._Collection.__getitem__(), python.cmstools.EventTree.__getitem__(), ntupleDataFormat._Collection.__iter__(), python.cmstools.EventTree.__iter__(), ntupleDataFormat.TrackingNtuple.__iter__(), ntupleDataFormat.TrackingParticle._nMatchedSeeds(), ntupleDataFormat._SimHitMatchAdaptor._nMatchedSimHits(), ntupleDataFormat._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntupleDataFormat.TrackingParticle._nMatchedTracks(), ntupleDataFormat.Event.beamspot(), ntupleDataFormat.TrackingParticle.bestMatchingTrack(), ntupleDataFormat._TrackingParticleMatchAdaptor.bestMatchingTrackingParticle(), ntupleDataFormat._TrackingParticleMatchAdaptor.bestMatchingTrackingParticleFromFirstHit(), output.OutputTree.branch(), python.cmstools.EventTree.branch(), python.cmstools.EventTree.cppCode(), ntupleDataFormat.TrackingVertex.daughterTrackingParticles(), ntupleDataFormat.TrackingParticle.decayVertices(), ntupleDataFormat._DetIdStrAdaptor.detIdStr(), ntupleDataFormat.Event.event(), ntupleDataFormat.Event.eventId(), output.OutputTree.fill(), output.FullOutput.fill(), ntupleDataFormat.TrackingNtuple.getEvent(), ntupleDataFormat._RecoHitAdaptor.gluedHits(), ntupleDataFormat.Event.gluedHits(), ntupleDataFormat.TrackingNtuple.hasHits(), ntupleDataFormat.TrackingNtuple.hasSeeds(), ntupleDataFormat._RecoHitAdaptor.hits(), ntupleDataFormat.Seed.indexWithinAlgo(), ntupleDataFormat._RecoHitAdaptor.invalidHits(), ntupleDataFormat.TrackingParticle.isLooper(), ntupleDataFormat._DetIdStrAdaptor.layerStr(), ntupleDataFormat.InvalidHit.layerStr(), ntupleDataFormat.Event.lumi(), ntupleDataFormat.TrackingParticle.matchedSeedInfos(), ntupleDataFormat._SimHitMatchAdaptor.matchedSimHitInfos(), ntupleDataFormat.TrackingParticle.matchedTrackInfos(), ntupleDataFormat._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntupleDataFormat.GluedHit.monoHit(), ntupleDataFormat.TrackingVertex.nDaughterTrackingParticles(), ntupleDataFormat.SimHit.nRecHits(), ntupleDataFormat._HitObject.nseeds(), ntupleDataFormat.GluedHit.nseeds(), ntupleDataFormat.Seeds.nSeedsForAlgo(), ntupleDataFormat.TrackingVertex.nSourceTrackingParticles(), ntupleDataFormat._HitObject.ntracks(), ntupleDataFormat.Vertex.nTracks(), ntupleDataFormat.TrackingParticle.parentVertex(), ntupleDataFormat._RecoHitAdaptor.phase2OTHits(), ntupleDataFormat.Event.phase2OTHits(), ntupleDataFormat._RecoHitAdaptor.pixelHits(), ntupleDataFormat.Event.pixelHits(), ntupleDataFormat.Event.run(), ntupleDataFormat.SeedMatchInfo.seed(), ntupleDataFormat.Track.seed(), ntupleDataFormat.Seeds.seedForAlgo(), ntupleDataFormat._HitObject.seeds(), ntupleDataFormat.Event.seeds(), ntupleDataFormat.GluedHit.seeds(), ntupleDataFormat.Seeds.seedsForAlgo(), ntupleDataFormat.SimHitMatchInfo.simHit(), ntupleDataFormat.TrackingParticle.simHits(), ntupleDataFormat._Collection.size(), ntupleDataFormat.TrackingVertex.sourceTrackingParticles(), ntupleDataFormat.GluedHit.stereoHit(), ntupleDataFormat._RecoHitAdaptor.stripHits(), ntupleDataFormat.Event.stripHits(), ntupleDataFormat.TrackMatchInfo.track(), ntupleDataFormat.Seed.track(), ntupleDataFormat.TrackingParticleMatchInfo.trackingParticle(), ntupleDataFormat.SimHit.trackingParticle(), ntupleDataFormat.Event.trackingParticles(), ntupleDataFormat.Event.trackingVertices(), ntupleDataFormat._HitObject.tracks(), ntupleDataFormat.Event.tracks(), ntupleDataFormat.Vertex.tracks(), output.OutputTree.tree(), python.cmstools.EventTree.tree(), ntupleDataFormat.TrackingNtuple.tree(), ntupleDataFormat.Track.vertex(), ntupleDataFormat.Event.vertices(), output.OutputTree.write(), and output.FullOutput.write().