REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDetectorDriftVolume.h
1
2/*************************************************************************
3 * This file is part of the REST software framework. *
4 * *
5 * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
6 * For more information see http://gifna.unizar.es/trex *
7 * *
8 * REST is free software: you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation, either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * REST is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have a copy of the GNU General Public License along with *
19 * REST in $REST_PATH/LICENSE. *
20 * If not, see http://www.gnu.org/licenses/. *
21 * For the list of contributors see $REST_PATH/CREDITS. *
22 *************************************************************************/
23
24#ifndef RestCore_TRestDetectorDriftVolume
25#define RestCore_TRestDetectorDriftVolume
26
27#include <TROOT.h>
28#include <stdlib.h>
29
30#include <fstream>
31#include <iostream>
32
33#include "TApplication.h"
34#include "TArrayI.h"
35#include "TAxis.h"
36#include "TCanvas.h"
37#include "TGraph.h"
38#include "TNamed.h"
39#include "TRestMetadata.h"
40#include "TString.h"
41#include "TSystem.h"
42#include "TVector3.h"
43
45 protected:
46 std::string fMaterial; // material description std::string
47 Double_t fW; // Work function for electron extraction, in unit eV.
48
49 Double_t fElectricField; // in unit V/mm
50 Double_t fDriftVelocity; // in unit mm/us
51 Double_t fElectronLifeTime; // in unit us
52 Double_t fLongitudinalDiffusion; // in unit (cm)^1/2
53 Double_t fTransversalDiffusion; // in unit (cm)^1/2
54 Double_t fTownsendCoefficient;
55 Double_t fAttachmentCoefficient;
56
57 Double_t fPressureInAtm; // Pressure of the gas in atm.
58 Double_t fTemperatureInK; // Temperature of the gas in K.
59
60 public:
62 TRestDetectorDriftVolume(const char* configFilename, std::string name = "");
63 void Initialize() override;
64 void InitFromConfigFile() override;
65
66 virtual std::string GetMaterial() const { return fMaterial; }
67 virtual Double_t GetW() const { return fW; }
68 virtual Double_t GetWvalue() const { return fW; }
69
71 virtual Double_t GetElectricField() const { return fElectricField; }
72
74 virtual Double_t GetDriftVelocity() { return fDriftVelocity; }
75
76 virtual Double_t GetElectronLifeTime() { return fElectronLifeTime; }
77 virtual Double_t GetLongitudinalDiffusion() { return fLongitudinalDiffusion; }
78 virtual Double_t GetTransversalDiffusion() { return fTransversalDiffusion; }
79 virtual Double_t GetTownsendCoefficient() { return fTownsendCoefficient; }
80 virtual Double_t GetAttachmentCoefficient() { return fAttachmentCoefficient; }
81
82 virtual Double_t GetPressure() const { return fPressureInAtm; }
83 virtual Double_t GetTemperature() const { return fTemperatureInK; }
84
85 virtual void SetMaterial(std::string value) { fMaterial = value; }
86
88 virtual void SetW(double value) { fW = value; }
89
91 virtual void SetElectricField(double value) { fElectricField = value; }
92
93 // Sets the drift velocity. Must be given in mm/us.
94 virtual void SetDriftVelocity(double value) { fDriftVelocity = value; }
95
96 virtual void SetElectronLifeTime(double value) { fElectronLifeTime = value; }
97 virtual void SetLongitudinalDiffusion(double value) { fLongitudinalDiffusion = value; }
98 virtual void SetTransversalDiffusion(double value) { fTransversalDiffusion = value; }
99 virtual void SetTownsendCoefficient(double value) { fTownsendCoefficient = value; }
100 virtual void SetAttachmentCoefficient(double value) { fAttachmentCoefficient = value; }
101
102 virtual void SetPressure(double value) { fPressureInAtm = value; }
103 virtual void SetTemperature(double value) { fTemperatureInK = value; }
104
105 virtual void UpdateCondition() {}
106
107 void PrintMetadata() override;
108
109 ClassDefOverride(TRestDetectorDriftVolume, 1); // Gas Parameters
110};
111
112#endif
void PrintMetadata() override
Implemented it in the derived metadata class to print out specific metadata information.
void InitFromConfigFile() override
To make settings from rml file. This method must be implemented in the derived class.
virtual void SetW(double value)
Sets the electric field of the drift volume. Given in V/mm.
void Initialize() override
Making default settings.
virtual Double_t GetDriftVelocity()
Returns the drift velocity in mm/us.
virtual void SetElectricField(double value)
Sets the electric field. Must be given in V/mm.
virtual Double_t GetElectricField() const
Returns the electric field in V/mm.
A base class for any REST metadata class.
Definition: TRestMetadata.h:74