CbmRoot
CbmStsSensor.cxx
Go to the documentation of this file.
1 
5 #include "CbmStsSensor.h"
6 
7 #include <ostream> // for operator<<, stringstream, basic_ostream
8 
9 
10 // ----- Constructor ---------------------------------------------------
12  TGeoPhysicalNode* node,
13  CbmStsElement* mother)
14  : CbmStsElement(address, kStsSensor, node, mother) {}
15 // -------------------------------------------------------------------------
16 
17 // ----- Get the unique address from the sensor name (static) ----------
18 UInt_t CbmStsSensor::GetAddressFromName(TString name) {
19 
20  Int_t unit = 10 * (name[5] - '0') + name[6] - '0' - 1;
21  Int_t ladder = 10 * (name[9] - '0') + name[10] - '0' - 1;
22  Int_t hLadder = (name[11] == 'U' ? 0 : 1);
23  Int_t module = 10 * (name[14] - '0') + name[15] - '0' - 1;
24  Int_t sensor = 10 * (name[18] - '0') + name[19] - '0' - 1;
25 
26  return CbmStsAddress::GetAddress(unit, ladder, hLadder, module, sensor);
27 }
28 // -------------------------------------------------------------------------
29 
30 
31 // ----- String output -------------------------------------------------
32 std::string CbmStsSensor::ToString() const {
33  std::stringstream ss;
34  ss << GetName() << ", address " << CbmStsAddress::ToString(fAddress);
35  return ss.str();
36 }
37 // -------------------------------------------------------------------------
38 
CbmStsAddress::GetAddress
Int_t GetAddress(UInt_t unit=0, UInt_t ladder=0, UInt_t halfladder=0, UInt_t module=0, UInt_t sensor=0, UInt_t side=0, UInt_t version=kCurrentVersion)
Construct address.
Definition: CbmStsAddress.cxx:90
CbmStsSensor::GetAddressFromName
static UInt_t GetAddressFromName(TString name)
Get the address from the sensor name (static)
Definition: CbmStsSensor.cxx:18
CbmStsSensor::ToString
virtual std::string ToString() const
String output.
Definition: CbmStsSensor.cxx:32
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmStsSensor
Class representing an instance of a sensor in the CBM-STS.
Definition: CbmStsSensor.h:38
CbmStsSensor::CbmStsSensor
CbmStsSensor(UInt_t address=0, TGeoPhysicalNode *node=nullptr, CbmStsElement *mother=nullptr)
Definition: CbmStsSensor.cxx:11
kStsSensor
@ kStsSensor
Definition: CbmStsAddress.h:22
CbmStsElement
Class representing an element of the STS setup.
Definition: CbmStsElement.h:32
CbmStsElement::fAddress
Int_t fAddress
Unique element address.
Definition: CbmStsElement.h:124
CbmStsAddress::ToString
std::string ToString(Int_t address)
String output.
Definition: CbmStsAddress.cxx:221
CbmStsSensor.h