Belle II Software development
TRGCDCT3DConverterModule Class Reference

A module of TRGCDCT3DConverter. More...

#include <TRGCDCT3DConverterModule.h>

Inheritance diagram for TRGCDCT3DConverterModule:
Module PathElement

Public Types

enum  EModulePropFlags {
  c_Input = 1 ,
  c_Output = 2 ,
  c_ParallelProcessingCertified = 4 ,
  c_HistogramManager = 8 ,
  c_InternalSerializer = 16 ,
  c_TerminateInAllProcesses = 32 ,
  c_DontCollectStatistics = 64
}
 Each module can be tagged with property flags, which indicate certain features of the module. More...
 
typedef ModuleCondition::EAfterConditionPath EAfterConditionPath
 Forward the EAfterConditionPath definition from the ModuleCondition.
 

Public Member Functions

 TRGCDCT3DConverterModule ()
 Constructor.
 
virtual ~TRGCDCT3DConverterModule ()
 Destructor.
 
virtual void initialize () override
 Initilizes TRGCDCT3DConverterModule.
 
virtual void event () override
 Called event by event.
 
virtual void terminate () override
 Called when processing ended.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void endRun () override
 Called when run ended.
 
std::string version () const
 returns version of TRGCDCT3DConverterModule.
 
void storeTSFirmwareData (boost::multi_array< double, 4 > &tsfInfo)
 converts firmwareResults of TS to a vector
 
void filterTSData (boost::multi_array< double, 4 > &tsfFirmwareInfo, boost::multi_array< double, 3 > &tsfInfo)
 filters tsfFirmwareInfo to tsfInfo
 
void addTSDatastore (boost::multi_array< double, 3 > &tsfInfo, int isSt=1)
 adds tsfInfo to TS data store
 
void store2DFirmwareData (boost::multi_array< double, 3 > &t2DFirmwareInfo, boost::multi_array< double, 4 > &axTsfFirmwareInfo)
 converts firmwareResults of 2D to a vector
 
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 add2DDatastore (boost::multi_array< double, 2 > &t2DInfo, boost::multi_array< double, 3 > &t2DTsfInfo)
 adds t2DInfo to track data store
 
void store3DFirmwareData (boost::multi_array< double, 3 > &t3DFirmwareInfo)
 converts firmwareResults of 3D to a vector
 
void store3DFastSimData (boost::multi_array< double, 3 > &t3DFirmwareInfo)
 uses fast sim with debug
 
void store3DFirmSimData (boost::multi_array< double, 3 > &t3DFirmwareInfo)
 uses firm sim with debug
 
void filter3DData (boost::multi_array< double, 3 > &t3DFirmwareInfo, boost::multi_array< double, 2 > &t3DInfo)
 filters t3DFirmwareInfo to t3DInfo
 
void add3DDatastore (boost::multi_array< double, 2 > &t3DInfo, bool doConvert=1)
 adds t3DInfo to track data store
 
void debug3DFirmware ()
 Used for debugging 3D firmware.
 
int toTSID (int iSL, int iWire)
 converts sl, iWire to continuous TS ID [0,2335]
 
int toSigned (int value, int nBits)
 converts to signed value
 
int t2DPhiTot3DPhi (int phi, int rho)
 converts to 2D rho to 3D rho value, obselete
 
virtual std::vector< std::string > getFileNames (bool outputFiles)
 Return a list of output filenames for this modules.
 
const std::string & getName () const
 Returns the name of the module.
 
