14#include <FairParamList.h>
18#include <TGenericClassInfo.h>
20#include <TObjString.h>
42 if (crob < 0)
continue;
53 if (!l)
return kFALSE;
54 if (!l->fill(
"NrOfModules", &
fNrOfModules))
return kFALSE;
56 if (!l->fill(
"ModuleId", &moduleId))
return kFALSE;
58 if (!l->fill(
"nAsic", &nAsic))
return kFALSE;
60 if (!l->fill(
"typeAsic", &typeAsic))
return kFALSE;
64 if (nAsic[imod] > maxNrAsics) maxNrAsics = nAsic[imod];
71 mod =
new CbmTrdParModAsic(GetName(), Form(
"%s for Module %d", GetTitle(), moduleId[i]));
75 if (9 == typeAsic[i]) {
77 if (!l->fill(Form(
"CrobInfo - Module %d", moduleId[i]), &crobAddress))
continue;
79 Int_t maxValues = maxNrAsics * int(
NFASPPARS);
80 TArrayI values(maxValues);
81 if (!l->fill(Form(
"FaspInfo - Module %d", moduleId[i]), &values))
continue;
82 for (Int_t iasic = 0; iasic < nAsic[i]; iasic++) {
84 address = values[offset++];
85 if (address == moduleId[i] * 1000 + 999)
continue;
87 static_cast<CbmTrdParFasp*
>(asic)->LoadParams(&(values.GetArray()[offset]));
92 Int_t maxValues = maxNrAsics * (5 +
NSPADICCH);
93 TArrayI values(maxValues);
95 if (!l->fill(Form(
"SpadicInfo - Module %d", moduleId[i]), &values))
continue;
96 for (Int_t iasic = 0; iasic < nAsic[i]; iasic++) {
98 address = values[offset + 0];
101 values[offset + 1], values[offset + 2], values[offset + 3], values[offset + 4]));
102 std::vector<Int_t> addresses {};
103 for (Int_t j = offset + 5; j < offset + 5 +
NSPADICCH; j++) {
104 addresses.push_back(values[j]);
124 moduleId[idx] = mod.first;
130 l->add(
"ModuleId", moduleId);
131 l->add(
"nAsic", nAsic);
132 l->add(
"typeAsic", typeChmb);
137 Int_t currentAsicAddress(-1);
146 Int_t fullSize = nAsic[idx] * sizePerSpadic;
147 TArrayI asicInfo(fullSize);
149 for (
auto iModuleIt : mod->
fModPar) {
150 size_t asicComponentId(100098);
151 currentAsicAddress = iModuleIt.first;
152 asicComponentId = ((
CbmTrdParSpadic*) iModuleIt.second)->GetComponentId();
153 int offset = iAsicNr * sizePerSpadic;
154 asicInfo[offset] = currentAsicAddress;
161 LOG(fatal) <<
"Number of channels found " << ((
CbmTrdParSpadic*) iModuleIt.second)->GetNchannels()
162 <<
" is differnt from the expected " <<
NSPADICCH;
165 Int_t iAsicChannel(0);
166 for (
auto channelAddressIt : ((
CbmTrdParSpadic*) iModuleIt.second)->GetChannelAddresses()) {
167 asicInfo[offset + 5 + iAsicChannel] = channelAddressIt;
172 l->add(Form(
"SpadicInfo - Module %d", mapEntry.first), asicInfo);
177 l->add(Form(
"CrobInfo - Module %d", mapEntry.first), crobAddress);
178 int fullSize = nAsic[idx] * int(
NFASPPARS);
179 TArrayI asicInfo(fullSize);
182 for (
auto iModuleIt : mod->
fModPar) {
184 asicInfo[offset++] = iModuleIt.first;
192 LOG(info) <<
"Missing calib for Fasp[" << offset <<
"] pad " << chAddress;
196 asicInfo[offset + ich] = (ch->
HasPairingT() ? -1 : 1) * chAddress;
204 l->add(Form(
"FaspInfo - Module %d", mapEntry.first), asicInfo);
ClassImp(CbmConverterManager)
Definition of ASIC parameters.
virtual std::vector< Int_t > GetChannelAddresses() const
virtual void SetComponentId(size_t id)
virtual void SetChannelAddresses(std::vector< Int_t > addresses)
Definition of FASP channel calibration container.
Int_t GetMinDelaySignal() const
Bool_t HasPairingT() const
Int_t GetPileUpTime() const
Int_t GetThreshold() const
Definition of FASP parameters.
const CbmTrdParFaspChannel * GetChannel(Int_t pad_address, UChar_t pair) const
Query the calibration for one FASP RO channel.
virtual uint32_t GetChannelMask() const
Describe TRD module ASIC settings (electronic gain, delays, etc)
virtual void SetCrobAddresses(int *addresses)
Initialize the CROB addresses as they are used in the DAQ.
std::map< int, CbmTrdParAsic * > fModPar
list of ASIC params for module
virtual void SetChamberType(Int_t t)
virtual CbmTrdDigi::eCbmTrdAsicType GetAsicType() const
Query the type of ASICs in the list.
virtual const int32_t * GetCrobAddresses() const
Query the type of chamber.
virtual void SetAsicPar(CbmTrdParAsic *p)
Initialize the ASIC parameters for DAQ id It applies to the list of ASICs.
virtual void SetModuleId(int m)
Describe TRD module ASIC settings (electronic gain, delays, etc)
CbmTrdParSetAsic(const char *name="CbmTrdParSetAsic", const char *title="TRD ASIC parameters", const char *context="Default")
Bool_t getParams(FairParamList *)
Build the ASICs par for the current module from the info stored in the param file It applies to the l...
void putParams(FairParamList *)
Store the ASICs par info for the current module into the param file It applies to the list of ASICs.
virtual int FindModuleByEqId(uint16_t eqid, uint8_t &rob_id, uint8_t &lnk_id) const
Search for the module in the setup parameters by equipement id.
std::map< Int_t, CbmTrdParMod * > fModuleMap
Int_t fNrOfModules
no of modules in the current run
Definition of SPADIC parameters.
std::uint8_t GetCrobNumber()
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....