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 42 of file TRGCDCT3DConverterModule.cc.

44{
46 string desc = "TRGCDCT3DConverterModule(" + version() + ")";
47 setDescription(desc);
48 addParam("hitCollectionName", m_hitCollectionName,
49 "Name of the input StoreArray of CDCTriggerSegmentHits.",
50 string("CDCTriggerSegmentHits0"));
51 addParam("addTSToDatastore", m_addTSToDatastore,
52 "If true, adds TS to datastore",
53 true);
54 addParam("EventTimeName", m_EventTimeName,
55 "Name of the event time object.",
56 string("BinnedEventT00"));
57 addParam("addEventTimeToDatastore", m_addEventTimeToDatastore,
58 "If true, adds event time to datastore",
59 true);
60 addParam("inputCollectionName", m_inputCollectionName,
61 "Name of the StoreArray holding the input tracks from the 2D finder.",
62 string("TRGCDC2DFinderTracks0"));
63 addParam("add2DFinderToDatastore", m_add2DFinderToDatastore,
64 "If true, adds 2D Finder results to datastore",
65 true);
66 addParam("outputCollectionName", m_outputCollectionName,
67 "Name of the StoreArray holding the 3D output tracks.",
68 string("TRGCDC3DFitterTracks0"));
69 addParam("add3DToDatastore", m_add3DToDatastore,
70 "If true, adds 3D results to datastore",
71 true);
72 addParam("fit3DWithTSIM", m_fit3DWithTSIM,
73 "0: use firmware results. 1: Fits with fast TSIM. 2: Fits with firm TSIM",
74 unsigned(0));
75 addParam("firmwareResultCollectionName", m_firmwareResultCollectionName,
76 "Name of the StoreArray holding the firmware results.",
77 string("TRGCDCT3DUnpackerStores0"));
78 addParam("isVerbose", m_isVerbose,
79 "If not zero, prints detail information.",
80 unsigned(0));
81 B2INFO("TRGCDCT3DConverter: Constructor done.");
82}
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:560

◆ ~TRGCDCT3DConverterModule()

Destructor.

Definition at line 84 of file TRGCDCT3DConverterModule.cc.

85{
86}

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 453 of file TRGCDCT3DConverterModule.cc.

