Skip to content

Commit 2e5709a

Browse files
committed
move Hit to common
1 parent 4b6daad commit 2e5709a

13 files changed

Lines changed: 183 additions & 72 deletions

File tree

Detectors/FIT/T0/base/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ set(HEADERS
1010
include/${MODULE_NAME}/Geometry.h
1111
)
1212

13-
1413
Set(LINKDEF src/T0BaseLinkDef.h)
1514
Set(LIBRARY_NAME ${MODULE_NAME})
1615
set(BUCKET_NAME fit_base_bucket)

Detectors/FIT/T0/simulation/include/T0Simulation/Detector.h

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,15 @@
1717
#include "SimulationDataFormat/BaseHits.h"
1818
#include "DetectorsBase/Detector.h" // for Detector
1919
#include "T0Base/Geometry.h"
20-
#include "CommonUtils/ShmAllocator.h"
20+
//#include "CommonUtils/ShmAllocator.h"
21+
#include "FITSimulation/HitType.h"
2122

2223
class FairModule;
2324

2425
class FairVolume;
2526
class TGeoVolume;
2627
class TGraph;
2728

28-
namespace o2
29-
{
30-
namespace t0
31-
{
32-
class HitType : public o2::BasicXYZEHit<float>
33-
{
34-
public:
35-
using BasicXYZEHit<float>::BasicXYZEHit;
36-
};
37-
} // namespace t0
38-
} // namespace o2
39-
40-
#ifdef USESHM
41-
namespace std
42-
{
43-
template <>
44-
class allocator<o2::t0::HitType> : public o2::utils::ShmAllocator<o2::t0::HitType>
45-
{
46-
};
47-
} // namespace std
48-
#endif
4929

5030
namespace o2
5131
{
@@ -91,11 +71,11 @@ class Detector : public o2::Base::DetImpl<Detector>
9171

9272
/// This method is called for each step during simulation (see FairMCApplication::Stepping())
9373
Bool_t ProcessHits(FairVolume* v) override;
94-
HitType* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId);
74+
o2::fit::HitType* AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId);
9575

9676
void Register() override;
9777

