-
Notifications
You must be signed in to change notification settings - Fork 502
Adding FT3 detector for ALICE3 EndCaps simulation #5526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b2e1015
Adding ALICE EC0 Detector (EndCaps)
rpezzi 668d607
Make clang-format happy
rpezzi 4564081
Make codecheck happy
rpezzi 16763d2
Naming ALICE 3 Forward Tracker (end caps): FT3
rpezzi b0bb0e3
Adding symmetric tracker at forward and backward directions
rpezzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Copyright CERN and copyright holders of ALICE O2. This software is distributed | ||
| # under the terms of the GNU General Public License v3 (GPL Version 3), copied | ||
| # verbatim in the file "COPYING". | ||
| # | ||
| # See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| # | ||
| # In applying this license CERN does not waive the privileges and immunities | ||
| # granted to it by virtue of its status as an Intergovernmental Organization or | ||
| # submit itself to any jurisdiction. | ||
|
|
||
| add_subdirectory(simulation) | ||
| add_subdirectory(base) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <!-- doxy | ||
| \page refDetectorsPostLS4 EndCaps | ||
| /doxy --> | ||
|
|
||
| # PostLS4EndCaps | ||
|
|
||
| This is a top page for the PostLS4EndCaps detector documentation. | ||
|
|
||
| <!-- doxy | ||
| /doxy --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Copyright CERN and copyright holders of ALICE O2. This software is distributed | ||
| # under the terms of the GNU General Public License v3 (GPL Version 3), copied | ||
| # verbatim in the file "COPYING". | ||
| # | ||
| # See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| # | ||
| # In applying this license CERN does not waive the privileges and immunities | ||
| # granted to it by virtue of its status as an Intergovernmental Organization or | ||
| # submit itself to any jurisdiction. | ||
|
|
||
| o2_add_library(FT3Base | ||
| SOURCES src/GeometryTGeo.cxx | ||
| PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::ITSMFTBase) | ||
|
|
||
| o2_target_root_dictionary(FT3Base | ||
| HEADERS include/FT3Base/GeometryTGeo.h) |
119 changes: 119 additions & 0 deletions
119
Detectors/Upgrades/ALICE3/FT3/base/include/FT3Base/GeometryTGeo.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| /// \file GeometryTGeo.h | ||
| /// \brief Definition of the GeometryTGeo class | ||
| /// \author cvetan.cheshkov@cern.ch - 15/02/2007 | ||
| /// \author ruben.shahoyan@cern.ch - adapted to ITSupg 18/07/2012 | ||
| /// \author rafael.pezzi@cern.ch - adapted to PostLS4EndCaps 25/06/2020 | ||
|
|
||
| #ifndef ALICEO2_FT3_GEOMETRYTGEO_H_ | ||
| #define ALICEO2_FT3_GEOMETRYTGEO_H_ | ||
|
|
||
| #include <TGeoMatrix.h> // for TGeoHMatrix | ||
| #include <TObject.h> // for TObject | ||
| #include <array> | ||
| #include <string> | ||
| #include <vector> | ||
| #include "DetectorsBase/GeometryManager.h" | ||
| #include "DetectorsCommonDataFormats/DetID.h" | ||
| #include "ITSMFTBase/GeometryTGeo.h" | ||
| #include "MathUtils/Utils.h" | ||
| #include "Rtypes.h" // for Int_t, Double_t, Bool_t, UInt_t, etc | ||
|
|
||
| class TGeoPNEntry; | ||
|
|
||
| namespace o2 | ||
| { | ||
| namespace ft3 | ||
| { | ||
| /// GeometryTGeo is a simple interface class to TGeoManager. It is used in the simulation | ||
| /// in order to query the TGeo FT3 geometry. | ||
| /// RS: In order to preserve the static character of the class but make it dynamically access | ||
| /// geometry, we need to check in every method if the structures are initialized. To be converted | ||
| /// to singleton at later stage. | ||
|
|
||
| class GeometryTGeo : public o2::itsmft::GeometryTGeo | ||
| { | ||
| public: | ||
| typedef o2::math_utils::Transform3D Mat3D; | ||
| using DetMatrixCache::getMatrixL2G; | ||
| using DetMatrixCache::getMatrixT2GRot; | ||
| using DetMatrixCache::getMatrixT2L; | ||
| // this method is not advised for ITS: for barrel detectors whose tracking frame is just a rotation | ||
| // it is cheaper to use T2GRot | ||
| using DetMatrixCache::getMatrixT2G; | ||
|
|
||
| static GeometryTGeo* Instance() | ||
| { | ||
| // get (create if needed) a unique instance of the object | ||
| if (!sInstance) { | ||
| sInstance = std::unique_ptr<GeometryTGeo>(new GeometryTGeo(true, 0)); | ||
| } | ||
| return sInstance.get(); | ||
| } | ||
|
|
||
| // adopt the unique instance from external raw pointer (to be used only to read saved instance from file) | ||
| static void adopt(GeometryTGeo* raw); | ||
|
|
||
| // constructor | ||
| // ATTENTION: this class is supposed to behave as a singleton, but to make it root-persistent | ||
| // we must define public default constructor. | ||
| // NEVER use it, it will throw exception if the class instance was already created | ||
| // Use GeometryTGeo::Instance() instead | ||
| GeometryTGeo(bool build = kFALSE, int loadTrans = 0 | ||
| /*o2::base::utils::bit2Mask(o2::TransformType::T2L, // default transformations to load | ||
| o2::TransformType::T2G, | ||
| o2::TransformType::L2G)*/ | ||
| ); | ||
|
|
||
| /// Default destructor | ||
| ~GeometryTGeo() override = default; | ||
|
|
||
| GeometryTGeo(const GeometryTGeo& src) = delete; | ||
| GeometryTGeo& operator=(const GeometryTGeo& geom) = delete; | ||
|
|
||
| // implement filling of the matrix cache | ||
| using o2::itsmft::GeometryTGeo::fillMatrixCache; | ||
| void fillMatrixCache(int mask) override; | ||
|
|
||
| /// Exract FT3 parameters from TGeo | ||
| void Build(int loadTrans = 0) override; | ||
|
|
||
| void Print(Option_t* opt = "") const; | ||
| static const char* getFT3VolPattern() { return sVolumeName.c_str(); } | ||
| static const char* getFT3LayerPattern() { return sLayerName.c_str(); } | ||
| static const char* getFT3ChipPattern() { return sChipName.c_str(); } | ||
| static const char* getFT3SensorPattern() { return sSensorName.c_str(); } | ||
|
|
||
| static const char* composeSymNameFT3(Int_t d) { return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::FT3).getName(), d); } | ||
| static const char* composeSymNameLayer(Int_t d, Int_t lr); | ||
| static const char* composeSymNameChip(Int_t d, Int_t lr); | ||
| static const char* composeSymNameSensor(Int_t d, Int_t lr); | ||
|
|
||
| protected: | ||
| static constexpr int MAXLAYERS = 15; ///< max number of active layers | ||
|
|
||
| Int_t mNumberOfLayers; ///< number of layers | ||
| static std::string sVolumeName; ///< Mother volume name | ||
| static std::string sLayerName; ///< Layer name | ||
| static std::string sChipName; ///< Chip name | ||
|
|
||
| static std::string sSensorName; ///< Sensor name | ||
|
|
||
| private: | ||
| static std::unique_ptr<o2::ft3::GeometryTGeo> sInstance; ///< singletone instance | ||
|
|
||
| ClassDefOverride(GeometryTGeo, 1); // FT3 geometry based on TGeo | ||
| }; | ||
| } // namespace ft3 | ||
| } // namespace o2 | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| #ifdef __CLING__ | ||
|
|
||
| #pragma link off all globals; | ||
| #pragma link off all classes; | ||
| #pragma link off all functions; | ||
|
|
||
| #pragma link C++ class o2::ft3::GeometryTGeo; | ||
|
|
||
| #endif |
110 changes: 110 additions & 0 deletions
110
Detectors/Upgrades/ALICE3/FT3/base/src/GeometryTGeo.cxx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| /// \file GeometryTGeo.cxx | ||
| /// \brief Implementation of the GeometryTGeo class | ||
| /// \author cvetan.cheshkov@cern.ch - 15/02/2007 | ||
| /// \author ruben.shahoyan@cern.ch - adapted to ITSupg 18/07/2012 | ||
| /// \author rafael.pezzi@cern.ch - adapted to ALICE 3 EndCaps 14/02/2021 | ||
|
|
||
| // ATTENTION: In opposite to old AliITSgeomTGeo, all indices start from 0, not from 1!!! | ||
|
|
||
| #include "FT3Base/GeometryTGeo.h" | ||
| #include "DetectorsBase/GeometryManager.h" | ||
| #include "MathUtils/Cartesian.h" | ||
|
|
||
| #include "FairLogger.h" // for LOG | ||
|
|
||
| #include <TGeoBBox.h> // for TGeoBBox | ||
| #include <TGeoManager.h> // for gGeoManager, TGeoManager | ||
| #include <TGeoPhysicalNode.h> // for TGeoPNEntry, TGeoPhysicalNode | ||
| #include <TGeoShape.h> // for TGeoShape | ||
| #include <TMath.h> // for Nint, ATan2, RadToDeg | ||
| #include <TString.h> // for TString, Form | ||
| #include "TClass.h" // for TClass | ||
| #include "TGeoMatrix.h" // for TGeoHMatrix | ||
| #include "TGeoNode.h" // for TGeoNode, TGeoNodeMatrix | ||
| #include "TGeoVolume.h" // for TGeoVolume | ||
| #include "TMathBase.h" // for Max | ||
| #include "TObjArray.h" // for TObjArray | ||
| #include "TObject.h" // for TObject | ||
|
|
||
| #include <cctype> // for isdigit | ||
| #include <cstdio> // for snprintf, NULL, printf | ||
| #include <cstring> // for strstr, strlen | ||
|
|
||
| using namespace TMath; | ||
| using namespace o2::ft3; | ||
| using namespace o2::detectors; | ||
|
|
||
| ClassImp(o2::ft3::GeometryTGeo); | ||
|
|
||
| std::unique_ptr<o2::ft3::GeometryTGeo> GeometryTGeo::sInstance; | ||
|
|
||
| std::string GeometryTGeo::sVolumeName = "FT3V"; ///< Mother volume name | ||
| std::string GeometryTGeo::sLayerName = "FT3Layer"; ///< Layer name | ||
| std::string GeometryTGeo::sChipName = "FT3Chip"; ///< Sensor name | ||
| std::string GeometryTGeo::sSensorName = "FT3Sensor"; ///< Sensor name | ||
|
|
||
| //__________________________________________________________________________ | ||
| GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : o2::itsmft::GeometryTGeo(DetID::FT3) | ||
| { | ||
| // default c-tor, if build is true, the structures will be filled and the transform matrices | ||
| // will be cached | ||
| if (sInstance) { | ||
| LOG(FATAL) << "Invalid use of public constructor: o2::ft3::GeometryTGeo instance exists"; | ||
| // throw std::runtime_error("Invalid use of public constructor: o2::ft3::GeometryTGeo instance exists"); | ||
| } | ||
|
|
||
| if (build) { | ||
| Build(loadTrans); | ||
| } | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| void GeometryTGeo::Build(int loadTrans) | ||
| { | ||
| if (isBuilt()) { | ||
| LOG(WARNING) << "Already built"; | ||
| return; // already initialized | ||
| } | ||
|
|
||
| if (!gGeoManager) { | ||
| // RSTODO: in future there will be a method to load matrices from the CDB | ||
| LOG(FATAL) << "Geometry is not loaded"; | ||
| } | ||
|
|
||
| fillMatrixCache(loadTrans); | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| const char* GeometryTGeo::composeSymNameLayer(Int_t d, Int_t lr) | ||
| { | ||
| return Form("%s/%s%d", composeSymNameFT3(d), getFT3LayerPattern(), lr); | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| const char* GeometryTGeo::composeSymNameChip(Int_t d, Int_t lr) | ||
| { | ||
| return Form("%s/%s%d", composeSymNameLayer(d, lr), getFT3ChipPattern(), lr); | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| const char* GeometryTGeo::composeSymNameSensor(Int_t d, Int_t lr) | ||
| { | ||
| return Form("%s/%s%d", composeSymNameChip(d, lr), getFT3SensorPattern(), lr); | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| void GeometryTGeo::fillMatrixCache(int mask) | ||
| { | ||
| // populate matrix cache for requested transformations | ||
| // | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at some moment it will make sense to talk about a better isolation of Run3 and upgrade detectors.
Something like predefined list in separate DetIDs ..