Skip to content

Commit 2d1bd3b

Browse files
committed
introduced FD hit data format
1 parent 0b61e9a commit 2d1bd3b

File tree

11 files changed

+264
-67
lines changed

11 files changed

+264
-67
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Copyright 2019 - 2020 CERN and copyright holders of ALICE O2.
2+
#See https: // alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
#All rights not expressly granted are reserved.
4+
#
5+
#This software is distributed under the terms of the GNU General Public
6+
#License v3(GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
#In applying this license CERN does not waive the privileges and immunities
9+
#granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
add_subdirectory(FD)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
# All rights not expressly granted are reserved.
4+
#
5+
# This software is distributed under the terms of the GNU General Public
6+
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
# In applying this license CERN does not waive the privileges and immunities
9+
# granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
o2_add_library(DataFormatsFD
13+
SOURCES src/Hit.cxx
14+
PUBLIC_LINK_LIBRARIES O2::FDBase
15+
O2::SimulationDataFormat
16+
O2::CommonDataFormat
17+
Microsoft.GSL::GSL
18+
O2::DetectorsCommonDataFormats
19+
)
20+
21+
o2_target_root_dictionary(DataFormatsFD
22+
HEADERS include/DataFormatsFD/Hit.h
23+
)
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file Hit.h
13+
/// \brief Definition of the FD Hit class (based on ITSMFT and FV0)
14+
15+
#ifndef ALICEO2_FVD_HIT_H_
16+
#define ALICEO2_FVD_HIT_H_
17+
18+
#include <iosfwd>
19+
#include "SimulationDataFormat/BaseHits.h" // for BasicXYZEHit
20+
#include "Rtypes.h" // for Bool_t, Double_t, int, Double32_t, etc
21+
#include "TVector3.h" // for TVector3
22+
#include "CommonUtils/ShmAllocator.h"
23+
24+
namespace o2
25+
{
26+
namespace fd
27+
{
28+
29+
class Hit : public o2::BasicXYZEHit<float, float>
30+
{
31+
public:
32+
/// Default constructor
33+
Hit() = default;
34+
35+
/// Class Constructor
36+
/// \param trackID Index of MCTrack
37+
/// \param cellID Cell ID
38+
/// \param startPos Coordinates at entrance to active volume [cm]
39+
/// \param endPos Coordinates to active volume [cm]
40+
/// \param startMom Momentum of track at entrance [GeV]
41+
/// \param startE Energy of track at entrance [GeV]
42+
/// \param endTime Final time [ns]
43+
/// \param eLoss Energy deposit [GeV]
44+
/// \param particlePdg PDG code of the partcile associated with the track
45+
inline Hit(int trackID,
46+
int cellID,
47+
const math_utils::Point3D<float>& startPos,
48+
const math_utils::Point3D<float>& endPos,
49+
const math_utils::Vector3D<float>& startMom,
50+
double startE,
51+
double endTime,
52+
double eLoss,
53+
int particlePdg);
54+
55+
// Entrance position getters
56+
math_utils::Point3D<float> const& GetPosStart() const { return mPositionStart; }
57+
float GetStartX() const { return mPositionStart.X(); }
58+
float GetStartY() const { return mPositionStart.Y(); }
59+
float GetStartZ() const { return mPositionStart.Z(); }
60+
template <typename F>
61+
void GetStartPosition(F& x, F& y, F& z) const
62+
{
63+
x = GetStartX();
64+
y = GetStartY();
65+
z = GetStartZ();
66+
}
67+
68+
// Momentum getters
69+
math_utils::Vector3D<float> const& GetMomentum() const { return mMomentumStart; }
70+
math_utils::Vector3D<float>& GetMomentum() { return mMomentumStart; }
71+
float GetPx() const { return mMomentumStart.X(); }
72+
float GetPy() const { return mMomentumStart.Y(); }
73+
float GetPz() const { return mMomentumStart.Z(); }
74+
float GetE() const { return mEnergyStart; }
75+
float GetTotalEnergyAtEntrance() const { return GetE(); }
76+
int GetParticlePdg() const { return mParticlePdg; }
77+
78+
void Print(const Option_t* opt) const;
79+
80+
private:
81+
math_utils::Vector3D<float> mMomentumStart; ///< momentum at entrance
82+
math_utils::Point3D<float> mPositionStart; ///< position at entrance (base mPos give position on exit)
83+
float mEnergyStart; ///< total energy at entrance
84+
int mParticlePdg; ///< PDG code of the particle associated with this track
85+
86+
ClassDefNV(Hit, 1);
87+
};
88+
89+
Hit::Hit(int trackID,
90+
int detID,
91+
const math_utils::Point3D<float>& startPos,
92+
const math_utils::Point3D<float>& endPos,
93+
const math_utils::Vector3D<float>& startMom,
94+
double startE,
95+
double endTime,
96+
double eLoss,
97+
int particlePdg)
98+
: BasicXYZEHit(endPos.X(),
99+
endPos.Y(),
100+
endPos.Z(),
101+
endTime,
102+
eLoss,
103+
trackID,
104+
detID),
105+
mMomentumStart(startMom.X(), startMom.Y(), startMom.Z()),
106+
mPositionStart(startPos.X(), startPos.Y(), startPos.Z()),
107+
mEnergyStart(startE),
108+
mParticlePdg(particlePdg)
109+
{
110+
}
111+
112+
} // namespace fd
113+
} // namespace o2
114+
115+
#ifdef USESHM
116+
namespace std
117+
{
118+
template <>
119+
class allocator<o2::fd::Hit> : public o2::utils::ShmAllocator<o2::fd::Hit>
120+
{
121+
};
122+
123+
} // namespace std
124+
#endif /* USESHM */
125+
#endif /* ALICEO2_FD_HIT_H_ */
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifdef __CLING__
13+
14+
#pragma link off all globals;
15+
#pragma link off all classes;
16+
#pragma link off all functions;
17+
18+
#pragma link C++ class o2::fd::Hit + ;
19+
#pragma link C++ class vector < o2::fd::Hit> + ;
20+
21+
#endif
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file Hit.cxx
13+
/// \brief Implementation of the Hit class
14+
15+
#include "DataFormatsFD/Hit.h"
16+
#include <iostream>
17+
18+
ClassImp(o2::fd::Hit);
19+
20+
namespace o2
21+
{
22+
namespace fd
23+
{
24+
25+
void Hit::Print(const Option_t* opt) const
26+
{
27+
printf(
28+
"Det: %5d Track: %6d E.loss: %.3e P: %+.3e %+.3e %+.3e\n"
29+
"PosIn: %+.3e %+.3e %+.3e PosOut: %+.3e %+.3e %+.3e\n",
30+
GetDetectorID(), GetTrackID(), GetEnergyLoss(), GetPx(), GetPy(), GetPz(),
31+
GetStartX(), GetStartY(), GetStartZ(), GetX(), GetY(), GetZ());
32+
}
33+
34+
} // namespace fd
35+
} // namespace o2

