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
22
24{
25 // Enumerating the fSystemString must come after the total mnemonic has been parsed as the details of other parts of
26 // the mnemonic must be known
27 if(fSystemString.compare("FI") == 0) {
28 if(SubSystem() == EMnemonic::kS) {
30 } else {
32 }
33 } else if(fSystemString.compare("IF") == 0) {
34 if(SubSystem() == EMnemonic::kS) {
36 } else {
38 }
39 } else if(fSystemString.compare("LB") == 0) {
40 if(SubSystem() == EMnemonic::kS ) {
42 } else if(SubSystem() == EMnemonic::kT) {
44 } else {
46 }
47 } else if(fSystemString.compare("PU") == 0) {
49 } else {
51 }
52}
53
55{
56 std::string name = digitizerName.Value();
57 std::transform(name.begin(), name.end(), name.begin(), ::toupper);
59 int tmpUnit = 10;
60 if(name.compare("V1724") == 0) {
61 tmpType = EDigitizer::kV1724;
62 tmpUnit = 10;
63 } else if(name.compare("V1725") == 0) {
64 tmpType = EDigitizer::kV1725;
65 tmpUnit = 4; // ns
66 } else if(name.compare("V1730") == 0) {
67 tmpType = EDigitizer::kV1730;
68 tmpUnit = 2; // ns
69 } else if(name.compare("V1751") == 0) {
70 tmpType = EDigitizer::kV1751;
71 tmpUnit = 1; // ns
72 } else {
73 std::cout<<"Warning, digitizer type '"<<name<<"' not recognized, options are 'V1724', 'V1725', 'V1730', and 'V1751'!"<<std::endl;
74 }
75 digitizerType.Set(tmpType, digitizerName.Priority());
76 timeStampUnit.Set(tmpUnit, digitizerName.Priority());
77}
78
79void TILLMnemonic::Parse(std::string* name)
80{
81 if((name == nullptr) || name->length() < 9) {
82 return;
83 }
84 TMnemonic::Parse(name);
85 // Enumerating the fSystemString must come last as the details of other parts of
86 // the mnemonic must be known
88}
89
90void TILLMnemonic::Print(Option_t*) const
91{
92 std::cout<<"====== ILLMNEMONIC ======"<<std::endl;
93 std::cout<<"fArrayPosition = "<<fArrayPosition<<std::endl;
94 std::cout<<"fSegment = "<<fSegment<<std::endl;
95 std::cout<<"fSystemString = "<<fSystemString<<std::endl;
96 std::cout<<"fSubSystemString = "<<fSubSystemString<<std::endl;
97 std::cout<<"fArraySubPositionString = "<<fArraySubPositionString<<std::endl;
98 std::cout<<"fCollectedChargeString = "<<fCollectedChargeString<<std::endl;
99 std::cout<<"fOutputSensorString = "<<fOutputSensorString<<std::endl;
100 std::cout<<"========================="<<std::endl;
101}
102
104{
105 if(fClassType != nullptr) {
106 return fClassType;
107 }
108
109 switch(System()) {
110 case ESystem::kFipps: fClassType = TFipps::Class(); break;
111 case ESystem::kFippsBgo: fClassType = TFippsBgo::Class(); break;
112 case ESystem::kFippsLaBr: fClassType = TFippsLaBr::Class(); break;
113 case ESystem::kFippsLaBrBgo: fClassType = TFippsLaBrBgo::Class(); break;
114 case ESystem::kFippsTAC: fClassType = TFippsTAC::Class(); break;
115 case ESystem::kFippsPulser: fClassType = TFippsPulser::Class(); break;
116 case ESystem::kIfin: fClassType = TIfin::Class(); break;
117 case ESystem::kIfinBgo: fClassType = TIfinBgo::Class(); break;
118 default: fClassType = nullptr;
119 };
120 return fClassType;
121}
122
123double TILLMnemonic::GetTime(Long64_t timestamp, Float_t, double energy, const TChannel* channel) const
124{
125 if(channel == nullptr) {
126 Error("GetTime", "No TChannel provided");
127 return static_cast<Double_t>((timestamp) + gRandom->Uniform());
128 }
129 Double_t dTime = static_cast<Double_t>((timestamp) + gRandom->Uniform()) * channel->GetTimeStampUnit() + channel->CalibrateCFD(0.);
130 return dTime - channel->GetTZero(energy) - channel->GetTimeOffset();
131}
ClassImp(TILLMnemonic) void TILLMnemonic
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
std::string fArraySubPositionString
Definition TMnemonic.h:111
int16_t fSegment
Definition TMnemonic.h:108
TClass * fClassType
! TGRSIDetector Type that this mnemonic represents
Definition TMnemonic.h:120
virtual EMnemonic SubSystem() const
Definition TMnemonic.h:61
std::string fOutputSensorString
Definition TMnemonic.h:113
std::string fSystemString
Definition TMnemonic.h:109
virtual void Parse(std::string *name)
Definition TMnemonic.cxx:57
std::string fCollectedChargeString
Definition TMnemonic.h:112
void Clear(Option_t *opt="") override
Definition TMnemonic.cxx:8
std::string fSubSystemString
Definition TMnemonic.h:110
int16_t fArrayPosition
Definition TMnemonic.h:107
void Set(const T &val, EPriority priority)
EPriority Priority() const
const T & Value() const