Skip to content
Snippets Groups Projects
Commit e262c966 authored by Alexandru Bercuci's avatar Alexandru Bercuci
Browse files

add radiator identification based on geo file

parent a4a08463
No related branches found
No related tags found
1 merge request!565Fix TRD-2D geometry and simulation for mCBM
......@@ -39,6 +39,7 @@ CbmTrdGeoHandler::CbmTrdGeoHandler()
, fLayerId(0)
, fModuleId(0)
, fModuleType(0)
, fRadiatorType(-1)
, fRotation(0)
, fStation(0)
, fLayer(0)
......@@ -159,6 +160,12 @@ Int_t CbmTrdGeoHandler::GetModuleType(const TString& path)
return fModuleType;
}
Int_t CbmTrdGeoHandler::GetRadiatorType(const TString& path)
{
if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
return fRadiatorType;
}
Int_t CbmTrdGeoHandler::GetStation(const TString& path)
{
if (fGeoPathHash != path.Hash()) { NavigateTo(path); }
......@@ -221,6 +228,13 @@ void CbmTrdGeoHandler::NavigateTo(const TString& path)
// In TGeoManager numbering starts with 1, so we have to subtract 1.
fModuleCopy = ((modulecopyNr / 1000000) % 100); // from module copy number
fRotation = ((modulecopyNr / 100000) % 10); // from module copy number
fRadiatorType = -1;
for (int i = 0; i < modulenode->GetNdaughters(); i++) {
TString nDaughter(modulenode->GetDaughter(i)->GetName());
if (!nDaughter.BeginsWith("radiator") && !nDaughter.BeginsWith("Radiator")) continue;
fRadiatorType = 0;
// TODO define radiator (+ entrance window) types according to the naming convention
}
}
else // 2013 and earlier
{
......
......@@ -82,6 +82,10 @@ public:
Double_t GetY(const TString& path);
Double_t GetZ(const TString& path);
Int_t GetModuleType(const TString& path);
/** \brief Navigate to node and return the radiator type build in the geometry based on the naming convention.
* @return radiator type ID or -1 if the radiator is not installed
*/
Int_t GetRadiatorType(const TString& path);
// for backward compatibility
Int_t GetStation(const TString& path);
......@@ -101,6 +105,7 @@ private:
Int_t fLayerId; //!
Int_t fModuleId; //!
Int_t fModuleType; //!
Int_t fRadiatorType; //! radiator + chamber entrance window type
Int_t fRotation; //! rotation angle 0,1,2,3
// for backward compatibility
......@@ -111,7 +116,7 @@ private:
CbmTrdGeoHandler(const CbmTrdGeoHandler&);
CbmTrdGeoHandler operator=(const CbmTrdGeoHandler&);
ClassDef(CbmTrdGeoHandler, 4)
ClassDef(CbmTrdGeoHandler, 5)
};
#endif //CBMTRDGEOHANDLER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment