// -*- Mode: C++ -*- // $Id$ #ifndef ALIHLTGLOBALHISTOCOMPONENT_H #define ALIHLTGLOBALHISTOCOMPONENT_H //* This file is property of and copyright by the ALICE HLT Project * //* ALICE Experiment at CERN, All rights reserved. * //* See cxx source for full Copyright notice * /// @file AliHLTGlobalHistoComponent.h /// @author Matthias Richter /// @date 2010-09-16 /// @brief A histogramming component for global ESD properties based /// on the AliHLTTTreeProcessor #include "AliHLTTTreeProcessor.h" #include #include #include /** * @class AliHLTGlobalHistoComponent * *

General properties:

* * Component ID: \b GlobalHisto
* Library: \b libAliHLTGlobal.so
* Input Data Types: ::kAliHLTAnyDataType
* Output Data Types: none
* *

Mandatory arguments:

* * *

Optional arguments:

* * *

Configuration:

* * Configuration by component arguments. * *

Default CDB entries:

* The component loads no CDB entries. * *

Performance:

* The component does not process any event data. * *

Memory consumption:

* The component does not process any event data. * *

Output size:

* Depending on the mode. * * @ingroup alihlt_util_components */ class AliHLTGlobalHistoComponent : public AliHLTTTreeProcessor { public: /// standard constructor AliHLTGlobalHistoComponent(); /// destructor virtual ~AliHLTGlobalHistoComponent(); /// inherited from AliHLTComponent: return id of the component. virtual const char* GetComponentID() {return "GlobalHisto";}; /// inherited from AliHLTComponent: input data types virtual void GetInputDataTypes(AliHLTComponentDataTypeList&); /// inherited from AliHLTComponent: spawn function, create an instance. virtual AliHLTComponent* Spawn() {return new AliHLTGlobalHistoComponent;} void FillHistogramDefinitions(); /// @class AliHLTGlobalHistoVariables /// container for the tree branch variables class AliHLTGlobalHistoVariables { public: AliHLTGlobalHistoVariables(); AliHLTGlobalHistoVariables(int capacity, const char* names); ~AliHLTGlobalHistoVariables(); /// init the arrays int Init(int capacity, const char* names); /// capacity for every key int Capacity() const {return fCapacity;} /// number of variables int Variables() const {return fArrays.size();} /// fill variable at index int Fill(unsigned index, float value); /// fill variable at key int Fill(const char* key, float value); /// get array at key float* GetArray(const char* key); /// get the key of an array const char* GetKey(int index) const; /// reset and cleanup arrays int Reset(); /// reset the fill counts int ResetCount(); private: int FindKey(const char* key) const; /// capacity of all arrays int fCapacity; //! /// pointers of arrays vector fArrays; //! /// fill count for arrays vector fCount; //! /// map of keys map fKeys; //! }; protected: /// inherited from AliHLTTTreeProcessor: create the tree instance and all branches TTree* CreateTree(int argc, const char** argv); /// inherited from AliHLTTTreeProcessor: process input blocks and fill tree int FillTree(TTree* pTree, const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ); /// dtOrigin for PushBack. AliHLTComponentDataType GetOriginDataType() const; /// spec for PushBack AliHLTUInt32_t GetDataSpec() const {return 0;} int ResetVariables(); private: /// copy constructor prohibited AliHLTGlobalHistoComponent(const AliHLTGlobalHistoComponent&); /// assignment operator prohibited AliHLTGlobalHistoComponent& operator=(const AliHLTGlobalHistoComponent&); /// the event number, tree filling variable int fEvent; //! /// track count, tree filling variable int fNofTracks; //! /// x coordinate of vertex float fVertexX; //! /// y coordinate of vertex float fVertexY; //! /// z coordinate of vertex float fVertexZ; //! /// filling arrays for track parameters AliHLTGlobalHistoComponent::AliHLTGlobalHistoVariables fTrackVariables; //! ClassDef(AliHLTGlobalHistoComponent, 0) // HLT Global Histogram component }; #endif