]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TRD/AliHLTTRDOfflineTrackerV1Component.cxx
rearranging data type ids for HLT TRD data transport (Theodor)
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDOfflineTrackerV1Component.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:                                                       *
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   AliHLTTRDOfflineTrackerV1Component.cxx
20     @author 
21     @date   2009-08-31
22     @brief  A TRDClusterizer processing component for the HLT. 
23 */
24
25 #include "AliHLTTRDOfflineTrackerV1Component.h"
26 #include "AliCDBManager.h"
27 #include "AliTRDrecoParam.h"
28 #include "AliHLTTRDDefinitions.h"
29
30 ClassImp(AliHLTTRDOfflineTrackerV1Component)
31     
32 AliHLTTRDOfflineTrackerV1Component::AliHLTTRDOfflineTrackerV1Component()
33   :AliHLTTRDTrackerV1Component()
34 {
35   // Default constructor
36   fOffline=kTRUE;
37 }
38
39 AliHLTTRDOfflineTrackerV1Component::~AliHLTTRDOfflineTrackerV1Component()
40 {
41   // Destructor
42   // Work is Done in DoDeInit()
43 }
44
45 int AliHLTTRDOfflineTrackerV1Component::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
46 {
47   // Get the output data types
48   tgtList.clear();
49   tgtList.push_back(AliHLTTRDDefinitions::fgkHiLvlTracksDataType);
50   return tgtList.size();
51 }
52
53 void AliHLTTRDOfflineTrackerV1Component::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
54 {
55   // Get the output data size
56   constBase = 1000000;
57   inputMultiplier = 4*((double)fOutputPercentage);
58 }
59
60 AliHLTComponent* AliHLTTRDOfflineTrackerV1Component::Spawn()
61 {
62   // Spawn function, return new instance of this class
63   return new AliHLTTRDOfflineTrackerV1Component;
64 };
65
66 int AliHLTTRDOfflineTrackerV1Component::DoInit( int argc, const char** argv )
67 {
68   int iResult = 0;
69   SetOfflineParams();
70   iResult=AliHLTTRDTrackerV1Component::DoInit(argc, argv);
71   fRecoParam->SetStreamLevel(AliTRDrecoParam::kTracker, 1); //in order to have the friends written
72   return iResult;
73 }
74
75 const char* AliHLTTRDOfflineTrackerV1Component::GetComponentID()
76 {
77   // Return the component ID const char *
78   return "TRDOfflineTrackerV1"; // The ID of this component
79 }
80
81 void AliHLTTRDOfflineTrackerV1Component::SetOfflineParams(){
82   if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
83     HLTFatal("You are resetting the Default Storage of the CDBManager!");
84     HLTFatal("Let's hope that this program is NOT running on the HLT cluster!");
85     AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
86   }
87   if(AliCDBManager::Instance()->GetRun()<0){
88     HLTFatal("You are resetting the CDB run number to 0!");
89     HLTFatal("Let's hope that this program is NOT running on the HLT cluster!");
90     AliCDBManager::Instance()->SetRun(0);
91   }
92 }
93
94 int AliHLTTRDOfflineTrackerV1Component::DoDeinit()
95 {
96   return AliHLTTRDTrackerV1Component::DoDeinit();
97 }
98
99 int AliHLTTRDOfflineTrackerV1Component::DoEvent(const AliHLTComponent_EventData& evtData, const AliHLTComponent_BlockData* blocks, 
100                                                   AliHLTComponent_TriggerData& trigData, AliHLTUInt8_t* outputPtr, 
101                                                   AliHLTUInt32_t& size, vector<AliHLTComponent_BlockData>& outputBlocks )
102 {
103   if ( GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR ) )
104     return 0;
105   return AliHLTTRDTrackerV1Component::DoEvent(evtData, blocks, trigData, outputPtr, size, outputBlocks );
106 }