]> 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 032a783dbfb046b581ed43c6350ab43c8ee32948..b1d3c5c6920d231e8839cedd87ab46b523c14bdb 100644 (file)
     @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,6 +47,8 @@ using namespace std;
 #include <cerrno>
 #include <string>
 
+using namespace std;
+
 ClassImp(AliHLTTRDTrackerV1Component)
 
 void AliHLTTRDTrackerV1Component::AliHLTTRDESDEvent::CreateStdContent()
@@ -125,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
@@ -183,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;
@@ -205,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;
@@ -237,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);
@@ -272,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();
@@ -331,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();
       
     }
@@ -537,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();
     }
   }
@@ -556,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);
@@ -627,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"));
+}