3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Jochen Thaeder <thaeder@kip.uni-heidelberg.de> *
8 * for The ALICE HLT Project. *
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 **************************************************************************/
19 /** @file AliHLTTPCRunStatisticsProducerComponent.cxx
20 @author Jochen Thaeder
22 @brief Component for the @see AliHLTTPCEventStatisticsProducer class
25 // see header file for class documentation
27 // refer to README to build package
29 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
35 #include "AliHLTTPCRunStatisticsProducerComponent.h"
36 #include "AliHLTTPCEventStatistics.h"
41 // ** This is a global object used for automatic component registration, do not use this
42 AliHLTTPCRunStatisticsProducerComponent gAliHLTTPCRunStatisticsProducerComponent;
44 ClassImp(AliHLTTPCRunStatisticsProducerComponent)
46 // ------------------------------------------------------------------------------------------
47 AliHLTTPCRunStatisticsProducerComponent::AliHLTTPCRunStatisticsProducerComponent() :
51 // see header file for class documentation
53 // refer to README to build package
55 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
58 // ------------------------------------------------------------------------------------------
59 AliHLTTPCRunStatisticsProducerComponent::~AliHLTTPCRunStatisticsProducerComponent() {
60 // see header file for class documentation
63 // ------------------------------------------------------------------------------------------
64 const char* AliHLTTPCRunStatisticsProducerComponent::GetComponentID() {
65 // see header file for class documentation
66 return "TPCRunStatisticsProducer";
69 // ------------------------------------------------------------------------------------------
70 void AliHLTTPCRunStatisticsProducerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list) {
71 // see header file for class documentation
74 list.push_back( kAliHLTDataTypeEventStatistics );
77 // ------------------------------------------------------------------------------------------
78 AliHLTComponentDataType AliHLTTPCRunStatisticsProducerComponent::GetOutputDataType() {
79 // see header file for class documentation
81 return kAliHLTDataTypeRunStatistics|kAliHLTDataOriginTPC;
84 // ------------------------------------------------------------------------------------------
85 void AliHLTTPCRunStatisticsProducerComponent::GetOutputDataSize( unsigned long& constBase,
86 double& inputMultiplier ) {
87 // see header file for class documentation
89 constBase = sizeof( AliHLTTPCRunStatistics );
90 inputMultiplier = 0.0;
93 // ------------------------------------------------------------------------------------------
94 AliHLTComponent* AliHLTTPCRunStatisticsProducerComponent::Spawn() {
95 // Spawn function, return new instance of this class
96 // see header file for class documentation
98 return new AliHLTTPCRunStatisticsProducerComponent;
101 // ------------------------------------------------------------------------------------------
102 Int_t AliHLTTPCRunStatisticsProducerComponent::DoInit( int argc, const char** argv ) {
103 // see header file for class documentation
110 fRunStat = new AliHLTTPCRunStatistics();
115 // ------------------------------------------------------------------------------------------
116 Int_t AliHLTTPCRunStatisticsProducerComponent::DoDeinit() {
117 // see header file for class documentation
126 // ------------------------------------------------------------------------------------------
127 Int_t AliHLTTPCRunStatisticsProducerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& trigData ) {
128 // see header file for class documentation
130 // ** Process EventStatistics Block
131 AliHLTTPCEventStatistics* evStat = (AliHLTTPCEventStatistics*) GetFirstInputObject ( kAliHLTDataTypeEventStatistics|kAliHLTDataOriginTPC,
132 "AliHLTTPCEventStatistics" );
134 ProcessEventStatistics ( evStat );
137 fRunStat->SetDetectorName("TPC");
140 fRunStat->SetClusterThreshold( evStat->GetClusterThreshold() );
143 // ** increase number of events
144 fRunStat->AddNEvents();
147 PushBack ( (TObject*) GetRunStatistics(), sizeof(AliHLTTPCRunStatistics), kAliHLTDataTypeRunStatistics|kAliHLTDataOriginTPC, (AliHLTUInt32_t) 0 );
152 // -- **********************************************************************************************
153 // -- ******************************* Processing Functions **************************************
154 // -- **********************************************************************************************
156 // -- **********************************************************************************************
157 void AliHLTTPCRunStatisticsProducerComponent::ProcessEventStatistics( AliHLTTPCEventStatistics* evStat ) {
158 // see header file for class documentation
160 // ** add number of total tracks
161 fRunStat->AddNTotalTracks( evStat->GetNTotalTracks() );
163 // ** add number of long tracks ( tracks above cluster threshold )
164 fRunStat->AddNTracksAboveClusterThreshold( evStat->GetNTracksAboveClusterThreshold() );
166 // ** add number of total clusters
167 fRunStat->AddNTotalCluster( evStat->GetNTotalCluster() );
169 // ** add number of cluster used in tracks
170 fRunStat->AddNUsedCluster( evStat->GetNUsedCluster() );
172 // ** add number of average clusters per track
173 fRunStat->AddAvgClusterPerTrack( evStat->GetAvgClusterPerTrack() );