File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed
ITSMFT/common/simulation/include/ITSMFTSimulation Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ class AlpideSimResponse
114114
115115 public:
116116 AlpideSimResponse () = default ;
117- ~AlpideSimResponse () = default ;
117+ virtual ~AlpideSimResponse () = default ;
118118
119119 void initData (int tableNumber, std::string dataPath, const bool quiet = true );
120120
@@ -145,7 +145,7 @@ class AlpideSimResponse
145145 const std::string& getColRowDataFmt () const { return mColRowDataFmt ; }
146146 void print () const ;
147147
148- ClassDefNV (AlpideSimResponse, 2 );
148+ ClassDef (AlpideSimResponse, 2 );
149149};
150150
151151// -----------------------------------------------------
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ class ChipSimResponse : public o2::itsmft::AlpideSimResponse
2424 public:
2525 ChipSimResponse () = default ;
2626 ChipSimResponse (const ChipSimResponse& other) = default ;
27+ ChipSimResponse (const o2::itsmft::AlpideSimResponse* base) : o2::itsmft::AlpideSimResponse(*base) {}
2728
2829 float getRespCentreDep () const { return mRespCentreDep ; }
2930 void computeCentreFromData ();
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ class Digitizer : public TObject
4242 using ExtraDig = std::vector<itsmft::PreDigitLabelRef>; // /< container for extra contributions to PreDigits
4343
4444 public:
45+ ~Digitizer ();
46+
4547 void setDigits (std::vector<o2::itsmft::Digit>* dig) { mDigits = dig; }
4648 void setMCLabels (o2::dataformats::MCTruthContainer<o2::MCCompLabel>* mclb) { mMCLabels = mclb; }
4749 void setROFRecords (std::vector<o2::itsmft::ROFRecord>* rec) { mROFRecords = rec; }
Original file line number Diff line number Diff line change 1212// / \file Digitizer.cxx
1313// / \brief Implementation of the ITS3 digitizer
1414
15+ #include " ITS3Simulation/ChipSimResponse.h"
1516#include " ITSMFTBase/SegmentationAlpide.h"
1617#include " ITS3Simulation/Digitizer.h"
1718#include " ITS3Base/ITS3Params.h"
@@ -34,6 +35,11 @@ using o2::itsmft::PreDigit;
3435
3536using namespace o2 ::its3;
3637
38+ Digitizer::~Digitizer ()
39+ {
40+ delete mSimRespIB ;
41+ }
42+
3743void Digitizer::init ()
3844{
3945 const int numOfChips = mGeometry ->getNumberOfChips ();
@@ -57,8 +63,14 @@ void Digitizer::init()
5763 if (!fOB || fOB ->IsZombie () || !fOB ->IsOpen ()) {
5864 LOGP (fatal, " Cannot open file {}" , fileOB);
5965 }
60- mParams .setIBSimResponse (mSimRespIB = fIB ->Get <o2::its3::ChipSimResponse>(nameIB));
61- mParams .setOBSimResponse (mSimRespOB = fOB ->Get <o2::itsmft::AlpideSimResponse>(nameOB));
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 );
6274 fIB ->Close ();
6375 fOB ->Close ();
6476 };
You can’t perform that action at this time.
0 commit comments