]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/MUON/OnlineAnalysis/AliHLTMUONDecisionComponent.h
Cleanup of documentation and code.
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONDecisionComponent.h
CommitLineData
c9537879 1#ifndef AliHLTMUONDECISIONCOMPONENT_H
2#define AliHLTMUONDECISIONCOMPONENT_H
3/* This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id: $ */
8
9///
10/// @file AliHLTMUONDecisionComponent.h
11/// @author Artur Szostak <artursz@iafrica.com>
12/// @date 30 April 2008
13/// @brief Declares the decision component for dimuon HLT triggering.
14///
15
16#include "AliHLTProcessor.h"
17#include "AliHLTMUONDataTypes.h"
18#include <vector>
19
20#if __GNUC__ && __GNUC__ < 3
21#define std
22#endif
23
24extern "C" struct AliHLTMUONMansoTrackStruct;
25extern "C" struct AliHLTMUONTrackDecisionStruct;
26extern "C" struct AliHLTMUONPairDecisionStruct;
27extern "C" struct AliHLTMUONSinglesDecisionBlockStruct;
28extern "C" struct AliHLTMUONPairsDecisionBlockStruct;
29
30
31/**
32 * @class AliHLTMUONDecisionComponent
33 * @brief Dimuon HLT trigger decision component.
34 *
35 * This class implements the dimuon HLT trigger decision component.
36 * The dimuon trigger decision is generated by first applying two pT cuts to the
37 * single tracks: a low cut for the J/psi family and a high cut for the upsilon
38 * family. From the tracks that pass the cuts, we count them and build up some
39 * statistics like the number of tracks passing the low or high pT cut.
40 * The algorithm then looks at pairs of tracks and similarly counts the number
41 * like sign or unlike sign pairs where both tracks passed the low or high pT cut
42 * or pairs that did not pass any cuts.
43 * At this point the invariant mass of the pairs is calculated and two mass cuts
44 * are applied. The number of pairs that pass the low or high mass cut are then
45 * counted. The results are encoded into two data blocks, one for trigger decisions
46 * for single tracks and another for the track pairs.
47 */
48class AliHLTMUONDecisionComponent : public AliHLTProcessor
49{
50public:
51 AliHLTMUONDecisionComponent();
52 virtual ~AliHLTMUONDecisionComponent();
53
54 // Public functions to implement the AliHLTProcessor interface.
55 // These functions are required for the registration process.
56 virtual const char* GetComponentID();
57 virtual void GetInputDataTypes(AliHLTComponentDataTypeList& list);
58 virtual AliHLTComponentDataType GetOutputDataType();
59 virtual int GetOutputDataTypes(AliHLTComponentDataTypeList& list);
60 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
61 virtual AliHLTComponent* Spawn();
62
63protected:
64
65 // Protected functions to implement the AliHLTProcessor interface.
66 // These functions provide initialization as well as the actual processing
67 // capabilities of the component.
68 virtual int DoInit(int argc, const char** argv);
69 virtual int DoDeinit();
70 virtual int Reconfigure(const char* cdbEntry, const char* componentId);
71 virtual int DoEvent(
72 const AliHLTComponentEventData& evtData,
73 const AliHLTComponentBlockData* blocks,
74 AliHLTComponentTriggerData& trigData,
75 AliHLTUInt8_t* outputPtr,
76 AliHLTUInt32_t& size,
77 std::vector<AliHLTComponentBlockData>& outputBlocks
78 );
79
80 using AliHLTProcessor::DoEvent;
81
82private:
83
84 // Do not allow copying of this class.
85 AliHLTMUONDecisionComponent(const AliHLTMUONDecisionComponent& /*obj*/);
86 AliHLTMUONDecisionComponent& operator = (const AliHLTMUONDecisionComponent& /*obj*/);
87
88 /**
89 * Reads the cut parameters from the CDB.
90 * \param path The relative CDB path to use for the CDB entry.
91 * If NULL the default value is used.
92 * \param setLowPtCut Indicates if the low pT cut should be set (default true).
93 * \param setHighPtCut Indicates if the high pT cut should be set (default true).
94 * \param setLowMassCut Indicates if the low invariant mass cut should be set (default true).
95 * \param setHighMassCut Indicates if the high invariant mass cut should be set (default true).
96 * \return 0 is returned on success and a non-zero value to indicate failure.
97 */
98 int ReadConfigFromCDB(
99 const char* path = NULL,
100 bool setLowPtCut = true, bool setHighPtCut = true,
101 bool setLowMassCut = true, bool setHighMassCut = true
102 );
103
104 int AddTrack(const AliHLTMUONMansoTrackStruct* track);
105
106 void ApplyTriggerAlgorithm(
107 AliHLTMUONSinglesDecisionBlockStruct& singlesHeader,
108 AliHLTMUONTrackDecisionStruct* singlesDecision,
109 AliHLTMUONPairsDecisionBlockStruct& pairsHeader,
110 AliHLTMUONPairDecisionStruct* pairsDecision
111 );
112
113 AliHLTUInt32_t fMaxTracks; /// The maximum number of elements that can be stored in fTracks.
114 AliHLTUInt32_t fTrackCount; /// The current number of elements stored in fTracks.
115 const AliHLTMUONMansoTrackStruct** fTracks; /// Pointers to the track structures in input data blocks.
116 AliHLTFloat32_t fLowPtCut; /// The low pT cut value to apply to tracks. [GeV/c]
117 AliHLTFloat32_t fHighPtCut; /// The high pT cut value to apply to tracks. [GeV/c]
118 AliHLTFloat32_t fLowMassCut; /// The low invariant mass cut value to apply to tracks. [GeV/c^2]
119 AliHLTFloat32_t fHighMassCut; /// The high invariant mass cut value to apply to tracks. [GeV/c^2]
120 bool fWarnForUnexpecedBlock; /// Flag indicating if we should log a warning if we got a block of an unexpected type.
121
122 ClassDef(AliHLTMUONDecisionComponent, 0); // Trigger decision component for the dimuon HLT.
123};
124
125#endif // AliHLTMUONDECISIONCOMPONENT_H