]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
naming, eff C++
authormploskon <mploskon@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Jul 2007 14:43:20 +0000 (14:43 +0000)
committermploskon <mploskon@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Jul 2007 14:43:20 +0000 (14:43 +0000)
HLT/TRD/AliHLTTRDClusterizerComponent.cxx
HLT/TRD/AliHLTTRDClusterizerComponent.h
HLT/TRD/AliHLTTRDTrackerComponent.cxx
HLT/TRD/AliHLTTRDTrackerComponent.h

index 112e95118d2c2dba3ff549b69acaa6e45f0289ff..a0f22af09e7a18b516840775fc6888cdf3c4a51f 100644 (file)
@@ -42,45 +42,54 @@ using namespace std;
 // this is a global object used for automatic component registration, do not use this
 AliHLTTRDClusterizerComponent gAliHLTTRDClusterizerComponent;
 
-ClassImp(AliHLTTRDClusterizerComponent)
-    
-  AliHLTTRDClusterizerComponent::AliHLTTRDClusterizerComponent()
+ClassImp(AliHLTTRDClusterizerComponent);
+   
+AliHLTTRDClusterizerComponent::AliHLTTRDClusterizerComponent()
+  : AliHLTProcessor()
+  , fOutputPercentage(100) // By default we copy to the output exactly what we got as input  
+  , fStrorageDBpath("local://$ALICE_ROOT")
+  , fClusterizer(NULL)
+  , fCDB(NULL)
+  , fMemReader(NULL)
 {
-  fOutputPercentage = 100; // By default we copy to the output exactly what we got as input
-  
+  // Default constructor
 }
 
 AliHLTTRDClusterizerComponent::~AliHLTTRDClusterizerComponent()
 {
+  // Destructor
+  ;
 }
 
 const char* AliHLTTRDClusterizerComponent::GetComponentID()
 {
+  // Return the component ID const char *
   return "TRDClusterizer"; // The ID of this component
 }
 
 void AliHLTTRDClusterizerComponent::GetInputDataTypes( vector<AliHLTComponent_DataType>& list)
 {
+  // Get the list of input data
   list.clear(); // We do not have any requirements for our input data type(s).
   list.push_back( AliHLTTRDDefinitions::fgkDDLRawDataType );
 }
 
 AliHLTComponent_DataType AliHLTTRDClusterizerComponent::GetOutputDataType()
 {
+  // Get the output data type
   return AliHLTTRDDefinitions::fgkClusterDataType;
 }
 
 void AliHLTTRDClusterizerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
 {
+  // Get the output data size
   constBase = 0;
   inputMultiplier = ((double)fOutputPercentage)/100.0;
 }
 
-
-
-// Spawn function, return new instance of this class
 AliHLTComponent* AliHLTTRDClusterizerComponent::Spawn()
 {
+  // Spawn function, return new instance of this class
   return new AliHLTTRDClusterizerComponent;
 };
 
@@ -143,38 +152,39 @@ int AliHLTTRDClusterizerComponent::DoInit( int argc, const char** argv )
       return EINVAL;
     }
 
-  cdb = AliCDBManager::Instance();
-  if (!cdb)
+  fCDB = AliCDBManager::Instance();
+  if (!fCDB)
     {
-      Logging(kHLTLogError, "HLT::TRDCalibration::DoInit", "Could not get CDB instance", "cdb 0x%x", cdb);
+      Logging(kHLTLogError, "HLT::TRDCalibration::DoInit", "Could not get CDB instance", "fCDB 0x%x", fCDB);
     }
   else
     {
-      cdb->SetRun(0); // THIS HAS TO BE RETRIEVED !!!
-      cdb->SetDefaultStorage(fStrorageDBpath.c_str());
-      Logging(kHLTLogDebug, "HLT::TRDCalibration::DoInit", "CDB instance", "cdb 0x%x", cdb);
+      fCDB->SetRun(0); // THIS HAS TO BE RETRIEVED !!!
+      fCDB->SetDefaultStorage(fStrorageDBpath.c_str());
+      Logging(kHLTLogDebug, "HLT::TRDCalibration::DoInit", "CDB instance", "fCDB 0x%x", fCDB);
     }
 
-  rmem = new AliRawReaderMemory;
-  clusterizer = new AliTRDclusterizerV1HLT("TRDCclusterizer", "TRDCclusterizer");
-  clusterizer->SetRawDataVersion(fRawDataVersion);
-  clusterizer->InitClusterTree();
+  fMemReader = new AliRawReaderMemory;
+  fClusterizer = new AliTRDclusterizerV1HLT("TRDCclusterizer", "TRDCclusterizer");
+  fClusterizer->SetRawDataVersion(fRawDataVersion);
+  fClusterizer->InitClusterTree();
   return 0;
 }
 
 int AliHLTTRDClusterizerComponent::DoDeinit()
 {
-  delete rmem;
-  rmem = 0;
-  delete clusterizer;
-  clusterizer = 0;
+  // Deinitialization of the component
+  delete fMemReader;
+  fMemReader = 0;
+  delete fClusterizer;
+  fClusterizer = 0;
   return 0;
 
-  if (cdb)
+  if (fCDB)
     {
-      Logging( kHLTLogDebug, "HLT::TRDCalibration::DoDeinit", "destroy", "cdb");
-      cdb->Destroy();
-      cdb = 0;
+      Logging( kHLTLogDebug, "HLT::TRDCalibration::DoDeinit", "destroy", "fCDB");
+      fCDB->Destroy();
+      fCDB = 0;
     }
 }
 
