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 AliHLTEventSummaryProducerComponent.cxx
20 @author Jochen Thaeder
22 @brief Produces a event summary as @see AliHLTEventSummary
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 "AliHLTEventSummaryProducerComponent.h"
36 #include "AliHLTTPCEventStatistics.h"
37 #include "AliRawDataHeader.h"
41 // ** This is a global object used for automatic component registration, do not use this
42 AliHLTEventSummaryProducerComponent gAliHLTEventSummaryProducerComponent;
44 ClassImp(AliHLTEventSummaryProducerComponent)
46 // ------------------------------------------------------------------------------------------
47 AliHLTEventSummaryProducerComponent::AliHLTEventSummaryProducerComponent() :
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 AliHLTEventSummaryProducerComponent::~AliHLTEventSummaryProducerComponent() {
58 // see header file for class documentation
61 // ------------------------------------------------------------------------------------------
62 const char* AliHLTEventSummaryProducerComponent::GetComponentID() {
63 // see header file for class documentation
64 return "TriggerEventSummaryProducer";
67 // ------------------------------------------------------------------------------------------
68 void AliHLTEventSummaryProducerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list) {
69 // see header file for class documentation
72 list.push_back( kAliHLTDataTypeEventStatistics );
75 // ------------------------------------------------------------------------------------------
76 AliHLTComponentDataType AliHLTEventSummaryProducerComponent::GetOutputDataType() {
77 // see header file for class documentation
79 return kAliHLTDataTypeEventSummary;
82 // ------------------------------------------------------------------------------------------
83 void AliHLTEventSummaryProducerComponent::GetOutputDataSize( unsigned long& constBase,
84 double& inputMultiplier ) {
85 // see header file for class documentation
87 constBase = sizeof( AliHLTEventSummary );
88 inputMultiplier = 0.0;
91 // ------------------------------------------------------------------------------------------
92 AliHLTComponent* AliHLTEventSummaryProducerComponent::Spawn() {
93 // Spawn function, return new instance of this class
94 // see header file for class documentation
96 return new AliHLTEventSummaryProducerComponent;
100 // ------------------------------------------------------------------------------------------
101 Int_t AliHLTEventSummaryProducerComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
102 // see header file for class documentation
109 // ------------------------------------------------------------------------------------------
110 Int_t AliHLTEventSummaryProducerComponent::DoDeinit() {
111 // see header file for class documentation
114 delete fEventSummary;
115 fEventSummary = NULL;
120 // ------------------------------------------------------------------------------------------
121 Int_t AliHLTEventSummaryProducerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& trigData ) {
122 // see header file for class documentation
125 delete fEventSummary;
127 fEventSummary = new AliHLTEventSummary;
129 const TObject* iter = NULL;
131 // ** Loop over all event statistics input objs and add them to the event summary
132 for ( iter = GetFirstInputObject(kAliHLTDataTypeEventStatistics|kAliHLTDataOriginAny); iter != NULL; iter = GetNextInputObject() ) {
134 fEventSummary->AddDetector( (TObject*) iter );
136 } // for ( iter = GetFirstInputObject(kAliHLTDataTypeEventEventStatistics|kAliHLTDataOriginAny); iter != NULL; iter = GetNextInputObject() ) {
138 // ** Process CTP trigger information
139 ProcessTriggerData( trigData );
141 // ** Set RunType / Run Number
142 fEventSummary->SetRunNumber ( GetRunNo() );
143 fEventSummary->SetRunType ( GetRunType() );
145 // ** PushBack Event Summary
146 PushBack ( (TObject*) fEventSummary, sizeof(AliHLTEventSummary), kAliHLTDataTypeEventSummary, (AliHLTUInt32_t) 0 );
151 // -- **********************************************************************************************
152 // -- ******************************* Processing Functions **************************************
153 // -- **********************************************************************************************
155 // -- **********************************************************************************************
156 void AliHLTEventSummaryProducerComponent::ProcessTriggerData( AliHLTComponentTriggerData& trigData ) {
157 // see header file for class documentation
159 const AliRawDataHeader* cdh = NULL;
160 if (AliHLTComponent::ExtractTriggerData(trigData, NULL, NULL, &cdh, NULL, true) != 0) return;
161 AliHLTUInt64_t triggerClass = cdh->GetTriggerClasses();
162 fEventSummary->SetTriggerClass( triggerClass );