Skip to content
Snippets Groups Projects
Commit 02c235d6 authored by Baptiste Ravina's avatar Baptiste Ravina Committed by Adam Edward Barton
Browse files

CPAlgorithms: smarter systematic printouts

CPAlgorithms: smarter systematic printouts
parent 95bc8839
No related branches found
No related tags found
No related merge requests found
...@@ -182,7 +182,7 @@ class GeneratorAnalysisBlock (ConfigBlock): ...@@ -182,7 +182,7 @@ class GeneratorAnalysisBlock (ConfigBlock):
super (GeneratorAnalysisBlock, self).__init__ ('Generator') super (GeneratorAnalysisBlock, self).__init__ ('Generator')
self.addOption ('saveCutBookkeepers', True, type=bool) self.addOption ('saveCutBookkeepers', True, type=bool)
self.addOption ('runNumber', None, type=int) self.addOption ('runNumber', None, type=int)
self.addOption ('cutBookkeepersSystematics', True, type=bool) self.addOption ('cutBookkeepersSystematics', None, type=bool)
def makeAlgs (self, config) : def makeAlgs (self, config) :
...@@ -200,7 +200,10 @@ class GeneratorAnalysisBlock (ConfigBlock): ...@@ -200,7 +200,10 @@ class GeneratorAnalysisBlock (ConfigBlock):
if self.saveCutBookkeepers: if self.saveCutBookkeepers:
alg = config.createAlgorithm('CP::AsgCutBookkeeperAlg', 'CutBookkeeperAlg') alg = config.createAlgorithm('CP::AsgCutBookkeeperAlg', 'CutBookkeeperAlg')
alg.runNumber = self.runNumber alg.runNumber = self.runNumber
alg.enableSystematics = self.cutBookkeepersSystematics if self.cutBookkeepersSystematics:
alg.enableSystematics = self.cutBookkeepersSystematics
else:
alg.enableSystematics = not config.noSystematics()
config.addPrivateTool( 'truthWeightTool', 'PMGTools::PMGTruthWeightTool' ) config.addPrivateTool( 'truthWeightTool', 'PMGTools::PMGTruthWeightTool' )
# Set up the weights algorithm: # Set up the weights algorithm:
......
...@@ -270,21 +270,26 @@ namespace CP ...@@ -270,21 +270,26 @@ namespace CP
StatusCode SystematicsSvc :: StatusCode SystematicsSvc ::
finalize () finalize ()
{ {
for (const CP::SystematicVariation& mysys : m_affectingSystematics) if (m_systematicsList.empty()) {
{ ANA_MSG_INFO ("no systematics were run.");
// this logic checks whether a systematic is recommended and
// affecting, or only affecting. if it is only the later, it
// reports the systematic in parenthesis to set it apart.
if (m_recommendedSystematics.find (mysys) == m_recommendedSystematics.end())
ANA_MSG_INFO ("found systematic: (" << mysys << ")");
else
ANA_MSG_INFO ("found systematic: " << mysys);
} }
else{
if(m_systematicsRegex!=".*") { for (const CP::SystematicVariation& mysys : m_affectingSystematics)
ANA_MSG_INFO("Systematics regex '" << m_systematicsRegex << "' matched:"); {
for(const CP::SystematicSet& mysys : makeSystematicsVector()) { // this logic checks whether a systematic is recommended and
// affecting, or only affecting. if it is only the later, it
// reports the systematic in parenthesis to set it apart.
if (m_recommendedSystematics.find (mysys) == m_recommendedSystematics.end())
ANA_MSG_INFO ("found systematic: (" << mysys << ")");
else
ANA_MSG_INFO ("found systematic: " << mysys);
}
if(m_systematicsRegex!=".*") {
ANA_MSG_INFO("Systematics regex '" << m_systematicsRegex << "' matched:");
for(const CP::SystematicSet& mysys : makeSystematicsVector()) {
ANA_MSG_INFO (" '" << mysys.name() << "'"); ANA_MSG_INFO (" '" << mysys.name() << "'");
}
} }
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
......
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