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 /** ROOT macro for the implementation of ROOT specific class methods */
42 ClassImp(AliHLTTPCRunStatisticsProducerComponent)
44 // ------------------------------------------------------------------------------------------
45 AliHLTTPCRunStatisticsProducerComponent::AliHLTTPCRunStatisticsProducerComponent() :
49 // see header file for class documentation
51 // refer to README to build package
53 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
56 // ------------------------------------------------------------------------------------------
57 AliHLTTPCRunStatisticsProducerComponent::~AliHLTTPCRunStatisticsProducerComponent() {
58 // see header file for class documentation
61 // ------------------------------------------------------------------------------------------
62 const char* AliHLTTPCRunStatisticsProducerComponent::GetComponentID() {
63 // see header file for class documentation
64 return "TPCRunStatisticsProducer";
67 // ------------------------------------------------------------------------------------------
68 void AliHLTTPCRunStatisticsProducerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list) {
69 // see header file for class documentation
72 list.push_back( kAliHLTDataTypeEventStatistics );
75 // ------------------------------------------------------------------------------------------
76 AliHLTComponentDataType AliHLTTPCRunStatisticsProducerComponent::GetOutputDataType() {
77 // see header file for class documentation
79 return kAliHLTDataTypeRunStatistics|kAliHLTDataOriginTPC;
82 // ------------------------------------------------------------------------------------------
83 void AliHLTTPCRunStatisticsProducerComponent::GetOutputDataSize( unsigned long& constBase,
84 double& inputMultiplier ) {
85 // see header file for class documentation
87 constBase = sizeof( AliHLTTPCRunStatistics );
88 inputMultiplier = 0.0;
91 // ------------------------------------------------------------------------------------------
92 AliHLTComponent* AliHLTTPCRunStatisticsProducerComponent::Spawn() {
93 // Spawn function, return new instance of this class
94 // see header file for class documentation
96 return new AliHLTTPCRunStatisticsProducerComponent;
99 // ------------------------------------------------------------------------------------------
100 Int_t AliHLTTPCRunStatisticsProducerComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
101 // see header file for class documentation
108 fRunStat = new AliHLTTPCRunStatistics();
113 // ------------------------------------------------------------------------------------------
114 Int_t AliHLTTPCRunStatisticsProducerComponent::DoDeinit() {
115 // see header file for class documentation
124 // ------------------------------------------------------------------------------------------
125 Int_t AliHLTTPCRunStatisticsProducerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/,
126 AliHLTComponentTriggerData& /*trigData*/ ) {
127 // see header file for class documentation
129 // ** Process EventStatistics Block
130 AliHLTTPCEventStatistics* evStat = (AliHLTTPCEventStatistics*) GetFirstInputObject ( kAliHLTDataTypeEventStatistics|kAliHLTDataOriginTPC,
131 "AliHLTTPCEventStatistics" );
133 ProcessEventStatistics ( evStat );
136 fRunStat->SetDetectorName("TPC");
139 fRunStat->SetClusterThreshold( evStat->GetClusterThreshold() );
142 // ** increase number of events
143 fRunStat->AddNEvents();
146 PushBack ( (TObject*) GetRunStatistics(), sizeof(AliHLTTPCRunStatistics), kAliHLTDataTypeRunStatistics|kAliHLTDataOriginTPC, (AliHLTUInt32_t) 0 );
151 // -- **********************************************************************************************
152 // -- ******************************* Processing Functions **************************************
153 // -- **********************************************************************************************
155 // -- **********************************************************************************************
156 void AliHLTTPCRunStatisticsProducerComponent::ProcessEventStatistics( AliHLTTPCEventStatistics* evStat ) {
157 // see header file for class documentation
159 // ** add number of total tracks
160 fRunStat->AddNTotalTracks( evStat->GetNTotalTracks() );
162 // ** add number of long tracks ( tracks above cluster threshold )
163 fRunStat->AddNTracksAboveClusterThreshold( evStat->GetNTracksAboveClusterThreshold() );
165 // ** add number of total clusters
166 fRunStat->AddNTotalCluster( evStat->GetNTotalCluster() );
168 // ** add number of cluster used in tracks
169 fRunStat->AddNUsedCluster( evStat->GetNUsedCluster() );
171 // ** add number of average clusters per track
172 fRunStat->AddAvgClusterPerTrack( evStat->GetAvgClusterPerTrack() );