Belle II Software  release-08-01-10
TRGCDCT3DConverterModule.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 // $Id$
10 //---------------------------------------------------------------
11 // Filename : TRGCDCT3DConverterModule.h
12 // Section :
13 // Owner :
14 // Email :
15 //---------------------------------------------------------------
16 // Description : TRGCDCT3DConverter Module
17 //---------------------------------------------------------------
18 // $Log$
19 //---------------------------------------------------------------
20 
21 #ifndef TRGCDCT3DCONVERTER_H
22 #define TRGCDCT3DCONVERTER_H
23 
24 #include <string>
25 #include <vector>
26 
27 #include <framework/datastore/StoreArray.h>
28 #include <framework/core/Module.h>
29 #include <framework/datastore/StoreObjPtr.h>
30 #include "trg/cdc/dataobjects/TRGCDCT3DUnpackerStore.h"
31 #include <trg/cdc/dataobjects/CDCTriggerSegmentHit.h>
32 #include <trg/cdc/dataobjects/CDCTriggerTrack.h>
33 #include <framework/dataobjects/BinnedEventT0.h>
34 #include "boost/multi_array.hpp"
35 
36 namespace Belle2 {
42  class TRGCDCJSignal;
43  class TRGCDCJLUT;
44  class TRGCDCJSignalData;
45 
46  namespace TRGCDCT3DCONVERTERSPACE {
47 
53 
54  public:
55 
58 
60  virtual ~TRGCDCT3DConverterModule();
61 
63  virtual void initialize() override;
64 
66  virtual void event() override;
67 
69  virtual void terminate() override;
70 
72  virtual void beginRun() override;
73 
75  virtual void endRun() override;
76 
78  std::string version() const;
79 
81  void storeTSFirmwareData(boost::multi_array<double, 4>& tsfInfo);
82 
84  void filterTSData(boost::multi_array<double, 4>& tsfFirmwareInfo,
85  boost::multi_array<double, 3>& tsfInfo);
86 
88  void addTSDatastore(boost::multi_array<double, 3>& tsfInfo, int isSt = 1);
89 
91  void store2DFirmwareData(boost::multi_array<double, 3>& t2DFirmwareInfo,
92  boost::multi_array<double, 4>& axTsfFirmwareInfo);
93 
95  //void filter2DData(boost::multi_array<double, 3> & t2DFirmwareInfo, boost::multi_array<double, 4> & t2DTsfFirmwareInfo, boost::multi_array<double, 2> & t2DInfo, boost::multi_array<double, 3> & t2DTsfInfo, std::vector<int> & t2DClks, std::vector<int> & t2DId);
96 
98  void filter2DData(boost::multi_array<double, 3>& t2DFirmwareInfo,
99  boost::multi_array<double, 4>& t2DTsfFirmwareInfo, boost::multi_array<double, 2>& t2DInfo,
100  boost::multi_array<double, 3>& t2DTsfInfo);
101 
103  void add2DDatastore(boost::multi_array<double, 2>& t2DInfo, boost::multi_array<double, 3>& t2DTsfInfo);
104 
106  void store3DFirmwareData(boost::multi_array<double, 3>& t3DFirmwareInfo);
107 
109  void store3DFastSimData(boost::multi_array<double, 3>& t3DFirmwareInfo);
110 
112  void store3DFirmSimData(boost::multi_array<double, 3>& t3DFirmwareInfo);
113 
115  void filter3DData(boost::multi_array<double, 3>& t3DFirmwareInfo, boost::multi_array<double, 2>& t3DInfo);
116 
118  void add3DDatastore(boost::multi_array<double, 2>& t3DInfo, bool doConvert = 1);
119 
121  void debug3DFirmware();
122 
124  int toTSID(int iSL, int iWire);
125 
127  int toSigned(int value, int nBits);
128 
130 // int t2DRhoTot3DRho(int value, bool isSigned = 1);
131 
133  int t2DPhiTot3DPhi(int phi, int rho);
134 
135  protected:
139  std::string m_hitCollectionName;
151  unsigned m_fit3DWithTSIM;
153  std::string m_EventTimeName;
157  unsigned m_isVerbose;
158 
159 
160 
161  private:
172 
176  std::map<std::string, TRGCDCJSignal> m_mSignalStorage;
178  std::map<std::string, TRGCDCJLUT*> m_mLutStorage;
179 
180  };
181  }
183 } // end namespace Belle2
184 #endif // TRGCDCT3DUNPACKER_H
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
A class to hold common data for JSignals.
Definition: JSignalData.h:33
std::string m_EventTimeName
name of the event time StoreObjPtr
StoreArray< CDCTriggerTrack > m_tracks2D
list of 2D input tracks
void addTSDatastore(boost::multi_array< double, 3 > &tsfInfo, int isSt=1)
adds tsfInfo to TS data store
bool m_add2DFinderToDatastore
Flag for adding 2D finder to datastore.
void store3DFirmSimData(boost::multi_array< double, 3 > &t3DFirmwareInfo)
uses firm sim with debug
Belle2::TRGCDCJSignalData * m_commonData
TRGCDCJSignalData for VHDL generation (jbkim's class)
int toSigned(int value, int nBits)
converts to signed value
void store3DFastSimData(boost::multi_array< double, 3 > &t3DFirmwareInfo)
uses fast sim with debug
virtual void initialize() override
Initilizes TRGCDCT3DConverterModule.
std::string m_outputCollectionName
Name of the StoreArray containing the resulting 3D tracks.
StoreArray< CDCTriggerSegmentHit > m_hits
list of track segment hits
void filterTSData(boost::multi_array< double, 4 > &tsfFirmwareInfo, boost::multi_array< double, 3 > &tsfInfo)
filters tsfFirmwareInfo to tsfInfo
virtual void endRun() override
Called when run ended.
std::map< std::string, TRGCDCJLUT * > m_mLutStorage
TRGCDCJLUT for VHDL generation (jbkim's class)
virtual void terminate() override
Called when processing ended.
void add3DDatastore(boost::multi_array< double, 2 > &t3DInfo, bool doConvert=1)
adds t3DInfo to track data store
std::map< std::string, TRGCDCJSignal > m_mSignalStorage
TRGCDCJSignal for VHDL generation (jbkim's class)
void store2DFirmwareData(boost::multi_array< double, 3 > &t2DFirmwareInfo, boost::multi_array< double, 4 > &axTsfFirmwareInfo)
converts firmwareResults of 2D to a vector
std::string m_inputCollectionName
Name of the StoreArray containing the input tracks from the 2D fitter.
unsigned m_isVerbose
Switch printing detail information.
void store3DFirmwareData(boost::multi_array< double, 3 > &t3DFirmwareInfo)
converts firmwareResults of 3D to a vector
virtual void beginRun() override
Called when new run started.
void storeTSFirmwareData(boost::multi_array< double, 4 > &tsfInfo)
converts firmwareResults of TS to a vector
bool m_addEventTimeToDatastore
Flag for adding event time to datastore.
StoreArray< CDCTriggerTrack > m_tracks3D
list of 3D output tracks
StoreObjPtr< BinnedEventT0 > m_eventTime
StoreObjPtr containing the event time.
void filter3DData(boost::multi_array< double, 3 > &t3DFirmwareInfo, boost::multi_array< double, 2 > &t3DInfo)
filters t3DFirmwareInfo to t3DInfo
std::string version() const
returns version of TRGCDCT3DConverterModule.
void filter2DData(boost::multi_array< double, 3 > &t2DFirmwareInfo, boost::multi_array< double, 4 > &t2DTsfFirmwareInfo, boost::multi_array< double, 2 > &t2DInfo, boost::multi_array< double, 3 > &t2DTsfInfo)
‍** filters t2DFirmwareInfo to t2DInfo*‍/
int toTSID(int iSL, int iWire)
converts sl, iWire to continuous TS ID [0,2335]
std::string m_hitCollectionName
Name of the StoreArray containing the input track segment hits.
std::string m_firmwareResultCollectionName
Name of the StoreArray containing the input firmware results.
void add2DDatastore(boost::multi_array< double, 2 > &t2DInfo, boost::multi_array< double, 3 > &t2DTsfInfo)
adds t2DInfo to track data store
int t2DPhiTot3DPhi(int phi, int rho)
converts to 2D rho to 3D rho value, obselete
StoreArray< TRGCDCT3DUnpackerStore > m_firmwareResults
list of firmware results
Abstract base class for different kinds of events.