Skip to content

Commit

Permalink
Please consider the following formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alibuild committed Sep 9, 2024
1 parent 605bf80 commit 8b80788
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,16 @@ class Hit : public o2::BasicXYZEHit<Float_t, Float_t>

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

int GetParticlePdg() const {return mParticlePdg;}
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;
math_utils::Point3D<float> mPositionStart;
ClassDefNV(Hit, 1);

};

Hit::Hit(int trackID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ namespace fvd
struct FVDBaseParam : public o2::conf::ConfigurableParamHelper<FVDBaseParam> {
static constexpr int nCellA = 40; // 24
static constexpr int nCellC = 48;
static constexpr int nRingsA = 5; //3
static constexpr int nRingsA = 5; // 3
static constexpr int nRingsC = 6;
static constexpr float dzScint = 4.;
static constexpr float rRingsA[int(nCellA/8)+1] = {3., 14.8, 26.6, 38.4, 50.2, 62.};
static constexpr float rRingsC[int(nCellC/8)+1] = {3.5, 17., 30.5, 44., 57.5, 71.};

static constexpr float dzScint = 4.;
static constexpr float rRingsA[int(nCellA / 8) + 1] = {3., 14.8, 26.6, 38.4, 50.2, 62.};
static constexpr float rRingsC[int(nCellC / 8) + 1] = {3.5, 17., 30.5, 44., 57.5, 71.};

static constexpr float zModA = 1700;
static constexpr float zModC = -1950;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
int getCurrentCellId(const TVirtualMC* fMC) const;

private:

static std::unique_ptr<o2::fvd::GeometryTGeo> sInstance;

ClassDefNV(GeometryTGeo, 1);
Expand Down
10 changes: 5 additions & 5 deletions Detectors/Upgrades/ALICE3/FVD/base/src/GeometryTGeo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <fairlogger/Logger.h>

using namespace o2::fvd;
namespace o2
namespace o2
{
namespace fvd
{
Expand Down Expand Up @@ -46,7 +46,7 @@ GeometryTGeo* GeometryTGeo::Instance()

void GeometryTGeo::Build(int loadTrans)
{
if (isBuilt()) {
if (isBuilt()) {
LOGP(warning, "Already built");
return; // already initialized
}
Expand All @@ -64,7 +64,7 @@ void GeometryTGeo::fillMatrixCache(int mask)

int GeometryTGeo::getCellId(int nmod, int nring, int nsec) const
{
return nmod * FVDBaseParam::nCellA + 8 * nring + nsec;
return nmod * FVDBaseParam::nCellA + 8 * nring + nsec;
}

int GeometryTGeo::getCurrentCellId(const TVirtualMC* fMC) const
Expand All @@ -76,10 +76,10 @@ int GeometryTGeo::getCurrentCellId(const TVirtualMC* fMC) const
fMC->CurrentVolOffID(2, moduleId);
fMC->CurrentVolOffID(1, sectorId);
fMC->CurrentVolOffID(0, ringId);
int cellId = getCellId(moduleId, ringId, sectorId);
int cellId = getCellId(moduleId, ringId, sectorId);

return cellId;
}

} // namespace fvd
} //namespace o2
} // namespace o2
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Detector : public o2::base::DetImpl<Detector>
Detector& operator=(const Detector&);

std::vector<o2::fvd::Hit>* mHits = nullptr;
GeometryTGeo* mGeometryTGeo = nullptr;
GeometryTGeo* mGeometryTGeo = nullptr;

TGeoVolumeAssembly* buildModuleA();
TGeoVolumeAssembly* buildModuleC();
Expand All @@ -83,7 +83,7 @@ class Detector : public o2::base::DetImpl<Detector>
/// Transient data about track passing the sensor, needed by ProcessHits()
struct TrackData { // this is transient
bool mHitStarted; //! hit creation started
TLorentzVector mPositionStart; //! position at entrance
TLorentzVector mPositionStart; //! position at entrance
TLorentzVector mMomentumStart; //! momentum
double mEnergyLoss; //! energy loss
} mTrackData; //!
Expand Down
89 changes: 44 additions & 45 deletions Detectors/Upgrades/ALICE3/FVD/simulation/src/Detector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Bool_t Detector::ProcessHits(FairVolume* vol)
return kFALSE; // do nothing more
}

return kTRUE;
return kTRUE;
}

