FdTriggerSimulator.h
Go to the documentation of this file.
1 
12 #ifndef _FdTriggerSimulatorOG_FdTriggerSimulator_h_
13 #define _FdTriggerSimulatorOG_FdTriggerSimulator_h_
14 
15 #include <utl/config.h>
16 #include <utl/TimeStamp.h>
17 #include <fwk/VModule.h>
18 #include <fevt/SLTData.h>
19 
20 #include <vector>
21 #include <map>
22 #include <list>
23 #include <set>
24 #include <string>
25 
26 #include <utl/Trace-fwd.h>
27 
28 class TEyeEvent;
29 class TMirrorEvent;
30 
31 #ifdef FDLIB_V3R3
32 #include <stdio.h>
33 class EyeEventClassifier;
34 class VTltProcessor;
35 #endif
36 
37 namespace utl {
38  class TimeInterval;
39 }
40 
41 namespace fevt {
42  class Telescope;
43  class Eye;
44  class PixelSimData;
45 }
46 
47 namespace fdet {
48  class Telescope;
49  class Eye;
50  class Channel;
51 }
52 
53 namespace FdTriggerSimulatorOG {
54 
68 
69  public:
71  eT3,
76  };
77 
80 
83 
86 
89 
90  private:
91  // top level trigger routines
92  bool FLTSim(fevt::Telescope& tel);
93  int SLTSim(fevt::Telescope& tel);
94  bool TLTSim(TMirrorEvent* tel, fevt::Telescope& evtTel);
95  bool T3Sim(TEyeEvent& eye, fevt::Eye& evtEye);
96 
98  bool T1Trigger(unsigned int chId, unsigned int pixelthreshold,
99  unsigned int nSamp,
100  const utl::TraceI& trace,
101  fevt::PixelSimData& pixelSim,
102  const fdet::Channel& detChannel);
103 
105  int T2Trigger(const fdet::Telescope& detTel, unsigned int lastFLTbin);
106  int ShiftEventToSLT(fevt::Telescope& tel, int sltTimeOffset);
107 
109  void DoPixelList(int sltTimeOffset, const fdet::Telescope& detTel);
110 
112  unsigned int TestPattern(const std::set<int>& pixInCycle, int col, int row,
113  int& multipattern, std::vector<int>& usedInSlt);
114 
115  TMirrorEvent* MakeMirrorEvent(fevt::Telescope& tel,
116  const evt::Event& event,
117  const utl::TimeInterval& offsetFdSd,
118  int sltTimeOffset);
119 
120  bool AddEyeEvent(fevt::Eye& eye, evt::Event& event,
121  TEyeEvent& EyeEvent);
122 
123  private:
124  // Datacard variables
127  unsigned int fVerbosity;
128  int fColRO; //< Number of columns (around FLTed pixel) to read out neighbours
129  int fRowRO; //< Number of rows (around FLTed pixel) to read out neighbours
130  //double fT0; //< Variable for timing offset // unused. LN.
131 
132  std::list<int> fChannelFLT; //< list of triggered pixels
133  std::list<int> fChannelReadOutList; //< list of pixel to be read out into the FD-event
134 
135  // FLT stuff
136  typedef std::map<int, int> FltTrace;
137  std::map<int, FltTrace> fFLT; // Flag of pixel ON at each time
138  std::map<int, int> fMultiplicity; // FLTcount; /// Count of simultaneous pixel on at each time (multiplicity)
139 
140  // SLT stuff
141  std::map<int, fevt::SLTData> fSLT; // SLT word for each column (1-20) and SLT time slice (1000 ns)
142 
143  //TLT stuff
146 
147 #ifdef FDLIB_V3R3
148  private:
149  EyeEventClassifier* fT3;
150  VTltProcessor* fTltProcessor;
151  FILE* fTltLogFile;
152 #endif
153 
154  REGISTER_MODULE("FdTriggerSimulatorOG", FdTriggerSimulator);
155 
156  };
157 
158 }
159 
160 
161 #endif
Simulates the FLT, SLT, TLT and T3 of the telescopes.
fwk::VModule::ResultFlag Init()
Init method of the module.
Description of the electronic channel for the 480 channels of the crate.
bool T3Sim(TEyeEvent &eye, fevt::Eye &evtEye)
Fluorescence Detector Eye Event.
Definition: FEvent/Eye.h:29
std::map< int, fevt::SLTData > fSLT
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
TMirrorEvent * MakeMirrorEvent(fevt::Telescope &tel, const evt::Event &event, const utl::TimeInterval &offsetFdSd, int sltTimeOffset)
int ShiftEventToSLT(fevt::Telescope &tel, int sltTimeOffset)
bool AddEyeEvent(fevt::Eye &eye, evt::Event &event, TEyeEvent &EyeEvent)
fwk::VModule::ResultFlag Finish()
Finish method of the module.
fwk::VModule::ResultFlag Run(evt::Event &event)
Run method of the module.
Module interface.
Definition: VModule.h:53
int T2Trigger(const fdet::Telescope &detTel, unsigned int lastFLTbin)
SLT algorithm.
REGISTER_MODULE("FdTriggerSimulatorOG", FdTriggerSimulator)
bool TLTSim(TMirrorEvent *tel, fevt::Telescope &evtTel)
Detector description interface for Telescope-related data.
A TimeInterval is used to represent time elapsed between two events.
Definition: TimeInterval.h:43
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
unsigned int TestPattern(const std::set< int > &pixInCycle, int col, int row, int &multipattern, std::vector< int > &usedInSlt)
Method to search patterns in list.
bool T1Trigger(unsigned int chId, unsigned int pixelthreshold, unsigned int nSamp, const utl::TraceI &trace, fevt::PixelSimData &pixelSim, const fdet::Channel &detChannel)
FLT algorithm.
Fluorescence Detector Telescope Event.
Fluorescence Detector Pixel Simulated Data.
Definition: PixelSimData.h:28
void DoPixelList(int sltTimeOffset, const fdet::Telescope &detTel)
Prepare list of pixel to be read-out.

, generated on Tue Sep 26 2023.