455{
456 // Add 2D track
457 for (unsigned iTrack = 0; iTrack < t2DInfo.shape()[0]; ++iTrack) {
458 double charge = 0, phi0_i = 0, omega = 0, chi2D = 0;
459 //double phi0_c = 0;
460 //Convert
461 charge = t2DInfo[iTrack][0] == 2 ? -1 : 1;
462 //phi0_c = t2DPhiTot3DPhi(t2DInfo[iTrack][2], t2DInfo[iTrack][1]) / (pow(2, 12) - 0.5) * M_PI;
463 //phi0_i = phi0_c + charge * M_PI_2;
464 //cout<<phi0_i<<" "<<(45 + 90./80 * (1+ t2DInfo[iTrack][2]))/180*M_PI<<endl;
465 phi0_i = (45 + 90. / 80 * (1 + t2DInfo[iTrack][2])) / 180 * M_PI;
466
467 //Correct phi0_i. The zero points of raw phi0_i for four boards are different.
468 if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore0") {
469 phi0_i = phi0_i + (M_PI / 2.0) * 0;
470 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore1") {
471 phi0_i = phi0_i + (M_PI / 2.0) * 1;
472 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore2") {
473 phi0_i = phi0_i + (M_PI / 2.0) * 2;
474 } else if (m_firmwareResultCollectionName == "TRGCDCT3DUnpackerStore3") {
475 phi0_i = phi0_i + (M_PI / 2.0) * 3;
476 }
477
478 // Confine the range of the angle to -pi ~ pi
479 while (phi0_i > M_PI) {
480 phi0_i -= 2 * M_PI;
481 }
482 while (phi0_i < -M_PI) {
483 phi0_i += 2 * M_PI;
484 }
485
486 //omega = charge / t2DRhoTot3DRho(t2DInfo[iTrack][1])/(pow(2,11)-0.5)*2500;
487 //cout<<omega<<" "<<toSigned(t2DInfo[iTrack][1],7)*1.5e-4*30/0.3/34<<endl;
488 //omega = toSigned(t2DInfo[iTrack][1], 7) * 1.5e-4 * 30 / 0.3 / 34;
489 omega = toSigned(t2DInfo[iTrack][1], 7) / 33.0 * 3.2;
490 //cout<<"iTrack: "<<iTrack<<" charge:"<<t2DInfo[iTrack][0]<<" "<<charge<<" rho: "<<t2DInfo[iTrack][1]<<" "<<omega<<" phi0_i: "<<t2DInfo[iTrack][2]<<" "<<phi0_i<<endl;
491
492 CDCTriggerTrack* track = m_tracks2D.appendNew(phi0_i, omega, chi2D, 0, 0, 0);
493
494 if (m_isVerbose) cout << "[2D] iTrack:" << iTrack << " charge:" << charge << " phi0_i:" << phi0_i << " " << phi0_i * 180 / M_PI <<
495 " omega:" << omega << " pt:" << charge / omega * 0.3 * 1.5 * 0.01 << endl;
496
497 for (unsigned iAx = 0; iAx < t2DTsfInfo.shape()[1]; ++iAx) {
498 double rawId = t2DTsfInfo[iTrack][iAx][0];
499 double id = -1;
500 if (iAx != 4) id = rawId;
501 else {
502 id = rawId - 16;
503 if (id < 0) id += 384;
504 }
505 double rt = t2DTsfInfo[iTrack][iAx][1];
506 double lr = t2DTsfInfo[iTrack][iAx][2];
507 double pr = t2DTsfInfo[iTrack][iAx][3];
508 double ft = t2DTsfInfo[iTrack][iAx][4];
509 if (pr == 0) continue;
510 CDCHit prHit(rt, 0, iAx * 2, pr == 3 ? 2 : 3, id);
511 m_hits.appendNew(prHit, toTSID(int(iAx * 2), id), pr, lr, rt, 0, ft);
512 track->addRelationTo(m_hits[m_hits.getEntries() - 1]);
513 if (m_isVerbose) cout << "[2D] iTrack: " << iTrack << " iAx:" << iAx << " id:" << id << " rt:" << rt << " lr:" << lr << " pr:" << pr
514 << " ft:" << ft << endl;
515 }
516
517
518 }
519}
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 1579 of file TRGCDCT3DConverterModule.cc.

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

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

◆ beginRun()

void beginRun ( void  )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 106 of file TRGCDCT3DConverterModule.cc.

107{
108}

◆ 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:363
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:187
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:512
LogConfig m_logConfig
The log system configuration of the module.
Definition: Module.h:514
std::vector< ModuleCondition > m_conditions
Module condition, only non-null if set.
Definition: Module.h:521
std::string m_package
Package this module is found in (may be empty).
Definition: Module.h:510
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 1178 of file TRGCDCT3DConverterModule.cc.

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

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

◆ 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 439 of file Module.h.

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

◆ 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 432 of file Module.h.

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

◆ 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 420 of file Module.h.