@@ -182,6 +192,7 @@ int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponent_EventData& evt
                                            AliHLTComponent_TriggerData& trigData, AliHLTUInt8_t* outputPtr, 
                                            AliHLTUInt32_t& size, vector<AliHLTComponent_BlockData>& outputBlocks )
 {
+  // Process an event
   Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "Output percentage set", "Output percentage set to %lu %%", fOutputPercentage );
   Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "BLOCKS", "NofBlocks %lu", evtData.fBlockCnt );
   // Process an event
@@ -236,10 +247,10 @@ int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponent_EventData& evt
 
   Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "COPY STATS", "total=%lu copied=%lu", totalSize, copied);
 
-  rmem->Reset();
-  rmem->SetMemory((UChar_t*)memBufIn, totalSize);
-  //rmem->Reset();
-  Bool_t ihead = rmem->ReadHeader();
+  fMemReader->Reset();
+  fMemReader->SetMemory((UChar_t*)memBufIn, totalSize);
+  //fMemReader->Reset();
+  Bool_t ihead = fMemReader->ReadHeader();
   if (ihead == kTRUE)
     {
       Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "HEADER", "Header read successfully");
@@ -250,8 +261,8 @@ int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponent_EventData& evt
       //return -1; -- not FATAL
     }
 
-  clusterizer->ResetTree();
-  Bool_t ireadD = clusterizer->ReadDigits(rmem);
+  fClusterizer->ResetTree();
+  Bool_t ireadD = fClusterizer->ReadDigits(fMemReader);
   if (ireadD == kTRUE)
     {
       Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "DIGITS", "Digits read successfully");
@@ -262,7 +273,7 @@ int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponent_EventData& evt
       return -1;
     }
 
-  Bool_t iclustered = clusterizer->MakeClusters();
+  Bool_t iclustered = fClusterizer->MakeClusters();
   if (iclustered == kTRUE)
     {
       Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "CLUSTERS", "Clustered successfully");
@@ -276,12 +287,12 @@ int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponent_EventData& evt
   free(memBufIn);
 
   //UInt_t memBufOutSize = 0;
-  //   void *memBufOut = clusterizer->WriteClustersToMemory(memBufOut, memBufOutSize);
-  Int_t iNclusters = clusterizer->GetNclusters();
+  //   void *memBufOut = fClusterizer->WriteClustersToMemory(memBufOut, memBufOutSize);
+  Int_t iNclusters = fClusterizer->GetNclusters();
   Logging( kHLTLogInfo, "HLT::TRDClusterizer::DoEvent", "COUNT", "N of Clusters = %d", iNclusters);
 
   // put the tree into output blocks of TObjArrays
-  TTree *fcTree = clusterizer->GetClusterTree();
+  TTree *fcTree = fClusterizer->GetClusterTree();
   TList *lt = (TList*)fcTree->GetListOfBranches();
   TIter it(lt);
   it.Reset();
index d7498d9a9854705a64fc6fcbf6e412eae270cb59..1b3b03dabd8a82e1a968ed664710ad2dd3005f76 100644 (file)
@@ -55,13 +55,14 @@ class AliHLTTRDClusterizerComponent : public AliHLTProcessor
 
        // The size of the output data produced, as a percentage of the input data's size.
        // Can be greater than 100 (%)
-       unsigned fOutputPercentage;
 
-       string fStrorageDBpath;
+       unsigned fOutputPercentage; // Output volume in percentage of the input
 
-       AliTRDclusterizerV1HLT *clusterizer; //!
-       AliCDBManager *cdb; //!
-       AliRawReaderMemory *rmem; //!
+       string fStrorageDBpath; // Default path for OCDB
+
+       AliTRDclusterizerV1HLT *fClusterizer; //! Offline derived HLT clusterizer
+       AliCDBManager *fCDB; //! Pointer to OCDB
+       AliRawReaderMemory *fMemReader; //! Input raw data reader
        
        ClassDef(AliHLTTRDClusterizerComponent, 0)
 
index 8991571c9cc1ed918e9bf230e1bcd33254018196..466fc0ee481242b4a384a77e832a700d3c86a233 100644 (file)
@@ -50,10 +50,17 @@ AliHLTTRDTrackerComponent gAliHLTTRDTrackerComponent;
 ClassImp(AliHLTTRDTrackerComponent);
     
 AliHLTTRDTrackerComponent::AliHLTTRDTrackerComponent()
