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"
40 // ** This is a global object used for automatic component registration, do not use this
41 AliHLTEventSummaryProducerComponent gAliHLTEventSummaryProducerComponent;
43 ClassImp(AliHLTEventSummaryProducerComponent)
45 // ------------------------------------------------------------------------------------------
46 AliHLTEventSummaryProducerComponent::AliHLTEventSummaryProducerComponent() :
48 // see header file for class documentation
50 // refer to README to build package
52 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
55 // ------------------------------------------------------------------------------------------
56 AliHLTEventSummaryProducerComponent::~AliHLTEventSummaryProducerComponent() {
57 // see header file for class documentation
60 // ------------------------------------------------------------------------------------------
61 const char* AliHLTEventSummaryProducerComponent::GetComponentID() {
62 // see header file for class documentation
63 return "TriggerEventSummaryProducer";
66 // ------------------------------------------------------------------------------------------
67 void AliHLTEventSummaryProducerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list) {
68 // see header file for class documentation
71 list.push_back( kAliHLTDataTypeEventStatistics );
74 // ------------------------------------------------------------------------------------------
75 AliHLTComponentDataType AliHLTEventSummaryProducerComponent::GetOutputDataType() {
76 // see header file for class documentation
78 return kAliHLTDataTypeEventSummary;
81 // ------------------------------------------------------------------------------------------
82 void AliHLTEventSummaryProducerComponent::GetOutputDataSize( unsigned long& constBase,
83 double& inputMultiplier ) {
84 // see header file for class documentation
86 constBase = sizeof( AliHLTEventSummary );
87 inputMultiplier = 0.0;
90 // ------------------------------------------------------------------------------------------
91 AliHLTComponent* AliHLTEventSummaryProducerComponent::Spawn() {
92 // Spawn function, return new instance of this class
93 // see header file for class documentation
95 return new AliHLTEventSummaryProducerComponent;
99 // ------------------------------------------------------------------------------------------
100 Int_t AliHLTEventSummaryProducerComponent::DoInit( int /*argc*/, const char** /*argv*/ ) {
101 // see header file for class documentation
108 // ------------------------------------------------------------------------------------------
109 Int_t AliHLTEventSummaryProducerComponent::DoDeinit() {
110 // see header file for class documentation
113 delete fEventSummary;
114 fEventSummary = NULL;
119 // ------------------------------------------------------------------------------------------
120 Int_t AliHLTEventSummaryProducerComponent::DoEvent( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& trigData ) {
121 // see header file for class documentation
124 delete fEventSummary;
126 fEventSummary = new AliHLTEventSummary;
128 const TObject* iter = NULL;
130 // ** Loop over all event statistics input objs and add them to the event summary
131 for ( iter = GetFirstInputObject(kAliHLTDataTypeEventStatistics|kAliHLTDataOriginAny); iter != NULL; iter = GetNextInputObject() ) {
133 fEventSummary->AddDetector( (TObject*) iter );
135 } // for ( iter = GetFirstInputObject(kAliHLTDataTypeEventEventStatistics|kAliHLTDataOriginAny); iter != NULL; iter = GetNextInputObject() ) {
137 // ** Process CTP trigger information
138 ProcessTriggerData( trigData );
140 // ** Set RunType / Run Number
141 fEventSummary->SetRunNumber ( GetRunNo() );
142 fEventSummary->SetRunType ( GetRunType() );
144 // ** PushBack Event Summary
145 PushBack ( (TObject*) fEventSummary, sizeof(AliHLTEventSummary), kAliHLTDataTypeEventSummary, (AliHLTUInt32_t) 0 );
150 // -- **********************************************************************************************
151 // -- ******************************* Processing Functions **************************************
152 // -- **********************************************************************************************
154 // -- **********************************************************************************************
155 void AliHLTEventSummaryProducerComponent::ProcessTriggerData( AliHLTComponentTriggerData& trigData ) {
156 // see header file for class documentation
158 AliHLTEventTriggerData* trg = ( AliHLTEventTriggerData* ) trigData.fData;
160 AliHLTUInt64_t triggerClass = 0;
163 triggerClass |= ( trg->fCommonHeader[6] & 0x3FFFF );
165 triggerClass = triggerClass << 32;
168 triggerClass |= trg->fCommonHeader[5] ;
170 fEventSummary->SetTriggerClass( triggerClass );