CbmRoot
Loading...
Searching...
No Matches
CbmTrdParFasp.h
Go to the documentation of this file.
1/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer], Alexandru Bercuci*/
4
5#ifndef CBMTRDPARFASP_H
6#define CBMTRDPARFASP_H
7
8#define NFASPMOD 180
9#define NCROBMOD 5
10#define NFASPCROB NFASPMOD / NCROBMOD
11#define NFASPCH 16
12// The size of the parameter translation is calculated as follows:
13// size = detId + chMask + NFASPCH*(chAddress + pileUp + threshold + delay)
14#define NFASPPARS 2 + 4 * NFASPCH
15
16#define FASP_EPOCH_LENGTH 128
17
18#include "CbmTrdParAsic.h" // for CbmTrdParAsic
19
20#include <Rtypes.h> // for THashConsistencyHolder, ClassDef, TESTBIT
21#include <RtypesCore.h> // for Int_t, Double_t, Bool_t, Float_t, UChar_t
22#include <TObject.h> // for TObject
23
24#include <vector> // for vector
25
26class FairParamList;
27class TArrayI;
28
30class CbmTrdParFaspChannel : public TObject {
31 friend class CbmTrdParFasp;
32
33public:
34 static constexpr double fgkSgmCh = 10;
35
37 {
38 kPair = 0 //< pad pairing type definition see SetPairing()
39 ,
40 kMask = 1 //< pad masking. See SetMask()
41 };
45 CbmTrdParFaspChannel(Int_t pup = 300, Int_t ft = 14, Int_t thr = 600, Int_t smin = 2586, Float_t dtPar = 4.181e-6);
46
47 Int_t GetFlatTop() const { return fFlatTop; }
48 Int_t GetMinDelaySignal() const { return fMinDelaySignal; }
49 Float_t GetMinDelayParam() const { return fMinDelayParam; }
50 Int_t GetPileUpTime() const { return fPileUpTime; }
51 Int_t GetThreshold() const { return fThreshold; }
52
54 Bool_t HasPairingR() const { return TESTBIT(fConfig, kPair); }
55 Bool_t HasPairingT() const { return !TESTBIT(fConfig, kPair); }
56 bool IsMasked() const { return TESTBIT(fConfig, kMask); }
57
58 void Print(Option_t* opt = "") const;
62 void SetPairing(Bool_t rect) { rect ? SETBIT(fConfig, kPair) : CLRBIT(fConfig, kPair); }
64 void SetMask(Bool_t set) { set ? SETBIT(fConfig, kMask) : CLRBIT(fConfig, kMask); }
65
66protected:
67 UShort_t fPileUpTime;
68 UChar_t fFlatTop;
69 UChar_t fConfig;
70
71 // threshold
72 UShort_t fThreshold;
73
74 // timming
75 UShort_t fMinDelaySignal;
77
78 ClassDef(CbmTrdParFaspChannel,
79 1) // Definition of FASP channel calibration container
80};
81
84public:
85 CbmTrdParFasp(Int_t address = 0, Int_t FebGrouping = -1, Double_t x = 0, Double_t y = 0, Double_t z = 0);
86 virtual ~CbmTrdParFasp() { ; }
91 const CbmTrdParFaspChannel* GetChannel(Int_t pad_address, UChar_t pair) const;
95 const CbmTrdParFaspChannel* GetChannel(Int_t chId) const;
96 virtual Int_t GetNchannels() const { return NFASPCH; };
100 virtual Int_t GetChannelAddress(Int_t chId) const
101 {
102 return ((chId < 0 || chId >= GetNchannels()) ? 0 : fChannelAddresses[chId]);
103 }
104 virtual uint32_t GetChannelMask() const;
105 virtual bool IsChannelMasked(int ch) const;
106 int GetPadAddress(Int_t ich) const { return int(0.5 * GetChannelAddress(ich)); }
107 Double_t GetSizeX() const { return fgSizeX; }
108 Double_t GetSizeY() const { return fgSizeY; }
109 Double_t GetSizeZ() const { return fgSizeZ; }
110 virtual void LoadParams(FairParamList* l);
112 void LoadParams(int* vals);
113 virtual void Print(Option_t* opt = "") const;
118 virtual Bool_t SetCalibParameters(Int_t ch, Double_t const* par);
119 virtual void SetChannelMask(uint32_t mask);
120
121private:
122 static Double_t fgSizeX;
123 static Double_t fgSizeY;
124 static Double_t fgSizeZ;
125
127
128 ClassDef(CbmTrdParFasp, 1) // Definition of FASP ASIC parameters
129};
130
131#endif
#define NFASPCH
#define SETBIT(n, i)
Definition RTypes.h:15
#define TESTBIT(n, i)
Definition RTypes.h:17
#define CLRBIT(n, i)
Definition RTypes.h:16
Definition of ASIC parameters.
std::vector< Int_t > fChannelAddresses
addresses of individual output channels
Definition of FASP channel calibration container.
CbmTrdParFaspChannel(Int_t pup=300, Int_t ft=14, Int_t thr=600, Int_t smin=2586, Float_t dtPar=4.181e-6)
Parametrization of a FASP channel based on CADENCE simulations from 12.01.2018 and parabolic parametr...
Int_t GetMinDelaySignal() const
Bool_t HasPairingR() const
Query pad pairing type.
UShort_t fThreshold
Threshold in ADC units.
bool IsMasked() const
void SetMask(Bool_t set)
Mask channel for processing.
void Print(Option_t *opt="") const
Bool_t HasPairingT() const
void SetPairing(Bool_t rect)
Specify pad pairing type.
UChar_t fConfig
configuration bit map
UShort_t fPileUpTime
Signal formation time in ns.
UShort_t fMinDelaySignal
Signal in ADC for minimum delay i.e. fPileUpTime.
static constexpr double fgkSgmCh
generic width of a pulser signal for FASP channels
Int_t GetPileUpTime() const
Int_t GetThreshold() const
Int_t GetFlatTop() const
Float_t fMinDelayParam
Factor of parabolic dependence dt=fdt*(s-s0)^2 to calculate trigger.
UChar_t fFlatTop
Length of Flat-Top in clocks.
Float_t GetMinDelayParam() const
Definition of FASP parameters.
static Double_t fgSizeY
FASP half size in y [cm].
CbmTrdParFaspChannel fCalib[NFASPCH]
calibration map for FASP channels
virtual bool IsChannelMasked(int ch) const
CbmTrdParFasp(Int_t address=0, Int_t FebGrouping=-1, Double_t x=0, Double_t y=0, Double_t z=0)
virtual Int_t GetChannelAddress(Int_t chId) const
Return the global RO channel for curent FASP and channel index.
virtual void SetChannelMask(uint32_t mask)
Double_t GetSizeY() const
virtual void Print(Option_t *opt="") const
const CbmTrdParFaspChannel * GetChannel(Int_t pad_address, UChar_t pair) const
Query the calibration for one FASP RO channel.
virtual Bool_t SetCalibParameters(Int_t ch, Double_t const *par)
Load FASP calibration parameters for a specific channel.
static Double_t fgSizeX
FASP half size in x [cm].
Double_t GetSizeX() const
int GetPadAddress(Int_t ich) const
virtual ~CbmTrdParFasp()
virtual void LoadParams(FairParamList *l)
virtual uint32_t GetChannelMask() const
static Double_t fgSizeZ
FASP half size in z [cm].
Double_t GetSizeZ() const
virtual Int_t GetNchannels() const