CbmRoot
CbmStsSimSensorFactory.cxx
Go to the documentation of this file.
1 
7 
8 #include "CbmStsDefs.h"
9 #include "CbmStsParSensor.h"
12 #include <FairLogger.h>
13 #include <cassert>
14 
16 
17 
18 // ----- Constructor ---------------------------------------------------
20 // -------------------------------------------------------------------------
21 
22 
23 // ----- Destructor ----------------------------------------------------
25 // -------------------------------------------------------------------------
26 
27 
28 // ----- Create a simulation sensor ------------------------------------
30 
31  switch (par.GetClass()) {
32 
33  // --- Sensor class DssdStereo. Number of strips and pitch must be
34  // --- the same for both sides.
36  Double_t dY = par.GetPar(3); // Active size in y
37  Int_t nStrips = par.GetParInt(4); // Number of strips front side
38  Double_t pitch = par.GetPar(6); // Strip pitch front side
39  Double_t stereoF = par.GetPar(8); // Stereo angle front side
40  Double_t stereoB = par.GetPar(9); // Stereo angle back side
41  assert(nStrips == par.GetParInt(5)); // same number of strips
42  assert(TMath::Abs(pitch - par.GetPar(7)) < 0.0001); // same pitch
43  assert(Double_t(nStrips) * pitch < par.GetPar(0));
44  assert(dY <= par.GetPar(1)); // Active size fits into geometry
45  UP_sensor sensor(
46  new CbmStsSimSensorDssdStereo(dY, nStrips, pitch, stereoF, stereoB));
47  return sensor;
48  break;
49  } //? DssdStereo
50 
51  // --- Sensor class DssdOrtho
53  Int_t nStripsX = par.GetParInt(4); // Number of strips front side
54  Int_t nStripsY = par.GetParInt(5); // Number of strips back side
55  Double_t pitchX = par.GetPar(6); // Strip pitch front side
56  Double_t pitchY = par.GetPar(7); // Strip pitch back side
57  assert(Double_t(nStripsX) * pitchX < par.GetPar(0));
58  assert(Double_t(nStripsY) * pitchY < par.GetPar(1));
59  UP_sensor sensor(
60  new CbmStsSimSensorDssdOrtho(nStripsX, pitchX, nStripsY, pitchY));
61  return sensor;
62  break;
63  } //? DssdOrtho
64 
65  // --- Unknown sensor class
66  default: {
67  LOG(fatal) << "StsSimSensorFactory: Unknown sensor class!";
68  return nullptr;
69  break;
70  } //? unknown sensor class
71 
72  } //# switch sensor class
73 
74  return nullptr;
75 }
76 // -------------------------------------------------------------------------
77 
78 
CbmStsSimSensorFactory.h
CbmStsParSensor::GetClass
CbmStsSensorClass GetClass() const
Get the sensor class.
Definition: CbmStsParSensor.h:56
CbmStsParSensor.h
CbmStsSensorClass::kDssdOrtho
@ kDssdOrtho
CbmStsSimSensorDssdStereo
Detector response for DSSD sensors with stereo angles and cross-connection by double metal layers.
Definition: CbmStsSimSensorDssdStereo.h:40
CbmStsSimSensorFactory::CbmStsSimSensorFactory
CbmStsSimSensorFactory()
Constructor.
Definition: CbmStsSimSensorFactory.cxx:19
CbmStsSensorClass::kDssdStereo
@ kDssdStereo
CbmStsParSensor
Constructional parameters of a STS sensor.
Definition: CbmStsParSensor.h:38
CbmStsSimSensorFactory::UP_sensor
std::unique_ptr< CbmStsSimSensor > UP_sensor
Definition: CbmStsSimSensorFactory.h:33
CbmStsDefs.h
CbmStsSimSensorFactory::CreateSensor
UP_sensor CreateSensor(const CbmStsParSensor &par)
Create a sensor.
Definition: CbmStsSimSensorFactory.cxx:29
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmStsSimSensorDssdStereo.h
CbmStsParSensor::GetParInt
Int_t GetParInt(UInt_t index) const
Get the nearest integer value of a parameter.
Definition: CbmStsParSensor.cxx:31
CbmStsSimSensorDssdOrtho
Detector response for DSSD sensors with orthogonal strips.
Definition: CbmStsSimSensorDssdOrtho.h:27
CbmStsParSensor::GetPar
Float_t GetPar(UInt_t index) const
Get a parameter.
Definition: CbmStsParSensor.cxx:22
UP_sensor
CbmStsSimSensorFactory::UP_sensor UP_sensor
Definition: CbmStsSimSensorFactory.cxx:15
CbmStsSimSensorFactory::~CbmStsSimSensorFactory
virtual ~CbmStsSimSensorFactory()
Definition: CbmStsSimSensorFactory.cxx:24
CbmStsSimSensorFactory
Definition: CbmStsSimSensorFactory.h:30
CbmStsSimSensorDssdOrtho.h