LCOV - code coverage report
Current view: top level - HLT/TRD - AliHLTTRDOfflineTrackerV1Component.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 57 12.3 %
Date: 2016-06-14 17:26:59 Functions: 7 14 50.0 %

          Line data    Source code
       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 Theodor Rascanu
      21             :     @date   
      22             :     @brief  Handles high level (object based) and low level (pod) input data (clusters). For debug purposes only
      23             : */
      24             : 
      25             : #include "AliHLTTRDOfflineTrackerV1Component.h"
      26             : #include "AliHLTTRDDefinitions.h"
      27             : #include "AliHLTTRDUtils.h"
      28             : #include "AliTRDrecoParam.h"
      29             : #include "AliTRDtrackerV1.h"
      30             : #include "AliTRDReconstructor.h"
      31             : #include "AliCDBManager.h"
      32             : #include "AliESDEvent.h"
      33             : #include "TClonesArray.h"
      34             : #include "TObjString.h"
      35             : 
      36             : #include "AliTRDtrackV1.h"
      37             : #include "AliTRDseedV1.h"
      38             : #include "AliTRDcluster.h"
      39             : 
      40           6 : ClassImp(AliHLTTRDOfflineTrackerV1Component)
      41             :     
      42             : AliHLTTRDOfflineTrackerV1Component::AliHLTTRDOfflineTrackerV1Component()
      43           3 :   :AliHLTTRDTrackerV1Component()
      44          15 : {
      45             :   // Default constructor
      46           6 : }
      47             : 
      48             : AliHLTTRDOfflineTrackerV1Component::~AliHLTTRDOfflineTrackerV1Component()
      49          12 : {
      50             :   // Destructor
      51             :   // Work is Done in DoDeInit()
      52          12 : }
      53             : 
      54             : void AliHLTTRDOfflineTrackerV1Component::GetInputDataTypes( vector<AliHLTComponent_DataType>& list)
      55             : {
      56             :   // Get the list of input data
      57           0 :   list.clear();
      58           0 :   AliHLTTRDTrackerV1Component::GetInputDataTypes(list);
      59           0 :   list.push_back(AliHLTTRDDefinitions::fgkHiLvlClusterDataType);
      60           0 : }
      61             : 
      62             : AliHLTComponentDataType AliHLTTRDOfflineTrackerV1Component::GetOutputDataType()
      63             : {
      64             :   // Get the output data type
      65           0 :   return kAliHLTMultipleDataType;
      66             : }
      67             : 
      68             : int AliHLTTRDOfflineTrackerV1Component::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList)
      69             : {
      70             :   // Get the output data types
      71           0 :   tgtList.clear();
      72           0 :   tgtList.push_back(AliHLTTRDDefinitions::fgkHiLvlTracksDataType);
      73           0 :   return tgtList.size();
      74             : }
      75             : 
      76             : void AliHLTTRDOfflineTrackerV1Component::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
      77             : {
      78             :   // Get the output data size
      79           0 :   AliHLTTRDTrackerV1Component::GetOutputDataSize(constBase, inputMultiplier);
      80           0 :   constBase += 500;
      81           0 : }
      82             : 
      83             : AliHLTComponent* AliHLTTRDOfflineTrackerV1Component::Spawn()
      84             : {
      85             :   // Spawn function, return new instance of this class
      86           0 :   return new AliHLTTRDOfflineTrackerV1Component;
      87           0 : };
      88             : 
      89             : const char* AliHLTTRDOfflineTrackerV1Component::GetComponentID()
      90             : {
      91             :   // Return the component ID const char *
      92         102 :   return "TRDOfflineTrackerV1"; // The ID of this component
      93             : }
      94             : 
      95             : int AliHLTTRDOfflineTrackerV1Component::SetParams()
      96             : {
      97           0 :   int iResult = AliHLTTRDTrackerV1Component::SetParams();
      98           0 :   fRecoParam->SetStreamLevel(AliTRDrecoParam::kTracker, 1); // in order to have the friends written
      99           0 :   return iResult;
     100             : }
     101             : 
     102             : int AliHLTTRDOfflineTrackerV1Component::DoEvent(const AliHLTComponent_EventData& evtData, const AliHLTComponent_BlockData* blocks, 
     103             :                                                   AliHLTComponent_TriggerData& trigData, AliHLTUInt8_t* outputPtr, 
     104             :                                                   AliHLTUInt32_t& size, vector<AliHLTComponent_BlockData>& outputBlocks )
     105             : {
     106           0 :   if(!IsDataEvent())return 0;
     107             :   
     108           0 :   if(!GetFirstInputBlock(AliHLTTRDDefinitions::fgkHiLvlClusterDataType))
     109           0 :     return AliHLTTRDTrackerV1Component::DoEvent(evtData, blocks, trigData, outputPtr, size, outputBlocks );
     110             : 
     111           0 :   for(const TObject *iter = GetFirstInputObject(AliHLTTRDDefinitions::fgkHiLvlClusterDataType); iter; iter = GetNextInputObject()) 
     112             :     {
     113           0 :       TClonesArray* clusterArray = dynamic_cast<TClonesArray*>(const_cast<TObject*>(iter));
     114           0 :       if(!clusterArray)continue;
     115           0 :       TObjString* strg = dynamic_cast<TObjString*>(const_cast<TObject*>(GetNextInputObject()));
     116           0 :       if(!strg)continue;
     117             :       
     118           0 :       fNtimeBins = strg->String().Atoi();
     119           0 :       fESD->Reset();
     120           0 :       AliTRDtrackerV1::SetNTimeBins(fNtimeBins);
     121             :       HLTDebug("TClonesArray of clusters: nbEntries = %i", clusterArray->GetEntriesFast());
     122           0 :       fTracker->LoadClusters(clusterArray);
     123           0 :       fTracker->Clusters2Tracks(fESD);
     124           0 :       Int_t nTracks = fESD->GetNumberOfTracks();
     125           0 :       HLTInfo("Number of tracks  == %d ==", nTracks);  
     126           0 :       TClonesArray* trdTracks = fTracker->GetListOfTracks();
     127             : 
     128           0 :       if(fEmulateHLTTracks && trdTracks){
     129           0 :         trdTracks = new TClonesArray(*trdTracks);
     130           0 :         AliHLTTRDUtils::EmulateHLTTracks(trdTracks);
     131           0 :       }
     132             : 
     133           0 :       AliHLTUInt32_t spec = GetSpecification(iter);
     134           0 :       if(trdTracks)
     135           0 :         PushBack(trdTracks, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, spec);
     136             :       else{
     137           0 :         TClonesArray temp("AliTRDtrackV1");
     138           0 :         PushBack(&temp, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, spec);
     139           0 :       }
     140           0 :       PushBack(strg, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, spec);
     141           0 :       fTracker->UnloadClusters();
     142             :       //AliTRDReconstructor::SetClusters(0x0);
     143             : 
     144           0 :       if(fEmulateHLTTracks && trdTracks){
     145           0 :         trdTracks->Delete();
     146           0 :         delete trdTracks;
     147             :       }
     148           0 :     }
     149           0 :   return 0;
     150           0 : }

Generated by: LCOV version 1.11