STS Digitizer: CbmStsDigitize and CbmStsParModule
In this merge request, the changes are done respectively as described below
1. Changes in CbmStsDigitize.cxx and CbmStsDigitize.h file
New function implementation to read the ASCII file to read the Asic Parameters like ModAddress, moduleSide, AsicIdx, nChannels, nAdc, dynRange, threshold, timeResol, deadTime, noise, znr to be set for each module address instead of using global default parameters. This implementation will allow the same parameters used in the real experiment, for example, the case of mSTS at the mCBM experiment. This will provide access to the use of the same lab parameters in the simulation.
2. Changes in CbmStsParModule.cxx and CbmStsParModule.h
New Function implementation is needed to get a side of the module. In the STS the Module has two sides 0 and 1. The function will allow a person to get direct access to the module side while preparing an analysis macro.
//--------------- Function to get the side of the module (Sensor) ----------
Int_t CbmStsParModule::GetModuleSide(uint32_t channel) const {
assert(channel < fNofChannels);
// Calculate side: 0 for channels in the front side, 1 for channels in the back side of the sensor
return channel < (fNofChannels / 2) ? 0 : 1;
}
secondly, another function is implemented to get the Asics Number/Index for each side of the module
//--------------- Function to get the Asic Index for each side of the module ----------
uint32_t CbmStsParModule::GetAsicIndex(uint32_t channel) const
{
// Ensure the channel is within valid range
assert(channel < fNofChannels);
// Determine the side of the module based on the channel
int Module_Side = GetModuleSide(channel);
// Calculate the relative channel number for the side 0 and side 1
uint32_t relativeChannel = (Module_Side == 0) ? channel : (channel - fNofChannels / 2);
// Calculate the ASIC index based on the relative channel
// for each side the Asic index withthin particular side of the module is 0-7 as the each side has a 8 asics, asic numbers starts from 0.
uint32_t asicIndexWithinSide = relativeChannel / fNofAsicChannels;
// Adjust the ASIC index for side 1 by adding the offset for getting the correct asic number/Index from 8-15
uint32_t AsicIndex = (Module_Side == 0) ? asicIndexWithinSide : (asicIndexWithinSide + 8);
/*
std::cout << "Channel: " << channel
<< ", Side: " << Module_Side
<< ", AsicIndexWithinSide: " << asicIndexWithinSide
<< ", AsicIndex: " << AsicIndex
<< std::endl;
*/
return AsicIndex;
}
In the analysis macro one can use it for an example below;
if(ModuleAddress == 268435458) {
// Get the side of the module for the given channel
int Side = StsModulePar->GetModuleSide(Digi.GetChannel());
uint32_t NofAsics = StsModulePar->GetNofAsics();
uint32_t asicIndex = StsModulePar->GetAsicIndex(Digi.GetChannel());
// Retrieve the ASIC parameters using the index iAsic
const auto& Asic = StsModulePar->GetParAsic(Digi.GetChannel());
// Only print ASIC parameters if it belongs to the specified side
if(Side == 0) {
// Print ASIC parameters for the specific side
cout << "Module Address: " << ModuleAddress
<< "\t ASIC Number: " << asicIndex
<< "\t Side: " << Side
<< "\t Channel: " << Digi.GetChannel()
<< "\t Dynamic Range: " << Asic.GetDynRange()
<< "\t Threshold: " << Asic.GetThreshold()
<< "\t Time Resolution: " << Asic.GetTimeResol()
<< "\t Dead Time: " << Asic.GetDeadTime()
<< endl;
}
}
Merge request reports
Activity
added 1 commit
- 399c1ae8 - Changes in CbmStsDigitize and CbmStsParModule
added 1 commit
- 3fa3a4bf - Changes in CbmStsDigitize and CbmStsParModule and clange file format applied
requested review from @v.friese
assigned to @v.friese
added Parameters Simulation mCBM labels
@m.shiroya it seems that you have a problem with all MacOS machines in
CbmStsDigitize::SetAsicParamsFromFile
. See for example this log on MacOS 10.15Could it be that you have something relying on "Case Sensitive" filename(s) in your changes?
This is the typical failure mode when problems appear only on MAC with files opening.(@f.uhlig if you have other insights please do not hesitate)
added 1 commit
- fa1ae42d - Changes in CbmStsDigitize and CbmStsParModule and clange file format applied
added 1 commit
- d6460260 - Changes done after seeing the message of macos CI test Falied
added 2 commits
@p.-a.loizeau I think now it is a problem of CI test longer run time.
added 2 commits
Dear @v.friese,
you have been identified as code owner of at least one file which was changed with this merge request.
Please check the changes and approve them or request changes.
added CodeOwners label
129 // Calculate the ASIC index based on the relative channel 130 // for each side the Asic index withthin particular side of the module is 0-7 as the each side has a 8 asics, asic numbers starts from 0. 131 uint32_t asicIndexWithinSide = relativeChannel / fNofAsicChannels; 132 133 // Adjust the ASIC index for side 1 by adding the offset for getting the correct asic number/Index from 8-15 134 uint32_t AsicIndex = (Module_Side == 0) ? asicIndexWithinSide : (asicIndexWithinSide + 8); 135 136 /* 137 std::cout << "Channel: " << channel 138 << ", Side: " << Module_Side 139 << ", AsicIndexWithinSide: " << asicIndexWithinSide 140 << ", AsicIndex: " << AsicIndex 141 << std::endl; 142 */ 143 144 return AsicIndex; - Comment on lines +120 to +144
311 Double_t noise; 312 Double_t zeroNoiseRate; 313 314 AsicParams() 315 : nChannels(0) 316 , nAdc(0) 317 , dynRange(0) 318 , threshold(0) 319 , timeResolution(0) 320 , deadTime(0) 321 , noise(0) 322 , zeroNoiseRate(0) 323 { 324 } 325 }; 326 383 410 std::pair<size_t, bool> ReadInactiveChannels(); 384 411 385 412 413 // --- File name for parsing ASIC parameters from ASCII file for particular asics setting 414 const char* fAsicParamsFileName = nullptr; 415 416 417 // --- Map of Asics parameters for particular modules 418 std::map<std::tuple<UInt_t, Int_t, Int_t>, CbmStsParAsic*> fModuleAsicParams;