Skip to content

Commit

Permalink
first iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
pkurash committed Aug 30, 2024
1 parent 880b207 commit bf2629b
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 243 deletions.
71 changes: 59 additions & 12 deletions DataFormats/Detectors/Upgrades/FVD/include/DataFormatsFVD/Hit.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// Copyright 2019-2024 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -9,9 +9,6 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file Hit.h
/// \Definition of the FVD Hit class we need number of photons on the top of base hit

#ifndef ALICEO2_FVD_HIT_H_
#define ALICEO2_FVD_HIT_H_

Expand All @@ -28,21 +25,71 @@ class Hit : public o2::BasicXYZEHit<Float_t, Float_t>
{

public:
//Default constructor
Hit() = default;
inline Hit(int trackID, unsigned short detID, const TVector3& Pos, double Time, double eLoss, int nPhot);

Int_t GetNphot() const { return mNphot; }
inline Hit(int trackID,
int cellID,
const math_utils::Point3D<float>& startPos,
const math_utils::Point3D<float>& endPos,
const math_utils::Vector3D<float>& startMom,
double startE,
double endTime,
double eLoss,
int particlePdg);

private:
Int_t mNphot; // Number of photons created by current hit
// Entrance position getters
math_utils::Point3D<Float_t> const& GetPosStart() const { return mPositionStart; }
Float_t GetStartX() const { return mPositionStart.X(); }
Float_t GetStartY() const { return mPositionStart.Y(); }
Float_t GetStartZ() const { return mPositionStart.Z(); }
template <typename F>
void GetStartPosition(F& x, F& y, F& z) const
{
x = GetStartX();
y = GetStartY();
z = GetStartZ();
}

// Momentum getters
math_utils::Vector3D<Float_t> const& GetMomentum() const { return mMomentumStart; }

math_utils::Vector3D<Float_t>& GetMomentum() { return mMomentumStart; }
Float_t GetPx() const { return mMomentumStart.X(); }
Float_t GetPy() const { return mMomentumStart.Y(); }
Float_t GetPz() const { return mMomentumStart.Z(); }
Float_t GetE() const { return mEnergyStart; }

Float_t GetTotalEnergyAtEntrance() const { return GetE(); }

int GetParticlePdg() const {return mParticlePdg;}

void Print(const Option_t* opt) const;

private:
int mParticlePdg;
float mEnergyStart;
math_utils::Vector3D<float> mMomentumStart; ///< momentum at entrance
math_utils::Point3D<float> mPositionStart;
ClassDefNV(Hit, 1);

};

Hit::Hit(int trackID, unsigned short detID, const TVector3& Pos, double Time, double eLoss, int nPhot)
: BasicXYZEHit(Pos.X(), Pos.Y(), Pos.Z(), Time, eLoss, trackID, detID),
mNphot(nPhot)
Hit::Hit(int trackID,
int detID,
const math_utils::Point3D<float>& startPos,
const math_utils::Point3D<float>& endPos,
const math_utils::Vector3D<float>& startMom,
double startE,
double endTime,
double eLoss,
Int_t particlePdg)
: BasicXYZEHit(endPos.X(),
endPos.Y(),
endPos.Z(),
endTime,
eLoss,
trackID,
detID)
{
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// Copyright 2019-2024 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down
Empty file.
3 changes: 2 additions & 1 deletion Detectors/Upgrades/ALICE3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
add_subdirectory(Passive)
add_subdirectory(TRK)
add_subdirectory(ECal)
add_subdirectory(FVD)
add_subdirectory(FT3)
add_subdirectory(FCT)
add_subdirectory(AOD)
add_subdirectory(IOTOF)
add_subdirectory(RICH)
add_subdirectory(MID)
add_subdirectory(macros)
add_subdirectory(macros)
4 changes: 1 addition & 3 deletions Detectors/Upgrades/ALICE3/FVD/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

o2_add_library(FVDBase
SOURCES src/GeometryTGeo.cxx
src/FVDBaseParam.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase)

o2_target_root_dictionary(FVDBase
HEADERS include/FVDBase/GeometryTGeo.h
include/FVDBase/FVDBaseParam.h
include/FVDBase/Constants.h)
include/FVDBase/FVDBaseParam.h)

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file Constants.h
/// \brief General constants in FV0
/// \file FVDBaseParam.g
/// \brief General constants in FVD
///
/// \author Maciej Slupecki, University of Jyvaskyla, Finland

#ifndef ALICEO2_FVD_CONSTANTS_
#define ALICEO2_FVD_CONSTANTS_
#ifndef ALICEO2_FVD_FVDBASEPARAM_
#define ALICEO2_FVD_FVDBASEPARAM_

#include "FVDBase/GeometryTGeo.h"

