Belle II Software development
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
36namespace Belle2 {
42 class TRGCDCJSignal;
43 class TRGCDCJLUT;
44 class TRGCDCJSignalData;
45
46 namespace TRGCDCT3DCONVERTERSPACE {
47
50
51 public:
52
55
58
60 virtual void initialize() override;
61
63 virtual void event() override;
64
66 virtual void terminate() override;
67
69 virtual void beginRun() override;
70
72 virtual void endRun() override;
73
75 std::string version() const;
76
78 void storeTSFirmwareData(boost::multi_array<double, 4>& tsfInfo);
79
81 void filterTSData(boost::multi_array<double, 4>& tsfFirmwareInfo,
82 boost::multi_array<double, 3>& tsfInfo);
83
85 void addTSDatastore(boost::multi_array<double, 3>& tsfInfo, int isSt = 1);
86
88 void store2DFirmwareData(boost::multi_array<double, 3>& t2DFirmwareInfo,
89 boost::multi_array<double, 4>& axTsfFirmwareInfo);
90
92 //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);
93
95 void filter2DData(boost::multi_array<double, 3>& t2DFirmwareInfo,
96 boost::multi_array<double, 4>& t2DTsfFirmwareInfo, boost::multi_array<double, 2>& t2DInfo,
97 boost::multi_array<double, 3>& t2DTsfInfo);
98
100 void add2DDatastore(boost::multi_array<double, 2>& t2DInfo, boost::multi_array<double, 3>& t2DTsfInfo);
101
103 void store3DFirmwareData(boost::multi_array<double, 3>& t3DFirmwareInfo);
104
106 void store3DFastSimData(boost::multi_array<double, 3>& t3DFirmwareInfo);
107
109 void store3DFirmSimData(boost::multi_array<double, 3>& t3DFirmwareInfo);
110
112 void filter3DData(boost::multi_array<double, 3>& t3DFirmwareInfo, boost::multi_array<double, 2>& t3DInfo);
113
115 void add3DDatastore(boost::multi_array<double, 2>& t3DInfo, bool doConvert = 1);
116
118 void debug3DFirmware();
119
121 int toTSID(int iSL, int iWire);
122
124 int toSigned(int value, int nBits);
125
127// int t2DRhoTot3DRho(int value, bool isSigned = 1);
128
130 int t2DPhiTot3DPhi(int phi, int rho);
131
132 protected:
150 std::string m_EventTimeName;
154 unsigned m_isVerbose;
155
156
157
158 private:
169
173 std::map<std::string, TRGCDCJSignal> m_mSignalStorage;
175 std::map<std::string, TRGCDCJLUT*> m_mLutStorage;
176
177 };
178 }
180} // end namespace Belle2
181#endif // TRGCDCT3DUNPACKER_H
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
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.