Belle II Software  release-05-02-19
TRGGRLMatchModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Chunhua LI, Yun-Tsung Lai, Junhao Yin *
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 <trg/cdc/dataobjects/CDCTriggerTrack.h>
15 #include <trg/ecl/dataobjects/TRGECLCluster.h>
16 #include <trg/klm/dataobjects/KLMTriggerTrack.h>
17 #include <trg/cdc/dataobjects/CDCTriggerSegmentHit.h>
18 #include <trg/grl/dataobjects/TRGGRLShortTrack.h>
19 #include <trg/grl/dataobjects/TRGGRLInfo.h>
20 #include <string>
21 #include <vector>
22 
23 #include <framework/datastore/StoreArray.h>
24 #include <framework/datastore/StoreObjPtr.h>
25 
26 
27 namespace Belle2 {
40  class TRGGRLMatchModule : public Module {
41 
42  public:
43 
48 
50  virtual ~TRGGRLMatchModule();
51 
53  virtual void initialize() override;
54 
56  virtual void beginRun() override;
57 
59  virtual void event() override;
60 
62  virtual void endRun() override;
63 
65  virtual void terminate() override;
66 
68  void calculationdistance(CDCTriggerTrack* track, TRGECLCluster* cluster, double* ds, int _match3D);
69 
71  void calculationphiangle(CDCTriggerTrack* track, TRGECLCluster* cluster, int& dphi_d, std::vector<bool>& track_phimap,
72  std::vector<bool>& track_phimap_i);
73 
75  void sectormatching_klm(CDCTriggerTrack* track, KLMTriggerTrack* klmtrack, double& dphi);
76 
78  bool photon_cluster(TRGECLCluster* cluster, std::vector<bool> track_phimap, double e_threshold);
79 
81  int N64(int x);
82 
84  int N36(int x);
85 
87  void fill_pattern_base2(std::vector< std::vector<int> >& patt);
88 
90  void make_veto_map(StoreArray<CDCTriggerTrack> track2Dlist, std::vector<bool>& map_veto);
91 
93  void short_tracking(StoreArray<CDCTriggerSegmentHit> tslist, std::vector<bool> map_veto, std::vector<bool> phimap_i,
94  std::vector< std::vector<int> >& pattern_base0, std::vector< std::vector<int> >& pattern_base2,
96  StoreObjPtr<TRGGRLInfo> trgInfo);
97 
99  void extrapolation(int pattern, int& l, int& r, int& ec);
100 
101  private:
104  int m_simulationMode;
107 
111 
114 
116  double m_dr_threshold;
120  int m_dphi_d_threshold;
122  double m_e_threshold;
126  std::vector<bool> track_phimap;
128  std::vector<bool> track_phimap_i;
130  std::string m_2d_tracklist;
132  std::string m_3d_tracklist;
134  std::string m_clusterlist;
136  std::string m_klmtracklist;
138  //double m_dr;
140  //double m_dz;
142  std::string m_2dmatch_tracklist;
144  std::string m_phimatch_tracklist;
146  std::string m_3dmatch_tracklist;
148  std::string m_klmmatch_tracklist;
150  std::string m_grlphotonlist;
152  std::string m_hitCollectionName;
158  std::vector< std::vector<int> > patterns_base0;
160  std::vector< std::vector<int> > patterns_base2;
161  };
163 }
Belle2::TRGGRLMatchModule::m_phimatch_tracklist
std::string m_phimatch_tracklist
the matched 2d track list by phi matching
Definition: TRGGRLMatchModule.h:152
Belle2::TRGGRLMatchModule::fill_pattern_base2
void fill_pattern_base2(std::vector< std::vector< int > > &patt)
Fill the patterns in short tracking logic.
Definition: TRGGRLMatchModule.cc:526
Belle2::TRGGRLMatchModule::photon_cluster
bool photon_cluster(TRGECLCluster *cluster, std::vector< bool > track_phimap, double e_threshold)
determine photon from isolated cluster
Definition: TRGGRLMatchModule.cc:476
Belle2::KLMTriggerTrack
Store KLM TRG track information as a ROOT object.
Definition: KLMTriggerTrack.h:30
Belle2::TRGGRLMatchModule::m_clusterlist
std::string m_clusterlist
the ecl cluster list
Definition: TRGGRLMatchModule.h:142
Belle2::TRGGRLMatchModule::m_klmmatch_tracklist
std::string m_klmmatch_tracklist
the matched 2d track list by KLM matching
Definition: TRGGRLMatchModule.h:156
Belle2::TRGGRLMatchModule::m_dphi_d_threshold
int m_dphi_d_threshold
max value of dphi_d to be identified as match, 1 digit = 10 degrees
Definition: TRGGRLMatchModule.h:128
Belle2::TRGECLCluster
Example Detector.
Definition: TRGECLCluster.h:25
Belle2::TRGGRLMatchModule::calculationphiangle
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
Definition: TRGGRLMatchModule.cc:368
Belle2::TRGGRLMatchModule::m_TRGGRLInfo
StoreObjPtr< TRGGRLInfo > m_TRGGRLInfo
output for TRGGRLInfo
Definition: TRGGRLMatchModule.h:110
Belle2::TRGGRLMatchModule::N64
int N64(int x)
Force an int to be witnin 0 to 63.
Definition: TRGGRLMatchModule.cc:512
Belle2::CDCTriggerTrack
Track created by the CDC trigger.
Definition: CDCTriggerTrack.h:15
Belle2::TRGGRLMatchModule::N36
int N36(int x)
Force an int to be witnin 0 to 35.
Definition: TRGGRLMatchModule.cc:519
Belle2::TRGGRLMatchModule::m_dz_threshold
double m_dz_threshold
max value of dz to be identified as match
Definition: TRGGRLMatchModule.h:126
Belle2::TRGGRLMatchModule::short_tracking
void short_tracking(StoreArray< CDCTriggerSegmentHit > tslist, std::vector< bool > map_veto, std::vector< bool > phimap_i, std::vector< std::vector< int > > &pattern_base0, std::vector< std::vector< int > > &pattern_base2, StoreArray< TRGGRLShortTrack > grlst, StoreObjPtr< TRGGRLInfo > trgInfo)
Short tracking logic.
Definition: TRGGRLMatchModule.cc:734
Belle2::TRGGRLMatchModule::m_grlphotonlist
std::string m_grlphotonlist
Non-matched cluster list at GRL.
Definition: TRGGRLMatchModule.h:158
Belle2::TRGGRLMatchModule::m_hitCollectionName
std::string m_hitCollectionName
Track Segment list.
Definition: TRGGRLMatchModule.h:160
Belle2::TRGGRLMatchModule::m_dr_threshold
double m_dr_threshold
max value of dr to be identified as match
Definition: TRGGRLMatchModule.h:124
Belle2::TRGGRLMatchModule::m_dphi_klm_threshold
double m_dphi_klm_threshold
max value of dphi (CDC track to KLM sector) to be identified as match (in degrees)
Definition: TRGGRLMatchModule.h:132
Belle2::TRGGRLMatchModule::m_fastSimulationMode
int m_fastSimulationMode
Switch for the fast simulation.
Definition: TRGGRLMatchModule.h:118
Belle2::TRGGRLMatchModule::terminate
virtual void terminate() override
Termination action.
Definition: TRGGRLMatchModule.cc:329
Belle2::TRGGRLMatchModule::m_3d_tracklist
std::string m_3d_tracklist
the 3D NN track list
Definition: TRGGRLMatchModule.h:140
Belle2::TRGGRLMatchModule::initialize
virtual void initialize() override
Initialize the parameters.
Definition: TRGGRLMatchModule.cc:83
Belle2::TRGGRLMatchModule::TRGGRLMatchModule
TRGGRLMatchModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition: TRGGRLMatchModule.cc:44
Belle2::TRGGRLMatchModule::m_TrgGrlInformationName
std::string m_TrgGrlInformationName
Name of the StoreArray holding projects information from grl.
Definition: TRGGRLMatchModule.h:164
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::TRGGRLMatchModule::calculationdistance
void calculationdistance(CDCTriggerTrack *track, TRGECLCluster *cluster, double *ds, int _match3D)
calculate dr and dz between track and cluster
Definition: TRGGRLMatchModule.cc:333
Belle2::TRGGRLMatchModule::extrapolation
void extrapolation(int pattern, int &l, int &r, int &ec)
Short track extrapolation (to endcap) function.
Definition: TRGGRLMatchModule.cc:1075
Belle2::TRGGRLMatchModule::m_klmtracklist
std::string m_klmtracklist
the KLM track list
Definition: TRGGRLMatchModule.h:144
Belle2::TRGGRLMatchModule::endRun
virtual void endRun() override
End-of-run action.
Definition: TRGGRLMatchModule.cc:325
Belle2::TRGGRLMatchModule::m_e_threshold
double m_e_threshold
min value of isolated cluster energy
Definition: TRGGRLMatchModule.h:130
Belle2::TRGGRLMatchModule::m_2dmatch_tracklist
std::string m_2dmatch_tracklist
the distance in phi direction between track and cluster
Definition: TRGGRLMatchModule.h:150
Belle2::TRGGRLMatchModule::m_grlstCollectionName
std::string m_grlstCollectionName
GRL short track list.
Definition: TRGGRLMatchModule.h:162
Belle2::TRGGRLMatchModule::patterns_base0
std::vector< std::vector< int > > patterns_base0
Short tracking patterns based on SL0.
Definition: TRGGRLMatchModule.h:166
Belle2::TRGGRLMatchModule::track_phimap
std::vector< bool > track_phimap
36 bits phi map of all 2D tracks
Definition: TRGGRLMatchModule.h:134
Belle2::TRGGRLMatchModule::patterns_base2
std::vector< std::vector< int > > patterns_base2
Short tracking patterns based on SL2.
Definition: TRGGRLMatchModule.h:168
Belle2::TRGGRLMatchModule::track_phimap_i
std::vector< bool > track_phimap_i
36 bits phi map of all 2D tracks
Definition: TRGGRLMatchModule.h:136
Belle2::TRGGRLMatchModule::m_2d_tracklist
std::string m_2d_tracklist
the 2D finder track list
Definition: TRGGRLMatchModule.h:138
Belle2::TRGGRLMatchModule::sectormatching_klm
void sectormatching_klm(CDCTriggerTrack *track, KLMTriggerTrack *klmtrack, double &dphi)
calculate dphi between 2D track and KLM track
Definition: TRGGRLMatchModule.cc:441
Belle2::TRGGRLMatchModule::make_veto_map
void make_veto_map(StoreArray< CDCTriggerTrack > track2Dlist, std::vector< bool > &map_veto)
Make the full track phi veto map for short tracking.
Definition: TRGGRLMatchModule.cc:668
Belle2::TRGGRLMatchModule::m_firmwareSimulationMode
int m_firmwareSimulationMode
Switch for the firmware simulation. 0:do nothing, 1:do everything.
Definition: TRGGRLMatchModule.h:121
Belle2::TRGGRLMatchModule::m_simulationMode
int m_simulationMode
Mode for TRGGRL simulation.
Definition: TRGGRLMatchModule.h:114
Belle2::TRGGRLMatchModule::m_3dmatch_tracklist
std::string m_3dmatch_tracklist
the matched 3d track list
Definition: TRGGRLMatchModule.h:154
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TRGGRLMatchModule::event
virtual void event() override
Event processor.
Definition: TRGGRLMatchModule.cc:170
Belle2::TRGGRLMatchModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: TRGGRLMatchModule.cc:166
Belle2::TRGGRLMatchModule::~TRGGRLMatchModule
virtual ~TRGGRLMatchModule()
Destructor.
Definition: TRGGRLMatchModule.cc:79