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 {
41
42 class TRGCDCJSignal;
43 class TRGCDCJLUT;
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 void storeTSFirmwareData(boost::multi_array<double, 4>& tsfInfo);
76
78 void filterTSData(boost::multi_array<double, 4>& tsfFirmwareInfo,
79 boost::multi_array<double, 3>& tsfInfo);
80
82 void addTSDatastore(boost::multi_array<double, 3>& tsfInfo, int isSt = 1);
83
85 void store2DFirmwareData(boost::multi_array<double, 3>& t2DFirmwareInfo,
86 boost::multi_array<double, 4>& axTsfFirmwareInfo);
87
89 //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);
90
92 void filter2DData(boost::multi_array<double, 3>& t2DFirmwareInfo,
93 boost::multi_array<double, 4>& t2DTsfFirmwareInfo, boost::multi_array<double, 2>& t2DInfo,
94 boost::multi_array<double, 3>& t2DTsfInfo);
95
97 void add2DDatastore(boost::multi_array<double, 2>& t2DInfo, boost::multi_array<double, 3>& t2DTsfInfo);
98
100 void store3DFirmwareData(boost::multi_array<double, 3>& t3DFirmwareInfo);
101
103 void store3DFastSimData(boost::multi_array<double, 3>& t3DFirmwareInfo);
104
106 void store3DFirmSimData(boost::multi_array<double, 3>& t3DFirmwareInfo);
107
109 void filter3DData(boost::multi_array<double, 3>& t3DFirmwareInfo, boost::multi_array<double, 2>& t3DInfo);
110
112 void add3DDatastore(boost::multi_array<double, 2>& t3DInfo, bool doConvert = 1);
113
115 void debug3DFirmware();
116
118 int toTSID(int iSL, int iWire);
119
121 int toSigned(int value, int nBits);
122
124// int t2DRhoTot3DRho(int value, bool isSigned = 1);
125
127 int t2DPhiTot3DPhi(int phi, int rho);
128
129 protected:
147 std::string m_EventTimeName;
151 unsigned m_isVerbose;
152
153
154
155 private:
166
170 std::map<std::string, TRGCDCJSignal> m_mSignalStorage;
172 std::map<std::string, TRGCDCJLUT*> m_mLutStorage;
173
174 };
175 }
177} // end namespace Belle2
178#endif // TRGCDCT3DUNPACKER_H
Module()
Constructor.
Definition Module.cc:30
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 use LUTs for TRGCDC.
Definition JLUT.h:35
A class to hold common data for JSignals.
Definition JSignalData.h:33
A class to use Signals for TRGCDC 3D tracker.
Definition JSignal.h:35
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
Initializes 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
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.
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
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*‍/ void filter2DData(boost::multi_array<double,...
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, obsolete
StoreArray< TRGCDCT3DUnpackerStore > m_firmwareResults
list of firmware results
Abstract base class for different kinds of events.