@@ -35,11 +35,6 @@ using o2::itsmft::PreDigit;
3535
3636using namespace o2 ::its3;
3737
38- Digitizer::~Digitizer ()
39- {
40- delete mSimRespIB ;
41- }
42-
4338void Digitizer::init ()
4439{
4540 const int numOfChips = mGeometry ->getNumberOfChips ();
@@ -53,46 +48,22 @@ void Digitizer::init()
5348 }
5449
5550 if (!mParams .hasResponseFunctions ()) {
56- auto loadSetResponseFunc = [&](const char * fileIB, const char * nameIB, const char * fileOB, const char * nameOB) {
57- LOGP (info, " Loading response function IB={}:{} ; OB={}:{}" , nameIB, fileIB, nameOB, fileOB);
58- auto fIB = TFile::Open (fileIB, " READ" );
59- if (!fIB || fIB ->IsZombie () || !fIB ->IsOpen ()) {
60- LOGP (fatal, " Cannot open file {}" , fileIB);
61- }
62- auto fOB = TFile::Open (fileOB, " READ" );
63- if (!fOB || fOB ->IsZombie () || !fOB ->IsOpen ()) {
64- LOGP (fatal, " Cannot open file {}" , fileOB);
65- }
66- if ((mSimRespIB = new o2::its3::ChipSimResponse (fIB ->Get <o2::itsmft::AlpideSimResponse>(nameIB))) == nullptr ) {
67- LOGP (fatal, " Cannot create response function for IB" );
68- }
69- if ((mSimRespOB = fOB ->Get <o2::itsmft::AlpideSimResponse>(nameOB)) == nullptr ) {
70- LOGP (fatal, " Cannot create response function for OB" );
71- }
72- mParams .setIBSimResponse (mSimRespIB );
73- mParams .setOBSimResponse (mSimRespOB );
74- fIB ->Close ();
75- fOB ->Close ();
76- };
77-
78- if (const auto & func = ITS3Params::Instance ().chipResponseFunction ; func == " Alpide" ) {
79- constexpr const char * responseFile = " $(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
80- loadSetResponseFunc (responseFile, " response0" , responseFile, " response0" );
81- mSimRespIBScaleX = o2::itsmft::SegmentationAlpide::PitchRow / SegmentationIB::PitchRow;
82- mSimRespIBScaleZ = o2::itsmft::SegmentationAlpide::PitchCol / SegmentationIB::PitchCol;
83- } else if (func == " APTS" ) {
84- constexpr const char * responseFileIB = " $(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root" ;
85- constexpr const char * responseFileOB = " $(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
86- loadSetResponseFunc (responseFileIB, " response1" , responseFileOB, " response0" );
87- mSimRespIBScaleX = constants::pixelarray::pixels::apts::pitchX / SegmentationIB::PitchRow;
88- mSimRespIBScaleZ = constants::pixelarray::pixels::apts::pitchZ / SegmentationIB::PitchCol;
89- mSimRespIBOrientation = true ;
90- } else {
91- LOGP (fatal, " ResponseFunction '{}' not implemented!" , func);
92- }
93- mSimRespIBShift = mSimRespIB ->getDepthMax () - constants::silicon::thickness / 2 .f ;
94- mSimRespOBShift = mSimRespOB ->getDepthMax () - SegmentationOB::SensorLayerThickness / 2 .f ;
51+ LOGP (fatal, " No response functions set!" );
52+ }
53+ if (const auto & func = ITS3Params::Instance ().chipResponseFunction ; func == " Alpide" ) {
54+ mSimRespIBScaleX = o2::itsmft::SegmentationAlpide::PitchRow / SegmentationIB::PitchRow;
55+ mSimRespIBScaleZ = o2::itsmft::SegmentationAlpide::PitchCol / SegmentationIB::PitchCol;
56+ } else if (func == " APTS" ) {
57+ mSimRespIBScaleX = constants::pixelarray::pixels::apts::pitchX / SegmentationIB::PitchRow;
58+ mSimRespIBScaleZ = constants::pixelarray::pixels::apts::pitchZ / SegmentationIB::PitchCol;
59+ mSimRespIBOrientation = true ;
60+ } else {
61+ LOGP (fatal, " ResponseFunction '{}' not implemented!" , func);
9562 }
63+ mSimRespIB = mParams .getIBSimResponse ();
64+ mSimRespOB = mParams .getOBSimResponse ();
65+ mSimRespIBShift = mSimRespIB ->getDepthMax () - constants::silicon::thickness / 2 .f ;
66+ mSimRespOBShift = mSimRespOB ->getDepthMax () - SegmentationOB::SensorLayerThickness / 2 .f ;
9667
9768 mParams .print ();
9869 LOGP (info, " IB shift = {} ; OB shift = {}" , mSimRespIBShift , mSimRespOBShift );
0 commit comments