Commit 9089a108 authored by Administrator's avatar Administrator
Browse files

Allow to place and rotate a detctor using CbmSetup

Add a member function to pass a TGeoHMatrix to the geometry module.
In case the matrix is present in the module the information is used to
place the geometry when creating the detector.
parent d81f2a18
......@@ -180,6 +180,23 @@ void CbmSetup::SetActive(ECbmModuleId moduleId, Bool_t active)
}
// -------------------------------------------------------------------------
// ----- Set the placement matrix of a detector -----------------------------
void CbmSetup::SetMatrix(ECbmModuleId moduleId, TGeoHMatrix matrix)
{
auto& moduleMap = fProvider->GetSetup().GetModuleMap();
// Check presence of module in current setup
if (moduleMap.find(moduleId) == moduleMap.end()) {
LOG(warn) << "Module " << moduleId << " does not exist in setup!";
return;
}
// Set activity flag
moduleMap.at(moduleId).SetMatrix(matrix);
}
// -------------------------------------------------------------------------
// ----- Set the field map ---------------------------------------------
void CbmSetup::SetField(const char* tag, Double_t scale, Double_t xPos, Double_t yPos, Double_t zPos)
......
......@@ -19,6 +19,7 @@
#include <Logger.h>
#include "TGeoMatrix.h"
#include "TNamed.h"
#include "TString.h"
#include "TVector3.h"
......@@ -140,6 +141,12 @@ public:
**/
void SetActive(ECbmModuleId moduleId, Bool_t active = kTRUE);
/** Set a placemnet matrix for a module (detector)
** @param moduleId Module identifier. SystemId for detectors, or kMagnet, kPipe, kTarget
** @param matrix TGeoHMatrix to place the detector at construction
**
**/
void SetMatrix(ECbmModuleId moduleId, TGeoHMatrix matrix);
/** Set the magnetic field map
** @param tag Field map tag
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment