]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/EMCAL/AliHLTEMCALClusterizerComponent.cxx
new centrality selection
[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
46 AliHLTEMCALClusterizerComponent gAliHLTEMCALClusterizerComponent;
47
48 AliHLTEMCALClusterizerComponent::AliHLTEMCALClusterizerComponent(): 
49   AliHLTCaloClusterizerComponent("EMCAL")
50 {
51   //See headerfile for documentation
52
53   fDataOrigin = const_cast<char*>(kAliHLTDataOriginEMCAL);
54
55   //AliHLTEMCALGeometry *geom = new AliHLTEMCALGeometry;
56   
57   
58 }
59
60 AliHLTEMCALClusterizerComponent::~AliHLTEMCALClusterizerComponent()
61 {
62   //See headerfile for documentation
63 }
64
65 void
66 AliHLTEMCALClusterizerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
67 {
68   //See headerfile for documentation
69   list.clear();
70   //list.push_back(AliHLTCaloDefinitions::fgkDigitDataType|kAliHLTDataOriginEMCAL);
71   list.push_back(AliHLTEMCALDefinitions::fgkDigitDataType);
72 }
73
74 AliHLTComponentDataType
75 AliHLTEMCALClusterizerComponent::GetOutputDataType()
76 {
77   //See headerfile for documentation
78   return kAliHLTDataTypeCaloCluster|kAliHLTDataOriginEMCAL;
79 }
80
81 void
82 AliHLTEMCALClusterizerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier )
83
84 {
85   //See headerfile for documentation
86   constBase = sizeof(AliHLTCaloRecPointHeaderStruct) + sizeof(AliHLTCaloRecPointDataStruct) + (sizeof(AliHLTCaloDigitDataStruct) << 7); //Reasonable estimate... ;
87   inputMultiplier = 2.0;
88 }
89
90
91 const Char_t*
92 AliHLTEMCALClusterizerComponent::GetComponentID()
93 {
94   //See headerfile for documentation
95   return "EmcalClusterizer";
96 }
97
98 AliHLTComponent*
99 AliHLTEMCALClusterizerComponent::Spawn()
100 {
101   //See headerfile for documentation
102
103   return new AliHLTEMCALClusterizerComponent();
104 }
105 int AliHLTEMCALClusterizerComponent::DoInit(int argc, const char** argv)
106 {
107    fClusterizerPtr = new AliHLTCaloClusterizer("EMCAL");
108    
109    fRecoParamsPtr = new AliHLTEMCALRecoParamHandler();
110
111     return AliHLTCaloClusterizerComponent::DoInit(argc, argv);
112 }
113
114 int AliHLTEMCALClusterizerComponent::DoDeinit()
115 {
116    if(fRecoParamsPtr)
117    {
118       delete fRecoParamsPtr;
119       fRecoParamsPtr = 0;
120    }
121     return AliHLTCaloClusterizerComponent::DoDeinit();
122 }
123
124
125 int AliHLTEMCALClusterizerComponent::InitialiseGeometry()
126 {
127         fAnalyserPtr->SetGeometry(new AliHLTEMCALGeometry());
128
129         return 0;
130 }