Line data Source code
1 : // $Id$
2 :
3 : //**************************************************************************
4 : //* This file is property of and copyright by the ALICE *
5 : //* ALICE Experiment at CERN, All rights reserved. *
6 : //* *
7 : //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 : //* *
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 : //**************************************************************************
17 :
18 : #include "AliHLTFXSWriterComponent.h"
19 : #include "AliHLTReadoutList.h"
20 :
21 : /** ROOT macro for the implementation of ROOT specific class methods */
22 8 : ClassImp(AliHLTFXSWriterComponent)
23 :
24 : AliHLTFXSWriterComponent::AliHLTFXSWriterComponent()
25 3 : : AliHLTCalibrationProcessor()
26 3 : , fFXSName("")
27 3 : , fFXSDetector("")
28 3 : , fDataType(kAliHLTAllDataTypes|kAliHLTDataOriginAny)
29 3 : , fRootObject(false)
30 15 : {
31 6 : }
32 :
33 : AliHLTFXSWriterComponent::~AliHLTFXSWriterComponent()
34 18 : {
35 9 : }
36 :
37 : void AliHLTFXSWriterComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list)
38 : {
39 0 : list.push_back(kAliHLTAllDataTypes);
40 0 : }
41 :
42 : AliHLTComponentDataType AliHLTFXSWriterComponent::GetOutputDataType()
43 : {
44 : // see header file for class documentation
45 0 : return kAliHLTDataTypeFXSCalib;
46 : }
47 :
48 : void AliHLTFXSWriterComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
49 : {
50 0 : constBase = 0;
51 0 : inputMultiplier = 1;
52 0 : }
53 :
54 : void AliHLTFXSWriterComponent::GetOCDBObjectDescription( TMap* const /*targetArray*/)
55 : {
56 0 : }
57 :
58 : int AliHLTFXSWriterComponent::InitCalibration()
59 : {
60 : int iResult=0;
61 :
62 0 : return iResult;
63 : }
64 :
65 : int AliHLTFXSWriterComponent::DeinitCalibration()
66 : {
67 : int iResult=0;
68 :
69 0 : return iResult;
70 : }
71 :
72 : Int_t AliHLTFXSWriterComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
73 : {
74 0 : if (fRootObject)
75 : {
76 0 : for (const TObject *obj = GetFirstInputObject(fDataType); obj != NULL; obj = GetNextInputObject())
77 : {
78 0 : PushToFXS(obj, fFXSDetector, fFXSName, NULL);
79 : }
80 0 : }
81 : else
82 : {
83 0 : for (const AliHLTComponentBlockData* blk = GetFirstInputBlock(fDataType); blk != NULL; blk = GetNextInputBlock())
84 : {
85 0 : if (blk->GetDataType() == (kAliHLTAnyDataType | kAliHLTDataOriginPrivate)) continue;
86 0 : PushToFXS(blk->fPtr, blk->fSize, fFXSDetector, fFXSName, NULL);
87 0 : }
88 : }
89 :
90 0 : return(0);
91 : }
92 :
93 : int AliHLTFXSWriterComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/,
94 : AliHLTComponentTriggerData& /*trigData*/)
95 : {
96 0 : return 0;
97 : }
98 :
99 : int AliHLTFXSWriterComponent::ScanConfigurationArgument(int argc, const char** argv)
100 : {
101 0 : if (argc<=0) return 0;
102 : int iRet = 0;
103 0 : for( int i=0; i<argc; i++ ){
104 0 : TString argument=argv[i];
105 0 : if (argument.CompareTo("-FXSName") == 0)
106 : {
107 0 : if (++i >= argc)
108 : {
109 0 : HLTError("FXSName missing");
110 0 : return(-1);
111 : }
112 0 : fFXSName = argv[i];
113 0 : iRet+=2;
114 0 : }
115 0 : else if (argument.CompareTo("-FXSDetector") == 0)
116 : {
117 0 : if (++i >= argc)
118 : {
119 0 : HLTError("FXSDetector missing");
120 0 : return(-1);
121 : }
122 0 : fFXSDetector = argv[i];
123 0 : iRet+=2;
124 0 : }
125 0 : else if (argument.CompareTo("-RootObject") == 0)
126 : {
127 0 : fRootObject = true;
128 0 : iRet++;
129 0 : }
130 0 : else if (argument.CompareTo( "-DataType" ) == 0)
131 : {
132 0 : if (i + 2 > argc)
133 : {
134 0 : HLTError("DataType missing");
135 0 : return(-1);
136 : }
137 :
138 0 : fDataType = AliHLTComponentDataTypeInitializerWithPadding(argv[i + 1], argv[i + 2]);
139 : i += 2;
140 0 : iRet += 3;
141 0 : }
142 : else
143 : {
144 : iRet = -EINVAL;
145 0 : HLTError("Unknown argument %s",argv[i]);
146 : }
147 0 : }
148 0 : return iRet;
149 0 : }
|