Belle II Software  release-05-02-19
ECLCRFinderModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Belle II Connected Region Finder (CRF). Starting with 'seed' cells *
6  * above an energy energyCut0. Add neighbouring crystals above energyCut2.*
7  * If neighbouring crystal is above energyCut1, repeat this. Timing cuts *
8  * can be set for each digit type and the energy cuts can be made *
9  * background dependent using the event-by-event background measurements. *
10  * Digits with failed time fits automatically pass timing cuts by default.*
11  * The CRF must run once before the splitters and splitters must only use *
12  * digits contained in a CR. Digits from different CRs must not be mixed. *
13  * *
14  * Author: The Belle II Collaboration *
15  * Contributors: Torben Ferber (ferber@physics.ubc.ca) *
16  * *
17  * This software is provided "as is" without any warranty. *
18  **************************************************************************/
19 
20 #pragma once
21 
22 // FRAMEWORK
23 #include <framework/core/Module.h>
24 #include <framework/datastore/StoreArray.h>
25 #include <framework/datastore/StoreObjPtr.h>
26 
27 namespace Belle2 {
32  class ECLConnectedRegion;
33  class ECLCalDigit;
34  class EventLevelClusteringInfo;
35 
36  namespace ECL {
37  class ECLNeighbours;
38  }
39 
44  class ECLCRFinderModule : public Module {
45 
46  public:
49 
51  virtual ~ECLCRFinderModule();
52 
54  virtual void initialize() override;
55 
57  virtual void beginRun() override;
58 
60  virtual void event() override;
61 
63  virtual void endRun() override;
64 
66  virtual void terminate() override;
67 
70 
73 
76 
78  virtual const char* eclCalDigitArrayName() const
79  { return "ECLCalDigits" ; }
80 
82  virtual const char* eclConnectedRegionArrayName() const
83  { return "ECLConnectedRegions" ; }
84 
86  virtual const char* eventLevelClusteringInfoName() const
87  { return "EventLevelClusteringInfo" ; }
88 
89  private:
90 
91  // Module parameters
92  double m_energyCut[3];
93  double m_energyCutBkgd[3];
94  double m_timeCut[3];
95  std::string m_mapType[2];
96  double m_mapPar[2];
102  double m_energyCutMod[3] {};
103  int m_tempCRId = -1;
106  std::vector <int> m_cellIdToSeedVec;
107  std::vector <int> m_cellIdToGrowthVec;
108  std::vector <int> m_cellIdToDigitVec;
111  std::vector< int > m_calDigitStoreArrPosition;
112 
113  // USE POSITION IN STORE ARRAY!!!
114 
116  std::vector < int > m_cellIdToTempCRIdVec;
117  std::map < int, int > m_cellIdToTempCRIdMap;
120  std::vector<ECL::ECLNeighbours*> m_neighbourMaps;
121 
123  void checkNeighbours(const int cellid, const int tempcrid, const int type);
124 
126  void updateCRs(int cellid, int tempcr);
127 
128  };
129 
132  public:
134  virtual const char* eclCalDigitArrayName() const override
135  { return "ECLCalDigitsPureCsI" ; }
136 
138  virtual const char* eclConnectedRegionArrayName() const override
139  { return "ECLConnectedRegionsPureCsI" ; }
140 
142  virtual const char* eventLevelClusteringInfoName() const override
143  { return "EventLevelClusteringInfoPureCsI" ; }
144 
145  }; // end of ECLCovarianceMatrixPureCsIModule
146 
148 } // end of Belle2 namespace
Belle2::ECLCRFinderModule::event
virtual void event() override
Event.
Definition: ECLCRFinderModule.cc:142
Belle2::ECLCRFinderModule::beginRun
virtual void beginRun() override
Begin.
Definition: ECLCRFinderModule.cc:137
Belle2::ECLCRFinderModule::m_eclConnectedRegions
StoreArray< ECLConnectedRegion > m_eclConnectedRegions
Store array: ECLConnectedRegion.
Definition: ECLCRFinderModule.h:89
Belle2::ECLCRFinderModule::m_energyCut
double m_energyCut[3]
Energy cut for seed, neighbours, ...
Definition: ECLCRFinderModule.h:109
Belle2::ECLCRFinderModule::~ECLCRFinderModule
virtual ~ECLCRFinderModule()
Destructor.
Definition: ECLCRFinderModule.cc:78
Belle2::ECLCRFinderModule::m_cellIdToTempCRIdVec
std::vector< int > m_cellIdToTempCRIdVec
Connected Region map.
Definition: ECLCRFinderModule.h:133
Belle2::ECLCRFinderModule::m_energyCutBkgd
double m_energyCutBkgd[3]
Energy cut (for high background) for seed, neighbours, ...
Definition: ECLCRFinderModule.h:110
Belle2::ECLCRFinderModule::m_tempCRId
int m_tempCRId
Temporary CR ID.
Definition: ECLCRFinderModule.h:120
Belle2::ECLCRFinderModule::m_timeCut
double m_timeCut[3]
Time cut for seed, neighbours, ...
Definition: ECLCRFinderModule.h:111
Belle2::ECLCRFinderModule::updateCRs
void updateCRs(int cellid, int tempcr)
Update CRs.
Definition: ECLCRFinderModule.cc:343
Belle2::ECLCRFinderModule::ECLCRFinderModule
ECLCRFinderModule()
Constructor.
Definition: ECLCRFinderModule.cc:47
Belle2::ECLCRFinderModule::m_mapType
std::string m_mapType[2]
Neighbour map types.
Definition: ECLCRFinderModule.h:112
Belle2::ECLCRFinderModule::m_cellIdToTempCRIdMap
std::map< int, int > m_cellIdToTempCRIdMap
cellid -> temporary CR.
Definition: ECLCRFinderModule.h:134
Belle2::ECLCRFinderPureCsIModule::eventLevelClusteringInfoName
virtual const char * eventLevelClusteringInfoName() const override
Name to be used for PureCsI option: EventLevelClusteringInfoPureCsI.
Definition: ECLCRFinderModule.h:159
Belle2::ECLCRFinderModule::eventLevelClusteringInfoName
virtual const char * eventLevelClusteringInfoName() const
Name to be used for default option: EventLevelClusteringInfo.
Definition: ECLCRFinderModule.h:103
Belle2::ECLCRFinderModule::terminate
virtual void terminate() override
Terminate (close ROOT files here if you have opened any).
Definition: ECLCRFinderModule.cc:303
Belle2::ECLCRFinderModule::m_eclCalDigits
StoreArray< ECLCalDigit > m_eclCalDigits
Store array: ECLCalDigit.
Definition: ECLCRFinderModule.h:86
Belle2::ECLCRFinderPureCsIModule::eclConnectedRegionArrayName
virtual const char * eclConnectedRegionArrayName() const override
Name to be used for PureCsI option: ECLConnectedRegionsPureCsI.
Definition: ECLCRFinderModule.h:155
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::ECLCRFinderModule::initialize
virtual void initialize() override
Initialize.
Definition: ECLCRFinderModule.cc:83
Belle2::ECLCRFinderModule::m_cellIdToDigitVec
std::vector< int > m_cellIdToDigitVec
cellid -> above threshold digits.
Definition: ECLCRFinderModule.h:125
Belle2::ECLCRFinderPureCsIModule
Class to find connected regions, pureCsI version.
Definition: ECLCRFinderModule.h:148
Belle2::ECLCRFinderModule::m_useBackgroundLevel
int m_useBackgroundLevel
Background dependend energy and timing cuts.
Definition: ECLCRFinderModule.h:114
Belle2::ECLCRFinderModule::m_eventLevelClusteringInfo
StoreObjPtr< EventLevelClusteringInfo > m_eventLevelClusteringInfo
Store object pointer: EventLevelClusteringInfo.
Definition: ECLCRFinderModule.h:92
Belle2::ECLCRFinderModule::endRun
virtual void endRun() override
End run.
Definition: ECLCRFinderModule.cc:297
Belle2::ECLCRFinderModule::checkNeighbours
void checkNeighbours(const int cellid, const int tempcrid, const int type)
Neighbour finder.
Definition: ECLCRFinderModule.cc:313
Belle2::ECLCRFinderModule::m_cellIdToGrowthVec
std::vector< int > m_cellIdToGrowthVec
cellid -> growth digits.
Definition: ECLCRFinderModule.h:124
Belle2::ECLCRFinderModule::m_energyCutMod
double m_energyCutMod[3]
Other variables.
Definition: ECLCRFinderModule.h:119
Belle2::ECLCRFinderPureCsIModule::eclCalDigitArrayName
virtual const char * eclCalDigitArrayName() const override
Name to be used for PureCsI option: ECLCalDigitsPureCsI.
Definition: ECLCRFinderModule.h:151
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLCRFinderModule::m_neighbourMaps
std::vector< ECL::ECLNeighbours * > m_neighbourMaps
Neighbour maps.
Definition: ECLCRFinderModule.h:137
Belle2::ECLCRFinderModule::m_mapPar
double m_mapPar[2]
Parameters for neighbour maps.
Definition: ECLCRFinderModule.h:113
Belle2::ECLCRFinderModule::eclConnectedRegionArrayName
virtual const char * eclConnectedRegionArrayName() const
Name to be used for default option: ECLConnectedRegions.
Definition: ECLCRFinderModule.h:99
Belle2::ECLCRFinderModule::eclCalDigitArrayName
virtual const char * eclCalDigitArrayName() const
Name to be used for default or PureCsI option: ECLCalDigits.
Definition: ECLCRFinderModule.h:95
Belle2::ECLCRFinderModule
Class to find connected regions.
Definition: ECLCRFinderModule.h:61
Belle2::ECLCRFinderModule::m_fullBkgdCount
int m_fullBkgdCount
Number of expected background digits at full background.
Definition: ECLCRFinderModule.h:116
Belle2::ECLCRFinderModule::m_cellIdToSeedVec
std::vector< int > m_cellIdToSeedVec
Digit vectors.
Definition: ECLCRFinderModule.h:123
Belle2::ECLCRFinderModule::m_calDigitStoreArrPosition
std::vector< int > m_calDigitStoreArrPosition
vector (8736+1 entries) with cell id to store array positions
Definition: ECLCRFinderModule.h:128
Belle2::ECLCRFinderModule::m_skipFailedTimeFitDigits
int m_skipFailedTimeFitDigits
Handling of digits with failed time fits.
Definition: ECLCRFinderModule.h:115