-
Notifications
You must be signed in to change notification settings - Fork 490
Adding Preshower detector (PSR) for ALICE3 simulation #6727
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
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
de1718d
parent 1cd95bce05efa9d27c04b1937fe67cec1f4acb33
an15ms157 11c0bd0
8 layer uniform PSR
an15ms157 a3222be
additional code removed
an15ms157 b59d161
Update DataFormats/Detectors/Common/include/DetectorsCommonDataFormat…
an15ms157 338d630
Update Detectors/Upgrades/ALICE3/PSR/README.md
an15ms157 9298213
Update Detectors/Upgrades/ALICE3/PSR/README.md
an15ms157 1b9f93d
Update Detectors/Upgrades/ALICE3/FT3/simulation/src/Detector.cxx
an15ms157 53351a3
Update build_geometry.C
an15ms157 ee6885c
Update DetID.h
an15ms157 0397818
Update DetID.h
an15ms157 c271311
Update DetID.h
an15ms157 abb85d6
Update DetID.h
an15ms157 fa05144
Update DetID.h
an15ms157 dae91fa
latest copyright notice
an15ms157 afbfd23
latest copyright notice
an15ms157 6b4dacb
Latest copyright notice
an15ms157 e06e529
latest copyright notice
an15ms157 9695fe9
latest copyright notice
an15ms157 8e2f6bb
latest copyright notice
an15ms157 28063ef
latest copyright notice
an15ms157 fecceed
latest copyright notice
an15ms157 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,13 @@ | ||
| <!-- doxy | ||
mconcas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| \page refDetectorsUpgradesALICE3PSR Preshower | ||
| /doxy --> | ||
|
|
||
| # PostLS4Preshower | ||
|
|
||
| This is a simple 8 layered preshower detector named PSR. This is a cylindrical detector of length 100 cm whose shower layers are made up of Pb (0.5 cm) and the detector layers are made up of Si (45 microns). PSR is based on the ITSMFT classes and the code is structurally similar to that of FT3. Each layer is made of a monolithic silicon disk with a thin sensitive layer for hit generation. Silicon chip thickness is tuned to match the layer x/X0 to allow a minimal evaluation of material budget effects. | ||
|
|
||
| One should get a file o2sim_HitsPSR.root by running | ||
| $ o2-sim -m PSR -e TGeant3 -g boxgen -n 10 | ||
|
|
||
| <!-- 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(PSRBase | ||
| SOURCES src/GeometryTGeo.cxx | ||
| PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2::ITSMFTBase) | ||
|
|
||
| o2_target_root_dictionary(PSRBase | ||
| HEADERS include/PSRBase/GeometryTGeo.h) |
123 changes: 123 additions & 0 deletions
123
Detectors/Upgrades/ALICE3/PSR/base/include/PSRBase/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,123 @@ | ||
| // Copyright 2019-2020 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. | ||
| // | ||
| // This software is distributed under the terms of the GNU General Public | ||
| // License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // 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 | ||
| /// \author aabhishek.naath@gmail.com- adapted for Preshower 12/05/2021 | ||
|
|
||
| #ifndef ALICEO2_PSR_GEOMETRYTGEO_H_ | ||
| #define ALICEO2_PSR_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 psr | ||
| { | ||
| /// GeometryTGeo is a simple interface class to TGeoManager. It is used in the simulation | ||
| /// in order to query the TGeo Preshower 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 Preshower parameters from TGeo | ||
| void Build(int loadTrans = 0) override; | ||
|
|
||
| void Print(Option_t* opt = "") const; | ||
| static const char* getPSRVolPattern() { return sVolumeName.c_str(); } | ||
| static const char* getPSRLayerPattern() { return sLayerName.c_str(); } | ||
| static const char* getPSRChipPattern() { return sChipName.c_str(); } | ||
| static const char* getPSRSensorPattern() { return sSensorName.c_str(); } | ||
| static const char* getPSRShowerlayerPattern() { return sShowerlayerName.c_str(); } | ||
|
|
||
| static const char* composeSymNamePSR(Int_t d) { return Form("%s_%d", o2::detectors::DetID(o2::detectors::DetID::PSR).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); | ||
| static const char* composeSymNameShowerlayer(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 | ||
| static std::string sShowerlayerName; ///< Showerlayer name | ||
|
|
||
| private: | ||
| static std::unique_ptr<o2::psr::GeometryTGeo> sInstance; ///< singletone instance | ||
|
|
||
| ClassDefOverride(GeometryTGeo, 1); // Preshower geometry based on TGeo | ||
| }; | ||
| } // namespace psr | ||
| } // namespace o2 | ||
|
|
||
| #endif |
121 changes: 121 additions & 0 deletions
121
Detectors/Upgrades/ALICE3/PSR/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,121 @@ | ||
| // Copyright 2019-2020 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. | ||
| // | ||
| // This software is distributed under the terms of the GNU General Public | ||
| // License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // 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 | ||
| /// \author aabhishek.naath@gmail.com - adapted for ALICE3 preshower | ||
|
|
||
| // ATTENTION: In opposite to old AliITSgeomTGeo, all indices start from 0, not from 1!!! | ||
|
|
||
| #include "PSRBase/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::psr; | ||
| using namespace o2::detectors; | ||
|
|
||
| ClassImp(o2::psr::GeometryTGeo); | ||
|
|
||
| std::unique_ptr<o2::psr::GeometryTGeo> GeometryTGeo::sInstance; | ||
|
|
||
| std::string GeometryTGeo::sVolumeName = "PSRV"; ///< Mother volume name | ||
| std::string GeometryTGeo::sLayerName = "PSRLayer"; ///< Layer name | ||
| std::string GeometryTGeo::sChipName = "PSRChip"; ///< Chip name | ||
| std::string GeometryTGeo::sSensorName = "PSRSensor"; ///< Sensor name | ||
| std::string GeometryTGeo::sShowerlayerName = "PSRShowerlayer"; ///< Showerlayer name | ||
|
|
||
| //__________________________________________________________________________ | ||
| GeometryTGeo::GeometryTGeo(bool build, int loadTrans) : o2::itsmft::GeometryTGeo(DetID::PSR) | ||
| { | ||
| // 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::psr::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", composeSymNamePSR(d), getPSRLayerPattern(), lr); | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| const char* GeometryTGeo::composeSymNameShowerlayer(Int_t d, Int_t lr) | ||
| { | ||
| LOG(INFO) << "composenamelayer works_0"; | ||
| return Form("%s/%s%d", composeSymNameShowerlayer(d, lr), getPSRShowerlayerPattern(), lr); | ||
| LOG(INFO) << "composenamelayer works_1"; | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| const char* GeometryTGeo::composeSymNameChip(Int_t d, Int_t lr) | ||
| { | ||
| return Form("%s/%s%d", composeSymNameLayer(d, lr), getPSRChipPattern(), lr); | ||
| } | ||
|
|
||
| //__________________________________________________________________________ | ||
| const char* GeometryTGeo::composeSymNameSensor(Int_t d, Int_t lr) | ||
| { | ||
| return Form("%s/%s%d", composeSymNameChip(d, lr), getPSRSensorPattern(), 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.
Uh oh!
There was an error while loading. Please reload this page.