]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/EMCAL/AliHLTEMCALClusterizerComponent.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / HLT / EMCAL / AliHLTEMCALClusterizerComponent.cxx
1 // $Id$
2
3 /**************************************************************************
4  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  *                                                                        *
6  * Authors: Oystein Djuvsland <oysteind@ift.uib.no>                       *
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * `documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 #include <iostream>
18
19 #include "AliHLTEMCALClusterizerComponent.h"
20 #include "AliHLTCaloRecPointDataStruct.h"
21 #include "AliHLTCaloRecPointHeaderStruct.h"
22 #include "AliHLTEMCALGeometry.h"
23 #include "AliHLTEMCALRecoParamHandler.h"
24 #include "AliHLTCaloClusterAnalyser.h"
25
26
27
28
29 /** @file   AliHLTEMCALClusterizerComponent.cxx
30     @author Oystein Djuvsland
31     @date   
32     @brief  A clusterizer component for EMCAL HLT
33 */
34
35 // see header file for class documentation
36 // or
37 // refer to README to build package
38 // or
39 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
40
41 #include "AliHLTCaloDefinitions.h"
42 #include "AliHLTEMCALDefinitions.h"
43 #include "AliHLTCaloClusterizer.h"
44
45 AliHLTEMCALClusterizerComponent::AliHLTEMCALClusterizerComponent(): 
46   AliHLTCaloClusterizerComponent("EMCAL")
47 {
48   //See headerfile for documentation
49
50   fDataOrigin = const_cast<char*>(kAliHLTDataOriginEMCAL);
51
52   //AliHLTEMCALGeometry *geom = new AliHLTEMCALGeometry;
53   
54   
55 }
56
57 AliHLTEMCALClusterizerComponent::~AliHLTEMCALClusterizerComponent()
58 {
59   //See headerfile for documentation
60 }
61
62 void
63 AliHLTEMCALClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
64 {
65   //See headerfile for documentation
66   list.clear();
67   //list.push_back(AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginEMCAL);
68   list.push_back(AliHLTEMCALDefinitions::fgkDigitDataType);
69 }
70
71 AliHLTComponentDataType
72 AliHLTEMCALClusterizerComponent::GetOutputDataType()
73 {
74   //See headerfile for documentation
75   return kAliHLTDataTypeCaloCluster|kAliHLTDataOriginEMCAL;
76 }
77
78 void
79 AliHLTEMCALClusterizerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
80
81 {
82   //See headerfile for documentation
83   constBase = sizeof(AliHLTCaloRecPointHeaderStruct) + sizeof(AliHLTCaloRecPointDataStruct) + (sizeof(AliHLTCaloDigitDataStruct) << 7); //Reasonable estimate... ;
84   inputMultiplier = 2.0;
85 }
86
87
88 const Char_t*
89 AliHLTEMCALClusterizerComponent::GetComponentID()
90 {
91   //See headerfile for documentation
92   return "EmcalClusterizer";
93 }
94
95 AliHLTComponent*
96 AliHLTEMCALClusterizerComponent::Spawn()
97 {
98   //See headerfile for documentation
99
100   return new AliHLTEMCALClusterizerComponent();
101 }
102 int AliHLTEMCALClusterizerComponent::DoInit(int argc, const char** argv)
103 {
104    fClusterizerPtr = new AliHLTCaloClusterizer("EMCAL");
105    
106    fRecoParamsPtr = new AliHLTEMCALRecoParamHandler();
107
108     return AliHLTCaloClusterizerComponent::DoInit(argc, argv);
109 }
110
111 int AliHLTEMCALClusterizerComponent::DoDeinit()
112 {
113    if(fRecoParamsPtr)
114    {
115       delete fRecoParamsPtr;
116       fRecoParamsPtr = 0;
117    }
118     return AliHLTCaloClusterizerComponent::DoDeinit();
119 }
120
121
122 int AliHLTEMCALClusterizerComponent::InitialiseGeometry()
123 {
124         fAnalyserPtr->SetGeometry(new AliHLTEMCALGeometry());
125
126         return 0;
127 }