10 from AthenaConfiguration.ComponentFactory 
import CompFactory
 
   11 from D3PDMakerCoreComps.D3PDObject 
import D3PDObject
 
   12 from D3PDMakerConfig.D3PDMakerFlags 
import D3PDMakerFlags
 
   14 D3PD = CompFactory.D3PD
 
   18     def __init__ (self, name, flags, acc, registry, *args, **kw):
 
   27         """Add a new IObjFillerTool to a tree.""" 
   30         nchild = len (self.
alg.Tools)
 
   31         if not isinstance(configs, list):
 
   33         self.
alg.Tools += configs
 
   35         for c 
in self.
alg.Tools[nchild:]:
 
   39             D3PDObject.runHooks (c, self.
flags, self.
acc)
 
   44         """Scan CONF and all children to set the proper 
   45         collection getter registry for this tree. 
   48         if 'CollectionGetterRegistry' in conf.getDefaultProperties():
 
   49             conf.CollectionGetterRegistry = self.
registry 
   50         if 'BlockFillers' in conf.getDefaultProperties():
 
   51             for c 
in conf.BlockFillers:
 
   53                 D3PDObject.runHooks (c, self.
flags, self.
acc)
 
   54         if 'Getter' in conf.getDefaultProperties():
 
   56         if 'SelectionGetter' in conf.getDefaultProperties():
 
   58         if 'Associator' in conf.getDefaultProperties():
 
   64                     clevel = D3PDMakerFlags.CompressionLevel,
 
   65                     autoflush = D3PDMakerFlags.AutoFlush,
 
   66                     ExistDataHeader = True, **kw):
 
   67     """Configure algorithm for making a D3PD tree. 
   69     Each distinct D3PD tree is make by a separate algorithm. 
   70     This function is used to configure these algorithms. 
   74       flags: The configuration flags. 
   75       name: The name of the algorithm (required). 
   76       stream: Athena stream for the tuple. 
   77       file: Name of the file containing the tuple. 
   78             If it starts with `pool:', then the tree is being emitted 
   79             into a POOL file.  In that case, stream is just the name 
   81       clevel: Compresson level for the output ROOT file. By default it is 
   82               controlled by the D3PDMakerFlags.CompressionLevel flag, but 
   83               can be controlled D3PD-by-D3PD as well. 
   84       autoflush: Allows overriding the global autoflush setting. 
   90     name = stream + 
'D3PDMaker' 
   93     if file.startswith (
'pool:'):
 
   98         TuplePath = f
'{file}/{tuplename}' 
  102         acc.addService (CompFactory.THistSvc (Output = [
 
  103             f
"{stream} DATAFILE='{file}' OPT='RECREATE' CL={clevel}"]))
 
  107         st = CompFactory.AANTupleStream (stream,
 
  108                                          ExtraRefNames = [
'StreamESD',
 
  112                                          ExistDataHeader = ExistDataHeader,
 
  113                                          WriteInputDataHeader = 
True,
 
  115         acc.addEventAlgo (st)
 
  117         TuplePath = f
'/{stream}/{tuplename}' 
  121     acc.addPublicTool (registry)
 
  125     alg = MakerAlg (name, flags, acc,
 
  127                     TuplePath = TuplePath,