]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TRD/AliHLTTRDTrackerV1Component.cxx
Merge remote-tracking branch 'origin/master' into flatdev
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDTrackerV1Component.cxx
index 20c5ad7ca5169724ed2929c63c2d4c62acbb2983..b1d3c5c6920d231e8839cedd87ab46b523c14bdb 100644 (file)
@@ -1,4 +1,4 @@
-// $Id: AliHLTTRDTrackerV1Component.cxx 23618 2008-01-29 13:07:38Z hristov $
+// $Id$
 
 //**************************************************************************
 //* This file is property of and copyright by the ALICE HLT Project        * 
 //**************************************************************************
 
 /** @file   AliHLTTRDTrackerV1Component.cxx
-    @author 
+    @author Theodor Rascanu
     @date   
     @brief  A TRDTrackerV1 processing component for the HLT.
 */
 
-#if __GNUC__ >= 3
-using namespace std;
-#endif
-
 #include "AliHLTTRDTrackerV1Component.h"
 #include "AliHLTTRDDefinitions.h"
 #include "AliHLTTRDTrack.h"
 #include "AliHLTTRDUtils.h"
+#include "AliHLTTRDCluster.h"
 
 #include "TFile.h"
 #include "TChain.h"
@@ -50,8 +47,23 @@ using namespace std;
 #include <cerrno>
 #include <string>
 
+using namespace std;
+
 ClassImp(AliHLTTRDTrackerV1Component)
-    
+
+void AliHLTTRDTrackerV1Component::AliHLTTRDESDEvent::CreateStdContent()
+{
+  TClonesArray* tracksArray = new TClonesArray("AliESDtrack",0);
+  tracksArray->SetName(AliESDEvent::fgkESDListName[AliESDEvent::kTracks]);
+  AddObject(tracksArray);
+  GetStdContent();
+}
+
+void AliHLTTRDTrackerV1Component::AliHLTTRDESDEvent::Streamer(TBuffer &/*R__b*/)
+{
+  AliFatal("class is for internal us only and not for streaming");
+}
+
 AliHLTTRDTrackerV1Component::AliHLTTRDTrackerV1Component():
   AliHLTProcessor(),
   fOutputPercentage(100), // By default we copy to the output exactly what we got as input 
@@ -112,6 +124,7 @@ void AliHLTTRDTrackerV1Component::GetOutputDataSize( unsigned long& constBase, d
   // Get the output data size
   constBase = 0;
   inputMultiplier = fOutputV1Tracks ? 2*((double)fOutputPercentage)/100.0 : 0.5*((double)fOutputPercentage)/100.0;
+  if(sizeof(AliHLTTRDClustersArray::cluster_type) == sizeof(AliHLTTRDCluster)) inputMultiplier *= 28.0/8;
 }
 
 // Spawn function, return new instance of this class
@@ -128,10 +141,9 @@ int AliHLTTRDTrackerV1Component::DoInit( int argc, const char** argv )
 
   fReconstructor = new AliTRDReconstructor();
   HLTDebug("TRDReconstructor at 0x%x", fReconstructor);
-
-  fESD = new AliESDEvent;
+  fESD = new AliHLTTRDESDEvent();
   fESD->CreateStdContent();
