10#define TRGGRL_SHORT_NAMES
13#include "framework/datastore/StoreArray.h"
14#include "trg/trg/Utilities.h"
15#include "trg/grl/TRGGRL.h"
16#include "trg/cdc/TRGCDC.h"
17#include "trg/cdc/TRGCDCTrack.h"
18#include "trg/ecl/dataobjects/TRGECLCluster.h"
19#include "trg/ecl/TrgEclCluster.h"
23#include <framework/logging/Logger.h>
45 return string(
"TRGGRL 0.01");
50 unsigned simulationMode,
51 unsigned fastSimulationMode,
52 unsigned firmwareSimulationMode)
65 B2DEBUG(100,
"TRGGRL::getTRGGRL ... good-bye");
76 B2WARNING(
"TRGGRL::getTRGGRL !!! TRGGRL is not created yet");
81 unsigned simulationMode,
82 unsigned fastSimulationMode,
83 unsigned firmwareSimulationMode)
85 _configFilename(configFile),
86 _simulationMode(simulationMode),
87 _fastSimulationMode(fastSimulationMode),
88 _firmwareSimulationMode(firmwareSimulationMode),
89 _clock(Belle2_GDL::GDLSystemClock)
104 m_file =
new TFile(
"trggrl.root",
"RECREATE");
105 h1 =
new TTree(
"h1",
"h1");
107 h1->Branch(
"3d", &
x0,
"3d");
108 h1->Branch(
"dr", &
x1,
"dr");
109 h1->Branch(
"dz", &
x2,
"dz");
110 h1->Branch(
"poe", &
x3,
"poe");
111 h1->Branch(
"z0", &
x4,
"z0");
112 h1->Branch(
"pt", &
x5,
"pt");
113 h1->Branch(
"pz", &
x6,
"pz");
114 h1->Branch(
"e", &
x7,
"e");
128 if (msg !=
"") B2DEBUG(100,
"dump nothing...");
149 B2DEBUG(100,
"do nothing...");
170 unsigned n_track = trackList.size();
171 unsigned n_track3D = trackList3D.size();
172 unsigned n_cluster = ClusterArray.
getEntries();
176 for (
unsigned i = 0; i < n_track; i++) {
178 if (n_cluster == 0)
break;
179 else if (n_cluster == 1) {
183 int best_j = 0;
double old_dr = 99999;
184 for (
unsigned j = 0; j < n_cluster; j++) {
186 if (match->getDr() < old_dr) {best_j = j; old_dr = match->getDr();}
194 for (
unsigned i = 0; i < n_track3D; i++) {
196 if (n_cluster == 0)
break;
197 else if (n_cluster == 1) {
201 int best_j = 0;
double old_dr = 99999;
202 for (
unsigned j = 0; j < n_cluster; j++) {
204 if (match->getDr() < old_dr) {best_j = j; old_dr = match->getDr();}
213 for (
unsigned i = 0; i <
matchList.size(); i++) {
216 x0 = match.getMatch3D();
220 x4 = match.getCenter_z0();
221 x5 = match.getCenter_pt();
222 x6 = match.getCenter_pz();
223 x7 = match.getCluster_e();
227 for (
unsigned i = 0; i <
matchList3D.size(); i++) {
230 x0 = match.getMatch3D();
234 x4 = match.getCenter_z0();
235 x5 = match.getCenter_pt();
236 x6 = match.getCenter_pz();
237 x7 = match.getCluster_e();
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
The instance of TRGCDC is a singleton.
A class to represent a matching candidate in TRGGRL A matching candidate consists of a TRGCDCTrack an...
unsigned _simulationMode
Simulation mode.
std::string _configFilename
root file name.
std::vector< TRGGRLMatch * > matchList
Vector which stores list of TRGGRLMatch without 3D information.
double x5
Temporary variables to make tree in root files.
std::vector< TRGGRLMatch * > matchList3D
Vector which stores list of TRGGRLMatch with 3D information.
double x3
Temporary variables to make tree in root files.
double x7
Temporary variables to make tree in root files.
double x1
Temporary variables to make tree in root files.
double x2
Temporary variables to make tree in root files.
double x6
Temporary variables to make tree in root files.
double x0
Temporary variables to make tree in root files.
double x4
Temporary variables to make tree in root files.
void configure(void)
configures trigger modules for firmware simulation.
static TRGCDC * getTRGCDC(void)
returns TRGCDC object.
std::string name(void) const
matching function
void fastClear(void)
clears TRGGRL information.
void terminate(void)
terminates when run is finished
std::vector< TRGCDCTrack * > getTrackList3D(void)
returns 3D track list (fitted).
static TRGGRL * getTRGGRL(void)
returns TRGGRL object.
TRGGRL(const std::string &configFile, unsigned simulationMode, unsigned fastSimulationMode, unsigned firmwareSimulationMode)
Constructor.
unsigned firmwareSimulationMode(void) const
returns firmware simulation mode.
void initialize(void)
initializes GRL.
void dump(const std::string &message) const
dumps debug information.
std::vector< TRGCDCTrack * > getTrackList2D(void)
returns 2D track list (no fit).
void update(bool mcAnalysis=true)
updates TRGGRL information.
void fastSimulation(void)
Fast simulation.
std::string version(void) const
returns version.
std::string configFile(void) const
returns configuration file name.
void simulate(void)
fast trigger simulation.
void clear(void)
clears all TRGGRL information.
void firmwareSimulation(void)
Firmware simulation.
static TRGGRL * _grl
GRL singleton.
virtual ~TRGGRL()
Destructor.
Abstract base class for different kinds of events.