Skip to content
Snippets Groups Projects
Commit a9eafa37 authored by Volker Friese's avatar Volker Friese
Browse files

Correct rotation angle for StsStation. Provide radiation length of silicon...

Correct rotation angle for StsStation. Provide radiation length of silicon from StsStation. Refs #133 @2h.

git-svn-id: https://subversion.gsi.de/cbmsoft/cbmroot/trunk@7584 5a1b234a-d7ce-0410-9a93-fd649a8fa65c
parent 924a2144
No related branches found
No related tags found
No related merge requests found
......@@ -258,7 +258,7 @@ Bool_t CbmStsSetup::Init(TGeoManager* geo) {
LOG(INFO) << GetName() << ": Set types for " << nSensors
<< " sensors" << FairLogger::endl;
// --- Init the stations (get station-wide parameters like z, xmax etc.)
// --- Initialise stations parameters
for (Int_t iStat = 0; iStat < GetNofDaughters(); iStat++) {
CbmStsStation* station =
dynamic_cast<CbmStsStation*>(GetDaughter(iStat));
......
......@@ -3,6 +3,7 @@
** @date 04.03.2015
**/
#include <cassert>
#include <sstream>
#include "TGeoBBox.h"
#include "TGeoMatrix.h"
......@@ -15,7 +16,7 @@
CbmStsStation::CbmStsStation()
: CbmStsElement(),
fZ(0.),
fXmin(0.), fXmax(0.), fYmin(0.), fYmax(0.), fSensorD(0.),
fXmin(0.), fXmax(0.), fYmin(0.), fYmax(0.), fSensorD(0.), fSensorRot(0.),
fNofSensors(0),
fDiffSensorD(kFALSE),
fFirstSensor(NULL)
......@@ -30,7 +31,7 @@ CbmStsStation::CbmStsStation(const char* name, const char* title,
TGeoPhysicalNode* node)
: CbmStsElement(name, title, kStsStation, node),
fZ(0.),
fXmin(0.), fXmax(0.), fYmin(0.), fYmax(0.), fSensorD(0.),
fXmin(0.), fXmax(0.), fYmin(0.), fYmax(0.), fSensorD(0.), fSensorRot(0.),
fNofSensors(0),
fDiffSensorD(kFALSE),
fFirstSensor(NULL)
......@@ -131,20 +132,6 @@ Double_t CbmStsStation::GetSensorPitch(Int_t iSide) const {
// ----- Rotation -----------------------------------------------------
// N.B.: Implementation is only correct if the first sensor is only rotated
// in the x-y plane.
Double_t CbmStsStation::GetSensorRotation() const {
TGeoPhysicalNode* sensorNode = fFirstSensor->GetNode();
Double_t local[3] = {1., 0., 0.}; // unit vector on local x axis
Double_t global[3]; // unit vector in global C.S.
sensorNode->GetMatrix()->LocalToMaster(local, global);
return atan2(global[1], global[0]); // angle from global to local x-axis
}
// -------------------------------------------------------------------------
// ----- Stereo angle -------------------------------------------------
Double_t CbmStsStation::GetSensorStereoAngle(Int_t iSide) const {
if ( iSide < 0 || iSide > 1 ) {
......@@ -188,6 +175,23 @@ void CbmStsStation::Init() {
if ( fDiffSensorD )
LOG(WARNING) << GetName() << ": Different values for sensor thickness!"
<< FairLogger::endl;
// Determine the rotation (in x-y) of the first sensor
assert(fFirstSensor);
TGeoPhysicalNode* sensorNode = fFirstSensor->GetNode();
assert(sensorNode);
// Transform unit vector on local x axis into global c.s.
Double_t unitLocal[3] = {1., 0., 0.};
Double_t unitGlobal[3];
sensorNode->GetMatrix()->LocalToMaster(unitLocal, unitGlobal);
// Subtract translation vector of local origin
Double_t* translation = sensorNode->GetMatrix()->GetTranslation();
unitGlobal[0] -= translation[0];
unitGlobal[1] -= translation[1];
unitGlobal[2] -= translation[2];
// Calculate angle between unit x vector in global and local c.s.
fSensorRot = atan2(unitGlobal[1], unitGlobal[0]);
}
// --------------------------------------------------------------------------
......@@ -200,7 +204,8 @@ string CbmStsStation::ToString() const
ss << GetName() << ": " << fNofSensors << " sensors, z = " << fZ
<< " cm, x = " << fXmin << " to " << fXmax << " cm, y = " << fYmin
<< " to " << fYmax << " cm " << "\n\t\t"
<< " sensor thickness " << fSensorD << " cm"
<< " rotation " << fSensorRot * 180. / 3.1415927 << " degrees,"
<< " sensor thickness " << fSensorD << " cm,"
<< " pitch " << GetSensorPitch(0) << " cm / " << GetSensorPitch(1)
<< " cm, stereo angle " << GetSensorStereoAngle(0) << " / "
<< GetSensorStereoAngle(1);
......
......@@ -40,11 +40,14 @@ class CbmStsStation : public CbmStsElement {
virtual ~CbmStsStation();
/** Minimal and maximal x and y coordinates **/
Double_t GetXmin() const { return fXmin; }
Double_t GetXmax() const { return fXmax; }
Double_t GetYmin() const { return fYmin; }
Double_t GetYmax() const { return fYmax; }
/** Radiation length of the main material of the station (silicon)
** @value Radiation length of silicon [cm]
**
** Required from L1/KF. The value for silicon is hard-coded here,
** since it is not likely that the material will change.
**/
Double_t GetRadLength() const { return 9.34953; }
/** Sensor thickness
......@@ -72,6 +75,18 @@ class CbmStsStation : public CbmStsElement {
Double_t GetSensorPitch(Int_t iSide) const;
/** Sensor rotation
** @value Rotation of first sensor in station in global C.S. [rad]
**
** This return the rotation angle in the x-y plane of the first sensor
** in the station w.r.t. the global C.S.
** Needed by L1/KF.
** Note that in general, the rotation angle will be different for each
** sensor. In particular, half of them are upside down.
**/
Double_t GetSensorRotation() const { return fSensorRot; }
/** Get sensor stereo angle
** @param iSide Sensor side (0 = front, 1 = back)
** @value Stereo angle [degrees]
......@@ -85,18 +100,11 @@ class CbmStsStation : public CbmStsElement {
Double_t GetSensorStereoAngle(Int_t iSide) const;
/** Sensor rotation
** @value Rotation of first sensor in station in global C.S. [rad]
**
** This return the rotation angle in the x-y plane of the first sensor
** in the station w.r.t. the global C.S.
** Needed by L1/KF.
** Note that in general, the rotation angle will be different for each
** sensor. In particular, half of the are upside down.
**/
Double_t GetSensorRotation() const;
/** Minimal and maximal x and y coordinates **/
Double_t GetXmin() const { return fXmin; }
Double_t GetXmax() const { return fXmax; }
Double_t GetYmin() const { return fYmin; }
Double_t GetYmax() const { return fYmax; }
/** Station z position in global c.s.
......@@ -119,14 +127,15 @@ class CbmStsStation : public CbmStsElement {
private:
Double_t fZ; ///< z position of station [cm]
Double_t fXmin; ///< minimal x coordinate [cm]
Double_t fXmax; ///< maximal x coordinate [cm]
Double_t fYmin; ///< minimal y coordinate [cm]
Double_t fYmax; ///< maximal y coordinate [cm]
Double_t fSensorD; ///< thickness of sensors [cm]
Int_t fNofSensors; ///< Number of sensors in station
Bool_t fDiffSensorD; ///< Flag for different sensor thicknesses
Double_t fZ; ///< z position of station [cm]
Double_t fXmin; ///< minimal x coordinate [cm]
Double_t fXmax; ///< maximal x coordinate [cm]
Double_t fYmin; ///< minimal y coordinate [cm]
Double_t fYmax; ///< maximal y coordinate [cm]
Double_t fSensorD; ///< thickness of sensors [cm]
Double_t fSensorRot; ///< Rotation of first sensor in global c.s. [rad]
Int_t fNofSensors; ///< Number of sensors in station
Bool_t fDiffSensorD; ///< Flag for different sensor thicknesses
CbmStsSensor* fFirstSensor; ///< Pointer to first sensor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment