GSI Forum - RDF feed
type: channel
description: GSI Helmholtzzentrum für Schwerionenforschung
items: Error matrix for EMC
items: Re: Error matrix for EMC

Error matrix for EMC
type: item
description: Dear colleagues, I have commited some code related to EMC error matrix calculation and treatment. So far parametrization of error matrix was hardcoded with parameters obtained by Marc Pelizaeus in Babar framework. My modification are based on the code from Marc and include possibility to use different parameters for different EMC geometries and include macro to recalculate parameters if some modification in EMC geometry are introduced (with as the most obvious example - inclusion of dead material). I have created a PndEmcErrorMatrixPar class to store these parameters in RTDB in object PndEmcErrorMatrixParObject. PndEmcErrorMatrix perform actual calculation of error matrix for given EmcCluster using its energy in method PndEmcErrorMatrix::Get4MomentumErrorMatrix(const PndEmcCluster &cluster) PndEmcErrorMatrix needs parametrs in the object PndEmcErrorMatrixParObject, which can be obtained from RTDB or root file. Therefore there are 2 methods of its initialization PndEmcErrorMatrix::Init(PndEmcErrorMatrixParObject *par) or PndEmcErrorMatrix::InitFromFile(Int_t geomVersion) geomVersion is parameter stored in RTDB in EMC simulation and depending on EMC geometry version, error matrix is initialised from different files, which names are hardcoded in PndEmcErrorMatrix::InitFromFile(). The place where error matrix is actually calculated in the code is PndPidCorrelator::ConstructNeutralCandidate(). I have attached a modified version of PndPidCorrelator.cxx, PndPidCorrelator.h, /pid/CMakeLists.txt and I would like to ask Stefano to commit my changes there, since I do not have write permission to /pid/ directory. In addition there two files with parameters emc_error_matrix_default.root and emc_error_matrix_1.root, which should be placed to /input/ directory. There are 3 macro added to /macro/emc/dedicated/: fill_error_matrix_param.C create root file (emc_error_matrix_default.root) with parameters, taken from Babar framework. error_matrix_data_production.C(Int_t emcGeometry=17, …
creator: Dima Melnychuk
date: 2010-10-01T13:13:12-00:00

Re: Error matrix for EMC
type: item
description: Hi Dima! I've got the error after update: class PndEmcBump has no member named 'Get4MomentumErrorMatrix' in PndPidCorrelator.cxx line 484. Dmitry
creator: Dmitry Morozov
date: 2010-10-04T07:05:12-00:00

Re: Error matrix for EMC
type: item
description: This is known. I should update the correlator but I had no time last week.
creator: StefanoSpataro
date: 2010-10-04T07:22:01-00:00

Re: Error matrix for EMC
type: item
description: I have committed the PndPidCorrelator and updated the code. At GSI I have the following error in compilation: [ 60%] Building CXX object emc/CMakeFiles/Emc.dir/EmcReco/PndEmcErrorMatrix.o /d/panda02/spataro/pandaroot/emc/EmcReco/PndEmcErrorMatrix.cxx: In member function 'TMatrixD PndEmcErrorMatrix::GetErrorMatrix(const PndEmcCluster&) const': /d/panda02/spataro/pandaroot/emc/EmcReco/PndEmcErrorMatrix.cxx:85: error: 'abort' was not declared in this scope make[2]: *** [emc/CMakeFiles/Emc.dir/EmcReco/PndEmcErrorMatrix.o] Error 1 make[1]: *** [emc/CMakeFiles/Emc.dir/all] Error 2 It seems abort() is not accepted by all the compilers. Would it be possible to return something else? Has someone else the same crash?
creator: StefanoSpataro
date: 2010-10-04T08:30:44-00:00

Re: Error matrix for EMC
type: item
description: Yes, Stefano, I have the same error Dmitry
creator: Dmitry Morozov
date: 2010-10-04T08:42:13-00:00

Re: Error matrix for EMC
type: item
description: Hi Stefano, Here I have the same problem. The solution is adding #include <cstdlib> or #include <stdlib.h> to PndEmcErrorMatrix.h. Because we use C++, I would prefer the first one. But the question remains if we need to use abort(). According to the documentation: ====================== Aborts the process with an abnormal program termination. The function generates the SIGABRT signal, which by default causes the program to terminate returning an unsuccessful termination error code to the host environment. The program is terminated without executing destructors for objects of automatic or static storage duration, and without calling any atexit function. The function never returns to its caller. ====================== I have not looked into the source code yet, but in the most cases, it is not a good idea to use abort(). btw. should I add the lines to the headers and submit? /M
creator: M.Babai
date: 2010-10-04T08:50:44-00:00

Re: Error matrix for EMC
type: item
description: Hi, I have added #include <cstdlib> to PndEmcErrorMatrix.h but I cannot check by myselfe if it eliminates error, since I didn't have it. Concerning the question of using abort() at all, I do not insist on it. I put it to catch unexpected run-time behaviour and would like to avoid complicated exception handling. Suggestions about better alternatives will be accepted. In addition I have added root files with parameters input/emc_error_matrix_default.root input/emc_error_matrix_1.root Best regards, Dima
creator: Dima Melnychuk
date: 2010-10-04T09:40:23-00:00

Re: Error matrix for EMC
type: item
description: Hi Dima, I think it should be added to PndEmcErrorMatrixPar.h as well. At least this two additions solve the problem for me here. I think exit() is a better option. At least according to the documentation: ================ Terminates the process normally, performing the regular cleanup for terminating processes. First, all functions registered by calls to atexit are executed in the reverse order of their registration. Then, all streams are closed and the temporary files deleted, and finally the control is returned to the host environment. The status argument is returned to the host environment. ================= Best regards, M
creator: M.Babai
date: 2010-10-04T09:56:31-00:00

Re: Error matrix for EMC
type: item
description: Hi Mohammad, I have found the following arguments to prefer abort() over exit(), which are suitable in this case. Quote: If there is a (critical) error and you call exit(), then you won't know where the error occurred (the program will exit cleanly). If you call abort(), you'll be able to catch the error at the point where it occurs. It's a debugging aid, which is why it's normally called by assert(). And I have added #include <cstdlib> to PndEmcErrorMatrixPar.h as well. Dima
creator: Dima Melnychuk
date: 2010-10-04T10:10:53-00:00

Re: Error matrix for EMC
type: item
description: Hi Dima, Thank you!. For me the error is gone now. I will run an experimental build. M
creator: M.Babai
date: 2010-10-04T10:21:02-00:00

Re: Error matrix for EMC
type: item
description: It is gone also for me. Thanks.
creator: StefanoSpataro
date: 2010-10-04T10:53:25-00:00