CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor Class Reference
Inheritance diagram for Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor:
Vispa.Share.BasicDataAccessor.BasicDataAccessor Vispa.Share.RelativeDataAccessor.RelativeDataAccessor Vispa.Share.ParticleDataAccessor.ParticleDataAccessor Vispa.Plugins.EventBrowser.EventFileAccessor.EventFileAccessor

Public Member Functions

def __init__
 
def charge
 
def children
 
def color
 
def compareObjects
 
def daughterRelations
 
def eventNumber
 
def filterBranches
 
def filteredBranches
 
def getBranch
 
def getDaughterObjects
 
def getDepth
 
def getObjectContent
 
def getObjectLabel
 
def getObjectProperties
 
def getObjectRef
 
def getShortLabel
 
def getShortLabelWithType
 
def getShortType
 
def getType
 
def goto
 
def isBoson
 
def isContainer
 
def isGluon
 
def isHiggs
 
def isLepton
 
def isPhoton
 
def isQuark
 
def isRead
 
def isVectorObject
 
def label
 
def lineStyle
 
def linkDaughter
 
def linkMother
 
def motherRelations
 
def numberOfEvents
 
def open
 
def particleId
 
def properties
 
def read
 
def readDaughtersRecursive
 
def readObjectsRecursive
 
def setFilterBranches
 
def setUnderscoreProperties
 
def topLevelObjects
 
def underscoreProperties
 
- Public Member Functions inherited from Vispa.Share.BasicDataAccessor.BasicDataAccessor
def addProperty
 
def allChildren
 
def children
 
def isContainer
 
def label
 
def properties
 
def property
 
def propertyValue
 
def removeProperty
 
def setProperty
 
def topLevelObjects
 
- Public Member Functions inherited from Vispa.Share.RelativeDataAccessor.RelativeDataAccessor
def allDaughterRelations
 
def allMotherRelations
 
def daughterRelations
 
def hasRelations
 
def motherRelations
 
- Public Member Functions inherited from Vispa.Share.ParticleDataAccessor.ParticleDataAccessor
def charge
 
def color
 
def createParticle
 
def id
 
def isBoson
 
def isGluon
 
def isLepton
 
def isQuark
 
def lineStyle
 
def linkDaughter
 
def linkMother
 
def particleId
 
- Public Member Functions inherited from Vispa.Plugins.EventBrowser.EventFileAccessor.EventFileAccessor
def close
 
def eventNumber
 
def goto
 
def numberOfEvents
 
def open
 

Public Attributes

 maxDaughters
 
 maxLevels
 

Private Member Functions

def _propertyType
 

Private Attributes

 _branches
 
 _dataObjects
 
 _edmChildren
 
 _edmChildrenObjects
 
 _edmDaughterRelations
 
 _edmLabel
 
 _edmMotherRelations
 
 _edmParent
 
 _eventIndex
 
 _events
 
 _filename
 
 _filterBranches
 
 _filteredBranches
 
 _numEvents
 
 _readOnDemand
 
 _underscore
 

Additional Inherited Members

- Static Public Attributes inherited from Vispa.Share.ParticleDataAccessor.ParticleDataAccessor
int LINE_STYLE_DASH = 1
 
int LINE_STYLE_SOLID = 0
 
int LINE_STYLE_SPIRAL = 3
 
int LINE_STYLE_WAVE = 2
 
int LINE_VERTEX = 4
 

Detailed Description

Definition at line 50 of file EdmDataAccessor.py.

Constructor & Destructor Documentation

def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.__init__ (   self)

Definition at line 52 of file EdmDataAccessor.py.

52 
53  def __init__(self):
54  logging.debug(__name__ + ": __init__")
55 
56  self._dataObjects = []
57  self._edmLabel={}
58  self._edmParent={}
59  self._edmChildren={}
62  self._edmChildrenObjects={}
63 
64  self._eventIndex = 0
65  self._numEvents = 0
66 
67  self._filename=""
68  self._branches=[]
70  self._events=None
71  self._readOnDemand=True
72  self._underscore=False
73  self._filterBranches=True
74  self.maxLevels=2
75  self.maxDaughters=1000

Member Function Documentation

def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._propertyType (   self,
  value 
)
private

Definition at line 295 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects().

296  def _propertyType(self,value):
297  if type(value) in (bool,):
298  return "Boolean"
299  elif type(value) in (int, long):
300  return "Integer"
301  elif type(value) in (float,):
302  return "Double"
303  elif type(value) in (complex,str,unicode):
304  return "String"
305  else:
306  return None
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.charge (   self,
  object 
)

Definition at line 595 of file EdmDataAccessor.py.

References Vispa.Share.BasicDataAccessor.BasicDataAccessor.property().

596  def charge(self, object):
597  charge=self.property(object,"charge")
598  if charge==None:
599  charge=0
600  return charge
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.children (   self,
  object 
)
Get children of an object 

Definition at line 85 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildren, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead().

