Belle II Software development
TRGGRLMatchModule.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
9#pragma once
10
11#include <framework/core/Module.h>
12#include <trg/cdc/dataobjects/CDCTriggerTrack.h>
13#include <trg/ecl/dataobjects/TRGECLCluster.h>
14#include <trg/klm/dataobjects/KLMTrgSummary.h>
15#include <trg/cdc/dataobjects/CDCTriggerSegmentHit.h>
16#include <trg/grl/dataobjects/TRGGRLShortTrack.h>
17#include <trg/grl/dataobjects/TRGGRLInnerTrack.h>
18#include <trg/grl/dataobjects/TRGGRLInfo.h>
19#include <string>
20#include <vector>
21
22#include <framework/datastore/StoreArray.h>
23#include <framework/datastore/StoreObjPtr.h>
24
25
26namespace Belle2 {
36 class TRGGRLMatchModule : public Module {
37
38 public:
39
44
46 virtual ~TRGGRLMatchModule();
47
49 virtual void initialize() override;
50
52 virtual void beginRun() override;
53
55 virtual void event() override;
56
58 virtual void endRun() override;
59
61 virtual void terminate() override;
62
64 void calculationdistance(CDCTriggerTrack* track, TRGECLCluster* cluster, double* ds, int _match3D);
65
67 void calculationphiangle(CDCTriggerTrack* track, TRGECLCluster* cluster, int& dphi_d, std::vector<bool>& track_phimap,
68 std::vector<bool>& track_phimap_i);
69
71 void sectormatching_klm(CDCTriggerTrack* track, StoreObjPtr<KLMTrgSummary> klmtrgsummary, double& dphi, int& klmtrack_ind_phi);
72
74 bool photon_cluster(TRGECLCluster* cluster, std::vector<bool> track_phimap, double e_threshold);
75
77 int N64(int x);
78
80 int N36(int x);
81
83 void fill_pattern_base2(std::vector< std::vector<int> >& patt);
84
86 void make_veto_map(StoreArray<CDCTriggerTrack> track2Dlist, std::vector<bool>& map_veto);
87
89 void make_eecl_map(StoreArray<TRGECLCluster> clusterlist, std::vector<bool>& ecl_phimap, std::vector<bool>& ecl_phimap_fwd,
90 std::vector<bool>& ecl_phimap_bwd, std::vector<bool>& ecl_sectormap_fwd, std::vector<bool>& ecl_sectormap_bwd);
91
94 std::vector<bool>& eklm_sectormap, std::vector<bool>& eklm_sectormap_fwd, std::vector<bool>& eklm_sectormap_bwd);
95
97 void short_tracking(StoreArray<CDCTriggerSegmentHit> tslist, std::vector<bool> map_veto, std::vector<bool> phimap_i,
98 std::vector<bool> ecl_phimap_fwd, std::vector<bool> ecl_phimap_bwd,
99 std::vector<bool> klm_sectormap_fwd, std::vector<bool> klm_sectormap_bwd,
100 std::vector< std::vector<int> >& pattern_base0, std::vector< std::vector<int> >& pattern_base2,
103
104 void inner_tracking(StoreArray<CDCTriggerSegmentHit> tslist, std::vector<bool> phimap_i,
105 std::vector<bool> ecl_phimap, std::vector<bool> klm_sectormap,
108
109 void matching_eecl_eklm(std::vector<bool> eecl_sectormap_fw,
110 std::vector<bool> eecl_setormap_bw,
111 std::vector<bool> eklm_sectormap_fw,
112 std::vector<bool> eklm_sectormap_bw,
114
116 void extrapolation(int pattern, int& l, int& r, int& ec);
117
118 private:
124
128
131
143 std::vector<bool> track_phimap;
145 std::vector<bool> track_phimap_i;
147 std::vector<bool> eecl_phimap;
149 std::vector<bool> eecl_phimap_fwd;
151 std::vector<bool> eecl_phimap_bwd;
153 std::vector<bool> eecl_sectormap_fwd;
155 std::vector<bool> eecl_sectormap_bwd;
157 std::vector<bool> eklm_sectormap;
159 std::vector<bool> eklm_sectormap_fwd;
161 std::vector<bool> eklm_sectormap_bwd;
163 std::string m_2d_tracklist;
165 std::string m_3d_tracklist;
167 std::string m_clusterlist;
171 //double m_dr;
173 //double m_dz;
183 std::string m_grlphotonlist;
193 std::vector< std::vector<int> > patterns_base0;
195 std::vector< std::vector<int> > patterns_base2;
196 };
198}
Track created by the CDC trigger.
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Example Detector.
Definition: TRGECLCluster.h:24
Match between CDC trigger track and ECL trigger cluster.
std::string m_klmtrgsummarylist
the KLM track list
std::vector< bool > eklm_sectormap
8 bits phi map of KLM clusters at endcap
StoreObjPtr< TRGGRLInfo > m_TRGGRLInfo
output for TRGGRLInfo
std::string m_2dmatch_tracklist
the distance in phi direction between track and cluster
int m_fastSimulationMode
Switch for the fast simulation.
int N36(int x)
Force an int to be witnin 0 to 35.
int m_simulationMode
Mode for TRGGRL simulation.
std::string m_grlitCollectionName
GRL inner track list.
int m_firmwareSimulationMode
Switch for the firmware simulation. 0:do nothing, 1:do everything.
double m_dr_threshold
max value of dr to be identified as match
int m_dphi_d_threshold
max value of dphi_d to be identified as match, 1 digit = 10 degrees
std::vector< std::vector< int > > patterns_base2
Short tracking patterns based on SL2.
virtual void initialize() override
Initialize the parameters.
std::string m_phimatch_tracklist
the matched 2d track list by phi matching
std::vector< std::vector< int > > patterns_base0
Short tracking patterns based on SL0.
std::vector< bool > track_phimap_i
36 bits phi map of all 2D tracks
bool photon_cluster(TRGECLCluster *cluster, std::vector< bool > track_phimap, double e_threshold)
determine photon from isolated cluster
std::vector< bool > eecl_phimap
36 bits phi map of ECL clusters at endcap
virtual void event() override
Event processor.
void make_veto_map(StoreArray< CDCTriggerTrack > track2Dlist, std::vector< bool > &map_veto)
Make the full track phi veto map for short tracking.
std::vector< bool > eklm_sectormap_fwd
8 bits sector map of KLM clusters at forward endcap
virtual void endRun() override
End-of-run action.
void calculationdistance(CDCTriggerTrack *track, TRGECLCluster *cluster, double *ds, int _match3D)
calculate dr and dz between track and cluster
void calculationphiangle(CDCTriggerTrack *track, TRGECLCluster *cluster, int &dphi_d, std::vector< bool > &track_phimap, std::vector< bool > &track_phimap_i)
calculate dphi_d between track and cluster
virtual void terminate() override
Termination action.
virtual ~TRGGRLMatchModule()
Destructor.
double m_dz_threshold
max value of dz to be identified as match
void short_tracking(StoreArray< CDCTriggerSegmentHit > tslist, std::vector< bool > map_veto, std::vector< bool > phimap_i, std::vector< bool > ecl_phimap_fwd, std::vector< bool > ecl_phimap_bwd, std::vector< bool > klm_sectormap_fwd, std::vector< bool > klm_sectormap_bwd, std::vector< std::vector< int > > &pattern_base0, std::vector< std::vector< int > > &pattern_base2, StoreArray< TRGGRLShortTrack > grlst, StoreObjPtr< TRGGRLInfo > trgInfo)
Short tracking logic.
std::vector< bool > eecl_sectormap_fwd
8 bits sector map of ECL clusters at forward endcap
std::string m_2d_tracklist
the 2D finder track list
virtual void beginRun() override
Called when entering a new run.
void extrapolation(int pattern, int &l, int &r, int &ec)
Short track extrapolation (to endcap) function.
std::string m_grlstCollectionName
GRL short track list.
std::string m_klmmatch_tracklist
the matched 2d track list by KLM matching
double m_dphi_klm_threshold
max value of dphi (CDC track to KLM sector) to be identified as match (in degrees)
std::string m_TrgGrlInformationName
Name of the StoreArray holding projects information from grl.
int N64(int x)
Force an int to be witnin 0 to 63.
TRGGRLMatchModule()
Constructor: Sets the description, the properties and the parameters of the module.
std::vector< bool > track_phimap
36 bits phi map of all 2D tracks
void make_eecl_map(StoreArray< TRGECLCluster > clusterlist, std::vector< bool > &ecl_phimap, std::vector< bool > &ecl_phimap_fwd, std::vector< bool > &ecl_phimap_bwd, std::vector< bool > &ecl_sectormap_fwd, std::vector< bool > &ecl_sectormap_bwd)
Make the ecl endcap phi map for inner/short track matching.
void sectormatching_klm(CDCTriggerTrack *track, StoreObjPtr< KLMTrgSummary > klmtrgsummary, double &dphi, int &klmtrack_ind_phi)
calculate dphi between 2D track and KLM track
std::string m_grlphotonlist
Non-matched cluster list at GRL.
std::vector< bool > eecl_phimap_bwd
36 bits phi map of ECL clusters at backward endcap
std::vector< bool > eecl_phimap_fwd
36 bits phi map of ECL clusters at forward endcap
void fill_pattern_base2(std::vector< std::vector< int > > &patt)
Fill the patterns in short tracking logic.
std::string m_3d_tracklist
the 3D NN track list
double m_e_threshold
min value of isolated cluster energy
std::vector< bool > eklm_sectormap_bwd
8 bits sector map of KLM clusters at backward endcap
std::string m_clusterlist
the ecl cluster list
std::string m_hitCollectionName
Track Segment list.
std::vector< bool > eecl_sectormap_bwd
8 bits sector map of ECL clusters at backward endcap
void make_eklm_map(StoreObjPtr< KLMTrgSummary > klmtrgsummary, std::vector< bool > &eklm_sectormap, std::vector< bool > &eklm_sectormap_fwd, std::vector< bool > &eklm_sectormap_bwd)
Make the klm endcap phi map for inner/short track matching.
std::string m_3dmatch_tracklist
the matched 3d track list
Abstract base class for different kinds of events.