]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCAgent.cxx
coding conventions
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCAgent.cxx
1 // @(#) $Id$
2
3 /**************************************************************************
4  * This file is property of and copyright by the ALICE HLT Project        * 
5  * ALICE Experiment at CERN, All rights reserved.                         *
6  *                                                                        *
7  * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no>        *
8  *                  for The ALICE HLT Project.                            *
9  *                                                                        *
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  **************************************************************************/
18
19 /** @file   AliHLTTPCAgent.cxx
20     @author Matthias Richter
21     @date   
22     @brief  Agent of the libAliHLTTPC library
23 */
24
25 #include "AliHLTTPCAgent.h"
26 #include "AliHLTConfiguration.h"
27
28 /** global instance for agent registration */
29 AliHLTTPCAgent gAliHLTTPCAgent;
30
31 // component headers
32 #include "AliHLTAltroChannelSelectorComponent.h"
33 #include "AliHLTTPCDigitDumpComponent.h"
34 #include "AliHLTTPCEsdWriterComponent.h"
35
36 /** ROOT macro for the implementation of ROOT specific class methods */
37 ClassImp(AliHLTTPCAgent)
38
39 AliHLTTPCAgent::AliHLTTPCAgent()
40 {
41   // see header file for class documentation
42   // or
43   // refer to README to build package
44   // or
45   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
46 }
47
48 AliHLTTPCAgent::~AliHLTTPCAgent()
49 {
50   // see header file for class documentation
51 }
52
53 int AliHLTTPCAgent::CreateConfigurations(AliHLTConfigurationHandler* handler,
54                                          AliRawReader* /*rawReader*/,
55                                          AliRunLoader* /*runloader*/) const
56 {
57   // see header file for class documentation
58   if (handler) {
59     int iMinSlice=0; 
60     int iMaxSlice=1;
61     int iMinPart=0;
62     int iMaxPart=1;
63     TString fileWriterInput;
64     TString esdWriterInput;
65     for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
66       TString trackerInput;
67       for (int part=iMinPart; part<=iMaxPart; part++) {
68         TString arg, publisher, cf;
69
70         // digit publisher components
71         arg.Form("-slice %d -partition %d", slice, part);
72         publisher.Form("DP_%02d_%d", slice, part);
73         handler->CreateConfiguration(publisher.Data(), "TPCDigitPublisher", NULL , arg.Data());
74
75         // cluster finder components
76         cf.Form("CF_%02d_%d", slice, part);
77         handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
78         if (trackerInput.Length()>0) trackerInput+=" ";
79         trackerInput+=cf;
80       }
81       TString tracker;
82       // tracker finder components
83       tracker.Form("TR_%02d", slice);
84       handler->CreateConfiguration(tracker.Data(), "TPCSliceTracker", trackerInput.Data(), "pp-run bfield 0.5");
85
86       // input for the global file writer
87       if (fileWriterInput.Length()>0) fileWriterInput+=" ";
88       fileWriterInput+=trackerInput;
89
90       // input for the esd writer
91       if (esdWriterInput.Length()>0) esdWriterInput+=" ";
92       esdWriterInput+=tracker;
93     }
94
95     // the writer configuration
96     handler->CreateConfiguration("sink1", "FileWriter"   , fileWriterInput.Data(), "-specfmt -subdir=test_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
97     // the esd writer configuration
98     handler->CreateConfiguration("esd-writer", "TPCEsdWriter"   , esdWriterInput.Data(), "-datafile AliESDs.root");
99   }
100   return 0;
101 }
102
103 const char* AliHLTTPCAgent::GetReconstructionChains(AliRawReader* /*rawReader*/,
104                                                     AliRunLoader* /*runloader*/) const
105 {
106   // see header file for class documentation
107   return NULL;
108   //return "sink1";
109   //return "esd-writer";
110 }
111
112 const char* AliHLTTPCAgent::GetRequiredComponentLibraries() const
113 {
114   // see header file for class documentation
115   return NULL;
116 }
117
118 int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const
119 {
120   // see header file for class documentation
121   if (!pHandler) return -EINVAL;
122   pHandler->AddComponent(new AliHLTAltroChannelSelectorComponent);
123   pHandler->AddComponent(new AliHLTTPCDigitDumpComponent);
124   pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliWriter);
125   pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliConverter);
126
127   return 0;
128 }