Belle II Software  release-08-01-10
SensitiveDetectorBase.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <simulation/kernel/SensitiveDetectorBase.h>
10 #include <framework/logging/Logger.h>
11 
12 using namespace std;
13 namespace Belle2 {
18  namespace Simulation {
19  bool SensitiveDetectorBase::s_active(false);
20  map<string, RelationArray::EConsolidationAction> SensitiveDetectorBase::s_mcRelations;
21 
22  void SensitiveDetectorBase::registerMCParticleRelation(const std::string& name, RelationArray::EConsolidationAction ignoreAction)
23  {
24  std::pair<std::map<std::string, RelationArray::EConsolidationAction>::iterator, bool> insert = s_mcRelations.insert(std::make_pair(
25  name, ignoreAction));
26  //If the relation already exists and the ignoreAction is different we do have a problem
27  if (!insert.second && insert.first->second != ignoreAction) {
28  B2FATAL("MCParticle Relation " << name << " already registered with different ignore action.");
29  }
30  }
31  }
33 }
EConsolidationAction
Modification actions for the consolidate member.
Definition: RelationArray.h:77
Abstract base class for different kinds of events.