o2::fvd::Hit* Detector::addHit(Int_t trackId, Int_t cellId,
Expand All @@ -148,16 +148,16 @@ o2::fvd::Hit* Detector::addHit(Int_t trackId, Int_t cellId,
return &(mHits->back());
}

void Detector::ConstructGeometry()
void Detector::ConstructGeometry()
{
createMaterials();
buildModules();
defineSensitiveVolumes();
createMaterials();
buildModules();
defineSensitiveVolumes();
}


void Detector::EndOfEvent() {
Reset();
void Detector::EndOfEvent()
{
Reset();
}

void Detector::Register()
Expand Down Expand Up @@ -194,16 +194,16 @@ void Detector::createMaterials()

Int_t matId = 0; // tmp material id number
const Int_t unsens = 0, sens = 1; // sensitive or unsensitive medium
//
Int_t fieldType = 3; // Field type
Float_t maxField = 5.0; // Field max.
//
Int_t fieldType = 3; // Field type
Float_t maxField = 5.0; // Field max.

Float_t tmaxfd = -10.0; // max deflection angle due to magnetic field in one step
Float_t stemax = 0.1; // max step allowed [cm]
Float_t deemax = 1.0; // maximum fractional energy loss in one step 0<deemax<=1
Float_t epsil = 0.03; // tracking precision [cm]
Float_t stmin = -0.001; // minimum step due to continuous processes [cm] (negative value: choose it automatically)

LOG(info) << "FVD: CreateMaterials(): fieldType " << fieldType << ", maxField " << maxField;

o2::base::Detector::Mixture(++matId, "Scintillator", aScint, zScint, dScint, nScint, wScint);
Expand All @@ -217,12 +217,12 @@ void Detector::buildModules()

TGeoVolume* vCave = gGeoManager->GetVolume("cave");
if (!vCave) {
LOG(fatal) << "Could not find the top volume!";
LOG(fatal) << "Could not find the top volume!";
}

// create modules
TGeoVolumeAssembly *vFVDA = buildModuleA();
TGeoVolumeAssembly *vFVDC = buildModuleC();
TGeoVolumeAssembly* vFVDA = buildModuleA();
TGeoVolumeAssembly* vFVDC = buildModuleC();

vCave->AddNode(vFVDA, 0, new TGeoTranslation(0., 0., FVDBaseParam::zModA));
vCave->AddNode(vFVDC, 1, new TGeoTranslation(0., 0., FVDBaseParam::zModC));
Expand All @@ -232,24 +232,24 @@ TGeoVolumeAssembly* Detector::buildModuleA()
{
TGeoVolumeAssembly* mod = new TGeoVolumeAssembly("FVDA");

const TGeoMedium* medium = gGeoManager->GetMedium("FVD_Scintillator");
const TGeoMedium* medium = gGeoManager->GetMedium("FVD_Scintillator");

const float dphiDeg = 45.;

for (int ir = 0; ir < FVDBaseParam::nRingsA; ir++) {
for (int ic = 0; ic < 8; ic ++) {
int cellId = ic + 8*ir;
std::string tbsName = "tbs" + std::to_string(cellId);
std::string nodeName = "fvd_node" + std::to_string(cellId);
float rmin = FVDBaseParam::rRingsA[ir];
float rmax = FVDBaseParam::rRingsA[ir+1];
float phimin = dphiDeg * ic;
float phimax = dphiDeg * (ic + 1);
float dz = FVDBaseParam::dzScint;
auto tbs = new TGeoTubeSeg(tbsName.c_str(), rmin, rmax, dz, phimin, phimax);
auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium);
mod->AddNode(nod, cellId);
}
for (int ic = 0; ic < 8; ic++) {
int cellId = ic + 8 * ir;
std::string tbsName = "tbs" + std::to_string(cellId);
std::string nodeName = "fvd_node" + std::to_string(cellId);
float rmin = FVDBaseParam::rRingsA[ir];
float rmax = FVDBaseParam::rRingsA[ir + 1];
float phimin = dphiDeg * ic;
float phimax = dphiDeg * (ic + 1);
float dz = FVDBaseParam::dzScint;
auto tbs = new TGeoTubeSeg(tbsName.c_str(), rmin, rmax, dz, phimin, phimax);
auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium);
mod->AddNode(nod, cellId);
}
}

return mod;
Expand All @@ -259,31 +259,30 @@ TGeoVolumeAssembly* Detector::buildModuleC()
{
TGeoVolumeAssembly* mod = new TGeoVolumeAssembly("FVDC");

const TGeoMedium* medium = gGeoManager->GetMedium("FVD_Scintillator");
const TGeoMedium* medium = gGeoManager->GetMedium("FVD_Scintillator");

const float dphiDeg = 45.;

for (int ir = 0; ir < FVDBaseParam::nRingsC; ir++) {
for (int ic = 0; ic < 8; ic ++) {
int cellId = ic + 8*ir + FVDBaseParam::nCellA;
std::string tbsName = "tbs" + std::to_string(cellId);
std::string nodeName = "fvd_node" + std::to_string(cellId);
float rmin = FVDBaseParam::rRingsC[ir];
float rmax = FVDBaseParam::rRingsC[ir+1];
float phimin = dphiDeg * ic;
float phimax = dphiDeg * (ic + 1);
float dz = FVDBaseParam::dzScint;
auto tbs = new TGeoTubeSeg(tbsName.c_str(), rmin, rmax, dz, phimin, phimax);
auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium);
mod->AddNode(nod, cellId);
}
for (int ic = 0; ic < 8; ic++) {
int cellId = ic + 8 * ir + FVDBaseParam::nCellA;
std::string tbsName = "tbs" + std::to_string(cellId);
std::string nodeName = "fvd_node" + std::to_string(cellId);
float rmin = FVDBaseParam::rRingsC[ir];
float rmax = FVDBaseParam::rRingsC[ir + 1];
float phimin = dphiDeg * ic;
float phimax = dphiDeg * (ic + 1);
float dz = FVDBaseParam::dzScint;
auto tbs = new TGeoTubeSeg(tbsName.c_str(), rmin, rmax, dz, phimin, phimax);
auto nod = new TGeoVolume(nodeName.c_str(), tbs, medium);
mod->AddNode(nod, cellId);
}
}

return mod;
}

void Detector::defineSensitiveVolumes()
{
LOG(info) << "Adding FVD Sentitive Volumes";

LOG(info) << "Adding FVD Sentitive Volumes";
}

0 comments on commit 8b80788

Please sign in to comment.