98-
std::vector<HitType>* getHits(Int_t iColl)
78+
std::vector<o2::fit::HitType>* getHits(Int_t iColl)
9979
{
10080
if (iColl == 0) {
10181
return mHits;
@@ -151,7 +131,7 @@ class Detector : public o2::Base::DetImpl<Detector>
151131
std::vector<Double_t> mReflMet;
152132

153133
/// Container for data points
154-
std::vector<HitType>* mHits = nullptr;
134+
std::vector<o2::fit::HitType>* mHits = nullptr;
155135

156136
/// Define the sensitive volumes of the geometry
157137
void defineSensitiveVolumes();

Detectors/FIT/T0/simulation/include/T0Simulation/DigitizerTask.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class DigitizerTask : public FairTask
6060
const std::vector<o2::t0::HitType>* mHitsArray = nullptr; ///< Array of MC hits
6161

6262
TBranch* mQEDBranch = nullptr; //! optional special branch of hits from QED collitions
63-
const std::vector<o2::t0::HitType>* mHitsArrayQED = nullptr; //! array of MC hits from ED
63+
const std::vector<o2::fit::HitType>* mHitsArrayQED = nullptr; //! array of MC hits from ED
6464
float mQEDEntryTimeBinNS = 0.f; ///< every entry in the QED branch integrates QED for so many nanosec.
6565
double mLastQEDTimeNS = 0.; ///< center of the time-bin of last added QED bg slot (entry of mQEDBranch)
6666
int mLastQEDEntry = -1; ///< last used QED entry

Detectors/FIT/T0/simulation/src/Detector.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using o2::t0::Geometry;
3434
ClassImp(Detector);
3535

3636
Detector::Detector(Bool_t Active)
37-
: o2::Base::DetImpl<Detector>("T0", Active), mIdSens1(0), mPMTeff(nullptr), mHits(o2::utils::createSimVector<HitType>())
37+
: o2::Base::DetImpl<Detector> ("T0", Active), mIdSens1(0), mPMTeff(nullptr), mHits(o2::utils::createSimVector<o2::fit::HitType>())
3838

3939
{
4040
// Gegeo = GetGeometry() ;
@@ -43,7 +43,7 @@ Detector::Detector(Bool_t Active)
4343
}
4444

4545
Detector::Detector(const Detector& rhs)
46-
: o2::Base::DetImpl<Detector>(rhs), mIdSens1(rhs.mIdSens1), mPMTeff(rhs.mPMTeff), mHits(o2::utils::createSimVector<HitType>())
46+
: o2::Base::DetImpl<Detector> (rhs), mIdSens1(rhs.mIdSens1), mPMTeff(rhs.mPMTeff), mHits(o2::utils::createSimVector<o2::fit::HitType>())
4747
{
4848
}
4949

@@ -309,7 +309,7 @@ Bool_t Detector::ProcessHits(FairVolume* v)
309309
return kFALSE;
310310
}
311311

312-
HitType* Detector::AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId)
312+
o2::fit::HitType* Detector::AddHit(float x, float y, float z, float time, float energy, Int_t trackId, Int_t detId)
313313
{
314314
mHits->emplace_back(x, y, z, time, energy, trackId, detId);
315315
auto stack = (o2::Data::Stack*)fMC->GetStack();

Detectors/FIT/T0/simulation/src/T0SimulationLinkDef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
#pragma link C++ class o2::t0::Detector + ;
1818
//#pragma link C++ class o2::t0::DigitizerTask + ;
19-
#pragma link C++ class o2::t0::HitType + ;
20-
#pragma link C++ class vector < o2::t0::HitType > +;
19+
//#pragma link C++ class o2::t0::HitType + ;
20+
//#pragma link C++ class vector < o2::t0::HitType > +;
2121

2222
#pragma link C++ class o2::Base::DetImpl < o2::t0::Detector > +;
2323

Detectors/FIT/common/simulation/include/FITSimulation/Digitizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Digitizer
2929
~Digitizer() = default;
3030

3131
//void process(const std::vector<HitType>* hits, std::vector<Digit>* digits);
32-
void process(const std::vector<o2::t0::HitType>* hits, Digit* digit);
32+
void process(const std::vector<o2::fit::HitType>* hits, Digit* digit);
3333

3434
void initParameters();
3535
// void printParameters();
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef ALICEO2_FIT_HITTYPE_H_
2+
#define ALICEO2_FIT_HITTYPE_H_
3+
4+
#include "SimulationDataFormat/BaseHits.h"
5+
#include "SimulationDataFormat/Stack.h"
6+
#include "CommonUtils/ShmAllocator.h"
7+
8+
namespace o2
9+
{
10+
namespace fit
11+
{
12+
class HitType : public o2::BasicXYZEHit<float>
13+
{
14+
public:
15+
using BasicXYZEHit<float>::BasicXYZEHit;
16+
};
17+
} // namespace t0
18+
} // namespace o2
19+
20+
#endif
21+
22+
#ifdef USESHM
23+
namespace std
24+
{
25+
template <>
26+
class allocator<o2::fit::HitType> : public o2::utils::ShmAllocator<o2::fit::HitType>
27+
{
28+
};
29+
} // namespace std
30+
#endif

Detectors/FIT/common/simulation/src/Digitizer.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using namespace o2::fit;
2424

2525
ClassImp(Digitizer);
2626

27-
void Digitizer::process(const std::vector<o2::t0::HitType>* hits, Digit* digit)
27+
void Digitizer::process(const std::vector<o2::fit::HitType>* hits, Digit* digit)
2828
{
2929
//parameters constants TO DO: move to class
3030

@@ -204,7 +204,9 @@ void Digitizer::initParameters()
204204
// murmur
205205
}
206206
//_______________________________________________________________________
207-
void Digitizer::init() {}
207+
void Digitizer::init() {
208+
std::cout<<" @@@ Digitizer::init "<<std::endl;
209+
}
208210

209211
//_______________________________________________________________________
210212
void Digitizer::finish() {}

Detectors/FIT/common/simulation/src/FITSimulationLinkDef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#pragma link C++ class o2::fit::Digitizer + ;
1818
#pragma link C++ class o2::fit::DigitizationParameters + ;
19+
#pragma link C++ class o2::fit::HitType + ;
20+
#pragma link C++ class vector < o2::fit::HitType > +;
1921
//#pragma link C++ class o2::fit::MCLabel + ;
2022
#pragma link C++ class o2::dataformats::MCTruthContainer < o2::fit::MCLabel > +;
2123
#pragma link C++ class o2::Base::DetImpl < o2::fit::Detector > +;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
// Declaration of a transient MC label class for FIT
12+
13+
#ifndef ALICEO2_FIT_MCLABEL_H_
14+
#define ALICEO2_FIT_MCLABEL_H_
15+
16+
#include "SimulationDataFormat/MCCompLabel.h"
17+
18+
namespace o2
19+
{
20+
namespace fit
21+
{
22+
class MCLabel : public o2::MCCompLabel
23+
{
24+
private:
25+
Int_t mDetID = -1;
26+
27+
public:
28+
MCLabel() = default;
29+
MCLabel(Int_t trackID, Int_t eventID, Int_t srcID, Int_t qID)
30+
: o2::MCCompLabel(trackID, eventID, srcID), mDetID(qID) {}
31+
32+
Int_t getDetID() const { return mDetID; }
33+
34+
ClassDefNV(MCLabel, 1);
35+
};
36+
} // namespace fit
37+
} // namespace o2
38+
39+
#endif

0 commit comments

Comments
 (0)