diff --git a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h index ee7fa2506968b..a6726fb0c5bcc 100644 --- a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h +++ b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h @@ -59,7 +59,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache int extractNumberOfLayersMLOT(); int extractNumberOfLayersVD() const; int extractNumberOfPetalsVD() const; - int extractNumberOfActivePartsVD() const; + int extractNumberOfActivePartsVD() const; int extractNumberOfDisksVD() const; int extractNumberOfChipsPerPetalVD() const; int extractNumberOfStavesMLOT(int lay) const; @@ -85,20 +85,20 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache int getPetalCase(int index) const; int getDisk(int index) const; - void defineMLOTSensors(); + void defineMLOTSensors(); int getBarrelLayer(int) const; - //sensor ref X and alpha for ML & OT - void extractSensorXAlphaMLOT(int, float&, float&); + // sensor ref X and alpha for ML & OT + void extractSensorXAlphaMLOT(int, float&, float&); - //cache for tracking frames (ML & OT) - bool isTrackingFrameCachedMLOT() const {return !mCacheRefXMLOT.empty();} + // cache for tracking frames (ML & OT) + bool isTrackingFrameCachedMLOT() const { return !mCacheRefXMLOT.empty(); } void fillTrackingFramesCacheMLOT(); - float getSensorRefAlphaMLOT(int index) const {return mCacheRefAlphaMLOT[index];} - float getSensorXMLOT(int index) const {return mCacheRefXMLOT[index];} + float getSensorRefAlphaMLOT(int index) const { return mCacheRefAlphaMLOT[index]; } + float getSensorXMLOT(int index) const { return mCacheRefXMLOT[index]; } - //create matrix for tracking to local frame for MLOT + // create matrix for tracking to local frame for MLOT TGeoHMatrix& createT2LMatrixMLOT(int); /// This routine computes the chip index number from the subDetID, petal, disk, layer, stave /// TODO: retrieve also from chip when chips will be available @@ -190,9 +190,9 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache bool mOwner = true; //! is it owned by the singleton? - std::vector sensorsMLOT; - std::vector mCacheRefXMLOT; ///cache for X of ML and OT - std::vector mCacheRefAlphaMLOT; ///cache for sensor ref alpha ML and OT + std::vector sensorsMLOT; + std::vector mCacheRefXMLOT; /// cache for X of ML and OT + std::vector mCacheRefAlphaMLOT; /// cache for sensor ref alpha ML and OT private: static std::unique_ptr sInstance; diff --git a/Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx b/Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx index a11ebdcc7e1ca..a48b6af4c6b9a 100644 --- a/Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx @@ -95,7 +95,7 @@ void GeometryTGeo::Build(int loadTrans) int numberOfChipsTotal = 0; /// filling the information for the VD - for (int i = 0; i < mNumberOfPetalsVD; i++) { + for (int i = 0; i < mNumberOfPetalsVD; i++) { mNumberOfChipsPerPetalVD[i] = extractNumberOfChipsPerPetalVD(); numberOfChipsTotal += mNumberOfChipsPerPetalVD[i]; mLastChipIndex[i] = numberOfChipsTotal - 1; @@ -348,7 +348,7 @@ TGeoHMatrix* GeometryTGeo::extractMatrixSensor(int index) const //__________________________________________________________________________ void GeometryTGeo::defineMLOTSensors() { - for(int i=0; i 1) { - LOG(error) << "getBarrelLayer(): Invalid subDetID for barrel: " << subDetID + LOG(error) << "getBarrelLayer(): Invalid subDetID for barrel: " << subDetID << ". Expected values are 0 or 1."; - return -1; + return -1; } if (subLayerID < 0 || subLayerID > 7) { - LOG(error) << "getBarrelLayer(): Invalid subLayerID for barrel: " << subDetID + LOG(error) << "getBarrelLayer(): Invalid subLayerID for barrel: " << subDetID << ". Expected values are between 0 and 7."; - return -1; + return -1; } const int baseOffsets[] = {0, 3}; - return baseOffsets[subDetID] + subLayerID; - + return baseOffsets[subDetID] + subLayerID; } //__________________________________________________________________________ -void GeometryTGeo::extractSensorXAlphaMLOT(int chipID, float& x, float& alp) +void GeometryTGeo::extractSensorXAlphaMLOT(int chipID, float& x, float& alp) { - //works for ML and OT only, a.k.a flat sensors !!! + // works for ML and OT only, a.k.a flat sensors !!! double locA[3] = {-100., 0., 0.}, locB[3] = {100., 0., 0.}, gloA[3], gloB[3]; double xp{0}, yp{0}; - if(getSubDetID(chipID) == 0){ - + if (getSubDetID(chipID) == 0) { + LOG(error) << "extractSensorXAlphaMLOT(): VD layers are not supported yet! chipID = " << chipID; return; - } else { //flat sensors, ML and OT + } else { // flat sensors, ML and OT const TGeoHMatrix* matL2G = extractMatrixSensor(chipID); matL2G->LocalToMaster(locA, gloA); matL2G->LocalToMaster(locB, gloB); @@ -1006,20 +1005,20 @@ void GeometryTGeo::extractSensorXAlphaMLOT(int chipID, float& x, float& alp) } alp = std::atan2(yp, xp); - x = std::hypot(xp, yp); + x = std::hypot(xp, yp); o2::math_utils::bringTo02Pi(alp); - ///TODO: - //once the VD segmentation is done, VD should be added + /// TODO: + // once the VD segmentation is done, VD should be added } //__________________________________________________________________________ TGeoHMatrix& GeometryTGeo::createT2LMatrixMLOT(int chipID) { - //works only for ML & OT - //for VD is yet to be implemented once we have more refined geometry - if(getSubDetID(chipID) == 0){ - + // works only for ML & OT + // for VD is yet to be implemented once we have more refined geometry + if (getSubDetID(chipID) == 0) { + LOG(error) << "createT2LMatrixMLOT(): VD layers are not supported yet! chipID = " << chipID << "returning dummy values! "; static TGeoHMatrix dummy; @@ -1029,13 +1028,13 @@ TGeoHMatrix& GeometryTGeo::createT2LMatrixMLOT(int chipID) static TGeoHMatrix t2l; t2l.Clear(); float alpha = getSensorRefAlphaMLOT(chipID); - t2l.RotateZ(alpha * TMath::RadToDeg()); + t2l.RotateZ(alpha * TMath::RadToDeg()); const TGeoHMatrix* matL2G = extractMatrixSensor(chipID); const TGeoHMatrix& matL2Gi = matL2G->Inverse(); t2l.MultiplyLeft(&matL2Gi); return t2l; } } - + } // namespace trk } // namespace o2