Belle II Software prerelease-10-00-00a
trg modules
Collaboration diagram for trg modules:

Classes

class  CDCTriggerNeuroDQMModule
 CDC Trigger DQM Module. More...
 
class  CDCTriggerNeuroDQMOnlineModule
 CDC Trigger DQM Module. More...
 
class  CDCTrigger2DFitterModule
 Module for the 2D Fitter of the CDC trigger. More...
 
class  CDCTrigger3DFitterModule
 Module for the 3D Fitter of the CDC trigger. More...
 
class  CDCTriggerHoughCand
 Hough Candidates class. More...
 
class  CDCTriggerHoughETFModule
 
class  CDCTrigger2DFinderModule
 
class  CDCTriggerMCMatcherModule
 A module to match CDCTriggerTracks to MCParticles. More...
 
class  CDCTriggerRecoHitMatcherModule
 A module to match CDCTriggerTracks to RecoTracks. More...
 
class  CDCTriggerRecoMatcherModule
 A module to match CDCTriggerTracks to RecoTracks. More...
 
class  CDCTriggerNDFinderModule
 CDC Trigger NDFinder Module. More...
 
class  CDCTriggerNeuroDataModule
 
class  CDCTriggerNeuroIDHistModule
 Description. More...
 
class  CDCTriggerNeuroModule
 The neural network module of the CDC trigger. More...
 
class  CDCTriggerETFModule
 Module for the Event Time Finder of the CDC trigger. More...
 
class  CDCTriggerTrackCombinerModule
 Module to combine the information from the various track trigger stages. More...
 
class  CDCTriggerTSFFirmwareModule
 This class is the interface between TSim/basf2 TSF module and the firmware simulation core of XSim/ISim. More...
 
class  CDCTriggerTSFModule
 Module for the Track Segment Finder of the CDC trigger. More...
 
class  TRGCDCModule
 A module to simulate the CDC trigger. More...
 
class  TRGCDCT2DDQMModule
 DQM module of TRGCDCT2D. More...
 
class  TRGCDCT3DDQMModule
 DQM module for TRGCDCT3D. More...
 
class  TRGCDCTSFDQMModule
 DQM module of TRGCDCTSF. More...
 
class  TRGCDCTSStreamModule
 A module to process CDC trigger data. More...
 
struct  SubTrigger
 enum class SubTriggerType : unsigned char {Merger, TSF, T2D, T3D, Neuro, ETF}; More...
 
class  CDCTriggerUnpackerModule
 Unpack the trigger data recorded in B2L. More...
 
struct  Merger
 unpacker for the merger reader (TSF which reads the merger output) More...
 
struct  Tracker2D
 unpacker for the 2D tracker More...
 
struct  Neuro< bitwidth, T_bitstream >
 unpacker for the Neuro More...
 
class  MCMatcherTRGECLModule
 Class to represent the hit of one cell. More...
 
class  TRGECLFAMModule
 A module of FAM. More...
 
class  TRGECLModule
 A module of ETM. More...
 
class  TRGECLBGTCHitModule
 
class  TRGECLDQMModule
 module of ecl trigger DQM More...
 
class  TRGECLEventTimingDQMModule
 This module is for ecl trigger DQM related to L1 event timing. More...
 
class  TRGECLQAMModule
 
class  TRGECLRawdataAnalysisModule
 A module of ETM. More...
 
class  TRGECLTimingCalModule
 Class ECL Trigger Timiing Calibration Module. More...
 
class  TRGECLUnpackerModule
 A module of TRG ECL Unpacker. More...
 
class  TRGGDLCosmicRunModule
 Module that returns true if the trigger condition for the 2017 cosmic runs is fulfilled. More...
 
class  TRGGDLModule
 A module to simulate the Global Decision Logic. More...
 
class  TRGEFFDQMModule
 Make summary of data quality from reconstruction. More...
 
class  TRGGDLDQMModule
 
class  TRGGDLDSTModule
 
class  TRGGDLSummaryModule
 
class  TRGGRLMatchModule
 Match between CDC trigger track and ECL trigger cluster. More...
 
class  TRGGRLModule
 A module to simulate the Global Decision Logic. More...
 
class  TRGGRLProjectsModule
 A module to simulate the Global Decision Logic. More...
 
class  TRGGRLDQMModule
 
class  TRGGRLInjectionVetoFromOverlayModule
 Module for adding to MC samples the information about the TRG active veto from beam background overlay files. More...
 
class  GRLNeuroModule
 The module for application of the neural networks of the GRL. More...
 
class  GRLNeuroTrainerModule
 The trainer module for the neural networks of the CDC trigger. More...
 
class  klmtrgLayerCounter
 
class  klmtrgLinearFit
 
class  KLMTriggerModule
 
struct  track_maker_t
 
struct  Linear_fit_of_Hits_t
 
class  TRGTOPDQMModule
 
class  TRGTOPTRD2TTSConverterModule
 TRG TOP Raw Digits to TimeStamps Converter. More...
 
class  TRGTOPUnpackerModule
 TRG TOP Unpacker. More...
 
class  TRGTOPUnpackerWaveformModule
 TRG TOP Unpacker for Timestamps. More...
 
class  TRGTOPWaveformPlotterModule
 
class  TRGRAWDATAModule
 

Typedefs

typedef std::pair< unsigned short, ROOT::Math::XYVector > cdcPair
 Pair of <iSuperLayer, (x, y)>, for hits in conformal space.
 
typedef std::map< int, cdcPaircdcMap
 Map of <counter, cdcPair>, for hits with indices.
 
typedef std::pair< ROOT::Math::XYVector, ROOT::Math::XYVector > coord2dPair
 Hough Tuples.
 
using NodeList = std::vector<std::vector<int> >
 Node list.
 
using MergerBus = std::array<std::bitset<mergerWidth>, nAllMergers>
 Merger data bus.
 
using MergerBits = Bitstream<MergerBus>
 Merger data bus Bitstream.
 

Functions

bool operator== (const CDCTriggerHoughCand &a, const CDCTriggerHoughCand &b)
 Two cells are identical if they have the same coordinates.
 
 REG_MODULE (CDCTriggerNeuroData)
 
 REG_MODULE (CDCTriggerNeuroIDHist)
 
 REG_MODULE (TRGCDC)
 register the basf2 module TRGCDC
 
 REG_MODULE (TRGCDCTSStream)
 register the basf2 TRGCDCTSStream module
 
 REG_MODULE (TRGECLFAM)
 Register module name.
 
 REG_MODULE (TRGECL)
 Register Module.
 
 REG_MODULE (TRGECLBGTCHit)
 Register module name.
 
 REG_MODULE (TRGECLQAM)
 Register module name.
 
 REG_MODULE (TRGECLRawdataAnalysis)
 Register Module.
 
 REG_MODULE (TRGGDL)
 
 REG_MODULE (TRGGRL)
 Register module for TRGGRL.
 
int countBits (uint64_t n)
 
template<typename CONTAINER_T>
uint64_t to_bit_mask (const CONTAINER_T &container)
 
void bitshift (int64_t &out, int64_t &shift, int64_t in, int64_t deltashift)
 
template<typename T>
constexpr int64_t get_index (const T &e, int track_id=0)
 
 CDCTriggerNeuroDataModule ()
 Constructor, for setting module description and parameters.
 
virtual void initialize () override
 Initialize the module.
 
virtual void event () override
 Called once for each event.
 
virtual void terminate () override
 Do the training for all sectors.
 
 CDCTriggerNeuroIDHistModule ()
 Constructor, for setting module description and parameters.
 
virtual void initialize () override
 Initialize the module.
 
virtual void event () override
 Called once for each event.
 
virtual void terminate () override
 Do the training for all sectors.
 
std::string version (void) const
 returns version of TRGCDCModule.
 
 TRGCDCModule ()
 Constructor.
 
virtual ~TRGCDCModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGCDCModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
std::string version (void) const
 returns version of TRGCDCTSStreamModule.
 
 TRGCDCTSStreamModule ()
 Constructor.
 
virtual ~TRGCDCTSStreamModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGCDCTSStreamModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
std::string version (void) const
 returns version of TRGECLFAMModule.
 
 TRGECLFAMModule ()
 Constructor.
 
virtual ~TRGECLFAMModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGECLFAMModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
std::string version (void) const
 returns version of TRGECLModule.
 
 TRGECLModule ()
 Constructor.
 
virtual ~TRGECLModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGECLModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
double getDBparmap (const std::map< std::string, double >, std::string, double)
 get payload from conditionDB
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
std::string version (void) const
 returns version of TRGECLBGTCHitModule.
 
 TRGECLBGTCHitModule ()
 Constructor.
 
virtual ~TRGECLBGTCHitModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGECLBGTCHitModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
void genSimulationObj ()
 Parameters.
 
void genRandomTrgObj ()
 
std::string version () const
 version
 
 TRGECLQAMModule ()
 Constructor.
 
virtual ~TRGECLQAMModule ()
 Destrunctor.
 
virtual void initialize () override
 initialize
 
virtual void beginRun () override
 begin Run
 
virtual void event () override
 Event.
 
virtual void endRun () override
 End Run.
 
virtual void terminate () override
 terminate
 
std::string version (void) const
 returns version of TRGECLModule.
 
 TRGECLRawdataAnalysisModule ()
 Constructor.
 
virtual ~TRGECLRawdataAnalysisModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGECLModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
std::string version (void) const
 returns version of TRGGDLModule.
 
 TRGGDLModule ()
 Constructor.
 
virtual ~TRGGDLModule ()
 Destructor.
 
virtual void defineHisto () override
 Define Histogram.
 
virtual void initialize () override
 Initializes TRGGDLModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
std::string version (void) const
 returns version of TRGGRLModule.
 
 TRGGRLModule ()
 Constructor.
 
virtual ~TRGGRLModule ()
 Destructor.
 
virtual void initialize () override
 Initializes TRGGRLModule.
 
virtual void beginRun () override
 Called when new run started.
 
virtual void event () override
 Called event by event.
 
virtual void endRun () override
 Called when run ended.
 
virtual void terminate () override
 Called when processing ended.
 
void clear_layersUsed ()
 
void add_layersUsed (int layersUsed)
 
void set_NLayerTrigger (int NlayerTrigger)
 
void run (const KLM_TRG_definitions::KLM_Digit_compact_ts &hits)
 
int get_n_sections_trig (int subdetector)
 
int get_triggermask (int subdetector, int section)
 
int get_BKLM_back_to_back_flag (int subdetector)
 
void clear_geometry ()
 
void add_geometry (const KLM_TRG_definitions::KLM_geo_fit_t &geometry)
 
void run (const KLM_TRG_definitions::KLM_Digit_compact_ts &hits)
 
const KLM_TRG_definitions::KLM_trig_linear_fits & get_result () const
 
int get_triggermask (int subdetector, int section)
 
int get_triggermask_or (int subdetector, int section)
 
void set_y_cutoff (int cutoff)
 
void set_intercept_cutoff (int cutoff)
 

Variables

static constexpr int mergerWidth = 256
 Merger data width.
 
static constexpr int nAllMergers = 146
 Number of Mergers.
 
static constexpr int wordWidth = 32
 width of a single word in the raw int buffer
 
static constexpr int nFinesse = 48
 Number of FINESSE in a PCIe40.
 
constexpr Linear_fit_of_Hits_t Linear_fit_of_Hits
 
static const int intNaN = std::numeric_limits<int>::quiet_NaN()
 
static TRGGDL_gdl = 0
 A pointer to a TRGGDL;.
 
static TRGGRL_grl = 0
 A pointer to a TRGGRL;.
 

Detailed Description

Typedef Documentation

◆ cdcMap

typedef std::map< int, cdcPair > cdcMap

Map of <counter, cdcPair>, for hits with indices.

Definition at line 37 of file CDCTriggerHoughETFModule.h.

◆ cdcPair

typedef std::pair< unsigned short, ROOT::Math::XYVector > cdcPair

Pair of <iSuperLayer, (x, y)>, for hits in conformal space.

Definition at line 35 of file CDCTriggerHoughETFModule.h.

◆ coord2dPair

typedef std::pair< ROOT::Math::XYVector, ROOT::Math::XYVector > coord2dPair

Hough Tuples.

Definition at line 39 of file CDCTriggerHoughETFModule.h.

◆ MergerBits

Merger data bus Bitstream.

Definition at line 55 of file CDCTriggerUnpackerModule.h.

◆ MergerBus

using MergerBus = std::array<std::bitset<mergerWidth>, nAllMergers>

Merger data bus.

Definition at line 53 of file CDCTriggerUnpackerModule.h.

◆ NodeList

using NodeList = std::vector<std::vector<int> >

Node list.

Definition at line 42 of file CDCTriggerUnpackerModule.h.

Function Documentation

◆ add_geometry()

void add_geometry ( const KLM_TRG_definitions::KLM_geo_fit_t & geometry)

Definition at line 154 of file klmtrgLinearFit.cc.

155 {
156
157 m_KLMgeomap[get_index(geometry)] = geo_KLM_t{
158 geometry.slopeX,
159 geometry.offsetX,
160 geometry.slopeY,
161 geometry.offsetY
162 };
163
164
165 }

◆ add_layersUsed()

void add_layersUsed ( int layersUsed)

Definition at line 44 of file klmtrgLayerCounter.cc.

45 {
46 m_layersUsed.emplace_back(layersUsed);
47 }

