]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TRD/AliHLTTRDCalibrationComponent.cxx
correcting compilation warning and making change of AliShuttleInterface (rev 29388)
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDCalibrationComponent.cxx
index f20f6fd9a58271eed052701560b4c2fa7bb713c1..93e9ff472a60287363dc743ecdb82a385076d8a6 100644 (file)
@@ -35,6 +35,7 @@ using namespace std;
 #include "AliCDBManager.h"
 #include "AliTRDclusterizerHLT.h"
 #include "AliRawReaderMemory.h"
+#include "AliTRDCalibraFillHisto.h"
 
 #include <cstdlib>
 #include <cerrno>
@@ -47,6 +48,7 @@ ClassImp(AliHLTTRDCalibrationComponent);
    
 AliHLTTRDCalibrationComponent::AliHLTTRDCalibrationComponent()
   : AliHLTCalibrationProcessor()
+  , fTRDCalibraFillHisto(NULL)
   , fOutputPercentage(100) // By default we copy to the output exactly what we got as input  
   , fStrorageDBpath("local://$ALICE_ROOT")
   , fCDB(NULL)
@@ -153,18 +155,34 @@ Int_t AliHLTTRDCalibrationComponent::InitCalibration()
       fCDB->SetDefaultStorage(fStrorageDBpath.c_str());
       Logging(kHLTLogDebug, "HLT::TRDCalibration::InitCalibration", "CDB instance", "fCDB 0x%x", fCDB);
     }
-
+  fTRDCalibraFillHisto = AliTRDCalibraFillHisto::Instance();
+  fTRDCalibraFillHisto->SetHisto2d(); // choose to use histograms
+  fTRDCalibraFillHisto->SetCH2dOn();  // choose to calibrate the gain
+  fTRDCalibraFillHisto->SetPH2dOn();  // choose to calibrate the drift velocity
+  fTRDCalibraFillHisto->SetPRF2dOn(); // choose to look at the PRF
+  fTRDCalibraFillHisto->Init2Dhistos(); // initialise the histos
+  return 0;
 }
 
 Int_t AliHLTTRDCalibrationComponent::DeinitCalibration()
 {
+  HLTDebug("DeinitCalibration");
+  
   // Deinitialization of the component
+  // gain histo
+  //TH2I *hCH2d = fTRDCalibraFillHisto->GetCH2d(); 
+  // drift velocity histo
+  //TProfile2D *hPH2d = fTRDCalibraFillHisto->GetPH2d(); 
+  // PRF histo
+  //TProfile2D *hPRF2d = fTRDCalibraFillHisto->GetPRF2d(); 
+
   if (fCDB)
     {
       Logging( kHLTLogDebug, "HLT::TRDCalibration::DeinitCalibration", "destroy", "fCDB");
       fCDB->Destroy();
       fCDB = 0;
     }
+  return 0;
 }
 
 Int_t AliHLTTRDCalibrationComponent::ProcessCalibration( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData)
@@ -173,7 +191,7 @@ Int_t AliHLTTRDCalibrationComponent::ProcessCalibration( const AliHLTComponentEv
 //   Logging( kHLTLogInfo, "HLT::TRDCalibration::ProcessCalibration", "Output percentage set", "Output percentage set to %lu %%", fOutputPercentage );
   Logging( kHLTLogDebug, "HLT::TRDCalibration::ProcessCalibration", "BLOCKS", "NofBlocks %lu", evtData.fBlockCnt );
   // Process an event
-  unsigned long totalSize = 0;
+  //unsigned long totalSize = 0;
 
   //implement a usage of the following
 //   AliHLTUInt32_t triggerDataStructSize = trigData.fStructSize;
@@ -190,12 +208,24 @@ Int_t AliHLTTRDCalibrationComponent::ProcessCalibration( const AliHLTComponentEv
     {
       tobjin = (TObject *)GetNextInputObject( ibForce );
       Logging( kHLTLogInfo, "HLT::TRDCalibration::ProcessCalibration", "nextBLOCK", "Pointer = 0x%x", tobjin);
+      TClonesArray* trdTracks = (TClonesArray* )tobjin;
+      if (trdTracks)
+       {
+         Int_t nbEntries = trdTracks->GetEntries();
+         AliTRDtrackV1* trdTrack = 0x0;
+         for (Int_t i = 0; i < nbEntries; i++){
+           trdTrack = (AliTRDtrackV1*)trdTracks->At(i);
+           fTRDCalibraFillHisto->UpdateHistogramsV1(trdTrack);
+         }
+         
+       }
+      
     }
 
   return 0;
 }
 
-Int_t AliHLTTRDCalibrationComponent::ShipDataToFXS( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData)
+Int_t AliHLTTRDCalibrationComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
 {
   //Int_t PushToFXS(TObject* pObject, const char* pDetector, const char* pFileID, const char* pDDLNumber = "");
   //ireturn = PushToFXS(object, "TRD ", "TRDCalib", "1024 ");