const std::string & getType () const
 Returns the type of the module (i.e.
 
const std::string & getPackage () const
 Returns the package this module is in.
 
const std::string & getDescription () const
 Returns the description of the module.
 
void setName (const std::string &name)
 Set the name of the module.
 
void setPropertyFlags (unsigned int propertyFlags)
 Sets the flags for the module properties.
 
LogConfiggetLogConfig ()
 Returns the log system configuration.
 
void setLogConfig (const LogConfig &logConfig)
 Set the log system configuration.
 
void setLogLevel (int logLevel)
 Configure the log level.
 
void setDebugLevel (int debugLevel)
 Configure the debug messaging level.
 
void setAbortLevel (int abortLevel)
 Configure the abort log level.
 
void setLogInfo (int logLevel, unsigned int logInfo)
 Configure the printed log information for the given level.
 
void if_value (const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 Add a condition to the module.
 
void if_false (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to add a condition to the module.
 
void if_true (const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
 A simplified version to set the condition of the module.
 
bool hasCondition () const
 Returns true if at least one condition was set for the module.
 
const ModuleConditiongetCondition () const
 Return a pointer to the first condition (or nullptr, if none was set)
 
const std::vector< ModuleCondition > & getAllConditions () const
 Return all set conditions for this module.
 
bool evalCondition () const
 If at least one condition was set, it is evaluated and true returned if at least one condition returns true.
 
std::shared_ptr< PathgetConditionPath () const
 Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).
 
Module::EAfterConditionPath getAfterConditionPath () const
 What to do after the conditional path is finished.
 
std::vector< std::shared_ptr< Path > > getAllConditionPaths () const
 Return all condition paths currently set (no matter if the condition is true or not).
 
bool hasProperties (unsigned int propertyFlags) const
 Returns true if all specified property flags are available in this module.
 
bool hasUnsetForcedParams () const
 Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
 
const ModuleParamListgetParamList () const
 Return module param list.
 
template<typename T >
ModuleParam< T > & getParam (const std::string &name) const
 Returns a reference to a parameter.
 
bool hasReturnValue () const
 Return true if this module has a valid return value set.
 
int getReturnValue () const
 Return the return value set by this module.
 
std::shared_ptr< PathElementclone () const override
 Create an independent copy of this module.
 
std::shared_ptr< boost::python::list > getParamInfoListPython () const
 Returns a python list of all parameters.
 

Static Public Member Functions

static void exposePythonAPI ()
 Exposes methods of the Module class to Python.
 

Protected Member Functions

virtual void def_initialize ()
 Wrappers to make the methods without "def_" prefix callable from Python.
 
virtual void def_beginRun ()
 Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.
 
virtual void def_event ()
 Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.
 
virtual void def_endRun ()
 This method can receive that the current run ends as a call from the Python side.
 
virtual void def_terminate ()
 Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.
 
void setDescription (const std::string &description)
 Sets the description of the module.
 
void setType (const std::string &type)
 Set the module type.
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
 Adds a new parameter to the module.
 
template<typename T >
void addParam (const std::string &name, T &paramVariable, const std::string &description)
 Adds a new enforced parameter to the module.
 
void setReturnValue (int value)
 Sets the return value for this module as integer.
 
void setReturnValue (bool value)
 Sets the return value for this module as bool.
 
void setParamList (const ModuleParamList &params)
 Replace existing parameter list.
 

Protected Attributes

std::string m_firmwareResultCollectionName
 Name of the StoreArray containing the input firmware results.
 
std::string m_hitCollectionName
 Name of the StoreArray containing the input track segment hits.
 
bool m_addTSToDatastore
 Flag for adding TS to datastore.
 
std::string m_inputCollectionName
 Name of the StoreArray containing the input tracks from the 2D fitter.
 
bool m_add2DFinderToDatastore
 Flag for adding 2D finder to datastore.
 
std::string m_outputCollectionName
 Name of the StoreArray containing the resulting 3D tracks.
 
bool m_add3DToDatastore
 Flag for adding 3D to datastore.
 
unsigned m_fit3DWithTSIM
 Mode for fitting with TSIM.
 
std::string m_EventTimeName
 name of the event time StoreObjPtr
 
bool m_addEventTimeToDatastore
 Flag for adding event time to datastore.
 
unsigned m_isVerbose
 Switch printing detail information.
 

Private Member Functions

std::list< ModulePtrgetModules () const override
 no submodules, return empty list
 
std::string getPathString () const override
 return the module name.
 
void setParamPython (const std::string &name, const boost::python::object &pyObj)
 Implements a method for setting boost::python objects.
 
void setParamPythonDict (const boost::python::dict &dictionary)
 Implements a method for reading the parameter values from a boost::python dictionary.
 

Private Attributes

StoreArray< TRGCDCT3DUnpackerStorem_firmwareResults
 list of firmware results
 
StoreArray< CDCTriggerSegmentHitm_hits
 list of track segment hits
 
StoreArray< CDCTriggerTrackm_tracks2D
 list of 2D input tracks
 
StoreArray< CDCTriggerTrackm_tracks3D
 list of 3D output tracks
 
StoreObjPtr< BinnedEventT0m_eventTime
 StoreObjPtr containing the event time.
 
Belle2::TRGCDCJSignalDatam_commonData
 TRGCDCJSignalData for VHDL generation (jbkim's class)
 
std::map< std::string, TRGCDCJSignalm_mSignalStorage
 TRGCDCJSignal for VHDL generation (jbkim's class)
 
std::map< std::string, TRGCDCJLUT * > m_mLutStorage
 TRGCDCJLUT for VHDL generation (jbkim's class)
 
std::string m_name
 The name of the module, saved as a string (user-modifiable)
 
std::string m_type
 The type of the module, saved as a string.
 
std::string m_package
 Package this module is found in (may be empty).
 
std::string m_description
 The description of the module.
 
unsigned int m_propertyFlags
 The properties of the module as bitwise or (with |) of EModulePropFlags.
 
LogConfig m_logConfig
 The log system configuration of the module.
 
ModuleParamList m_moduleParamList
 List storing and managing all parameter of the module.
 
bool m_hasReturnValue
 True, if the return value is set.
 
int m_returnValue
 The return value.
 
std::vector< ModuleConditionm_conditions
 Module condition, only non-null if set.
 

Detailed Description

A module of TRGCDCT3DConverter.

Definition at line 49 of file TRGCDCT3DConverterModule.h.

Member Typedef Documentation

◆ EAfterConditionPath

Forward the EAfterConditionPath definition from the ModuleCondition.

Definition at line 88 of file Module.h.

Member Enumeration Documentation

◆ EModulePropFlags

enum EModulePropFlags
inherited

Each module can be tagged with property flags, which indicate certain features of the module.

Enumerator
c_Input 

This module is an input module (reads data).

c_Output 

This module is an output module (writes data).

c_ParallelProcessingCertified 

This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)

c_HistogramManager 

This module is used to manage histograms accumulated by other modules.

c_InternalSerializer 

This module is an internal serializer/deserializer for parallel processing.

c_TerminateInAllProcesses 

When using parallel processing, call this module's terminate() function in all processes().

This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.

c_DontCollectStatistics 

No statistics is collected for this module.

Definition at line 77 of file Module.h.

77 {
78 c_Input = 1,
79 c_Output = 2,
85 };
@ c_HistogramManager
This module is used to manage histograms accumulated by other modules.
Definition: Module.h:81
@ c_Input
This module is an input module (reads data).
Definition: Module.h:78
@ c_DontCollectStatistics
No statistics is collected for this module.
Definition: Module.h:84
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
@ c_InternalSerializer
This module is an internal serializer/deserializer for parallel processing.
Definition: Module.h:82
@ c_Output
This module is an output module (writes data).
Definition: Module.h:79
@ c_TerminateInAllProcesses
When using parallel processing, call this module's terminate() function in all processes().
Definition: Module.h:83

Constructor & Destructor Documentation

◆ TRGCDCT3DConverterModule()

Constructor.

Definition at line 41 of file TRGCDCT3DConverterModule.cc.

43{
45 string desc = "TRGCDCT3DConverterModule(" + version() + ")";
46 setDescription(desc);
47 addParam("hitCollectionName", m_hitCollectionName,
48 "Name of the input StoreArray of CDCTriggerSegmentHits.",
49 string("CDCTriggerSegmentHits0"));
50 addParam("addTSToDatastore", m_addTSToDatastore,
51 "If true, adds TS to datastore",
52 true);
53 addParam("EventTimeName", m_EventTimeName,
54 "Name of the event time object.",
55 string("BinnedEventT00"));
56 addParam("addEventTimeToDatastore", m_addEventTimeToDatastore,
57 "If true, adds event time to datastore",
58 true);
59 addParam("inputCollectionName", m_inputCollectionName,
60 "Name of the StoreArray holding the input tracks from the 2D finder.",
61 string("TRGCDC2DFinderTracks0"));
62 addParam("add2DFinderToDatastore", m_add2DFinderToDatastore,
63 "If true, adds 2D Finder results to datastore",
64 true);
65 addParam("outputCollectionName", m_outputCollectionName,
66 "Name of the StoreArray holding the 3D output tracks.",
67 string("TRGCDC3DFitterTracks0"));
68 addParam("add3DToDatastore", m_add3DToDatastore,
69 "If true, adds 3D results to datastore",
70 true);
71 addParam("fit3DWithTSIM", m_fit3DWithTSIM,
72 "0: use firmware results. 1: Fits with fast TSIM. 2: Fits with firm TSIM",
73 unsigned(0));
74 addParam("firmwareResultCollectionName", m_firmwareResultCollectionName,
75 "Name of the StoreArray holding the firmware results.",
76 string("TRGCDCT3DUnpackerStores0"));
77 addParam("isVerbose", m_isVerbose,
78 "If not zero, prints detail information.",
79 unsigned(0));
80 B2INFO("TRGCDCT3DConverter: Constructor done.");
81}
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
Module()
Constructor.
Definition: Module.cc:30
std::string m_EventTimeName
name of the event time StoreObjPtr
bool m_add2DFinderToDatastore
Flag for adding 2D finder to datastore.
std::string m_outputCollectionName
Name of the StoreArray containing the resulting 3D tracks.
std::string m_inputCollectionName
Name of the StoreArray containing the input tracks from the 2D fitter.
unsigned m_isVerbose
Switch printing detail information.
bool m_addEventTimeToDatastore
Flag for adding event time to datastore.
std::string version() const
returns version of TRGCDCT3DConverterModule.
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 addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:559

◆ ~TRGCDCT3DConverterModule()

Destructor.

Definition at line 83 of file TRGCDCT3DConverterModule.cc.

84{
85}

Member Function Documentation

◆ add2DDatastore()

void add2DDatastore ( boost::multi_array< double, 2 > &  t2DInfo,
boost::multi_array< double, 3 > &  t2DTsfInfo 
)

adds t2DInfo to track data store

Definition at line 452 of file TRGCDCT3DConverterModule.cc.

454{
455 // Add 2D track
456 for (unsigned iTrack = 0; iTrack < t2DInfo.shape()[0]; ++iTrack) {
457 double charge = 0, phi0_i = 0, omega = 0, chi2D = 0;
458 //double phi0_c = 0;
459 //Convert
460 charge = t2DInfo[iTrack][0] == 2 ? -1 : 1;
461 //phi0_c = t2DPhiTot3DPhi(t2DInfo[iTrack][2], t2DInfo[iTrack][1]) / (pow(2, 12) - 0.5) * M_PI;
462 //phi0_i = phi0_c + charge * M_PI_2;
463 //cout<<phi0_i<<" "<<(45 + 90./80 * (1+ t2DInfo[iTrack][2]))/180*M_PI<<endl;
464 phi0_i = (45 + 90. / 80 * (1 + t2DInfo[iTrack][2])) / 180 * M_PI;
465
466 //Correct phi0_i. The zero points of raw phi0_i for four boards are different.
467 if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore0") {
468 phi0_i = phi0_i + (M_PI / 2.0) * 0;
469 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore1") {
470 phi0_i = phi0_i + (M_PI / 2.0) * 1;
471 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore2") {
472 phi0_i = phi0_i + (M_PI / 2.0) * 2;
473 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore3") {
474 phi0_i = phi0_i + (M_PI / 2.0) * 3;
475 }
476
477 // Confine the range of the angle to -pi ~ pi
478 while (phi0_i > M_PI) {
479 phi0_i -= 2 * M_PI;
480 }
481 while (phi0_i < -M_PI) {
482 phi0_i += 2 * M_PI;
483 }
484
485 //omega = charge / t2DRhoTot3DRho(t2DInfo[iTrack][1])/(pow(2,11)-0.5)*2500;
486 //cout<<omega<<" "<<toSigned(t2DInfo[iTrack][1],7)*1.5e-4*30/0.3/34<<endl;
487 //omega = toSigned(t2DInfo[iTrack][1], 7) * 1.5e-4 * 30 / 0.3 / 34;
488 omega = toSigned(t2DInfo[iTrack][1], 7) / 33.0 * 3.2;
489 //cout<<"iTrack: "<<iTrack<<" charge:"<<t2DInfo[iTrack][0]<<" "<<charge<<" rho: "<<t2DInfo[iTrack][1]<<" "<<omega<<" phi0_i: "<<t2DInfo[iTrack][2]<<" "<<phi0_i<<endl;
490
491 CDCTriggerTrack* track = m_tracks2D.appendNew(phi0_i, omega, chi2D, 0, 0, 0);
492
493 if (m_isVerbose) cout << "[2D] iTrack:" << iTrack << " charge:" << charge << " phi0_i:" << phi0_i << " " << phi0_i * 180 / M_PI <<
494 " omega:" << omega << " pt:" << charge / omega * 0.3 * 1.5 * 0.01 << endl;
495
496 for (unsigned iAx = 0; iAx < t2DTsfInfo.shape()[1]; ++iAx) {
497 double rawId = t2DTsfInfo[iTrack][iAx][0];
498 double id = -1;
499 if (iAx != 4) id = rawId;
500 else {
501 id = rawId - 16;
502 if (id < 0) id += 384;
503 }
504 double rt = t2DTsfInfo[iTrack][iAx][1];
505 double lr = t2DTsfInfo[iTrack][iAx][2];
506 double pr = t2DTsfInfo[iTrack][iAx][3];
507 double ft = t2DTsfInfo[iTrack][iAx][4];
508 if (pr == 0) continue;
509 CDCHit prHit(rt, 0, iAx * 2, pr == 3 ? 2 : 3, id);
510 m_hits.appendNew(prHit, toTSID(int(iAx * 2), id), pr, lr, rt, 0, ft);
511 track->addRelationTo(m_hits[m_hits.getEntries() - 1]);
512 if (m_isVerbose) cout << "[2D] iTrack: " << iTrack << " iAx:" << iAx << " id:" << id << " rt:" << rt << " lr:" << lr << " pr:" << pr
513 << " ft:" << ft << endl;
514 }
515
516
517 }
518}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
Track created by the CDC trigger.
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:246
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
StoreArray< CDCTriggerTrack > m_tracks2D
list of 2D input tracks
int toSigned(int value, int nBits)
converts to signed value
StoreArray< CDCTriggerSegmentHit > m_hits
list of track segment hits
int toTSID(int iSL, int iWire)
converts sl, iWire to continuous TS ID [0,2335]
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

◆ add3DDatastore()

void add3DDatastore ( boost::multi_array< double, 2 > &  t3DInfo,
bool  doConvert = 1 
)

adds t3DInfo to track data store

Definition at line 1578 of file TRGCDCT3DConverterModule.cc.

1579{
1580 for (unsigned iTrack = 0; iTrack < t3DInfo.shape()[0]; ++iTrack) {
1581 double charge = 0, phi0_i = 0, omega = 0, chi2D = 0, z0 = 0, cot = 0, zchi2 = 0;
1582 double phi0_c = 0;
1583 if (doConvert) {
1584 charge = t3DInfo[iTrack][1] == 2 ? -1 : 1;
1585 phi0_c = t2DPhiTot3DPhi(t3DInfo[iTrack][3], t3DInfo[iTrack][2]) / (pow(2, 12) - 0.5) * M_PI;
1586 //phi0_i = phi0_c + charge * M_PI_2;
1587 phi0_i = (45 + 90. / 80 * (1 + t3DInfo[iTrack][3])) / 180 * M_PI;
1588 //omega = charge / t2DRhoTot3DRho(t3DInfo[iTrack][2]) / (pow(2, 11) - 0.5) * 2500;
1589 omega = toSigned(t3DInfo[iTrack][2], 7) / 33.0 * 3.2;
1590 z0 = toSigned(t3DInfo[iTrack][4], 11) * 0.0382;
1591 cot = toSigned(t3DInfo[iTrack][5], 11) * 0.00195;
1592 zchi2 = t3DInfo[iTrack][6];
1593 } else {
1594 charge = t3DInfo[iTrack][1] == 1 ? 1 : -1;
1595 phi0_c = t2DPhiTot3DPhi((t3DInfo[iTrack][3] - 34 / 90.*80 - 1), t3DInfo[iTrack][2]) / (pow(2, 12) - 0.5) * M_PI;
1596 phi0_i = t3DInfo[iTrack][3];
1597 omega = t3DInfo[iTrack][2];
1598 z0 = t3DInfo[iTrack][4];
1599 cot = t3DInfo[iTrack][5];
1600 zchi2 = t3DInfo[iTrack][6];
1601 }
1602
1603 //Correct phi0_i. The zero points of raw phi0_i for four boards are different.
1604 if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore0") {
1605 phi0_c = phi0_c + (M_PI / 2.0) * 0;
1606 phi0_i = phi0_i + (M_PI / 2.0) * 0;
1607 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore1") {
1608 phi0_c = phi0_c + (M_PI / 2.0) * 1;
1609 phi0_i = phi0_i + (M_PI / 2.0) * 1;
1610 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore2") {
1611 phi0_c = phi0_c + (M_PI / 2.0) * 2;
1612 phi0_i = phi0_i + (M_PI / 2.0) * 2;
1613 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore3") {
1614 phi0_c = phi0_c + (M_PI / 2.0) * 3;
1615 phi0_i = phi0_i + (M_PI / 2.0) * 3;
1616 }
1617 // Confine the range of the angle to -pi ~ pi
1618 while (phi0_c > M_PI) {
1619 phi0_c -= 2 * M_PI;
1620 }
1621 while (phi0_i < -M_PI) {
1622 phi0_c += 2 * M_PI;
1623 }
1624 while (phi0_i > M_PI) {
1625 phi0_i -= 2 * M_PI;
1626 }
1627 while (phi0_i < -M_PI) {
1628 phi0_i += 2 * M_PI;
1629 }
1630
1631 //cout<<"iTrack: "<<iTrack<<" eventTime:"<<t3DInfo[iTrack][0]<<" charge:"<<charge<<" omega: "<<omega<<" rho: "<<charge/omega<<" pt: "<<charge/omega*0.3*1.5*0.01<<" phi0_i: "<<phi0_i<<" "<<phi0_i*180/M_PI<<" phi0_c: "<<phi0_c<<" "<<phi0_c*180/M_PI<<" z0:"<<z0<<" cot:"<<cot<<" theta: "<<M_PI/2-atan(cot)<<" zchi:"<<zchi2<<endl;
1632 if (m_isVerbose) cout << "[3D] iTrack:" << iTrack << " charge: " << charge << " phi0_i:" << phi0_i << " " << phi0_i * 180 / M_PI <<
1633 " omega:" << omega << " pt:" << charge / omega * 0.3 * 1.5 * 0.01 << " z0:" << z0 << " cot:" << cot << " zchi2:" << zchi2 << endl;
1634 m_tracks3D.appendNew(phi0_i, omega, chi2D, z0, cot, zchi2);
1635 }
1636}
StoreArray< CDCTriggerTrack > m_tracks3D
list of 3D output tracks
int t2DPhiTot3DPhi(int phi, int rho)
converts to 2D rho to 3D rho value, obselete

◆ addTSDatastore()

void addTSDatastore ( boost::multi_array< double, 3 > &  tsfInfo,
int  isSt = 1 
)

adds tsfInfo to TS data store

Definition at line 520 of file TRGCDCT3DConverterModule.cc.

521{
522 for (unsigned iSL = 0; iSL < tsfInfo.shape()[0]; iSL++) {
523 for (unsigned iTS = 0; iTS < tsfInfo.shape()[1]; iTS++) {
524 double id = tsfInfo[iSL][iTS][0];
525 double rt = tsfInfo[iSL][iTS][1];
526 double lr = tsfInfo[iSL][iTS][2];
527 double pr = tsfInfo[iSL][iTS][3];
528 double ft = tsfInfo[iSL][iTS][4];
529 if (m_isVerbose) cout << "[TSF] iSL:" << iSL << " iTS:" << iTS << " id:" << id << " rt:" << rt << " lr:" << lr << " pr:" << pr <<
530 " ft:" << ft << endl;
531 if (pr != 0) {
532 CDCHit prHit(rt, 0, iSL * 2 + isSt, pr == 3 ? 2 : 3, id);
533 m_hits.appendNew(prHit, toTSID(int(iSL * 2 + isSt), id), pr, lr, rt, 0, ft);
534 }
535 }
536 }
537}

◆ beginRun()

void beginRun ( void  )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 105 of file TRGCDCT3DConverterModule.cc.

106{
107}

◆ clone()

std::shared_ptr< PathElement > clone ( ) const
overridevirtualinherited

Create an independent copy of this module.

Note that parameters are shared, so changing them on a cloned module will also affect the original module.

Implements PathElement.

Definition at line 179 of file Module.cc.

180{
182 newModule->m_moduleParamList.setParameters(getParamList());
183 newModule->setName(getName());
184 newModule->m_package = m_package;
185 newModule->m_propertyFlags = m_propertyFlags;
186 newModule->m_logConfig = m_logConfig;
187 newModule->m_conditions = m_conditions;
188
189 return newModule;
190}
std::shared_ptr< Module > registerModule(const std::string &moduleName, std::string sharedLibPath="") noexcept(false)
Creates an instance of a module and registers it to the ModuleManager.
static ModuleManager & Instance()
Exception is thrown if the requested module could not be created by the ModuleManager.
const ModuleParamList & getParamList() const
Return module param list.
Definition: Module.h:362
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:186
const std::string & getType() const
Returns the type of the module (i.e.
Definition: Module.cc:41
unsigned int m_propertyFlags
The properties of the module as bitwise or (with |) of EModulePropFlags.
Definition: Module.h:511
LogConfig m_logConfig
The log system configuration of the module.
Definition: Module.h:513
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition: Module.h:520
std::string m_package
Package this module is found in (may be empty).
Definition: Module.h:509
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition: Module.h:43

◆ debug3DFirmware()

void debug3DFirmware ( )

Used for debugging 3D firmware.

Definition at line 1177 of file TRGCDCT3DConverterModule.cc.

1178{
1179 bool doPrint = (m_isVerbose > 1);
1180
1181 for (int iClk = 0; iClk < m_firmwareResults.getEntries(); iClk++) {
1183 //bitset<6> t2d_fnf (int(result->m_t3d_2dfnf));
1184 //bitset<4> tsf_fnf (int(result->m_t3d_validTS));
1185
1186 //cout<<"iClk:"<<iClk<<endl;
1187 //cout<<" [2D] fnf:"<<result->m_t2d_fnf<<" "<<bitset<6> (result->m_t2d_fnf)<<endl;
1188 //cout<<" [0] rho: "<<result->m_t2d0_rho_s<<" "<<toSigned(result->m_t2d0_rho_s, 7)<<" "<<int(0.3*34/30/1.5e-4/abs(toSigned(result->m_t2d0_rho_s, 7))*(pow(2,11)-0.5)/2500)<<" phi0: "<<result->m_t2d0_phi<<endl;
1189 //cout<<" [1] rho: "<<result->m_t2d1_rho_s<<" "<<toSigned(result->m_t2d1_rho_s, 7)<<" "<<int(0.3*34/30/1.5e-4/abs(toSigned(result->m_t2d1_rho_s, 7))*(pow(2,11)-0.5)/2500)<<" phi0: "<<result->m_t2d1_phi<<endl;
1190 //cout<<" [2] rho: "<<result->m_t2d2_rho_s<<" "<<toSigned(result->m_t2d2_rho_s, 7)<<" "<<int(0.3*34/30/1.5e-4/abs(toSigned(result->m_t2d2_rho_s, 7))*(pow(2,11)-0.5)/2500)<<" phi0: "<<result->m_t2d2_phi<<endl;
1191 //cout<<" [3] rho: "<<result->m_t2d3_rho_s<<" "<<toSigned(result->m_t2d3_rho_s, 7)<<" "<<int(0.3*34/30/1.5e-4/abs(toSigned(result->m_t2d3_rho_s, 7))*(pow(2,11)-0.5)/2500)<<" phi0: "<<result->m_t2d3_phi<<endl;
1192 //cout<<" [3D] fnf:"<<result->m_t3d_2dfnf<<" "<<t2d_fnf<<" "<<t2d_fnf[5]<<" tsValid: "<<result->m_t3d_validTS<<" "<<tsf_fnf<<endl;;
1193 //cout<<" [0] z0: "<<result->m_t3dtrk0_z0_s<<" cot: "<<result->m_t3dtrk0_cot_s<<" chi2: "<<result->m_t3dtrk0_zchisq<<endl;
1194 //cout<<" [1] z0: "<<result->m_t3dtrk1_z0_s<<" cot: "<<result->m_t3dtrk1_cot_s<<" chi2: "<<result->m_t3dtrk1_zchisq<<endl;
1195 //cout<<" [2] z0: "<<result->m_t3dtrk2_z0_s<<" cot: "<<result->m_t3dtrk2_cot_s<<" chi2: "<<result->m_t3dtrk2_zchisq<<endl;
1196 //cout<<" [3] z0: "<<result->m_t3dtrk3_z0_s<<" cot: "<<result->m_t3dtrk3_cot_s<<" chi2: "<<result->m_t3dtrk3_zchisq<<endl;
1197 //cout<<" [debug] MSB"<<endl;
1198 //cout<<" evtTime: "<<result->m_t3dtrk0_evtTime_delay<<" evtTimeValid: "<<result->m_t3dtrk0_evtTimeValid_delay<<endl;
1199 //cout<<" charge: "<<result->m_t3dtrk0_charge<<" rho: "<<result->m_t3dtrk0_rho<<" phi0: "<<result->m_t3dtrk0_phi0<<endl;;
1200 //cout<<" ts0 id: "<<result->m_t3dtrk0ts0_id<<" lr: "<<result->m_t3dtrk0ts0_lr<<" rt: "<<result->m_t3dtrk0ts0_rt<<endl;
1201 //cout<<" ts1 id: "<<result->m_t3dtrk0ts1_id<<" lr: "<<result->m_t3dtrk0ts1_lr<<" rt: "<<result->m_t3dtrk0ts1_rt<<endl;
1202 //cout<<" ts2 id: "<<result->m_t3dtrk0ts2_id<<" lr: "<<result->m_t3dtrk0ts2_lr<<" rt: "<<result->m_t3dtrk0ts2_rt<<endl;
1203 //cout<<" ts3 id: "<<result->m_t3dtrk0ts3_id<<" lr: "<<result->m_t3dtrk0ts3_lr<<" rt: "<<result->m_t3dtrk0ts3_rt<<endl;
1204 //cout<<" [debug] LSB"<<endl;
1205 //cout<<" evtTime: "<<result->m_t3dtrk1_evtTime_delay<<" evtTimeValid: "<<result->m_t3dtrk1_evtTimeValid_delay<<endl;
1206 //cout<<" charge: "<<result->m_t3dtrk1_charge<<" rho: "<<result->m_t3dtrk1_rho<<" phi0: "<<result->m_t3dtrk1_phi0<<endl;;
1207 //cout<<" ts0 id: "<<result->m_t3dtrk1ts0_id<<" lr: "<<result->m_t3dtrk1ts0_lr<<" rt: "<<result->m_t3dtrk1ts0_rt<<endl;
1208 //cout<<" ts1 id: "<<result->m_t3dtrk1ts1_id<<" lr: "<<result->m_t3dtrk1ts1_lr<<" rt: "<<result->m_t3dtrk1ts1_rt<<endl;
1209 //cout<<" ts2 id: "<<result->m_t3dtrk1ts2_id<<" lr: "<<result->m_t3dtrk1ts2_lr<<" rt: "<<result->m_t3dtrk1ts2_rt<<endl;
1210 //cout<<" ts3 id: "<<result->m_t3dtrk1ts3_id<<" lr: "<<result->m_t3dtrk1ts3_lr<<" rt: "<<result->m_t3dtrk1ts3_rt<<endl;
1211
1213 //if (result->m_t2d_fnf && iClk < 48-4-1 && bitset<6> (result->m_t2d_fnf)[5])
1214 //{
1215 // TRGCDCT3DUnpackerStore * resultDebug = m_firmwareResults[iClk+4];
1216 // if(t2DRhoTot3DRho(result->m_t2d0_rho_s) == resultDebug->m_t3dtrk0_rho)
1217 // {
1218 // cout<<"Matched 2D0 and debug0"<<endl;
1219 // } else {
1220 // cout<<"iClk:"<<iClk<<endl;
1221 // cout<<" [2D] fnf:"<<result->m_t2d_fnf<<" "<<bitset<6> (result->m_t2d_fnf)<<endl;
1222 // cout<<" [0] rho: "<<result->m_t2d0_rho_s<<" "<<toSigned(result->m_t2d0_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d0_rho_s)<<" phi0: "<<result->m_t2d0_phi<<endl;
1223 // cout<<" [1] rho: "<<result->m_t2d1_rho_s<<" "<<toSigned(result->m_t2d1_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d1_rho_s)<<" phi0: "<<result->m_t2d1_phi<<endl;
1224 // cout<<" [2] rho: "<<result->m_t2d2_rho_s<<" "<<toSigned(result->m_t2d2_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d2_rho_s)<<" phi0: "<<result->m_t2d2_phi<<endl;
1225 // cout<<" [3] rho: "<<result->m_t2d3_rho_s<<" "<<toSigned(result->m_t2d3_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d3_rho_s)<<" phi0: "<<result->m_t2d3_phi<<endl;
1226 // cout<<" [3DDebug] MSB"<<endl;
1227 // cout<<" charge: "<<resultDebug->m_t3dtrk0_charge<<" rho: "<<resultDebug->m_t3dtrk0_rho<<" phi0: "<<resultDebug->m_t3dtrk0_phi0<<endl;;
1228 // cout<<" ts0 id: "<<resultDebug->m_t3dtrk0ts0_id<<" lr: "<<resultDebug->m_t3dtrk0ts0_lr<<" rt: "<<resultDebug->m_t3dtrk0ts0_rt<<endl;
1229 // cout<<" ts1 id: "<<resultDebug->m_t3dtrk0ts1_id<<" lr: "<<resultDebug->m_t3dtrk0ts1_lr<<" rt: "<<resultDebug->m_t3dtrk0ts1_rt<<endl;
1230 // cout<<" ts2 id: "<<resultDebug->m_t3dtrk0ts2_id<<" lr: "<<resultDebug->m_t3dtrk0ts2_lr<<" rt: "<<resultDebug->m_t3dtrk0ts2_rt<<endl;
1231 // cout<<" ts3 id: "<<resultDebug->m_t3dtrk0ts3_id<<" lr: "<<resultDebug->m_t3dtrk0ts3_lr<<" rt: "<<resultDebug->m_t3dtrk0ts3_rt<<endl;
1232 // }
1233 //}
1234
1236 //if (iClk < 48-4-1 && bitset<6> (result->m_t2d_fnf)[2])
1237 //{
1238 // TRGCDCT3DUnpackerStore * resultDebug = m_firmwareResults[iClk+4];
1239 // if(t2DRhoTot3DRho(result->m_t2d3_rho_s) == resultDebug->m_t3dtrk1_rho)
1240 // {
1241 // cout<<"Matched 2D3 and debug1"<<endl;
1242 // } else {
1243 // cout<<"iClk:"<<iClk<<endl;
1244 // cout<<" [2D] fnf:"<<result->m_t2d_fnf<<" "<<bitset<6> (result->m_t2d_fnf)<<endl;
1245 // cout<<" [0] rho: "<<result->m_t2d0_rho_s<<" "<<toSigned(result->m_t2d0_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d0_rho_s)<<" phi0: "<<result->m_t2d0_phi<<endl;
1246 // cout<<" [1] rho: "<<result->m_t2d1_rho_s<<" "<<toSigned(result->m_t2d1_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d1_rho_s)<<" phi0: "<<result->m_t2d1_phi<<endl;
1247 // cout<<" [2] rho: "<<result->m_t2d2_rho_s<<" "<<toSigned(result->m_t2d2_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d2_rho_s)<<" phi0: "<<result->m_t2d2_phi<<endl;
1248 // cout<<" [3] rho: "<<result->m_t2d3_rho_s<<" "<<toSigned(result->m_t2d3_rho_s, 7)<<" "<<t2DRhoTot3DRho(result->m_t2d3_rho_s)<<" phi0: "<<result->m_t2d3_phi<<endl;
1249 // cout<<" [3DDebug] LSB"<<endl;
1250 // cout<<" evtTime: "<<resultDebug->m_t3dtrk1_evtTime_delay<<" evtTimeValid: "<<resultDebug->m_t3dtrk1_evtTimeValid_delay<<endl;
1251 // cout<<" charge: "<<resultDebug->m_t3dtrk1_charge<<" rho: "<<resultDebug->m_t3dtrk1_rho<<" phi0: "<<resultDebug->m_t3dtrk1_phi0<<endl;;
1252 // cout<<" ts0 id: "<<resultDebug->m_t3dtrk1ts0_id<<" lr: "<<resultDebug->m_t3dtrk1ts0_lr<<" rt: "<<resultDebug->m_t3dtrk1ts0_rt<<endl;
1253 // cout<<" ts1 id: "<<resultDebug->m_t3dtrk1ts1_id<<" lr: "<<resultDebug->m_t3dtrk1ts1_lr<<" rt: "<<resultDebug->m_t3dtrk1ts1_rt<<endl;
1254 // cout<<" ts2 id: "<<resultDebug->m_t3dtrk1ts2_id<<" lr: "<<resultDebug->m_t3dtrk1ts2_lr<<" rt: "<<resultDebug->m_t3dtrk1ts2_rt<<endl;
1255 // cout<<" ts3 id: "<<resultDebug->m_t3dtrk1ts3_id<<" lr: "<<resultDebug->m_t3dtrk1ts3_lr<<" rt: "<<resultDebug->m_t3dtrk1ts3_rt<<endl;
1256 // }
1257 //}
1258
1260 //int countTrk0 = int(result->m_t3dtrk0ts0_lr!=0)+int(result->m_t3dtrk0ts1_lr!=0)+int(result->m_t3dtrk0ts2_lr!=0)+int(result->m_t3dtrk0ts3_lr!=0);
1261 //if ( iClk < 48 - 7 - 1)
1262 //{
1263 // TRGCDCT3DUnpackerStore * resultDebug = m_firmwareResults[iClk];
1264 // TRGCDCT3DUnpackerStore * result = m_firmwareResults[iClk+7];
1265
1266 // if (int(countTrk0 > 1) == bitset<4> (int(result->m_t3d_validTS))[3])
1267 // {
1268 // cout<<"debug TSF matches with TSFValid0"<<endl;
1269 // } else {
1270 // cout<<"iClk:"<<iClk+7<<endl;
1271 // cout<<" [3D] fnf:"<<result->m_t3d_2dfnf<<" "<<bitset<6> (int(result->m_t3d_2dfnf))<<" tsValid: "<<result->m_t3d_validTS<<" "<<bitset<4> (int(result->m_t3d_validTS))<<endl;;
1272 // cout<<" [3DDebug] MSB"<<endl;
1273 // cout<<" charge: "<<resultDebug->m_t3dtrk0_charge<<" rho: "<<resultDebug->m_t3dtrk0_rho<<" phi0: "<<resultDebug->m_t3dtrk0_phi0<<endl;;
1274 // cout<<" ts0 id: "<<resultDebug->m_t3dtrk0ts0_id<<" lr: "<<resultDebug->m_t3dtrk0ts0_lr<<" rt: "<<resultDebug->m_t3dtrk0ts0_rt<<endl;
1275 // cout<<" ts1 id: "<<resultDebug->m_t3dtrk0ts1_id<<" lr: "<<resultDebug->m_t3dtrk0ts1_lr<<" rt: "<<resultDebug->m_t3dtrk0ts1_rt<<endl;
1276 // cout<<" ts2 id: "<<resultDebug->m_t3dtrk0ts2_id<<" lr: "<<resultDebug->m_t3dtrk0ts2_lr<<" rt: "<<resultDebug->m_t3dtrk0ts2_rt<<endl;
1277 // cout<<" ts3 id: "<<resultDebug->m_t3dtrk0ts3_id<<" lr: "<<resultDebug->m_t3dtrk0ts3_lr<<" rt: "<<resultDebug->m_t3dtrk0ts3_rt<<endl;
1278 // cout<<" count: "<<countTrk0<<endl;
1279 // }
1280 //}
1281
1283 //int countTrk3 = int(result->m_t3dtrk1ts0_lr!=0)+int(result->m_t3dtrk1ts1_lr!=0)+int(result->m_t3dtrk1ts2_lr!=0)+int(result->m_t3dtrk1ts3_lr!=0);
1284 //if ( iClk < 48 - 7 - 1)
1285 //{
1286 // TRGCDCT3DUnpackerStore * resultDebug = m_firmwareResults[iClk];
1287 // TRGCDCT3DUnpackerStore * result = m_firmwareResults[iClk+7];
1288
1289 // if (int(countTrk3 > 1) == bitset<4> (int(result->m_t3d_validTS))[2])
1290 // {
1291 // cout<<"debug TSF matches with TSFValid3"<<endl;
1292 // } else {
1293 // cout<<"iClk:"<<iClk+7<<endl;
1294 // cout<<" [3D] fnf:"<<result->m_t3d_2dfnf<<" "<<bitset<6> (int(result->m_t3d_2dfnf))<<" tsValid: "<<result->m_t3d_validTS<<" "<<bitset<4> (int(result->m_t3d_validTS))<<endl;;
1295 // cout<<" [3DDebug] LSB"<<endl;
1296 // cout<<" charge: "<<resultDebug->m_t3dtrk1_charge<<" rho: "<<resultDebug->m_t3dtrk1_rho<<" phi0: "<<resultDebug->m_t3dtrk1_phi0<<endl;;
1297 // cout<<" ts0 id: "<<resultDebug->m_t3dtrk1ts0_id<<" lr: "<<resultDebug->m_t3dtrk1ts0_lr<<" rt: "<<resultDebug->m_t3dtrk1ts0_rt<<endl;
1298 // cout<<" ts1 id: "<<resultDebug->m_t3dtrk1ts1_id<<" lr: "<<resultDebug->m_t3dtrk1ts1_lr<<" rt: "<<resultDebug->m_t3dtrk1ts1_rt<<endl;
1299 // cout<<" ts2 id: "<<resultDebug->m_t3dtrk1ts2_id<<" lr: "<<resultDebug->m_t3dtrk1ts2_lr<<" rt: "<<resultDebug->m_t3dtrk1ts2_rt<<endl;
1300 // cout<<" ts3 id: "<<resultDebug->m_t3dtrk1ts3_id<<" lr: "<<resultDebug->m_t3dtrk1ts3_lr<<" rt: "<<resultDebug->m_t3dtrk1ts3_rt<<endl;
1301 // cout<<" count: "<<countTrk3<<endl;
1302 // }
1303 //}
1304
1305 // Compare 2D with debug and 3D after 4 clks and 11 clks
1306 if (result->m_t2d_fnf && iClk < 48 - 17 - 1 && bitset<6> (result->m_t2d_fnf)[5]) {
1307 TRGCDCT3DUnpackerStore* resultDebug = m_firmwareResults[iClk + 4];
1308 TRGCDCT3DUnpackerStore* result3D = m_firmwareResults[iClk + 17];
1309
1310 // Store information(charge, radius(cm), phi_c(rad), eventTime, eventTimeValid, [TS ID, TS LR, TS driftTime])
1311 // [TODO] Is evtTime clock correct?
1312 int charge = resultDebug->m_t3dtrk0_charge;
1313 double radius = resultDebug->m_t3dtrk0_rho * 2500 / (pow(2, 11) - 0.5);
1314 double phi_c = toSigned(resultDebug->m_t3dtrk0_phi0, 13) * M_PI / (pow(2, 12) - 0.5);
1315 int eventTime = result3D->m_t3dtrk0_evtTime_delay;
1316 int eventTimeValid = result3D->m_t3dtrk0_evtTimeValid_delay;
1317 // rawStTSs[iSt] = [TS ID, TS LR, TS driftTime]
1318 vector<vector<int> > rawStTSs(4, vector<int> (3));
1319 rawStTSs[0][0] = resultDebug->m_t3dtrk0ts0_id;
1320 rawStTSs[0][1] = resultDebug->m_t3dtrk0ts0_lr;
1321 rawStTSs[0][2] = resultDebug->m_t3dtrk0ts0_rt;
1322 rawStTSs[1][0] = resultDebug->m_t3dtrk0ts1_id;
1323 rawStTSs[1][1] = resultDebug->m_t3dtrk0ts1_lr;
1324 rawStTSs[1][2] = resultDebug->m_t3dtrk0ts1_rt;
1325 rawStTSs[2][0] = resultDebug->m_t3dtrk0ts2_id;
1326 rawStTSs[2][1] = resultDebug->m_t3dtrk0ts2_lr;
1327 rawStTSs[2][2] = resultDebug->m_t3dtrk0ts2_rt;
1328 rawStTSs[3][0] = resultDebug->m_t3dtrk0ts3_id;
1329 rawStTSs[3][1] = resultDebug->m_t3dtrk0ts3_lr;
1330 rawStTSs[3][2] = resultDebug->m_t3dtrk0ts3_rt;
1331
1332 // Get geometry
1333 map<string, vector<double> > stGeometry;
1334 vector<vector<double> > stXts;
1336 TRGCDCFitter3D::getStereoXt(stGeometry["priorityLayer"], stXts);
1337 //Fitter3DUtility::loadStereoXt("TODOdata/stereoXt",4,stXts);
1338
1340 //vector<double> stTSs(4);
1341 //Fitter3DUtility::calPhiFast(stGeometry, stXts, eventTimeValid, eventTime, rawStTSs, stTSs);
1342 //cout<<" [calPhi] "<<stTSs[0]<<" "<<stTSs[1]<<" "<<stTSs[2]<<" "<<stTSs[3]<<endl;
1344 //vector<double> invZError2;
1345 //Fitter3DUtility::setErrorFast(rawStTSs, eventTimeValid, invZError2);
1346 //cout<<" [invZError2] "<<invZError2[0]<<" "<<invZError2[1]<<" "<<invZError2[2]<<" "<<invZError2[3]<<endl;
1349 //vector<double> zz(4, 0);
1350 //vector<double> arcS(4, 0);
1351 //for (unsigned iSt = 0; iSt < 4; iSt++) {
1352 // if (rawStTSs[iSt][1] != 0) {
1353 // zz[iSt] = Fitter3DUtility::calZ(charge, stGeometry["angleSt"][iSt], stGeometry["zToStraw"][iSt],
1354 // stGeometry["cdcRadius"][iSt], stTSs[iSt], radius, phi_c);
1355 // arcS[iSt] = Fitter3DUtility::calS(radius, stGeometry["cdcRadius"][iSt]);
1356 // }
1357 //}
1358 //cout<<" [zz] "<<zz[0]<<" "<<zz[1]<<" "<<zz[2]<<" "<<zz[3]<<endl;
1359 //cout<<" [arcS] "<<arcS[0]<<" "<<arcS[1]<<" "<<arcS[2]<<" "<<arcS[3]<<endl;
1361 //double z0 = 0;
1362 //double cot = 0;
1363 //double chi2 = 0;
1364 //Fitter3DUtility::rSFit(&invZError2[0], &arcS[0], &zz[0], z0, cot, chi2);
1365 double z0 = 0;
1366 double cot = 0;
1367 double chi2 = 0;
1368 Fitter3DUtility::fitter3D(stGeometry, stXts, eventTimeValid, eventTime, rawStTSs, charge, radius, phi_c, z0, cot, chi2);
1369
1370 // Prepare complex fit3D
1371 map<string, vector<double> > mConstV;
1372 map<string, double> mConstD;
1373 TRGCDCFitter3D::getConstants(mConstD, mConstV);
1374 //Belle2::TRGCDCJSignalData commonData;
1375 //map<string, TRGCDCJSignal> mSignalStorage;
1376 //map<string, TRGCDCJLUT*> mLutStorage;
1377 Fitter3DUtility::fitter3DFirm(mConstD, mConstV, eventTimeValid, eventTime, rawStTSs, charge, radius, phi_c, m_commonData,
1379
1382 //vector<tuple<string, double, int, double, double, int> > t_values = {
1383 // make_tuple("phi0", phi_c, mConstD["phiBitSize"], mConstD["phiMin"], mConstD["phiMax"], 0),
1384 // make_tuple("rho", radius, mConstD["rhoBitSize"], mConstD["rhoMin"], mConstD["rhoMax"], 0),
1385 // //make_tuple("charge",(int) (m_mDouble["charge"]==1 ? 1 : 0), 1, 0, 1.5, 0),
1386 // make_tuple("charge", (int)(charge == 1 ? 1 : 0), 1, 0, 1.5, 0),
1387 // make_tuple("lr_0", rawStTSs[0][1], 2, 0, 3.5, 0),
1388 // make_tuple("lr_1", rawStTSs[1][1], 2, 0, 3.5, 0),
1389 // make_tuple("lr_2", rawStTSs[2][1], 2, 0, 3.5, 0),
1390 // make_tuple("lr_3", rawStTSs[3][1], 2, 0, 3.5, 0),
1391 // make_tuple("tsId_0", rawStTSs[0][0], ceil(log(mConstV["nTSs"][1]) / log(2)), 0, pow(2, ceil(log(mConstV["nTSs"][1]) / log(2))) - 0.5, 0),
1392 // make_tuple("tsId_1", rawStTSs[1][0], ceil(log(mConstV["nTSs"][3]) / log(2)), 0, pow(2, ceil(log(mConstV["nTSs"][3]) / log(2))) - 0.5, 0),
1393 // make_tuple("tsId_2", rawStTSs[2][0], ceil(log(mConstV["nTSs"][5]) / log(2)), 0, pow(2, ceil(log(mConstV["nTSs"][5]) / log(2))) - 0.5, 0),
1394 // make_tuple("tsId_3", rawStTSs[3][0], ceil(log(mConstV["nTSs"][7]) / log(2)), 0, pow(2, ceil(log(mConstV["nTSs"][7]) / log(2))) - 0.5, 0),
1395 // make_tuple("tdc_0", rawStTSs[0][2], mConstD["tdcBitSize"], 0, pow(2, mConstD["tdcBitSize"]) - 0.5, 0),
1396 // make_tuple("tdc_1", rawStTSs[1][2], mConstD["tdcBitSize"], 0, pow(2, mConstD["tdcBitSize"]) - 0.5, 0),
1397 // make_tuple("tdc_2", rawStTSs[2][2], mConstD["tdcBitSize"], 0, pow(2, mConstD["tdcBitSize"]) - 0.5, 0),
1398 // make_tuple("tdc_3", rawStTSs[3][2], mConstD["tdcBitSize"], 0, pow(2, mConstD["tdcBitSize"]) - 0.5, 0),
1399 // make_tuple("eventTime", eventTime, mConstD["tdcBitSize"], 0, pow(2, mConstD["tdcBitSize"]) - 0.5, 0),
1400 // make_tuple("eventTimeValid", eventTimeValid, 1, 0, 1.5, 0),
1401 //};
1402 //TRGCDCJSignal::valuesToMapSignals(t_values, m_commonData, m_mSignalStorage);
1404 //Fitter3DUtility::setError(mConstD, mConstV, m_mSignalStorage);
1405 //Fitter3DUtility::calPhi(mConstD, mConstV, m_mSignalStorage, m_mLutStorage);
1406 //Fitter3DUtility::constrainRPerStSl(mConstV, m_mSignalStorage);
1407 //Fitter3DUtility::calZ(mConstD, mConstV, m_mSignalStorage, m_mLutStorage);
1408 //Fitter3DUtility::calS(mConstD, mConstV, m_mSignalStorage, m_mLutStorage);
1409 //Fitter3DUtility::rSFit(mConstD, mConstV, m_mSignalStorage, m_mLutStorage);
1412 //if ((*m_mSignalStorage.begin()).second.getName() == "") {
1413 // for (auto it = m_mSignalStorage.begin(); it != m_mSignalStorage.end(); ++it) {
1414 // (*it).second.setName((*it).first);
1415 // }
1416 //}
1417
1418 if (toSigned(result3D->m_t3dtrk0_z0_s, 11) != m_mSignalStorage["z0_r"].getInt()
1419 || toSigned(result3D->m_t3dtrk0_cot_s, 11) != m_mSignalStorage["cot_r"].getInt()) {
1420 bitset<6> t2d_oldfnf(int(result->m_t3d_2doldtrk));
1421 cout << "iClk:" << iClk << endl;
1422 cout << " [2D] fnf:" << result->m_t2d_fnf << " " << bitset<6> (result->m_t2d_fnf) << " oldfnf: " << t2d_oldfnf << endl;
1423// cout << " [0] rho: " << result->m_t2d0_rho_s << " " << t2DRhoTot3DRho(result->m_t2d0_rho_s) << " phi0: " << result->m_t2d0_phi <<
1424// " " << t2DPhiTot3DPhi(result->m_t2d0_phi, result->m_t2d0_rho_s) << endl;
1425 cout << " [debug] MSB" << endl;
1426 cout << " charge: " << resultDebug->m_t3dtrk0_charge << " rho: " << resultDebug->m_t3dtrk0_rho << " phi0: " << toSigned(
1427 resultDebug->m_t3dtrk0_phi0, 13) << endl;;
1428 cout << " ts0 id: " << resultDebug->m_t3dtrk0ts0_id << " lr: " << resultDebug->m_t3dtrk0ts0_lr << " rt: " <<
1429 resultDebug->m_t3dtrk0ts0_rt << endl;
1430 cout << " ts1 id: " << resultDebug->m_t3dtrk0ts1_id << " lr: " << resultDebug->m_t3dtrk0ts1_lr << " rt: " <<
1431 resultDebug->m_t3dtrk0ts1_rt << endl;
1432 cout << " ts2 id: " << resultDebug->m_t3dtrk0ts2_id << " lr: " << resultDebug->m_t3dtrk0ts2_lr << " rt: " <<
1433 resultDebug->m_t3dtrk0ts2_rt << endl;
1434 cout << " ts3 id: " << resultDebug->m_t3dtrk0ts3_id << " lr: " << resultDebug->m_t3dtrk0ts3_lr << " rt: " <<
1435 resultDebug->m_t3dtrk0ts3_rt << endl;
1436 cout << " [3D] fnf:" << result3D->m_t3d_2dfnf << " " << bitset<6> (result3D->m_t3d_2dfnf) << " tsValid: " <<
1437 result3D->m_t3d_validTS << " " << bitset<4> (result3D->m_t3d_validTS) << endl;;
1438 cout << " [0] z0: " << result3D->m_t3dtrk0_z0_s << " " << toSigned(result3D->m_t3dtrk0_z0_s,
1439 11) << " " << toSigned(result3D->m_t3dtrk0_z0_s,
1440 11) * 0.0382 << " cot: " << result3D->m_t3dtrk0_cot_s << " " << toSigned(result3D->m_t3dtrk0_cot_s,
1441 11) << " " << toSigned(result3D->m_t3dtrk0_cot_s, 11) * 0.00195 << " chi2: " << result3D->m_t3dtrk0_zchisq << endl;
1442 cout << " [1] z0: " << result3D->m_t3dtrk1_z0_s << " " << toSigned(result3D->m_t3dtrk1_z0_s,
1443 11) << " " << toSigned(result3D->m_t3dtrk1_z0_s,
1444 11) * 0.0382 << " cot: " << result3D->m_t3dtrk1_cot_s << " " << toSigned(result3D->m_t3dtrk1_cot_s,
1445 11) << " " << toSigned(result3D->m_t3dtrk1_cot_s, 11) * 0.00195 << " chi2: " << result3D->m_t3dtrk1_zchisq << endl;
1446 cout << " [2] z0: " << result3D->m_t3dtrk2_z0_s << " " << toSigned(result3D->m_t3dtrk2_z0_s,
1447 11) << " " << toSigned(result3D->m_t3dtrk2_z0_s,
1448 11) * 0.0382 << " cot: " << result3D->m_t3dtrk2_cot_s << " " << toSigned(result3D->m_t3dtrk2_cot_s,
1449 11) << " " << toSigned(result3D->m_t3dtrk2_cot_s, 11) * 0.00195 << " chi2: " << result3D->m_t3dtrk2_zchisq << endl;
1450 cout << " [3] z0: " << result3D->m_t3dtrk3_z0_s << " " << toSigned(result3D->m_t3dtrk3_z0_s,
1451 11) << " " << toSigned(result3D->m_t3dtrk3_z0_s,
1452 11) * 0.0382 << " cot: " << result3D->m_t3dtrk3_cot_s << " " << toSigned(result3D->m_t3dtrk3_cot_s,
1453 11) << " " << toSigned(result3D->m_t3dtrk3_cot_s, 11) * 0.00195 << " chi2: " << result3D->m_t3dtrk3_zchisq << endl;
1454 cout << " evtTime: " << result3D->m_t3dtrk0_evtTime_delay << " evtTimeValid: " << result3D->m_t3dtrk0_evtTimeValid_delay << endl;
1455
1456 cout << " [Store information]" << endl;
1457 cout << " charge: " << charge << " radius(cm): " << radius << " phi_c(rad): " << phi_c << endl;
1458 cout << " eventTime: " << eventTime << " valid: " << eventTimeValid << endl;
1459 cout << " rawStTSs[0] id:" << rawStTSs[0][0] << " lr: " << rawStTSs[0][1] << " rt: " << rawStTSs[0][2] << endl;
1460 cout << " rawStTSs[1] id:" << rawStTSs[1][0] << " lr: " << rawStTSs[1][1] << " rt: " << rawStTSs[1][2] << endl;
1461 cout << " rawStTSs[2] id:" << rawStTSs[2][0] << " lr: " << rawStTSs[2][1] << " rt: " << rawStTSs[2][2] << endl;
1462 cout << " rawStTSs[3] id:" << rawStTSs[3][0] << " lr: " << rawStTSs[3][1] << " rt: " << rawStTSs[3][2] << endl;
1463
1464 cout << " [Calculate fast]" << endl;
1465 cout << " [z0] " << z0 << " [cot] " << cot << " [chi2] " << chi2 << endl;
1466
1467 cout << " [Calculate firm]" << endl;
1468 cout << " z0: " << m_mSignalStorage["z0_r"].getInt() << " " << m_mSignalStorage["z0_r"].getRealInt() << " " <<
1469 m_mSignalStorage["z0_r"].getToReal() << " cot: " << m_mSignalStorage["cot_r"].getInt() << " " <<
1470 m_mSignalStorage["cot_r"].getRealInt() << " " << m_mSignalStorage["cot_r"].getToReal() << " zchi: " <<
1471 m_mSignalStorage["zChi2_r"].getInt() << " " << m_mSignalStorage["zChi2_r"].getRealInt() << " " <<
1472 m_mSignalStorage["zChi2_r"].getToReal() << endl;
1473 //doPrint = 1;
1474 }
1475 //else
1476 //{
1477 // cout<<"same"<<endl;
1478 //}
1479
1480 }
1481
1482 }
1483
1484 if (doPrint) {
1485 for (int iClk = 0; iClk < m_firmwareResults.getEntries(); iClk++) {
1487 bitset<6> t2d_fnf(int(result->m_t3d_2dfnf));
1488 bitset<4> tsf_fnf(int(result->m_t3d_validTS));
1489 bitset<6> t2d_oldfnf(int(result->m_t3d_2doldtrk));
1490 cout << "iClk:" << iClk << endl;
1491 cout << " [2D] fnf:" << result->m_t2d_fnf << " " << bitset<6> (result->m_t2d_fnf) << " oldfnf: " << t2d_oldfnf << endl;
1492 cout << " [0] rho: " << result->m_t2d0_rho_s << " " << toSigned(result->m_t2d0_rho_s,
1493 7) << " " << int(0.3 * 34 / 30 / 1.5e-4 / abs(toSigned(result->m_t2d0_rho_s, 7)) * (pow(2,
1494 11) - 0.5) / 2500) << " phi0: " << result->m_t2d0_phi << endl;
1495 cout << " [1] rho: " << result->m_t2d1_rho_s << " " << toSigned(result->m_t2d1_rho_s,
1496 7) << " " << int(0.3 * 34 / 30 / 1.5e-4 / abs(toSigned(result->m_t2d1_rho_s, 7)) * (pow(2,
1497 11) - 0.5) / 2500) << " phi0: " << result->m_t2d1_phi << endl;
1498 cout << " [2] rho: " << result->m_t2d2_rho_s << " " << toSigned(result->m_t2d2_rho_s,
1499 7) << " " << int(0.3 * 34 / 30 / 1.5e-4 / abs(toSigned(result->m_t2d2_rho_s, 7)) * (pow(2,
1500 11) - 0.5) / 2500) << " phi0: " << result->m_t2d2_phi << endl;
1501 cout << " [3] rho: " << result->m_t2d3_rho_s << " " << toSigned(result->m_t2d3_rho_s,
1502 7) << " " << int(0.3 * 34 / 30 / 1.5e-4 / abs(toSigned(result->m_t2d3_rho_s, 7)) * (pow(2,
1503 11) - 0.5) / 2500) << " phi0: " << result->m_t2d3_phi << endl;
1504 cout << " [3D] fnf:" << result->m_t3d_2dfnf << " " << t2d_fnf << " " << t2d_fnf[5] << " tsValid: " << result->m_t3d_validTS << " "
1505 << tsf_fnf << endl;;
1506 cout << " [0] z0: " << result->m_t3dtrk0_z0_s << " cot: " << result->m_t3dtrk0_cot_s << " chi2: " << result->m_t3dtrk0_zchisq
1507 << endl;
1508 cout << " [1] z0: " << result->m_t3dtrk1_z0_s << " cot: " << result->m_t3dtrk1_cot_s << " chi2: " << result->m_t3dtrk1_zchisq
1509 << endl;
1510 cout << " [2] z0: " << result->m_t3dtrk2_z0_s << " cot: " << result->m_t3dtrk2_cot_s << " chi2: " << result->m_t3dtrk2_zchisq
1511 << endl;
1512 cout << " [3] z0: " << result->m_t3dtrk3_z0_s << " cot: " << result->m_t3dtrk3_cot_s << " chi2: " << result->m_t3dtrk3_zchisq
1513 << endl;
1514 cout << " [debug] MSB" << endl;
1515 cout << " evtTime: " << result->m_t3dtrk0_evtTime_delay << " evtTimeValid: " << result->m_t3dtrk0_evtTimeValid_delay <<
1516 endl;
1517 cout << " charge: " << result->m_t3dtrk0_charge << " rho: " << result->m_t3dtrk0_rho << " phi0: " << result->m_t3dtrk0_phi0
1518 << endl;;
1519 cout << " ts0 id: " << result->m_t3dtrk0ts0_id << " lr: " << result->m_t3dtrk0ts0_lr << " rt: " << result->m_t3dtrk0ts0_rt
1520 << endl;
1521 cout << " ts1 id: " << result->m_t3dtrk0ts1_id << " lr: " << result->m_t3dtrk0ts1_lr << " rt: " << result->m_t3dtrk0ts1_rt
1522 << endl;
1523 cout << " ts2 id: " << result->m_t3dtrk0ts2_id << " lr: " << result->m_t3dtrk0ts2_lr << " rt: " << result->m_t3dtrk0ts2_rt
1524 << endl;
1525 cout << " ts3 id: " << result->m_t3dtrk0ts3_id << " lr: " << result->m_t3dtrk0ts3_lr << " rt: " << result->m_t3dtrk0ts3_rt
1526 << endl;
1527 cout << " [debug] LSB" << endl;
1528 cout << " evtTime: " << result->m_t3dtrk1_evtTime_delay << " evtTimeValid: " << result->m_t3dtrk1_evtTimeValid_delay <<
1529 endl;
1530 cout << " charge: " << result->m_t3dtrk1_charge << " rho: " << result->m_t3dtrk1_rho << " phi0: " << result->m_t3dtrk1_phi0
1531 << endl;;
1532 cout << " ts0 id: " << result->m_t3dtrk1ts0_id << " lr: " << result->m_t3dtrk1ts0_lr << " rt: " << result->m_t3dtrk1ts0_rt
1533 << endl;
1534 cout << " ts1 id: " << result->m_t3dtrk1ts1_id << " lr: " << result->m_t3dtrk1ts1_lr << " rt: " << result->m_t3dtrk1ts1_rt
1535 << endl;
1536 cout << " ts2 id: " << result->m_t3dtrk1ts2_id << " lr: " << result->m_t3dtrk1ts2_lr << " rt: " << result->m_t3dtrk1ts2_rt
1537 << endl;
1538 cout << " ts3 id: " << result->m_t3dtrk1ts3_id << " lr: " << result->m_t3dtrk1ts3_lr << " rt: " << result->m_t3dtrk1ts3_rt
1539 << endl;
1540 }
1541 }
1542}
Belle2::TRGCDCJSignalData * m_commonData
TRGCDCJSignalData for VHDL generation (jbkim's class)
std::map< std::string, TRGCDCJLUT * > m_mLutStorage
TRGCDCJLUT for VHDL generation (jbkim's class)
std::map< std::string, TRGCDCJSignal > m_mSignalStorage
TRGCDCJSignal for VHDL generation (jbkim's class)
StoreArray< TRGCDCT3DUnpackerStore > m_firmwareResults
list of firmware results
int m_t3dtrk3_cot_s
m_t3dtrk3_cot_s leaf
int m_t3dtrk3_zchisq
m_t3dtrk3_zchisq leaf
int m_t3dtrk0_evtTimeValid_delay
m_t3dtrk0_evtTimeValid_delay leaf
int m_t3dtrk0ts2_id
m_t3dtrk0ts2_id leaf
int m_t3dtrk0ts0_rt
m_t3dtrk0ts0_rt leaf
int m_t3dtrk0ts3_lr
m_t3dtrk0ts3_lr leaf
int m_t3dtrk0ts1_id
m_t3dtrk0ts1_id leaf
int m_t3dtrk2_zchisq
m_t3dtrk2_zchisq leaf
int m_t3dtrk2_cot_s
m_t3dtrk2_cot_s leaf
int m_t3dtrk0ts3_id
m_t3dtrk0ts3_id leaf
int m_t3dtrk0ts0_lr
m_t3dtrk0ts0_lr leaf
int m_t3dtrk0_zchisq
m_t3dtrk0_zchisq leaf
int m_t3dtrk1_cot_s
m_t3dtrk1_cot_s leaf
int m_t3dtrk0ts0_id
m_t3dtrk0ts0_id leaf
int m_t3dtrk0_cot_s
m_t3dtrk0_cot_s leaf
int m_t3dtrk0_evtTime_delay
m_t3dtrk0_evtTime_delay leaf
int m_t3dtrk0ts2_lr
m_t3dtrk0ts2_lr leaf
int m_t3dtrk0ts1_rt
m_t3dtrk0ts1_rt leaf
int m_t3dtrk0_phi0
m_t3dtrk0_phi0 leaf
int m_t3dtrk0ts3_rt
m_t3dtrk0ts3_rt leaf
int m_t3dtrk0_charge
m_t3dtrk0_charge leaf
int m_t3dtrk0ts1_lr
m_t3dtrk0ts1_lr leaf
int m_t3dtrk0ts2_rt
m_t3dtrk0ts2_rt leaf
int m_t3dtrk1_zchisq
m_t3dtrk1_zchisq leaf
static void fitter3DFirm(std::map< std::string, double > &mConstD, const std::map< std::string, std::vector< double > > &mConstV, int eventTimeValid, int eventTime, std::vector< std::vector< int > > const &rawStTSs, int charge, double radius, double phi_c, Belle2::TRGCDCJSignalData *commonData, std::map< std::string, Belle2::TRGCDCJSignal > &mSignalStorage, std::map< std::string, Belle2::TRGCDCJLUT * > &mLutStorage)
Combines several functions for fitter3D firmware.
static void fitter3D(std::map< std::string, std::vector< double > > &stGeometry, std::vector< std::vector< double > > const &stXts, int eventTimeValid, int eventTime, std::vector< std::vector< int > > const &rawStTSs, int charge, double radius, double phi_c, double &z0, double &cot, double &chi2)
Combines several functions for fitter3D.
static void getStereoGeometry(std::map< std::string, std::vector< double > > &stGeometry)
Get stereo geometry.
Definition: Fitter3D.cc:1558
static void getStereoXt(std::vector< double > const &stPriorityLayer, std::vector< std::vector< double > > &stXts, bool isSimple=0)
Get stereo Xt.
Definition: Fitter3D.cc:1578
static void getConstants(std::map< std::string, double > &mConstD, std::map< std::string, std::vector< double > > &mConstV, bool isXtSimple=0)
Get constants for firmwareFit.
Definition: Fitter3D.cc:1596

◆ def_beginRun()

virtual void def_beginRun ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function beginRun() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 425 of file Module.h.

425{ beginRun(); }
virtual void beginRun()
Called when entering a new run.
Definition: Module.h:146

◆ def_endRun()

virtual void def_endRun ( )
inlineprotectedvirtualinherited

This method can receive that the current run ends as a call from the Python side.

For regular C++-Modules that forwards the call to the regular endRun() method.

Reimplemented in PyModule.

Definition at line 438 of file Module.h.

438{ endRun(); }
virtual void endRun()
This method is called if the current run ends.
Definition: Module.h:165

◆ def_event()

virtual void def_event ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function event() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 431 of file Module.h.

431{ event(); }
virtual void event()
This method is the core of the module.
Definition: Module.h:156

◆ def_initialize()

virtual void def_initialize ( )
inlineprotectedvirtualinherited

Wrappers to make the methods without "def_" prefix callable from Python.

Overridden in PyModule. Wrapper method for the virtual function initialize() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 419 of file Module.h.

419{ initialize(); }
virtual void initialize()
Initialize the Module.
Definition: Module.h:109

◆ def_terminate()

virtual void def_terminate ( )
inlineprotectedvirtualinherited

Wrapper method for the virtual function terminate() that has the implementation to be used in a call from Python.

Reimplemented in PyModule.

Definition at line 444 of file Module.h.

444{ terminate(); }
virtual void terminate()
This method is called at the end of the event processing.
Definition: Module.h:175

◆ endRun()

void endRun ( void  )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 109 of file TRGCDCT3DConverterModule.cc.

110{
111}

◆ evalCondition()

bool evalCondition ( ) const
inherited

If at least one condition was set, it is evaluated and true returned if at least one condition returns true.

If no condition or result value was defined, the method returns false. Otherwise, the condition is evaluated and true returned, if at least one condition returns true. To speed up the evaluation, the condition strings were already parsed in the method if_value().

Returns
True if at least one condition and return value exists and at least one condition expression was evaluated to true.

Definition at line 96 of file Module.cc.

97{
98 if (m_conditions.empty()) return false;
99
100 //okay, a condition was set for this Module...
101 if (!m_hasReturnValue) {
102 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
103 }
104
105 for (const auto& condition : m_conditions) {
106 if (condition.evaluate(m_returnValue)) {
107 return true;
108 }
109 }
110 return false;
111}
int m_returnValue
The return value.
Definition: Module.h:518
bool m_hasReturnValue
True, if the return value is set.
Definition: Module.h:517

◆ event()

void event ( void  )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 113 of file TRGCDCT3DConverterModule.cc.

114{
115 //cout<<"Event"<<endl;
116
117 if (m_addTSToDatastore) {
118 // Process firmware stereo TS
119 // stTsfFirmwareInfo[stSL][tsIndex][iClk][id, rt, lr, pr, foundTime]
120 boost::multi_array<double, 4> stTsfFirmwareInfo{boost::extents[4][15][48][5]};
121 storeTSFirmwareData(stTsfFirmwareInfo);
122
123 // stTsfInfo[stSL][iTS][id, rt, lr, pr, foundTime]
124 boost::multi_array<double, 3> stTsfInfo{boost::extents[4][0][5]};
125
126 filterTSData(stTsfFirmwareInfo, stTsfInfo);
127 // Add to TS datastore
128 addTSDatastore(stTsfInfo, 1);
129 }
130
132 // Process firmware 2D
133
134 // t2DFirmwareInfo[tIndex][iClk][valid, isOld, charge, rho, phi0]
135 boost::multi_array<double, 3> t2DFirmwareInfo{boost::extents[4][48][5]};
136 // t2DTsfFirmwareInfo[tIndex][iClk][axSL][id, rt, lr, pr]
137 boost::multi_array<double, 4> t2DTsfFirmwareInfo{boost::extents[4][48][5][4]};
138 store2DFirmwareData(t2DFirmwareInfo, t2DTsfFirmwareInfo);
139
140 // t2DInfo[tIndex][charge, rho, phi0]
141 boost::multi_array<double, 2> t2DInfo{boost::extents[0][3]};
142 // t2DTsfInfo[tIndex][axSL][id, rt, lr, pr, -9999]
143 boost::multi_array<double, 3> t2DTsfInfo{boost::extents[0][5][5]};
144
145 filter2DData(t2DFirmwareInfo, t2DTsfFirmwareInfo, t2DInfo, t2DTsfInfo);
146 add2DDatastore(t2DInfo, t2DTsfInfo);
147 }
148
151 // add eventTime
152 bool validEventTime = 0;
153 int eventTime = 0;
154 for (int iClk = 0; iClk < m_firmwareResults.getEntries() - 17 - 1; iClk++) {
156 if (result->m_t3dtrk0_evtTimeValid_delay) {
157 validEventTime = 1;
158 eventTime = result->m_t3dtrk0_evtTime_delay;
159 }
160 }
161 if (validEventTime) {
162 m_eventTime->addBinnedEventT0(eventTime, Const::CDC);
163 }
164 if (m_isVerbose) {
165 if (validEventTime) cout << "[ET] valid: 1 eventTime:" << eventTime << endl;
166 else cout << "[ET] valid: 0" << endl;
167 }
168 }
169
170 if (m_add3DToDatastore) {
171 // t3DFirmwareInfo[tIndex][iClk][2DValid, 2DisOld, TSFValid, EventTimeValid, eventTime, charge, rho, phi0, z0, cot, zchi]
172 boost::multi_array<double, 3> t3DFirmwareInfo{boost::extents[4][48][11]};
173
174 // m_fit3DWithTSIM 0:firmware 1:fastSim 2:firmSim
175 // Use Firmware results
176 if (m_fit3DWithTSIM == 0) store3DFirmwareData(t3DFirmwareInfo);
177 // Use fast sim with debug
178 if (m_fit3DWithTSIM == 1) store3DFastSimData(t3DFirmwareInfo);
179 // Use firm sim with debug
180 if (m_fit3DWithTSIM == 2) store3DFirmSimData(t3DFirmwareInfo);
181
182 // t3DInfo[eventTime, charge, rho, phi0, z0, cot, zchi]
183 boost::multi_array<double, 2> t3DInfo{boost::extents[0][7]};
184
185
186 filter3DData(t3DFirmwareInfo, t3DInfo);
187
188 if (m_fit3DWithTSIM == 0) add3DDatastore(t3DInfo);
189 else add3DDatastore(t3DInfo, 0);
190 }
191
192 if (m_isVerbose > 1) {
194 }
195
196
197
198 //vector<int> t2DClks;
199 //vector<int> t2DTrackId;
200 //filter2DData(t2DFirmwareInfo, t2DTsfFirmwareInfo, t2DInfo, t2DTsfInfo, t2DClks, t2DTrackId);
201
204 //for(unsigned iTrack = 0; iTrack < t2DInfo.size(); iTrack++)
205 //{
206 // cout<<"[2D] iClk: "<<t2DClks[iTrack]<<" trackid: "<<t2DTrackId[iTrack]<<" charge:"<<t2DInfo[iTrack][0]<<endl;
207 // int rho_s = t2DInfo[iTrack][1];
208 // int rho_2Dint = toSigned(rho_s, 7);
209 // double rho = 0.3*34/30/1.5e-4/abs(rho_2Dint);
210 // int rho_3Dint = rho*(pow(2,11)-0.5)/2500;
211 // cout<<" rho_s "<<rho_s<<" rho_int: "<<rho_2Dint<<" rho: "<<rho<<" rho_3Dint: "<<rho_3Dint<<endl;;
212 // //cout<<" phi0: "<<t2DInfo[iTrack][2]<<" s: "<<toSigned(t2DInfo[iTrack][2],13)<<" convert: "<<endl;
213 // //for(unsigned iAx = 0; iAx < t2DTsfInfo[iTrack].size(); iAx++)
214 // //{
215 // // cout<<" iAx: "<<iAx<<" id: "<<t2DTsfInfo[iTrack][iAx][0]<<" lr: "<<t2DTsfInfo[iTrack][iAx][2]<<endl;
216 // //}
217 //}
219 //for (unsigned iTrack = 0; iTrack < t3DInfo.size(); iTrack++)
220 //{
221 // cout<<"iClk: "<<t3DClks[iTrack]<<" trackid: "<<t3DTrackId[iTrack]<<" validTS: "<<bitset<4>(t3DInfo[iTrack][0])<<" z0: "<<t3DInfo[iTrack][1]<<" cot: "<<t3DInfo[iTrack][2]<<" zchi: "<<t3DInfo[iTrack][3]<<endl;
222 //}
223
224
225}
void addBinnedEventT0(int eventT0, Const::EDetector detector)
Store a binned event t0 for the given detector replacing any other hypothesis for this detector.
bool create(bool replace=false)
Create a default object in the data store.
bool isValid() const
Check whether the object was created.
Definition: StoreObjPtr.h:111
void addTSDatastore(boost::multi_array< double, 3 > &tsfInfo, int isSt=1)
adds tsfInfo to TS data store
void store3DFirmSimData(boost::multi_array< double, 3 > &t3DFirmwareInfo)
uses firm sim with debug
void store3DFastSimData(boost::multi_array< double, 3 > &t3DFirmwareInfo)
uses fast sim with debug
void filterTSData(boost::multi_array< double, 4 > &tsfFirmwareInfo, boost::multi_array< double, 3 > &tsfInfo)
filters tsfFirmwareInfo to tsfInfo
void add3DDatastore(boost::multi_array< double, 2 > &t3DInfo, bool doConvert=1)
adds t3DInfo to track data store
void store2DFirmwareData(boost::multi_array< double, 3 > &t2DFirmwareInfo, boost::multi_array< double, 4 > &axTsfFirmwareInfo)
converts firmwareResults of 2D to a vector
void store3DFirmwareData(boost::multi_array< double, 3 > &t3DFirmwareInfo)
converts firmwareResults of 3D to a vector
void storeTSFirmwareData(boost::multi_array< double, 4 > &tsfInfo)
converts firmwareResults of TS to a vector
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 add2DDatastore(boost::multi_array< double, 2 > &t2DInfo, boost::multi_array< double, 3 > &t2DTsfInfo)
adds t2DInfo to track data store

◆ exposePythonAPI()

void exposePythonAPI ( )
staticinherited

Exposes methods of the Module class to Python.

Definition at line 325 of file Module.cc.

326{
327 // to avoid confusion between std::arg and boost::python::arg we want a shorthand namespace as well
328 namespace bp = boost::python;
329
330 docstring_options options(true, true, false); //userdef, py sigs, c++ sigs
331
332 void (Module::*setReturnValueInt)(int) = &Module::setReturnValue;
333
334 enum_<Module::EAfterConditionPath>("AfterConditionPath",
335 R"(Determines execution behaviour after a conditional path has been executed:
336
337.. attribute:: END
338
339 End processing of this path after the conditional path. (this is the default for if_value() etc.)
340
341.. attribute:: CONTINUE
342
343 After the conditional path, resume execution after this module.)")
344 .value("END", Module::EAfterConditionPath::c_End)
345 .value("CONTINUE", Module::EAfterConditionPath::c_Continue)
346 ;
347
348 /* Do not change the names of >, <, ... we use them to serialize conditional paths */
349 enum_<Belle2::ModuleCondition::EConditionOperators>("ConditionOperator")
356 ;
357
358 enum_<Module::EModulePropFlags>("ModulePropFlags",
359 R"(Flags to indicate certain low-level features of modules, see :func:`Module.set_property_flags()`, :func:`Module.has_properties()`. Most useful flags are:
360
361.. attribute:: PARALLELPROCESSINGCERTIFIED
362
363 This module can be run in parallel processing mode safely (All I/O must be done through the data store, in particular, the module must not write any files.)
364
365.. attribute:: HISTOGRAMMANAGER
366
367 This module is used to manage histograms accumulated by other modules
368
369.. attribute:: TERMINATEINALLPROCESSES
370
371 When using parallel processing, call this module's terminate() function in all processes. This will also ensure that there is exactly one process (single-core if no parallel modules found) or at least one input, one main and one output process.
372)")
373 .value("INPUT", Module::EModulePropFlags::c_Input)
374 .value("OUTPUT", Module::EModulePropFlags::c_Output)
375 .value("PARALLELPROCESSINGCERTIFIED", Module::EModulePropFlags::c_ParallelProcessingCertified)
376 .value("HISTOGRAMMANAGER", Module::EModulePropFlags::c_HistogramManager)
377 .value("INTERNALSERIALIZER", Module::EModulePropFlags::c_InternalSerializer)
378 .value("TERMINATEINALLPROCESSES", Module::EModulePropFlags::c_TerminateInAllProcesses)
379 ;
380
381 //Python class definition
382 class_<Module, PyModule> module("Module", R"(
383Base class for Modules.
384
385A module is the smallest building block of the framework.
386A typical event processing chain consists of a Path containing
387modules. By inheriting from this base class, various types of
388modules can be created. To use a module, please refer to
389:func:`Path.add_module()`. A list of modules is available by running
390``basf2 -m`` or ``basf2 -m package``, detailed information on parameters is
391given by e.g. ``basf2 -m RootInput``.
392
393The 'Module Development' section in the manual provides detailed information
394on how to create modules, setting parameters, or using return values/conditions:
395https://xwiki.desy.de/xwiki/rest/p/f4fa4/#HModuleDevelopment
396
397)");
398 module
399 .def("__str__", &Module::getPathString)
400 .def("name", &Module::getName, return_value_policy<copy_const_reference>(),
401 "Returns the name of the module. Can be changed via :func:`set_name() <Module.set_name()>`, use :func:`type() <Module.type()>` for identifying a particular module class.")
402 .def("type", &Module::getType, return_value_policy<copy_const_reference>(),
403 "Returns the type of the module (i.e. class name minus 'Module')")
404 .def("set_name", &Module::setName, args("name"), R"(
405Set custom name, e.g. to distinguish multiple modules of the same type.
406
407>>> path.add_module('EventInfoSetter')
408>>> ro = path.add_module('RootOutput', branchNames=['EventMetaData'])
409>>> ro.set_name('RootOutput_metadata_only')
410>>> print(path)
411[EventInfoSetter -> RootOutput_metadata_only]
412
413)")
414 .def("description", &Module::getDescription, return_value_policy<copy_const_reference>(),
415 "Returns the description of this module.")
416 .def("package", &Module::getPackage, return_value_policy<copy_const_reference>(),
417 "Returns the package this module belongs to.")
418 .def("available_params", &_getParamInfoListPython,
419 "Return list of all module parameters as `ModuleParamInfo` instances")
420 .def("has_properties", &Module::hasProperties, (bp::arg("properties")),
421 R"DOCSTRING(Allows to check if the module has the given properties out of `ModulePropFlags` set.
422
423>>> if module.has_properties(ModulePropFlags.PARALLELPROCESSINGCERTIFIED):
424>>> ...
425
426Parameters:
427 properties (int): bitmask of `ModulePropFlags` to check for.
428)DOCSTRING")
429 .def("set_property_flags", &Module::setPropertyFlags, args("property_mask"),
430 "Set module properties in the form of an OR combination of `ModulePropFlags`.");
431 {
432 // python signature is too crowded, make ourselves
433 docstring_options subOptions(true, false, false); //userdef, py sigs, c++ sigs
434 module
435 .def("if_value", &Module::if_value,
436 (bp::arg("expression"), bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
437 R"DOCSTRING(if_value(expression, condition_path, after_condition_path=AfterConditionPath.END)
438
439Sets a conditional sub path which will be executed after this
440module if the return value set in the module passes the given ``expression``.
441
442Modules can define a return value (int or bool) using ``setReturnValue()``,
443which can be used in the steering file to split the Path based on this value, for example
444
445>>> module_with_condition.if_value("<1", another_path)
446
447In case the return value of the ``module_with_condition`` for a given event is
448less than 1, the execution will be diverted into ``another_path`` for this event.
449
450You could for example set a special return value if an error occurs, and divert
451the execution into a path containing :b2:mod:`RootOutput` if it is found;
452saving only the data producing/produced by the error.
453
454After a conditional path has executed, basf2 will by default stop processing
455the path for this event. This behaviour can be changed by setting the
456``after_condition_path`` argument.
457
458Parameters:
459 expression (str): Expression to determine if the conditional path should be executed.
460 This should be one of the comparison operators ``<``, ``>``, ``<=``,
461 ``>=``, ``==``, or ``!=`` followed by a numerical value for the return value
462 condition_path (Path): path to execute in case the expression is fulfilled
463 after_condition_path (AfterConditionPath): What to do once the ``condition_path`` has been executed.
464)DOCSTRING")
465 .def("if_false", &Module::if_false,
466 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
467 R"DOC(if_false(condition_path, after_condition_path=AfterConditionPath.END)
468
469Sets a conditional sub path which will be executed after this module if
470the return value of the module evaluates to False. This is equivalent to
471calling `if_value` with ``expression=\"<1\"``)DOC")
472 .def("if_true", &Module::if_true,
473 (bp::arg("condition_path"), bp::arg("after_condition_path")= Module::EAfterConditionPath::c_End),
474 R"DOC(if_true(condition_path, after_condition_path=AfterConditionPath.END)
475
476Sets a conditional sub path which will be executed after this module if
477the return value of the module evaluates to True. It is equivalent to
478calling `if_value` with ``expression=\">=1\"``)DOC");
479 }
480 module
481 .def("has_condition", &Module::hasCondition,
482 "Return true if a conditional path has been set for this module "
483 "using `if_value`, `if_true` or `if_false`")
484 .def("get_all_condition_paths", &_getAllConditionPathsPython,
485 "Return a list of all conditional paths set for this module using "
486 "`if_value`, `if_true` or `if_false`")
487 .def("get_all_conditions", &_getAllConditionsPython,
488 "Return a list of all conditional path expressions set for this module using "
489 "`if_value`, `if_true` or `if_false`")
490 .add_property("logging", make_function(&Module::getLogConfig, return_value_policy<reference_existing_object>()),
@ c_GE
Greater or equal than: ">=".
@ c_SE
Smaller or equal than: "<=".
@ c_GT
Greater than: ">"
@ c_NE
Not equal: "!=".
@ c_EQ
Equal: "=" or "=="
@ c_ST
Smaller than: "<"
Base class for Modules.
Definition: Module.h:72
LogConfig & getLogConfig()
Returns the log system configuration.
Definition: Module.h:224
void if_value(const std::string &expression, const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
Add a condition to the module.
Definition: Module.cc:79
void if_true(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to set the condition of the module.
Definition: Module.cc:90
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition: Module.cc:220
void setLogConfig(const LogConfig &logConfig)
Set the log system configuration.
Definition: Module.h:229
const std::string & getDescription() const
Returns the description of the module.
Definition: Module.h:201
void if_false(const std::shared_ptr< Path > &path, EAfterConditionPath afterConditionPath=EAfterConditionPath::c_End)
A simplified version to add a condition to the module.
Definition: Module.cc:85
bool hasCondition() const
Returns true if at least one condition was set for the module.
Definition: Module.h:310
const std::string & getPackage() const
Returns the package this module is in.
Definition: Module.h:196
void setName(const std::string &name)
Set the name of the module.
Definition: Module.h:213
bool hasProperties(unsigned int propertyFlags) const
Returns true if all specified property flags are available in this module.
Definition: Module.cc:160
std::string getPathString() const override
return the module name.
Definition: Module.cc:192

◆ filter2DData()

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*‍/

filters t2DFirmwareInfo to t2DInfo

Definition at line 357 of file TRGCDCT3DConverterModule.cc.

360{
361
362 for (unsigned iTrack = 0; iTrack < t2DFirmwareInfo.shape()[0]; iTrack++) {
363 for (unsigned iClk = 0; iClk < t2DFirmwareInfo.shape()[1]; iClk++) {
364 if (t2DFirmwareInfo[iTrack][iClk][0] == 0) continue;
365 // TODO make an algorithm to follow the track.
366
367 //choose new tracks
368 //if (t2DInfo.shape()[0] != 0 && t2DFirmwareInfo[iTrack][iClk][1] == 1) continue;
369
370 double track_ref[3] = {t2DFirmwareInfo[iTrack][iClk][2], t2DFirmwareInfo[iTrack][iClk][3], t2DFirmwareInfo[iTrack][iClk][4]};
371 boost::multi_array_ref<double, 1> track((double*)track_ref, boost::extents[3]);
372 t2DInfo.resize(boost::extents[t2DInfo.shape()[0] + 1][3]);
373 t2DInfo[t2DInfo.shape()[0] - 1] = track;
374
375
376 boost::multi_array<double, 2> axTSInfo{boost::extents[5][5]};
377 for (unsigned iAx = 0; iAx < t2DTsfFirmwareInfo.shape()[2]; iAx++) {
378 double id = t2DTsfFirmwareInfo[iTrack][iClk][iAx][0];
379 double rt = t2DTsfFirmwareInfo[iTrack][iClk][iAx][1];
380 double lr = t2DTsfFirmwareInfo[iTrack][iClk][iAx][2];
381 double pr = t2DTsfFirmwareInfo[iTrack][iClk][iAx][3];
382
383 axTSInfo[iAx][0] = id;
384 axTSInfo[iAx][1] = rt;
385 axTSInfo[iAx][2] = lr;
386 axTSInfo[iAx][3] = pr;
387 axTSInfo[iAx][4] = -9999;
388 }
389 t2DTsfInfo.resize(boost::extents[t2DTsfInfo.shape()[0] + 1][5][5]);
390 t2DTsfInfo[t2DTsfInfo.shape()[0] - 1] = axTSInfo;
391 }
392 }
393 //for(unsigned iTrack = 0; iTrack < t2DInfo.size(); iTrack++)
394 //{
395 // cout<<"iTrack: "<<iTrack<<" charge:"<<t2DInfo[iTrack][0]<<" rho: "<<t2DInfo[iTrack][1]<<" phi0: "<<t2DInfo[iTrack][2]<<endl;
396 // for(unsigned iAx = 0; iAx < t2DTsfInfo[iTrack].size(); iAx++)
397 // {
398 // cout<<" iAx: "<<iAx<<" id: "<<t2DTsfInfo[iTrack][iAx][0]<<" lr: "<<t2DTsfInfo[iTrack][iAx][2]<<endl;
399 // }
400 //}
401}

◆ filter3DData()

void filter3DData ( boost::multi_array< double, 3 > &  t3DFirmwareInfo,
boost::multi_array< double, 2 > &  t3DInfo 
)

filters t3DFirmwareInfo to t3DInfo

Definition at line 1547 of file TRGCDCT3DConverterModule.cc.

1549{
1550 for (unsigned iTrack = 0; iTrack < t3DFirmwareInfo.shape()[0]; iTrack++) {
1551 for (unsigned iClk = 0; iClk < t3DFirmwareInfo.shape()[1]; iClk++) {
1552 //cout<<iClk<<" 2d: "<<t3DFirmwareInfo[iTrack][iClk][0]<<" tsf: "<<t3DFirmwareInfo[iTrack][iClk][2]<<" evt: "<<t3DFirmwareInfo[iTrack][iClk][3]<<" isOld: "<<t3DFirmwareInfo[iTrack][iClk][1]<<endl;
1553 // 2DValid
1554 if (t3DFirmwareInfo[iTrack][iClk][0] == 0) continue;
1555 //cout<<iClk<<" 2d: "<<t3DFirmwareInfo[iTrack][iClk][0]<<" tsf: "<<t3DFirmwareInfo[iTrack][iClk][2]<<" evt: "<<t3DFirmwareInfo[iTrack][iClk][3]<<" isOld: "<<t3DFirmwareInfo[iTrack][iClk][1]<<endl;
1556 // TSFValid
1557//t3DFirmwareInfo[iTrack][iClk][0] (t3d_fnf) := t2d_fnf & TSFValid, so using t3d_fnf is alreay sufficient
1558// if (t3DFirmwareInfo[iTrack][iClk][2] == 0) continue;
1559 // EventTimeValid
1560// if (t3DFirmwareInfo[iTrack][iClk][3] == 0) continue;
1561 // TODO make an algorithm to follow the track.
1562 // Start follow status of track.
1563 //choose new tracks
1564// if (t3DInfo.size() != 0 && t3DFirmwareInfo[iTrack][iClk][1] == 1) continue;
1565 //if (t3DFirmwareInfo[iTrack][iClk][1] == 1) continue;
1566 double track3D_ref[7] = {t3DFirmwareInfo[iTrack][iClk][4], t3DFirmwareInfo[iTrack][iClk][5], t3DFirmwareInfo[iTrack][iClk][6], t3DFirmwareInfo[iTrack][iClk][7], t3DFirmwareInfo[iTrack][iClk][8], t3DFirmwareInfo[iTrack][iClk][9], t3DFirmwareInfo[iTrack][iClk][10]};
1567
1568 boost::multi_array_ref<double, 1> track3D((double*)track3D_ref, boost::extents[7]);
1569
1570 t3DInfo.resize(boost::extents[t3DInfo.shape()[0] + 1][7]);
1571 t3DInfo[t3DInfo.shape()[0] - 1] = track3D;
1572
1573 }
1574 }
1575}

◆ filterTSData()

void filterTSData ( boost::multi_array< double, 4 > &  tsfFirmwareInfo,
boost::multi_array< double, 3 > &  tsfInfo 
)

filters tsfFirmwareInfo to tsfInfo

Definition at line 301 of file TRGCDCT3DConverterModule.cc.

303{
304 // iSl is stereo SL index
305 for (unsigned iSL = 0; iSL < tsfFirmwareInfo.shape()[0]; iSL++) {
306 unsigned iTS_filter = 0;
307 for (unsigned iTS = 0; iTS < tsfFirmwareInfo.shape()[1]; iTS++) {
308 for (unsigned iClk = 0; iClk < tsfFirmwareInfo.shape()[2]; iClk++) {
309 double id = tsfFirmwareInfo[iSL][iTS][iClk][0];
310 double rt = tsfFirmwareInfo[iSL][iTS][iClk][1];
311 double lr = tsfFirmwareInfo[iSL][iTS][iClk][2];
312 double pr = tsfFirmwareInfo[iSL][iTS][iClk][3];
313 double ft = tsfFirmwareInfo[iSL][iTS][iClk][4];
314
315 if (pr != 0) {
316 double ts_ref[5] = {id, rt, lr, pr, ft};
317 boost::multi_array_ref<double, 1> ts((double*)ts_ref, boost::extents[5]);
318 tsfInfo.resize(boost::extents[4][tsfInfo.shape()[1] + 1][5]);
319 tsfInfo[iSL][iTS_filter++] = ts;
320 }
321
322 }
323 }
324 }
325}

◆ getAfterConditionPath()

Module::EAfterConditionPath getAfterConditionPath ( ) const
inherited

What to do after the conditional path is finished.

(defaults to c_End if no condition is set)

Definition at line 133 of file Module.cc.

134{
135 if (m_conditions.empty()) return EAfterConditionPath::c_End;
136
137 //okay, a condition was set for this Module...
138 if (!m_hasReturnValue) {
139 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
140 }
141
142 for (const auto& condition : m_conditions) {
143 if (condition.evaluate(m_returnValue)) {
144 return condition.getAfterConditionPath();
145 }
146 }
147
148 return EAfterConditionPath::c_End;
149}

◆ getAllConditionPaths()

std::vector< std::shared_ptr< Path > > getAllConditionPaths ( ) const
inherited

Return all condition paths currently set (no matter if the condition is true or not).

Definition at line 150 of file Module.cc.

151{
152 std::vector<std::shared_ptr<Path>> allConditionPaths;
153 for (const auto& condition : m_conditions) {
154 allConditionPaths.push_back(condition.getPath());
155 }
156
157 return allConditionPaths;
158}

◆ getAllConditions()

const std::vector< ModuleCondition > & getAllConditions ( ) const
inlineinherited

Return all set conditions for this module.

Definition at line 323 of file Module.h.

324 {
325 return m_conditions;
326 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

Return a pointer to the first condition (or nullptr, if none was set)

Definition at line 313 of file Module.h.

314 {
315 if (m_conditions.empty()) {
316 return nullptr;
317 } else {
318 return &m_conditions.front();
319 }
320 }

◆ getConditionPath()

std::shared_ptr< Path > getConditionPath ( ) const
inherited

Returns the path of the last true condition (if there is at least one, else reaturn a null pointer).


Definition at line 113 of file Module.cc.

114{
115 PathPtr p;
116 if (m_conditions.empty()) return p;
117
118 //okay, a condition was set for this Module...
119 if (!m_hasReturnValue) {
120 B2FATAL("A condition was set for '" << getName() << "', but the module did not set a return value!");
121 }
122
123 for (const auto& condition : m_conditions) {
124 if (condition.evaluate(m_returnValue)) {
125 return condition.getPath();
126 }
127 }
128
129 // if none of the conditions were true, return a null pointer.
130 return p;
131}
std::shared_ptr< Path > PathPtr
Defines a pointer to a path object as a boost shared pointer.
Definition: Path.h:35

◆ getDescription()

const std::string & getDescription ( ) const
inlineinherited

Returns the description of the module.

Definition at line 201 of file Module.h.

201{return m_description;}
std::string m_description
The description of the module.
Definition: Module.h:510

◆ getFileNames()

virtual std::vector< std::string > getFileNames ( bool  outputFiles)
inlinevirtualinherited

Return a list of output filenames for this modules.

This will be called when basf2 is run with "--dry-run" if the module has set either the c_Input or c_Output properties.

If the parameter outputFiles is false (for modules with c_Input) the list of input filenames should be returned (if any). If outputFiles is true (for modules with c_Output) the list of output files should be returned (if any).

If a module has sat both properties this member is called twice, once for each property.

The module should return the actual list of requested input or produced output filenames (including handling of input/output overrides) so that the grid system can handle input/output files correctly.

This function should return the same value when called multiple times. This is especially important when taking the input/output overrides from Environment as they get consumed when obtained so the finalized list of output files should be stored for subsequent calls.

Reimplemented in RootInputModule, StorageRootOutputModule, and RootOutputModule.

Definition at line 133 of file Module.h.

134 {
135 return std::vector<std::string>();
136 }

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 224 of file Module.h.

224{return m_logConfig;}

◆ getModules()

std::list< ModulePtr > getModules ( ) const
inlineoverrideprivatevirtualinherited

no submodules, return empty list

Implements PathElement.

Definition at line 505 of file Module.h.

505{ return std::list<ModulePtr>(); }

◆ getName()

const std::string & getName ( ) const
inlineinherited

Returns the name of the module.

This can be changed via e.g. set_name() in the steering file to give more useful names if there is more than one module of the same type.

For identifying the type of a module, using getType() (or type() in Python) is recommended.

Definition at line 186 of file Module.h.

186{return m_name;}
std::string m_name
The name of the module, saved as a string (user-modifiable)
Definition: Module.h:507

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 196 of file Module.h.

196{return m_package;}

◆ getParamInfoListPython()

std::shared_ptr< boost::python::list > getParamInfoListPython ( ) const
inherited

Returns a python list of all parameters.

Each item in the list consists of the name of the parameter, a string describing its type, a python list of all default values and the description of the parameter.

Returns
A python list containing the parameters of this parameter list.

Definition at line 279 of file Module.cc.

280{
282}
std::shared_ptr< boost::python::list > getParamInfoListPython() const
Returns a python list of all parameters.
ModuleParamList m_moduleParamList
List storing and managing all parameter of the module.
Definition: Module.h:515

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 362 of file Module.h.

362{ return m_moduleParamList; }

◆ getPathString()

std::string getPathString ( ) const
overrideprivatevirtualinherited

return the module name.

Implements PathElement.

Definition at line 192 of file Module.cc.

193{
194
195 std::string output = getName();
196
197 for (const auto& condition : m_conditions) {
198 output += condition.getString();
199 }
200
201 return output;
202}

◆ getReturnValue()

int getReturnValue ( ) const
inlineinherited

Return the return value set by this module.

This value is only meaningful if hasReturnValue() is true

Definition at line 380 of file Module.h.

380{ return m_returnValue; }

◆ getType()

const std::string & getType ( ) const
inherited

Returns the type of the module (i.e.

class name minus 'Module')

Definition at line 41 of file Module.cc.

42{
43 if (m_type.empty())
44 B2FATAL("Module type not set for " << getName());
45 return m_type;
46}
std::string m_type
The type of the module, saved as a string.
Definition: Module.h:508

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

Returns true if at least one condition was set for the module.

Definition at line 310 of file Module.h.

310{ return not m_conditions.empty(); };

◆ hasProperties()

bool hasProperties ( unsigned int  propertyFlags) const
inherited

Returns true if all specified property flags are available in this module.

Parameters
propertyFlagsOred EModulePropFlags which should be compared with the module flags.

Definition at line 160 of file Module.cc.

161{
162 return (propertyFlags & m_propertyFlags) == propertyFlags;
163}

◆ hasReturnValue()

bool hasReturnValue ( ) const
inlineinherited

Return true if this module has a valid return value set.

Definition at line 377 of file Module.h.

377{ return m_hasReturnValue; }

◆ hasUnsetForcedParams()

bool hasUnsetForcedParams ( ) const
inherited

Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.

Definition at line 166 of file Module.cc.

167{
169 std::string allMissing = "";
170 for (const auto& s : missing)
171 allMissing += s + " ";
172 if (!missing.empty())
173 B2ERROR("The following required parameters of Module '" << getName() << "' were not specified: " << allMissing <<
174 "\nPlease add them to your steering file.");
175 return !missing.empty();
176}
std::vector< std::string > getUnsetForcedParams() const
Returns list of unset parameters (if they are required to have a value.

◆ if_false()

void if_false ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression "<1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is false.
afterConditionPathWhat to do after executing 'path'.

Definition at line 85 of file Module.cc.

86{
87 if_value("<1", path, afterConditionPath);
88}

◆ if_true()

void if_true ( const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

A simplified version to set the condition of the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

It is equivalent to the if_value() method, using the expression ">=1". This method is meant to be used together with the setReturnValue(bool value) method.

Parameters
pathShared pointer to the Path which will be executed if the return value is true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 90 of file Module.cc.

91{
92 if_value(">=1", path, afterConditionPath);
93}

◆ if_value()

void if_value ( const std::string &  expression,
const std::shared_ptr< Path > &  path,
EAfterConditionPath  afterConditionPath = EAfterConditionPath::c_End 
)
inherited

Add a condition to the module.

Please note that successive calls of this function will add more than one condition to the module. If more than one condition results in true, only the last of them will be used.

See https://xwiki.desy.de/xwiki/rest/p/a94f2 or ModuleCondition for a description of the syntax.

Please be careful: Avoid creating cyclic paths, e.g. by linking a condition to a path which is processed before the path where this module is located in.

Parameters
expressionThe expression of the condition.
pathShared pointer to the Path which will be executed if the condition is evaluated to true.
afterConditionPathWhat to do after executing 'path'.

Definition at line 79 of file Module.cc.

80{
81 m_conditions.emplace_back(expression, path, afterConditionPath);
82}

◆ initialize()

void initialize ( void  )
overridevirtual

Initilizes TRGCDCT3DConverterModule.

Reimplemented from Module.

Definition at line 91 of file TRGCDCT3DConverterModule.cc.

92{
98
101
103}
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Definition: StoreArray.h:140
A class to hold common data for JSignals.
Definition: JSignalData.h:33

◆ setAbortLevel()

void setAbortLevel ( int  abortLevel)
inherited

Configure the abort log level.

Definition at line 67 of file Module.cc.

68{
69 m_logConfig.setAbortLevel(static_cast<LogConfig::ELogLevel>(abortLevel));
70}
ELogLevel
Definition of the supported log levels.
Definition: LogConfig.h:26
void setAbortLevel(ELogLevel abortLevel)
Configure the abort level.
Definition: LogConfig.h:112

◆ setDebugLevel()

void setDebugLevel ( int  debugLevel)
inherited

Configure the debug messaging level.

Definition at line 61 of file Module.cc.

62{
63 m_logConfig.setDebugLevel(debugLevel);
64}
void setDebugLevel(int debugLevel)
Configure the debug messaging level.
Definition: LogConfig.h:98

◆ setDescription()

void setDescription ( const std::string &  description)
protectedinherited

Sets the description of the module.

Parameters
descriptionA description of the module.

Definition at line 214 of file Module.cc.

215{
216 m_description = description;
217}

◆ setLogConfig()

void setLogConfig ( const LogConfig logConfig)
inlineinherited

Set the log system configuration.

Definition at line 229 of file Module.h.

229{m_logConfig = logConfig;}

◆ setLogInfo()

void setLogInfo ( int  logLevel,
unsigned int  logInfo 
)
inherited

Configure the printed log information for the given level.

Parameters
logLevelThe log level (one of LogConfig::ELogLevel)
logInfoWhat kind of info should be printed? ORed combination of LogConfig::ELogInfo flags.

Definition at line 73 of file Module.cc.

74{
75 m_logConfig.setLogInfo(static_cast<LogConfig::ELogLevel>(logLevel), logInfo);
76}
void setLogInfo(ELogLevel logLevel, unsigned int logInfo)
Configure the printed log information for the given level.
Definition: LogConfig.h:127

◆ setLogLevel()

void setLogLevel ( int  logLevel)
inherited

Configure the log level.

Definition at line 55 of file Module.cc.

56{
57 m_logConfig.setLogLevel(static_cast<LogConfig::ELogLevel>(logLevel));
58}
void setLogLevel(ELogLevel logLevel)
Configure the log level.
Definition: LogConfig.cc:25

◆ setName()

void setName ( const std::string &  name)
inlineinherited

Set the name of the module.

Note
The module name is set when using the REG_MODULE macro, but the module can be renamed before calling process() using the set_name() function in your steering file.
Parameters
nameThe name of the module

Definition at line 213 of file Module.h.

213{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 500 of file Module.h.

500{ m_moduleParamList = params; }

◆ setParamPython()

void setParamPython ( const std::string &  name,
const boost::python::object &  pyObj 
)
privateinherited

Implements a method for setting boost::python objects.

The method supports the following types: list, dict, int, double, string, bool The conversion of the python object to the C++ type and the final storage of the parameter value is done in the ModuleParam class.

Parameters
nameThe unique name of the parameter.
pyObjThe object which should be converted and stored as the parameter value.

Definition at line 234 of file Module.cc.

235{
236 LogSystem& logSystem = LogSystem::Instance();
237 logSystem.updateModule(&(getLogConfig()), getName());
238 try {
240 } catch (std::runtime_error& e) {
241 throw std::runtime_error("Cannot set parameter '" + name + "' for module '"
242 + m_name + "': " + e.what());
243 }
244
245 logSystem.updateModule(nullptr);
246}
Class for logging debug, info and error messages.
Definition: LogSystem.h:46
void updateModule(const LogConfig *moduleLogConfig=nullptr, const std::string &moduleName="")
Sets the log configuration to the given module log configuration and sets the module name This method...
Definition: LogSystem.h:191
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition: LogSystem.cc:31
void setParamPython(const std::string &name, const PythonObject &pyObj)
Implements a method for setting boost::python objects.

◆ setParamPythonDict()

void setParamPythonDict ( const boost::python::dict &  dictionary)
privateinherited

Implements a method for reading the parameter values from a boost::python dictionary.

The key of the dictionary has to be the name of the parameter and the value has to be of one of the supported parameter types.

Parameters
dictionaryThe python dictionary from which the parameter values are read.

Definition at line 249 of file Module.cc.

250{
251
252 LogSystem& logSystem = LogSystem::Instance();
253 logSystem.updateModule(&(getLogConfig()), getName());
254
255 boost::python::list dictKeys = dictionary.keys();
256 int nKey = boost::python::len(dictKeys);
257
258 //Loop over all keys in the dictionary
259 for (int iKey = 0; iKey < nKey; ++iKey) {
260 boost::python::object currKey = dictKeys[iKey];
261 boost::python::extract<std::string> keyProxy(currKey);
262
263 if (keyProxy.check()) {
264 const boost::python::object& currValue = dictionary[currKey];
265 setParamPython(keyProxy, currValue);
266 } else {
267 B2ERROR("Setting the module parameters from a python dictionary: invalid key in dictionary!");
268 }
269 }
270
271 logSystem.updateModule(nullptr);
272}
void setParamPython(const std::string &name, const boost::python::object &pyObj)
Implements a method for setting boost::python objects.
Definition: Module.cc:234

◆ setPropertyFlags()

void setPropertyFlags ( unsigned int  propertyFlags)
inherited

Sets the flags for the module properties.

Parameters
propertyFlagsbitwise OR of EModulePropFlags

Definition at line 208 of file Module.cc.

209{
210 m_propertyFlags = propertyFlags;
211}

◆ setReturnValue() [1/2]

void setReturnValue ( bool  value)
protectedinherited

Sets the return value for this module as bool.

The bool value is saved as an integer with the convention 1 meaning true and 0 meaning false. The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 227 of file Module.cc.

228{
229 m_hasReturnValue = true;
230 m_returnValue = value;
231}

◆ setReturnValue() [2/2]

void setReturnValue ( int  value)
protectedinherited

Sets the return value for this module as integer.

The value can be used in the steering file to divide the analysis chain into several paths.

Parameters
valueThe value of the return value.

Definition at line 220 of file Module.cc.

221{
222 m_hasReturnValue = true;
223 m_returnValue = value;
224}

◆ setType()

void setType ( const std::string &  type)
protectedinherited

Set the module type.

Only for use by internal modules (which don't use the normal REG_MODULE mechanism).

Definition at line 48 of file Module.cc.

49{
50 if (!m_type.empty())
51 B2FATAL("Trying to change module type from " << m_type << " is not allowed, the value is assumed to be fixed.");
52 m_type = type;
53}

◆ store2DFirmwareData()

void store2DFirmwareData ( boost::multi_array< double, 3 > &  t2DFirmwareInfo,
boost::multi_array< double, 4 > &  axTsfFirmwareInfo 
)

converts firmwareResults of 2D to a vector

Definition at line 853 of file TRGCDCT3DConverterModule.cc.

855{
856
857 for (int iClk = 0; iClk < m_firmwareResults.getEntries(); iClk++) {
859 bitset<6> t2d_fnf(int(result->m_t2d_fnf));
860 bitset<6> t2d_oldfnf(int(result->m_t3d_2doldtrk));
861 //cout<<"iclk:"<<iClk<<" fnf:"<<result->m_t2d_fnf<<" "<<t2d_fnf<<" "<<t2d_fnf[5]<<endl;
862 //cout<<"iClk:"<<iClk<<" t2d_fnf:"<<m_firmwareResults[iClk]->m_t2d_fnf<<endl;
863
864 t2DFirmwareInfo[0][iClk][0] = t2d_fnf[5];
865 t2DFirmwareInfo[0][iClk][1] = t2d_oldfnf[5];;
866 t2DFirmwareInfo[0][iClk][2] = result->m_t2d0_charge;
867 t2DFirmwareInfo[0][iClk][3] = result->m_t2d0_rho_s;
868 t2DFirmwareInfo[0][iClk][4] = result->m_t2d0_phi;
869
870 t2DFirmwareInfo[1][iClk][0] = t2d_fnf[4];
871 t2DFirmwareInfo[1][iClk][1] = t2d_oldfnf[4];;
872 t2DFirmwareInfo[1][iClk][2] = result->m_t2d1_charge;
873 t2DFirmwareInfo[1][iClk][3] = result->m_t2d1_rho_s;
874 t2DFirmwareInfo[1][iClk][4] = result->m_t2d1_phi;
875
876 t2DFirmwareInfo[2][iClk][0] = t2d_fnf[3];
877 t2DFirmwareInfo[2][iClk][1] = t2d_oldfnf[3];;
878 t2DFirmwareInfo[2][iClk][2] = result->m_t2d2_charge;
879 t2DFirmwareInfo[2][iClk][3] = result->m_t2d2_rho_s;
880 t2DFirmwareInfo[2][iClk][4] = result->m_t2d2_phi;
881
882 t2DFirmwareInfo[3][iClk][0] = t2d_fnf[2];
883 t2DFirmwareInfo[3][iClk][1] = t2d_oldfnf[2];;
884 t2DFirmwareInfo[3][iClk][2] = result->m_t2d3_charge;
885 t2DFirmwareInfo[3][iClk][3] = result->m_t2d3_rho_s;
886 t2DFirmwareInfo[3][iClk][4] = result->m_t2d3_phi;
887
888 t2DTsfFirmwareInfo[0][iClk][0][0] = result->m_t2d0ts0_id;
889 t2DTsfFirmwareInfo[0][iClk][0][1] = result->m_t2d0ts0_rt;
890 t2DTsfFirmwareInfo[0][iClk][0][2] = result->m_t2d0ts0_lr;
891 t2DTsfFirmwareInfo[0][iClk][0][3] = result->m_t2d0ts0_pr;
892 t2DTsfFirmwareInfo[0][iClk][1][0] = result->m_t2d0ts2_id;
893 t2DTsfFirmwareInfo[0][iClk][1][1] = result->m_t2d0ts2_rt;
894 t2DTsfFirmwareInfo[0][iClk][1][2] = result->m_t2d0ts2_lr;
895 t2DTsfFirmwareInfo[0][iClk][1][3] = result->m_t2d0ts2_pr;
896 t2DTsfFirmwareInfo[0][iClk][2][0] = result->m_t2d0ts4_id;
897 t2DTsfFirmwareInfo[0][iClk][2][1] = result->m_t2d0ts4_rt;
898 t2DTsfFirmwareInfo[0][iClk][2][2] = result->m_t2d0ts4_lr;
899 t2DTsfFirmwareInfo[0][iClk][2][3] = result->m_t2d0ts4_pr;
900 t2DTsfFirmwareInfo[0][iClk][3][0] = result->m_t2d0ts6_id;
901 t2DTsfFirmwareInfo[0][iClk][3][1] = result->m_t2d0ts6_rt;
902 t2DTsfFirmwareInfo[0][iClk][3][2] = result->m_t2d0ts6_lr;
903 t2DTsfFirmwareInfo[0][iClk][3][3] = result->m_t2d0ts6_pr;
904 t2DTsfFirmwareInfo[0][iClk][4][0] = result->m_t2d0ts8_id;
905 t2DTsfFirmwareInfo[0][iClk][4][1] = result->m_t2d0ts8_rt;
906 t2DTsfFirmwareInfo[0][iClk][4][2] = result->m_t2d0ts8_lr;
907 t2DTsfFirmwareInfo[0][iClk][4][3] = result->m_t2d0ts8_pr;
908
909 t2DTsfFirmwareInfo[1][iClk][0][0] = result->m_t2d1ts0_id;
910 t2DTsfFirmwareInfo[1][iClk][0][1] = result->m_t2d1ts0_rt;
911 t2DTsfFirmwareInfo[1][iClk][0][2] = result->m_t2d1ts0_lr;
912 t2DTsfFirmwareInfo[1][iClk][0][3] = result->m_t2d1ts0_pr;
913 t2DTsfFirmwareInfo[1][iClk][1][0] = result->m_t2d1ts2_id;
914 t2DTsfFirmwareInfo[1][iClk][1][1] = result->m_t2d1ts2_rt;
915 t2DTsfFirmwareInfo[1][iClk][1][2] = result->m_t2d1ts2_lr;
916 t2DTsfFirmwareInfo[1][iClk][1][3] = result->m_t2d1ts2_pr;
917 t2DTsfFirmwareInfo[1][iClk][2][0] = result->m_t2d1ts4_id;
918 t2DTsfFirmwareInfo[1][iClk][2][1] = result->m_t2d1ts4_rt;
919 t2DTsfFirmwareInfo[1][iClk][2][2] = result->m_t2d1ts4_lr;
920 t2DTsfFirmwareInfo[1][iClk][2][3] = result->m_t2d1ts4_pr;
921 t2DTsfFirmwareInfo[1][iClk][3][0] = result->m_t2d1ts6_id;
922 t2DTsfFirmwareInfo[1][iClk][3][1] = result->m_t2d1ts6_rt;
923 t2DTsfFirmwareInfo[1][iClk][3][2] = result->m_t2d1ts6_lr;
924 t2DTsfFirmwareInfo[1][iClk][3][3] = result->m_t2d1ts6_pr;
925 t2DTsfFirmwareInfo[1][iClk][4][0] = result->m_t2d1ts8_id;
926 t2DTsfFirmwareInfo[1][iClk][4][1] = result->m_t2d1ts8_rt;
927 t2DTsfFirmwareInfo[1][iClk][4][2] = result->m_t2d1ts8_lr;
928 t2DTsfFirmwareInfo[1][iClk][4][3] = result->m_t2d1ts8_pr;
929
930 t2DTsfFirmwareInfo[2][iClk][0][0] = result->m_t2d2ts0_id;
931 t2DTsfFirmwareInfo[2][iClk][0][1] = result->m_t2d2ts0_rt;
932 t2DTsfFirmwareInfo[2][iClk][0][2] = result->m_t2d2ts0_lr;
933 t2DTsfFirmwareInfo[2][iClk][0][3] = result->m_t2d2ts0_pr;
934 t2DTsfFirmwareInfo[2][iClk][1][0] = result->m_t2d2ts2_id;
935 t2DTsfFirmwareInfo[2][iClk][1][1] = result->m_t2d2ts2_rt;
936 t2DTsfFirmwareInfo[2][iClk][1][2] = result->m_t2d2ts2_lr;
937 t2DTsfFirmwareInfo[2][iClk][1][3] = result->m_t2d2ts2_pr;
938 t2DTsfFirmwareInfo[2][iClk][2][0] = result->m_t2d2ts4_id;
939 t2DTsfFirmwareInfo[2][iClk][2][1] = result->m_t2d2ts4_rt;
940 t2DTsfFirmwareInfo[2][iClk][2][2] = result->m_t2d2ts4_lr;
941 t2DTsfFirmwareInfo[2][iClk][2][3] = result->m_t2d2ts4_pr;
942 t2DTsfFirmwareInfo[2][iClk][3][0] = result->m_t2d2ts6_id;
943 t2DTsfFirmwareInfo[2][iClk][3][1] = result->m_t2d2ts6_rt;
944 t2DTsfFirmwareInfo[2][iClk][3][2] = result->m_t2d2ts6_lr;
945 t2DTsfFirmwareInfo[2][iClk][3][3] = result->m_t2d2ts6_pr;
946 t2DTsfFirmwareInfo[2][iClk][4][0] = result->m_t2d2ts8_id;
947 t2DTsfFirmwareInfo[2][iClk][4][1] = result->m_t2d2ts8_rt;
948 t2DTsfFirmwareInfo[2][iClk][4][2] = result->m_t2d2ts8_lr;
949 t2DTsfFirmwareInfo[2][iClk][4][3] = result->m_t2d2ts8_pr;
950
951 t2DTsfFirmwareInfo[3][iClk][0][0] = result->m_t2d3ts0_id;
952 t2DTsfFirmwareInfo[3][iClk][0][1] = result->m_t2d3ts0_rt;
953 t2DTsfFirmwareInfo[3][iClk][0][2] = result->m_t2d3ts0_lr;
954 t2DTsfFirmwareInfo[3][iClk][0][3] = result->m_t2d3ts0_pr;
955 t2DTsfFirmwareInfo[3][iClk][1][0] = result->m_t2d3ts2_id;
956 t2DTsfFirmwareInfo[3][iClk][1][1] = result->m_t2d3ts2_rt;
957 t2DTsfFirmwareInfo[3][iClk][1][2] = result->m_t2d3ts2_lr;
958 t2DTsfFirmwareInfo[3][iClk][1][3] = result->m_t2d3ts2_pr;
959 t2DTsfFirmwareInfo[3][iClk][2][0] = result->m_t2d3ts4_id;
960 t2DTsfFirmwareInfo[3][iClk][2][1] = result->m_t2d3ts4_rt;
961 t2DTsfFirmwareInfo[3][iClk][2][2] = result->m_t2d3ts4_lr;
962 t2DTsfFirmwareInfo[3][iClk][2][3] = result->m_t2d3ts4_pr;
963 t2DTsfFirmwareInfo[3][iClk][3][0] = result->m_t2d3ts6_id;
964 t2DTsfFirmwareInfo[3][iClk][3][1] = result->m_t2d3ts6_rt;
965 t2DTsfFirmwareInfo[3][iClk][3][2] = result->m_t2d3ts6_lr;
966 t2DTsfFirmwareInfo[3][iClk][3][3] = result->m_t2d3ts6_pr;
967 t2DTsfFirmwareInfo[3][iClk][4][0] = result->m_t2d3ts8_id;
968 t2DTsfFirmwareInfo[3][iClk][4][1] = result->m_t2d3ts8_rt;
969 t2DTsfFirmwareInfo[3][iClk][4][2] = result->m_t2d3ts8_lr;
970 t2DTsfFirmwareInfo[3][iClk][4][3] = result->m_t2d3ts8_pr;
971 }
972}

◆ store3DFastSimData()

void store3DFastSimData ( boost::multi_array< double, 3 > &  t3DFirmwareInfo)

uses fast sim with debug

Definition at line 1044 of file TRGCDCT3DConverterModule.cc.

1045{
1046
1047 for (int iClk = 0; iClk < m_firmwareResults.getEntries() - 17 - 1; iClk++) {
1048
1050 TRGCDCT3DUnpackerStore* result3D = m_firmwareResults[iClk + 17];
1051 TRGCDCT3DUnpackerStore* resultDebug = m_firmwareResults[iClk + 4];
1052
1053 if (bitset<6> (result->m_t2d_fnf)[5] == 0) continue;
1054
1055 // Store information(charge, radius(cm), phi_c(rad), eventTime, eventTimeValid, [TS ID, TS LR, TS driftTime])
1056 // [TODO] Is evtTime clock correct?
1057 int charge = resultDebug->m_t3dtrk0_charge == 2 ? -1 : 1;
1058 double radius = resultDebug->m_t3dtrk0_rho * 2500 / (pow(2, 11) - 0.5);
1059 double phi_c = toSigned(resultDebug->m_t3dtrk0_phi0, 13) * M_PI / (pow(2, 12) - 0.5);
1060 int eventTime = result3D->m_t3dtrk0_evtTime_delay;
1061 int eventTimeValid = result3D->m_t3dtrk0_evtTimeValid_delay;
1062 // rawStTSs[iSt] = [TS ID, TS LR, TS driftTime]
1063 vector<vector<int> > rawStTSs(4, vector<int> (3));
1064 rawStTSs[0][0] = resultDebug->m_t3dtrk0ts0_id;
1065 rawStTSs[0][1] = resultDebug->m_t3dtrk0ts0_lr;
1066 rawStTSs[0][2] = resultDebug->m_t3dtrk0ts0_rt;
1067 rawStTSs[1][0] = resultDebug->m_t3dtrk0ts1_id;
1068 rawStTSs[1][1] = resultDebug->m_t3dtrk0ts1_lr;
1069 rawStTSs[1][2] = resultDebug->m_t3dtrk0ts1_rt;
1070 rawStTSs[2][0] = resultDebug->m_t3dtrk0ts2_id;
1071 rawStTSs[2][1] = resultDebug->m_t3dtrk0ts2_lr;
1072 rawStTSs[2][2] = resultDebug->m_t3dtrk0ts2_rt;
1073 rawStTSs[3][0] = resultDebug->m_t3dtrk0ts3_id;
1074 rawStTSs[3][1] = resultDebug->m_t3dtrk0ts3_lr;
1075 rawStTSs[3][2] = resultDebug->m_t3dtrk0ts3_rt;
1076
1077 // Get geometry
1078 map<string, vector<double> > stGeometry;
1079 vector<vector<double> > stXts;
1081 TRGCDCFitter3D::getStereoXt(stGeometry["priorityLayer"], stXts);
1082
1083 double z0 = 0, cot = 0, chi2 = 0;
1084 Fitter3DUtility::fitter3D(stGeometry, stXts, eventTimeValid, eventTime, rawStTSs, charge, radius, phi_c, z0, cot, chi2);
1085
1086 bitset<6> t2d_fnf(int(result3D->m_t3d_2dfnf));
1087 bitset<4> tsf_fnf(int(result3D->m_t3d_validTS));
1088 bitset<6> t2d_oldfnf(int(result->m_t3d_2doldtrk));
1089
1090 //cout<<iClk<<" "<<t2d_fnf<<" "<<t2d_oldfnf<<endl;
1091
1092 t3DFirmwareInfo[0][iClk][0] = t2d_fnf[5];
1093 t3DFirmwareInfo[0][iClk][1] = t2d_oldfnf[5];
1094 t3DFirmwareInfo[0][iClk][2] = tsf_fnf[3];
1095
1096 t3DFirmwareInfo[0][iClk][3] = result3D->m_t3dtrk0_evtTimeValid_delay;
1097 t3DFirmwareInfo[0][iClk][4] = result3D->m_t3dtrk0_evtTime_delay;
1098 t3DFirmwareInfo[0][iClk][5] = charge;
1099 t3DFirmwareInfo[0][iClk][6] = radius;
1100 t3DFirmwareInfo[0][iClk][7] = phi_c;
1101 t3DFirmwareInfo[0][iClk][8] = z0;
1102 t3DFirmwareInfo[0][iClk][9] = cot;
1103 t3DFirmwareInfo[0][iClk][10] = chi2;
1104 }
1105}

◆ store3DFirmSimData()

void store3DFirmSimData ( boost::multi_array< double, 3 > &  t3DFirmwareInfo)

uses firm sim with debug

Definition at line 1108 of file TRGCDCT3DConverterModule.cc.

1109{
1110 for (int iClk = 0; iClk < m_firmwareResults.getEntries() - 17 - 1; iClk++) {
1111
1113 TRGCDCT3DUnpackerStore* result3D = m_firmwareResults[iClk + 17];
1114 TRGCDCT3DUnpackerStore* resultDebug = m_firmwareResults[iClk + 4];
1115
1116 if (bitset<6> (result->m_t2d_fnf)[5] == 0) continue;
1117
1118 // Store information(charge, radius(cm), phi_c(rad), eventTime, eventTimeValid, [TS ID, TS LR, TS driftTime])
1119 // [TODO] Is evtTime clock correct?
1120 int charge = resultDebug->m_t3dtrk0_charge == 2 ? -1 : 1;
1121 double radius = resultDebug->m_t3dtrk0_rho * 2500 / (pow(2, 11) - 0.5);
1122 double phi_c = toSigned(resultDebug->m_t3dtrk0_phi0, 13) * M_PI / (pow(2, 12) - 0.5);
1123 int eventTime = result3D->m_t3dtrk0_evtTime_delay;
1124 int eventTimeValid = result3D->m_t3dtrk0_evtTimeValid_delay;
1125 // rawStTSs[iSt] = [TS ID, TS LR, TS driftTime]
1126 vector<vector<int> > rawStTSs(4, vector<int> (3));
1127 rawStTSs[0][0] = resultDebug->m_t3dtrk0ts0_id;
1128 rawStTSs[0][1] = resultDebug->m_t3dtrk0ts0_lr;
1129 rawStTSs[0][2] = resultDebug->m_t3dtrk0ts0_rt;
1130 rawStTSs[1][0] = resultDebug->m_t3dtrk0ts1_id;
1131 rawStTSs[1][1] = resultDebug->m_t3dtrk0ts1_lr;
1132 rawStTSs[1][2] = resultDebug->m_t3dtrk0ts1_rt;
1133 rawStTSs[2][0] = resultDebug->m_t3dtrk0ts2_id;
1134 rawStTSs[2][1] = resultDebug->m_t3dtrk0ts2_lr;
1135 rawStTSs[2][2] = resultDebug->m_t3dtrk0ts2_rt;
1136 rawStTSs[3][0] = resultDebug->m_t3dtrk0ts3_id;
1137 rawStTSs[3][1] = resultDebug->m_t3dtrk0ts3_lr;
1138 rawStTSs[3][2] = resultDebug->m_t3dtrk0ts3_rt;
1139
1140 // Get geometry
1141 map<string, vector<double> > stGeometry;
1142 vector<vector<double> > stXts;
1144 TRGCDCFitter3D::getStereoXt(stGeometry["priorityLayer"], stXts);
1145
1146 // Prepare complex fit3D
1147 map<string, vector<double> > mConstV;
1148 map<string, double> mConstD;
1149 TRGCDCFitter3D::getConstants(mConstD, mConstV);
1150 Fitter3DUtility::fitter3DFirm(mConstD, mConstV, eventTimeValid, eventTime, rawStTSs, charge, radius, phi_c, m_commonData,
1152 double z0 = m_mSignalStorage["z0_r"].getRealInt();
1153 double cot = m_mSignalStorage["cot_r"].getRealInt();
1154 double chi2 = m_mSignalStorage["zChi2_r"].getRealInt();
1155
1156 bitset<6> t2d_fnf(int(result3D->m_t3d_2dfnf));
1157 bitset<4> tsf_fnf(int(result3D->m_t3d_validTS));
1158 bitset<6> t2d_oldfnf(int(result->m_t3d_2doldtrk));
1159
1160 //cout<<iClk<<" "<<t2d_fnf<<" "<<t2d_oldfnf<<endl;
1161
1162 t3DFirmwareInfo[0][iClk][0] = t2d_fnf[5];
1163 t3DFirmwareInfo[0][iClk][1] = t2d_oldfnf[5];
1164 t3DFirmwareInfo[0][iClk][2] = tsf_fnf[3];
1165
1166 t3DFirmwareInfo[0][iClk][3] = result3D->m_t3dtrk0_evtTimeValid_delay;
1167 t3DFirmwareInfo[0][iClk][4] = result3D->m_t3dtrk0_evtTime_delay;
1168 t3DFirmwareInfo[0][iClk][5] = charge;
1169 t3DFirmwareInfo[0][iClk][6] = radius;
1170 t3DFirmwareInfo[0][iClk][7] = phi_c;
1171 t3DFirmwareInfo[0][iClk][8] = z0;
1172 t3DFirmwareInfo[0][iClk][9] = cot;
1173 t3DFirmwareInfo[0][iClk][10] = chi2;
1174 }
1175}

◆ store3DFirmwareData()

void store3DFirmwareData ( boost::multi_array< double, 3 > &  t3DFirmwareInfo)

converts firmwareResults of 3D to a vector

Definition at line 976 of file TRGCDCT3DConverterModule.cc.

977{
978
979 for (int iClk = 0; iClk < m_firmwareResults.getEntries() - 17 - 1; iClk++) {
981 TRGCDCT3DUnpackerStore* result3D = m_firmwareResults[iClk + 17];
982
983 bitset<6> t3d_fnf(int(result3D->m_t3d_2dfnf));
984 bitset<4> tsf_fnf(int(result3D->m_t3d_validTS));
985 bitset<6> t3d_oldfnf(int(result->m_t3d_2doldtrk));
986
987 //cout<<iClk<<" "<<t3d_fnf<<" "<<t3d_oldfnf<<endl;
988
989//The evtTime information was for debugging, but the currnet firmware doese not output the evtTime information corresponding to every track.
990
991 t3DFirmwareInfo[0][iClk][0] = t3d_fnf[5];
992 t3DFirmwareInfo[0][iClk][1] = t3d_oldfnf[5];
993 t3DFirmwareInfo[0][iClk][2] = tsf_fnf[0];
994// t3DFirmwareInfo[0][iClk][3] = result3D->m_t3dtrk0_evtTimeValid_delay;
995// t3DFirmwareInfo[0][iClk][4] = result3D->m_t3dtrk0_evtTime_delay;
996 t3DFirmwareInfo[0][iClk][5] = result->m_t2d0_charge;
997 t3DFirmwareInfo[0][iClk][6] = result->m_t2d0_rho_s;
998 t3DFirmwareInfo[0][iClk][7] = result->m_t2d0_phi;
999 t3DFirmwareInfo[0][iClk][8] = result3D->m_t3dtrk0_z0_s;
1000 t3DFirmwareInfo[0][iClk][9] = result3D->m_t3dtrk0_cot_s;
1001 t3DFirmwareInfo[0][iClk][10] = result3D->m_t3dtrk0_zchisq;
1002
1003 t3DFirmwareInfo[1][iClk][0] = t3d_fnf[4];
1004 t3DFirmwareInfo[1][iClk][1] = t3d_oldfnf[4];
1005 t3DFirmwareInfo[1][iClk][2] = tsf_fnf[1];
1006// t3DFirmwareInfo[1][iClk][3] = result3D->m_t3dtrk1_evtTimeValid_delay;
1007// t3DFirmwareInfo[1][iClk][4] = result3D->m_t3dtrk1_evtTime_delay;
1008 t3DFirmwareInfo[1][iClk][5] = result->m_t2d1_charge;
1009 t3DFirmwareInfo[1][iClk][6] = result->m_t2d1_rho_s;
1010 t3DFirmwareInfo[1][iClk][7] = result->m_t2d1_phi;
1011 t3DFirmwareInfo[1][iClk][8] = result3D->m_t3dtrk1_z0_s;
1012 t3DFirmwareInfo[1][iClk][9] = result3D->m_t3dtrk1_cot_s;
1013 t3DFirmwareInfo[1][iClk][10] = result3D->m_t3dtrk1_zchisq;
1014
1015 t3DFirmwareInfo[2][iClk][0] = t3d_fnf[3];
1016 t3DFirmwareInfo[2][iClk][1] = t3d_oldfnf[3];
1017 t3DFirmwareInfo[2][iClk][2] = tsf_fnf[2];
1018// t3DFirmwareInfo[2][iClk][3] = result3D->m_t3dtrk2_evtTimeValid_delay;
1019// t3DFirmwareInfo[2][iClk][4] = result3D->m_t3dtrk2_evtTime_delay;
1020 t3DFirmwareInfo[2][iClk][5] = result->m_t2d2_charge;
1021 t3DFirmwareInfo[2][iClk][6] = result->m_t2d2_rho_s;
1022 t3DFirmwareInfo[2][iClk][7] = result->m_t2d2_phi;
1023 t3DFirmwareInfo[2][iClk][8] = result3D->m_t3dtrk2_z0_s;
1024 t3DFirmwareInfo[2][iClk][9] = result3D->m_t3dtrk2_cot_s;
1025 t3DFirmwareInfo[2][iClk][10] = result3D->m_t3dtrk2_zchisq;
1026
1027 t3DFirmwareInfo[3][iClk][0] = t3d_fnf[2];
1028 t3DFirmwareInfo[3][iClk][1] = t3d_oldfnf[2];
1029 t3DFirmwareInfo[3][iClk][2] = tsf_fnf[3];
1030// t3DFirmwareInfo[3][iClk][3] = result3D->m_t3dtrk3_evtTimeValid_delay;
1031// t3DFirmwareInfo[3][iClk][4] = result3D->m_t3dtrk3_evtTime_delay;
1032 t3DFirmwareInfo[3][iClk][5] = result->m_t2d3_charge;
1033 t3DFirmwareInfo[3][iClk][6] = result->m_t2d3_rho_s;
1034 t3DFirmwareInfo[3][iClk][7] = result->m_t2d3_phi;
1035 t3DFirmwareInfo[3][iClk][8] = result3D->m_t3dtrk3_z0_s;
1036 t3DFirmwareInfo[3][iClk][9] = result3D->m_t3dtrk3_cot_s;
1037 t3DFirmwareInfo[3][iClk][10] = result3D->m_t3dtrk3_zchisq;
1038
1039 }
1040
1041}

◆ storeTSFirmwareData()

void storeTSFirmwareData ( boost::multi_array< double, 4 > &  tsfInfo)

converts firmwareResults of TS to a vector

Definition at line 539 of file TRGCDCT3DConverterModule.cc.

540{
541 for (int iClk = 0; iClk < m_firmwareResults.getEntries(); iClk++) {
543 //cout<<"iClk:"<<iClk<<" tsf1_cc:"<<result->m_tsf1_cc<<" tsf1ts0_id:"<<result->m_tsf1ts0_id<<" tsf1ts0_rt:"<<result->m_tsf1ts0_rt<<" tsf1ts0_lr:"<<result->m_tsf1ts0_lr<<" tsf1ts0_pr:"<<result->m_tsf1ts0_pr<<endl;
544 tsfInfo[0][0][iClk][0] = result->m_tsf1ts0_id;
545 tsfInfo[0][0][iClk][1] = result->m_tsf1ts0_rt;
546 tsfInfo[0][0][iClk][2] = result->m_tsf1ts0_lr;
547 tsfInfo[0][0][iClk][3] = result->m_tsf1ts0_pr;
548 tsfInfo[0][0][iClk][4] = result->m_tsf1_cc;
549 tsfInfo[0][1][iClk][0] = result->m_tsf1ts1_id;
550 tsfInfo[0][1][iClk][1] = result->m_tsf1ts1_rt;
551 tsfInfo[0][1][iClk][2] = result->m_tsf1ts1_lr;
552 tsfInfo[0][1][iClk][3] = result->m_tsf1ts1_pr;
553 tsfInfo[0][1][iClk][4] = result->m_tsf1_cc;
554 tsfInfo[0][2][iClk][0] = result->m_tsf1ts2_id;
555 tsfInfo[0][2][iClk][1] = result->m_tsf1ts2_rt;
556 tsfInfo[0][2][iClk][2] = result->m_tsf1ts2_lr;
557 tsfInfo[0][2][iClk][3] = result->m_tsf1ts2_pr;
558 tsfInfo[0][2][iClk][4] = result->m_tsf1_cc;
559 tsfInfo[0][3][iClk][0] = result->m_tsf1ts3_id;
560 tsfInfo[0][3][iClk][1] = result->m_tsf1ts3_rt;
561 tsfInfo[0][3][iClk][2] = result->m_tsf1ts3_lr;
562 tsfInfo[0][3][iClk][3] = result->m_tsf1ts3_pr;
563 tsfInfo[0][3][iClk][4] = result->m_tsf1_cc;
564 tsfInfo[0][4][iClk][0] = result->m_tsf1ts4_id;
565 tsfInfo[0][4][iClk][1] = result->m_tsf1ts4_rt;
566 tsfInfo[0][4][iClk][2] = result->m_tsf1ts4_lr;
567 tsfInfo[0][4][iClk][3] = result->m_tsf1ts4_pr;
568 tsfInfo[0][4][iClk][4] = result->m_tsf1_cc;
569 tsfInfo[0][5][iClk][0] = result->m_tsf1ts5_id;
570 tsfInfo[0][5][iClk][1] = result->m_tsf1ts5_rt;
571 tsfInfo[0][5][iClk][2] = result->m_tsf1ts5_lr;
572 tsfInfo[0][5][iClk][3] = result->m_tsf1ts5_pr;
573 tsfInfo[0][5][iClk][4] = result->m_tsf1_cc;
574 tsfInfo[0][6][iClk][0] = result->m_tsf1ts6_id;
575 tsfInfo[0][6][iClk][1] = result->m_tsf1ts6_rt;
576 tsfInfo[0][6][iClk][2] = result->m_tsf1ts6_lr;
577 tsfInfo[0][6][iClk][3] = result->m_tsf1ts6_pr;
578 tsfInfo[0][6][iClk][4] = result->m_tsf1_cc;
579 tsfInfo[0][7][iClk][0] = result->m_tsf1ts7_id;
580 tsfInfo[0][7][iClk][1] = result->m_tsf1ts7_rt;
581 tsfInfo[0][7][iClk][2] = result->m_tsf1ts7_lr;
582 tsfInfo[0][7][iClk][3] = result->m_tsf1ts7_pr;
583 tsfInfo[0][7][iClk][4] = result->m_tsf1_cc;
584 tsfInfo[0][8][iClk][0] = result->m_tsf1ts8_id;
585 tsfInfo[0][8][iClk][1] = result->m_tsf1ts8_rt;
586 tsfInfo[0][8][iClk][2] = result->m_tsf1ts8_lr;
587 tsfInfo[0][8][iClk][3] = result->m_tsf1ts8_pr;
588 tsfInfo[0][8][iClk][4] = result->m_tsf1_cc;
589 tsfInfo[0][9][iClk][0] = result->m_tsf1ts9_id;
590 tsfInfo[0][9][iClk][1] = result->m_tsf1ts9_rt;
591 tsfInfo[0][9][iClk][2] = result->m_tsf1ts9_lr;
592 tsfInfo[0][9][iClk][3] = result->m_tsf1ts9_pr;
593 tsfInfo[0][9][iClk][4] = result->m_tsf1_cc;
594 tsfInfo[0][10][iClk][0] = result->m_tsf1ts10_id;
595 tsfInfo[0][10][iClk][1] = result->m_tsf1ts10_rt;
596 tsfInfo[0][10][iClk][2] = result->m_tsf1ts10_lr;
597 tsfInfo[0][10][iClk][3] = result->m_tsf1ts10_pr;
598 tsfInfo[0][10][iClk][4] = result->m_tsf1_cc;
599 tsfInfo[0][11][iClk][0] = result->m_tsf1ts11_id;
600 tsfInfo[0][11][iClk][1] = result->m_tsf1ts11_rt;
601 tsfInfo[0][11][iClk][2] = result->m_tsf1ts11_lr;
602 tsfInfo[0][11][iClk][3] = result->m_tsf1ts11_pr;
603 tsfInfo[0][11][iClk][4] = result->m_tsf1_cc;
604 tsfInfo[0][12][iClk][0] = result->m_tsf1ts12_id;
605 tsfInfo[0][12][iClk][1] = result->m_tsf1ts12_rt;
606 tsfInfo[0][12][iClk][2] = result->m_tsf1ts12_lr;
607 tsfInfo[0][12][iClk][3] = result->m_tsf1ts12_pr;
608 tsfInfo[0][12][iClk][4] = result->m_tsf1_cc;
609 tsfInfo[0][13][iClk][0] = result->m_tsf1ts13_id;
610 tsfInfo[0][13][iClk][1] = result->m_tsf1ts13_rt;
611 tsfInfo[0][13][iClk][2] = result->m_tsf1ts13_lr;
612 tsfInfo[0][13][iClk][3] = result->m_tsf1ts13_pr;
613 tsfInfo[0][13][iClk][4] = result->m_tsf1_cc;
614 tsfInfo[0][14][iClk][0] = result->m_tsf1ts14_id;
615 tsfInfo[0][14][iClk][1] = result->m_tsf1ts14_rt;
616 tsfInfo[0][14][iClk][2] = result->m_tsf1ts14_lr;
617 tsfInfo[0][14][iClk][3] = result->m_tsf1ts14_pr;
618 tsfInfo[0][14][iClk][4] = result->m_tsf1_cc;
619
620 tsfInfo[1][0][iClk][0] = result->m_tsf3ts0_id;
621 tsfInfo[1][0][iClk][1] = result->m_tsf3ts0_rt;
622 tsfInfo[1][0][iClk][2] = result->m_tsf3ts0_lr;
623 tsfInfo[1][0][iClk][3] = result->m_tsf3ts0_pr;
624 tsfInfo[1][0][iClk][4] = result->m_tsf3_cc;
625 tsfInfo[1][1][iClk][0] = result->m_tsf3ts1_id;
626 tsfInfo[1][1][iClk][1] = result->m_tsf3ts1_rt;
627 tsfInfo[1][1][iClk][2] = result->m_tsf3ts1_lr;
628 tsfInfo[1][1][iClk][3] = result->m_tsf3ts1_pr;
629 tsfInfo[1][1][iClk][4] = result->m_tsf3_cc;
630 tsfInfo[1][2][iClk][0] = result->m_tsf3ts2_id;
631 tsfInfo[1][2][iClk][1] = result->m_tsf3ts2_rt;
632 tsfInfo[1][2][iClk][2] = result->m_tsf3ts2_lr;
633 tsfInfo[1][2][iClk][3] = result->m_tsf3ts2_pr;
634 tsfInfo[1][2][iClk][4] = result->m_tsf3_cc;
635 tsfInfo[1][3][iClk][0] = result->m_tsf3ts3_id;
636 tsfInfo[1][3][iClk][1] = result->m_tsf3ts3_rt;
637 tsfInfo[1][3][iClk][2] = result->m_tsf3ts3_lr;
638 tsfInfo[1][3][iClk][3] = result->m_tsf3ts3_pr;
639 tsfInfo[1][3][iClk][4] = result->m_tsf3_cc;
640 tsfInfo[1][4][iClk][0] = result->m_tsf3ts4_id;
641 tsfInfo[1][4][iClk][1] = result->m_tsf3ts4_rt;
642 tsfInfo[1][4][iClk][2] = result->m_tsf3ts4_lr;
643 tsfInfo[1][4][iClk][3] = result->m_tsf3ts4_pr;
644 tsfInfo[1][4][iClk][4] = result->m_tsf3_cc;
645 tsfInfo[1][5][iClk][0] = result->m_tsf3ts5_id;
646 tsfInfo[1][5][iClk][1] = result->m_tsf3ts5_rt;
647 tsfInfo[1][5][iClk][2] = result->m_tsf3ts5_lr;
648 tsfInfo[1][5][iClk][3] = result->m_tsf3ts5_pr;
649 tsfInfo[1][5][iClk][4] = result->m_tsf3_cc;
650 tsfInfo[1][6][iClk][0] = result->m_tsf3ts6_id;
651 tsfInfo[1][6][iClk][1] = result->m_tsf3ts6_rt;
652 tsfInfo[1][6][iClk][2] = result->m_tsf3ts6_lr;
653 tsfInfo[1][6][iClk][3] = result->m_tsf3ts6_pr;
654 tsfInfo[1][6][iClk][4] = result->m_tsf3_cc;
655 tsfInfo[1][7][iClk][0] = result->m_tsf3ts7_id;
656 tsfInfo[1][7][iClk][1] = result->m_tsf3ts7_rt;
657 tsfInfo[1][7][iClk][2] = result->m_tsf3ts7_lr;
658 tsfInfo[1][7][iClk][3] = result->m_tsf3ts7_pr;
659 tsfInfo[1][7][iClk][4] = result->m_tsf3_cc;
660 tsfInfo[1][8][iClk][0] = result->m_tsf3ts8_id;
661 tsfInfo[1][8][iClk][1] = result->m_tsf3ts8_rt;
662 tsfInfo[1][8][iClk][2] = result->m_tsf3ts8_lr;
663 tsfInfo[1][8][iClk][3] = result->m_tsf3ts8_pr;
664 tsfInfo[1][8][iClk][4] = result->m_tsf3_cc;
665 tsfInfo[1][9][iClk][0] = result->m_tsf3ts9_id;
666 tsfInfo[1][9][iClk][1] = result->m_tsf3ts9_rt;
667 tsfInfo[1][9][iClk][2] = result->m_tsf3ts9_lr;
668 tsfInfo[1][9][iClk][3] = result->m_tsf3ts9_pr;
669 tsfInfo[1][9][iClk][4] = result->m_tsf3_cc;
670 tsfInfo[1][10][iClk][0] = result->m_tsf3ts10_id;
671 tsfInfo[1][10][iClk][1] = result->m_tsf3ts10_rt;
672 tsfInfo[1][10][iClk][2] = result->m_tsf3ts10_lr;
673 tsfInfo[1][10][iClk][3] = result->m_tsf3ts10_pr;
674 tsfInfo[1][10][iClk][4] = result->m_tsf3_cc;
675 tsfInfo[1][11][iClk][0] = result->m_tsf3ts11_id;
676 tsfInfo[1][11][iClk][1] = result->m_tsf3ts11_rt;
677 tsfInfo[1][11][iClk][2] = result->m_tsf3ts11_lr;
678 tsfInfo[1][11][iClk][3] = result->m_tsf3ts11_pr;
679 tsfInfo[1][11][iClk][4] = result->m_tsf3_cc;
680 tsfInfo[1][12][iClk][0] = result->m_tsf3ts12_id;
681 tsfInfo[1][12][iClk][1] = result->m_tsf3ts12_rt;
682 tsfInfo[1][12][iClk][2] = result->m_tsf3ts12_lr;
683 tsfInfo[1][12][iClk][3] = result->m_tsf3ts12_pr;
684 tsfInfo[1][12][iClk][4] = result->m_tsf3_cc;
685 tsfInfo[1][13][iClk][0] = result->m_tsf3ts13_id;
686 tsfInfo[1][13][iClk][1] = result->m_tsf3ts13_rt;
687 tsfInfo[1][13][iClk][2] = result->m_tsf3ts13_lr;
688 tsfInfo[1][13][iClk][3] = result->m_tsf3ts13_pr;
689 tsfInfo[1][13][iClk][4] = result->m_tsf3_cc;
690 tsfInfo[1][14][iClk][0] = result->m_tsf3ts14_id;
691 tsfInfo[1][14][iClk][1] = result->m_tsf3ts14_rt;
692 tsfInfo[1][14][iClk][2] = result->m_tsf3ts14_lr;
693 tsfInfo[1][14][iClk][3] = result->m_tsf3ts14_pr;
694 tsfInfo[1][14][iClk][4] = result->m_tsf3_cc;
695
696 tsfInfo[2][0][iClk][0] = result->m_tsf5ts0_id;
697 tsfInfo[2][0][iClk][1] = result->m_tsf5ts0_rt;
698 tsfInfo[2][0][iClk][2] = result->m_tsf5ts0_lr;
699 tsfInfo[2][0][iClk][3] = result->m_tsf5ts0_pr;
700 tsfInfo[2][0][iClk][4] = result->m_tsf5_cc;
701 tsfInfo[2][1][iClk][0] = result->m_tsf5ts1_id;
702 tsfInfo[2][1][iClk][1] = result->m_tsf5ts1_rt;
703 tsfInfo[2][1][iClk][2] = result->m_tsf5ts1_lr;
704 tsfInfo[2][1][iClk][3] = result->m_tsf5ts1_pr;
705 tsfInfo[2][1][iClk][4] = result->m_tsf5_cc;
706 tsfInfo[2][2][iClk][0] = result->m_tsf5ts2_id;
707 tsfInfo[2][2][iClk][1] = result->m_tsf5ts2_rt;
708 tsfInfo[2][2][iClk][2] = result->m_tsf5ts2_lr;
709 tsfInfo[2][2][iClk][3] = result->m_tsf5ts2_pr;
710 tsfInfo[2][2][iClk][4] = result->m_tsf5_cc;
711 tsfInfo[2][3][iClk][0] = result->m_tsf5ts3_id;
712 tsfInfo[2][3][iClk][1] = result->m_tsf5ts3_rt;
713 tsfInfo[2][3][iClk][2] = result->m_tsf5ts3_lr;
714 tsfInfo[2][3][iClk][3] = result->m_tsf5ts3_pr;
715 tsfInfo[2][3][iClk][4] = result->m_tsf5_cc;
716 tsfInfo[2][4][iClk][0] = result->m_tsf5ts4_id;
717 tsfInfo[2][4][iClk][1] = result->m_tsf5ts4_rt;
718 tsfInfo[2][4][iClk][2] = result->m_tsf5ts4_lr;
719 tsfInfo[2][4][iClk][3] = result->m_tsf5ts4_pr;
720 tsfInfo[2][4][iClk][4] = result->m_tsf5_cc;
721 tsfInfo[2][5][iClk][0] = result->m_tsf5ts5_id;
722 tsfInfo[2][5][iClk][1] = result->m_tsf5ts5_rt;
723 tsfInfo[2][5][iClk][2] = result->m_tsf5ts5_lr;
724 tsfInfo[2][5][iClk][3] = result->m_tsf5ts5_pr;
725 tsfInfo[2][5][iClk][4] = result->m_tsf5_cc;
726 tsfInfo[2][6][iClk][0] = result->m_tsf5ts6_id;
727 tsfInfo[2][6][iClk][1] = result->m_tsf5ts6_rt;
728 tsfInfo[2][6][iClk][2] = result->m_tsf5ts6_lr;
729 tsfInfo[2][6][iClk][3] = result->m_tsf5ts6_pr;
730 tsfInfo[2][6][iClk][4] = result->m_tsf5_cc;
731 tsfInfo[2][7][iClk][0] = result->m_tsf5ts7_id;
732 tsfInfo[2][7][iClk][1] = result->m_tsf5ts7_rt;
733 tsfInfo[2][7][iClk][2] = result->m_tsf5ts7_lr;
734 tsfInfo[2][7][iClk][3] = result->m_tsf5ts7_pr;
735 tsfInfo[2][7][iClk][4] = result->m_tsf5_cc;
736 tsfInfo[2][8][iClk][0] = result->m_tsf5ts8_id;
737 tsfInfo[2][8][iClk][1] = result->m_tsf5ts8_rt;
738 tsfInfo[2][8][iClk][2] = result->m_tsf5ts8_lr;
739 tsfInfo[2][8][iClk][3] = result->m_tsf5ts8_pr;
740 tsfInfo[2][8][iClk][4] = result->m_tsf5_cc;
741 tsfInfo[2][9][iClk][0] = result->m_tsf5ts9_id;
742 tsfInfo[2][9][iClk][1] = result->m_tsf5ts9_rt;
743 tsfInfo[2][9][iClk][2] = result->m_tsf5ts9_lr;
744 tsfInfo[2][9][iClk][3] = result->m_tsf5ts9_pr;
745 tsfInfo[2][9][iClk][4] = result->m_tsf5_cc;
746 tsfInfo[2][10][iClk][0] = result->m_tsf5ts10_id;
747 tsfInfo[2][10][iClk][1] = result->m_tsf5ts10_rt;
748 tsfInfo[2][10][iClk][2] = result->m_tsf5ts10_lr;
749 tsfInfo[2][10][iClk][3] = result->m_tsf5ts10_pr;
750 tsfInfo[2][10][iClk][4] = result->m_tsf5_cc;
751 tsfInfo[2][11][iClk][0] = result->m_tsf5ts11_id;
752 tsfInfo[2][11][iClk][1] = result->m_tsf5ts11_rt;
753 tsfInfo[2][11][iClk][2] = result->m_tsf5ts11_lr;
754 tsfInfo[2][11][iClk][3] = result->m_tsf5ts11_pr;
755 tsfInfo[2][11][iClk][4] = result->m_tsf5_cc;
756 tsfInfo[2][12][iClk][0] = result->m_tsf5ts12_id;
757 tsfInfo[2][12][iClk][1] = result->m_tsf5ts12_rt;
758 tsfInfo[2][12][iClk][2] = result->m_tsf5ts12_lr;
759 tsfInfo[2][12][iClk][3] = result->m_tsf5ts12_pr;
760 tsfInfo[2][12][iClk][4] = result->m_tsf5_cc;
761 tsfInfo[2][13][iClk][0] = result->m_tsf5ts13_id;
762 tsfInfo[2][13][iClk][1] = result->m_tsf5ts13_rt;
763 tsfInfo[2][13][iClk][2] = result->m_tsf5ts13_lr;
764 tsfInfo[2][13][iClk][3] = result->m_tsf5ts13_pr;
765 tsfInfo[2][13][iClk][4] = result->m_tsf5_cc;
766 tsfInfo[2][14][iClk][0] = result->m_tsf5ts14_id;
767 tsfInfo[2][14][iClk][1] = result->m_tsf5ts14_rt;
768 tsfInfo[2][14][iClk][2] = result->m_tsf5ts14_lr;
769 tsfInfo[2][14][iClk][3] = result->m_tsf5ts14_pr;
770 tsfInfo[2][14][iClk][4] = result->m_tsf5_cc;
771
772 tsfInfo[3][0][iClk][0] = result->m_tsf7ts0_id;
773 tsfInfo[3][0][iClk][1] = result->m_tsf7ts0_rt;
774 tsfInfo[3][0][iClk][2] = result->m_tsf7ts0_lr;
775 tsfInfo[3][0][iClk][3] = result->m_tsf7ts0_pr;
776 tsfInfo[3][0][iClk][4] = result->m_tsf7_cc;
777 tsfInfo[3][1][iClk][0] = result->m_tsf7ts1_id;
778 tsfInfo[3][1][iClk][1] = result->m_tsf7ts1_rt;
779 tsfInfo[3][1][iClk][2] = result->m_tsf7ts1_lr;
780 tsfInfo[3][1][iClk][3] = result->m_tsf7ts1_pr;
781 tsfInfo[3][1][iClk][4] = result->m_tsf7_cc;
782 tsfInfo[3][2][iClk][0] = result->m_tsf7ts2_id;
783 tsfInfo[3][2][iClk][1] = result->m_tsf7ts2_rt;
784 tsfInfo[3][2][iClk][2] = result->m_tsf7ts2_lr;
785 tsfInfo[3][2][iClk][3] = result->m_tsf7ts2_pr;
786 tsfInfo[3][2][iClk][4] = result->m_tsf7_cc;
787 tsfInfo[3][3][iClk][0] = result->m_tsf7ts3_id;
788 tsfInfo[3][3][iClk][1] = result->m_tsf7ts3_rt;
789 tsfInfo[3][3][iClk][2] = result->m_tsf7ts3_lr;
790 tsfInfo[3][3][iClk][3] = result->m_tsf7ts3_pr;
791 tsfInfo[3][3][iClk][4] = result->m_tsf7_cc;
792 tsfInfo[3][4][iClk][0] = result->m_tsf7ts4_id;
793 tsfInfo[3][4][iClk][1] = result->m_tsf7ts4_rt;
794 tsfInfo[3][4][iClk][2] = result->m_tsf7ts4_lr;
795 tsfInfo[3][4][iClk][3] = result->m_tsf7ts4_pr;
796 tsfInfo[3][4][iClk][4] = result->m_tsf7_cc;
797 tsfInfo[3][5][iClk][0] = result->m_tsf7ts5_id;
798 tsfInfo[3][5][iClk][1] = result->m_tsf7ts5_rt;
799 tsfInfo[3][5][iClk][2] = result->m_tsf7ts5_lr;
800 tsfInfo[3][5][iClk][3] = result->m_tsf7ts5_pr;
801 tsfInfo[3][5][iClk][4] = result->m_tsf7_cc;
802 tsfInfo[3][6][iClk][0] = result->m_tsf7ts6_id;
803 tsfInfo[3][6][iClk][1] = result->m_tsf7ts6_rt;
804 tsfInfo[3][6][iClk][2] = result->m_tsf7ts6_lr;
805 tsfInfo[3][6][iClk][3] = result->m_tsf7ts6_pr;
806 tsfInfo[3][6][iClk][4] = result->m_tsf7_cc;
807 tsfInfo[3][7][iClk][0] = result->m_tsf7ts7_id;
808 tsfInfo[3][7][iClk][1] = result->m_tsf7ts7_rt;
809 tsfInfo[3][7][iClk][2] = result->m_tsf7ts7_lr;
810 tsfInfo[3][7][iClk][3] = result->m_tsf7ts7_pr;
811 tsfInfo[3][7][iClk][4] = result->m_tsf7_cc;
812 tsfInfo[3][8][iClk][0] = result->m_tsf7ts8_id;
813 tsfInfo[3][8][iClk][1] = result->m_tsf7ts8_rt;
814 tsfInfo[3][8][iClk][2] = result->m_tsf7ts8_lr;
815 tsfInfo[3][8][iClk][3] = result->m_tsf7ts8_pr;
816 tsfInfo[3][8][iClk][4] = result->m_tsf7_cc;
817 tsfInfo[3][9][iClk][0] = result->m_tsf7ts9_id;
818 tsfInfo[3][9][iClk][1] = result->m_tsf7ts9_rt;
819 tsfInfo[3][9][iClk][2] = result->m_tsf7ts9_lr;
820 tsfInfo[3][9][iClk][3] = result->m_tsf7ts9_pr;
821 tsfInfo[3][9][iClk][4] = result->m_tsf7_cc;
822 tsfInfo[3][10][iClk][0] = result->m_tsf7ts10_id;
823 tsfInfo[3][10][iClk][1] = result->m_tsf7ts10_rt;
824 tsfInfo[3][10][iClk][2] = result->m_tsf7ts10_lr;
825 tsfInfo[3][10][iClk][3] = result->m_tsf7ts10_pr;
826 tsfInfo[3][10][iClk][4] = result->m_tsf7_cc;
827 tsfInfo[3][11][iClk][0] = result->m_tsf7ts11_id;
828 tsfInfo[3][11][iClk][1] = result->m_tsf7ts11_rt;
829 tsfInfo[3][11][iClk][2] = result->m_tsf7ts11_lr;
830 tsfInfo[3][11][iClk][3] = result->m_tsf7ts11_pr;
831 tsfInfo[3][11][iClk][4] = result->m_tsf7_cc;
832 tsfInfo[3][12][iClk][0] = result->m_tsf7ts12_id;
833 tsfInfo[3][12][iClk][1] = result->m_tsf7ts12_rt;
834 tsfInfo[3][12][iClk][2] = result->m_tsf7ts12_lr;
835 tsfInfo[3][12][iClk][3] = result->m_tsf7ts12_pr;
836 tsfInfo[3][12][iClk][4] = result->m_tsf7_cc;
837 tsfInfo[3][13][iClk][0] = result->m_tsf7ts13_id;
838 tsfInfo[3][13][iClk][1] = result->m_tsf7ts13_rt;
839 tsfInfo[3][13][iClk][2] = result->m_tsf7ts13_lr;
840 tsfInfo[3][13][iClk][3] = result->m_tsf7ts13_pr;
841 tsfInfo[3][13][iClk][4] = result->m_tsf7_cc;
842 tsfInfo[3][14][iClk][0] = result->m_tsf7ts14_id;
843 tsfInfo[3][14][iClk][1] = result->m_tsf7ts14_rt;
844 tsfInfo[3][14][iClk][2] = result->m_tsf7ts14_lr;
845 tsfInfo[3][14][iClk][3] = result->m_tsf7ts14_pr;
846 tsfInfo[3][14][iClk][4] = result->m_tsf7_cc;
847
848 }
849}

◆ t2DPhiTot3DPhi()

int t2DPhiTot3DPhi ( int  phi,
int  rho 
)

converts to 2D rho to 3D rho value, obselete

converts to 2D phi to 3D phi value

Definition at line 284 of file TRGCDCT3DConverterModule.cc.

285{
286 double phiReal = 45 + 90. / 80 * (1 + phi);
287 if (toSigned(rho, 7) >= 0) phiReal -= 90;
288 else phiReal += 90;
289
290 while (phiReal > 180) {
291 phiReal -= 360;
292 }
293 while (phiReal < -180) {
294 phiReal += 360;
295 }
296
297 int phiInt = phiReal * (pow(2, 12) - 0.5) / 180;
298 return phiInt;
299}

◆ terminate()

void terminate ( void  )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 87 of file TRGCDCT3DConverterModule.cc.

88{
89}

◆ toSigned()

int toSigned ( int  value,
int  nBits 
)

converts to signed value

Definition at line 261 of file TRGCDCT3DConverterModule.cc.

262{
263 int signMask = 1 << (nBits - 1);
264 if (value & signMask) {
265 int mask = (1 << nBits) - 1;
266 value |= ~mask;
267 }
268 return value;
269}

◆ toTSID()

int toTSID ( int  iSL,
int  iWire 
)

converts sl, iWire to continuous TS ID [0,2335]

Definition at line 227 of file TRGCDCT3DConverterModule.cc.

228{
229 vector<int> nWires = {160, 160, 192, 224, 256, 288, 320, 352, 384};
230 int id = 0;
231 for (int i = 0; i < (int)iSL; i++) {
232 id += nWires[i];
233 }
234
235//Correct the segmentID. The zero points of raw segmentID for four boards are different.
236 if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore0") {
237 id = id + iWire + nWires[(int)iSL] / 4.0 * 0;
238 if (iWire + nWires[(int)iSL] / 4.0 * 0 > nWires[(int)iSL]) {
239 id = id - nWires[(int)iSL];
240 }
241 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore1") {
242 id = id + iWire + nWires[(int)iSL] / 4.0 * 1;
243 if (iWire + nWires[(int)iSL] / 4.0 * 1 > nWires[(int)iSL]) {
244 id = id - nWires[(int)iSL];
245 }
246 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore2") {
247 id = id + iWire + nWires[(int)iSL] / 4.0 * 2;
248 if (iWire + nWires[(int)iSL] / 4.0 * 2 > nWires[(int)iSL]) {
249 id = id - nWires[(int)iSL];
250 }
251 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore3") {
252 id = id + iWire + nWires[(int)iSL] / 4.0 * 3;
253 if (iWire + nWires[(int)iSL] / 4.0 * 3 > nWires[(int)iSL]) {
254 id = id - nWires[(int)iSL];
255 }
256 }
257 //cout<<"toID: iSL"<<iSL<<" iWire:"<<iWire<<" id:"<<id<<endl;
258 return id;
259}

◆ version()

string version ( ) const

returns version of TRGCDCT3DConverterModule.

Definition at line 36 of file TRGCDCT3DConverterModule.cc.

37{
38 return string("1.00");
39}

Member Data Documentation

◆ m_add2DFinderToDatastore

bool m_add2DFinderToDatastore
protected

Flag for adding 2D finder to datastore.

Definition at line 142 of file TRGCDCT3DConverterModule.h.

◆ m_add3DToDatastore

bool m_add3DToDatastore
protected

Flag for adding 3D to datastore.

Definition at line 146 of file TRGCDCT3DConverterModule.h.

◆ m_addEventTimeToDatastore

bool m_addEventTimeToDatastore
protected

Flag for adding event time to datastore.

Definition at line 152 of file TRGCDCT3DConverterModule.h.

◆ m_addTSToDatastore

bool m_addTSToDatastore
protected

Flag for adding TS to datastore.

Definition at line 138 of file TRGCDCT3DConverterModule.h.

◆ m_commonData

Belle2::TRGCDCJSignalData* m_commonData
private

TRGCDCJSignalData for VHDL generation (jbkim's class)

Definition at line 171 of file TRGCDCT3DConverterModule.h.

◆ m_conditions

std::vector<ModuleCondition> m_conditions
privateinherited

Module condition, only non-null if set.

Definition at line 520 of file Module.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 510 of file Module.h.

◆ m_eventTime

StoreObjPtr<BinnedEventT0> m_eventTime
private

StoreObjPtr containing the event time.

Definition at line 168 of file TRGCDCT3DConverterModule.h.

◆ m_EventTimeName

std::string m_EventTimeName
protected

name of the event time StoreObjPtr

Definition at line 150 of file TRGCDCT3DConverterModule.h.

◆ m_firmwareResultCollectionName

std::string m_firmwareResultCollectionName
protected

Name of the StoreArray containing the input firmware results.

Definition at line 134 of file TRGCDCT3DConverterModule.h.

◆ m_firmwareResults

StoreArray<TRGCDCT3DUnpackerStore> m_firmwareResults
private

list of firmware results

Definition at line 160 of file TRGCDCT3DConverterModule.h.

◆ m_fit3DWithTSIM

unsigned m_fit3DWithTSIM
protected

Mode for fitting with TSIM.

Definition at line 148 of file TRGCDCT3DConverterModule.h.

◆ m_hasReturnValue

bool m_hasReturnValue
privateinherited

True, if the return value is set.

Definition at line 517 of file Module.h.

◆ m_hitCollectionName

std::string m_hitCollectionName
protected

Name of the StoreArray containing the input track segment hits.

Definition at line 136 of file TRGCDCT3DConverterModule.h.

◆ m_hits

list of track segment hits

Definition at line 162 of file TRGCDCT3DConverterModule.h.

◆ m_inputCollectionName

std::string m_inputCollectionName
protected

Name of the StoreArray containing the input tracks from the 2D fitter.

Definition at line 140 of file TRGCDCT3DConverterModule.h.

◆ m_isVerbose

unsigned m_isVerbose
protected

Switch printing detail information.


Definition at line 154 of file TRGCDCT3DConverterModule.h.

◆ m_logConfig

LogConfig m_logConfig
privateinherited

The log system configuration of the module.

Definition at line 513 of file Module.h.

◆ m_mLutStorage

std::map<std::string, TRGCDCJLUT*> m_mLutStorage
private

TRGCDCJLUT for VHDL generation (jbkim's class)

Definition at line 175 of file TRGCDCT3DConverterModule.h.

◆ m_moduleParamList

ModuleParamList m_moduleParamList
privateinherited

List storing and managing all parameter of the module.

Definition at line 515 of file Module.h.

◆ m_mSignalStorage

std::map<std::string, TRGCDCJSignal> m_mSignalStorage
private

TRGCDCJSignal for VHDL generation (jbkim's class)

Definition at line 173 of file TRGCDCT3DConverterModule.h.

◆ m_name

std::string m_name
privateinherited

The name of the module, saved as a string (user-modifiable)

Definition at line 507 of file Module.h.

◆ m_outputCollectionName

std::string m_outputCollectionName
protected

Name of the StoreArray containing the resulting 3D tracks.

Definition at line 144 of file TRGCDCT3DConverterModule.h.

◆ m_package

std::string m_package
privateinherited

Package this module is found in (may be empty).

Definition at line 509 of file Module.h.

◆ m_propertyFlags

unsigned int m_propertyFlags
privateinherited

The properties of the module as bitwise or (with |) of EModulePropFlags.

Definition at line 511 of file Module.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 518 of file Module.h.

◆ m_tracks2D

StoreArray<CDCTriggerTrack> m_tracks2D
private

list of 2D input tracks

Definition at line 164 of file TRGCDCT3DConverterModule.h.

◆ m_tracks3D

StoreArray<CDCTriggerTrack> m_tracks3D
private

list of 3D output tracks

Definition at line 166 of file TRGCDCT3DConverterModule.h.

◆ m_type

std::string m_type
privateinherited

The type of the module, saved as a string.

Definition at line 508 of file Module.h.


The documentation for this class was generated from the following files: