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>
38 return string(
"TRGECLFAMModule 1.00");
57 string desc =
"TRGECLFAMModule(" +
version() +
")";
76 "Select source of TC data(1:=ECLHit or 2:=ECLSimHit or 3:=ECLHit+TRGECLBGTCHit)",
79 B2DEBUG(100,
"TRGECLFAMModule ... created");
89 B2DEBUG(100,
"TRGECLFAMModule ... destructed ");
98 B2DEBUG(100,
"TRGECLFAMModule::initialize ... options");
99 B2DEBUG(100,
"TRGECLFAMModule::initialize> FAM Fit Method = " <<
m_famMethod
104 B2FATAL(
"TRGECLFAMModule::initialize> SourceOfTC must be 1 or 2 or 3");
136 int tc_id = (int) para.getTCId();
141 B2DEBUG(200,
"TRGECLFAMModule ... beginRun called ");
151 B2DEBUG(200,
"TRGECLFAMMoudle ... event called");
157 else if (
m_nEvent < 1e5) {
if (
m_nEvent % 10000 == 0) {B2DEBUG(200,
"TRGECLFAMModule::event> evtno= " <<
m_nEvent);}}
158 else if (
m_nEvent < 1e6) {
if (
m_nEvent % 100000 == 0) {B2DEBUG(200,
"TRGECLFAMModule::event> evtno= " <<
m_nEvent);}}
192 uint16_t nTCsPerRegion[3] = {};
193 const double absTimeRequirement = 9999.;
194 const int firstBarrelId = 81;
195 const int lastBarrelId = 512;
197 const int tcId = trgeclhit.getTCId();
198 const double tcTime = trgeclhit.getTimeAve();
199 if (std::abs(tcTime) < absTimeRequirement) {
200 if (tcId < firstBarrelId) {
202 }
else if (tcId > lastBarrelId) {
216 delete obj_trgeclDigi;
217 delete obj_trgeclfit;
225 double parAlternativeValue)
228 if (dbParmap.count(parName)) {
229 par = dbParmap.at(parName);
231 par = parAlternativeValue;
232 B2WARNING(
"No key(\"" + parName +
233 "\") for map in DB and set alternative value(" + parAlternativeValue +
245 B2DEBUG(200,
"TRGECLFAMModule ... endRun called ");
254 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 m_SourceOfTC
Set source of TC data (1:=ECLHit or 2:=ECLSimHit or 3:=ECLHit+TRGECLBGTCHit)
int m_debugLevel
Parameters.
int m_famMethod
fam Method
StoreArray< TRGECLFAMAna > m_TRGECLFAMAna
output for TRGECLFAMAna
std::vector< int > m_TCEThreshold
TC Energy Threshold [MeV].
DBArray< TRGECLFAMTCADCThreshold > m_FAMTCADCThreshold
FAM TC ADC Thresholds.
int m_famana
save FAM ana table
int m_binTimeInterval
Time interval.
double m_TCADCtoEnergy
TC ADC Energy conversion factor [MeV].
int m_SaveTCWaveForm
Waveform.
int m_beambkgtag
save Beam background tag in TRGECLHit table
StoreArray< TRGECLDigi0 > m_TRGECLDigi0
output for TRGECLDigi0
bool m_ConditionDBFAM
Use Condition DB.
int m_nEvent
Event number.
DBObjPtr< TRGECLETMParameters > m_ETMParameters
ETM Parameters.
std::vector< std::vector< double > > m_TCDigiE
Digitized TC E [GeV].
StoreArray< TRGECLWaveform > m_TRGECLWaveform
output for TRGECLWaveform
int m_SetTCEThreshold
Threshold input.
StoreArray< TRGECLHit > m_TRGECLHit
output for TRGECLHit
std::vector< std::vector< double > > m_TCDigiT
Digitized TC T [ns].
StoreObjPtr< EventLevelClusteringInfo > m_eventLevelClusteringInfo
EventLevelClusteringInfo.
int m_FADC
Set Shaping Function.
void save(int)
save fitting result into tables
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 setup(int)
setup fam module
void setThreshold(const std::vector< int > &tcethreshold)
set Threshold
void FAMFit02(std::vector< std::vector< double > >, std::vector< std::vector< double > >)
function for backup 1
void FAMFit01(std::vector< std::vector< double > >, std::vector< std::vector< double > >)
function for fitting
void setBeamBkgTagFlag(int beambkgtagflag)
set Beam Background Tag flag
void FAMFit03(std::vector< std::vector< double > >, std::vector< std::vector< double > >)
function for backup2
void setAnaTagFlag(int anatagflag)
set flag for saving analysis table
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
Initializes TRGECLFAMModule.
TRGECLFAMModule()
Constructor.
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.
double getDBparmap(const std::map< std::string, double >, std::string, double)
get payload from conditionDB (TRGECLETMParameters)
std::string version(void) const
returns version of TRGECLFAMModule.
virtual ~TRGECLFAMModule()
Destructor.
Abstract base class for different kinds of events.