+  : AliHLTProcessor()
+  , fOutputPercentage(100) // By default we copy to the output exactly what we got as input  
+  , fStrorageDBpath("local://$ALICE_ROOT")
+  , fCDB(NULL)
+  , fField(NULL)
+  , fGeometryFileName("")
+  , fGeometryFile(NULL)
+  , fGeoManager(NULL)
+  , fTracker(NULL)
 {
-  fOutputPercentage = 100; // By default we copy to the output exactly what we got as input
-
-  fStrorageDBpath = "local://$ALICE_ROOT";
+  // Default constructor
   fCDB = AliCDBManager::Instance();
   //fCDB->SetDefaultStorage(fStrorageDBpath.c_str());
   fCDB->SetRun(0);
@@ -64,26 +71,31 @@ AliHLTTRDTrackerComponent::AliHLTTRDTrackerComponent()
 
 AliHLTTRDTrackerComponent::~AliHLTTRDTrackerComponent()
 {
+  // Destructor
 }
 
 const char* AliHLTTRDTrackerComponent::GetComponentID()
 {
+  // Return the component ID const char *
   return "TRDTracker"; // The ID of this component
 }
 
 void AliHLTTRDTrackerComponent::GetInputDataTypes( vector<AliHLTComponent_DataType>& list)
 {
+  // Get the list of input data  
   list.clear(); // We do not have any requirements for our input data type(s).
   list.push_back( AliHLTTRDDefinitions::fgkClusterDataType );
 }
 
 AliHLTComponent_DataType AliHLTTRDTrackerComponent::GetOutputDataType()
 {
+  // Get the output data type
   return AliHLTTRDDefinitions::fgkClusterDataType;
 }
 
 void AliHLTTRDTrackerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
 {
+  // Get the output data size
   constBase = 0;
   inputMultiplier = ((double)fOutputPercentage)/100.0;
 }
@@ -91,6 +103,7 @@ void AliHLTTRDTrackerComponent::GetOutputDataSize( unsigned long& constBase, dou
 // Spawn function, return new instance of this class
 AliHLTComponent* AliHLTTRDTrackerComponent::Spawn()
 {
+  // Spawn function, return new instance of this class
   return new AliHLTTRDTrackerComponent;
 };
 
@@ -192,10 +205,13 @@ int AliHLTTRDTrackerComponent::DoInit( int argc, const char** argv )
 
 int AliHLTTRDTrackerComponent::DoDeinit()
 {
+  // Deinitialization of the component
+
   delete fClusterizer;
   fClusterizer = 0;
 
   delete fField;
+  fField = 0;
 
   delete fTracker;
   fTracker = 0;
@@ -204,11 +220,13 @@ int AliHLTTRDTrackerComponent::DoDeinit()
     {
       fGeometryFile->Close();
       delete fGeometryFile;
+      fGeometryFile = 0;
     }
 
   AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance();
   if (calibra)
     {
+      // should not write in here!
       calibra->Write2d();
       calibra->Destroy();
     }
@@ -219,6 +237,8 @@ int AliHLTTRDTrackerComponent::DoDeinit()
 int AliHLTTRDTrackerComponent::DoEvent( const AliHLTComponentEventData & evtData,
                                        AliHLTComponentTriggerData & trigData )
 {
+  // Process an event
+  
   Logging( kHLTLogInfo, "HLT::TRDTracker::DoEvent", "Output percentage set", "Output percentage set to %lu %%", fOutputPercentage );
   Logging( kHLTLogInfo, "HLT::TRDTracker::DoEvent", "BLOCKS", "NofBlocks %lu", evtData.fBlockCnt );
 
index e521feea7187dca0800454909dbb6832f1979065..ef84b294edd8e686eb08a13b26beba5d38aad108 100644 (file)
@@ -60,19 +60,19 @@ class AliHLTTRDTrackerComponent : public AliHLTProcessor
 
        // The size of the output data produced, as a percentage of the input data's size.
        // Can be greater than 100 (%)
-       unsigned fOutputPercentage;
+       unsigned fOutputPercentage; // Output volume in percentage of the input
 
-       string fStrorageDBpath;
-       AliTRDclusterizerV1HLT *fClusterizer; //!
-       AliCDBManager *fCDB; //!
+       string fStrorageDBpath; // Default path for OCDB
+       AliTRDclusterizerV1HLT *fClusterizer; //! Offline derived HLT clusterizer
+       AliCDBManager *fCDB; //! Pointer to OCDB
 
        AliMagFMaps* fField; //! magn. field settings
 
-       string fGeometryFileName;
-       TFile *fGeometryFile; //!
-       TGeoManager *fGeoManager; //!
+       string fGeometryFileName; // Path to geometry file 
+       TFile *fGeometryFile; //! // Pointer to the geom root file
+       TGeoManager *fGeoManager; //! Pointer to geometry manager 
 
-       AliTRDtrackerHLT *fTracker;//!
+       AliTRDtrackerHLT *fTracker;//! Offline-like/HLT tracker
 
        ClassDef(AliHLTTRDTrackerComponent, 0)