Skip to content

Commit fe29ee8

Browse files
shahor02sawenzel
authored andcommitted
Move FIT data formats to DataFormats/Detectors, remove duplicate headers
1 parent 0b05e4c commit fe29ee8

File tree

28 files changed

+137
-141
lines changed

28 files changed

+137
-141
lines changed

DataFormats/Detectors/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ add_subdirectory (TPC)
55
add_subdirectory (ITSMFT)
66
add_subdirectory (MUON)
77
add_subdirectory (TOF)
8+
add_subdirectory (FIT)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
set(MODULE_NAME "DataFormatsFIT")
2+
set(MODULE_BUCKET_NAME data_format_fit_bucket)
3+
4+
O2_SETUP(NAME ${MODULE_NAME})
5+
6+
set(SRCS
7+
src/Digit.cxx
8+
src/RecPoints.cxx
9+
)
10+
11+
set(HEADERS
12+
include/${MODULE_NAME}/Digit.h
13+
include/${MODULE_NAME}/RecPoints.h
14+
include/${MODULE_NAME}/MCLabel.h
15+
include/${MODULE_NAME}/HitType.h
16+
)
17+
18+
Set(LINKDEF src/DataFormatsFITLinkDef.h)
19+
Set(LIBRARY_NAME ${MODULE_NAME})
20+
set(BUCKET_NAME ${MODULE_BUCKET_NAME})
21+
22+
O2_GENERATE_LIBRARY()
23+
24+

Detectors/FIT/common/base/include/FITBase/Digit.h renamed to DataFormats/Detectors/FIT/include/DataFormatsFIT/Digit.h

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#ifndef ALICEO2_FIT_DIGIT_H
1212
#define ALICEO2_FIT_DIGIT_H
1313

14+
#include "CommonDataFormat/InteractionRecord.h"
1415
#include "CommonDataFormat/TimeStamp.h"
1516
#include <iosfwd>
1617
#include "Rtypes.h"
@@ -36,13 +37,12 @@ class Digit : public DigitBase
3637
public:
3738
Digit() = default;
3839

39-
Digit(std::vector<ChannelData> ChDgDataArr, Double_t time, Int_t bc, Int_t orbit, Bool_t isA,
40+
Digit(std::vector<ChannelData> ChDgDataArr, Double_t time, uint16_t bc, uint32_t orbit, Bool_t isA,
4041
Bool_t isC, Bool_t isCnt, Bool_t isSCnt, Bool_t isVrtx)
4142
{
4243
setChDgData(std::move(ChDgDataArr));
4344
setTime(time);
44-
setBC(bc);
45-
setOrbit(orbit);
45+
setInteractionRecord(bc, orbit);
4646
setTriggers(isA, isC, isCnt, isSCnt, isVrtx);
4747
}
4848

@@ -51,10 +51,16 @@ class Digit : public DigitBase
5151
Double_t getTime() const { return mTime; }
5252
void setTime(Double_t time) { mTime = time; }
5353

54-
Int_t getBC() const { return mBC; }
55-
void setBC(Int_t bc) { mBC = bc; }
56-
Int_t getOrbit() const { return mOrbit; }
57-
void setOrbit(Int_t orbit) { mOrbit = orbit; }
54+
void setInteractionRecord(uint16_t bc, uint32_t orbit)
55+
{
56+
mIntRecord.bc = bc;
57+
mIntRecord.orbit = orbit;
58+
}
59+
const o2::InteractionRecord& getInteractionRecord() const { return mIntRecord; }
60+
o2::InteractionRecord& getInteractionRecord(o2::InteractionRecord& src) { return mIntRecord; }
61+
void setInteractionRecord(const o2::InteractionRecord& src) { mIntRecord = src; }
62+
uint32_t getOrbit() const { return mIntRecord.orbit; }
63+
uint16_t getBC() const { return mIntRecord.bc; }
5864

5965
Bool_t getisA() const { return mIsA; }
6066
Bool_t getisC() const { return mIsC; }
@@ -84,9 +90,8 @@ class Digit : public DigitBase
8490
}
8591

