2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE HLT Project *
4 //* ALICE Experiment at CERN, All rights reserved. *
6 //* Primary Authors: Gaute Ovrebekk *
7 //* for The ALICE HLT Project. *
9 //* Permission to use, copy, modify and distribute this software and its *
10 //* documentation strictly for non-commercial purposes is hereby granted *
11 //* without fee, provided that the above copyright notice appears in all *
12 //* copies and that both the copyright notice and this permission notice *
13 //* appear in the supporting documentation. The authors make no claims *
14 //* about the suitability of this software for any purpose. It is *
15 //* provided "as is" without express or implied warranty. *
16 //**************************************************************************
18 /// @file AliHLTTriggerITSMultiplicity.cxx
19 /// @author Gaute Ovrebekk
21 /// @brief HLT trigger component for cluster multiplicity
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
31 #include "AliHLTTriggerITSMultiplicity.h"
32 #include "AliHLTTriggerDecision.h"
33 #include "AliHLTDomainEntry.h"
34 #include "TObjString.h"
35 #include "AliHLTITSClusterDataFormat.h"
36 #include "AliHLTITSSpacePointData.h"
38 /** ROOT macro for the implementation of ROOT specific class methods */
39 ClassImp(AliHLTTriggerITSMultiplicity)
41 AliHLTTriggerITSMultiplicity::AliHLTTriggerITSMultiplicity()
45 // see header file for class documentation
47 // refer to README to build package
49 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
53 const char* AliHLTTriggerITSMultiplicity::fgkOCDBEntry="HLT/ConfigHLT/ITSMultiplicityTrigger";
55 AliHLTTriggerITSMultiplicity::~AliHLTTriggerITSMultiplicity()
57 // see header file for class documentation
60 const char* AliHLTTriggerITSMultiplicity::GetTriggerName() const
62 // see header file for class documentation
63 return "ITSMultiplicityTrigger";
66 AliHLTComponent* AliHLTTriggerITSMultiplicity::Spawn()
68 // see header file for class documentation
69 return new AliHLTTriggerITSMultiplicity;
72 int AliHLTTriggerITSMultiplicity::DoTrigger()
74 // see header file for class documentation
76 int numberOfClusters=-1;
79 const AliHLTComponentBlockData* iter = NULL;
81 if(!IsDataEvent()) return 0;
83 for(iter = GetFirstInputBlock(kAliHLTDataTypeClusters); iter != NULL; iter = GetNextInputBlock()){
85 if(iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSPD) &&
86 iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSDD) &&
87 iter->fDataType!=(kAliHLTAnyDataType|kAliHLTDataOriginITSSSD))
90 const AliHLTITSClusterData* clusterData = (const AliHLTITSClusterData*) iter->fPtr;
91 Int_t nSpacepoint = (Int_t) clusterData->fSpacePointCnt;
92 numberOfClusters += nSpacepoint;
96 if (iResult>=0 && numberOfClusters>=0) {
98 if (numberOfClusters>=fnClusters) {
99 description.Form("Event contains %d cluster(s)", numberOfClusters);
100 SetDescription(description.Data());
101 // Enable the central detectors for readout.
102 GetReadoutList().Enable(
103 AliHLTReadoutList::kITSSPD |
104 AliHLTReadoutList::kITSSDD |
105 AliHLTReadoutList::kITSSSD |
106 AliHLTReadoutList::kTPC |
107 AliHLTReadoutList::kTRD |
108 AliHLTReadoutList::kTOF |
109 AliHLTReadoutList::kHMPID |
110 AliHLTReadoutList::kPHOS
112 // Add the available HLT information for readout too.
113 GetTriggerDomain().Add("CLUSTERS", "ITS ");
117 description.Form("No clusters matching the tresholds found (min clusters %d ", fnClusters);
119 description.Form("No input blocks found");
121 SetDescription(description.Data());
126 int AliHLTTriggerITSMultiplicity::DoInit(int argc, const char** argv)
128 // see header file for class documentation
130 // first configure the default
132 if (iResult>=0) iResult=ConfigureFromCDBTObjString(fgkOCDBEntry);
134 // configure from the command line parameters if specified
135 if (iResult>=0 && argc>0)
136 iResult=ConfigureFromArgumentString(argc, argv);
140 int AliHLTTriggerITSMultiplicity::DoDeinit()
142 // see header file for class documentation
146 int AliHLTTriggerITSMultiplicity::Reconfigure(const char* cdbEntry, const char* /*chainId*/)
148 // see header file for class documentation
150 // configure from the specified antry or the default one
151 const char* entry=cdbEntry;
152 if (!entry || entry[0]==0) {
156 return ConfigureFromCDBTObjString(entry);
159 int AliHLTTriggerITSMultiplicity::ScanConfigurationArgument(int argc, const char** argv)
161 // see header file for class documentation
162 if (argc<=0) return 0;
164 TString argument=argv[i];
167 if (argument.CompareTo("-nclusters")==0) {
168 if (++i>=argc) return -EPROTO;
170 fnClusters=argument.Atoi();