Skip to content

Commit de548d7

Browse files
wiechulasawenzel
authored andcommitted
Add a simple event monitor for raw data
1 parent 36e0069 commit de548d7

9 files changed

Lines changed: 886 additions & 6 deletions

File tree

Detectors/TPC/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ add_subdirectory(base)
1818
add_subdirectory(reconstruction)
1919
add_subdirectory(simulation)
2020
add_subdirectory(calibration)
21+
add_subdirectory(monitor)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
set(MODULE_NAME "TPCMonitor")
2+
3+
O2_SETUP(NAME ${MODULE_NAME})
4+
5+
set(SRCS
6+
src/SimpleEventDisplay.cxx
7+
)
8+
9+
set(HEADERS
10+
include/${MODULE_NAME}/SimpleEventDisplay.h
11+
)
12+
13+
Set(LINKDEF src/${MODULE_NAME}LinkDef.h)
14+
Set(LIBRARY_NAME ${MODULE_NAME})
15+
set(BUCKET_NAME tpc_monitor_bucket)
16+
17+
O2_GENERATE_LIBRARY()
18+
19+
#install(
20+
#DIRECTORY files
21+
#DESTINATION share/Detectors/TPC/
22+
#)
23+
# ===| Tests |==================================================================
24+
#set(TEST_SRCS
25+
#test/testTPCBase.cxx
26+
#)
27+
28+
#O2_GENERATE_TESTS(
29+
#BUCKET_NAME ${BUCKET_NAME}
30+
#MODULE_LIBRARY_NAME ${MODULE_NAME}
31+
#TEST_SRCS ${TEST_SRCS}
32+
#)
33+
34+
# ===| generate executables |===================================================
35+
Set(Exe_Names
36+
tpc-monitor
37+
)
38+
39+
Set(Exe_Source
40+
run/runMonitor.cxx
41+
)
42+
43+
# todo we repeat ourselves because the macro O2_GENERATE_LIBRARY dares deleting the variables we pass to it.
44+
set(BUCKET_NAME tpc_monitor_bucket)
45+
set(LIBRARY_NAME ${MODULE_NAME})
46+
47+
list(LENGTH Exe_Names _length)
48+
math(EXPR _length ${_length}-1)
49+
50+
foreach (_file RANGE 0 ${_length}) # loop over a range because we traverse 2 lists and not 1
51+
list(GET Exe_Names ${_file} _name)
52+
list(GET Exe_Source ${_file} _src)
53+
# Set(EXE_NAME ${_name})
54+
# Set(SRCS ${_src})
55+
# Set(DEPENDENCIES CCDB)
56+
O2_GENERATE_EXECUTABLE(
57+
EXE_NAME ${_name}
58+
SOURCES ${_src}
59+
MODULE_LIBRARY_NAME ${LIBRARY_NAME}
60+
BUCKET_NAME ${BUCKET_NAME}
61+
)
62+
endforeach (_file RANGE 0 ${_length})
63+
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#ifndef ALICEO2_TPC_SIMPLEEVENTDISPLAY_H_
2+
#define ALICEO2_TPC_SIMPLEEVENTDISPLAY_H_
3+
4+
/// \file SimpleEventDisplay.h
5+
/// \author Jens Wiechula, Jens.Wiechula@ikf.uni-frankfurt.de
6+
7+
8+
#include "THnSparse.h"
9+
#include "TPCBase/CalDet.h"
10+
#include "TPCCalibration/CalibRawBase.h"
11+
12+
class TH2D;
13+
14+
namespace o2
15+
{
16+
namespace TPC
17+
{
18+
19+
class Mapper;
20+
/// \class SimpleEventDisplay
21+
/// \brief Base of a simple event display for digits
22+
///
23+
/// This class is a base for a simple event display
24+
/// It processes raw data and saves digit information for pad and row.
25+
///
26+
/// \author Jens Wiechula, Jens.Wiechula@ikf.uni-frankfurt.de
27+
class SimpleEventDisplay : public CalibRawBase
28+
{
29+
public:
30+
SimpleEventDisplay();
31+
32+
virtual ~SimpleEventDisplay() = default;
33+
34+
virtual Int_t Update(const Int_t roc, const Int_t row, const Int_t pad,
35+
const Int_t timeBin, const Float_t signal) override;
36+
37+
CalPad* getCalPadMax() {return &mPadMax;}
38+
39+
void setPedstals(CalPad* pedestals) { mPedestals = pedestals; }
40+
// TH1D* MakePadSignals(Int_t roc, Int_t channel);
41+
TH1D* MakePadSignals(Int_t roc, Int_t row, Int_t pad);
42+
43+
// private:
44+
THnSparseS *mHnDataIROC; //!< Event Data IROCs
45+
THnSparseS *mHnDataOROC; //!< Event Data OROCs
46+
CalPad mPadMax; //!< Cal Pad with max Entry per channel
47+
TH2D *mHSigIROC; //!< iroc signals
48+
TH2D *mHSigOROC; //!< oroc signals
49+
CalPad* mPedestals; //!< Pedestal calibratino object
50+
51+
Int_t mCurrentChannel; //!< current channel processed
52+
Int_t mCurrentROC; //!< current ROC processed
53+
Int_t mLastSector; //!< Last sector processed
54+
Int_t mSelectedSector; //!< Sector selected for processing
55+
Int_t mLastSelSector; //!< Last sector selected for processing
56+
Int_t mCurrentRow; //!< current row processed
57+
Int_t mCurrentPad; //!< current pad processed
58+
Float_t mMaxPadSignal; //!< maximum bin of current pad
59+
Int_t mMaxTimeBin; //!< time bin with maximum value
60+
Bool_t mSectorLoop; //!< only process one sector
61+
Int_t mFirstTimeBin; //!< first time bin to accept
62+
Int_t mLastTimeBin; //!< last time bin to accept
63+
64+
const Mapper& mTPCmapper; //! mapper
65+
66+
virtual void ResetEvent() override;
67+
};
68+
69+
70+
} // namespace TPC
71+
72+
} // namespace o2
73+
#endif

0 commit comments

Comments
 (0)