GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TILLMnemonic.cxx
Go to the documentation of this file.
1#include "TILLMnemonic.h"
2
3#include <algorithm>
4
5// Detector dependent includes
6#include "TFipps.h"
7#include "TFippsBgo.h"
8#include "TFippsLaBr.h"
9#include "TFippsLaBrBgo.h"
10#include "TFippsTAC.h"
11#include "TFippsPulser.h"
12#include "TIfin.h"
13#include "TIfinBgo.h"
14
15void TILLMnemonic::Clear(Option_t*)
16{
19}
20
22{
23 // Enumerating the SystemString must come after the total mnemonic has been parsed as the details of other parts of
24 // the mnemonic must be known
25 if(SystemString() == "FI") {
26 if(SubSystem() == EMnemonic::kS) {
28 } else {
30 }
31 } else if(SystemString() == "IF") {
32 if(SubSystem() == EMnemonic::kS) {
34 } else {
36 }
37 } else if(SystemString() == "LB") {
38 if(SubSystem() == EMnemonic::kS) {
40 } else if(SubSystem() == EMnemonic::kT) {
42 } else {
44 }
45 } else if(SystemString() == "PU") {
47 } else {
49 }
50}
51
53{
54 std::string name = digitizerName.Value();
55 std::transform(name.begin(), name.end(), name.begin(), ::toupper);
57 int tmpUnit = 10;
58 if(name.compare("V1724") == 0) {
59 tmpType = EDigitizer::kV1724;
60 tmpUnit = 10;
61 } else if(name.compare("V1725") == 0) {
62 tmpType = EDigitizer::kV1725;
63 tmpUnit = 4; // ns
64 } else if(name.compare("V1730") == 0) {
65 tmpType = EDigitizer::kV1730;
66 tmpUnit = 2; // ns
67 } else if(name.compare("V1751") == 0) {
68 tmpType = EDigitizer::kV1751;
69 tmpUnit = 1; // ns
70 } else {
71 std::cout << "Warning, digitizer type '" << name << "' not recognized, options are 'V1724', 'V1725', 'V1730', and 'V1751'!" << std::endl;
72 }
73 digitizerType.Set(tmpType, digitizerName.Priority());
74 timeStampUnit.Set(tmpUnit, digitizerName.Priority());
75}
76
77void TILLMnemonic::Parse(std::string* name)
78{
79 if((name == nullptr) || name->length() < 9) {
80 return;
81 }
82 TMnemonic::Parse(name);
83 // Enumerating the fSystemString must come last as the details of other parts of
84 // the mnemonic must be known
86}
87
88void TILLMnemonic::Print(Option_t*) const
89{
90 std::ostringstream str;
91 std::cout << "====== ILLMNEMONIC ======" << std::endl;
93 std::cout << "=========================" << std::endl;
94 std::cout << str.str();
95}
96
98{
99 if(TMnemonic::GetClassType() != nullptr) {
101 }
102
103 switch(System()) {
104 case ESystem::kFipps: SetClassType(TFipps::Class()); break;
105 case ESystem::kFippsBgo: SetClassType(TFippsBgo::Class()); break;
106 case ESystem::kFippsLaBr: SetClassType(TFippsLaBr::Class()); break;
107 case ESystem::kFippsLaBrBgo: SetClassType(TFippsLaBrBgo::Class()); break;
108 case ESystem::kFippsTAC: SetClassType(TFippsTAC::Class()); break;
109 case ESystem::kFippsPulser: SetClassType(TFippsPulser::Class()); break;
110 case ESystem::kIfin: SetClassType(TIfin::Class()); break;
111 case ESystem::kIfinBgo: SetClassType(TIfinBgo::Class()); break;
112 default: SetClassType(nullptr);
113 };
115}
116
117double TILLMnemonic::GetTime(Long64_t timestamp, Float_t, double energy, const TChannel* channel) const
118{
119 if(channel == nullptr) {
120 Error("GetTime", "No TChannel provided");
121 return static_cast<Double_t>((timestamp) + gRandom->Uniform());
122 }
123 Double_t dTime = static_cast<Double_t>((timestamp) + gRandom->Uniform()) * channel->GetTimeStampUnit() + channel->CalibrateCFD(0.);
124 return dTime - channel->GetTZero(energy) - channel->GetTimeOffset();
125}
EDigitizer
Definition TILLMnemonic.h:9
Long64_t GetTimeOffset() const
Definition TChannel.h:176
double CalibrateCFD(double) const
Definition TChannel.cxx:705
int GetTimeStampUnit() const
Definition TChannel.h:175
double GetTZero(double tempd) const
Definition TChannel.h:294
double GetTime(Long64_t timestamp, Float_t cfd, double energy, const TChannel *channel) const override
void EnumerateSystem()
void Print(Option_t *opt="") const override
ESystem fSystem
void Parse(std::string *name) override
void Clear(Option_t *opt="") override
TClass * GetClassType() const override
ESystem System() const
void EnumerateDigitizer(TPriorityValue< std::string > &digitizerName, TPriorityValue< EDigitizer > &digitizerType, TPriorityValue< int > &timeStampUnit) override
virtual std::string SystemString() const
Definition TMnemonic.h:69
virtual EMnemonic SubSystem() const
Definition TMnemonic.h:61
void Print(Option_t *opt="") const override
virtual void Parse(std::string *name)
Definition TMnemonic.cxx:57
void Clear(Option_t *opt="") override
Definition TMnemonic.cxx:8
virtual TClass * GetClassType() const
virtual void SetClassType(TClass *classType) const
Definition TMnemonic.h:92
void Set(const T &val, EPriority priority)
EPriority Priority() const
const T & Value() const