DataFormats/Detectors/Upgrades/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
# or submit itself to any jurisdiction.
1111

1212
message(STATUS "Building dataformats for upgrades")
13+
add_subdirectory(ALICE3)
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2-
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3-
# All rights not expressly granted are reserved.
1+
#Copyright 2019 - 2020 CERN and copyright holders of ALICE O2.
2+
#See https: // alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
#All rights not expressly granted are reserved.
44
#
5-
# This software is distributed under the terms of the GNU General Public
6-
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
5+
#This software is distributed under the terms of the GNU General Public
6+
#License v3(GPL Version 3), copied verbatim in the file "COPYING".
77
#
8-
# In applying this license CERN does not waive the privileges and immunities
9-
# granted to it by virtue of its status as an Intergovernmental Organization
8+
#In applying this license CERN does not waive the privileges and immunities
9+
#granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

1212
add_subdirectory(base)
13-
add_subdirectory(simulation)
13+
add_subdirectory(simulation)

Detectors/Upgrades/ALICE3/FD/base/include/FDBase/FDBaseParam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ struct FDBaseParam : public o2::conf::ConfigurableParamHelper<FDBaseParam> {
2828

2929
bool withMG = false; // modified geometry with 3 rings on A side
3030

31-
bool plateBehindA = true;
31+
bool plateBehindA = false;
3232
bool fullContainer = false;
3333
float dzplate = 1.0f; // Aluminium plate width
3434

Detectors/Upgrades/ALICE3/FD/simulation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
o2_add_library(FDSimulation
1313
SOURCES src/Detector.cxx
1414
PUBLIC_LINK_LIBRARIES O2::FDBase
15-
O2::ITSMFTSimulation
15+
O2::DataFormatsFD
1616
ROOT::Physics)
1717

1818
o2_target_root_dictionary(FDSimulation

Detectors/Upgrades/ALICE3/FD/simulation/include/FDSimulation/Detector.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
#include "DetectorsBase/Detector.h"
2020
#include "FDBase/GeometryTGeo.h"
2121
#include "FDBase/FDBaseParam.h"
22-
#include "ITSMFTSimulation/Hit.h"
22+
#include "DataFormatsFD/Hit.h"
2323
#include "Rtypes.h"
2424
#include "TGeoManager.h"
2525
#include "TLorentzVector.h"
2626
#include "TVector3.h"
27+
#include <cmath>
2728

2829
class FairVolume;
2930
class TGeoVolume;
@@ -53,16 +54,15 @@ class Detector : public o2::base::DetImpl<Detector>
5354
void ConstructGeometry() override;
5455

5556
/// This method is an example of how to add your own point of type Hit to the clones array
56-
o2::itsmft::Hit* addHit(int trackID, int detID,
57-
const TVector3& startPos,
58-
const TVector3& endPos,
59-
const TVector3& startMom,
60-
double startE,
61-
double endTime, double eLoss,
62-
unsigned int startStatus,
63-
unsigned int endStatus);
64-
65-
std::vector<o2::itsmft::Hit>* getHits(Int_t iColl)
57+
o2::fd::Hit* addHit(int trackId, unsigned int detId,
58+
const math_utils::Point3D<float>& startPos,
59+
const math_utils::Point3D<float>& endPos,
60+
const math_utils::Vector3D<float>& startMom, double startE,
61+
double endTime, double eLoss, int particlePdg);
62+
// unsigned int startStatus,
63+
// unsigned int endStatus);
64+
65+
std::vector<o2::fd::Hit>* getHits(Int_t iColl)
6666
{
6767
if (iColl == 0) {
6868
return mHits;
@@ -93,7 +93,7 @@ class Detector : public o2::base::DetImpl<Detector>
9393
Detector(const Detector&);
9494
Detector& operator=(const Detector&);
9595

96-
std::vector<o2::itsmft::Hit>* mHits = nullptr;
96+
std::vector<o2::fd::Hit>* mHits = nullptr;
9797
GeometryTGeo* mGeometryTGeo = nullptr;
9898

9999
TGeoVolumeAssembly* buildModuleA();

0 commit comments

Comments
 (0)