Belle II Software development
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)
 Register the module.
 
 REG_MODULE (CDCTriggerNeuroIDHist)
 Register the module.
 
 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)
 Register the module.
 
 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 ()
 generate random trigger data TCHit data objection
 
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 332 of file TRGECLModule.cc.

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

◆ 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 43 of file CDCTriggerNeuroDataModule.cc.

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

◆ CDCTriggerNeuroIDHistModule()

Constructor, for setting module description and parameters.

Definition at line 39 of file CDCTriggerNeuroIDHistModule.cc.

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

◆ 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 701 of file TRGECLModule.cc.

702 {
703 if (TRGDebug::level()) {
704 std::cout << "TRGECLModule ... endRun called " << std::endl;
705 }
706 }

◆ 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 138 of file CDCTriggerNeuroDataModule.cc.

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

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

◆ 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 660 of file TRGECLModule.cc.

661 {
662
663 if (TRGDebug::level()) {
664 std::cout << "TRGECLMoudle ... event called" << std::endl;
665 }
666
667 // simulation
668 if (m_SelectEvent == 0) {
669 etm->simulate01(m_nEvent);
670 } else if (m_SelectEvent == 1) {
671 etm->simulate02(m_nEvent);
672 }
673
674 m_nEvent++;
675
676 }

◆ 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

generate random trigger data TCHit data objection

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.

generate simulation TCHit data objection

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 681 of file TRGECLModule.cc.

684 {
685 double par;
686 if (dbParmap.count(parName)) {
687 par = dbParmap.at(parName);
688 } else {
689 par = parAlternativeValue;
690 B2WARNING("No key(\"" + parName +
691 "\") for map in DB and set alternative value(" + parAlternativeValue +
692 ")");
693 }
694
695 return par;
696 }

◆ initialize() [1/11]

void initialize ( void )
overridevirtual

Initialize the module.

Initialize the networks and register datastore objects.

Reimplemented from Module.

Definition at line 86 of file CDCTriggerNeuroDataModule.cc.

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

◆ 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 71 of file CDCTriggerNeuroIDHistModule.cc.

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

◆ 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 303 of file TRGECLModule.cc.

304 {
305
306 TRGDebug::level(m_debugLevel);
307
308 if (TRGDebug::level()) {
309 std::cout << "TRGECLModule::initialize ... options" << std::endl;
310 std::cout << TRGDebug::tab(4) << "debug level = " << TRGDebug::level()
311 << std::endl;
312 }
313 //
314 //
315 //
316 m_nRun = 0 ;
317 m_nEvent = 0 ;
318 m_hitNum = 0;
319 m_hitTCNum = 0;
320
321 m_TRGECLHit.registerInDataStore();
322 m_TRGECLTrg.registerInDataStore();
323 m_TRGECLCluster.registerInDataStore();
324
325 etm = new TrgEclMaster();
326
327 }

◆ 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 318 of file CDCTriggerNeuroDataModule.cc.

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

◆ terminate() [2/11]

void terminate ( void )
overridevirtual

Do the training for all sectors.

Reimplemented from Module.

Definition at line 214 of file CDCTriggerNeuroIDHistModule.cc.

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

◆ 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 711 of file TRGECLModule.cc.

712 {
713 delete etm;
714
715 if (TRGDebug::level()) {
716 std::cout << "TRGECLModule ... terminate called " << std::endl;
717 }
718 }

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

◆ 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 292 of file TRGECLModule.cc.

293 {
294 if (TRGDebug::level()) {
295 std::cout << "TRGECLModule ... destructed " << std::endl;
296
297 }
298 }

◆ ~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 113 of file TRGGDLModule.h.

◆ _grl

TRGGRL * _grl = 0
staticprivate

A pointer to a TRGGRL;.

Definition at line 79 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.