CbmRoot
Loading...
Searching...
No Matches
CbmTrdParSpadic.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], Pascal Raisig */
4
5#ifndef CBMTRDPARSPADIC_H
6#define CBMTRDPARSPADIC_H
7
8#define NSPADICCH 32
9
10#include "CbmTrdParAsic.h" // for CbmTrdParAsic
11
12#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
13#include <RtypesCore.h> // for Int_t, Double_t, UInt_t
14
15#include <cstdint> // for size_t, uint8_t, uint16_t
16#include <map> // fMapAsicChannelToElink
17#include <vector> // fVecSpadicChannels
18
19class FairParamList;
20
23 public:
24 CbmTrdParSpadic(Int_t address = 0, Int_t FebGrouping = -1, Double_t x = 0, Double_t y = 0, Double_t z = 0,
25 size_t compId = 0);
26 virtual ~CbmTrdParSpadic() { ; }
27
28 virtual void LoadParams(
29 FairParamList*
30 inList);
31
32 virtual Int_t GetNchannels() const { return NSPADICCH; };
33
34 virtual Double_t GetSizeX() const { return fgSizeX; }
35 virtual Double_t GetSizeY() const { return fgSizeY; }
36 virtual Double_t GetSizeZ() const { return fgSizeZ; }
37
38 static size_t CreateComponentId(
39 Int_t criId, Int_t crobId, Int_t nThCrobOnModule,
40 Int_t
41 eLinkId);
42
43 std::vector<UInt_t> GetSpadicChannelVec() { return fVecSpadicChannels; }
45
46 static Int_t GetNasicsOnModule(
47 Int_t moduleType);
48 static Int_t GetNasicsPerCrob(
49 Int_t moduleType);
50 static std::uint16_t GetCriId(
51 size_t
52 componentId);
53 static std::uint8_t GetCrobId(size_t componentId);
54 static std::uint8_t
55 GetCrobNumber(size_t componentId);
56 static std::uint8_t GetElinkId(
57 size_t componentId,
58 Int_t
59 channelId);
60
61 std::uint16_t GetCriId();
62 std::uint8_t GetCrobId();
63 std::uint8_t GetCrobNumber();
64 std::uint8_t GetElinkId(
65 Int_t
66 channelId);
67 UInt_t GetElinkNr(Int_t moduleChannel, UInt_t nChannelsPerRow);
69 UInt_t GetAddressOnModule() const
70 {
71 return fAddress % 1000;
72 }
73 Int_t GetAsicChAddress(const Int_t asicChannel);
75
76
77 private:
78 static Double_t fgSizeX;
79 static Double_t fgSizeY;
80 static Double_t fgSizeZ;
81
82 const std::vector<UInt_t> fVecSpadicChannels = {23, 7, 22, 6, 21, 19, 5, 20, 18, 4, 3, 17, 16, 2, 1, 0,
83 31, 30, 29, 15, 14, 28, 27, 13, 11, 26, 12, 10, 25, 9, 24, 8};
84 std::map<UInt_t, UInt_t> fMapAsicChannelToElink = {};
86 std::map<UInt_t, UInt_t>* map);
87
88 ClassDef(CbmTrdParSpadic, 3) // Definition of SPADIC ASIC parameters
89};
90
91#endif
#define NSPADICCH
Definition of ASIC parameters.
Int_t fAddress
unique ASIC ID
Definition of SPADIC parameters.
virtual Int_t GetNchannels() const
virtual Double_t GetSizeX() const
static size_t CreateComponentId(Int_t criId, Int_t crobId, Int_t nThCrobOnModule, Int_t eLinkId)
Create the componentId from a given criId, crobId, eLinkId and the nThCrobOnModule count,...
virtual Double_t GetSizeZ() const
const std::vector< UInt_t > fVecSpadicChannels
CbmTrdParSpadic(Int_t address=0, Int_t FebGrouping=-1, Double_t x=0, Double_t y=0, Double_t z=0, size_t compId=0)
void FillAsicChannelToElinkMap(std::map< UInt_t, UInt_t > *map)
Write the eLink to asicChannel mapping to the passed map.
static Double_t fgSizeZ
SPADIC half size in z [cm].
std::uint8_t GetCrobId()
static Double_t fgSizeX
SPADIC half size in x [cm].
std::uint16_t GetCriId()
std::uint8_t GetCrobNumber()
static Int_t GetNasicsPerCrob(Int_t moduleType)
Returns the number of asics per Crob on a given moduleType defined in eCbmTrdModuleTypes.
virtual void LoadParams(FairParamList *inList)
Loads the specific params for the spadic placed at fAddress, e.g. channel calibration parameters.
UInt_t GetAddressOnModule() const
Returns the number of the asic on the module counted from top left.
UInt_t GetElinkNr(Int_t moduleChannel, UInt_t nChannelsPerRow)
Return the number of the elink (counting started in channel order from bottom left to right) correlat...
static Int_t GetNasicsOnModule(Int_t moduleType)
Returns the number of asics on a given moduleType defined in eCbmTrdModuleTypes.
std::vector< UInt_t > GetSpadicChannelVec()
Return the vector with the corresponding spadic channel numbers sorted from channel 00....
Int_t GetAsicChAddress(const Int_t asicChannel)
Returns the nth asic Channel in asic coordinates in single asic padplane coordinates....
virtual Double_t GetSizeY() const
static Double_t fgSizeY
SPADIC half size in y [cm].
virtual ~CbmTrdParSpadic()
static std::uint8_t GetElinkId(size_t componentId, Int_t channelId)
eLinkId for the given asicAddress and channelId (in the asic coordinates, i.e. 00....
std::map< UInt_t, UInt_t > fMapAsicChannelToElink