420{ 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 445 of file Module.h.

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

◆ endRun()

void endRun ( void  )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 110 of file TRGCDCT3DConverterModule.cc.

111{
112}

◆ 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:519
bool m_hasReturnValue
True, if the return value is set.
Definition: Module.h:518

◆ event()

void event ( void  )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 114 of file TRGCDCT3DConverterModule.cc.

115{
116 //cout<<"Event"<<endl;
117
118 if (m_addTSToDatastore) {
119 // Process firmware stereo TS
120 // stTsfFirmwareInfo[stSL][tsIndex][iClk][id, rt, lr, pr, foundTime]
121 multi_array<double, 4> stTsfFirmwareInfo{extents[4][15][48][5]};
122 storeTSFirmwareData(stTsfFirmwareInfo);
123
124 // stTsfInfo[stSL][iTS][id, rt, lr, pr, foundTime]
125 multi_array<double, 3> stTsfInfo{extents[4][0][5]};
126
127 filterTSData(stTsfFirmwareInfo, stTsfInfo);
128 // Add to TS datastore
129 addTSDatastore(stTsfInfo, 1);
130 }
131
133 // Process firmware 2D
134
135 // t2DFirmwareInfo[tIndex][iClk][valid, isOld, charge, rho, phi0]
136 multi_array<double, 3> t2DFirmwareInfo{extents[4][48][5]};
137 // t2DTsfFirmwareInfo[tIndex][iClk][axSL][id, rt, lr, pr]
138 multi_array<double, 4> t2DTsfFirmwareInfo{extents[4][48][5][4]};
139 store2DFirmwareData(t2DFirmwareInfo, t2DTsfFirmwareInfo);
140
141 // t2DInfo[tIndex][charge, rho, phi0]
142 multi_array<double, 2> t2DInfo{extents[0][3]};
143 // t2DTsfInfo[tIndex][axSL][id, rt, lr, pr, -9999]
144 multi_array<double, 3> t2DTsfInfo{extents[0][5][5]};
145
146 filter2DData(t2DFirmwareInfo, t2DTsfFirmwareInfo, t2DInfo, t2DTsfInfo);
147 add2DDatastore(t2DInfo, t2DTsfInfo);
148 }
149
152 // add eventTime
153 bool validEventTime = 0;
154 int eventTime = 0;
155 for (int iClk = 0; iClk < m_firmwareResults.getEntries() - 17 - 1; iClk++) {
157 if (result->m_t3dtrk0_evtTimeValid_delay) {
158 validEventTime = 1;
159 eventTime = result->m_t3dtrk0_evtTime_delay;
160 }
161 }
162 if (validEventTime) {
163 m_eventTime->addBinnedEventT0(eventTime, Const::CDC);
164 }
165 if (m_isVerbose) {
166 if (validEventTime) cout << "[ET] valid: 1 eventTime:" << eventTime << endl;
167 else cout << "[ET] valid: 0" << endl;
168 }
169 }
170
171 if (m_add3DToDatastore) {
172 // t3DFirmwareInfo[tIndex][iClk][2DValid, 2DisOld, TSFValid, EventTimeValid, eventTime, charge, rho, phi0, z0, cot, zchi]
173 multi_array<double, 3> t3DFirmwareInfo{extents[4][48][11]};
174
175 // m_fit3DWithTSIM 0:firmware 1:fastSim 2:firmSim
176 // Use Firmware results
177 if (m_fit3DWithTSIM == 0) store3DFirmwareData(t3DFirmwareInfo);
178 // Use fast sim with debug
179 if (m_fit3DWithTSIM == 1) store3DFastSimData(t3DFirmwareInfo);
180 // Use firm sim with debug
181 if (m_fit3DWithTSIM == 2) store3DFirmSimData(t3DFirmwareInfo);
182
183 // t3DInfo[eventTime, charge, rho, phi0, z0, cot, zchi]
184 multi_array<double, 2> t3DInfo{extents[0][7]};
185
186
187 filter3DData(t3DFirmwareInfo, t3DInfo);
188
189 if (m_fit3DWithTSIM == 0) add3DDatastore(t3DInfo);
190 else add3DDatastore(t3DInfo, 0);
191 }
192
193 if (m_isVerbose > 1) {
195 }
196
197
198
199 //vector<int> t2DClks;
200 //vector<int> t2DTrackId;
201 //filter2DData(t2DFirmwareInfo, t2DTsfFirmwareInfo, t2DInfo, t2DTsfInfo, t2DClks, t2DTrackId);
202
205 //for(unsigned iTrack = 0; iTrack < t2DInfo.size(); iTrack++)
206 //{
207 // cout<<"[2D] iClk: "<<t2DClks[iTrack]<<" trackid: "<<t2DTrackId[iTrack]<<" charge:"<<t2DInfo[iTrack][0]<<endl;
208 // int rho_s = t2DInfo[iTrack][1];
209 // int rho_2Dint = toSigned(rho_s, 7);
210 // double rho = 0.3*34/30/1.5e-4/abs(rho_2Dint);
211 // int rho_3Dint = rho*(pow(2,11)-0.5)/2500;
212 // cout<<" rho_s "<<rho_s<<" rho_int: "<<rho_2Dint<<" rho: "<<rho<<" rho_3Dint: "<<rho_3Dint<<endl;;
213 // //cout<<" phi0: "<<t2DInfo[iTrack][2]<<" s: "<<toSigned(t2DInfo[iTrack][2],13)<<" convert: "<<endl;
214 // //for(unsigned iAx = 0; iAx < t2DTsfInfo[iTrack].size(); iAx++)
215 // //{
216 // // cout<<" iAx: "<<iAx<<" id: "<<t2DTsfInfo[iTrack][iAx][0]<<" lr: "<<t2DTsfInfo[iTrack][iAx][2]<<endl;
217 // //}
218 //}
220 //for (unsigned iTrack = 0; iTrack < t3DInfo.size(); iTrack++)
221 //{
222 // 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;
223 //}
224
225
226}
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 pathes */
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:225
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:230
const std::string & getDescription() const
Returns the description of the module.
Definition: Module.h:202
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:311
const std::string & getPackage() const
Returns the package this module is in.
Definition: Module.h:197
void setName(const std::string &name)
Set the name of the module.
Definition: Module.h:214
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 358 of file TRGCDCT3DConverterModule.cc.

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

