Belle II Software  release-05-02-19
TOPBunchFinderModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Marko Staric *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 #include <map>
15 #include <framework/datastore/StoreArray.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 #include <top/dataobjects/TOPDigit.h>
18 #include <top/dataobjects/TOPRawDigit.h>
19 #include <mdst/dataobjects/Track.h>
20 #include <top/dataobjects/TOPRecBunch.h>
21 #include <top/dataobjects/TOPTimeZero.h>
22 #include <framework/dataobjects/MCInitialParticles.h>
23 #include <framework/dataobjects/EventT0.h>
24 #include <framework/database/DBObjPtr.h>
25 #include <top/dbobjects/TOPCalCommonT0.h>
26 
27 namespace Belle2 {
37  class TOPBunchFinderModule : public Module {
38 
39  public:
40 
45 
50  virtual void initialize() override;
51 
55  virtual void beginRun() override;
56 
60  virtual void event() override;
61 
66  virtual void terminate() override;
67 
68  private:
69 
77 
78  // steering parameters
79  int m_numBins;
80  double m_timeRange;
81  double m_sigmaSmear;
82  double m_minSignal;
83  double m_minSBRatio;
84  double m_minDERatio;
85  double m_maxDERatio;
86  double m_minPt;
87  double m_maxPt;
88  double m_maxD0;
89  double m_maxZ0;
91  bool m_useMCTruth;
93  double m_tau;
94  bool m_fineSearch;
100  // internal variables shared between events
101  double m_bunchTimeSep = 0;
102  std::map<int, double> m_priors;
103  double m_runningOffset = 0;
104  double m_runningError = 0;
105  bool m_HLTmode = false;
106  unsigned m_processed = 0;
107  unsigned m_success = 0;
108  int m_nodEdxCount = 0;
110  // collections
119  // database
122  };
123 
125 } // Belle2 namespace
126 
Belle2::TOPBunchFinderModule::m_commonT0
DBObjPtr< TOPCalCommonT0 > m_commonT0
common T0 calibration constants
Definition: TOPBunchFinderModule.h:128
Belle2::TOPBunchFinderModule::m_bunchesPerSSTclk
int m_bunchesPerSSTclk
number of bunches per SST clock
Definition: TOPBunchFinderModule.h:105
Belle2::TOPBunchFinderModule::m_bunchTimeSep
double m_bunchTimeSep
time between two bunches
Definition: TOPBunchFinderModule.h:109
Belle2::TOPBunchFinderModule::m_topDigits
StoreArray< TOPDigit > m_topDigits
collection of TOP digits
Definition: TOPBunchFinderModule.h:119
Belle2::TOPBunchFinderModule::m_minSignal
double m_minSignal
minimal number of signal photons
Definition: TOPBunchFinderModule.h:90
Belle2::TOPBunchFinderModule::m_topRawDigits
StoreArray< TOPRawDigit > m_topRawDigits
collection of TOP raw digits
Definition: TOPBunchFinderModule.h:120
Belle2::TOPBunchFinderModule::m_usePIDLikelihoods
bool m_usePIDLikelihoods
if true, use PIDLikelihoods (only on cdst files)
Definition: TOPBunchFinderModule.h:106
Belle2::TOPBunchFinderModule::m_minPt
double m_minPt
minimal p_T of track
Definition: TOPBunchFinderModule.h:94
Belle2::TOPBunchFinderModule::m_maxPt
double m_maxPt
maximal p_T of track
Definition: TOPBunchFinderModule.h:95
Belle2::TOPBunchFinderModule::m_useMCTruth
bool m_useMCTruth
use MC truth for mass instead of dEdx most probable
Definition: TOPBunchFinderModule.h:99
Belle2::TOPBunchFinderModule::m_initialParticles
StoreObjPtr< MCInitialParticles > m_initialParticles
simulated beam particles
Definition: TOPBunchFinderModule.h:123
Belle2::TOPBunchFinderModule::event
virtual void event() override
Event processor.
Definition: TOPBunchFinderModule.cc:214
Belle2::TOPBunchFinderModule::terminate
virtual void terminate() override
Termination action.
Definition: TOPBunchFinderModule.cc:509
Belle2::TOPBunchFinderModule::m_subtractRunningOffset
bool m_subtractRunningOffset
subtract running offset when running in HLT mode
Definition: TOPBunchFinderModule.h:104
Belle2::TOPBunchFinderModule::m_timeZeros
StoreArray< TOPTimeZero > m_timeZeros
collection of T0 of individual tracks
Definition: TOPBunchFinderModule.h:124
Belle2::TOPBunchFinderModule::m_timeRange
double m_timeRange
time range in which to do fine search [ns]
Definition: TOPBunchFinderModule.h:88
Belle2::TOPBunchFinderModule::m_tau
double m_tau
first order filter time constant [events]
Definition: TOPBunchFinderModule.h:101
Belle2::TOPBunchFinderModule::m_numBins
int m_numBins
number of bins to which search region is divided
Definition: TOPBunchFinderModule.h:87
Belle2::TOPBunchFinderModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TOPBunchFinderModule.cc:201
Belle2::TOPBunchFinderModule::m_processed
unsigned m_processed
processed events
Definition: TOPBunchFinderModule.h:114
Belle2::TOPBunchFinderModule::m_eventT0
StoreObjPtr< EventT0 > m_eventT0
event T0
Definition: TOPBunchFinderModule.h:125
Belle2::DBObjPtr
Class for accessing objects in the database.
Definition: DBObjPtr.h:31
Belle2::TOPBunchFinderModule::m_success
unsigned m_success
events with reconstructed bunch
Definition: TOPBunchFinderModule.h:115
Belle2::TOPBunchFinderModule::TOPBunchFinderModule
TOPBunchFinderModule()
Constructor.
Definition: TOPBunchFinderModule.cc:60
Belle2::TOPBunchFinderModule::m_sigmaSmear
double m_sigmaSmear
additional smearing of PDF in [ns]
Definition: TOPBunchFinderModule.h:89
Belle2::TOPBunchFinderModule::m_fineSearch
bool m_fineSearch
use fine search
Definition: TOPBunchFinderModule.h:102
Belle2::TOPBunchFinderModule::m_runningOffset
double m_runningOffset
running average of bunch offset
Definition: TOPBunchFinderModule.h:111
Belle2::TOPBunchFinderModule::m_minNHitsCDC
int m_minNHitsCDC
minimal number of hits in CDC
Definition: TOPBunchFinderModule.h:98
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::TOPBunchFinderModule::m_minSBRatio
double m_minSBRatio
minimal signal-to-background ratio
Definition: TOPBunchFinderModule.h:91
Belle2::TOPBunchFinderModule::m_HLTmode
bool m_HLTmode
use running average to correct digits
Definition: TOPBunchFinderModule.h:113
Belle2::TOPBunchFinderModule::m_saveHistograms
bool m_saveHistograms
flag to save histograms
Definition: TOPBunchFinderModule.h:100
Belle2::TOPBunchFinderModule::m_maxZ0
double m_maxZ0
maximal absolute value of helix perigee z coordnate
Definition: TOPBunchFinderModule.h:97
Belle2::TOPBunchFinderModule::m_maxD0
double m_maxD0
maximal absolute value of helix perigee distance
Definition: TOPBunchFinderModule.h:96
Belle2::TOPBunchFinderModule::getMostProbable
Const::ChargedStable getMostProbable(const Track &track)
Returns most probable charged stable particle according to dEdx and predefined prior probabilities.
Definition: TOPBunchFinderModule.cc:516
Belle2::TOPBunchFinderModule::m_recBunch
StoreObjPtr< TOPRecBunch > m_recBunch
reconstructed bunch
Definition: TOPBunchFinderModule.h:122
Belle2::TOPBunchFinderModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: TOPBunchFinderModule.cc:110
Belle2::TOPBunchFinderModule::m_minDERatio
double m_minDERatio
minimal ratio of detected over expected photons
Definition: TOPBunchFinderModule.h:92
Belle2::TOPBunchFinderModule::m_runningError
double m_runningError
error on running average
Definition: TOPBunchFinderModule.h:112
Belle2::TOPBunchFinderModule::m_maxDERatio
double m_maxDERatio
maximal ratio of detected over expected photons
Definition: TOPBunchFinderModule.h:93
Belle2::Const::ChargedStable
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:465
Belle2::TOPBunchFinderModule::m_correctDigits
bool m_correctDigits
subtract bunch time in TOPDigits
Definition: TOPBunchFinderModule.h:103
Belle2::Track
Class that bundles various TrackFitResults.
Definition: Track.h:35
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TOPBunchFinderModule::m_priors
std::map< int, double > m_priors
map of PDG codes to prior probabilities
Definition: TOPBunchFinderModule.h:110
Belle2::TOPBunchFinderModule::m_nodEdxCount
int m_nodEdxCount
counter of tracks with no dEdx, reset at each event
Definition: TOPBunchFinderModule.h:116
Belle2::TOPBunchFinderModule::m_tracks
StoreArray< Track > m_tracks
collection of tracks
Definition: TOPBunchFinderModule.h:121