◆ beginRun() [1/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 353 of file TRGCDCModule.cc.

354 {
355 if (TRGDebug::level())
356 cout << "TRGCDCModule ... beginRun called " << endl;
357 }

◆ beginRun() [2/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 102 of file TRGCDCTSStreamModule.cc.

103 {
104
105 _cdc = TRGCDC::getTRGCDC();
106
107 //...Super layer loop...
108 for (unsigned l = 0; l < _cdc->nSegmentLayers(); l++) {
109 const Belle2::TRGCDCLayer* lyr = _cdc->segmentLayer(l);
110 const unsigned nWires = lyr->nCells();
111
112 //...Clear old pointers...
113 _wires[l].clear();
114
115 //...TS loop...
116 for (unsigned i = 0; i < nWires; i++) {
117 const TCSegment& s = (TCSegment&) * (* lyr)[i];
118 _wires[l].push_back(s.wires()[5]);
119 }
120 }
121
122 if (_out) {
123 unsigned val = TRGBSRecord_BeginRun;
124 _out->write((char*) & val, 4);
125 val = 0;
126 _out->write((char*) & val, 4);
127 }
128
129 if (TRGDebug::level())
130 cout << "TRGCDCTSStreamModule ... beginRun called. TRGCDC version="
131 << _cdc->version() << endl;
132 }
unsigned nCells(void) const
returns # of cells.
Definition Layer.h:194

◆ beginRun() [3/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 103 of file TRGECLBGTCHitModule.cc.

104 {
105 B2DEBUG(200, "TRGECLBGTCHitModule ... beginRun called ");
106 }

◆ beginRun() [4/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 131 of file TRGECLFAMModule.cc.

132 {
133 if (!m_ConditionDB) {
134 m_TCEThreshold.resize(576, m_SetTCEThreshold);
135 } else { //Use global tag
136 m_TCEThreshold.resize(576, 0);
137 for (const auto& para : m_FAMPara) {
138 m_TCEThreshold[para.getTCId() - 1] = (int)((para.getThreshold()) * (para.getConversionFactor()));
139 }
140 }
141
142 B2DEBUG(200, "TRGECLFAMModule ... beginRun called ");
143
144 }

◆ beginRun() [5/9]

void beginRun ( void )
overridevirtual

Called when new run started.

read parameters from conditionDB

Reimplemented from Module.

Definition at line 339 of file TRGECLModule.cc.

340 {
341
342 if (m_ConditionDB) {
343
345 DBObjPtr<TRGECLETMParameters> m_ETMParameters;
346
347 const auto& dbParmap = m_ETMParameters->getparMap();
348
349 B2DEBUG(100, "[TRGECLModule] valid N(par) in ETMParameters = "
350 << m_ETMParameters->getnpar());
351 B2DEBUG(100, "[TRGECLModule] all N(par) in ETMParameters = "
352 << dbParmap.size());
353
354 m_ADCtoEnergy = getDBparmap(dbParmap, "adc2energy", 0);
355 m_TotalEnergy = {
356 getDBparmap(dbParmap, "lowe", 100),
357 getDBparmap(dbParmap, "hie", 100),
358 getDBparmap(dbParmap, "lume", 100)
359 };
360 m_2DBhabhaThresholdFWD = {
361 getDBparmap(dbParmap, "bha2d_fw01", 100),
362 getDBparmap(dbParmap, "bha2d_fw02", 100),
363 getDBparmap(dbParmap, "bha2d_fw03", 100),
364 getDBparmap(dbParmap, "bha2d_fw04", 100),
365 getDBparmap(dbParmap, "bha2d_fw05", 100),
366 getDBparmap(dbParmap, "bha2d_fw06", 100),
367 getDBparmap(dbParmap, "bha2d_fw07", 100),
368 getDBparmap(dbParmap, "bha2d_fw08", 100),
369 getDBparmap(dbParmap, "bha2d_fw09", 100),
370 getDBparmap(dbParmap, "bha2d_fw10", 100),
371 getDBparmap(dbParmap, "bha2d_fw11", 100),
372 getDBparmap(dbParmap, "bha2d_fw12", 100),
373 getDBparmap(dbParmap, "bha2d_fw13", 100),
374 getDBparmap(dbParmap, "bha2d_fw14", 100)
375 };
376 m_2DBhabhaThresholdBWD = {
377 getDBparmap(dbParmap, "bha2d_bw01", 100),
378 getDBparmap(dbParmap, "bha2d_bw02", 100),
379 getDBparmap(dbParmap, "bha2d_bw03", 100),
380 getDBparmap(dbParmap, "bha2d_bw04", 100),
381 getDBparmap(dbParmap, "bha2d_bw05", 100),
382 getDBparmap(dbParmap, "bha2d_bw06", 100),
383 getDBparmap(dbParmap, "bha2d_bw07", 100),
384 getDBparmap(dbParmap, "bha2d_bw08", 100),
385 getDBparmap(dbParmap, "bha2d_bw09", 100),
386 getDBparmap(dbParmap, "bha2d_bw10", 100),
387 getDBparmap(dbParmap, "bha2d_bw11", 100),
388 getDBparmap(dbParmap, "bha2d_bw12", 100),
389 getDBparmap(dbParmap, "bha2d_bw13", 100),
390 getDBparmap(dbParmap, "bha2d_bw14", 100)
391 };
392 m_3DBhabhaVetoThreshold = {
393 getDBparmap(dbParmap, "bha3dveto_e_l", 100),
394 getDBparmap(dbParmap, "bha3dveto_e_h", 100)
395 };
396 m_3DBhabhaVetoAngle = {
397 (int) getDBparmap(dbParmap, "bha3dveto_phi_d_l", 0),
398 (int) getDBparmap(dbParmap, "bha3dveto_phi_d_h", 0),
399 (int) getDBparmap(dbParmap, "bha3dveto_theta_s_l", 0),
400 (int) getDBparmap(dbParmap, "bha3dveto_theta_s_h", 0)
401 };
402 m_3DBhabhaSelectionThreshold = {
403 getDBparmap(dbParmap, "bha3dsel_e_l", 100),
404 getDBparmap(dbParmap, "bha3dsel_e_h", 100)
405 };
406 m_3DBhabhaSelectionAngle = {
407 (int) getDBparmap(dbParmap, "bha3dsel_phi_d_l", 0),
408 (int) getDBparmap(dbParmap, "bha3dsel_phi_d_h", 0),
409 (int) getDBparmap(dbParmap, "bha3dsel_theta_s_l", 0),
410 (int) getDBparmap(dbParmap, "bha3dsel_theta_s_h", 0)
411 };
412 m_3DBhabhaSelectionPreScale = {
413 (int) getDBparmap(dbParmap, "bha3dsel_ps_fw", 0),
414 (int) getDBparmap(dbParmap, "bha3dsel_ps_br", 0),
415 (int) getDBparmap(dbParmap, "bha3dsel_ps_bw", 0)
416 };
417 m_mumuThreshold = getDBparmap(dbParmap, "mumu_e", 100);
418 m_mumuAngle = {
419 (int) getDBparmap(dbParmap, "mumu_phi_d_l", 0),
420 (int) getDBparmap(dbParmap, "mumu_phi_d_h", 0),
421 (int) getDBparmap(dbParmap, "mumu_theta_s_l", 0),
422 (int) getDBparmap(dbParmap, "mumu_theta_s_h", 0)
423 };
424 m_lmlCLELabCut = {
425 getDBparmap(dbParmap, "lml_cl_e_lab_1", 100),
426 getDBparmap(dbParmap, "lml_cl_e_lab_2", 100),
427 getDBparmap(dbParmap, "lml_cl_e_lab_3", 100)
428 };
429 m_lmlCLECMSCut = {
430 getDBparmap(dbParmap, "lml_cl_e_cms_1", 100),
431 getDBparmap(dbParmap, "lml_cl_e_cms_2", 100),
432 getDBparmap(dbParmap, "lml_cl_e_cms_3", 100)
433 };
434 m_lml00NCLforMinE = (int) getDBparmap(dbParmap, "lml00_ncl", 100);
435 m_lml12NCLforMinE = (int) getDBparmap(dbParmap, "lml12_ncl", 100);
436 m_lml13ThetaIdSelection = (int) getDBparmap(dbParmap, "lml13_theta_id", 0);
437 m_ECLBurstThreshold = getDBparmap(dbParmap, "e_burst", 100);
438 m_EventTimingQualityThreshold = {
439 getDBparmap(dbParmap, "event_timing_fine", 100),
440 getDBparmap(dbParmap, "event_timing_super", 100)
441 };
442 m_3DBhabhaVetoInTrackThetaRegion = {
443 (int) getDBparmap(dbParmap, "bha3d_theta_id_in_trk_l", 100),
444 (int) getDBparmap(dbParmap, "bha3d_theta_id_in_trk_h", 0)
445 };
446 m_taub2bAngleCut = {
447 (int) getDBparmap(dbParmap, "taub2b_phi_d_l", 0),
448 (int) getDBparmap(dbParmap, "taub2b_phi_d_h", 0),
449 (int) getDBparmap(dbParmap, "taub2b_theta_s_l", 0),
450 (int) getDBparmap(dbParmap, "taub2b_theta_s_h", 0)
451 };
452 m_taub2bCLELabCut = getDBparmap(dbParmap, "taub2b_cl_e", 0);
453 m_taub2bEtotCut = getDBparmap(dbParmap, "taub2b_tot_e", 0);
454 m_hie12BhabhaVetoAngle = {
455 (int) getDBparmap(dbParmap, "hie12_phi_d_l", 0),
456 (int) getDBparmap(dbParmap, "hie12_phi_d_h", 0),
457 (int) getDBparmap(dbParmap, "hie12_theta_s_l", 0),
458 (int) getDBparmap(dbParmap, "hie12_theta_s_h", 0)
459 };
460 m_taub2b2AngleCut = {
461 (int) getDBparmap(dbParmap, "taub2b2_phi_d_l", 0),
462 (int) getDBparmap(dbParmap, "taub2b2_phi_d_h", 0),
463 (int) getDBparmap(dbParmap, "taub2b2_theta_s_l", 0),
464 (int) getDBparmap(dbParmap, "taub2b2_theta_s_h", 0)
465 };
466 m_taub2b2EtotCut = getDBparmap(dbParmap, "taub2b2_tot_e", 0);
467 m_taub2b2CLELabCut = {
468 getDBparmap(dbParmap, "taub2b2_cl_e_endcap", 100),
469 getDBparmap(dbParmap, "taub2b2_cl_e_all", 100)
470 };
471 m_taub2b3AngleCut = {
472 (int) getDBparmap(dbParmap, "taub2b3_phi_d_l", 0),
473 (int) getDBparmap(dbParmap, "taub2b3_phi_d_h", 0),
474 (int) getDBparmap(dbParmap, "taub2b3_theta_s_l", 0),
475 (int) getDBparmap(dbParmap, "taub2b3_theta_s_h", 0)
476 };
477 m_taub2b3EtotCut = getDBparmap(dbParmap, "taub2b3_tot_e", 0);
478 m_taub2b3CLEb2bLabCut = getDBparmap(dbParmap, "taub2b3_cl_e_b2b", 0);
479 m_taub2b3CLELabCut = {
480 getDBparmap(dbParmap, "taub2b3_cl_e_all_l", 100),
481 getDBparmap(dbParmap, "taub2b3_cl_e_all_h", 100)
482 };
483 m_hie4LowCLELabCut = getDBparmap(dbParmap, "hie4_cl_e", 100);
484 }
485 //--------------------------------------------------------
486 //
487 //--------------------------------------------------------
488 B2DEBUG(100, "[TRGECLModule] Clustering method (0 := BelleI, 1 := BelleII) = "
489 << m_Clustering);
490
491 B2DEBUG(100, "[TRGECLModule] ConditionDB usage (0 := no, 1 := yes) = "
492 << m_ConditionDB);
493 B2DEBUG(100, "[TRGECLModule] ADC to Energy in Lab in GeV = "
494 << m_ADCtoEnergy);
495 B2DEBUG(100, "[TRGECLModule] TotalEnergyCut (Low, middle, high) in Lab in GeV = ("
496 << m_TotalEnergy[0] << ", "
497 << m_TotalEnergy[1] << ", "
498 << m_TotalEnergy[2] << ")");
499 B2DEBUG(100, "[TRGECLModule] 2D BhaV E FW in GeV = ("
500 << m_2DBhabhaThresholdFWD[0] << ", "
501 << m_2DBhabhaThresholdFWD[1] << ", "
502 << m_2DBhabhaThresholdFWD[2] << ", "
503 << m_2DBhabhaThresholdFWD[3] << ", "
504 << m_2DBhabhaThresholdFWD[4] << ", "
505 << m_2DBhabhaThresholdFWD[5] << ", "
506 << m_2DBhabhaThresholdFWD[6] << ", "
507 << m_2DBhabhaThresholdFWD[7] << ", "
508 << m_2DBhabhaThresholdFWD[8] << ", "
509 << m_2DBhabhaThresholdFWD[9] << ", "
510 << m_2DBhabhaThresholdFWD[10] << ", "
511 << m_2DBhabhaThresholdFWD[11] << ", "
512 << m_2DBhabhaThresholdFWD[12] << ", "
513 << m_2DBhabhaThresholdFWD[13] << ")");
514 B2DEBUG(100, "[TRGECLModule] 2D BhaV E BW in GeV = ("
515 << m_2DBhabhaThresholdBWD[0] << ", "
516 << m_2DBhabhaThresholdBWD[1] << ", "
517 << m_2DBhabhaThresholdBWD[2] << ", "
518 << m_2DBhabhaThresholdBWD[3] << ", "
519 << m_2DBhabhaThresholdBWD[4] << ", "
520 << m_2DBhabhaThresholdBWD[5] << ", "
521 << m_2DBhabhaThresholdBWD[6] << ", "
522 << m_2DBhabhaThresholdBWD[7] << ", "
523 << m_2DBhabhaThresholdBWD[8] << ", "
524 << m_2DBhabhaThresholdBWD[9] << ", "
525 << m_2DBhabhaThresholdBWD[10] << ", "
526 << m_2DBhabhaThresholdBWD[11] << ", "
527 << m_2DBhabhaThresholdBWD[12] << ", "
528 << m_2DBhabhaThresholdBWD[13] << ")");
529 B2DEBUG(100, "[TRGECLModule] 3D Bhabha veto CL E Threshold in CMS in GeV (Low, High) = ("
530 << m_3DBhabhaVetoThreshold[0] << ", "
531 << m_3DBhabhaVetoThreshold[1] << ")");
532 B2DEBUG(100, "[TRGECLModule] 3D Bhabha veto 2 CL angles in CMS in degree(dphi L, H, theta sum L, H) = ("
533 << m_3DBhabhaVetoAngle[0] << ", "
534 << m_3DBhabhaVetoAngle[1] << ", "
535 << m_3DBhabhaVetoAngle[2] << ", "
536 << m_3DBhabhaVetoAngle[3] << ")");
537 B2DEBUG(100, "[TRGECLModule] 3D Bhabha selection CL E Threshold in CMS in GeV (Low, High) = ("
538 << m_3DBhabhaSelectionThreshold[0] << ", "
539 << m_3DBhabhaSelectionThreshold[1] << ")");
540 B2DEBUG(100, "[TRGECLModule] 3D Bhabha selection 2 CL angles in CMS in degree(dphi L, H, theta sum L, H) = ("
541 << m_3DBhabhaSelectionAngle[0] << ", "
542 << m_3DBhabhaSelectionAngle[1] << ", "
543 << m_3DBhabhaSelectionAngle[2] << ", "
544 << m_3DBhabhaSelectionAngle[3] << ")");
545 B2DEBUG(100, "[TRGECLModule] 3D Bhabha selection prescale(FW, BR, BW) = ("
546 << m_3DBhabhaSelectionPreScale[0] << ", "
547 << m_3DBhabhaSelectionPreScale[1] << ", "
548 << m_3DBhabhaSelectionPreScale[2] << ")");
549 B2DEBUG(100, "[TRGECLModule] mumu CL E Threshold in CMS in GeV = "
550 << m_mumuThreshold);
551 B2DEBUG(100, "[TRGECLModule] mumu 2 CL angles in CMS in degree(dphi L, H, theta sum L, H) = ("
552 << m_mumuAngle[0] << ", "
553 << m_mumuAngle[1] << ", "
554 << m_mumuAngle[2] << ", "
555 << m_mumuAngle[3] << ")");
556 B2DEBUG(100, "[TRGECLModule] lml CL E cuts(high, mid, low) in Lab in GeV = ("
557 << m_lmlCLELabCut[0] << ", "
558 << m_lmlCLELabCut[1] << ", "
559 << m_lmlCLELabCut[2] << ")");
560 B2DEBUG(100, "[TRGECLModule] lml CL E cuts(high, mid, low) in CMS in GeV = ("
561 << m_lmlCLECMSCut[0] << ", "
562 << m_lmlCLECMSCut[1] << ", "
563 << m_lmlCLECMSCut[2] << ")");
564 B2DEBUG(100, "[TRGECLModule] lml00 the number of cluster for minimum energy cluster = "
565 << m_lml00NCLforMinE);
566 B2DEBUG(100, "[TRGECLModule] lml12 the number of cluster for minimum energy cluster = "
567 << m_lml12NCLforMinE);
568 B2DEBUG(100, "[TRGECLModule] lml13 ThetaID selection = "
569 << m_lml13ThetaIdSelection);
570 B2DEBUG(100, "[TRGECLModule] ECL Burst Threshold in lab. in GeV = "
571 << m_ECLBurstThreshold);
572 B2DEBUG(100, "[TRGECLModule] EventTimingQualityThreshold (low, high)= ("
573 << m_EventTimingQualityThreshold[0] << ", "
574 << m_EventTimingQualityThreshold[1] << ") (GeV)");
575 B2DEBUG(100, "[TRGECLModule] 3DBhabhaVetoInTrackThetaRegion (low, high) = ("
576 << m_3DBhabhaVetoInTrackThetaRegion[0] << ", "
577 << m_3DBhabhaVetoInTrackThetaRegion[1] << ")");
578 B2DEBUG(100, "[TRGECLModule] Taub2b two CL Angle cut in CM (degree) (dphi L, H, theta sum L, H ) = ("
579 << m_taub2bAngleCut[0] << ", "
580 << m_taub2bAngleCut[1] << ", "
581 << m_taub2bAngleCut[2] << ", "
582 << m_taub2bAngleCut[3] << ")");
583 B2DEBUG(100, "[TRGECLModule] Taub2b Total Energy Cut in lab. (GeV) = "
584 << m_taub2bEtotCut);
585 B2DEBUG(100, "[TRGECLModule] Taub2b Cluster Energy Cut in lab. (GeV) = "
586 << m_taub2bCLELabCut);
587 B2DEBUG(100, "[TRGECLModule] hie12 Bhabha Add Angle cut in CM (degree) (dphi L, H, theta sum L, H) = ("
588 << m_hie12BhabhaVetoAngle[0] << ", "
589 << m_hie12BhabhaVetoAngle[1] << ", "
590 << m_hie12BhabhaVetoAngle[2] << ", "
591 << m_hie12BhabhaVetoAngle[3] << ")");
592 B2DEBUG(100, "[TRGECLModule] Taub2b2 two CL Angle cut in CM (degree) (dphi L, H, theta sum L, H) = ("
593 << m_taub2b2AngleCut[0] << ", "
594 << m_taub2b2AngleCut[1] << ", "
595 << m_taub2b2AngleCut[2] << ", "
596 << m_taub2b2AngleCut[3] << ")");
597 B2DEBUG(100, "[TRGECLModule] Taub2b2 Total Energy Cut in lab. (GeV) = "
598 << m_taub2b2EtotCut);
599 B2DEBUG(100, "[TRGECLModule] Taub2b2 Cluster energy cut(high, low) in lab. (GeV) = ("
600 << m_taub2b2CLELabCut[0] << ", "
601 << m_taub2b2CLELabCut[1] << ")");
602 B2DEBUG(100, "[TRGECLModule] Taub2b3 two CL Angle cut in CM (degree) (dphi L, H, theta sum L, H) = ("
603 << m_taub2b3AngleCut[0] << ", "
604 << m_taub2b3AngleCut[1] << ", "
605 << m_taub2b3AngleCut[2] << ", "
606 << m_taub2b3AngleCut[3] << ")");
607 B2DEBUG(100, "[TRGECLModule] Taub2b3 Total Energy Cut in lab. (GeV) = "
608 << m_taub2b3EtotCut);
609 B2DEBUG(100, "[TRGECLModule] Taub2b3 Cluster energy cut in lab. for one of b2b clusters (GeV) = "
610 << m_taub2b3CLEb2bLabCut);
611 B2DEBUG(100, "[TRGECLModule] Taub2b3 Cluster energy cut(low, high) in lab. for all clusters (GeV) = ("
612 << m_taub2b3CLELabCut[0] << ", "
613 << m_taub2b3CLELabCut[1] << ")");
614 B2DEBUG(100, "[TRGECLModule] (hie4) CL E cut for minimum energy cluster = "
615 << m_hie4LowCLELabCut);
616
617 // set parameters to TRGECLMaster
618 etm->initialize();
619 etm->setClusterMethod(m_Clustering);
620 etm->setClusterLimit(m_ClusterLimit);
621 etm->setBhabhaMethod(m_Bhabha);
622 etm->setEventTimingMethod(m_EventTiming);
623 etm->setTimeWindow(m_TimeWindow);
624 etm->setOverlapWindow(m_OverlapWindow);
625 etm->setNofTopTC(m_NofTopTC);
626 //
627 etm->setADCtoEnergy(m_ADCtoEnergy);
628 etm->setTotalEnergyThreshold(m_TotalEnergy);
629 etm->set2DBhabhaThreshold(m_2DBhabhaThresholdFWD,
630 m_2DBhabhaThresholdBWD);
631 etm->set3DBhabhaVetoThreshold(m_3DBhabhaVetoThreshold);
632 etm->set3DBhabhaVetoAngle(m_3DBhabhaVetoAngle);
633 etm->set3DBhabhaSelectionThreshold(m_3DBhabhaSelectionThreshold);
634 etm->set3DBhabhaSelectionAngle(m_3DBhabhaSelectionAngle);
635 etm->set3DBhabhaSelectionPreScale(m_3DBhabhaSelectionPreScale);
636 etm->setmumuThreshold(m_mumuThreshold);
637 etm->setmumuAngle(m_mumuAngle);
638 etm->setlmlCLELabCut(m_lmlCLELabCut);
639 etm->setlmlCLECMSCut(m_lmlCLECMSCut);
640 etm->setlml00NCLforMinE(m_lml00NCLforMinE);
641 etm->setlml12NCLforMinE(m_lml12NCLforMinE);
642 etm->setlml13ThetaIdSelection(m_lml13ThetaIdSelection);
643 etm->setECLBurstThreshold(m_ECLBurstThreshold);
644 etm->setEventTimingQualityThreshold(m_EventTimingQualityThreshold);
645 etm->set3DBhabhaVetoInTrackThetaRegion(m_3DBhabhaVetoInTrackThetaRegion);
646 etm->setTaub2bAngleCut(m_taub2bAngleCut);
647 etm->setTaub2bEtotCut(m_taub2bEtotCut);
648 etm->setTaub2bCLELabCut(m_taub2bCLELabCut);
649 etm->sethie12BhabhaVetoAngle(m_hie12BhabhaVetoAngle);
650 etm->setTaub2b2Cut(m_taub2b2AngleCut,
651 m_taub2b2EtotCut,
652 m_taub2b2CLELabCut);
653 etm->setTaub2b3Cut(m_taub2b3AngleCut,
654 m_taub2b3EtotCut,
655 m_taub2b3CLEb2bLabCut,
656 m_taub2b3CLELabCut);
657 etm->sethie4LowCLELabCut(m_hie4LowCLELabCut);
658
659 if (TRGDebug::level()) {
660 std::cout << "TRGECLModule ... beginRun called " << std::endl;
661 }
662
663 }

◆ beginRun() [6/9]

void beginRun ( void )
overridevirtual

begin Run

Reimplemented from Module.

Definition at line 133 of file TRGECLQAMModule.cc.

134 {
135
136 B2DEBUG(200, "TRGECLQAMModule ... beginRun called ");
137
138 }

◆ beginRun() [7/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 97 of file TRGECLRawdataAnalysisModule.cc.

98 {
99
100 if (TRGDebug::level()) {
101 std::cout << "TRGECLRawdataAnalysisModule ... beginRun called " << std::endl;
102 }
103 // _ecl = TrgEcl::getTrgEcl();
104
105 }

◆ beginRun() [8/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from HistoModule.

Definition at line 147 of file TRGGDLModule.cc.

148 {
149
150 //...GDL config. name...
151 string cfn = _configFilename;
152
153 //...GDL...
154 if (_gdl == 0) {
155 _gdl = TRGGDL::getTRGGDL(cfn,
156 _simulationMode,
157 _fastSimulationMode,
158 _firmwareSimulationMode,
159 _Phase,
160 _algFromDB,
161 _algFilePath,
162 _debugLevel,
163 _timquality_threshold_sfin,
164 _timquality_threshold_fine);
165 } else if (cfn != _gdl->configFile()) {
166 _gdl = TRGGDL::getTRGGDL(cfn,
167 _simulationMode,
168 _fastSimulationMode,
169 _firmwareSimulationMode,
170 _Phase,
171 _algFromDB,
172 _algFilePath,
173 _debugLevel,
174 _timquality_threshold_sfin,
175 _timquality_threshold_fine);
176 }
177 if (_debugLevel > 9) printf("TRGGDLModule::beginRun() ends.\n");
178
179 _gdl->checkDatabase();
180
181 B2DEBUG(100, "TRGGDLModule ... beginRun called configFile = " << cfn);
182 }

◆ beginRun() [9/9]

void beginRun ( void )
overridevirtual

Called when new run started.

Reimplemented from Module.

Definition at line 86 of file TRGGRLModule.cc.

87 {
88
89 //...GDL config. name...
90 string cfn = _configFilename;
91
92 //...GRL...
93 if (_grl == 0) {
94 _grl = TRGGRL::getTRGGRL(cfn,
95 _simulationMode,
96 _fastSimulationMode,
97 _firmwareSimulationMode);
98 } else if (cfn != _grl->configFile()) {
99 _grl = TRGGRL::getTRGGRL(cfn,
100 _simulationMode,
101 _fastSimulationMode,
102 _firmwareSimulationMode);
103 }
104
105 B2DEBUG(300, "TRGGDLModule ... beginRun called configFile = " << cfn);
106
107 }

◆ bitshift()

void bitshift ( int64_t & out,
int64_t & shift,
int64_t in,
int64_t deltashift )

Definition at line 31 of file klmtrgLinearFit.cc.

32 {
33 int64_t mask = 0xFFFFFF;
34 if (((mask << deltashift) & in) > 0) {
35 throw std::runtime_error("bitshift error");
36 }
37
38 out |= (in << shift);
39 shift += deltashift;
40 }

◆ CDCTriggerNeuroDataModule()

Constructor, for setting module description and parameters.

Definition at line 42 of file CDCTriggerNeuroDataModule.cc.

42 : Module()
43 {
44 setDescription(
45 "This module takes 2dtracks, track segments, and targettracks (either recotracks or mcparticles) as input and generates training data for the neurotrigger in a tab separated, gzip compressed file."
46 );
47 // parameters for saving / loading
48 addParam("hitCollectionName", m_hitCollectionName,
49 "Name of the input StoreArray of CDCTriggerSegmentHits. The Axials need to have a relation to inputtracks",
50 std::string(""));
51 addParam("inputCollectionName", m_inputCollectionName,
52 "Name of the StoreArray holding the 2D input tracks.",
53 std::string("CDCTriggerNNInput2DTracks"));
54 addParam("targetCollectionName", m_targetCollectionName,
55 "Name of the MCParticle/RecoTrack collection used as target values.",
56 std::string("RecoTracks"));
57 addParam("trainOnRecoTracks", m_trainOnRecoTracks,
58 "If true, use RecoTracks as targets instead of MCParticles.",
59 true);
60 addParam("EventTimeName", m_EventTimeName,
61 "Name of the event time object.",
62 std::string("CDCTriggerNeuroETFT0"));
63 addParam("NeuroTrackInputMode", m_neuroTrackInputMode,
64 "When using real tracks, use neurotracks instead of 2dtracks as input to the neurotrigger. this is important to get the relations right.",
65 false);
66 addParam("singleUse", m_singleUse,
67 "Only use a track for a single expert", true);
68 addParam("configFileName", m_configFileName,
69 "Name of the configuration file. This File should be created by the CDCTriggerIDHistModule and will be extended in this module",
70 std::string(""));
71 addParam("writeconfigFileName", m_writeconfigFileName,
72 "Name of the configuration file, which will be written. If left blank, the same file as the input configuration file is used and it will be overwritten.",
73 std::string(""));
74 addParam("gzipFilename", m_filename,
75 "Name of the gzip file, where the training samples will be saved.",
76 std::string("out.gz"));
77 addParam("SaveFakeTrack", m_SaveFakeTrack,
78 "Flag for whether save fake track or not",
79 false);
80
81
82
83 }

◆ CDCTriggerNeuroIDHistModule()

Constructor, for setting module description and parameters.

Definition at line 38 of file CDCTriggerNeuroIDHistModule.cc.

38 : Module()
39 {
40 setDescription(
41 "description" //TODO
42 );
43 // parameters for saving / loading
44 addParam("hitCollectionName", m_hitCollectionName,
45 "Name of the input StoreArray of CDCTriggerSegmentHits.",
46 std::string(""));
47 addParam("inputCollectionName", m_inputCollectionName,
48 "Name of the StoreArray holding the 2D input tracks.",
49 std::string("TRGCDC2DFinderTracks"));
50 addParam("trainOnRecoTracks", m_trainOnRecoTracks,
51 "If true, use RecoTracks as targets instead of MCParticles.",
52 false);
53 addParam("targetCollectionName", m_targetCollectionName,
54 "Name of the MCParticle/RecoTrack collection used as target values.",
55 std::string("MCParticles"));
56 addParam("writeconfigfile", m_writeconfigFileName,
57 "Name of the config file, where all the parameters and the IDHist configuration is written.",
58 std::string(""));
59 addParam("configfile", m_configFileName,
60 "Name of the config file, where all the parameters and the IDHist configuration is read in from.",
61 std::string(""));
62 addParam("MaxEvents", m_nPrepare,
63 "amount of events used for creating the IDHist. If it is 0, "
64 "all Events are used.",
65 0);
66
67 }

◆ clear_geometry()

void clear_geometry ( )

Definition at line 148 of file klmtrgLinearFit.cc.

149 {
150 m_KLMgeomap.clear();
151
152 }

◆ clear_layersUsed()

void clear_layersUsed ( )

Definition at line 39 of file klmtrgLayerCounter.cc.

40 {
41 m_layersUsed.clear();
42 }

◆ countBits()

int countBits ( uint64_t n)
inline

Definition at line 21 of file bit_operations.h.

22 {
23 return static_cast<int>(std::bitset<64>(n).count());
24 }

◆ defineHisto()

void defineHisto ( )
overridevirtual

Define Histogram.

Reimplemented from HistoModule.

Definition at line 109 of file TRGGDLModule.cc.

110 {
111
112 oldDir = gDirectory;
113 newDir = gDirectory;
114 oldDir->mkdir("TRGGDLModule");
115 newDir->cd("TRGGDLModule");
116
117 h_inp = new TH1I("hTRGGDL_inp", "input bits from TRGGDLModule", 200, 0, 200);
118 h_ftd = new TH1I("hTRGGDL_ftd", "ftdl bits from TRGGDLModule", 200, 0, 200);
119 h_psn = new TH1I("hTRGGDL_psn", "psnm bits from TRGGDLModule", 200, 0, 200);
120
121 oldDir->cd();
122
123 }

◆ endRun() [1/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 391 of file TRGCDCModule.cc.

392 {
393 if (TRGDebug::level())
394 cout << "TRGCDCModule ... endRun called " << endl;
395 }

◆ endRun() [2/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 203 of file TRGCDCTSStreamModule.cc.

204 {
205 if (_out) {
206 unsigned val = TRGBSRecord_EndRun;
207 _out->write((char*) & val, 4);
208 val = 0;
209 _out->write((char*) & val, 4);
210 }
211
212 if (TRGDebug::level())
213 cout << "TRGCDCTSStreamModule ... endRun called " << endl;
214 }

◆ endRun() [3/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 125 of file TRGECLBGTCHitModule.cc.

126 {
127 B2DEBUG(200, "TRGECLBGTCHitModule ... endRun called ");
128 }

◆ endRun() [4/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 224 of file TRGECLFAMModule.cc.

225 {
226 B2DEBUG(200, "TRGECLFAMModule ... endRun called ");
227 }

◆ endRun() [5/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 709 of file TRGECLModule.cc.

710 {
711 if (TRGDebug::level()) {
712 std::cout << "TRGECLModule ... endRun called " << std::endl;
713 }
714 }

◆ endRun() [6/9]

void endRun ( void )
overridevirtual

End Run.

Reimplemented from Module.

Definition at line 202 of file TRGECLQAMModule.cc.

203 {
204
205 double mean_FWD = 0;
206 double mean_BAR = 0;
207 double mean_BWD = 0;
208
209 //QAM TC Hit Map Check
210 for (int TCId = 1; TCId < 577; TCId++) {
211 if (TCId < 81) { //Forward Endcap
212 mean_FWD += TCID[TCId - 1];
213 } else if (TCId < 513) { //Barrel
214 mean_BAR += TCID[TCId - 1];
215 } else { //Backward Endcap
216 mean_BWD += TCID[TCId - 1];
217 }
218 }
219 mean_FWD /= 80;
220 mean_BAR /= (512 - 80);
221 mean_BWD /= (576 - 512);
222
223 for (int TCId = 1; TCId < 577; TCId++) {
224 if (TCId < 81) { //Forward Endcap
225 if (TCID[TCId - 1] < mean_FWD * 0.1)m_FWD++;
226 } else if (TCId < 513) { //Barrel
227 if (TCID[TCId - 1] < mean_BAR * 0.1)m_BAR++;
228 } else { //Backward Endcap
229 if (TCID[TCId - 1] < mean_BWD * 0.1)m_BWD++;
230 }
231 }
232
233 m_ALL = m_FWD + m_BAR + m_BWD;
234 const int etot_size = etot.size();
235 for (int i = 0; i < etot_size; i++) {
236 h_etot->Fill(etot[i]);
237 }
238 //Caluate E_total peak and width
239
240 RooRealVar* E_tot = new RooRealVar("E_tot", "E_tot", 0, 4000);
241 RooDataHist* data_E_tot = new RooDataHist("data_E_tot", "dataset with E_tot", *E_tot, h_etot);
242 RooRealVar* mean_check = new RooRealVar("mean_check", "Mean for checking", 2000, 1000, 3000);
243 RooRealVar* sigma_check = new RooRealVar("sigma_check", "Sigma for checking", 100, 0, 300);
244 RooGaussian* gauss_check = new RooGaussian("gauss_check", "Gaussian for checking", *E_tot, *mean_check, *sigma_check);
245 gauss_check->fitTo(*data_E_tot);
246 double mean_ch = mean_check->getVal();
247
248 RooRealVar* mean_E_tot = new RooRealVar("mean_E_tot", "Mean of Gaussian", mean_ch, mean_ch - 200, mean_ch + 200);
249 // RooRealVar sigma_E_tot("sigma_E_tot","Width of Gaussian", 10, 0, 50);
250
251 RooRealVar* sigma1_E_tot = new RooRealVar("sigma1_E_tot", "Width of Gaussian", 30, 0, 60);
252 RooGaussian* gauss1_E_tot = new RooGaussian("gauss1_E_tot", "gauss(x,mean,sigma)", *E_tot, *mean_E_tot, *sigma1_E_tot);
253 RooRealVar* sigma2_E_tot = new RooRealVar("sigma2_E_tot", "Width of Gaussian", 100, 30, 250);
254 RooGaussian* gauss2_E_tot = new RooGaussian("gauss2_E_tot", "gauss(x,mean,sigma)", *E_tot, *mean_E_tot, *sigma2_E_tot);
255
256 RooRealVar* frac_core_E_tot = new RooRealVar("frac_core", "core fraction", 0.85, 0.0, 1.0);
257 RooAddModel* gaussm_E_tot = new RooAddModel("gaussm", "core+tail gauss", RooArgList(*gauss1_E_tot, *gauss2_E_tot),
258 RooArgList(*frac_core_E_tot));
259
260 // RooGaussian gauss_E_tot("gauss_E_tot","gauss(x,mean,sigma)",E_tot,mean_E_tot,sigma_E_tot);
261
262 gaussm_E_tot->fitTo(*data_E_tot, RooFit::Range(mean_ch - 300, mean_ch + 300));
263 //RooPlot* xframe_E_tot = E_tot->frame();
264 RooPlot* xframe_E_tot = E_tot->frame(RooFit::Title("energy_tot"));
265 //data_E_tot->plotOn(xframe_E_tot);
266 data_E_tot->plotOn(xframe_E_tot, RooFit::MarkerStyle(7));
267 // gauss_E_tot->plotOn(xframe_E_tot);
268 gaussm_E_tot->plotOn(xframe_E_tot, RooFit::Name("Cal_energy"), RooFit::LineColor(2));
269 double v_m_E_tot = mean_E_tot->getVal();
270 double e_m_E_tot = mean_E_tot->getError();
271
272 double v1_s1_E_tot = sigma1_E_tot->getVal();
273 // double e1_s1_E_tot = sigma1_E_tot->getError();
274 double v2_s1_E_tot = sigma2_E_tot->getVal();
275 // double e2_s1_E_tot = sigma2_E_tot->getError();
276
277 double frac_E_tot = frac_core_E_tot->getVal();
278 double v_s1_E_tot = v1_s1_E_tot * (frac_E_tot) + v2_s1_E_tot * (1 - frac_E_tot);
279
280
281
282 for (long unsigned int ii = 0; ii < caltime.size(); ii++) {
283 h_caltime->Fill(caltime[ii]);
284 }
285
286
287 //Calculate Caltime peak and width
288 RooRealVar T_c("T_c", "T_c", -100, 100);
289 RooDataHist data_T_c("data_T_c", "dataset with T_c", T_c, h_caltime);
290
291 RooRealVar mean_T_c("mean_T_c", "Mean of Gaussian", 0, -100, 100);
292 RooRealVar sigma1_T_c("sigma1_T_c", "Width of Gaussian", 10, 0, 50);
293 RooGaussian gauss1_T_c("gauss1_T_c", "gauss(x,mean,sigma)", T_c, mean_T_c, sigma1_T_c);
294 RooRealVar sigma2_T_c("sigma2_T_c", "Width of Gaussian", 30, 10, 100);
295 RooGaussian gauss2_T_c("gauss2_T_c", "gauss(x,mean,sigma)", T_c, mean_T_c, sigma2_T_c);
296
297 RooRealVar frac_core_T_c("frac_core", "core fraction", 0.85, 0.0, 1.0);
298 RooAddModel gaussm_T_c("gaussm", "core+tail gauss", RooArgList(gauss1_T_c, gauss2_T_c), RooArgList(frac_core_T_c));
299
300 gaussm_T_c.fitTo(data_T_c, RooFit::Range(-45, 45));
301 RooPlot* xframe_T_c = T_c.frame(RooFit::Title("Caltime"));
302 data_T_c.plotOn(xframe_T_c, RooFit::MarkerStyle(7));
303 gaussm_T_c.plotOn(xframe_T_c, RooFit::Name("Caltime"), RooFit::LineColor(2));
304 gaussm_T_c.plotOn(xframe_T_c, RooFit::Components("gauss1_T_c"), RooFit::LineColor(kGreen));
305 gaussm_T_c.plotOn(xframe_T_c, RooFit::Components("gauss2_T_c"), RooFit::LineColor(kMagenta));
306
307 xframe_T_c->GetXaxis()->SetTitle("Caltime[ns]");
308 xframe_T_c->GetYaxis()->SetTitle("Entries");
309
310 double v_m_T_c = mean_T_c.getVal();
311 double e_m_T_c = mean_T_c.getError();
312
313 double v1_s1_T_c = sigma1_T_c.getVal();
314 // double e1_s1_T_c = sigma1_T_c.getError();
315 double v2_s1_T_c = sigma2_T_c.getVal();
316 // double e2_s1_T_c = sigma2_T_c.getError();
317
318 double frac_T_c = frac_core_T_c.getVal();
319 double v_s1_T_c = v1_s1_T_c * (frac_T_c) + v2_s1_T_c * (1 - frac_T_c);
320
321
322
323 //Cluster E sum for Bhabha skim
324 const int cluster_size = cluster.size();
325 for (int ii = 0; ii < cluster_size; ii++) {
326 h_clusterE->Fill(cluster[ii]);
327 }
328
329 RooRealVar x("x", "esum", 0, 4000);
330 RooDataHist dh("dh", "ecltrg", x, h_clusterE);
331
332 RooRealVar mean("mean", "mean", 2000, 1000, 2500);
333 RooRealVar sigma("sigma", "sigma", 150, 0, 300);
334 RooRealVar tail("tail", "tail", 0.45, 0, 1);
335 RooNovosibirsk novo("novo", "", x, mean, sigma, tail);
336 novo.fitTo(dh, RooFit::Extended(0), RooFit::Range(1500, 2200));
337
338
339 double clusterE_vm, clusterE_em, clusterE_vs;
340
341 clusterE_vm = mean.getVal();
342 clusterE_em = mean.getError();
343 clusterE_vs = sigma.getVal();
344
345
346 TString outputfile = m_outputfile;
347 TFile file(outputfile, "RECREATE");
348 TTree* tree = new TTree("tree", "tree");
349 int nevent;
350 double FWD;
351 double BAR;
352 double BWD;
353 double ALL;
354
355 nevent = m_nevent;
356 FWD = m_FWD;
357 BAR = m_BAR;
358 BWD = m_BWD;
359 ALL = m_ALL;
360
361 m_etot_mean = v_m_E_tot;
362 m_etot_error = e_m_E_tot;
363 m_etot_sigma = v_s1_E_tot;
364
365 m_caltime_mean = v_m_T_c;
366 m_caltime_error = e_m_T_c;
367 m_caltime_sigma = v_s1_T_c;
368
369 tree->Branch("m_nRun", &m_nRun, "m_nRun/I");
370 tree->Branch("m_nevent", &nevent, "m_nevent/I");
371 tree->Branch("m_FWD", &FWD, "m_FWD/D");
372 tree->Branch("m_BAR", &BAR, "m_BAR/D");
373 tree->Branch("m_BWD", &BWD, "m_BWD/D");
374 tree->Branch("m_ALL", &ALL, "m_ALL/D");
375 tree->Branch("m_etot_mean", &m_etot_mean, "m_etot_mean/D");
376 tree->Branch("m_etot_error", &m_etot_error, "m_etot_error/D");
377 tree->Branch("m_etot_sigma", &m_etot_sigma, "m_etot_sigma/D");
378 tree->Branch("m_caltime_mean", &m_caltime_mean, "m_caltime_mean/D");
379 tree->Branch("m_caltime_error", &m_caltime_error, "m_caltime_error/D");
380 tree->Branch("m_caltime_sigma", &m_caltime_sigma, "m_caltime_sigma/D");
381 tree->Branch("m_clusterE_mean", &clusterE_vm, "m_clusterE_mean/D");
382 tree->Branch("m_clusterE_error", &clusterE_em, "m_clusterE_error/D");
383 tree->Branch("m_clusterE_sigma", &clusterE_vs, "m_clusterE_sigma/D");
384
385 tree->Fill();
386 tree->Write();
387 file.Close();
388
389
390
391 B2INFO("ECL Trigger QAM result "
392 << LogVar("Run Number", m_nRun)
393 << LogVar("Total Event", nevent)
394 << LogVar("The # of Low Hit TC in Forward Endcap", FWD)
395 << LogVar("The # of Low Hit TC in Barrel", BAR)
396 << LogVar("The # of Low Hit TC in Backward Endcap", BWD)
397 << LogVar("Total Energy Peak", m_etot_mean)
398 << LogVar("Total Energy Peak width", m_etot_sigma)
399 << LogVar("Caltime Peak", m_caltime_mean)
400 << LogVar("Caltime Peak width", m_caltime_sigma)
401 << LogVar("Cluster Energy Peak", clusterE_vm)
402 << LogVar("Cluster Energy Peak width", clusterE_vs));
403
404
405 B2DEBUG(100, "TRGECLQAMModule ... endRun called ");
406
407 }

◆ endRun() [7/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 184 of file TRGECLRawdataAnalysisModule.cc.

185 {
186 if (TRGDebug::level()) {
187 std::cout << "TRGECLRawdataAnalysisModule ... endRun called " << std::endl;
188 }
189 }

◆ endRun() [8/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from HistoModule.

Definition at line 212 of file TRGGDLModule.cc.

213 {
214 B2DEBUG(200, "TRGGDLModule ... endRun called ");
215 }

◆ endRun() [9/9]

void endRun ( void )
overridevirtual

Called when run ended.

Reimplemented from Module.

Definition at line 120 of file TRGGRLModule.cc.

121 {
122 B2DEBUG(300, "TRGGRLModule ... endRun called ");
123 }

◆ event() [1/11]

void event ( void )
overridevirtual

Called once for each event.

Prepare input and target for each track and store it.

Reimplemented from Module.

Definition at line 137 of file CDCTriggerNeuroDataModule.cc.

138 {
139 StoreObjPtr<EventMetaData> evtmetadata;
140 B2DEBUG(150, Form("Number of Track : %d", m_tracks.getEntries()));
141 for (int itrack = 0; itrack < m_tracks.getEntries(); ++itrack) {
142 // get related MCParticle/RecoTrack for target
143 // and retrieve track parameters
144 //float phi0Target = 0;
145 //float invptTarget = 0;
146 float thetaTarget = 0;
147 float zTarget = 0;
148 float PtTarget = 0;
149 bool isFakeTrack = false;
150
151 if (m_trainOnRecoTracks) {
152 RecoTrack* recoTrack =
153 m_tracks[itrack]->getRelatedTo<RecoTrack>(m_targetCollectionName);
154 if (!recoTrack) {
155 if (m_SaveFakeTrack)
156 isFakeTrack = true;
157 else {
158 B2DEBUG(150, "Skipping CDCTriggerTrack without relation to RecoTrack.");
159 continue;
160 }
161 } else {
162 // a RecoTrack has multiple representations for different particle hypothesis
163 // -> just take the first one that does not give errors.
164 const std::vector<genfit::AbsTrackRep*>& reps = recoTrack->getRepresentations();
165 bool foundValidRep = false;
166 for (unsigned irep = 0; irep < reps.size() && !foundValidRep; ++irep) {
167 if (!recoTrack->wasFitSuccessful(reps[irep])) {
168 continue;
169 }
170
171 // get state (position, momentum etc.) from hit closest to IP and
172 // extrapolate to z-axis (may throw an exception -> continue to next representation)
173 try {
174 genfit::MeasuredStateOnPlane state =
175 recoTrack->getMeasuredStateOnPlaneClosestTo(ROOT::Math::XYZVector(0, 0, 0), reps[irep]);
176 reps[irep]->extrapolateToLine(state, TVector3(0, 0, -1000), TVector3(0, 0, 2000));
177 // flip tracks if necessary, such that trigger tracks and reco tracks
178 // point in the same direction
179 if (state.getMom().Dot(B2Vector3D(m_tracks[itrack]->getDirection())) < 0) {
180 state.setPosMom(state.getPos(), -state.getMom());
181 state.setChargeSign(-state.getCharge());
182 }
183 // get track parameters
184 //phi0Target = state.getMom().Phi();
185 //invptTarget = state.getCharge() / state.getMom().Pt();
186 thetaTarget = state.getMom().Theta();
187 zTarget = state.getPos().Z();
188 PtTarget = state.getMom().Pt();
189 } catch (...) {
190 continue;
191 }
192 // break loop
193 foundValidRep = true;
194 }
195 if (!foundValidRep) {
196 B2DEBUG(150, "No valid representation found for RecoTrack, skipping.");
197 continue;
198 }
199 }
200 } else {
201 MCParticle* mcTrack =
202 m_tracks[itrack]->getRelatedTo<MCParticle>(m_targetCollectionName);
203 if (!mcTrack) {
204 if (m_SaveFakeTrack)
205 isFakeTrack = true;
206 else {
207 B2DEBUG(150, "Skipping CDCTriggerTrack without relation to MCParticle.");
208 continue;
209 }
210 } else {
211 //phi0Target = mcTrack->getMomentum().Phi();
212 //invptTarget = mcTrack->getCharge() / mcTrack->getMomentum().rho();
213 thetaTarget = mcTrack->getMomentum().Theta();
214 zTarget = mcTrack->getProductionVertex().Z();
215 PtTarget = mcTrack->getMomentum().rho();
216 }
217 }
218 m_NeuroTrigger.updateTrack(*m_tracks[itrack]);
219
220 // find all matching sectors
221 float phi0 = m_tracks[itrack]->getPhi0();
222 float invpt = m_tracks[itrack]->getKappa(1.5);
223 float theta = atan2(1., m_tracks[itrack]->getCotTheta());
224 std::vector<int> sectors = m_NeuroTrigger.selectMLPsTrain(phi0, invpt, theta);
225 if (sectors.size() == 0) continue;
226
227 // get target values
228 std::vector<float> targetRaw = {};
229 if (!isFakeTrack) {
230 if (m_neuroParameters.targetZ)
231 targetRaw.push_back(zTarget);
232 if (m_neuroParameters.targetTheta)
233 targetRaw.push_back(thetaTarget);
234 }
235 for (unsigned i = 0; i < sectors.size(); ++i) {
236 int isector = sectors[i];
237 std::vector<float> target;
238 if (isFakeTrack) {
239 target.push_back(2);
240 target.push_back(2);
241 } else {
242 target = m_NeuroTrigger[isector].scaleTarget(targetRaw);
243 // skip out of range targets or rescale them
244 bool outOfRange = false;
245 for (unsigned itarget = 0; itarget < target.size(); ++itarget) {
246 if (fabs(target[itarget]) > 1.) {
247 outOfRange = true;
248 target[itarget] /= fabs(target[itarget]);
249 }
250 }
251 if (!m_neuroParameters.rescaleTarget && outOfRange) {
252 continue;
253 }
254 }
255
256 //
257 // read out or determine event time
258 m_NeuroTrigger.getEventTime(isector, *m_tracks[itrack], m_neuroParameters.et_option(), m_neuroTrackInputMode);
259 // check hit pattern
260 unsigned long hitPattern = m_NeuroTrigger.getCompleteHitPattern(isector, *m_tracks[itrack], m_neuroTrackInputMode); // xxxxx0xxx
261 // sectorpattern holds the absolute necessary SLs for the expert
262 unsigned long sectorPattern = m_NeuroTrigger[isector].getSLpattern(); // 010100010
263 // sectorpatternmask holds the SLs, which are generally used to determine the right expert
264 unsigned long sectorPatternMask = m_NeuroTrigger[isector].getSLpatternMask(); // 010101010
265 B2DEBUG(250, "hitPattern " << hitPattern << " sectorPattern " << sectorPattern);
266 // if multiple experts should be trained with one track, the necessary SLs have to be in the hitpattern
267 if (!m_singleUse && sectorPattern > 0 && (sectorPattern & hitPattern) != sectorPattern) {
268 B2DEBUG(250, "hitPattern not matching " << (sectorPattern & hitPattern));
269 continue;
270 // if one track should only be used for one expert, the absolute necessary SLs for this expert should match exactly the set within the hitpattern of the generally used SLs for determining the expert.
271 } else if (m_singleUse && sectorPattern > 0 && (sectorPattern) != (hitPattern & sectorPatternMask)) {
272 // 010100010 != 0x0x0x0x0
273 B2DEBUG(250, "hitPattern not matching " << (sectorPatternMask & hitPattern));
274 continue;
275 }
276 // check, if enough axials are there. first, we select the axial bits from the
277 // hitpattern (341 = int('101010101',base=2)) and then check if the number of
278 // ones is equal or greater than 4.
279 int count = 0;
280 unsigned axialPattern = hitPattern & 0b101010101;
281 while (axialPattern) {
282 count += axialPattern & 1;
283 axialPattern >>= 1;
284 }
285 if (count < 4) {
286 B2DEBUG(250, "Not enough axial hits (<4), skipping!");
287 continue;
288 }
289 // get training data
290 std::vector<unsigned> hitIds;
291 if (m_neuroTrackInputMode) {
292 hitIds = m_NeuroTrigger.selectHitsHWSim(isector, *m_tracks[itrack]);
293 } else {
294 hitIds = m_NeuroTrigger.selectHits(isector, *m_tracks[itrack]);
295 }
296 // add a "sample" it is a full training set including some zeroes for the neurotrigger values (raw and scaled z and theta). Those are sometimes used in the training for reference, but cannot be added here without running *some* neuotrigger instance.
297 CDCTriggerMLPData::NeuroSet sample(m_NeuroTrigger.getInputVector(isector, hitIds), target,
298 evtmetadata->getExperiment(), evtmetadata->getRun(), evtmetadata->getSubrun(), evtmetadata->getEvent(), itrack, i,
299 m_tracks.getEntries(), 0, 0, 0, 0, phi0, theta, invpt, PtTarget);
300 //check whether we already have enough samples
301 m_trainSet[isector].addSample(sample);
302 if ((m_trainSet)[isector].nSamples() % 1000 == 0) {
303 B2DEBUG(50, m_trainSet[isector].nSamples() << " samples for training collected for sector " << isector);
304 }
305 std::ofstream gzipfile4(m_filename, std::ios_base::app | std::ios_base::binary);
306 boost::iostreams::filtering_ostream outStream;
307 outStream.push(boost::iostreams::gzip_compressor());
308 outStream.push(gzipfile4);
309
310 outStream << sample << std::endl;
311 m_trackcounter++;
312 }
313
314 }
315 }
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition B2Vector3.h:516

◆ event() [2/11]

void event ( void )
overridevirtual

Called once for each event.

Prepare input and target for each track and store it.

Reimplemented from Module.

Definition at line 126 of file CDCTriggerNeuroIDHistModule.cc.

127 {
128 StoreObjPtr<EventMetaData> evtmetadata;
129 for (int itrack = 0; itrack < m_tracks.getEntries(); ++itrack) {
130 // get related MCParticle/RecoTrack for target
131 // and retrieve track parameters
132
133 std::vector<float> targetvector = NeuroTrainer::getTrainTargets(m_trainOnRecoTracks, m_tracks[itrack], m_targetCollectionName);
134 if (targetvector[4] == 0) {
135 continue;
136 } // no valid representation found
137 // float phi0Target = targetvector[0]; // currently unused
138 // float invptTarget = targetvector[1]; // currently unused
139 float thetaTarget = targetvector[2];
140 float zTarget = targetvector[3];
141
142
143 // update 2D track variables
144 m_NeuroTrigger.updateTrack(*m_tracks[itrack]);
145
146 // find all matching sectors
147 float phi0 = m_tracks[itrack]->getPhi0();
148 float invpt = m_tracks[itrack]->getKappa(1.5);
149 float theta = atan2(1., m_tracks[itrack]->getCotTheta());
150 std::vector<int> sectors = m_NeuroTrigger.selectMLPsTrain(phi0, invpt, theta);
151 if (sectors.size() == 0) continue;
152 // get target values
153 std::vector<float> targetRaw = {};
154 if (m_neuroParameters.targetZ)
155 targetRaw.push_back(zTarget);
156 if (m_neuroParameters.targetTheta)
157 targetRaw.push_back(thetaTarget);
158 for (unsigned i = 0; i < sectors.size(); ++i) {
159 int isector = sectors[i];
160 std::vector<float> target = m_NeuroTrigger[isector].scaleTarget(targetRaw);
161 // skip out of range targets or rescale them
162 bool outOfRange = false;
163 for (unsigned itarget = 0; itarget < target.size(); ++itarget) {
164 if (fabs(target[itarget]) > 1.) {
165 outOfRange = true;
166 target[itarget] /= fabs(target[itarget]);
167 }
168 }
169 if (!m_neuroParameters.rescaleTarget && outOfRange) continue;
170 if (m_nPrepare == 0 || m_trainSets_prepare[isector].getTrackCounter() < m_nPrepare) {
171 // get relative ids for all hits related to the MCParticle / RecoTrack
172 // and count them to find relevant id range
173 // using only related hits suppresses background EXCEPT for curling tracks
174 if (m_trainOnRecoTracks) {
175 RecoTrack* recoTrack =
176 m_tracks[itrack]->getRelatedTo<RecoTrack>(m_targetCollectionName);
177 for (const CDCTriggerSegmentHit& hit :
178 recoTrack->getRelationsTo<CDCTriggerSegmentHit>(m_hitCollectionName)) {
179 // get relative id
180 double relId = m_NeuroTrigger.getRelId(hit);
181 m_trainSets_prepare[isector].addHit(hit.getISuperLayer(), round(relId));
182 }
183 } else {
184 MCParticle* mcTrack =
185 m_tracks[itrack]->getRelatedTo<MCParticle>(m_targetCollectionName);
186 for (const CDCTriggerSegmentHit& hit :
187 mcTrack->getRelationsTo<CDCTriggerSegmentHit>(m_hitCollectionName)) {
188 // get relative id
189 double relId = m_NeuroTrigger.getRelId(hit);
190 m_trainSets_prepare[isector].addHit(hit.getISuperLayer(), round(relId));
191 }
192 }
193 m_trainSets_prepare[isector].countTrack();
194 }
195 }
196 }
197 bool stop = true;
198 for (unsigned isector = 0; isector < m_trainSets_prepare.size(); ++isector) {
199 if (m_nPrepare == 0 || m_trainSets_prepare[isector].getTrackCounter() < m_nPrepare) {
200 stop = false;
201 break;
202 }
203 }
204 if (stop) {
205 B2INFO("Training sample preparation for NeuroTrigger finished, stopping event loop.");
206 // if required hit number is reached, get relevant ids
207 StoreObjPtr<EventMetaData> eventMetaData;
208 eventMetaData->setEndOfData();
209 }
210 }

◆ event() [3/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 360 of file TRGCDCModule.cc.

361 {
362 // initialize returnValue
363 _cdc->setReturnValue(0);
364
365 //...CDC trigger simulation...
366 _cdc->update();
367 _cdc->simulate();
368
369 // save the results to DataStore
370 _cdc->storeSimulationResults(m_2DfinderCollectionName,
371 m_2DfitterCollectionName,
372 m_3DfitterCollectionName);
373
374 // Set return value
375 int returnValue = _cdc->getReturnValue();
376 int mask = 0;
377 for (vector<string>::iterator it = _returnValueModuleNames.begin(); it != _returnValueModuleNames.end(); ++it) {
378 string const& moduleName = *it;
379 if (moduleName == "TSF") mask |= TRGCDC::EReturnValueType::TSF;
380 else if (moduleName == "ETF") mask |= TRGCDC::EReturnValueType::ETF;
381 else if (moduleName == "find2D") mask |= TRGCDC::EReturnValueType::find2D;
382 else if (moduleName == "fit2D") mask |= TRGCDC::EReturnValueType::fit2D;
383 else if (moduleName == "find3D") mask |= TRGCDC::EReturnValueType::find3D;
384 else if (moduleName == "fit3D") mask |= TRGCDC::EReturnValueType::fit3D;
385 }
386 if (mask != 0) returnValue &= mask;
387 setReturnValue(returnValue);
388 }

◆ event() [4/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 135 of file TRGCDCTSStreamModule.cc.

136 {
137
138 //...To dump wire hits...
139 if (TRGDebug::level())
140 _cdc->dump("trgWireCentralHits");
141
142 if (_out) {
143 unsigned val = TRGBSRecord_BeginEvent;
144 _out->write((char*) & val, 4);
145 val = 0;
146 _out->write((char*) & val, 4);
147 }
148
149 //...Clock loop (from 0 to 99 cycles, about 800 ns)...
150 for (unsigned c = 0; c < 100; c++) {
151
152 if (_out) {
153 unsigned val = TRGBSRecord_Clock;
154 _out->write((char*) & val, 4);
155 val = 32;
156 _out->write((char*) & val, 4);
157 val = c;
158 _out->write((char*) & val, 4);
159 }
160
161 //...Super layer loop...
162 for (unsigned l = 0; l < 9; l++) {
163
164 //...Bit stream for this super layer...
165 TRGBitStream stream;
166
167 //...Wire loop...
168 for (unsigned i = 0; i < _wires[l].size(); i++) {
169 const TRGSignal& s = _wires[l][i]->signal();
170 bool hit = s.state(c);
171 stream.append(hit);
172 }
173
174 if (_out) {
175 unsigned val = TRGBSRecord_SegmentSL0;
176 val += l;
177 _out->write((char*) & val, 4);
178 val = stream.size();
179 _out->write((char*) & val, 4);
180 for (unsigned i = 0; i < stream.sizeInChar(); i++) {
181 char cs = stream.c(i);
182 _out->write(& cs, 1);
183 }
184 }
185
186 if (TRGDebug::level()) {
187 cout << "Super layer " << l << ", clock " << c << endl;
188 stream.dump();
189 }
190 }
191 }
192
193 if (_out) {
194 unsigned val = TRGBSRecord_EndEvent;
195 _out->write((char*) & val, 4);
196 val = 0;
197 _out->write((char*) & val, 4);
198 }
199
200 }

◆ event() [5/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 111 of file TRGECLBGTCHitModule.cc.

112 {
113 B2DEBUG(200, "TRGECLBGTCHitMoudle ... event called");
114
115 if (m_eclHits.getEntries() > 0) {
116 genSimulationObj();
117 } else if (m_trgeclUnpackerStores.getEntries() > 0) {
118 genRandomTrgObj();
119 }
120 }

◆ event() [6/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 149 of file TRGECLFAMModule.cc.

150 {
151
152 B2DEBUG(200, "TRGECLFAMMoudle ... event called");
153 //
154 //
155 if (m_nEvent < 1e2) {if (m_nEvent % 10 == 0) {B2DEBUG(200, "TRGECLFAMModule::event> evtno= " << m_nEvent);}}
156 else if (m_nEvent < 1e3) {if (m_nEvent % 100 == 0) {B2DEBUG(200, "TRGECLFAMModule::event> evtno= " << m_nEvent);}}
157 else if (m_nEvent < 1e4) {if (m_nEvent % 1000 == 0) {B2DEBUG(200, "TRGECLFAMModule::event> evtno= " << m_nEvent);}}
158 else if (m_nEvent < 1e5) {if (m_nEvent % 10000 == 0) {B2DEBUG(200, "TRGECLFAMModule::event> evtno= " << m_nEvent);}}
159 else if (m_nEvent < 1e6) {if (m_nEvent % 100000 == 0) {B2DEBUG(200, "TRGECLFAMModule::event> evtno= " << m_nEvent);}}
160
161
162 //
163 //
164 //
165 // FAM Digitizer
166 TrgEclDigitizer* obj_trgeclDigi = new TrgEclDigitizer();
167 obj_trgeclDigi->setWaveform(m_SaveTCWaveForm);
168 obj_trgeclDigi->setFADC(m_FADC);
169 obj_trgeclDigi->setup(m_SourceOfTC);
170 if (m_famMethod == 1 || m_famMethod == 2) {
171 // no-fit method = backup method 1
172 obj_trgeclDigi->digitization01(m_TCDigiE, m_TCDigiT);
173 } else if (m_famMethod == 3) {
174 // original method = backup method 2
175 obj_trgeclDigi->digitization02(m_TCDigiE, m_TCDigiT);
176 }
177 obj_trgeclDigi->save(m_nEvent);
178
179
180 // FAM Fitter
181 TrgEclFAMFit* obj_trgeclfit = new TrgEclFAMFit();
182 obj_trgeclfit->setBeamBkgTagFlag(m_beambkgtag);
183 obj_trgeclfit->setAnaTagFlag(m_famana);
184 obj_trgeclfit->setup(m_nEvent);
185 obj_trgeclfit->setThreshold(m_TCEThreshold);
186
187 if (m_famMethod == 1) { obj_trgeclfit->FAMFit01(m_TCDigiE, m_TCDigiT); } // fitting method
188 else if (m_famMethod == 2) { obj_trgeclfit->FAMFit02(m_TCDigiE, m_TCDigiT); } // no-fit method = backup method 1
189 else if (m_famMethod == 3) { obj_trgeclfit->FAMFit03(m_TCDigiE, m_TCDigiT); } // original method = backup method 2
190 obj_trgeclfit-> save(m_nEvent);
191
192 // Count number of trigger cells in each ECL region for EventLevelClusteringInfo
193 uint16_t nTCsPerRegion[3] = {};
194 const double absTimeRequirement = 9999.; // Selection on time to reproduce data
195 const int firstBarrelId = 81; // First TCId in the barrel
196 const int lastBarrelId = 512; // Last TCId in the barrel
197 for (auto& trgeclhit : m_TRGECLHit) {
198 const int tcId = trgeclhit.getTCId();
199 const double tcTime = trgeclhit.getTimeAve();
200 if (std::abs(tcTime) < absTimeRequirement) {
201 if (tcId < firstBarrelId) {
202 nTCsPerRegion[0]++;
203 } else if (tcId > lastBarrelId) {
204 nTCsPerRegion[2]++;
205 } else {
206 nTCsPerRegion[1]++;
207 }
208 }
209 }
210 // Store
211 if (!m_eventLevelClusteringInfo) { m_eventLevelClusteringInfo.create();}
212 m_eventLevelClusteringInfo->setNECLTriggerCellsFWD(nTCsPerRegion[0]);
213 m_eventLevelClusteringInfo->setNECLTriggerCellsBarrel(nTCsPerRegion[1]);
214 m_eventLevelClusteringInfo->setNECLTriggerCellsBWD(nTCsPerRegion[2]);
215 //
216 m_nEvent++;
217 delete obj_trgeclDigi;
218 delete obj_trgeclfit;
219 }

◆ event() [7/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 668 of file TRGECLModule.cc.

669 {
670
671 if (TRGDebug::level()) {
672 std::cout << "TRGECLMoudle ... event called" << std::endl;
673 }
674
675 // simulation
676 if (m_SelectEvent == 0) {
677 etm->simulate01(m_nEvent);
678 } else if (m_SelectEvent == 1) {
679 etm->simulate02(m_nEvent);
680 }
681
682 m_nEvent++;
683
684 }

◆ event() [8/11]

void event ( void )
overridevirtual

Event.

Reimplemented from Module.

Definition at line 143 of file TRGECLQAMModule.cc.

144 {
145
146 B2DEBUG(200, "TRGECLFAMMoudle ... event called");
147
148
149
150 //QAM ECL Hit Map
151
152 // StoreArray<TRGECLUnpackerStore> m_TRGECLUnpackerStore;
153 for (int ii = 0; ii < m_TRGECLUnpackerStore.getEntries(); ii++) {
154 TRGECLUnpackerStore* m_TRGECLUnpacker = m_TRGECLUnpackerStore[ii];
155
156
157 int TCId = (m_TRGECLUnpacker->getTCId());
158 int HitEnergy = (m_TRGECLUnpacker->getTCEnergy());
159
160 m_etot += HitEnergy;
161 if (TCId < 1 || TCId > 576 || HitEnergy == 0) {continue;}
162 TCID[TCId - 1]++;
163 int Caltime = m_TRGECLUnpacker->getTCCALTime();
164 if (Caltime != 0) {
165 caltime.push_back(Caltime);
166 }
167 }
168
169 etot.push_back(m_etot);
170
171 m_etot = 0;
172
173 //Unpacker EvtStore
174 //for ( int ii = 0; ii < m_TRGECLUnpackerSumStore.getEntries(); ii++){
175 TRGECLUnpackerEvtStore* m_TRGECLUnpackerEvt = m_TRGECLUnpackerEvtStore[0];
176
177 if (m_TRGECLUnpackerEvt->get3DBhabhaS() == 1) {
178 //Cluster Energy 2D Check
179 const int* clE = m_TRGECLUnpackerEvt->getCLEnergy();
180
181 int clER[6] = {0};
182
183 for (int i = 0; i < 6; i++) {
184 clER[i] = clE[i];
185 }
186
187 sort(clER, clER + 6);
188
189 clusterE = clER[5] + clER[4]; // Ecl1+Ecl2
190 cluster.push_back(clusterE);
191 }
192
193 StoreObjPtr<EventMetaData> bevt;
194 m_nRun = bevt->getRun();
195 m_nevent++;
196
197 }

◆ event() [9/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 110 of file TRGECLRawdataAnalysisModule.cc.

111 {
112
113 if (TRGDebug::level()) {
114 std::cout << "TRGECLMoudle ... event called" << std::endl;
115 }
116
117 std::vector<int> TCId;
118 std::vector<double> TCTiming;
119 std::vector<double> TCEnergy;
120
121 TCId.clear();
122 TCTiming.clear();
123 TCEnergy.clear();
124
125 int HitRevoFAM = 0;
126 int HitFineTime = 0;
127
128
129 //
130 StoreArray<TRGECLUnpackerStore> trgeclUnpackerStoreArray;
131 for (int ii = 0; ii < trgeclUnpackerStoreArray.getEntries(); ii++) {
132
133 TRGECLUnpackerStore* TCHit = trgeclUnpackerStoreArray[ii];
134 int iTCID = (TCHit->getTCId() - 1);
135 int HitTiming = TCHit ->getTCTime();
136 int HitEnergy = TCHit -> getTCEnergy();
137 HitRevoFAM = TCHit -> getRevoFAM();
138 HitFineTime = TCHit -> getTCTime();
139
140 if (iTCID == -1) {continue;}
141
142 TCId.push_back(iTCID + 1);
143 TCTiming.push_back(HitTiming);
144 TCEnergy.push_back(HitEnergy);
145
146
147
148 }
149 TrgEclCluster obj_cluster;
150 if (TCId.size() > 0) {
151
152 obj_cluster.setClusteringMethod(_Clustering);
153 obj_cluster.setEventId(m_nEvent);
154 obj_cluster.setICN(TCId, TCEnergy, TCTiming); // Make Cluster
155 obj_cluster.save(m_nEvent); // Save Clusters to TRGECLCluster
156
157 }
158
159 int Timing = ((HitFineTime >> 3) & 0xF) + ((HitRevoFAM & 0x7F) << 4);
160
161 m_hitNum = 0;
162 StoreArray<TRGECLTiming> TimingArray;
163 TimingArray.appendNew();
164 m_hitNum = TimingArray.getEntries() - 1;
165 TimingArray[m_hitNum]->setEventId(m_nEvent);
166 TimingArray[m_hitNum]->setTiming(Timing);
167
168
169 //
170
171 //
172 //
173 m_nEvent++;
174 //
175 //
176 //
177
178
179 }

◆ event() [10/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from HistoModule.

Definition at line 185 of file TRGGDLModule.cc.

186 {
187
188 if (_debugLevel > 9) printf("TRGGDLModule::event() starts.\n");
189
190 newDir->cd();
191
192 //...GDL simulation...
193 _gdl->update(true);
194 _gdl->simulate();
195 _gdl->accumulateInp(h_inp);
196 _gdl->accumulateFtd(h_ftd);
197 _gdl->accumulatePsn(h_psn);
198
199 //StoreObjPtr<TRGSummary> m_TRGSummary; /**< output for TRGSummary */
200 bool result_summary = false;
201 if (m_TRGSummary) {
202 result_summary = m_TRGSummary->test();
203 } else {
204 B2WARNING("TRGGDLModule.cc: TRGSummary not found. Check it!!!!");
205 }
206 setReturnValue(result_summary);
207
208 oldDir->cd();
209 }

◆ event() [11/11]

void event ( void )
overridevirtual

Called event by event.

Reimplemented from Module.

Definition at line 110 of file TRGGRLModule.cc.

111 {
112
113 //...GRL simulation...
114 _grl->update(true);
115 _grl->simulate();
116
117 }

◆ genRandomTrgObj()

void genRandomTrgObj ( )
private

Definition at line 181 of file TRGECLBGTCHitModule.cc.

182 {
183
184 for (const TRGECLUnpackerStore& ttt : m_trgeclUnpackerStores) {
185 int tcID = ttt.getTCId();
186 // TC energy(ADC)
187 double tcEnergyADC = (double) ttt.getTCEnergy();
188 // TC timing(ns)
189 double tcTime = (double) ttt.getTCTime();
190 if (tcID <= 0) {continue;}
191 // ADC to Energy(MeV) conversion
192 double adc2energy = 5.231;
193 // TC energy (GeV)
194 double tcEnergy = tcEnergyADC * (adc2energy / 1000);
195 // TC energy cut to reduce object size
196 if (tcEnergy < m_TCEnergyCut) { continue; }
197 // TC timing cut to reduce object size
198 if (tcTime < m_TCTimingCutLow || tcTime > m_TCTimingCutHigh) { continue; }
199 // store data
200 m_trgeclBGTCHits.appendNew(tcID,
201 tcEnergy,
202 tcTime);
203 }
204 }

◆ genSimulationObj()

void genSimulationObj ( )
private

Parameters.

Definition at line 141 of file TRGECLBGTCHitModule.cc.

142 {
143
144 struct hit_t { double e, t; };
145 map<int, hit_t> a;
146
147 for (const ECLHit& t : m_eclHits) {
148 double txtal = t.getTimeAve();
149 // timing cut, +-8ns, (almost) same as ECL in SensitiveDetector.cc
150 if (txtal >= 8000.0 || txtal < -8000.0) continue;
151 double edep = t.getEnergyDep();
152 int TimeIndex = (txtal + 8000.0) * (1. / 100);
153 int cellId = t.getCellId() - 1;
154 int iTCIdm = m_TCMap->getTCIdFromXtalId(cellId + 1) - 1;
155
156 int key = iTCIdm * 160 + TimeIndex;
157 hit_t& h = a[key];
158 double old_edep = h.e, old_txtal = h.t;
159 double new_edep = old_edep + edep;
160 h.e = new_edep;
161 h.t = (old_edep * old_txtal + edep * txtal) / new_edep;
162 }
163 // save TC data to dataobject
164 for (pair<int, hit_t> t : a) {
165 int key = t.first;
166 int tcid = key / 160;
167 const hit_t& h = t.second;
168 // TC energy cut to reduce object size
169 if (h.e < m_TCEnergyCut) { continue; }
170 // TC timing cut to reduce object size
171 if (h.t < m_TCTimingCutLow || h.t > m_TCTimingCutHigh) { continue; }
172 // store data
173 m_trgeclBGTCHits.appendNew(tcid + 1, h.e, h.t);
174 }
175
176 }

◆ get_BKLM_back_to_back_flag()

int get_BKLM_back_to_back_flag ( int subdetector)

Definition at line 158 of file klmtrgLayerCounter.cc.

159 {
160 for (const auto& e : m_summary1) {
161 if (e.subdetector == subdetector) {
162 return e.back2back;
163 }
164 }
165 return 0;
166 }

◆ get_index()

template<typename T>
int64_t get_index ( const T & e,
int track_id = 0 )
constexpr

Definition at line 43 of file klmtrgLinearFit.cc.

44 {
45 int64_t ret = 0;
46 int64_t shift = 0;
47 bitshift(ret, shift, track_id, 5);
48 bitshift(ret, shift, e.layer, 6);
49 bitshift(ret, shift, e.plane, 2);
50 bitshift(ret, shift, e.sector, 6);
51 bitshift(ret, shift, e.section, 3);
52 bitshift(ret, shift, e.subdetector, 3);
53
54
55 return ret;
56 };

◆ get_n_sections_trig()

int get_n_sections_trig ( int subdetector)

Definition at line 138 of file klmtrgLayerCounter.cc.

139 {
140 for (const auto& e : m_summary1) {
141 if (e.subdetector == subdetector) {
142 return e.n_sections_trig;
143 }
144 }
145 return 0;
146 }

◆ get_result()

const KLM_trig_linear_fits & get_result ( ) const

Definition at line 275 of file klmtrgLinearFit.cc.

276 {
277 return m_linear_fits;
278 }

◆ get_triggermask() [1/2]

int get_triggermask ( int subdetector,
int section )

Definition at line 148 of file klmtrgLayerCounter.cc.

149 {
150 for (const auto& e : m_sections_trig) {
151 if (e.subdetector == subdetector && e.section == section) {
152 return e.sector_mask;
153 }
154 }
155 return 0;
156 }

◆ get_triggermask() [2/2]

int get_triggermask ( int subdetector,
int section )

Definition at line 282 of file klmtrgLinearFit.cc.

283 {
284 for (const auto& e : m_sections_trig) {
285 if (e.subdetector == subdetector && e.section == section) {
286 return e.sector_mask;
287 }
288 }
289 return 0;
290 }

◆ get_triggermask_or()

int get_triggermask_or ( int subdetector,
int section )

Definition at line 292 of file klmtrgLinearFit.cc.

293 {
294 for (const auto& e : m_sections_trig) {
295 if (e.subdetector == subdetector && e.section == section) {
296 return e.sector_mask_or;
297 }
298 }
299 return 0;
300 }

◆ getDBparmap()

double getDBparmap ( const std::map< std::string, double > dbParmap,
std::string parName,
double parAlternativeValue )
private

get payload from conditionDB

Definition at line 689 of file TRGECLModule.cc.

692 {
693 double par;
694 if (dbParmap.count(parName)) {
695 par = dbParmap.at(parName);
696 } else {
697 par = parAlternativeValue;
698 B2WARNING("No key(\"" + parName +
699 "\") for map in DB and set alternative value(" + parAlternativeValue +
700 ")");
701 }
702
703 return par;
704 }

◆ initialize() [1/11]

void initialize ( void )
overridevirtual

Initialize the module.

Initialize the networks and register datastore objects.

Reimplemented from Module.

Definition at line 85 of file CDCTriggerNeuroDataModule.cc.

86 {
87 // register store objects
88 m_tracks.isRequired(m_inputCollectionName);
89 // decided whether to load mcparticles or recotracks as training targets.
90 // This has to be done because the train target values are obtained
91 // for both classes in a different way.
92 if (m_trainOnRecoTracks) {
93 StoreArray<RecoTrack> targets(m_targetCollectionName);
94 targets.isRequired(m_targetCollectionName);
95 } else {
96 StoreArray<MCParticle> targets(m_targetCollectionName);
97 targets.isRequired(m_targetCollectionName);
98 }
99 // initialize the neurotrigger object, but use the parameters given in the module
100 if (m_configFileName != "") {
101 m_neuroParameters.loadconfigtxt(m_configFileName);
102 m_NeuroTrigger.initialize(m_neuroParameters);
103 } else {
104 B2ERROR("The Neurotrigger needs to be initialized by a configuration file! Make sure to give the configuration file as a parameter.");
105 }
106 // in this version, we first need an idhistfile in prior to collect the training data.
107 // this idhistfile is created by running another steering file before
108 // and stored in the config file loaded in the previous step.
109 m_trainSet.clear();
110 CDC::CDCGeometryPar& cdc = CDC::CDCGeometryPar::Instance();
111 // create an empty dataset of training data for each expert network
112 for (unsigned iMLP = 0; iMLP < m_NeuroTrigger.nSectors(); ++iMLP) {
113 m_trainSet.push_back(CDCTriggerMLPData());
114 int layerId = 3;
115 for (int iSL = 0; iSL < 9; ++iSL) {
116 m_trainSet[iMLP].addCounters(cdc.nWiresInLayer(layerId));
117 layerId += (iSL > 0 ? 6 : 7);
118 }
119 }
120 // this one sets up the other root store arrays needed to collect training data
121 m_NeuroTrigger.initializeCollections(m_hitCollectionName, m_EventTimeName, m_neuroParameters.et_option());
122 // consistency check of training parameters
123 if (m_NeuroTrigger.nSectors() != m_trainSet.size()) {
124 B2ERROR("Number of ID sets (" << m_trainSet.size() << ") should match " <<
125 "number of sectors (" << m_NeuroTrigger.nSectors() << ")");
126 }
127 // overwrite previous file with empty file, in case it already exists
128 std::ofstream gzipfile4(m_filename, std::ios_base::trunc | std::ios_base::binary);
129 boost::iostreams::filtering_ostream outStream;
130 outStream.push(boost::iostreams::gzip_compressor());
131 outStream.push(gzipfile4);
132 int inlen = m_neuroParameters.AdditionWireMode ? 9 * (3 + m_neuroParameters.AdditionInputPerSL) : 27 ;
133 CDCTriggerMLPData::NeuroSet sample(inlen);
134 outStream << sample.headline << std::endl;
135 }

◆ initialize() [2/11]

void initialize ( void )
overridevirtual

Initialize the module.

Initialize the networks and register datastore objects.

First Initialize the neurotrigger object, which is needed because of the original structure of the training procedure in the old module. Second, the dataset for the idhist data will be initialized and set up.

Reimplemented from Module.

Definition at line 70 of file CDCTriggerNeuroIDHistModule.cc.

71 {
77 if (m_configFileName != "") {
78 m_neuroParameters.loadconfigtxt(m_configFileName);
79 m_NeuroTrigger.initialize(m_neuroParameters);
80 } else {
81 m_neuroParameters.saveconfigtxt("neuroconfig_example.conf");
82 B2ERROR("Configuration file is missing! Make sure to give the configuration file as a parameter. \
83 An example file neuroconfig_example.conf has been saved.");
84 }
85 m_trainSets_prepare.clear();
86 CDC::CDCGeometryPar& cdc = CDC::CDCGeometryPar::Instance();
87 for (unsigned iMLP = 0; iMLP < m_NeuroTrigger.nSectors(); ++iMLP) {
88 // sectors means experts here; this is the old naming within the neurotrigger
89 // class which originates from times were we had different expert networks for
90 // different geometrical sectors. In future, this might come back because of
91 // the 3DFinder and its rough information about the theta angle of the tracks.
92 m_trainSets_prepare.push_back(CDCTriggerMLPData());
93 // layerid is the layer number where the priority hits are.
94 // for every 1st priority wire there is a corresponding track segment.
95 int layerId = 3;
96 for (int iSL = 0; iSL < 9; ++iSL) {
97
98 m_trainSets_prepare[iMLP].addCounters(cdc.nWiresInLayer(layerId));
99 // the first superlayer has 2 layers extra compared to the rest
100 layerId += (iSL > 0 ? 6 : 7);
101 }
102 m_tracks.isRequired(m_inputCollectionName);
103 if (m_trainOnRecoTracks) {
104 StoreArray<RecoTrack> targets(m_targetCollectionName);
105 targets.isRequired(m_targetCollectionName);
106 } else {
107 StoreArray<MCParticle> targets(m_targetCollectionName);
108 targets.isRequired(m_targetCollectionName);
109 }
110
111 m_NeuroTrigger.initializeCollections(m_hitCollectionName);
112
113
114
115
116 }
117 if (m_NeuroTrigger.nSectors() == 0) {
118 B2ERROR("No networks defined, please make sure to have a proper configuration file! Example file will be created here: ./neurotrigger_default.conf");
119 m_neuroParameters.saveconfigtxt("neurotrigger_default.conf");
120 }
121 }

◆ initialize() [3/11]

void initialize ( void )
overridevirtual

Initializes TRGCDCModule.

Reimplemented from Module.

Definition at line 257 of file TRGCDCModule.cc.

258 {
259
260 //...Stop curl buck...
261 if (_curlBackStop) {
262 G4RunManager* g4rm = G4RunManager::GetRunManager();
263 if (g4rm != 0) {
264 if (g4rm->GetUserPhysicsList() != 0) {
265 _sa = new TCSAction();
266 g4rm->SetUserAction(_sa);
267 }
268 }
269 }
270 TRGDebug::level(_debugLevel);
271
272 if (TRGDebug::level()) {
273 cout << "TRGCDCModule::initialize ... options" << endl;
274 cout << TRGDebug::tab(4) << "debug level = " << TRGDebug::level()
275 << endl;
276 cout << TRGDebug::tab(4) << "back stop = " << _curlBackStop << endl;
277 cout << TRGDebug::tab(4) << "2D finder perfect = " << _perfect2DFinder
278 << endl;
279 cout << TRGDebug::tab(4) << "Hough finder Min. Peak = "
280 << _hFinderPeakMin
281 << endl;
282 }
283
284 // register DataStore elements
285 StoreArray<CDCTriggerSegmentHit> segmentHits;
286 segmentHits.registerInDataStore();
287 StoreArray<CDCHit> cdcHits(m_inputCollectionName);
288 cdcHits.isRequired();
289 StoreArray<MCParticle> mcparticles;
290 segmentHits.registerRelationTo(cdcHits);
291 mcparticles.registerRelationTo(segmentHits);
292 // register tracks only for full simulation (not for TSF simulation)
293 if (!(_fastSimulationMode & 1)) {
294 StoreArray<CDCTriggerTrack> tracks2Dfinder(m_2DfinderCollectionName);
295 StoreArray<CDCTriggerTrack> tracks2Dfitter(m_2DfitterCollectionName);
296 StoreArray<CDCTriggerTrack> tracks3Dfitter(m_3DfitterCollectionName);
297 tracks2Dfinder.registerInDataStore(m_2DfinderCollectionName);
298 tracks2Dfitter.registerInDataStore(m_2DfitterCollectionName);
299 tracks3Dfitter.registerInDataStore(m_3DfitterCollectionName);
300 tracks2Dfinder.registerRelationTo(segmentHits); // hits related over Hough cell
301 tracks2Dfitter.registerRelationTo(segmentHits); // hits used for the 2D fit
302 tracks3Dfitter.registerRelationTo(segmentHits); // hits used for the 2D and 3D fit
303 tracks2Dfinder.registerRelationTo(tracks2Dfitter);
304 tracks2Dfinder.registerRelationTo(tracks3Dfitter);
305 }
306 StoreObjPtr<TRGTiming> eventTime("CDCTriggerEventTime");
307 eventTime.registerInDataStore("CDCTriggerEventTime");
308
309 //...CDC trigger config. name...
310 static string cfn = _configFilename;
311
312 //...CDC trigger...
313 if ((cfn != _configFilename) || (_cdc == 0)) {
314 Belle2::CDC::CDCGeometryPar& cdc = Belle2::CDC::CDCGeometryPar::Instance();
315 _cdc = TRGCDC::getTRGCDC(_configFilename,
316 _simulationMode,
317 _fastSimulationMode,
318 _firmwareSimulationMode,
319 _firmwareSimulationStart,
320 _firmwareSimulationStop,
321 _fileTRGCDC,
322 _perfect2DFinder,
323 _perfect3DFinder,
324 _innerTSLUTFilename,
325 _outerTSLUTFilename,
326 _rootTRGCDCFilename,
327 _rootFitter3DFilename,
328 _hFinderPeakMin,
329 _hFinderMappingFilePlus,
330 _hFinderMappingFileMinus,
331 _hFinderDoit,
332 _fLogicLUTTSF,
333 _fLRLUT,
334 _fFitter3Dsmclr,
335 _fFitter3Ds2DFit,
336 _fFitter3Ds2DFitDrift,
337 _wireHitInefficiency,
338 _fileTSF,
339 _fileETF,
340 _fverETF,
341 _fprintFirmETF,
342 _fileHough3D,
343 _finder3DMode,
344 _fileFitter3D,
345 _fXtSimpleFitter3D,
346 cdc.getTdcBinWidth(),
347 _trgCDCDataInputMode,
348 m_inputCollectionName);
349 }
350 }
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.

◆ initialize() [4/11]

void initialize ( void )
overridevirtual

Initializes TRGCDCTSStreamModule.

Reimplemented from Module.

Definition at line 81 of file TRGCDCTSStreamModule.cc.

82 {
83 if (TRGDebug::level()) {
84 cout << "TRGCDCTSStreamModule::initialize ... options" << endl;
85 cout << TRGDebug::tab(4) << "debug level = " << _debugLevel << endl;
86 cout << TRGDebug::tab(4) << " mode = " << _mode << endl;
87 cout << TRGDebug::tab(4) << "output file = " << _streamFilename << endl;
88 }
89
90 if (_streamFilename != "unknown") {
91 _out = new ofstream(_streamFilename.c_str(), ios::out | ios::binary);
92 unsigned val = TRGBSRecord_Comment;
93 _out->write((char*) & val, 4);
94 const string cmt = "test data ";
95 val = cmt.size() * 8;
96 _out->write((char*) & val, 4);
97 _out->write(cmt.c_str(), cmt.size());
98 }
99 }

◆ initialize() [5/11]

void initialize ( void )
overridevirtual

Initializes TRGECLBGTCHitModule.

Reimplemented from Module.

Definition at line 84 of file TRGECLBGTCHitModule.cc.

85 {
86 B2DEBUG(100, "TRGECLBGTCHitModule::initialize>");
87
88 B2INFO("[TRGECLBGTCHitModule] TCEnergyCut : TC(E) GeV = "
89 << m_TCEnergyCut);
90 B2INFO("[TRGECLBGTCHitModule] TCTimingCutLow : TC(T) ns = "
91 << m_TCTimingCutLow);
92 B2INFO("[TRGECLBGTCHitModule] TCTimingCutHigh : TC(T) ns = "
93 << m_TCTimingCutHigh);
94
95 m_eclHits.registerInDataStore();
96 m_trgeclUnpackerStores.registerInDataStore();
97 m_trgeclBGTCHits.registerInDataStore();
98 }

◆ initialize() [6/11]

void initialize ( void )
overridevirtual

Initializes TRGECLFAMModule.

Reimplemented from Module.

Definition at line 101 of file TRGECLFAMModule.cc.

102 {
103
104 B2DEBUG(100, "TRGECLFAMModule::initialize ... options");
105 B2DEBUG(100, "TRGECLFAMModule::initialize> FAM Fit Method = " << m_famMethod
106 << " ; Bin of Time Interval = " << m_binTimeInterval
107 << " ;output TC waveforml = " << m_SaveTCWaveForm);
108 if (m_SourceOfTC <= 0 ||
109 m_SourceOfTC >= 4) {
110 B2FATAL("TRGECLFAMModule::initialize> SourceOfTC must be 1 or 2 or 3");
111 }
112
113 m_nRun = 0;
114 m_nEvent = 1;
115
116 m_TRGECLDigi0.registerInDataStore();
117 m_TRGECLWaveform.registerInDataStore();
118 m_TRGECLHit.registerInDataStore();
119 m_TRGECLFAMAna.registerInDataStore();
120 // This object is registered by few packages. Let's be agnostic about the
121 // execution order of the modules: the first package run registers the module
122 m_eventLevelClusteringInfo.isOptional() ? m_eventLevelClusteringInfo.isRequired() :
123 m_eventLevelClusteringInfo.registerInDataStore();
124
125 // m_FAMPara = new DBObjPtr<TRGECLFAMPara>;
126 }

◆ initialize() [7/11]

void initialize ( void )
overridevirtual

Initializes TRGECLModule.

Reimplemented from Module.

Definition at line 310 of file TRGECLModule.cc.

311 {
312
313 TRGDebug::level(m_debugLevel);
314
315 if (TRGDebug::level()) {
316 std::cout << "TRGECLModule::initialize ... options" << std::endl;
317 std::cout << TRGDebug::tab(4) << "debug level = " << TRGDebug::level()
318 << std::endl;
319 }
320 //
321 //
322 //
323 m_nRun = 0 ;
324 m_nEvent = 0 ;
325 m_hitNum = 0;
326 m_hitTCNum = 0;
327
328 m_TRGECLHit.registerInDataStore();
329 m_TRGECLTrg.registerInDataStore();
330 m_TRGECLCluster.registerInDataStore();
331
332 etm = new TrgEclMaster();
333
334 }

◆ initialize() [8/11]

void initialize ( void )
overridevirtual

initialize

Reimplemented from Module.

Definition at line 115 of file TRGECLQAMModule.cc.

116 {
117
118 B2DEBUG(100, "TRGECLQAMModule::initialize ... options");
119
120
121 m_TRGECLUnpackerStore.registerInDataStore();
122 m_TRGECLUnpackerEvtStore.registerInDataStore();
123
124 m_TRGSummary.registerInDataStore();
125 // EvtMeta.registterInDataStore();
126
127
128 }

◆ initialize() [9/11]

void initialize ( void )
overridevirtual

Initializes TRGECLModule.

Reimplemented from Module.

Definition at line 70 of file TRGECLRawdataAnalysisModule.cc.

71 {
72
73 TRGDebug::level(_debugLevel);
74
75 if (TRGDebug::level()) {
76 std::cout << "TRGECLRawdataAnalysisModule::initialize ... options" << std::endl;
77 std::cout << TRGDebug::tab(4) << "debug level = " << TRGDebug::level()
78 << std::endl;
79 }
80 //
81 //
82 //
83 m_nRun = 0 ;
84 m_nEvent = 0 ;
85 m_hitNum = 0;
86 m_hitTCNum = 0;
87
88 m_TRGECLUnpackerStore.registerInDataStore();
89 m_TRGECLCluster.registerInDataStore();
90 m_TRGECLTiming.registerInDataStore();
91
92 }

◆ initialize() [10/11]

void initialize ( void )
overridevirtual

Initializes TRGGDLModule.

Reimplemented from HistoModule.

Definition at line 126 of file TRGGDLModule.cc.

127 {
128
129 REG_HISTOGRAM
130 defineHisto();
131
132// m_TRGSummary.isRequired();
133 TRGDebug::level(_debugLevel);
134
135 B2INFO("TRGGDLModule::initialize. simulationMode=" << _simulationMode);
136 if (_simulationMode != 3) {
137 m_TRGGRLInfo.isRequired("TRGGRLObjects");
138 }
139
140 if (m_simulateT0Jitter)
141 m_simClockState.isRequired();
142
143 m_TRGSummary.registerInDataStore();
144 }

◆ initialize() [11/11]

void initialize ( void )
overridevirtual

Initializes TRGGRLModule.

Reimplemented from Module.

Definition at line 77 of file TRGGRLModule.cc.

78 {
79
80// TRGDebug::level(_debugLevel);
81
82 B2DEBUG(100, "TRGGRLModule::initialize ... options");
83 }

◆ operator==()

bool operator== ( const CDCTriggerHoughCand & a,
const CDCTriggerHoughCand & b )
inline

Two cells are identical if they have the same coordinates.

Definition at line 77 of file CDCTriggerHoughETFModule.h.

78 {
79 return (a.getCoord().first.X() == b.getCoord().first.X() &&
80 a.getCoord().first.Y() == b.getCoord().first.Y());
81 }

◆ run() [1/2]

void run ( const KLM_TRG_definitions::KLM_Digit_compact_ts & hits)

Definition at line 54 of file klmtrgLayerCounter.cc.

55 {
56
57
58 m_sections_trig.clear();
59 m_summary1.clear();
60
61 auto hits1 = nt::algorithms::join_vectors(
62 hits,
63 m_layersUsed,
64 nt::comparators::on_common_args,
65 [&](auto e1, const auto&) {
66 e1.layer = e1.layer * 2 + e1.plane;
67 return e1;
68 }
69 );
70
71 __CSV__WRITE__(hits1);
72
73
74 auto grouped = nt_group(
75 hits1[0].subdetector,
76 hits1[0].section,
77 hits1[0].sector
78 ).apply_append(
79 hits1,
80 [](const auto & e1) {
81 auto bit_mask = to_bit_mask(nt_span(e1, layer));
82 return nt::ntuple(
83 ax_maker(layer_count) = countBits(bit_mask),
84 ax_maker(layer_mask) = bit_mask
85 );
86 });
87
88
89 __CSV__WRITE__(grouped);
90
91 nt::algorithms::filter(grouped, [&](const auto & e) { return e.layer_count >= m_NlayerTrigger; });
92
93
94
95
96
97 m_sections_trig = nt_group(
98 grouped[0].subdetector,
99 grouped[0].section
100 ).apply_append(
101 grouped,
102 [&](const auto & e1) {
103
104 auto bit_mask = to_bit_mask(nt_span(e1, sector));
105 n_sections_trig nsector = countBits(bit_mask);
106 return nt::ntuple(
107 sector_mask(bit_mask),
108 nsector
109 );
110 }
111 );
112
113 __CSV__WRITE__(m_sections_trig);
114
115
116
117 m_summary1 = nt_group(
118 m_sections_trig[0].subdetector
119 ).apply_append(
120 m_sections_trig,
121 [](const auto & e1) {
122 auto bit_mask = countBits(to_bit_mask(nt_span(e1, section)));
123 n_sections_trig nsector = nt::algorithms::sum(e1, [](auto&& e) {return e.n_sections_trig; });
124
125 return nt::ntuple(
126 nsector,
127 back2back(bit_mask == 2)
128
129 );
130 }
131 );
132
133 __CSV__WRITE__(m_summary1);
134
135
136 }

◆ run() [2/2]

void run ( const KLM_TRG_definitions::KLM_Digit_compact_ts & hits)

Definition at line 167 of file klmtrgLinearFit.cc.

168 {
169
170 __CSV__WRITE__(hits);
171 m_linear_fits.clear();
172
173
174 auto hits_w_geo_fit = nt::algorithms::add_column(
175 hits,
176 [&](const auto & e1) {
177 auto ret = nt::ntuple(
178 Belle2::KLM_TRG_definitions::x_pos(0),
179 Belle2::KLM_TRG_definitions::y_pos(0)
180 );
181
182 auto&& e2 = m_KLMgeomap[get_index(e1)];
183 ret.x_pos.v = e1.layer * e2.slopeX + e2.offsetX;
184 ret.y_pos.v = e1.strip * e2.slopeY + e2.offsetY;
185 return ret;
186
187 }
188 );
189
190
191 __CSV__WRITE__(hits_w_geo_fit);
192 nt::algorithms::sort(hits_w_geo_fit);
193
194
195 auto track_maker_ = track_maker_t{};
196 track_maker_.y_cutoff = y_cutoff;
197
198
199 auto hits_w_geo_fit_w_tracks = nt::algorithms::add_column(
200 hits_w_geo_fit,
201 [&](const auto & e) {
202 return nt::ntuple{
203 track_id(track_maker_(e))
204 };
205
206
207 }
208
209 );
210
211
212 __CSV__WRITE__(hits_w_geo_fit_w_tracks);
213
214
215
216 m_linear_fits = nt_group(
217 hits_w_geo_fit_w_tracks[0].subdetector,
218 hits_w_geo_fit_w_tracks[0].section,
219 hits_w_geo_fit_w_tracks[0].sector,
220 hits_w_geo_fit_w_tracks[0].plane,
221 hits_w_geo_fit_w_tracks[0].track_id
222 ).apply_append(
223 hits_w_geo_fit_w_tracks,
224 Linear_fit_of_Hits
225 );
226 __CSV__WRITE__(m_linear_fits);
227
228
229 nt::algorithms::filter(m_linear_fits, [&](const auto & e) { return std::abs(e.interceptXY) <= m_intercept_cutoff; });
230
231
232 auto m_linear_fits1 = nt_group(
233 m_linear_fits[0].subdetector,
234 m_linear_fits[0].section,
235 m_linear_fits[0].sector
236 ).apply_append(
237 m_linear_fits,
238 [](const auto & es) {
239 bool plane0 = false;
240 bool plane1 = false;
241 for (const auto& e : es) {
242 if (e.plane == 0) { plane0 = true; }
243 if (e.plane == 1) { plane1 = true; }
244 }
245 return nt::ntuple{
246 ax_maker(trigger_or) = (int)(plane0 || plane1),
247 ax_maker(trigger_and) = (int)(plane0 && plane1)
248 };
249 }
250 );
251 __CSV__WRITE__(m_linear_fits1);
252
253 m_sections_trig = nt_group(
254 m_linear_fits1[0].subdetector,
255 m_linear_fits1[0].section
256 ).apply_append(
257 m_linear_fits1,
258 [](const auto & e) {
259 auto ret = nt::ntuple{
260 KLM_TRG_definitions::sector_mask {},
261 KLM_TRG_definitions::sector_mask_or{}
262 };
263 auto trig_and = nt::algorithms::filter_copy(e, [](const auto & x) { return x.trigger_and > 0; });
264 ret.sector_mask.v = Belle2::to_bit_mask(nt_span(trig_and, sector));
265 ret.sector_mask_or.v = Belle2::to_bit_mask(nt_span(trig_and, sector));
266 return ret;
267
268 }
269 );
270 __CSV__WRITE__(m_sections_trig);
271
272
273 }

◆ set_intercept_cutoff()

void set_intercept_cutoff ( int cutoff)

Definition at line 307 of file klmtrgLinearFit.cc.

308 {
309 m_intercept_cutoff = cutoff;
310 }

◆ set_NLayerTrigger()

void set_NLayerTrigger ( int NlayerTrigger)

Definition at line 49 of file klmtrgLayerCounter.cc.

50 {
51 m_NlayerTrigger = NlayerTrigger;
52 }

◆ set_y_cutoff()

void set_y_cutoff ( int cutoff)

Definition at line 302 of file klmtrgLinearFit.cc.

303 {
304 y_cutoff = cutoff;
305 }

◆ terminate() [1/11]

void terminate ( void )
overridevirtual

Do the training for all sectors.

Reimplemented from Module.

Definition at line 317 of file CDCTriggerNeuroDataModule.cc.

318 {
319 std::stringstream ss;
320 for (unsigned int i = 0; i < m_trainSet.size(); ++i) {
321 ss << "expert " << i << " : " << m_trainSet[i].nSamples() << ", ";
322 }
323 // lock the parameters, which were used to obtain the training data, so they cannot be altered in the next steps.
324 m_neuroParameters.ETOption.lock();
325 m_neuroParameters.rescaleTarget.lock();
326 m_neuroParameters.targetZ.lock();
327 m_neuroParameters.targetTheta.lock();
328 for (auto x : m_neuroParameters.maxHitsPerSL) {
329 x.lock();
330 }
331 if (m_writeconfigFileName == "") {
332 B2INFO("write writeconfig now: " + m_configFileName);
333 m_neuroParameters.saveconfigtxt(m_configFileName);
334 } else {
335 B2INFO("write writeconfig now: " + m_writeconfigFileName);
336 m_neuroParameters.saveconfigtxt(m_writeconfigFileName);
337 }
338
339 B2DEBUG(10, "Collected events: " << ss.str());
340 }

◆ terminate() [2/11]

void terminate ( void )
overridevirtual

Do the training for all sectors.

Reimplemented from Module.

Definition at line 213 of file CDCTriggerNeuroIDHistModule.cc.

214 {
215
216 if (m_neuroParameters.IDRanges.size() > 0) {
217 if (m_neuroParameters.IDRanges[0].size() > 0) {
218 if (m_neuroParameters.IDRanges[0][0].isSet()) {
219 // the idranges are already set, print warning:
220 if (!m_neuroParameters.IDRanges[0][0].isLocked()) {
221 B2WARNING("ID ranges are already set in the config file, they will be updated now!");
222 } else {
223 B2ERROR("The ID ranges in the config file are already locked and cannot be updated!");
224 return;
225 }
226 }
227 }
228 }
229 m_neuroParameters.IDRanges.clear();
230 for (unsigned isector = 0; isector < m_trainSets_prepare.size(); ++isector) {
231 CDCTriggerMLPData::HeaderSet hset(isector, NeuroTrainer::getRelevantID(
232 m_trainSets_prepare[isector],
233 m_neuroParameters.cutSum,
234 m_neuroParameters.relevantCut));
235 std::vector<NNTParam<float>> expertline;
236 expertline.push_back(float(isector));
237 expertline.back().lock();
238 for (auto x : hset.relID) {
239 expertline.push_back(x);
240 expertline.back().lock();
241 }
242 m_neuroParameters.IDRanges.push_back(expertline);
243 B2DEBUG(15, hset);
244 }
245 // lock the variables used in this module, that are not supposed be changed
246 // further down the training chain because of the danger of implications or
247 // wrong assumptions.
248 m_neuroParameters.relevantCut.lock();
249 m_neuroParameters.cutSum.lock();
250 // the IDRanges are set here; however, they can be altered manually in the
251 // configuration file to achieve potentially better results, eg. widen
252 // the range of the axial phi acceptance. This is why they are not to be "locked".
253 m_neuroParameters.nInput.lock();
254 m_neuroParameters.nOutput.lock();
255 m_neuroParameters.nMLP.lock();
256 for (auto x : m_neuroParameters.SLpattern) {
257 x.lock();
258 }
259 for (auto x : m_neuroParameters.SLpatternMask) {
260 x.lock();
261 }
262 for (auto x : m_neuroParameters.maxHitsPerSL) {
263 x.lock();
264 }
265 m_neuroParameters.multiplyHidden.lock();
266
267 if (m_writeconfigFileName == "") {
268 m_neuroParameters.saveconfigtxt(m_configFileName);
269 } else {
270 m_neuroParameters.saveconfigtxt(m_writeconfigFileName);
271 }
272
273
274 // the *rangeTrain variables are used here, but just for obtaining the idranges.
275 // because they only have a very minor effect on those, they are not locked here.
276 //TODO: also write the config file to be directly able to start the training
277 }

◆ terminate() [3/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 398 of file TRGCDCModule.cc.

399 {
400
401 _cdc->terminate();
402
403 if (TRGDebug::level())
404 cout << "TRGCDCModule ... terminate called " << endl;
405 }

◆ terminate() [4/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 217 of file TRGCDCTSStreamModule.cc.

218 {
219 if (_out) {
220 _out->flush();
221 _out->close();
222 }
223
224 if (TRGDebug::level())
225 cout << "TRGCDCTSStreamModule ... terminate called " << endl;
226 }

◆ terminate() [5/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 133 of file TRGECLBGTCHitModule.cc.

134 {
135 B2DEBUG(100, "TRGECLBGTCHitModule ... terminate called ");
136 }

◆ terminate() [6/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 232 of file TRGECLFAMModule.cc.

233 {
234 B2DEBUG(100, "TRGECLFAMModule ... terminate called ");
235 }

◆ terminate() [7/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 719 of file TRGECLModule.cc.

720 {
721 delete etm;
722
723 if (TRGDebug::level()) {
724 std::cout << "TRGECLModule ... terminate called " << std::endl;
725 }
726 }

◆ terminate() [8/11]

void terminate ( void )
overridevirtual

terminate

Reimplemented from Module.

Definition at line 411 of file TRGECLQAMModule.cc.

412 {
413 B2DEBUG(100, "TRGECLQAMModule ... terminate called ");
414
415 }

◆ terminate() [9/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 194 of file TRGECLRawdataAnalysisModule.cc.

195 {
196 if (TRGDebug::level()) {
197 std::cout << "TRGECLRawdataAnalysisModule ... terminate called " << std::endl;
198 }
199 }

◆ terminate() [10/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from HistoModule.

Definition at line 218 of file TRGGDLModule.cc.

219 {
220
221 _gdl->terminate();
222
223 B2DEBUG(100, "TRGGDLModule ... terminate called ");
224 }

◆ terminate() [11/11]

void terminate ( void )
overridevirtual

Called when processing ended.

Reimplemented from Module.

Definition at line 127 of file TRGGRLModule.cc.

128 {
129 _grl->terminate();
130 B2DEBUG(200, "TRGGRLModule ... terminate called ");
131 }

◆ to_bit_mask()

template<typename CONTAINER_T>
uint64_t to_bit_mask ( const CONTAINER_T & container)

Definition at line 30 of file bit_operations.h.

31 {
32
33 return std::accumulate(container.begin(), container.end(), uint64_t(0),
34 [](const auto & lhs, const auto & rhs) {
35 const auto bitshift = uint64_t(rhs);
36 if (bitshift > 32) {
37 throw std::runtime_error("from:\nuint64_t to_bit_mask(const CONTAINER_T& container)\ninput number to large.\n\n");
38 }
39 return lhs | (uint64_t(1) << bitshift);
40 });
41
42
43
44 }

◆ TRGCDCModule()

Constructor.

Definition at line 47 of file TRGCDCModule.cc.

48 : Module::Module(),
49 _debugLevel(0),
50 _configFilename("TRGCDCConfig.dat"),
51 _innerTSLUTFilename("undefined"),
52 _outerTSLUTFilename("undefined"),
53 _rootTRGCDCFilename("undefined"),
54 _rootFitter3DFilename("undefined"),
55 _curlBackStop(0),
56 _simulationMode(1),
57 _fastSimulationMode(0),
58 _firmwareSimulationMode(0),
59 _firmwareSimulationStart(0),
60 _firmwareSimulationStop(32 * 32 - 1),
61 _fileTRGCDC(0),
62 _perfect2DFinder(false),
63 _perfect3DFinder(false),
64 _hFinderPeakMin(5),
65 _hFinderMappingFilePlus("HoughMappingPlus20160223.dat"),
66 _hFinderMappingFileMinus("HoughMappingMinus20160223.dat"),
67 _hFinderDoit(2),
68 _fLogicLUTTSF(1),
69 _fLRLUT(1),
70 _fFitter3Dsmclr(0),
71 _fFitter3Ds2DFit(1),
72 _fFitter3Ds2DFitDrift(0),
73 _wireHitInefficiency(0.),
74 _fileTSF(0),
75 _fileETF(0),
76 _fverETF(0),
77 _fprintFirmETF(0),
78 _fileHough3D(0),
79 _finder3DMode(2),
80 _fileFitter3D(0),
81 _fXtSimpleFitter3D(0),
82 _trgCDCDataInputMode(0),
83 _cdc(0),
84 _sa(0)
85 {
86
87 string desc = "TRGCDCModule(" + version() + ")";
88 setDescription(desc);
89 setPropertyFlags(c_ParallelProcessingCertified);
90
91 vector<string> emptyvector;
92
93 addParam("DebugLevel", _debugLevel, "TRGCDC debug level", _debugLevel);
94 addParam("ConfigFile",
95 _configFilename,
96 "The filename of CDC trigger config file",
97 _configFilename);
98 addParam("ReturnValueModuleNames", _returnValueModuleNames,
99 "Chooses modules for return value. Can be a list of [TSF, ETF, 2DFind, 2DFit, 3DFind, 3DFit]. If empty list then returnValue will be for all modules.",
100 emptyvector);
101 addParam("InnerTSLUTFile",
102 _innerTSLUTFilename,
103 "The filename of LUT for inner-most track segments",
104 _innerTSLUTFilename);
105 addParam("OuterTSLUTFile",
106 _outerTSLUTFilename,
107 "The filename of LUT for outer track segments",
108 _outerTSLUTFilename);
109 addParam("RootTRGCDCFile",
110 _rootTRGCDCFilename,
111 "The filename of root file for TRGCDC",
112 string("TRGCDC.root"));
113 addParam("RootFitter3DFile",
114 _rootFitter3DFilename,
115 "The filename of root file for Fitter3D",
116 string("Fitter3D.root"));
117 addParam("CurlBackStop",
118 _curlBackStop,
119 "Curl back stop parameter",
120 _curlBackStop);
121 addParam("SimulationMode",
122 _simulationMode,
123 "TRGCDC simulation switch",
124 _simulationMode);
125 addParam("FastSimulationMode",
126 _fastSimulationMode,
127 "TRGCDC fast simulation mode",
128 _fastSimulationMode);
129 addParam("FirmwareSimulationMode",
130 _firmwareSimulationMode,
131 "TRGCDC firmware simulation mode",
132 _firmwareSimulationMode);
133 addParam("FirmwareSimulationStart",
134 _firmwareSimulationStart,
135 "TRGCDC firmware simulation start clock of CDC FE",
136 _firmwareSimulationStart);
137 addParam("FirmwareSimulationStop",
138 _firmwareSimulationStop,
139 "TRGCDC firmware simulation stop clock of CDC FE",
140 _firmwareSimulationStop);
141 addParam("TRGCDCRootFile",
142 _fileTRGCDC,
143 "Flag for making TRGCDC.root",
144 _fileTRGCDC);
145 addParam("TSFLogicLUT",
146 _fLogicLUTTSF,
147 "Use logic or LUT for TSF",
148 _fLogicLUTTSF);
149 addParam("2DFinderPerfect",
150 _perfect2DFinder,
151 "2D finder perfect option",
152 _perfect2DFinder);
153 addParam("3DFinderPerfect",
154 _perfect3DFinder,
155 "3D finder perfect option",
156 _perfect3DFinder);
157 addParam("HoughFinderPeakMin",
158 _hFinderPeakMin,
159 "Hough finder min. peak height",
160 _hFinderPeakMin);
161 addParam("HoughFinderMappingFilePlus",
162 _hFinderMappingFilePlus,
163 "Hough finder cell mapping file for charge plus",
164 _hFinderMappingFilePlus);
165 addParam("HoughFinderMappingFileMinus",
166 _hFinderMappingFileMinus,
167 "Hough finder cell mapping file for charge minus",
168 _hFinderMappingFileMinus);
169 addParam("HoughFinderDoit",
170 _hFinderDoit,
171 "Hough finder doit() version",
172 _hFinderDoit);
173 addParam("Fitter3DsLRLUT",
174 _fLRLUT,
175 "Using L/R LUT in fitter3D",
176 _fLRLUT);
177 addParam("Fitter3DsMcLR",
178 _fFitter3Dsmclr,
179 "Using MC L/R information for Fitter3D",
180 _fFitter3Dsmclr);
181 addParam("Fitter3Ds2DFit",
182 _fFitter3Ds2DFit,
183 "Using 1: 2D fit or 0: Hough Finder results for Fitter3D",
184 _fFitter3Ds2DFit);
185 addParam("Fitter3Ds2DFitDrift",
186 _fFitter3Ds2DFitDrift,
187 "Using 1: drift 2D fit or 0: wire 2D fit for Fitter3D",
188 _fFitter3Ds2DFitDrift);
189 addParam("wireHitInefficiency",
190 _wireHitInefficiency,
191 "wire hit inefficiency",
192 _wireHitInefficiency);
193 addParam("TSFRootFile",
194 _fileTSF,
195 "Flag for making TSF.root",
196 _fileTSF);
197 addParam("ETFRootFile",
198 _fileETF,
199 "Flag for making ETF.root",
200 _fileETF);
201 addParam("verETF",
202 _fverETF,
203 "Select ETF ver, 0:histogram, 1:old Version, 2:True T0",
204 _fverETF);
205 addParam("printFirmETF",
206 _fprintFirmETF,
207 "Flag for printing Firmware inputs for ETF",
208 _fprintFirmETF);
209 addParam("Hough3DRootFile",
210 _fileHough3D,
211 "Flag for making Hough3D.root",
212 _fileHough3D);
213 addParam("Finder3DMode",
214 _finder3DMode,
215 "Mode for finder3D",
216 _finder3DMode);
217 addParam("Fitter3DRootFile",
218 _fileFitter3D,
219 "Flag for making Fitter3D.root",
220 _fileFitter3D);
221 addParam("Fitter3DsXtSimple",
222 _fXtSimpleFitter3D,
223 "0: Use simple xt curve table. 1: use non-linear xt curve table.",
224 _fXtSimpleFitter3D);
225 addParam("TRGCDCDataInputMode",
226 _trgCDCDataInputMode,
227 "Flag for TRG CDC input mode",
228 _trgCDCDataInputMode);
229 addParam("inputCollection", m_inputCollectionName,
230 "Name of the CDCHit StoreArray to be used as input.",
231 string(""));
232 addParam("2DfinderCollection", m_2DfinderCollectionName,
233 "Name of the StoreArray holding the tracks made by the 2D finder.",
234 string("Trg2DFinderTracks"));
235 addParam("2DfitterCollection", m_2DfitterCollectionName,
236 "Name of the StoreArray holding the tracks made by the 2D fitter.",
237 string("Trg2DFitterTracks"));
238 addParam("3DfitterCollection", m_3DfitterCollectionName,
239 "Name of the StoreArray holding the tracks made by the 3D fitter.",
240 string("Trg3DFitterTracks"));
241
242
243 if (TRGDebug::level())
244 cout << "TRGCDCModule ... created" << endl;
245 }

◆ TRGCDCTSStreamModule()

Constructor.

Definition at line 42 of file TRGCDCTSStreamModule.cc.

43 : Module::Module(),
44 _debugLevel(0),
45 _mode(0),
46 _streamFilename("unknown"),
47 _cdc(0),
48 _out(0)
49 {
50
51 string desc = "TRGCDCTSStreamModule(" + version() + ")";
52 setDescription(desc);
53
54 addParam("DebugLevel",
55 _debugLevel,
56 "TRGCDCTSStream debug level",
57 _debugLevel);
58
59 addParam("Mode", _mode, "TRGCDCTSStream mode", _mode);
60
61 addParam("OutputStreamFile",
62 _streamFilename,
63 "The filename of bit stream",
64 _streamFilename);
65
66 if (TRGDebug::level())
67 cout << "TRGCDCTSStreamModule ... created" << endl;
68 }

◆ TRGECLBGTCHitModule()

Constructor.

Definition at line 41 of file TRGECLBGTCHitModule.cc.

42 : Module::Module(),
43 m_TCEnergyCut(0.005),
44 m_TCTimingCutLow(-1500),
45 m_TCTimingCutHigh(1500),
46 m_debugLevel(0)
47 {
48 string desc = "TRGECLBGTCHitModule(" + version() + ")";
49 setDescription(desc);
50 setPropertyFlags(c_ParallelProcessingCertified);
51
52 addParam("TCEnergyCut",
53 m_TCEnergyCut,
54 "TC energy cut: TC(E)<X (GeV), X=",
55 m_TCEnergyCut);
56 addParam("TCTimingCutLow",
57 m_TCTimingCutLow,
58 "TC Timing cut low: TC(T)>X (ns), X=",
59 m_TCTimingCutLow);
60 addParam("TCTimingCutHigh",
61 m_TCTimingCutHigh,
62 "TC Timing cut high: TC(T)<X (ns), X=",
63 m_TCTimingCutHigh);
64 addParam("DebugLevel",
65 m_debugLevel,
66 "TRGECL debug level",
67 m_debugLevel);
68
69 m_TCMap = new TrgEclMapping();
70
71 B2DEBUG(100, "TRGECLBGTCHitModule ... created");
72 }

◆ TRGECLFAMModule()

Constructor.

Definition at line 45 of file TRGECLFAMModule.cc.

46 : Module::Module(),
47 m_debugLevel(0),
48 m_famMethod(1),
49 m_binTimeInterval(125),
50 m_SaveTCWaveForm(0),
51 m_beambkgtag(0),
52 m_famana(0),
53 m_SetTCEThreshold(100.0),
54 m_FADC(1),
55 m_ConditionDB(false),
56 m_SourceOfTC(3)
57 {
58
59 string desc = "TRGECLFAMModule(" + version() + ")";
60 setDescription(desc);
61 setPropertyFlags(c_ParallelProcessingCertified);
62
63 addParam("DebugLevel", m_debugLevel, "TRGECL debug level", m_debugLevel);
64 addParam("FAMFitMethod", m_famMethod, "TRGECLFAM fit method", m_famMethod);
65 addParam("FAMBinTimeInterval", m_binTimeInterval, "TRGECLFAM binTimeInterval",
66 m_binTimeInterval);
67 addParam("TCWaveform", m_SaveTCWaveForm, "Output the TC waveform ",
68 m_SaveTCWaveForm);
69 addParam("FAMAnaTable", m_famana, "Save FAM ana table ",
70 m_famana);
71 addParam("BeamBkgTag", m_beambkgtag, "Save beambackground tag in TRGECLHit table ",
72 m_beambkgtag);
73 addParam("TCThreshold", m_SetTCEThreshold, "Set FAM TC threshold ",
74 m_SetTCEThreshold);
75 addParam("ShapingFunction", m_FADC, "Set function of shaper ", m_FADC);
76 addParam("ConditionDB", m_ConditionDB, "Use conditionDB ", m_ConditionDB);
77 addParam("SourceOfTC", m_SourceOfTC,
78 "Select source of TC data(1:=ECLHit or 2:=ECLSimHit or 3:=ECLHit+TRGECLBGTCHit)",
79 m_SourceOfTC);
80
81 if (m_ConditionDB) { //Use global tag
82 m_FAMPara.addCallback(this, &TRGECLFAMModule::beginRun);
83 }
84 B2DEBUG(100, "TRGECLFAMModule ... created");
85 m_TCEThreshold.clear();
86
87 }

◆ TRGECLModule()

Constructor.

Definition at line 47 of file TRGECLModule.cc.

47 :
48 Module::Module(), m_debugLevel(0), m_Bhabha(0),
49 m_Clustering(1), m_ClusterLimit(6), m_EventTiming(1),
50 m_TimeWindow(250.0), m_OverlapWindow(125.0), m_NofTopTC(3),
51 m_SelectEvent(1), m_ConditionDB(true)
52 {
53
54 string desc = "TRGECLModule(" + version() + ")";
55 setDescription(desc);
56 setPropertyFlags(c_ParallelProcessingCertified);
57
58 addParam("DebugLevel",
59 m_debugLevel,
60 "TRGECL debug level",
61 m_debugLevel);
62 addParam("Bhabha",
63 m_Bhabha,
64 "TRGECL Bhabha method 0 : Belle I, 1 :belle II(default)",
65 m_Bhabha);
66 addParam("Clustering",
67 m_Clustering,
68 "TRGECL Clustering method 0 : use only ICN, 1 : ICN + Energy(Default)",
69 m_Clustering);
70 addParam("ClusterLimit",
71 m_ClusterLimit,
72 "The Limit number of cluster (Default:6)",
73 m_ClusterLimit);
74 addParam("EventTiming",
75 m_EventTiming,
76 "TRGECL EventTiming method 0 : Belle I, 1 : Energetic TC, 2 : Energy Weighted timing (default)",
77 m_EventTiming);
78 addParam("NofTopTC",
79 m_NofTopTC,
80 "TRGECL # of considered TC in energy weighted Timing method(Only work for EvenTiming Method 2)",
81 m_NofTopTC);
82 addParam("TimeWindow",
83 m_TimeWindow,
84 "TRGECL Trigger decision Time Window",
85 m_TimeWindow);
86 addParam("OverlapWindow",
87 m_OverlapWindow,
88 "TRGECL Trigger decision Time Window",
89 m_OverlapWindow);
90 addParam("EventSelect",
91 m_SelectEvent,
92 "TRGECL Select one trigger window for logic study",
93 m_SelectEvent);
94 addParam("ConditionDB",
95 m_ConditionDB,
96 "Flag to use Condition Database (0:=not use, 1:=use(default))",
97 m_ConditionDB);
98 //-----------------------------------------------
99 addParam("ADCtoEnergy",
100 m_ADCtoEnergy,
101 "set conversion factor of ADC to Energy (GeV) : ",
102 m_ADCtoEnergy);
103 addParam("TotalEnergyCut",
104 m_TotalEnergy,
105 "set total energy cut(lowe, hie, lumie) in lab (GeV) : ",
106 m_TotalEnergy);
107 addParam("Bhabha2DThresholdFWD",
108 m_2DBhabhaThresholdFWD,
109 "set energy threshold(14 regions) of 2D Bhabha veto for FWD side in Lab. (GeV) : ",
110 m_2DBhabhaThresholdFWD);
111 addParam("Bhabha2DThresholdBWD",
112 m_2DBhabhaThresholdBWD,
113 "set energy threshold(14 regions) of 2D Bhabha veto for BWD side in Lab. (GeV) : ",
114 m_2DBhabhaThresholdBWD);
115 addParam("Bhabha3DVetoThreshold",
116 m_3DBhabhaVetoThreshold,
117 "set energy threshold(low, high) of 3D Bhabha veto in CMS (GeV) : ",
118 m_3DBhabhaVetoThreshold);
119 addParam("Bhabha3DVetoAngle",
120 m_3DBhabhaVetoAngle,
121 "set angle cut (phi diff L, H, and theta sum L, H) of 3D Bhabha veto in CMS(degree) : ",
122 m_3DBhabhaVetoAngle);
123 addParam("Bhabha3DSelectionThreshold",
124 m_3DBhabhaSelectionThreshold,
125 "set energy threshold(low, high) of 3D Bhabha selection in CMS (GeV) : ",
126 m_3DBhabhaSelectionThreshold);
127 addParam("Bhabha3DSelectionAngle",
128 m_3DBhabhaSelectionAngle,
129 "set angle cut (phi diff L, H, and theta sum L, H) of 3D Bhabha selection in CMS(degree) : ",
130 m_3DBhabhaSelectionAngle);
131 addParam("Bhabha3DSelectionPreScale",
132 m_3DBhabhaSelectionPreScale,
133 "set prescale (FW, BR, BW for Bhabha selection : ",
134 m_3DBhabhaSelectionPreScale);
135 addParam("mumuThreshold",
136 m_mumuThreshold,
137 "set cluster energy cut for mumu in CMS (GeV) : ",
138 m_mumuThreshold);
139 addParam("mumuAngle",
140 m_mumuAngle,
141 "set angle cut (phi diff L, H, and theta sum L, H) of mumu in CMS(degree) : ",
142 m_mumuAngle);
143
144 addParam("lmlCLELabCut",
145 m_lmlCLELabCut,
146 "set lml cluster energy thresholds(high, middle, low) in Lab in GeV : ",
147 m_lmlCLELabCut);
148 addParam("lmlCLECMSCut",
149 m_lmlCLECMSCut,
150 "set lml cluster energy thresholds(high, middle, low) in CMS in GeV : ",
151 m_lmlCLECMSCut);
152 addParam("lml00NCLforMinE",
153 m_lml00NCLforMinE,
154 "set lml00 the number of cluster for minimum energy cluster : ",
155 m_lml00NCLforMinE);
156 addParam("lml12NCLforMinE",
157 m_lml12NCLforMinE,
158 "set lml12 the number of cluster for minimum energy cluster : ",
159 m_lml12NCLforMinE);
160 addParam("lml13ThetaIdSelection",
161 m_lml13ThetaIdSelection,
162 "set lml13 theta ID selection : ",
163 m_lml13ThetaIdSelection);
164
165 addParam("ECLBurstThreshold",
166 m_ECLBurstThreshold,
167 "set ECL Burst Threshold in lab in GeV : ",
168 m_ECLBurstThreshold);
169 addParam("EventTimingQualityThreshold",
170 m_EventTimingQualityThreshold,
171 "set EventTimingQualityThreshold (low energy(GeV) and high energy(GeV))",
172 m_EventTimingQualityThreshold);
173
174 addParam("3DBhabhaVetoInTrackThetaRegion",
175 m_3DBhabhaVetoInTrackThetaRegion,
176 "set 3DBhabhaVetoInTrackThetaRegion (low TCID and high TCID)",
177 m_3DBhabhaVetoInTrackThetaRegion);
178
179 addParam("Taub2bAngleCut",
180 m_taub2bAngleCut,
181 "set Taub2bAngleCut(dphi low and high, theta sum low and high(degree)",
182 m_taub2bAngleCut);
183 addParam("Taub2bEtotCut",
184 m_taub2bEtotCut,
185 "set Taub2b total energy cut in TC ThetaID 1-17(GeV)",
186 m_taub2bEtotCut);
187 addParam("Taub2bCLELabCut",
188 m_taub2bCLELabCut,
189 "set Taub2b cluster energy cut in Lab (GeV) : ",
190 m_taub2bCLELabCut);
191
192 addParam("hie12BhabhaVetoAngle",
193 m_hie12BhabhaVetoAngle,
194 "set Angle Cut of Bhbaha Additional veto for hie (dphi low and high, theta sum low and high(degree)",
195 m_hie12BhabhaVetoAngle);
196
197 addParam("Taub2b2AngleCut",
198 m_taub2b2AngleCut,
199 "set Taub2b2AngleCut(dphi low and high, theta sum low and high(degree))",
200 m_taub2b2AngleCut);
201 addParam("Taub2b2EtotCut",
202 m_taub2b2EtotCut,
203 "set Taub2b2 total energy cut in TC ThetaID 1-17(GeV)",
204 m_taub2b2EtotCut);
205 addParam("Taub2b2CLELabCut",
206 m_taub2b2CLELabCut,
207 "set Taub2b2 cluster energy Cut(high, low) (GeV) : ",
208 m_taub2b2CLELabCut);
209
210 addParam("Taub2b3AngleCut",
211 m_taub2b3AngleCut,
212 "set Taub2b3AngleCut(dphi low and high, theta sum low and high in cms (degree))",
213 m_taub2b3AngleCut);
214 addParam("Taub2b3EtotCut",
215 m_taub2b3EtotCut,
216 "set Taub2b3 total energy cut in lab in ThetaID 1-17(GeV)",
217 m_taub2b3EtotCut);
218 addParam("Taub2b3CLEb2bLabCut",
219 m_taub2b3CLEb2bLabCut,
220 "set Taub2b3 cluster energy Cut in lab for one of b2b clusters (GeV) : ",
221 m_taub2b3CLEb2bLabCut);
222 addParam("Taub2b3CLELabCut",
223 m_taub2b3CLELabCut,
224 "set Taub2b3 cluster energy Cut(low, high) in lab for all clusters (GeV) : ",
225 m_taub2b3CLELabCut);
226
227 //-------------------------------------
228 m_TotalEnergy.clear();
229 m_2DBhabhaThresholdFWD.clear();
230 m_2DBhabhaThresholdBWD.clear();
231 m_3DBhabhaVetoThreshold.clear();
232 m_3DBhabhaVetoAngle.clear();
233 m_3DBhabhaSelectionThreshold.clear();
234 m_3DBhabhaSelectionAngle.clear();
235 m_3DBhabhaSelectionPreScale.clear();
236 m_mumuAngle.clear();
237 m_lmlCLELabCut.clear();
238 m_lmlCLECMSCut.clear();
239 m_EventTimingQualityThreshold.clear();
240 m_3DBhabhaVetoInTrackThetaRegion.clear();
241 m_hie12BhabhaVetoAngle.clear();
242 m_taub2bAngleCut.clear();
243 m_taub2b2AngleCut.clear();
244 m_taub2b2CLELabCut.clear();
245 m_taub2b3AngleCut.clear();
246 m_taub2b3CLELabCut.clear();
247 // lowe, hie, lume in Lab in GeV
248 m_TotalEnergy = {0.5, 1.0, 3.0};
249 // 2D Bhabha E cut in Lab in GeV (forward and backward sides)
250 m_2DBhabhaThresholdFWD = {4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 3.0, 3.5};
251 m_2DBhabhaThresholdBWD = {2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5, 3.0, 3.0};
252 // 3D Bhabha
253 m_3DBhabhaVetoThreshold = {3.0, 4.5}; // GeV
254 m_3DBhabhaVetoAngle = {160, 200, 165, 190}; // degree
255 // 3D Bhabha selection
256 m_3DBhabhaSelectionThreshold = {2.5, 4.0}; // GeV
257 m_3DBhabhaSelectionAngle = {140, 220, 160, 200}; // degree
258 m_3DBhabhaSelectionPreScale = {1, 1, 1}; // pre-scale(no unit)
259 // mumu
260 m_mumuThreshold = 2.0; // GeV
261 m_mumuAngle = {160, 200, 165, 190}; // degree
262 // lml
263 m_lmlCLELabCut = {0.5, 0.3, 0.25}; // in GeV
264 m_lmlCLECMSCut = {2.0, 1.0, 0.5}; // in GeV
265 m_lml00NCLforMinE = 1;
266 m_lml12NCLforMinE = 1;
267 m_lml13ThetaIdSelection = 2016;
268 //
269 m_ECLBurstThreshold = 20.0; // GeV
270 //
271 m_EventTimingQualityThreshold = {1.0, 20}; // GeV
272 //
273 m_3DBhabhaVetoInTrackThetaRegion = {3, 15};
274 // taub2b
275 m_taub2bAngleCut = {110, 250, 130, 230}; // degree
276 m_taub2bEtotCut = 7.0; // GeV
277 m_taub2bCLELabCut = 1.9; // GeV
278 //
279 m_hie12BhabhaVetoAngle = {150, 210, 160, 200}; // degree
280 // taub2b2
281 m_taub2b2AngleCut = {120, 240, 140, 220}; // degree
282 m_taub2b2EtotCut = 7.0; // GeV
283 m_taub2b2CLELabCut = {3.0, 0.162}; // GeV
284 // taub2b3
285 m_taub2b3AngleCut = {120, 240, 140, 220}; // degree
286 m_taub2b3EtotCut = 7.0; // GeV
287 m_taub2b3CLEb2bLabCut = 0.14; // GeV
288 m_taub2b3CLELabCut = {0.12, 4.50}; // GeV
289 //
290 m_hie4LowCLELabCut = 0.5; // GeV
291
292 if (TRGDebug::level()) {
293 std::cout << "TRGECLModule ... created" << std::endl;
294 }
295 }

◆ TRGECLQAMModule()

Constructor.

Definition at line 57 of file TRGECLQAMModule.cc.

58 : Module::Module(),
59 m_nevent(1), m_outputfile("")
60 {
61
62 string desc = "TRGECLQAMModule(" + version() + ")";
63 setDescription(desc);
64 setPropertyFlags(c_ParallelProcessingCertified);
65
66 addParam("outputFileName", m_outputfile, "TRGECL QAM file", m_outputfile);
67
68 m_nRun = 0;
69 m_nevent = 1;
70
71 //Problem TC Check
72 m_FWD = 0;
73 m_BAR = 0;
74 m_BWD = 0;
75 m_ALL = 0;
76 memset(TCID, 0, sizeof(TCID));
77
78
79 //Total Energy
80
81 m_etot = 0;
82 m_etot_mean = 0;
83 m_etot_error = 0;
84 m_etot_sigma = 0;
85
86 // std::vector<int> etot;
87 etot.clear();
88
89 //Caltime
90
91 m_caltime_mean = 0;
92 m_caltime_error = 0;
93 m_caltime_sigma = 0;
94 caltime.clear();
95
96 //Cluster E
97
98 clusterE = 0;
99 cluster.clear();
100
101 B2DEBUG(100, "TRGECLQAMModule ... created");
102 }

◆ TRGECLRawdataAnalysisModule()

Constructor.

Definition at line 37 of file TRGECLRawdataAnalysisModule.cc.

38 : Module::Module(),
39 _debugLevel(0), _Clustering(1)
40 {
41
42 string desc = "TRGECLRawdataAnalysisModule(" + version() + ")";
43 setDescription(desc);
44 // setPropertyFlags(c_ParallelProcessingCertified | c_InitializeInProcess);
45
46 addParam("DebugLevel", _debugLevel, "TRGECL debug level", _debugLevel);
47 addParam("Clustering", _Clustering, "TRGECL Clustering method 0 : use only ICN, 1 : ICN + Energy(Default)", _Clustering);
48
49
50
51 if (TRGDebug::level()) {
52 std::cout << "TRGECLRawdataAnalysisModule ... created" << std::endl;
53 }
54 }

◆ TRGGDLModule()

Constructor.

Definition at line 37 of file TRGGDLModule.cc.

37 : HistoModule(),
38//TRGGDLModule::TRGGDLModule()
39// : Module::Module(),
40 _debugLevel(0),
41 _configFilename("TRGGDLConfig.dat"),
42 _simulationMode(1),
43 _fastSimulationMode(0),
44 _firmwareSimulationMode(0),
45 _Phase("Phase2"),
46 _algFilePath("ftd.alg")
47 {
48
49 string desc = "TRGGDLModule(" + version() + ")";
50 setDescription(desc);
51 setPropertyFlags(c_ParallelProcessingCertified);
52
53 addParam("debugLevel", _debugLevel, "Debug Level", _debugLevel);
54 addParam("Belle2Phase", _Phase, "Phase2 or Phase3", _Phase);
55 addParam("ConfigFile",
56 _configFilename,
57 "The filename of CDC trigger config file",
58 _configFilename);
59 addParam("SimulationMode",
60 _simulationMode,
61 "TRGGDL simulation switch",
62 _simulationMode);
63 addParam("FastSimulationMode",
64 _fastSimulationMode,
65 "TRGGDL fast simulation mode",
66 _fastSimulationMode);
67 addParam("FirmwareSimulationMode",
68 _firmwareSimulationMode,
69 "TRGGDL firmware simulation mode",
70 _firmwareSimulationMode);
71
72 addParam("algFromDB",
73 _algFromDB,
74 "Set false when alg is taken from local file.",
75 true);
76
77 addParam("algFilePath",
78 _algFilePath,
79 ".alg file path",
80 _algFilePath);
81
82 addParam("timquality_threshold_sfin",
83 _timquality_threshold_sfin,
84 "Threshold to determine timing quality flag with MC truth: superfine",
85 -1.0);
86
87 addParam("timquality_threshold_fine",
88 _timquality_threshold_fine,
89 "Threshold to determine timing quality flag with MC truth: fine",
90 10.0);
91
92 addParam("simulateT0jitter",
93 m_simulateT0Jitter,
94 "if True, L1 jitter is simulated by EventT0Generator.",
95 false);
96
97 B2DEBUG(100, "TRGGDLModule ... created");
98 }

◆ TRGGRLModule()

Constructor.

Definition at line 36 of file TRGGRLModule.cc.

37 : Module::Module(),
38 _debugLevel(0),
39 _configFilename("TRGGDLConfig.dat"),
40 _simulationMode(2),
41 _fastSimulationMode(0),
42 _firmwareSimulationMode(0)
43 {
44
45 string desc = "TRGGRLModule(" + version() + ")";
46 setDescription(desc);
47 setPropertyFlags(c_ParallelProcessingCertified);
48
49 addParam("DebugLevel", _debugLevel, "TRGGRL debug level", _debugLevel);
50 addParam("ConfigFile",
51 _configFilename,
52 "The filename of CDC trigger config file",
53 _configFilename);
54 addParam("SimulationMode",
55 _simulationMode,
56 "TRGGRL simulation switch",
57 _simulationMode);
58 addParam("FastSimulationMode",
59 _fastSimulationMode,
60 "TRGGRL fast simulation mode",
61 _fastSimulationMode);
62 addParam("FirmwareSimulationMode",
63 _firmwareSimulationMode,
64 "TRGGRL firmware simulation mode",
65 _firmwareSimulationMode);
66 }

◆ version() [1/9]

string version ( void ) const

returns version of TRGCDCModule.

Definition at line 42 of file TRGCDCModule.cc.

43 {
44 return string("TRGCDCModule 5.07");
45 }

◆ version() [2/9]

string version ( void ) const

returns version of TRGCDCTSStreamModule.

Definition at line 37 of file TRGCDCTSStreamModule.cc.

38 {
39 return string("TRGCDCTSStreamModule 0.00");
40 }

◆ version() [3/9]

string version ( void ) const

returns version of TRGECLBGTCHitModule.

Definition at line 34 of file TRGECLBGTCHitModule.cc.

35 {
36 return string("TRGECLBGTCHitModule 1.00");
37 }

◆ version() [4/9]

string version ( void ) const

returns version of TRGECLFAMModule.

Definition at line 38 of file TRGECLFAMModule.cc.

39 {
40 return string("TRGECLFAMModule 1.00");
41 }

◆ version() [5/9]

string version ( void ) const

returns version of TRGECLModule.

Definition at line 40 of file TRGECLModule.cc.

41 {
42 return string("TRGECLModule 1.00");
43 }

◆ version() [6/9]

string version ( void ) const

version

Definition at line 50 of file TRGECLQAMModule.cc.

51 {
52 return string("TRGECLQAMModule 1.00");
53 }

◆ version() [7/9]

string version ( void ) const

returns version of TRGECLModule.

Definition at line 30 of file TRGECLRawdataAnalysisModule.cc.

31 {
32 return string("TRGECLAnalysisModule 1.00");
33 }

◆ version() [8/9]

string version ( void ) const

returns version of TRGGDLModule.

Definition at line 32 of file TRGGDLModule.cc.

33 {
34 return string("TRGGDLModule 0.00");
35 }

◆ version() [9/9]

string version ( void ) const

returns version of TRGGRLModule.

Definition at line 31 of file TRGGRLModule.cc.

32 {
33 return string("TRGGRLModule 0.00");
34 }

◆ ~TRGCDCModule()

~TRGCDCModule ( )
virtual

Destructor.

Definition at line 247 of file TRGCDCModule.cc.

248 {
249 if (_cdc)
250 TRGCDC::getTRGCDC("good-bye");
251
252 if (TRGDebug::level())
253 cout << "TRGCDCModule ... destructed " << endl;
254 }

◆ ~TRGCDCTSStreamModule()

~TRGCDCTSStreamModule ( )
virtual

Destructor.

Definition at line 70 of file TRGCDCTSStreamModule.cc.

71 {
72
73 if (_cdc)
74 TRGCDC::getTRGCDC("good-bye");
75
76 if (TRGDebug::level())
77 cout << "TRGCDCTSStreamModule ... destructed " << endl;
78 }

◆ ~TRGECLBGTCHitModule()

~TRGECLBGTCHitModule ( )
virtual

Destructor.

Definition at line 76 of file TRGECLBGTCHitModule.cc.

77 {
78 B2DEBUG(100, "TRGECLBGTCHitModule ... destructed ");
79 }

◆ ~TRGECLFAMModule()

~TRGECLFAMModule ( )
virtual

Destructor.

Definition at line 91 of file TRGECLFAMModule.cc.

92 {
93
94 B2DEBUG(100, "TRGECLFAMModule ... destructed ");
95
96 }

◆ ~TRGECLModule()

~TRGECLModule ( )
virtual

Destructor.

Definition at line 299 of file TRGECLModule.cc.

300 {
301 if (TRGDebug::level()) {
302 std::cout << "TRGECLModule ... destructed " << std::endl;
303
304 }
305 }

◆ ~TRGECLQAMModule()

~TRGECLQAMModule ( )
virtual

Destrunctor.

Definition at line 106 of file TRGECLQAMModule.cc.

107 {
108
109 B2DEBUG(100, "TRGECLQAMModule ... destructed ");
110 }

◆ ~TRGECLRawdataAnalysisModule()

Destructor.

Definition at line 58 of file TRGECLRawdataAnalysisModule.cc.

59 {
60
61 if (TRGDebug::level()) {
62 std::cout << "TRGECLRawdataAnalysisModule ... destructed " << std::endl;
63
64 }
65 }

◆ ~TRGGDLModule()

~TRGGDLModule ( )
virtual

Destructor.

Definition at line 100 of file TRGGDLModule.cc.

101 {
102
103 if (_gdl)
104 B2DEBUG(100, "good-bye");
105
106 B2DEBUG(100, "TRGGDLModule ... destructed ");
107 }

◆ ~TRGGRLModule()

~TRGGRLModule ( )
virtual

Destructor.

Definition at line 68 of file TRGGRLModule.cc.

69 {
70
71 if (_grl)
72 TRGGRL::getTRGGRL("good-bye");
73
74 }

Variable Documentation

◆ _gdl

TRGGDL * _gdl = 0
staticprivate

A pointer to a TRGGDL;.

Definition at line 119 of file TRGGDLModule.h.

◆ _grl

TRGGRL * _grl = 0
staticprivate

A pointer to a TRGGRL;.

Definition at line 82 of file TRGGRLModule.h.

◆ intNaN

const int intNaN = std::numeric_limits<int>::quiet_NaN()
static

Definition at line 53 of file trgrawdataModule.h.

◆ Linear_fit_of_Hits

Linear_fit_of_Hits_t Linear_fit_of_Hits
constexpr

Definition at line 140 of file klmtrgLinearFit.cc.

◆ mergerWidth

int mergerWidth = 256
staticconstexpr

Merger data width.

Definition at line 45 of file CDCTriggerUnpackerModule.h.

◆ nAllMergers

int nAllMergers = 146
staticconstexpr

Number of Mergers.

Definition at line 47 of file CDCTriggerUnpackerModule.h.

◆ nFinesse

int nFinesse = 48
staticconstexpr

Number of FINESSE in a PCIe40.

Definition at line 51 of file CDCTriggerUnpackerModule.h.

◆ wordWidth

int wordWidth = 32
staticconstexpr

width of a single word in the raw int buffer

Definition at line 49 of file CDCTriggerUnpackerModule.h.