Expand All @@ -24,7 +24,7 @@ namespace o2
namespace fvd
{

struct Constants {
struct FVDBaseParam {
static constexpr int nFvdChannels = GeometryTGeo::getNumberOfReadoutChannels();
static constexpr int nFvdChannelsPlusRef = nFvdChannels + 1;
};
Expand Down
74 changes: 12 additions & 62 deletions Detectors/Upgrades/ALICE3/FVD/base/include/FVDBase/GeometryTGeo.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,106 +23,56 @@
#include <TGeoVolume.h>
#include <TVirtualMC.h>

class TGeoPNEntry;

namespace o2
{
namespace fvd
{



/// FVD Geometry type
class GeometryTGeo : public o2::detectors::DetMatrixCache
{
public:
enum EGeoType {
eUninitialized,
eOnlySensit
eFull,
};
GeometryTGeo();

/// Geometry components possible to be enabled/disabled. Only enabled components will be created.
enum EGeoComponent {
eScintillator,
};
void Build() const;
void fillMatrixCache(int mask);
virtual ~GeometryTGeo();

GeometryTGeo() : mGeometryType(eUninitialized){};

GeometryTGeo(const Geometry& geometry);
static Geometry* instance(EGeoType initType = eUninitialized);
~GeometryTGeo();

int getCurrentCellId(const TVirtualMC* fMC) const;
const std::vector<std::string>& getSensitiveVolumeNames() const { return mSensitiveVolumeNames; };

bool enableComponent(EGeoComponent component, bool enable = true);

/// Build the geometry.
void buildGeometry() const;
static GeometryTGeo* Instance();

void getGlobalPosition(float& x, float& y, float& z);
Point3Dsimple& getCellCenter(UInt_t cellId);
Point3Dsimple& getReadoutCenter(UInt_t cellId);
static constexpr int getNumberOfReadoutChannelsA() { return sNumberOfReadoutChannelsA; };
static constexpr int getNumberOfReadoutChannelsC() { return sNumberOfReadoutChannelsC; };
static constexpr int getNumberOfReadoutChannels() { return sNumberOfReadoutChannelsA + sNumberOfCellsC; }

static constexpr o2::detectors::DetID::ID getDetID() { return o2::detectors::DetID::FVD; }
TGeoPNEntry* getPNEntry(int index) const
{
/// Get a pointer to the TGeoPNEntry of a chip identified by 'index'
/// Returns NULL in case of invalid index, missing TGeoManager or invalid symbolic name
return o2::base::GeometryManager::getPNEntry(getDetID(), index);
}

private:
explicit Geometry(EGeoType initType);
int getCellId(int nmod, int nring, int nsec) const;
int getCurrentCellId(const TVirtualMC* fMC) const;

inline static const std::string sDetectorName = "FVD";
private:

static constexpr float sDzScintillator = 4;

static constexpr float sXGlobal = 0;
static constexpr float sYGlobal = 0;
static constexpr float sZGlobalA = 1700. - sDzScintillator/2;
static constexpr float sZGlobalC = -1950. - sDzScintillator/2;
static constexpr float sZGlobalC = -1950. + sDzScintillator/2;

static constexpr int sNumberOfCellSectors = 8;
static constexpr int sNumberOfCellRingsA = 5; // 3
static constexpr int sNumberOfCellRingsC = 6;
static constexpr int sNumberOfCellsA = sNumberOfCellRingsA * sNumberOfCellSectors;
static constexpr int sNumberOfCellsC = sNumberOfCellRingsC * sNumberOfCellSectors;

static constexpr int sNumberOfReadoutChannelsA = sNumberOfCellsA;
static constexpr int sNumberOfReadoutChannelsC = sNumberOfCellsC;


static constexpr float sCellRingRadiiA[sNumberOfCellRingsA + 1] = {3., 14.8, 26.6, 38.4, 50.2, 62.};
static constexpr float sCellRingRadiiC[sNumberOfCellRingsC + 1] = {3.5, 17., 30.5, 44., 57.5, 71.};
static constexpr float sDrSeparationScint = 0.07;

// Strings for volume names, etc.
inline static const std::string sScintillatorName = "SCINT";
inline static const std::string sSectorName = "SECTOR";
inline static const std::string sCellName = "CELL";
inline static const std::string sScintillatorSectorName = sScintillatorName + sSectorName;
inline static const std::string sScintillatorCellName = sScintillatorName + sCellName;

/// Initialize the geometry.
void initializeGeometry();
void initializeMaps();
void initializeVectors();
void initializeTransformations();
void initializeSectorTransformations();

TGeoVolumeAssembly *buildModuleA() const;
TGeoVolumeAssembly *buildModuleC() const;

const int mGeometryType;
std::map<EGeoComponent, bool> mEnabledComponents;
static std::unique_ptr<o2::fvd::GeometryTGeo> sInstance;

static GeometryTGeo* sInstance;
TGeoVolumeAssembly* buildModuleA() const;
TGeoVolumeAssembly* buildModuleC() const;

ClassDefNV(GeometryTGeo, 1);
};
Expand Down
Loading

0 comments on commit bf2629b

Please sign in to comment.