]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/calibration/AliHLTTPCCalibTimeComponent.h
correcting memory leaks on error conditions
[u/mrichter/AliRoot.git] / HLT / TPCLib / calibration / AliHLTTPCCalibTimeComponent.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTTPCCALIBTIMECOMPONENT_H
4 #define ALIHLTTPCCALIBTIMECOMPONENT_H
5
6 /* This file is property of and copyright by the ALICE HLT Project        * 
7  * ALICE Experiment at CERN, All rights reserved.                         *
8  * See cxx source for full Copyright notice                               */
9
10 /** @file   AliHLTTPCCalibTimeComponent.h
11     @author Kalliopi Kanaki
12     @date   2009-07-08
13     @brief  A calibration component for interfacing the offline calculation of TPC drift velocity correction
14 */
15
16 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt   
21
22 #include "AliHLTCalibrationProcessor.h"
23
24 class AliTPCcalibTime;
25 class AliTPCcalibCalib;
26 class AliESDEvent;
27 class AliESDtrack;
28 class AliESDfriend;
29 class TObjArray;
30 class AliTPCclusterMI;
31
32 /**
33  * @class AliHLTTPCCalibTimeComponent
34  * 
35  * Interface of the offline algorithm (AliTPCcalibTime) for estimating the 
36  * drift velocity for changes of p and T as a function of
37  * time.
38  *
39  * @ingroup alihlt_tpc_components
40  */
41 class AliHLTTPCCalibTimeComponent : public AliHLTCalibrationProcessor
42     {
43     public:
44       /** constructor */
45       AliHLTTPCCalibTimeComponent();
46       /** destructor */
47       virtual ~AliHLTTPCCalibTimeComponent();
48       
49       /** the name of the component registered in macros and configurations */
50       const char* GetComponentID();
51       
52       /** the data types the component subscribes to in memory */
53       void GetInputDataTypes( vector<AliHLTComponentDataType>& list); 
54       
55       /** the data type the component produces */
56       AliHLTComponentDataType GetOutputDataType();
57       
58       /** the size of the output data buffer */
59       virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
60       AliHLTComponent* Spawn();
61
62     protected:
63
64       using AliHLTCalibrationProcessor::ProcessCalibration;
65       using AliHLTCalibrationProcessor::ShipDataToFXS;
66       
67       // Protected functions to implement AliHLTComponent's interface.
68       // These functions provide initialization as well as the actual processing
69       // capabilities of the component. 
70       
71       /** Initialize the calibration component */
72       Int_t InitCalibration();
73
74       /** Scan commandline arguments of the calibration component */
75       Int_t ScanConfigurationArgument( Int_t argc, const char** argv );
76
77       /** Clean up memory at the end of the run */
78       Int_t DeinitCalibration();
79
80       /** Process the data in the calibration component, called once per event */
81       Int_t ProcessCalibration( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
82       
83       /** inherited from AliHLTComponent: handle re-configuration event */
84       int Reconfigure(const char* cdbEntry, const char* chainId);
85
86       /** Ship the data to the FXS at end of run or event modulo (the first by default, the latter to be implemented if necessary). */
87       Int_t ShipDataToFXS( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData );
88
89     private:
90       
91       /** copy constructor prohibited */
92       AliHLTTPCCalibTimeComponent(const AliHLTTPCCalibTimeComponent&);
93       
94       /** assignment operator prohibited */
95       AliHLTTPCCalibTimeComponent& operator=(const AliHLTTPCCalibTimeComponent&);
96
97       AliTPCcalibTime  *fCalibTime; //!transient
98       AliTPCcalibCalib *fCal;       //!transient
99       AliESDEvent      *fESDevent;  //!transient
100       AliESDtrack      *fESDtrack;  //!transient
101       AliESDfriend     *fESDfriend; //!transient
102       TObjArray        *fSeedArray; //!transient
103       AliHLTUInt32_t    fOutputSize;// output size
104       
105       static const Int_t fkNPartition = 36*6; // number of partitions in TPC
106       AliTPCclusterMI   *fPartitionClusters[fkNPartition];  //! arrays of cluster data for each TPC partition
107       Int_t              fNPartitionClusters[fkNPartition]; //! number of clusters for each TPC partition
108
109       /** the default configuration entry for this component */
110       static const char* fgkOCDBEntry; //!transient
111
112       ClassDef(AliHLTTPCCalibTimeComponent, 5)
113     };
114 #endif