Skip to content
Snippets Groups Projects
Commit d94e6d56 authored by Baptiste Ravina's avatar Baptiste Ravina Committed by Walter Lampl
Browse files

CPAlgorithms: distinguish between MC and data when writing output branches

CPAlgorithms: distinguish between MC and data when writing output branches
parent 23fb305f
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ class OutputAnalysisConfig (ConfigBlock):
super (OutputAnalysisConfig, self).__init__ (configName)
self.addOption ('postfix', '', type=str)
self.addOption ('vars', [], type=None)
self.addOption ('varsOnlyForMC', [], type=None)
self.addOption ('metVars', [], type=None)
self.addOption ('containers', {}, type=None)
self.addOption ('treeName', 'analysis', type=str)
......@@ -24,6 +25,12 @@ class OutputAnalysisConfig (ConfigBlock):
def makeAlgs (self, config) :
self.vars = set(self.vars)
self.varsOnlyForMC = set(self.varsOnlyForMC)
# merge the MC-specific branches into the main list only if we are not running on data
if config.dataType() is not DataType.Data:
self.vars |= self.varsOnlyForMC
if self.storeSelectionFlags:
self.createSelectionFlagBranches(config)
......@@ -95,7 +102,7 @@ class OutputAnalysisConfig (ConfigBlock):
if len (self.vars) + len (autoVars) :
ntupleMaker = config.createAlgorithm( 'CP::AsgxAODNTupleMakerAlg', 'NTupleMaker' + postfix )
ntupleMaker.TreeName = self.treeName
ntupleMaker.Branches = self.vars + autoVars
ntupleMaker.Branches = list( self.vars | set(autoVars) )
# ntupleMaker.OutputLevel = 2 # For output validation
if len (self.metVars) + len (autoMetVars) > 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment