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