GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
THILMnemonic.cxx
Go to the documentation of this file.
1#include "THILMnemonic.h"
2
3#include <algorithm>
4
5// Detector dependent includes
6#include "TEagle.h"
7#include "TEaglePulser.h"
8
16
18{
19 // Enumerating the fSystemString must come after the total mnemonic has been parsed as the details of other parts of
20 // the mnemonic must be known
21 if(fSystemString.compare("EA") == 0) {
23 } else if(fSystemString.compare("PD") == 0) {
25 } else if(fSystemString.compare("PU") == 0) {
27 } else {
29 }
30}
31
33{
34 std::string name = digitizerName.Value();
35 std::transform(name.begin(), name.end(), name.begin(), ::toupper);
37 int tmpUnit = 10;
38 digitizerType.Set(tmpType, digitizerName.Priority());
39 timeStampUnit.Set(tmpUnit, digitizerName.Priority());
40}
41
42void THILMnemonic::Parse(std::string* name)
43{
44 if((name == nullptr) || name->length() < 9) {
45 return;
46 }
47 TMnemonic::Parse(name);
48 // Enumerating the fSystemString must come last as the details of other parts of
49 // the mnemonic must be known
51}
52
53void THILMnemonic::Print(Option_t*) const
54{
55 std::cout<<"====== HILMNEMONIC ============"<<std::endl;
56 std::cout<<"fArrayPosition = "<<fArrayPosition<<std::endl;
57 std::cout<<"fSegment = "<<fSegment<<std::endl;
58 std::cout<<"fSystemString = "<<fSystemString<<std::endl;
59 std::cout<<"fSubSystemString = "<<fSubSystemString<<std::endl;
60 std::cout<<"fArraySubPositionString = "<<fArraySubPositionString<<std::endl;
61 std::cout<<"fCollectedChargeString = "<<fCollectedChargeString<<std::endl;
62 std::cout<<"fOutputSensorString = "<<fOutputSensorString<<std::endl;
63 std::cout<<"==============================="<<std::endl;
64}
65
67{
68 if(fClassType != nullptr) {
69 return fClassType;
70 }
71
72 switch(System()) {
73 case ESystem::kEagle: fClassType = TEagle::Class(); break;
74 case ESystem::kPinDiode: fClassType = TEagle::Class(); break;
75 case ESystem::kEaglePulser: fClassType = TEaglePulser::Class(); break;
76 default: fClassType = nullptr;
77 };
78 return fClassType;
79}
80
81double THILMnemonic::GetTime(Long64_t timestamp, Float_t, double energy, const TChannel* channel) const
82{
83 if(channel == nullptr) {
84 Error("GetTime", "No TChannel provided");
85 return static_cast<Double_t>((timestamp) + gRandom->Uniform());
86 }
87 Double_t dTime = static_cast<Double_t>((timestamp) + gRandom->Uniform()) * channel->GetTimeStampUnit() + channel->CalibrateCFD(0.);
88 return dTime - channel->GetTZero(energy) - channel->GetTimeOffset();
89}
ClassImp(THILMnemonic) void THILMnemonic
EDigitizer
Definition THILMnemonic.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
TClass * GetClassType() const override
void Clear(Option_t *opt="") override
void Parse(std::string *name) override
ESystem fSystem
void EnumerateDigitizer(TPriorityValue< std::string > &digitizerName, TPriorityValue< EDigitizer > &digitizerType, TPriorityValue< int > &timeStampUnit) override
void Print(Option_t *opt="") const override
double GetTime(Long64_t timestamp, Float_t cfd, double energy, const TChannel *channel) const override
ESystem System() const
void EnumerateSystem()
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
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