-  
+
   TString configuration="";
   TString argument="";
   for (int i=0; i<argc && iResult>=0; i++) {
@@ -171,7 +183,7 @@ int AliHLTTRDTrackerV1Component::DoDeinit()
   
   // We need to set clusters in Reconstructor to null to prevent from 
   // double deleting, since we delete TClonesArray by ourself.
-  fReconstructor->SetClusters(0x0);
+  //fReconstructor->SetClusters(0x0);
   delete fReconstructor;
   fReconstructor = NULL;
   delete fESD;
@@ -193,9 +205,6 @@ int AliHLTTRDTrackerV1Component::DoEvent( const AliHLTComponentEventData& evtDat
 
   HLTDebug("NofBlocks %i", evtData.fBlockCnt );
   
-  fESD->Reset();
-  //fESD->SetMagneticField(GetBz());
-
   AliHLTUInt32_t totalSize = 0, offset = 0;
 
   AliHLTComponentDataType expectedDataType = AliHLTTRDDefinitions::fgkClusterDataType;
@@ -225,9 +234,12 @@ int AliHLTTRDTrackerV1Component::DoEvent( const AliHLTComponentEventData& evtDat
       double inputMultiplier;
       GetOutputDataSize(constBase,inputMultiplier);
       if(size<(constBase+block.fSize*inputMultiplier)){
-       HLTWarning("Memory Block given might be too small: %i < %i; Event %Lu", size, constBase+block.fSize*inputMultiplier, evtData.fEventID);
+       HLTWarning("Memory Block given might be too small: %i < %f; Event %Lu", size, constBase+block.fSize*inputMultiplier, evtData.fEventID);
       }
-#endif      
+#endif
+
+      fESD->Reset();
+      //fESD->SetMagneticField(GetBz());
 
       AliHLTTRDUtils::ReadClusters(fClusterArray, block.fPtr, block.fSize, &fNtimeBins);
       HLTDebug("Reading number of time bins from input block. Setting number of timebins to %d", fNtimeBins);
@@ -260,12 +272,12 @@ int AliHLTTRDTrackerV1Component::DoEvent( const AliHLTComponentEventData& evtDat
        TObjString strg;
        strg.String() += fNtimeBins;
        if(trdTracks)
-       PushBack(trdTracks, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, 0);
+         PushBack(trdTracks, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, block.fSpecification);
        else{
          TClonesArray temp("AliTRDtrackV1");
-         PushBack(&temp, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, 0);
+         PushBack(&temp, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, block.fSpecification);
        }
-       PushBack(&strg, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, 0);
+       PushBack(&strg, AliHLTTRDDefinitions::fgkHiLvlTracksDataType, block.fSpecification);
 
        if(fEmulateHLTTracks && trdTracks){
          trdTracks->Delete();
@@ -319,7 +331,7 @@ int AliHLTTRDTrackerV1Component::DoEvent( const AliHLTComponentEventData& evtDat
 
       //here we are deleting clusters (but not the TClonesArray itself)
       fTracker->UnloadClusters();
-      AliTRDReconstructor::SetClusters(0x0);
+      //AliTRDReconstructor::SetClusters(0x0);
       fClusterArray->Delete();
       
     }
@@ -429,19 +441,19 @@ int AliHLTTRDTrackerV1Component::Configure(const char* arguments){
        }
        continue;
       }
-      else if (argument.CompareTo("-emulateHLTTracks")==0) {
+      else if (argument.CompareTo("-emulateHLToutput")==0) {
        if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
        TString toCompareTo=((TObjString*)pTokens->At(i))->GetString();
        if (toCompareTo.CompareTo("yes")==0){
-         HLTWarning("Setting emulateHLTTracks to: %s", toCompareTo.Data());
+         HLTWarning("Setting emulateHLToutput to: %s", toCompareTo.Data());
          fEmulateHLTTracks=kTRUE;
        }
        else if (toCompareTo.CompareTo("no")==0){
-         HLTInfo("Setting emulateHLTTracks to: %s", toCompareTo.Data());
+         HLTInfo("Setting emulateHLToutput to: %s", toCompareTo.Data());
          fEmulateHLTTracks=kFALSE;
        }
        else {
-         HLTError("unknown argument for emulateHLTTracks: %s", toCompareTo.Data());
+         HLTError("unknown argument for emulateHLToutput: %s", toCompareTo.Data());
          iResult=-EINVAL;
          break;
        }
@@ -525,15 +537,31 @@ int AliHLTTRDTrackerV1Component::SetParams()
     HLTInfo("RecoParam already set!");
   }else{
     if(fRecoParamType == 0){
-      HLTDebug("Low flux params init.");
-      fRecoParam = AliTRDrecoParam::GetLowFluxParam();
+#ifndef HAVE_NOT_ALITRD_RECOPARAM_r41621
+      if(fHLTflag){
+       HLTInfo("Low flux HLT params init.");
+       fRecoParam = AliTRDrecoParam::GetLowFluxHLTParam();
+      }else
+#endif
+       {
+         HLTInfo("Low flux params init.");
+         fRecoParam = AliTRDrecoParam::GetLowFluxParam();
+       }
     }
     if(fRecoParamType == 1){
-      HLTDebug("High flux params init.");
-      fRecoParam = AliTRDrecoParam::GetHighFluxParam();
+#ifndef HAVE_NOT_ALITRD_RECOPARAM_r41621
+      if(fHLTflag){
+       HLTInfo("High flux HLT params init.");
+       fRecoParam = AliTRDrecoParam::GetHighFluxHLTParam();
+      }else
+#endif
+       {
+         HLTInfo("High flux params init.");
+         fRecoParam = AliTRDrecoParam::GetHighFluxParam();
+       }
     }
     if(fRecoParamType == 2){
-      HLTDebug("Cosmic Test params init.");
+      HLTInfo("Cosmic Test params init.");
       fRecoParam = AliTRDrecoParam::GetCosmicTestParam();
     }
   }
@@ -544,17 +572,10 @@ int AliHLTTRDTrackerV1Component::SetParams()
       return -EINVAL;
     }
 
-  // backward compatibility to AliTRDrecoParam < r34995
-# ifndef HAVE_NOT_ALITRDRECOPARAM_r34995
-#   define AliTRDRecoParamSetPIDNeuralNetwork(b) fRecoParam->SetPIDNeuralNetwork(b)
-# else
-#   define AliTRDRecoParamSetPIDNeuralNetwork(b) fRecoParam->SetPIDNeuralNetwork()
-# endif
-
   switch(fPIDmethod){
-  case 0: AliTRDRecoParamSetPIDNeuralNetwork(kFALSE); break;
-  case 1: AliTRDRecoParamSetPIDNeuralNetwork(kTRUE); break;
-  case 2: AliTRDRecoParamSetPIDNeuralNetwork(kFALSE); break;
+  case 0: fRecoParam->SetPIDNeuralNetwork(kFALSE); break;
+  case 1: fRecoParam->SetPIDNeuralNetwork(kTRUE); break;
+  case 2: fRecoParam->SetPIDNeuralNetwork(kFALSE); break;
   }
 
   fRecoParam->SetImproveTracklets(fImproveTracklets);
@@ -615,3 +636,23 @@ int AliHLTTRDTrackerV1Component::ReadPreprocessorValues(const char* modules)
   }  
   return iResult;
 }
+
+void AliHLTTRDTrackerV1Component::GetOCDBObjectDescription(TMap* const targetMap){
+  // Get a list of OCDB object description needed for the particular component
+  if (!targetMap) return;
+  targetMap->Add(new TObjString("HLT/ConfigTRD/TrackerV1Component"), new TObjString("component arguments"));
+  targetMap->Add(new TObjString("TRD/Calib/ChamberGainFactor"), new TObjString("gain factor of chambers"));
+  targetMap->Add(new TObjString("TRD/Calib/ChamberT0"), new TObjString("T0 of chambers"));
+  targetMap->Add(new TObjString("TRD/Calib/ChamberVdrift"), new TObjString("drift velocity of chambers"));
+  targetMap->Add(new TObjString("TRD/Calib/DetNoise"), new TObjString("noise of chambers"));
+  targetMap->Add(new TObjString("TRD/Calib/LocalGainFactor"), new TObjString("per pad gain factor"));
+  targetMap->Add(new TObjString("TRD/Calib/LocalT0"), new TObjString("per pad T0"));
+  targetMap->Add(new TObjString("TRD/Calib/LocalVdrift"), new TObjString("per pad drift velocity"));
+  targetMap->Add(new TObjString("TRD/Calib/PadNoise"), new TObjString("per pad noise"));
+  targetMap->Add(new TObjString("TRD/Calib/PadStatus"), new TObjString("pad status"));
+  targetMap->Add(new TObjString("TRD/Calib/PRFWidth"), new TObjString("pad response function"));
+  targetMap->Add(new TObjString("TRD/Calib/ChamberStatus"), new TObjString("status of chambers"));
+  targetMap->Add(new TObjString("TRD/Calib/PIDLQ"), new TObjString("likelyhood PID"));
+  targetMap->Add(new TObjString("TRD/Calib/PIDNN"), new TObjString("neuronal network PID"));
+  targetMap->Add(new TObjString("TRD/Calib/PIDThresholds"), new TObjString("threshold for PID"));
+}