Commit 99b9874f authored by Sarah Seif El Nasr's avatar Sarah Seif El Nasr
Browse files

Merge branch 'v1.x-dev' into 'v1.x-dev'

Added CMSIT converter plugin for data coming from Ph2_ACF

See merge request !1
parents 87d561f1 ac20d8fd
......@@ -7,9 +7,8 @@ lib/*
# IGnore build
build
# Ignoere incle
include
# Ignore include
/include
# Ignore data files:
data/*
......
/*!
\file CMSITConverterPlugin.cc
\brief Implementaion of CMSIT Converter Plugin for EUDAQ
\author Mauro DINARDO
\version 1.0
\date 23/08/21
Support: email to mauro.dinardo@cern.ch
Support: email to alkiviadis.papadopoulos@cern.ch
*/
#include <cstdint>
#include <ctime>
#include <vector>
#include <string>
namespace CMSITEventData
{
struct HitData
{
uint32_t row, col, tot;
template <typename Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar& row;
ar& col;
ar& tot;
}
};
struct ChipEventData
{
std::string chipType;
uint32_t chipId;
uint32_t chipLane;
uint32_t hybridId;
uint32_t triggerId;
uint32_t triggerTag;
uint32_t bcId;
std::vector<HitData> hits;
template <typename Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar& chipType;
ar& chipId;
ar& chipLane;
ar& hybridId;
ar& triggerId;
ar& triggerTag;
ar& bcId;
ar& hits;
}
};
struct EventData
{
std::time_t timestamp;
uint32_t l1aCounter;
uint32_t tdc;
uint32_t bxCounter;
uint32_t tluTriggerId;
std::vector<ChipEventData> chipData;
template <typename Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar& timestamp;
ar& l1aCounter;
ar& tdc;
ar& bxCounter;
ar& tluTriggerId;
ar& chipData;
}
};
} // namespace CMSITEventData
......@@ -48,9 +48,11 @@ namespace eudaq {
typedef std::map<std::string, std::string> map_t;
bool isbusy=false;
int m_state;
std::string m_msg;
int m_state;
map_t m_tags; ///< Metadata tags in (name=value) pairs of strings
};
......
......@@ -61,7 +61,7 @@ namespace eudaq {
protected:
int m_state;
std::string m_type, m_name;
std::string m_name, m_type;
std::string m_host;
/*
......
......@@ -29,6 +29,21 @@ ENDIF(BUILD_nreader)
AUX_SOURCE_DIRECTORY( src library_sources )
AUX_SOURCE_DIRECTORY( plugins plugins_sources )
# Boost
string(ASCII 27 Esc)
set(Reset "${Esc}[m")
set(BoldRed "${Esc}[1;31m")
set(BoldBlue "${Esc}[1;34m")
find_package(Boost 1.53 REQUIRED serialization)
include_directories(${Boost_INCLUDE_DIRS})
link_libraries(${Boost_SERIALIZATION_LIBRARY})
IF (Boost_FOUND)
message("${BoldBlue}=== I found BOOST version ${Boost_VERSION} ===${Reset}")
ELSE (Boost_FOUND)
message("${BoldRed}=== I didn't find any BOOST. BOOST is needed to run with the InnerTracker DAQ ===${Reset}")
list(REMOVE_ITEM plugins_sources plugins/CMSITConverterPlugin.cc)
ENDIF (BUILD_nreader)
option(USE_TINYXML "Compiling main library using TinyXML" OFF)
if (USE_TINYXML OR BUILD_palpidefs)
FIND_PACKAGE( TINYXML REQUIRED )
......
This diff is collapsed.
......@@ -66,7 +66,7 @@ virtual bool GetLCIOSubEvent(lcio::LCEvent & lcioEvent, eudaq::Event const & eud
//data headers (DHs) in the data stream
boardChannels.at(boardID) = getChannels(evRaw.GetBlock(0));
if(!boardChannels.at(boardID).empty()) boardInitialized.at(boardID) = true;
}
}
lcioEvent.parameters().setValue( eutelescope::EUTELESCOPE::EVENTTYPE, eutelescope::kDE );
LCCollectionVec * dataCollection;
......@@ -142,7 +142,11 @@ virtual bool GetStandardSubEvent(StandardEvent& sev, eudaq::Event const & ev) co
std::map<int, StandardPlane> StandardPlaneMap;
auto evRaw = dynamic_cast<RawDataEvent const &>(ev);
//In the Gen3 producer we will only have one data block, always!
// Fix here - for some reason the BORE sometimes contains zero data blocks; need to skip it in that case - Simon
if (evRaw.NumBlocks() != 1)
return false;
auto pixelVec = decodeFEI4Data(evRaw.GetBlock(0));
int boardID = evRaw.GetTag("board", int());
......@@ -150,9 +154,12 @@ virtual bool GetStandardSubEvent(StandardEvent& sev, eudaq::Event const & ev) co
//getChannels will determine all the channels from a board, making the assumption that every channel (i.e. FrontEnd)
//wrote date into the data block. This holds true if the FE is responding. Then for every trigger there will be
//data headers (DHs) in the data stream
boardChannels.at(boardID) = getChannels(evRaw.GetBlock(0));
if(!boardChannels.at(boardID).empty()) boardInitialized.at(boardID) = true;
}
// Fix here - for some reason the BORE sometimes contains zero data blocks; need to skip it in that case - Simon
if (evRaw.NumBlocks() > 0) {
boardChannels.at(boardID) = getChannels(evRaw.GetBlock(0));
if(!boardChannels.at(boardID).empty()) boardInitialized.at(boardID) = true;
}
}
for(auto channel: boardChannels.at(boardID)){
auto sensorID = 20 + channel;
......
......@@ -33,7 +33,7 @@ void EUDAQMonitorCollection::Write(TFile *file) {
cout << "EUDAQMonitorCollection::Write File pointer is NULL" << endl;
exit(-1);
}
if (gDirectory != NULL) // check if this pointer exists
if (gDirectory) // check if this pointer exists
{
gDirectory->mkdir("EUDAQMonitor");
gDirectory->cd("EUDAQMonitor");
......
......@@ -92,7 +92,7 @@ void HitmapCollection::Write(TFile *file) {
// cout << "HitmapCollection::Write File pointer is NULL"<<endl;
exit(-1);
}
if (gDirectory != NULL) // check if this pointer exists
if (gDirectory) // check if this pointer exists
{
gDirectory->mkdir("Hitmaps");
gDirectory->cd("Hitmaps");
......
......@@ -16,7 +16,7 @@ HitmapHistos::HitmapHistos(SimpleStandardPlane p, RootMonitor *mon)
_lvl1Cluster(NULL), _totSingle(NULL),
_lvl1VsTot(NULL), _totHeat(NULL),
_totCluster(NULL), _hitOcc(NULL),
_nClusters(NULL), _nHits(NULL), _clusterXWidth(NULL),
_nClusters(NULL), _nHits(NULL), _clusterXWidth(NULL),
_clusterYWidth(NULL), _nbadHits(NULL), _nHotPixels(NULL),
_hitmapSections(NULL), is_MIMOSA26(false), is_APIX(false),
is_USBPIX(false), is_USBPIXI4(false), is_RD53A(false) {
......@@ -36,7 +36,7 @@ HitmapHistos::HitmapHistos(SimpleStandardPlane p, RootMonitor *mon)
is_USBPIXI4 = true;
} else if (_sensor.find("USBPIXI4B") != std::string::npos) {
is_USBPIXI4 = true;
std::cout << "set correctly" << std::endl;
std::cout << "set correctly" << std::endl;
}
is_DEPFET = p.is_DEPFET;
......
......@@ -25,7 +25,7 @@ void MonitorPerformanceCollection::Write(TFile *file) {
cout << "MonitorPerformanceCollection::Write File pointer is NULL" << endl;
exit(-1);
}
if (gDirectory != NULL) // check if this pointer exists
if (gDirectory) // check if this pointer exists
{
gDirectory->mkdir("MonitorPerformance");
gDirectory->cd("MonitorPerformance");
......
......@@ -39,7 +39,7 @@ void ParaMonitorCollection::Write(TFile *file) {
cout << "ParaMonitorCollection::Write File pointer is NULL" << endl;
exit(-1);
}
if (gDirectory != NULL) // check if this pointer exists
if (gDirectory) // check if this pointer exists
{
gDirectory->mkdir("ParaMonitor");
gDirectory->cd("ParaMonitor");
......
......@@ -256,7 +256,7 @@ void SimpleStandardPlane::setPixelType(std::string name) {
is_RD53A = true;
is_UNKNOWN = false;
AnalogPixelType = true;
} else if(name.find("Rd53a") != std::string::npos) {
} else if(name.find("RD53A") != std::string::npos) {
is_RD53A = true;
is_UNKNOWN = false;
AnalogPixelType = true;
......@@ -270,8 +270,7 @@ void SimpleStandardPlane::setPixelType(std::string name) {
is_EXPLORER = true;
is_UNKNOWN = false;
AnalogPixelType = true;
} else if (name == "pALPIDEfs" ||
name=="CLICpix" || name=="timepix3") {
} else if (name == "pALPIDEfs" || name == "CLICpix" || name == "timepix3") {
is_UNKNOWN = false;
} else {
is_UNKNOWN = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment