]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSHistogramProducerComponent.cxx
Removing man in the middle classes. They will be implemnted
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSHistogramProducerComponent.cxx
CommitLineData
1b41ab20 1// $Id$
2
9bf87c6f 3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
6 * *
7 * Primary Authors: Oystein Djuvsland *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18#include "AliHLTPHOSHistogramProducerComponent.h"
19#include "AliHLTPHOSProcessor.h"
20#include "TH1D.h"
21#include "TNtuple.h"
87434909 22#include "TFile.h"
9bf87c6f 23#include "AliHLTPHOSHistogramProducer.h"
87434909 24#include "AliHLTPHOSPhysicsHistogramProducer.h"
9bf87c6f 25#include "AliHLTPHOSCaloClusterContainerStruct.h"
87434909 26#include "TClonesArray.h"
ed95031f 27#include "AliHLTPHOSHistoProdCellEnergy.h"
28#include "AliHLTPHOSHistoProdClusterEnergy.h"
29#include "AliHLTPHOSHistoProdInvMass.h"
30#include "AliHLTPHOSHistoProdMatchedTracks.h"
31
9bf87c6f 32/**
33 * @file AliHLTPHOSHistogramProducerComponent.cxx
34 * @author Oystein Djuvsland
35 * @date
87434909 36 * @brief A histogram producer component for PHOS HLT
9bf87c6f 37*/
38
39// see below for class documentation
40// or
41// refer to README to build package
42// or
43// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
44
45
9bf87c6f 46AliHLTPHOSHistogramProducerComponent gAliHLTPHOSHistogramProducerComponent;
47
48AliHLTPHOSHistogramProducerComponent::AliHLTPHOSHistogramProducerComponent() :
49 AliHLTPHOSProcessor(),
87434909 50 fPhysicsHistogramProducerPtr(0),
f1bfc65f 51 fPushModulo(1),
52 fCellEnergy(0),
53 fClusterEnergy(0),
54 fInvariantMass(0),
55 fMatchedTracks(0),
56 fCellEnergyHistProducer(0),
57 fClusterEnergyHistProducer(0),
58 fInvariantMassHistProducer(0),
59 fMatchedTracksHistProducer(0)
60
9bf87c6f 61{
62 //see header file for documentation
63}
64
65AliHLTPHOSHistogramProducerComponent::~AliHLTPHOSHistogramProducerComponent()
66{
67 //see header file for documentation
68}
69
70int
71AliHLTPHOSHistogramProducerComponent::Deinit()
72{
73 //see header file for documentation
87434909 74 if(fPhysicsHistogramProducerPtr != 0)
75 {
76 delete fPhysicsHistogramProducerPtr;
77 fPhysicsHistogramProducerPtr = 0;
78 }
79
e304ea31 80 return 0;
9bf87c6f 81}
82
83const char*
84AliHLTPHOSHistogramProducerComponent::GetComponentID()
85{
86 //see header file for documentation
87 return "PhosHistoProducer";
88}
89
90
91void
92AliHLTPHOSHistogramProducerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
93{
94 //see header file for documentation
95 list.clear();
87434909 96 list.push_back(AliHLTPHOSDefinitions::fgkESDCaloClusterDataType);
97 list.push_back(AliHLTPHOSDefinitions::fgkESDCaloCellsDataType);
9bf87c6f 98
9bf87c6f 99}
100
101AliHLTComponentDataType
102AliHLTPHOSHistogramProducerComponent::GetOutputDataType()
103{
104 //see header file for documentation
105 return AliHLTPHOSDefinitions::fgkPhosHistDataType;
106}
107
108
109void
110AliHLTPHOSHistogramProducerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
111{
112 //see header file for documentation
113 constBase = 30;
114 inputMultiplier = 5;
115}
116
117// int
118// AliHLTPHOSHistogramProducerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
119// AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
120// std::vector<AliHLTComponentBlockData>& outputBlocks)
121
122int
fc7132e2 123AliHLTPHOSHistogramProducerComponent::DoEvent(const AliHLTComponentEventData& /*evtData*/,
e304ea31 124 AliHLTComponentTriggerData& /*trigData*/)
9bf87c6f 125
126
127{
128 //see header file for documentation
ee24aae2 129 for (const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeCaloCluster | kAliHLTDataOriginPHOS); pBlock!=NULL; pBlock=GetNextInputBlock())
9bf87c6f 130 {
ee24aae2 131 AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(pBlock->fPtr);
132
133 if(fCellEnergy)
134 {
135 fCellEnergyHistProducer->DoEvent(caloClusterHeaderPtr);
136 }
137 if(fClusterEnergy)
138 {
139 fClusterEnergyHistProducer->DoEvent(caloClusterHeaderPtr);
140 }
141 if(fInvariantMass)
142 {
143 fInvariantMassHistProducer->DoEvent(caloClusterHeaderPtr);
144 }
145 if(fMatchedTracks)
146 {
147 fMatchedTracksHistProducer->DoEvent(caloClusterHeaderPtr);
148 }
9bf87c6f 149 }
ee24aae2 150 if(fCellEnergy)
9bf87c6f 151 {
ee24aae2 152 PushBack(fCellEnergyHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
153 }
154 if(fClusterEnergy)
155 {
156 PushBack(fClusterEnergyHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
9bf87c6f 157 }
ee24aae2 158 if(fInvariantMass)
159 {
160 PushBack(fInvariantMassHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
161 }
162 if(fMatchedTracks)
163 {
164 PushBack(fMatchedTracksHistProducer->GetHistograms(), AliHLTPHOSDefinitions::fgkPhysicsHistogramsDataType);
165 }
166
9bf87c6f 167 return 0;
168}
169
170
171int
172AliHLTPHOSHistogramProducerComponent::DoInit(int argc, const char** argv )
173{
174 //see header file for documentation
175
ee24aae2 176
9bf87c6f 177 for(int i = 0; i < argc; i++)
178 {
ee24aae2 179 if(!strcmp("-cellenergy", argv[i+1])) fCellEnergy = true;
180 if(!strcmp("-clusterenergy", argv[i+1])) fClusterEnergy = true;
181 if(!strcmp("-invariantmass", argv[i+1])) fInvariantMass= true;
182 if(!strcmp("-matchedtracks", argv[i+1])) fMatchedTracks = true;
183 }
184
185 if(fCellEnergy)
186 {
187 fCellEnergyHistProducer = new AliHLTPHOSHistoProdCellEnergy();
188 }
189 if(fClusterEnergy)
190 {
191 fClusterEnergyHistProducer = new AliHLTPHOSHistoProdClusterEnergy();
192 }
193 if(fInvariantMass)
194 {
195 fInvariantMassHistProducer = new AliHLTPHOSHistoProdInvMass();
196 }
197 if(fMatchedTracks)
198 {
199 fMatchedTracksHistProducer = new AliHLTPHOSHistoProdMatchedTracks();
9bf87c6f 200 }
9bf87c6f 201
202 return 0;
203}
204
205AliHLTComponent*
206AliHLTPHOSHistogramProducerComponent::Spawn()
207{
208 //see header file for documentation
209 return new AliHLTPHOSHistogramProducerComponent();
210}
211