◆ filter3DData()

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

filters t3DFirmwareInfo to t3DInfo

Definition at line 1548 of file TRGCDCT3DConverterModule.cc.

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

◆ filterTSData()

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

filters tsfFirmwareInfo to tsfInfo

Definition at line 302 of file TRGCDCT3DConverterModule.cc.

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

◆ 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 324 of file Module.h.

325 {
326 return m_conditions;
327 }

◆ getCondition()

const ModuleCondition * getCondition ( ) const
inlineinherited

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

Definition at line 314 of file Module.h.

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

◆ 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 202 of file Module.h.

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

◆ 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 134 of file Module.h.

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

◆ getLogConfig()

LogConfig & getLogConfig ( )
inlineinherited

Returns the log system configuration.

Definition at line 225 of file Module.h.

225{return m_logConfig;}

◆ getModules()

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

no submodules, return empty list

Implements PathElement.

Definition at line 506 of file Module.h.

506{ 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 187 of file Module.h.

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

◆ getPackage()

const std::string & getPackage ( ) const
inlineinherited

Returns the package this module is in.

Definition at line 197 of file Module.h.

197{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:516

◆ getParamList()

const ModuleParamList & getParamList ( ) const
inlineinherited

Return module param list.

Definition at line 363 of file Module.h.

363{ 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 381 of file Module.h.

381{ 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:509

◆ hasCondition()

bool hasCondition ( ) const
inlineinherited

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

Definition at line 311 of file Module.h.

311{ 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 378 of file Module.h.

378{ 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 92 of file TRGCDCT3DConverterModule.cc.

93{
99
102
104}
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 230 of file Module.h.

230{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 214 of file Module.h.

214{ m_name = name; };

◆ setParamList()

void setParamList ( const ModuleParamList params)
inlineprotectedinherited

Replace existing parameter list.

Definition at line 501 of file Module.h.

501{ 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 854 of file TRGCDCT3DConverterModule.cc.

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

◆ store3DFastSimData()

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

uses fast sim with debug

Definition at line 1045 of file TRGCDCT3DConverterModule.cc.

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

◆ store3DFirmSimData()

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

uses firm sim with debug

Definition at line 1109 of file TRGCDCT3DConverterModule.cc.

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

◆ store3DFirmwareData()

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

converts firmwareResults of 3D to a vector

Definition at line 977 of file TRGCDCT3DConverterModule.cc.

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

◆ storeTSFirmwareData()

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

converts firmwareResults of TS to a vector

Definition at line 540 of file TRGCDCT3DConverterModule.cc.

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

◆ 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 285 of file TRGCDCT3DConverterModule.cc.

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

◆ terminate()

void terminate ( void  )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 88 of file TRGCDCT3DConverterModule.cc.

89{
90}

◆ toSigned()

int toSigned ( int  value,
int  nBits 
)

converts to signed value

Definition at line 262 of file TRGCDCT3DConverterModule.cc.

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

◆ toTSID()

int toTSID ( int  iSL,
int  iWire 
)

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

Definition at line 228 of file TRGCDCT3DConverterModule.cc.

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

◆ version()

string version ( ) const

returns version of TRGCDCT3DConverterModule.

Definition at line 37 of file TRGCDCT3DConverterModule.cc.

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

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 521 of file Module.h.

◆ m_description

std::string m_description
privateinherited

The description of the module.

Definition at line 511 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 518 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 514 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 516 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 508 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 510 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 512 of file Module.h.

◆ m_returnValue

int m_returnValue
privateinherited

The return value.

Definition at line 519 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 509 of file Module.h.


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