Skip to content
Snippets Groups Projects

STS Digitizer: CbmStsDigitize and CbmStsParModule

Open 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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

    The method returns an ASIC index from 0 to 15 (for 2048 channels and 128 channels per ASIC). The side-related values relativeChannel and asicIndexWithinSide are only used internally. So, the method can be much more easily formulated (even inline) as

    return channel / fNofAsicChannels;

  • Please register or sign in to reply
  • 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;
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading