@@ -45,33 +45,31 @@ void Digitizer::init()
4545 }
4646
4747 if (!mParams .hasResponseFunctions ()) {
48- auto loadSetResponseFunc = [&](const char * fileIB, const char * fileOB, const char * name) {
49- const auto & nameIB = ITS3Params::Instance ().responseFunctionIB ;
50- const auto & nameOB = ITS3Params::Instance ().responseFunctionOB ;
51- LOGP (info, " Loading response function for {}: IB={}:{} / OB={}:{}" , name, nameIB, fileIB, nameOB, fileOB);
52- auto fIB = TFile::Open (fileIB);
48+ auto loadSetResponseFunc = [&](const char * name, const char * fileIB, const char * nameIB, const char * fileOB, const char * nameOB) {
49+ LOGP (info, " Loading response function for {}: IB={}:{} ; OB={}:{}" , name, nameIB, fileIB, nameOB, fileOB);
50+ auto fIB = TFile::Open (fileIB, " READ" );
5351 if (fIB ->IsZombie () || !fIB ->IsOpen ()) {
5452 LOGP (fatal, " Cannot open file {}" , fileIB);
5553 }
56- auto fOB = TFile::Open (fileIB);
54+ auto fOB = TFile::Open (fileIB, " READ " );
5755 if (fOB ->IsZombie () || !fOB ->IsOpen ()) {
5856 LOGP (fatal, " Cannot open file {}" , fileOB);
5957 }
60- mParams .setIBSimResponse (mSimRespIB = fIB ->Get <o2::itsmft::AlpideSimResponse>(nameIB. c_str () ));
61- mParams .setOBSimResponse (mSimRespOB = fOB ->Get <o2::itsmft::AlpideSimResponse>(nameOB. c_str () ));
58+ mParams .setIBSimResponse (mSimRespIB = fIB ->Get <o2::itsmft::AlpideSimResponse>(nameIB));
59+ mParams .setOBSimResponse (mSimRespOB = fOB ->Get <o2::itsmft::AlpideSimResponse>(nameOB));
6260 fIB ->Close ();
6361 fOB ->Close ();
6462 };
6563
6664 if (const auto & func = ITS3Params::Instance ().chipResponseFunction ; func == " Alpide" ) {
6765 constexpr const char * responseFile = " $(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
68- loadSetResponseFunc (responseFile, responseFile, " Alpide " );
66+ loadSetResponseFunc (" Alpide " , responseFile, " response0 " , responseFile, " response1 " );
6967 mSimRespIBShift = mSimRespIB ->getDepthMax () - SegmentationMosaix::mSensorLayerThickness / 2 .f ;
7068 mSimRespOBShift = mSimRespOB ->getDepthMax () - Segmentation::SensorLayerThickness / 2 .f ;
7169 } else if (func == " APTS" ) {
72- constexpr const char * responseFileIB = " $(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/" ;
70+ constexpr const char * responseFileIB = " $(O2_ROOT)/share/Detectors/Upgrades/ITS3/data/ITS3ChipResponseData/APTSResponseData.root " ;
7371 constexpr const char * responseFileOB = " $(O2_ROOT)/share/Detectors/ITSMFT/data/AlpideResponseData/AlpideResponseData.root" ;
74- loadSetResponseFunc (responseFileIB, responseFileOB, " APTS " );
72+ loadSetResponseFunc (" APTS " , responseFileIB, " response1 " , responseFileOB, " response1 " );
7573 mSimRespIBShift = mSimRespIB ->getDepthMax () - 10 .e -4f ;
7674 mSimRespOBShift = mSimRespOB ->getDepthMax () - Segmentation::SensorLayerThickness / 2 .f ;
7775 } else {
0 commit comments