@@ -47,8 +47,8 @@ void Digitizer::init()
4747 }
4848
4949 if (!mParams .hasResponseFunctions ()) {
50- auto loadSetResponseFunc = [&](const char * name, const char * fileIB, const char * nameIB, const char * fileOB, const char * nameOB) {
51- LOGP (info, " Loading response function for {}: IB={}:{} ; OB={}:{}" , name , nameIB, fileIB, nameOB, fileOB);
50+ auto loadSetResponseFunc = [&](const char * fileIB, const char * nameIB, const char * fileOB, const char * nameOB) {
51+ LOGP (info, " Loading response function IB={}:{} ; OB={}:{}" , nameIB, fileIB, nameOB, fileOB);
5252 auto fIB = TFile::Open (fileIB, " READ" );
5353 if (!fIB || fIB ->IsZombie () || !fIB ->IsOpen ()) {
5454 LOGP (fatal, " Cannot open file {}" , fileIB);
@@ -65,25 +65,27 @@ void Digitizer::init()
6565
6666 if (const auto & func = ITS3Params::Instance ().chipResponseFunction ; func == " Alpide" ) {
6767 constexpr const char * responseFile = " $(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
68- loadSetResponseFunc (" Alpide " , responseFile, " response0" , responseFile, " response1 " );
69- mSimRespIBShift = mSimRespIB -> getDepthMax () - SegmentationIB::SensorLayerThickness / 2 . f + 10 . e - 4f ;
70- mSimRespOBShift = mSimRespOB -> getDepthMax () - SegmentationOB::SensorLayerThickness / 2 . f ;
68+ loadSetResponseFunc (responseFile, " response0" , responseFile, " response0 " );
69+ mSimRespIBScaleX = o2::itsmft::SegmentationAlpide::PitchRow / SegmentationIB::PitchRow ;
70+ mSimRespIBScaleZ = o2::itsmft::SegmentationAlpide::PitchCol / SegmentationIB::PitchCol ;
7171 } else if (func == " APTS" ) {
7272 constexpr const char * responseFileIB = " $(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root" ;
7373 constexpr const char * responseFileOB = " $(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
74- loadSetResponseFunc (" APTS" , responseFileIB, " response1" , responseFileOB, " response1" );
75- mSimRespIBShift = mSimRespIB ->getDepthMax () + (float )constants::pixelarray::pixels::apts::responseYShift;
76- mSimRespOBShift = mSimRespOB ->getDepthMax () - SegmentationOB::SensorLayerThickness / 2 .f ;
77- mSimRespIBScaleX = 0 .5f * constants::pixelarray::pixels::apts::pitchX / SegmentationIB::PitchRow;
78- mSimRespIBScaleZ = 0 .5f * constants::pixelarray::pixels::apts::pitchZ / SegmentationIB::PitchCol;
74+ loadSetResponseFunc (responseFileIB, " response1" , responseFileOB, " response0" );
75+ mSimRespIBScaleX = constants::pixelarray::pixels::apts::pitchX / SegmentationIB::PitchRow;
76+ mSimRespIBScaleZ = constants::pixelarray::pixels::apts::pitchZ / SegmentationIB::PitchCol;
7977 mSimRespIBOrientation = true ;
8078 } else {
8179 LOGP (fatal, " ResponseFunction '{}' not implemented!" , func);
8280 }
81+ mSimRespIBShift = mSimRespIB ->getDepthMax () - constants::silicon::thicknessOut;
82+ mSimRespOBShift = mSimRespOB ->getDepthMax () - SegmentationOB::SensorLayerThickness / 2 .f ;
8383 }
84+
8485 mParams .print ();
8586 LOGP (info, " IBShift = {} ; OBShift = {}" , mSimRespIBShift , mSimRespOBShift );
8687 LOGP (info, " IB-Scale: X={} ; Z={}" , mSimRespIBScaleX , mSimRespIBScaleZ );
88+ LOGP (info, " IB-Orientation: {}" , mSimRespIBOrientation ? " flipped" : " normal" );
8789 mIRFirstSampledTF = o2::raw::HBFUtils::Instance ().getFirstSampledTFIR ();
8890}
8991
@@ -374,8 +376,8 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
374376 float rowMax{}, colMax{};
375377 const AlpideRespSimMat* rspmat{nullptr };
376378 if (chip.isIB ()) {
377- rowMax = 0 .5f * SegmentationIB::PitchRow;
378- colMax = 0 .5f * SegmentationIB::PitchCol;
379+ rowMax = 0 .5f * SegmentationIB::PitchRow * mSimRespIBScaleX ;
380+ colMax = 0 .5f * SegmentationIB::PitchCol * mSimRespIBScaleZ ;
379381 rspmat = mSimRespIB ->getResponse (mSimRespIBScaleX * (xyzLocS.X () - cRowPix), mSimRespIBScaleZ * (xyzLocS.Z () - cColPix), xyzLocS.Y (), flipRow, flipCol, rowMax, colMax);
380382 } else {
381383 rowMax = 0 .5f * SegmentationOB::PitchRow;
0 commit comments