Exemple #1
0
 def color(self, node):
     '''used to color dag nodes
     @param node: a node in the DAG history'''
     cols = [
         "red", "lightblue", "green", "yellow", "cyan", "grey", "white",
         "pink"
     ]
     return cols[IdCoder.get_type(node.get_value())]
 def get_object(self, uniqueid):
     ''' given a uniqueid return the underlying obejct
     '''
     type = IdCoder.get_type(uniqueid)
     subtype = IdCoder.get_subtype(uniqueid)
     if type == IdCoder.PFOBJECTTYPE.TRACK:
         return self.tracks[uniqueid]       
     elif type == IdCoder.PFOBJECTTYPE.ECALCLUSTER:      
         return self.ecal_clusters[uniqueid] 
     elif type == IdCoder.PFOBJECTTYPE.HCALCLUSTER:            
         return self.hcal_clusters[uniqueid]            
     elif type == IdCoder.PFOBJECTTYPE.PARTICLE:
         if subtype == 'g':
             return self.sim_particles[uniqueid]       
         elif subtype == 'r':
             return self.reconstructed_particles[uniqueid]
     elif type == IdCoder.PFOBJECTTYPE.BLOCK:
         return self.blocks[uniqueid]
     else:
         assert(False)   
 def get_object(self, uniqueid):
     ''' given a uniqueid return the underlying obejct
     '''
     type = IdCoder.get_type(uniqueid)
     subtype = IdCoder.get_subtype(uniqueid)
     if type == IdCoder.PFOBJECTTYPE.TRACK:
         return self.tracks[uniqueid]
     elif type == IdCoder.PFOBJECTTYPE.ECALCLUSTER:
         return self.ecal_clusters[uniqueid]
     elif type == IdCoder.PFOBJECTTYPE.HCALCLUSTER:
         return self.hcal_clusters[uniqueid]
     elif type == IdCoder.PFOBJECTTYPE.PARTICLE:
         if subtype == 'g':
             return self.sim_particles[uniqueid]
         elif subtype == 'r':
             return self.reconstructed_particles[uniqueid]
     elif type == IdCoder.PFOBJECTTYPE.BLOCK:
         return self.blocks[uniqueid]
     else:
         assert (False)
Exemple #4
0
 def color(self, node):
     '''used to color dag nodes
     @param node: a node in the DAG history'''
     cols = ["red", "lightblue", "green", "yellow", "cyan", "grey", "white", "pink"]
     return cols[IdCoder.get_type(node.get_value())]