Referenced by Vispa.Share.BasicDataAccessor.BasicDataAccessor.allChildren(), Vispa.Views.LineDecayView.LineDecayView.autolayout(), Vispa.Views.BoxDecayView.BoxDecayContainer.autolayoutAlgorithm(), Vispa.Gui.WidgetContainer.WidgetContainer.autolayoutChildren(), Vispa.Gui.WidgetContainer.WidgetContainer.autosize(), Vispa.Views.LineDecayView.LineDecayContainer.childContainer(), Vispa.Views.WidgetView.WidgetView.clear(), Vispa.Views.LineDecayView.LineDecayContainer.createDecayObjectsFromPxlObject(), Vispa.Gui.ConnectableWidgetOwner.ConnectableWidgetOwner.deleteSelectedConnections(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.deselectAllWidgets(), Vispa.Gui.ConnectableWidgetOwner.ConnectableWidgetOwner.getWidgetByName(), Vispa.Gui.ConnectableWidgetOwner.ConnectableWidgetOwner.hideMenuWidgets(), Vispa.Views.LineDecayView.LineDecayView.lineDecayContainer(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.mouseReleaseEvent(), Vispa.Gui.ConnectableWidgetOwner.ConnectableWidgetOwner.portConnection(), Vispa.Gui.ConnectableWidgetOwner.ConnectableWidgetOwner.propagateEventUnderConnectionWidget(), Vispa.Views.LineDecayView.LineDecayContainer.scheduleUpdateVisibleList(), Vispa.Views.LineDecayView.LineDecayView.scrollBarValueChanged(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.selectedWidgets(), Vispa.Views.LineDecayView.LineDecayContainer.setAcceptDrops(), Vispa.Gui.VispaWidget.VispaWidget.setDragable(), Vispa.Views.LineDecayView.LineDecayView.setEditable(), Vispa.Gui.ZoomableWidget.ZoomableWidget.setZoom(), Vispa.Gui.WidgetContainer.WidgetContainer.toggleCollapse(), Vispa.Gui.ConnectableWidgetOwner.ConnectableWidgetOwner.updateConnections(), and Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner.widgetDragged().

85 
86  def children(self,object):
87  """ Get children of an object """
88  if id(object) in self._edmChildren.keys() and self.isRead(object):
89  return self._edmChildren[id(object)]
90  else:
91  return ()
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.color (   self,
  object 
)

Definition at line 583 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

Referenced by cuy.plotElement.__init__(), cuy.superimposeElement.__init__(), and cuy.graphElement.__init__().

584  def color(self, object):
585  particleId = self.particleId(object)
586  if defaultParticleDataList.isLeptonId(particleId):
587  return QColor(244, 164, 96)
588  elif defaultParticleDataList.isQuarkId(particleId):
589  return QColor(0, 100, 0)
590  elif hasattr(defaultParticleDataList,"isHiggsId") and defaultParticleDataList.isHiggsId(particleId):
591  return QColor(247, 77, 251)
592  elif defaultParticleDataList.isBosonId(particleId):
593  return QColor(253, 74, 74)
594  return QColor(176, 179, 177)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.compareObjects (   self,
  a,
  b 
)

Definition at line 235 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects().

236  def compareObjects(self,a,b):
237  same=False
238  if hasattr(a,"px") and hasattr(a,"py") and hasattr(a,"pz") and hasattr(a,"energy") and \
239  hasattr(b,"px") and hasattr(b,"py") and hasattr(b,"pz") and hasattr(b,"energy"):
240  same=a.px()==b.px() and a.py()==b.py() and a.pz()==b.pz() and a.energy()==b.energy()
241  return same
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.daughterRelations (   self,
  object 
)
Get daughterRelations of an object 

Definition at line 106 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmDaughterRelations, and Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id().

Referenced by Vispa.Share.RelativeDataAccessor.RelativeDataAccessor.allDaughterRelations().

107  def daughterRelations(self,object):
108  """ Get daughterRelations of an object """
109  if id(object) in self._edmDaughterRelations.keys():
110  return self._edmDaughterRelations[id(object)]
111  else:
112  return ()
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.eventNumber (   self)

Definition at line 488 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._eventIndex.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

489  def eventNumber(self):
490  return self._eventIndex+1
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.filterBranches (   self)

Definition at line 613 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filterBranches.

614  def filterBranches(self):
615  return self._filterBranches
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.filteredBranches (   self)

Definition at line 633 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filteredBranches.

634  def filteredBranches(self):
return self._filteredBranches
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getBranch (   self,
  object 
)

Definition at line 142 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmParent, and Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties().

143  def getBranch(self,object):
144  entry=object
145  while id(entry) in self._edmParent.keys() and self._edmParent[id(entry)]!=None:
146  entry=self._edmParent[id(entry)]
147  return entry
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects (   self,
  object 
)
get list of daughter objects from properties 

Definition at line 242 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmDaughterRelations, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmMotherRelations, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._propertyType(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.all(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.compareObjects(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectContent(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectProperties(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectRef(), CocoaSolidShape.getType(), l1t::BlockHeader.getType(), pos::PixelTKFECParameters.getType(), DDDividedGeometryObject.getType(), cond::persistency::IPayloadTable.getType(), SiPixelRawDataError.getType(), pos::PixelTKFECConfig.getType(), l1t::EtSum.getType(), l1t::CaloSpare.getType(), cond::persistency::PAYLOAD::Table.getType(), cond::persistency::OraPayloadTable.getType(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getType(), TrackingRecHit.getType(), Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isVectorObject().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive().

243  def getDaughterObjects(self,object):
244  """ get list of daughter objects from properties """
245  objects=[]
246  # subobjects
247  objectdict={}
248  hidden_attr=["front","back","IsA","clone","masterClone","masterClonePtr","mother","motherRef","motherPtr","daughter","daughterRef","daughterPtr","is_back_safe"]
249  broken_attr=[]#["jtaRef"]
250  for attr1,property1 in self.getObjectProperties(object):
251  if attr1 in hidden_attr:
252  pass
253  elif attr1 in broken_attr:
254  objectdict[attr1]=("ERROR: Cannot read property",False)
255  else:
256  (value,ref)=self.getObjectRef(self.getObjectContent(property1))
257  if not isinstance(value,type(None)) and (not self.isVectorObject(object) or self._propertyType(value)!=None):
258  objectdict[attr1]=(value,ref)
259  for name in sorted(objectdict.keys()):
260  objects+=[(name,objectdict[name][0],objectdict[name][1],self._propertyType(objectdict[name][0]))]
261  # entries in vector
262  if self.isVectorObject(object):
263  n=0
264  for o in all(object):
265  (value,ref)=self.getObjectRef(o)
266  typ=self._propertyType(value)
267  if typ!=None:
268  name="["+str(n)+"]"
269  elif "GenParticle" in str(value):
270  name=defaultParticleDataList.getNameFromId(value.pdgId())
271  else:
272  name=self.getType(value)+" ["+str(n)+"]"
273  objects+=[(name,value,ref,typ)]
274  n+=1
275  # read candidate relations
276  for name,mother,ref,propertyType in objects:
277  if hasattr(mother,"numberOfDaughters") and hasattr(mother,"daughter"):
278  try:
279  for n in range(mother.numberOfDaughters()):
280  daughter=mother.daughter(n)
281  found=False
282  for na,da,re,st in objects:
283  if self.compareObjects(daughter,da):
284  daughter=da
285  found=True
286  if not id(mother) in self._edmDaughterRelations.keys():
287  self._edmDaughterRelations[id(mother)]=[]
288  self._edmDaughterRelations[id(mother)]+=[daughter]
289  if not id(daughter) in self._edmMotherRelations.keys():
290  self._edmMotherRelations[id(daughter)]=[]
291  self._edmMotherRelations[id(daughter)]+=[mother]
292  except Exception, message:
293  logging.error("Cannot read candidate relations: "+str(message))
294  return objects
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDepth (   self,
  object 
)

Definition at line 148 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmParent, and Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id().

149  def getDepth(self,object):
150  entry=object
151  i=0
152  while id(entry) in self._edmParent.keys() and self._edmParent[id(entry)]!=None:
153  entry=self._edmParent[id(entry)]
154  i+=1
155  return i
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectContent (   self,
  object 
)
get string value of a method 

Definition at line 187 of file EdmDataAccessor.py.

References prof2calltree.count, join(), dbtoconf.object, and split.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects().

188  def getObjectContent(self,object):
189  """ get string value of a method """
190  if not callable(object):
191  return object
192  else:
193  typ=""
194  if not object.__doc__ or str(object.__doc__)=="":
195  return "ERROR: Empty __doc__ string"
196  docs=str(object.__doc__).split("\n")
197  for doc in docs:
198  parameters=[]
199  for p in doc[doc.find("(")+1:doc.find(")")].split(","):
200  if p!="" and not "=" in p:
201  parameters+=[p]
202  if len(parameters)!=0:
203  continue
204  typestring=doc[:doc.find("(")]
205  split_typestring=typestring.split(" ")
206  templates=0
207  end_typestring=0
208  for i in reversed(range(len(split_typestring))):
209  templates+=split_typestring[i].count("<")
210  templates-=split_typestring[i].count(">")
211  if templates==0:
212  end_typestring=i
213  break
214  typ=" ".join(split_typestring[:end_typestring])
215  hidden_types=["iterator","Iterator"]
216  root_types=["ROOT::"]
217  if typ=="" or "void" in typ or True in [t in typ for t in hidden_types]:
218  return None
219  from ROOT import TClass
220  if True in [t in typ for t in root_types] and TClass.GetClass(typ)==None:
221  return "ERROR: Cannot display object of type "+typ
222  try:
223  object=object()
224  value=object
225  except Exception, message:
226  value="ERROR: "+str(message)
227  if "Buffer" in str(type(value)):
228  return "ERROR: Cannot display object of type "+typ
229  else:
230  return value
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
list object
Definition: dbtoconf.py:77
double split
Definition: MVATrainer.cc:139
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectLabel (   self,
  object 
)

Definition at line 126 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), join(), and split.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties().

127  def getObjectLabel(self,object):
128  splitlabel=self._edmLabel[id(object)].strip(".").split(".")
129  return ".".join(splitlabel[1:-1])
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
double split
Definition: MVATrainer.cc:139
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectProperties (   self,
  object 
)
get all method properties of an object 

Definition at line 156 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._underscore, and dir.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects().

157  def getObjectProperties(self,object):
158  """ get all method properties of an object """
159  objects=[]
160  for attr in dir(object):
161  prop=getattr(object,attr)
162  if not attr.startswith("__") and (self._underscore or attr.strip("_")==attr):
163  objects+=[(attr,prop)]
164  return objects
dbl *** dir
Definition: mlp_gen.cc:35
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectRef (   self,
  object 
)
get object and resolve references 

Definition at line 165 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortType(), CocoaSolidShape.getType(), l1t::BlockHeader.getType(), pos::PixelTKFECParameters.getType(), DDDividedGeometryObject.getType(), cond::persistency::IPayloadTable.getType(), SiPixelRawDataError.getType(), pos::PixelTKFECConfig.getType(), l1t::EtSum.getType(), l1t::CaloSpare.getType(), cond::persistency::PAYLOAD::Table.getType(), cond::persistency::OraPayloadTable.getType(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getType(), and TrackingRecHit.getType().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects().

166  def getObjectRef(self,object):
167  """ get object and resolve references """
168  typshort=self.getShortType(object)
169  ref_types=["edm::Ref","edm::RefProd","edm::RefToBase","edm::RefToBaseProd","edm::Ptr"]
170  value=object
171  ref=False
172  if typshort in ref_types:
173  try:
174  if hasattr(object, "isNull") and object.isNull():
175  value="ERROR: "+self.getType(object)+" object is null"
176  elif hasattr(object, "isAvailable") and not object.isAvailable():
177  value="ERROR: "+self.getType(object)+" object is not available"
178  else:
179  value=object.get()
180  if type(value)==type(None):
181  value="ERROR: Could not get "+self.getType(object)
182  else:
183  ref=True
184  except Exception, message:
185  value="ERROR: "+str(message)
186  return value,ref
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabel (   self,
  object 
)

Definition at line 116 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), and split.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabelWithType(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.label(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties().

117  def getShortLabel(self,object):
118  if id(object) in self._edmLabel.keys():
119  splitlabel=self._edmLabel[id(object)].strip(".").split(".")
120  return splitlabel[len(splitlabel)-1]
121  else:
122  return ""
double split
Definition: MVATrainer.cc:139
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabelWithType (   self,
  object 
)

Definition at line 123 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabel(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortType().

124  def getShortLabelWithType(self,object):
125  return self.getShortLabel(object)+" <"+self.getShortType(object)+">"
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortType (   self,
  object 
)

Definition at line 138 of file EdmDataAccessor.py.

References CocoaSolidShape.getType(), l1t::BlockHeader.getType(), pos::PixelTKFECParameters.getType(), DDDividedGeometryObject.getType(), cond::persistency::IPayloadTable.getType(), SiPixelRawDataError.getType(), pos::PixelTKFECConfig.getType(), l1t::EtSum.getType(), l1t::CaloSpare.getType(), cond::persistency::PAYLOAD::Table.getType(), cond::persistency::OraPayloadTable.getType(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getType(), TrackingRecHit.getType(), and split.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectRef(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabelWithType(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isVectorObject().

139  def getShortType(self,object):
140  typ=self.getType(object).split("<")[0].strip(" ")
141  return typ
double split
Definition: MVATrainer.cc:139
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getType (   self,
  object 
)

Definition at line 130 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectRef(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortType(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties().

131  def getType(self,object):
132  typ=str(object.__class__)
133  if "\'" in typ:
134  typ=typ.split("\'")[1]
135  if "." in typ:
136  typ=typ.split(".")[len(typ.split("."))-1]
137  return typ.strip(" ")
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto (   self,
  index 
)
Goto event number index in file.

Definition at line 464 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._dataObjects, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildren, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildrenObjects, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmDaughterRelations, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmMotherRelations, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._eventIndex, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._events, MELaserPrim._events, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filterBranches, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filteredBranches, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._readOnDemand, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.maxLevels, cond::FileReader.read(), FileBlob.read(), AlignmentCorrelationsIO.read(), ora::IBlobStreamingService.read(), pos::PixelROCMaskBits.read(), pos::PixelROCTrimBits.read(), SimBeamSpotObjects.read(), MultiFileBlob.read(), AlignmentCorrelationsIORoot.read(), ora::QVReader.read(), LMap::impl.read(), cond::TBufferBlobStreamingService.read(), pos::PixelROCDACSettings.read(), personalPlayback.Applet.read(), AlignmentUserVariablesIO.read(), SurveyPxbImageReader< T >.read(), cond::BlobStreamingService.read(), AlignmentParametersIO.read(), reference_db.ReferenceDB.read(), l1t::LUT.read(), MixingInputConfig.read(), PedeReader.read(), ora::PVectorReader.read(), FedRawDataInputSource.read(), CSCPairResidualsConstraint.read(), NuclearInteractionSimulator.read(), DDStreamer.read(), ora::IRelationalReader.read(), ora::OraPtrReadBuffer.read(), BuildTrackerMapPlugin.read(), ora::QueryableVectorReader.read(), MixingModuleConfig.read(), results_db.ResultsDB.read(), ora::PrimitiveReader.read(), ora::OraReferenceReader.read(), LMap.read(), ora::BlobReader.read(), ora::OraPtrReader.read(), ora::UniqueRefReader.read(), ora::CArrayReader.read(), ora::InlineCArrayReader.read(), ora::ObjectReader.read(), ora::STLContainerReader.read(), ora::NamedRefReader.read(), MuonResidualsTwoBin.read(), ora::DependentClassReader.read(), ora::ReadBuffer.read(), MuonResidualsFitter.read(), DTTFBitArray< N >.read(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

465  def goto(self, index):
466  """ Goto event number index in file.
467  """
468  self._eventIndex=index-1
469  self._edmLabel={}
470  self._edmChildren={}
471  self._edmMotherRelations={}
472  self._edmDaughterRelations={}
473  self._edmChildrenObjects={}
474  if self._events:
475  self._events.to(self._eventIndex)
476  self._dataObjects=[]
477  i=0
478  for branchtuple in self._filteredBranches:
479  branch=BranchDummy(branchtuple)
480  self._dataObjects+=[branch]
481  self._edmLabel[id(branch)]=branchtuple[0]
482  if not self._readOnDemand:
483  self.read(branch,self.maxLevels)
484  i+=1
485  if self._filterBranches and self._events:
486  self.setFilterBranches(True)
487  return True
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isBoson (   self,
  object 
)

Definition at line 551 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

552  def isBoson(self, object):
553  particleId = self.particleId(object)
554  if not particleId:
555  return False
556  return defaultParticleDataList.isBosonId(particleId)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isContainer (   self,
  object 
)
Get children of an object 

Definition at line 92 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildren, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead().

92 
93  def isContainer(self,object):
94  """ Get children of an object """
95  if id(object) in self._edmChildren.keys() and self.isRead(object):
96  return len(self._edmChildren[id(object)])>0
97  else:
98  return True
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isGluon (   self,
  object 
)

Definition at line 545 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

546  def isGluon(self, object):
547  particleId = self.particleId(object)
548  if not particleId:
549  return False
550  return defaultParticleDataList.isGluonId(particleId)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isHiggs (   self,
  object 
)

Definition at line 565 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

566  def isHiggs(self, object):
567  particleId = self.particleId(object)
568  if not particleId:
569  return False
570  if not hasattr(defaultParticleDataList,"isHiggsId"):
571  return False
572  return defaultParticleDataList.isHiggsId(particleId)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isLepton (   self,
  object 
)

Definition at line 539 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

540  def isLepton(self, object):
541  particleId = self.particleId(object)
542  if not particleId:
543  return False
544  return defaultParticleDataList.isLeptonId(particleId)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isPhoton (   self,
  object 
)

Definition at line 557 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

558  def isPhoton(self, object):
559  particleId = self.particleId(object)
560  if not particleId:
561  return False
562  if not hasattr(defaultParticleDataList,"isPhotonId"):
563  return False
564  return defaultParticleDataList.isPhotonId(particleId)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isQuark (   self,
  object 
)

Definition at line 533 of file EdmDataAccessor.py.

References reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

534  def isQuark(self, object):
535  particleId = self.particleId(object)
536  if not particleId:
537  return False
538  return defaultParticleDataList.isQuarkId(particleId)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead (   self,
  object,
  levels = 1 
)

Definition at line 76 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildren, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.children(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isContainer(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read().

76 
77  def isRead(self,object,levels=1):
78  if not id(object) in self._edmChildrenObjects.keys():
79  return False
80  if levels>1 and id(object) in self._edmChildren.keys():
81  for child in self._edmChildren[id(object)]:
82  if not self.isRead(child, levels-1):
83  return False
84  return True
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isVectorObject (   self,
  object 
)

Definition at line 231 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortType().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects().

232  def isVectorObject(self,object):
233  typ=self.getShortType(object)
234  return typ=="list" or typ[-6:].lower()=="vector" or typ[-3:].lower()=="map" or typ[-10:].lower()=="collection" or hasattr(object,"size")
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.label (   self,
  object 
)

Definition at line 113 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabel().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties().

114  def label(self,object):
115  return self.getShortLabel(object)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.lineStyle (   self,
  object 
)

Definition at line 573 of file EdmDataAccessor.py.

References Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.LINE_STYLE_DASH, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.LINE_STYLE_SOLID, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.LINE_STYLE_SPIRAL, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.LINE_STYLE_WAVE, reco::PFCandidate.particleId(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId().

574  def lineStyle(self, object):
575  particleId = self.particleId(object)
576  if hasattr(defaultParticleDataList,"isPhotonId") and defaultParticleDataList.isPhotonId(particleId):
577  return self.LINE_STYLE_WAVE
578  elif defaultParticleDataList.isGluonId(particleId):
579  return self.LINE_STYLE_SPIRAL
580  elif defaultParticleDataList.isBosonId(particleId):
581  return self.LINE_STYLE_DASH
582  return self.LINE_STYLE_SOLID
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.linkDaughter (   self,
  object,
  daughter 
)

Definition at line 604 of file EdmDataAccessor.py.

605  def linkDaughter(self, object, daughter):
606  pass
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.linkMother (   self,
  object,
  mother 
)

Definition at line 601 of file EdmDataAccessor.py.

602  def linkMother(self, object, mother):
603  pass
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.motherRelations (   self,
  object 
)
Get motherRelations of an object 

Definition at line 99 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmMotherRelations, and Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id().

Referenced by Vispa.Share.RelativeDataAccessor.RelativeDataAccessor.allMotherRelations().

99 
100  def motherRelations(self,object):
101  """ Get motherRelations of an object """
102  if id(object) in self._edmMotherRelations.keys():
103  return self._edmMotherRelations[id(object)]
104  else:
105  return ()
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.numberOfEvents (   self)

Definition at line 491 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._numEvents.

492  def numberOfEvents(self):
493  return self._numEvents
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open (   self,
  filename = None 
)
Open edm file and show first event 

Definition at line 497 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._branches, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._events, MELaserPrim._events, Vispa.Main.TabController.TabController._filename, DQMIO2histo.DQMIO._filename, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor._filename, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filename, MuonGeometryArrange._filename, TrackerGeometryCompare._filename, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filteredBranches, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._numEvents, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), and split.

498  def open(self, filename=None):
499  """ Open edm file and show first event """
500  self._filename=filename
501  self._branches=[]
502  if os.path.splitext(filename)[1].lower()==".txt":
503  file = open(filename)
504  for line in file.readlines():
505  if "\"" in line:
506  linecontent=[l.strip(" \n").rstrip(".") for l in line.split("\"")]
507  self._branches+=[(linecontent[0]+"_"+linecontent[1]+"_"+linecontent[3]+"_"+linecontent[5],None,linecontent[1],linecontent[3],linecontent[5])]
508  else:
509  linecontent=line.strip("\n").split(" ")[0].split("_")
510  if len(linecontent)>3:
511  self._branches+=[(linecontent[0]+"_"+linecontent[1]+"_"+linecontent[2]+"_"+linecontent[3],None,linecontent[1],linecontent[2],linecontent[3])]
512  elif os.path.splitext(filename)[1].lower()==".root":
513  from DataFormats.FWLite import Events, Handle
514  self._events = Events(self._filename)
515  self._numEvents=self._events.size()
516  branches=self._events.object().getBranchDescriptions()
517  for branch in branches:
518  try:
519  branchname=branch.friendlyClassName()+"_"+branch.moduleLabel()+"_"+branch.productInstanceName()+"_"+branch.processName()
520  handle=Handle(branch.fullClassName())
521  self._branches+=[(branchname,handle,branch.moduleLabel(),branch.productInstanceName(),branch.processName())]
522  except Exception, e:
523  logging.warning("Cannot read branch "+branchname+":"+str(e))
524  self._branches.sort(lambda x, y: cmp(x[0], y[0]))
525  self._filteredBranches=self._branches[:]
526  return self.goto(1)
double split
Definition: MVATrainer.cc:139
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.particleId (   self,
  object 
)

Definition at line 527 of file EdmDataAccessor.py.

References Vispa.Share.BasicDataAccessor.BasicDataAccessor.property().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.color(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isBoson(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isGluon(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isHiggs(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isLepton(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isPhoton(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isQuark(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.lineStyle().

528  def particleId(self, object):
529  charge=self.property(object,"pdgId")
530  if charge==None:
531  charge=0
532  return charge
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties (   self,
  object 
)
Make list of all properties 

Definition at line 307 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildrenObjects, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getBranch(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectLabel(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabel(), CocoaSolidShape.getType(), l1t::BlockHeader.getType(), pos::PixelTKFECParameters.getType(), DDDividedGeometryObject.getType(), cond::persistency::IPayloadTable.getType(), SiPixelRawDataError.getType(), pos::PixelTKFECConfig.getType(), l1t::CaloSpare.getType(), l1t::EtSum.getType(), cond::persistency::PAYLOAD::Table.getType(), cond::persistency::OraPayloadTable.getType(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getType(), TrackingRecHit.getType(), Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), python.readProv.filereader.Module.label, reco::tau::entry.label, core.AutoHandle.AutoHandle.label, SubDetParams.label, reco::Centrality.label(), ElectronLikelihoodCategoryData.label, entry< T >.label, SiPixelFedFillerWordEventNumber.label, GenericMVAComputerCache::IndividualComputer.label, TtEvent::HypoClassKeyStringToEnum.label, HcalLutSet.label, DTDQMHarvesting.DTDQMHarvesting.label, DTVDriftMeanTimerCalibration.DTVDriftMeanTimerCalibration.label, DTVDriftSegmentCalibration.DTVDriftSegmentCalibration.label, l1t::L1GtBoardTypeStringToEnum.label, DTDQMValidation.DTDQMValidation.label, DTAnalysisResiduals.DTAnalysisResiduals.label, L1GtBoardTypeStringToEnum.label, SiPixelDigiToRaw.label, DTResidualCalibration.DTResidualCalibration.label, DTTTrigValid.DTTTrigValid.label, TrackCandidateTopBottomHitFilter.label, L1GtObjectStringToEnum.label, muon::SelectionTypeStringToEnum.label, ConverterTester.label, DTTTrigResidualCorr.DTTTrigResidualCorr.label, HLTVertexPerformanceAnalyzer.label, SiPixelRawToDigi.label, TaggingVariablePlotter::VariableConfig.label, FWPSetTableManager::PSetData.label, MillePedeVariables.label(), MultiTrackValidatorBase.label, core.TriggerMatchAnalyzer.TriggerMatchAnalyzer.label, MatrixInjector.MatrixInjector.label, PrimaryVertexProducer::algo.label, GlobalDigisHistogrammer.label, GlobalRecHitsHistogrammer.label, L1GtPsbQuadStringToEnum.label, l1t::L1GtPsbQuadStringToEnum.label, python.rootplot.utilities.Hist2D.label, PhysicsTools::MVAModuleHelper< Record, Object, Filler >.label, TauDiscriminationProducerBase< TauType, TauDiscriminator >::TauDiscInfo.label, MuonSimHitsValidAnalyzer.label, cond::DataProxyWrapperBase.label(), pat::TriggerFilter.label(), HLTBTagPerformanceAnalyzer.label, GlobalHitsTester.label, GlobalHitsHistogrammer.label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ToolDataAccessor.label(), ValidationMisalignedTracker.label, PrimaryVertexProducerAlgorithm::algo.label, GlobalHitsAnalyzer.label, MatrixUtil.InputInfo.label, TrackerHitProducer.label, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.label(), GlobalHitsProducer.label, DTDigiReader.label, hitfit::FE_Obj.label, L1GtConditionTypeStringToEnum.label, l1t::GtConditionTypeStringToEnum.label, python.rootplot.utilities.Hist.label, FWColorSelect.label(), GlobalDigisProducer.label, l1t::GtConditionCategoryStringToEnum.label, EcalSimHitsValidProducer.label, L1GtConditionCategoryStringToEnum.label, GlobalDigisAnalyzer.label, FastTimerService::LuminosityDescription.label, GlobalRecHitsAnalyzer.label, GlobalRecHitsProducer.label, Vispa.Gui.FindDialog.FindDialog.label(), PhysicsTools::Calibration::Comparator.label, conddblib.GlobalTagMap.label, edm::TrieNodeIter< T >.label(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.label(), and MuonTrackValidatorBase.label.

Referenced by Vispa.Share.BasicDataAccessor.BasicDataAccessor.property().

308  def properties(self,object):
309  """ Make list of all properties """
310  logging.debug(__name__ + ": properties: "+self.label(object))
311  properties=[]
312 
313  objectproperties={}
314  objectproperties_sorted=[]
315  if id(object) in self._edmChildrenObjects.keys():
316  for name,value,ref,propertyType in self._edmChildrenObjects[id(object)]:
317  if propertyType!=None:
318  objectproperties[name]=(value,propertyType)
319  objectproperties_sorted+=[name]
320 
321  properties+=[("Category","Object info","")]
322  shortlabel=self.getShortLabel(object)
323  properties+=[("String","label",shortlabel)]
324  properties+=[("String","type",self.getType(object))]
325  objectlabel=self.getObjectLabel(object)
326  if objectlabel!="":
327  properties+=[("String","object",objectlabel)]
328  branchlabel=self.label(self.getBranch(object))
329  if shortlabel.strip(".")!=branchlabel.strip("."):
330  properties+=[("String","branch",branchlabel)]
331  else:
332  properties+=[("Category","Branch info","")]
333  properties+=[("String","Type",branchlabel.split("_")[0])]
334  properties+=[("String","Label",branchlabel.split("_")[1])]
335  properties+=[("String","Product",branchlabel.split("_")[2])]
336  properties+=[("String","Process",branchlabel.split("_")[3])]
337 
338  for property in ["pdgId","charge","status"]:
339  if property in objectproperties.keys():
340  properties+=[(objectproperties[property][1],property,objectproperties[property][0])]
341  del objectproperties[property]
342 
343  if "px" in objectproperties.keys():
344  properties+=[("Category","Vector","")]
345  for property in ["energy","px","py","pz","mass","pt","eta","phi","p","theta","y","rapidity","et","mt","mtSqr","massSqr"]:
346  if property in objectproperties.keys():
347  properties+=[(objectproperties[property][1],property,objectproperties[property][0])]
348  del objectproperties[property]
349 
350  if "x" in objectproperties.keys():
351  properties+=[("Category","Vector","")]
352  for property in ["x","y","z"]:
353  if property in objectproperties.keys():
354  properties+=[(objectproperties[property][1],property,objectproperties[property][0])]
355  del objectproperties[property]
356 
357  if False in [str(value[0]).startswith("ERROR") for value in objectproperties.values()]:
358  properties+=[("Category","Values","")]
359  for property in objectproperties_sorted:
360  if property in objectproperties.keys():
361  if not str(objectproperties[property][0]).startswith("ERROR"):
362  properties+=[(objectproperties[property][1],property,objectproperties[property][0])]
363  del objectproperties[property]
364 
365  if len(objectproperties.keys())>0:
366  properties+=[("Category","Errors","")]
367  for property in objectproperties_sorted:
368  if property in objectproperties.keys():
369  properties+=[(objectproperties[property][1],property,objectproperties[property][0])]
370 
371  return tuple(properties)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read (   self,
  object,
  levels = 1 
)
reads contents of a branch 

Definition at line 424 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildrenObjects, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._events, MELaserPrim._events, Vispa.Main.Exceptions.exception_traceback(), Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive().

Referenced by edmIntegrityCheck.PublishToFileSystem.get(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

425  def read(self,object,levels=1):
426  """ reads contents of a branch """
427  logging.debug(__name__ + ": read")
428  if isinstance(object,BranchDummy):
429  if hasattr(object,"product"):
430  return object.product
431  if not self._events:
432  return object
433  try:
434  self._events.getByLabel(object.branchtuple[2],object.branchtuple[3],object.branchtuple[4],object.branchtuple[1])
435  if object.branchtuple[1].isValid():
436  product=object.branchtuple[1].product()
437  if not isinstance(product,(int,float,long,complex,str,unicode,bool)):
438  # override comparison operator of object
439  try:
440  type(product).__eq__=eq
441  type(product).__ne__=ne
442  except:
443  pass
444  self._dataObjects.insert(self._dataObjects.index(object),product)
445  self._dataObjects.remove(object)
446  self._edmLabel[id(product)]=object.branchtuple[0]
447  object.product=product
448  object=product
449  else:
450  self._edmChildrenObjects[id(object)]=[("ERROR","ERROR: Branch is not valid.",False,True)]
451  logging.info("Branch is not valid: "+object.branchtuple[0]+".")
452  object.invalid=True
453  return object
454  except Exception, e:
455  self._edmChildrenObjects[id(object)]=[("ERROR","ERROR: Unable to read branch : "+str(e),False,True)]
456  object.unreadable=True
457  logging.warning("Unable to read branch "+object.branchtuple[0]+" : "+exception_traceback())
458  return object
459  if self.isRead(object,levels):
460  return object
461  if levels>0:
462  self.readDaughtersRecursive(object,[],levels)
463  return object
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive (   self,
  edmobject,
  objects,
  levels = 1 
)
read daughter objects of an edmobject 

Definition at line 397 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildrenObjects, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects(), Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.maxDaughters, and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readObjectsRecursive().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readObjectsRecursive().

398  def readDaughtersRecursive(self,edmobject,objects,levels=1):
399  """ read daughter objects of an edmobject """
400  logging.debug(__name__ + ": readDaughtersRecursive (levels="+str(levels)+"): "+str(edmobject))
401  # read children information
402  if not id(edmobject) in self._edmChildrenObjects.keys():
403  self._edmChildrenObjects[id(edmobject)]=self.getDaughterObjects(edmobject)
404  # analyze children information
405  ok=True
406  daughters=self._edmChildrenObjects[id(edmobject)]
407  i=0
408  for name,daughter,ref,propertyType in daughters:
409  # create children objects
410  if propertyType==None:
411  if ref:
412  label="* "+name
413  else:
414  label=name
415  if id(edmobject) in self._edmLabel.keys() and self._edmLabel[id(edmobject)]!="":
416  label=self._edmLabel[id(edmobject)]+"."+label
417  (res,ok)=self.readObjectsRecursive(edmobject,label,daughter,levels-1)
418  objects+=res
419  i+=1
420  if i>self.maxDaughters:
421  logging.warning("Did not read all daughter objects. Maximum is set to "+str(self.maxDaughters)+".")
422  return objects,False
423  return objects,ok
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readObjectsRecursive (   self,
  mother,
  label,
  edmobject,
  levels = 1 
)
read edm objects recursive 

Definition at line 372 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildren, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmParent, Vispa.Share.ParticleDataAccessor.ParticleDataAccessor.id(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive().

373  def readObjectsRecursive(self,mother,label,edmobject,levels=1):
374  """ read edm objects recursive """
375  logging.debug(__name__ + ": readObjectsRecursive (levels="+str(levels)+"): "+label)
376  # save object information
377  if not id(edmobject) in self._edmLabel.keys():
378  if not isinstance(edmobject,(int,float,long,complex,str,unicode,bool)):
379  # override comparison operator of object
380  try:
381  type(edmobject).__eq__=eq
382  type(edmobject).__ne__=ne
383  except:
384  pass
385  self._edmLabel[id(edmobject)]=label
386  self._edmParent[id(edmobject)]=mother
387  self._edmChildren[id(edmobject)]=[]
388  if not id(mother) in self._edmChildren.keys():
389  self._edmChildren[id(mother)]=[]
390  self._edmChildren[id(mother)]+=[edmobject]
391  if levels==0:
392  # do not read more daughters
393  return [edmobject],True
394  else:
395  # read daughters
396  return self.readDaughtersRecursive(edmobject,[edmobject],levels)
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches (   self,
  check 
)

Definition at line 616 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._branches, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._dataObjects, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._events, MELaserPrim._events, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filterBranches, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filteredBranches, LTCDigi.eventNumber(), DigiAnalyzer.eventNumber, hcalCalib.eventNumber, PUDumper.eventNumber, L1TriggerScalers.eventNumber(), evf::evtn::TCDSHeader::tcdsheader::@315.eventNumber, evf::evtn::TCDSHeader::tcdsheader.eventNumber, StandardTrgMsgBlkStruct.eventNumber, ZdcTBAnalysis.eventNumber, ValidIsoTrkCalib.eventNumber, WenuPlots.eventNumber, GctErrorAnalyzer.eventNumber, ZeePlots.eventNumber, Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.eventNumber(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), cond::FileReader.read(), FileBlob.read(), AlignmentCorrelationsIO.read(), ora::IBlobStreamingService.read(), pos::PixelROCTrimBits.read(), pos::PixelROCMaskBits.read(), SimBeamSpotObjects.read(), MultiFileBlob.read(), AlignmentCorrelationsIORoot.read(), ora::QVReader.read(), LMap::impl.read(), cond::TBufferBlobStreamingService.read(), pos::PixelROCDACSettings.read(), AlignmentUserVariablesIO.read(), personalPlayback.Applet.read(), cond::BlobStreamingService.read(), SurveyPxbImageReader< T >.read(), AlignmentParametersIO.read(), reference_db.ReferenceDB.read(), MixingInputConfig.read(), l1t::LUT.read(), PedeReader.read(), ora::PVectorReader.read(), FedRawDataInputSource.read(), CSCPairResidualsConstraint.read(), NuclearInteractionSimulator.read(), DDStreamer.read(), ora::OraPtrReadBuffer.read(), ora::IRelationalReader.read(), BuildTrackerMapPlugin.read(), ora::QueryableVectorReader.read(), results_db.ResultsDB.read(), MixingModuleConfig.read(), ora::PrimitiveReader.read(), ora::OraReferenceReader.read(), LMap.read(), ora::BlobReader.read(), ora::UniqueRefReader.read(), ora::OraPtrReader.read(), ora::CArrayReader.read(), ora::InlineCArrayReader.read(), ora::ObjectReader.read(), ora::STLContainerReader.read(), ora::NamedRefReader.read(), MuonResidualsTwoBin.read(), ora::DependentClassReader.read(), ora::ReadBuffer.read(), MuonResidualsFitter.read(), DTTFBitArray< N >.read(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read().

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto().

617  def setFilterBranches(self,check):
618  if not self._events:
619  return True
620  self._filterBranches=check
621  if check:
622  for branch in self._dataObjects[:]:
623  result=self.read(branch,0)
624  if isinstance(result,BranchDummy):
625  self._dataObjects.remove(result)
626  if hasattr(result,"invalid"):
627  self._filteredBranches.remove(result.branchtuple)
628  return True
629  else:
630  self._filteredBranches=self._branches[:]
631  self.goto(self.eventNumber())
632  return False
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setUnderscoreProperties (   self,
  check 
)

Definition at line 610 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._underscore.

611  def setUnderscoreProperties(self,check):
612  self._underscore=check
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.topLevelObjects (   self)

Definition at line 494 of file EdmDataAccessor.py.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._dataObjects.

495  def topLevelObjects(self):
496  return self._dataObjects
def Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.underscoreProperties (   self)

Definition at line 607 of file EdmDataAccessor.py.

608  def underscoreProperties(self):
609  return self._underscore

Member Data Documentation

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._branches
private

Definition at line 67 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._dataObjects
private

Definition at line 55 of file EdmDataAccessor.py.

Referenced by Vispa.Share.ObjectHolder.ObjectHolder.allDataObjectChildren(), Vispa.Share.ObjectHolder.ObjectHolder.appendObject(), Vispa.Share.ObjectHolder.ObjectHolder.clearObjects(), Vispa.Share.ObjectHolder.ObjectHolder.dataObjects(), Vispa.Views.LineDecayView.LineDecayContainer.dataObjects(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), Vispa.Share.ObjectHolder.ObjectHolder.numberDataObjectChildren(), Vispa.Share.ObjectHolder.ObjectHolder.removeObject(), Vispa.Share.ObjectHolder.ObjectHolder.setDataObject(), Vispa.Share.ObjectHolder.ObjectHolder.setDataObjects(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.topLevelObjects().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildren
private

Definition at line 58 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.children(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isContainer(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.isRead(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readObjectsRecursive().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmChildrenObjects
private

Definition at line 61 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.properties(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmDaughterRelations
private

Definition at line 60 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.daughterRelations(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmLabel
private

Definition at line 56 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectLabel(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getShortLabel(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readObjectsRecursive().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmMotherRelations
private

Definition at line 59 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDaughterObjects(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.motherRelations().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._edmParent
private

Definition at line 57 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getBranch(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getDepth(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readObjectsRecursive().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._eventIndex
private

Definition at line 63 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.eventNumber(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._events
private

Definition at line 69 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.read(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filename
private

Definition at line 66 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filterBranches
private

Definition at line 72 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.filterBranches(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._filteredBranches
private

Definition at line 68 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.filteredBranches(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setFilterBranches().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._numEvents
private

Definition at line 64 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.numberOfEvents(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.open().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._readOnDemand
private

Definition at line 70 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor._underscore
private

Definition at line 71 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.getObjectProperties(), Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.setUnderscoreProperties(), and Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.underscoreProperties().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.maxDaughters

Definition at line 74 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.readDaughtersRecursive().

Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.maxLevels

Definition at line 73 of file EdmDataAccessor.py.

Referenced by Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor.goto().