8692
private:
87-
Double_t mTime; // time stamp
88-
Int_t mBC; // Bunch Crossing
89-
Int_t mOrbit; // orbit
93+
Double_t mTime; // time stamp
94+
o2::InteractionRecord mIntRecord; // Interaction record (orbit, bc)
9095

9196
//online triggers processed on TCM
9297
Bool_t mIsA, mIsC;

Detectors/FIT/common/simulation/include/FITSimulation/HitType.h renamed to DataFormats/Detectors/FIT/include/DataFormatsFIT/HitType.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class HitType : public o2::BasicXYZEHit<float>
3232

3333
} // namespace o2
3434

35-
3635
#ifdef USESHM
3736
namespace std
3837
{

Detectors/FIT/common/base/include/FITBase/MCLabel.h renamed to DataFormats/Detectors/FIT/include/DataFormatsFIT/MCLabel.h

File renamed without changes.

Detectors/FIT/T0/reconstruction/include/T0Reconstruction/RecPoints.h renamed to DataFormats/Detectors/FIT/include/DataFormatsFIT/RecPoints.h

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,18 @@
1313
#ifndef ALICEO2_FIT_RECPOINTS_H
1414
#define ALICEO2_FIT_RECPOINTS_H
1515

16+
#include "CommonDataFormat/InteractionRecord.h"
1617
#include "CommonDataFormat/TimeStamp.h"
1718
#include <array>
1819
#include "Rtypes.h"
1920
#include <TObject.h>
20-
#include <FITBase/Digit.h>
21+
#include <DataFormatsFIT/Digit.h>
2122

2223
namespace o2
2324
{
2425
namespace t0
2526
{
26-
struct Channel {
27-
Int_t index;
28-
Float_t time, amp;
29-
ClassDefNV(Channel, 1);
30-
};
27+
3128
class RecPoints
3229
{
3330
public:
@@ -53,20 +50,27 @@ class RecPoints
5350
void setVertex(Float_t vertex) { mVertex = vertex; }
5451

5552
void SetMgrEventTime(Double_t time) { mEventTime = time; }
56-
void setBC(Int_t bc) { mBC = bc; }
57-
void setOrbit(Int_t orbit) { mOrbit = orbit; }
5853

5954
const std::vector<o2::fit::ChannelData>& getChDgData() const { return mTimeAmp; }
6055
void setChDgData(const std::vector<o2::fit::ChannelData>& TimeAmp) { mTimeAmp = TimeAmp; }
6156
void setChDgData(std::vector<o2::fit::ChannelData>&& TimeAmp) { mTimeAmp = std::move(TimeAmp); }
6257

58+
void setInteractionRecord(uint16_t bc, uint32_t orbit)
59+
{
60+
mIntRecord.bc = bc;
61+
mIntRecord.orbit = orbit;
62+
}
63+
const o2::InteractionRecord& getInteractionRecord() const { return mIntRecord; }
64+
o2::InteractionRecord& getInteractionRecord() { return mIntRecord; }
65+
uint32_t getOrbit() const { return mIntRecord.orbit; }
66+
uint16_t getBC() const { return mIntRecord.bc; }
67+
6368
private:
6469
std::array<Float_t, 3> mCollisionTime;
6570
Float_t mVertex = 0;
6671
Double_t mEventTime; //event time from Fair for continuous
6772
std::vector<o2::fit::ChannelData> mTimeAmp;
68-
Int_t mBC = 0; // BC from digits
69-
Int_t mOrbit = 0; // orbit from digits
73+
o2::InteractionRecord mIntRecord; // Interaction record (orbit, bc) from digits
7074

7175
ClassDefNV(RecPoints, 1);
7276
};

Detectors/FIT/common/base/src/FITBaseLinkDef.h renamed to DataFormats/Detectors/FIT/src/DataFormatsFITLinkDef.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,20 @@
1414
#pragma link off all classes;
1515
#pragma link off all functions;
1616

17+
//// #pragma link C++ class o2::t0::Channel + ; // RS: unused?
18+
1719
#pragma link C++ class o2::fit::Digit + ;
1820
#pragma link C++ class o2::fit::ChannelData + ;
19-
#pragma link C++ class vector < o2::fit::ChannelData > +;
20-
#pragma link C++ class vector < o2::fit::Digit > +;
21+
#pragma link C++ class vector < o2::fit::ChannelData> + ;
22+
#pragma link C++ class vector < o2::fit::Digit> + ;
23+
24+
#pragma link C++ class o2::t0::RecPoints + ;
25+
#pragma link C++ class vector < o2::t0::RecPoints> + ;
26+
27+
#pragma link C++ class o2::fit::MCLabel + ;
28+
#pragma link C++ class o2::dataformats::MCTruthContainer < o2::fit::MCLabel> + ;
29+
30+
#pragma link C++ class o2::fit::HitType + ;
31+
#pragma link C++ class vector < o2::fit::HitType> + ;
2132

2233
#endif
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
1010

11-
#include "FITBase/Digit.h"
11+
#include "DataFormatsFIT/Digit.h"
1212
#include <iostream>
1313

1414
using namespace o2::fit;
@@ -18,7 +18,7 @@ ClassImp(o2::fit::ChannelData);
1818

1919
void Digit::printStream(std::ostream& stream) const
2020
{
21-
stream << "FIT Digit: event time " << mTime << " BC " << mBC << " orbit " << mOrbit << std::endl;
21+
stream << "FIT Digit: event time " << mTime << " BC " << mIntRecord.bc << " orbit " << mIntRecord.orbit << std::endl;
2222
stream << "IS A " << mIsA << " IS C " << mIsC << " is Central " << mIsCentral
2323
<< " is SemiCentral " << mIsSemiCentral << " is Vertex " << mIsVertex << std::endl;
2424

Detectors/FIT/T0/reconstruction/src/RecPoints.cxx renamed to DataFormats/Detectors/FIT/src/RecPoints.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// granted to it by virtue of its status as an Intergovernmental Organization
99
// or submit itself to any jurisdiction.
1010

11-
#include "T0Reconstruction/RecPoints.h"
11+
#include "DataFormatsFIT/RecPoints.h"
1212
#include "T0Base/Geometry.h"
1313
#include <cassert>
1414
#include <iostream>
@@ -29,9 +29,8 @@ void RecPoints::FillFromDigits(const o2::fit::Digit& digit)
2929
constexpr Int_t nMCPs = nMCPsA + nMCPsC;
3030
Float_t sideAtime = 0, sideCtime = 0;
3131

32-
mBC = digit.getBC();
33-
mOrbit = digit.getOrbit();
34-
mEventTime = o2::InteractionRecord::bc2ns(mBC, mOrbit);
32+
mIntRecord = digit.getInteractionRecord();
33+
mEventTime = o2::InteractionRecord::bc2ns(mIntRecord.bc, mIntRecord.orbit);
3534

3635
Float_t BCEventTime = 12.5;
3736

Detectors/FIT/T0/base/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
set(MODULE_NAME "T0Base")
2+
set(BUCKET_NAME fit_base_bucket)
23

34
O2_SETUP(NAME ${MODULE_NAME})
45

@@ -12,7 +13,7 @@ set(HEADERS
1213

1314
Set(LINKDEF src/T0BaseLinkDef.h)
1415
Set(LIBRARY_NAME ${MODULE_NAME})
15-
set(BUCKET_NAME fit_base_bucket)
16+
1617

1718
O2_GENERATE_LIBRARY()
1819

0 commit comments

Comments
 (0)