9 #define TRGECLFAM_SHORT_NAMES
12 #include <framework/logging/Logger.h>
15 #include "trg/ecl/modules/trgecl/TRGECLFAMModule.h"
16 #include "trg/ecl/TrgEclDigitizer.h"
17 #include "trg/ecl/TrgEclFAMFit.h"
19 #include "trg/ecl/dbobjects/TRGECLFAMPara.h"
38 TRGECLFAMModule::version()
const
40 return string(
"TRGECLFAMModule 1.00");
45 TRGECLFAMModule::TRGECLFAMModule()
49 _binTimeInterval(125),
59 string desc =
"TRGECLFAMModule(" +
version() +
")";
78 "Select source of TC data(1:=ECLHit or 2:=ECLSimHit or 3:=ECLHit+TRGECLBGTCHit)",
84 B2DEBUG(100,
"TRGECLFAMModule ... created");
94 B2DEBUG(100,
"TRGECLFAMModule ... destructed ");
104 B2DEBUG(100,
"TRGECLFAMModule::initialize ... options");
105 B2DEBUG(100,
"TRGECLFAMModule::initialize> FAM Fit Method = " <<
_famMethod
107 <<
" ;output TC waveforml = " <<
_waveform);
110 B2FATAL(
"TRGECLFAMModule::initialize> SourceOfTC must be 1 or 2 or 3");
135 Threshold[para.getTCId() - 1] = (int)((para.getThreshold()) * (para.getConversionFactor()));
139 B2DEBUG(200,
"TRGECLFAMModule ... beginRun called ");
149 B2DEBUG(200,
"TRGECLFAMMoudle ... event called");
155 else if (
m_nEvent < 1e5) {
if (
m_nEvent % 10000 == 0) {B2DEBUG(200,
"TRGECLFAMModule::event> evtno= " <<
m_nEvent);}}
156 else if (
m_nEvent < 1e6) {
if (
m_nEvent % 100000 == 0) {B2DEBUG(200,
"TRGECLFAMModule::event> evtno= " <<
m_nEvent);}}
180 obj_trgeclfit-> SetAnaTagFlag(
_famana);
191 uint16_t nTCsPerRegion[3] = {};
192 const double absTimeRequirement = 9999.;
193 const int firstBarrelId = 81;
194 const int lastBarrelId = 512;
196 const int tcId = trgeclhit.getTCId();
197 const double tcTime = trgeclhit.getTimeAve();
198 if (std::abs(tcTime) < absTimeRequirement) {
199 if (tcId < firstBarrelId) {
201 }
else if (tcId > lastBarrelId) {
220 delete obj_trgeclDigi;
221 delete obj_trgeclfit;
232 B2DEBUG(200,
"TRGECLFAMModule ... endRun called ");
240 B2DEBUG(100,
"TRGECLFAMModule ... terminate called ");
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
int _FADC
Set Shaping Function.
int m_SourceOfTC
Set source of TC data (1:=ECLHit or 2:=ECLSimHit or 3:=ECLHit+TRGECLBGTCHit)
int _famana
save FAM ana table
std::vector< std::vector< double > > TCDigiT
Digitized TC T [ns].
int _ConditionDB
Use Condition DB.
StoreArray< TRGECLFAMAna > m_TRGECLFAMAna
output for TRGECLFAMAna
int _debugLevel
Parameters.
int _beambkgtag
save Beam background tag in TRGECLHit table
int _binTimeInterval
Time interval.
std::vector< std::vector< double > > TCDigiE
Digitized TC E [GeV].
StoreArray< TRGECLDigi0 > m_TRGECLDigi0
output for TRGECLDigi0
int m_nEvent
Event number.
int _threshold
Threshold input.
StoreArray< TRGECLWaveform > m_TRGECLWaveform
output for TRGECLWaveform
StoreArray< TRGECLHit > m_TRGECLHit
output for TRGECLHit
std::vector< int > Threshold
Threshold.
StoreObjPtr< EventLevelClusteringInfo > m_eventLevelClusteringInfo
EventLevelClusteringInfo.
DBArray< TRGECLFAMPara > m_FAMPara
FAM Parameters.
void setup(int)
setup fam module
void setFADC(int fadc)
Set flag of waveform table.
void setWaveform(int wave)
Set flag of waveform table.
void digitization01(std::vector< std::vector< double >> &, std::vector< std::vector< double >> &)
fit method, digi with 125ns interval
void digitization02(std::vector< std::vector< double >> &, std::vector< std::vector< double >> &)
original no fit method, digi with 12ns interval
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
virtual void initialize() override
Initilizes TRGECLFAMModule.
virtual void event() override
Called event by event.
virtual void endRun() override
Called when run ended.
virtual void terminate() override
Called when processing ended.
virtual void beginRun() override
Called when new run started.
std::string version(void) const
returns version of TRGECLFAMModule.
virtual ~TRGECLFAMModule()
Destructor.
Abstract base class for different kinds of events.