Skip to content

STS Digitizer: CbmStsDigitize and CbmStsParModule

Mehulkumar Shiroya requested to merge m.shiroya/cbmroot:STS_Digitize into master

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;          
   }
}
Edited by Mehulkumar Shiroya

Merge request reports