]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTPluginBase.cxx
bugfix: suppress points without associated track point in residual calculation
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTPluginBase.cxx
1 // $Id$
2
3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project        * 
5 //* ALICE Experiment at CERN, All rights reserved.                         *
6 //*                                                                        *
7 //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
8 //*                  for The ALICE HLT Project.                            *
9 //*                                                                        *
10 //* Permission to use, copy, modify and distribute this software and its   *
11 //* documentation strictly for non-commercial purposes is hereby granted   *
12 //* without fee, provided that the above copyright notice appears in all   *
13 //* copies and that both the copyright notice and this permission notice   *
14 //* appear in the supporting documentation. The authors make no claims     *
15 //* about the suitability of this software for any purpose. It is          *
16 //* provided "as is" without express or implied warranty.                  *
17 //**************************************************************************
18
19 /** @file   AliHLTPluginBase.cxx
20     @author Matthias Richter
21     @date   
22     @brief  Base class for AliRoot HLT plugins.
23 */
24
25 #include "AliHLTPluginBase.h"
26 #include "AliHLTSystem.h"
27 #include "AliHLTDataBuffer.h"
28
29 /** ROOT macro for the implementation of ROOT specific class methods */
30 ClassImp(AliHLTPluginBase)
31
32 AliHLTPluginBase::AliHLTPluginBase()
33 {
34   // see header file for class documentation
35   // or
36   // refer to README to build package
37   // or
38   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
39   fNofInstances++;
40 }
41
42 AliHLTPluginBase::~AliHLTPluginBase()
43 {
44   // see header file for class documentation
45   if (--fNofInstances<=0) {
46     delete fpSystem;
47
48     // 2010-04-07 not sure whether this is the best place for
49     // the global cleanup of memory pages. In case of AliReconstruction
50     // there is no cleanup method for the reconstructor plugins. They
51     // are just deleted at the end.
52     // However, here we can assume that some global cleanup takes place
53     // when we arrive at this point.
54     AliHLTDataBuffer::AliHLTRawPage::GlobalClean();
55   }
56   fpSystem=NULL;
57 }
58
59 void AliHLTPluginBase::InitInstance()
60 {
61   // see header file for class documentation
62   if (!fpSystem) fpSystem=new AliHLTSystem;
63 }
64
65 AliHLTSystem* AliHLTPluginBase::GetInstance()
66 {
67   // see header file for class documentation
68   if (!fpSystem) InitInstance();
69   return fpSystem;
70 }
71
72
73 AliHLTSystem* AliHLTPluginBase::fpSystem=NULL;
74
75 int AliHLTPluginBase::fNofInstances=0;