Belle II Software development
AsicBackgroundLibraryCreator.h
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#pragma once
9#include <vector>
10#include <string>
11#include <map>
12#include <tracking/trackFindingCDC/findlets/base/Findlet.h>
13#include <framework/database/DBArray.h>
14#include <cdc/dbobjects/CDCChannelMap.h>
15#include <tracking/trackFindingCDC/mva/Recorder.h>
16#include <cdc/dbobjects/CDCCrossTalkClasses.h>
17
18namespace Belle2 {
24 namespace TrackFindingCDC {
25 class CDCWireHit;
26 class CDCTrack;
27
29 class AsicBackgroundLibraryCreator : public Findlet<const CDCWireHit, const CDCTrack> {
30 private:
33
34 public:
37
39 void initialize() final;
40
42 void beginRun() final;
43
45 std::string getDescription() final;
46
48 void exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix) final;
49
51 void apply(const std::vector<CDCWireHit>& wireHits, const std::vector<CDCTrack>& tracks) final;
52
54 void terminate() final;
55 private:
56
58 void selectAsic(const std::vector<const CDCWireHit*>& wireHits, const std::vector<CDCTrack>& tracks);
63
65 std::map<int, std::pair<int, int> > m_map;
66
68 std::string m_library_name{"CDCAsicLibrary.root"};
69
72
75
78
81
83 bool m_write_extra_vars{false};
84
85
88
90 std::unique_ptr<Recorder> m_recorder;
91
92 // Variables to be stored:
93
96
98 UChar_t m_board{0};
99
101 UChar_t m_channel{0};
102
104 UChar_t m_n_hit{0};
105
106 // Store also distance to the signal as well as minimal distance to bg
107
110
112 float m_dist_bg{0};
113
115 Short_t m_adc_sig{0};
116
118 Short_t m_adc_max_bg{0};
119
121 UShort_t m_n_hit_track{0};
122
123 };
124 }
126}
Database object of CDC channel map.
Definition: CDCChannelMap.h:22
Class for accessing arrays of objects in the database.
Definition: DBArray.h:26
The Module parameter list class.
Finds ASICs with single signal hit, records info to the library.
double m_distance_signal_max
maximal distance from track to signal hit
std::unique_ptr< DBArray< CDCChannelMap > > m_channelMapFromDB
Channel map retrieved from DB.
AsicBackgroundLibraryCreator()=default
Default constructor.
void initialize() final
Access database here, open library for writing:
size_t m_minimal_hits_on_track
min. number of hits on the track
std::map< int, std::pair< int, int > > m_map
map from ewire to board/channel ID
std::string getDescription() final
Short description of the findlet.
void selectAsic(const std::vector< const CDCWireHit * > &wireHits, const std::vector< CDCTrack > &tracks)
Algorithm to select suitable ASIC for library creation.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose the parameters to a module.
UChar_t m_n_hit
For debuging, store also number of channels with hits.
std::unique_ptr< Recorder > m_recorder
Recorder for the root output.
double m_distance_background_min
minimal distance from track to background hit
size_t m_minimal_hit_number
min. number of hits in ASIC for background check
void apply(const std::vector< CDCWireHit > &wireHits, const std::vector< CDCTrack > &tracks) final
Main algorithm marking hit as background.
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition: Findlet.h:26
Abstract base class for different kinds of events.
STL namespace.
record to be used to store ASIC info