9 #define TRG_SHORT_NAMES
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>
37 TRGGRL::name(
void)
const
43 TRGGRL::version(
void)
const
45 return string(
"TRGGRL 0.01");
49 TRGGRL::getTRGGRL(
const string& configFile,
50 unsigned simulationMode,
51 unsigned fastSimulationMode,
52 unsigned firmwareSimulationMode)
59 if (configFile !=
"good-bye") {
60 _grl =
new TRGGRL(configFile,
63 firmwareSimulationMode);
65 B2DEBUG(100,
"TRGGRL::getTRGGRL ... good-bye");
73 TRGGRL::getTRGGRL(
void)
76 B2WARNING(
"TRGGRL::getTRGGRL !!! TRGGRL is not created yet");
80 TRGGRL::TRGGRL(
const string& configFile,
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();}
193 for (
unsigned i = 0; i < n_track3D; i++) {
195 if (n_cluster == 0)
break;
196 else if (n_cluster == 1) {
200 int best_j = 0;
double old_dr = 99999;
201 for (
unsigned j = 0; j < n_cluster; j++) {
203 if (match->getDr() < old_dr) {best_j = j; old_dr = match->getDr();}
211 for (
unsigned i = 0; i <
matchList.size(); i++) {
214 x0 = match.getMatch3D();
218 x4 = match.getCenter_z0();
219 x5 = match.getCenter_pt();
220 x6 = match.getCenter_pz();
221 x7 = match.getCluster_e();
225 for (
unsigned i = 0; i <
matchList3D.size(); i++) {
228 x0 = match.getMatch3D();
232 x4 = match.getCenter_z0();
233 x5 = match.getCenter_pt();
234 x6 = match.getCenter_pz();
235 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.
void fastClear(void)
clears TRGGRL information.
void terminate(void)
terminates when run is finished
std::vector< TRGCDCTrack * > getTrackList3D(void)
returns 3D track list (fitted).
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.
void simulate(void)
fast trigger simulation.
void clear(void)
clears all TRGGRL information.
void firmwareSimulation(void)
Firmware simulation.
virtual ~TRGGRL()
Destructor.
Abstract base class for different kinds of events.