Here I have a question more related to c++ than ROOT itself I would say, but I spent hours online look for an answer to this but without any success yet. So I hope you can help me to find my way
Well, the idea is : I would like to create a function that returns an object like TH1F*[2][3]. Here is what I currently have
The compilation fails and I am not surprised since TH1F [2][3] is not TH1F*.
But I also tried to change the function return into : TH1F ArrayManager::myHisto()[2][3]*
and it still does not want to compile. So I tried different things to return my TH1F *[2][3] but nothing successful yet. Of course you would have noticed that my understanding of pointer and arrays is limited but I couldn’t find any answer online to this problem yet, this is why I am asking for your help.
C++ function can not return arrays (they could return a pointer to an array then the array would need to be allocated on the heap and getting the syntax correct is tricky).
I recommend you either use vector<vector<TH1F*>> or write a small class that contains the array (and then you can return a pointer to that class).
BTW. When you post “source code” or “output” here, do remember to enclose them into two lines which contain just three characters ``` (see how your posts have been edited above).