1 #ifndef EUDAQ_INCLUDED_DataConverterPlugin
2 #define EUDAQ_INCLUDED_DataConverterPlugin
4 #include "eudaq/StandardEvent.hh"
5 #include "eudaq/RawDataEvent.hh"
8 #include "IMPL/LCEventImpl.h"
9 #include "IMPL/TrackerRawDataImpl.h"
10 #include "IMPL/TrackerDataImpl.h"
11 #include "IMPL/LCCollectionVec.h"
12 #include "IMPL/LCGenericObjectImpl.h"
13 #include "UTIL/CellIDEncoder.h"
17 using lcio::TrackerDataImpl;
19 #include "TLUEvent.hh"
21 #define NOTIMESTAMPSET (uint64_t) - 1
22 #define NOTIMEDURATIONSET 0
26 #define Event_IS_EARLY -1
27 #define Event_IS_LATE 1
28 #define Event_IS_Sync 0
35 using namespace EVENT;
44 bool Collection_createIfNotExist(lcio::LCCollectionVec **zsDataCollection,
45 const lcio::LCEvent &lcioEvent,
47 void ConvertPlaneToLCIOGenericPixel(StandardPlane &plane,
48 lcio::TrackerDataImpl &zsFrame);
51 inline int compareTLU2DUT(
unsigned TLU_Trigger_Number,
52 unsigned DUT_Trigger_number) {
53 if (DUT_Trigger_number == TLU_Trigger_Number) {
55 }
else if (DUT_Trigger_number > TLU_Trigger_Number) {
56 return Event_IS_EARLY;
61 inline int compareTLU2DUT(T TLU_Trigger_Number, T DUT_Trigger_number) {
62 if (DUT_Trigger_number == TLU_Trigger_Number) {
64 }
else if (DUT_Trigger_number > TLU_Trigger_Number) {
65 return Event_IS_EARLY;
71 inline int hasTimeOVerlaping(T eventBegin, T EventEnd, T TLUStart, T TLUEnd) {
73 if (eventBegin <= TLUEnd) {
74 if (EventEnd >= TLUStart) {
101 return Event_IS_EARLY;
116 return Event_IS_LATE;
134 typedef std::pair<unsigned, std::string> t_eventid;
139 virtual unsigned GetTriggerID(
eudaq::Event const &)
const;
146 unsigned triggerID = ev.GetTag<
unsigned>(
"tlu_trigger_id", 0);
147 auto tlu_triggerID = tlu.GetEventNumber();
148 return compareTLU2DUT(tlu_triggerID, triggerID);
153 ev.SetTag(
"tlu_trigger_id", tlu.GetEventNumber());
155 virtual void GetLCIORunHeader(lcio::LCRunHeader &,
eudaq::Event const &,
210 #endif // EUDAQ_INCLUDED_DataConverterPlugin
Definition: TLUEvent.hh:10
Definition: Configuration.hh:12
virtual ~DataConverterPlugin()
Definition: DataConverterPlugin.hh:179
virtual t_eventid const & GetEventType() const
Definition: DataConverterPlugin.hh:175
t_eventid m_eventtype
Definition: DataConverterPlugin.hh:187
virtual bool GetStandardSubEvent(StandardEvent &, eudaq::Event const &) const
Definition: DataConverterPlugin.hh:167
Definition: StandardEvent.hh:128
Definition: DataConverterPlugin.hh:132
virtual bool GetLCIOSubEvent(lcio::LCEvent &, eudaq::Event const &) const
Definition: DataConverterPlugin.hh:160