]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TRD/AliHLTTRDCalibrationComponent.cxx
- changed Addtask to run added signals for new MC's
[u/mrichter/AliRoot.git] / HLT / TRD / AliHLTTRDCalibrationComponent.cxx
index 90097b8316be6ef3cc27a0be9da61b40b85cec06..f44f5e2a95d0cdf8d477bd49d75f49334684ba4b 100644 (file)
@@ -3,9 +3,8 @@
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
- * Authors: Matthias Richter <Matthias.Richter@ift.uib.no>                *
- *          Timm Steinbeck <timm@kip.uni-heidelberg.de>                   *
- *          for The ALICE Off-line Project.                               *
+ * Authors:                                                               *
+ *          for The ALICE HLT Project.                                    *
  *                                                                        *
  * Permission to use, copy, modify and distribute this software and its   *
  * documentation strictly for non-commercial purposes is hereby granted   *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/** @file   AliHLTTRDCalibrationComponent.cxx
-    @author Timm Steinbeck, Matthias Richter
-    @date
-    @brief  A TRDCalibration processing component for the HLT. */
-
-#if __GNUC__ >= 3
-using namespace std;
-#endif
+//  @file   AliHLTTRDCalibrationComponent.cxx
+//  @author 
+//  @date
+//  @brief  A TRDCalibration processing component for the HLT. 
+// 
 
 #include "TTree.h"
 #include "TFile.h"
@@ -59,6 +55,8 @@ using namespace std;
 #include <cerrno>
 #include <string>
 
+using namespace std;
+
 ClassImp(AliHLTTRDCalibrationComponent);
 
 AliHLTTRDCalibrationComponent::AliHLTTRDCalibrationComponent()
@@ -272,6 +270,7 @@ Int_t AliHLTTRDCalibrationComponent::DeinitCalibration()
   
   HLTDebug("DeinitCalibration");
   delete fTracksArray; fTracksArray=0;
+  fTRDCalibraFillHisto->DestroyDebugStreamer();
   //fTRDCalibraFillHisto->Destroy();
   //fOutArray->Delete();
   delete fOutArray; fOutArray=0;
@@ -286,7 +285,7 @@ Int_t AliHLTTRDCalibrationComponent::DeinitCalibration()
 
 Int_t AliHLTTRDCalibrationComponent::ProcessCalibration(const AliHLTComponent_EventData& /*evtData*/,
                                                         const AliHLTComponent_BlockData* /*blocks*/,
-                                                        AliHLTComponent_TriggerData& trigData,
+                                                        AliHLTComponent_TriggerData& /*trigData*/,
                                                         AliHLTUInt8_t* /*outputPtr*/,
                                                         AliHLTUInt32_t& /*size*/,
                                                         vector<AliHLTComponent_BlockData>& /*outputBlocks*/)
@@ -346,8 +345,7 @@ Int_t AliHLTTRDCalibrationComponent::ProcessCalibration(const AliHLTComponent_Ev
       for(int i = 0; i < fTrgStrings->GetEntriesFast(); i++){
        const TObjString *const obString=(TObjString*)fTrgStrings->At(i);
        const TString tString=obString->GetString();
-       //printf("Trigger Output: %i\n",EvaluateCTPTriggerClass(tString.Data(),trigData));
-       if(EvaluateCTPTriggerClass(tString.Data(),trigData)){TriggerPassed=kTRUE; break;}
+       if(CheckCTPTrigger(tString.Data())>0){TriggerPassed=kTRUE; break;}
       }
     }
     else{
@@ -355,7 +353,7 @@ Int_t AliHLTTRDCalibrationComponent::ProcessCalibration(const AliHLTComponent_Ev
       for(int i = 0; i < fTrgStrings->GetEntriesFast(); i++){
        const TObjString *const obString=(TObjString*)fTrgStrings->At(i);
        const TString tString=obString->GetString();
-       if(EvaluateCTPTriggerClass(tString.Data(),trigData)){TriggerPassed=kFALSE; break;}
+       if(CheckCTPTrigger(tString.Data())>0){TriggerPassed=kFALSE; break;}
       }
     }
   }
@@ -434,8 +432,6 @@ void AliHLTTRDCalibrationComponent::FormOutput(Int_t param)
 
 Int_t AliHLTTRDCalibrationComponent::ShipDataToFXS(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/)
 {
-  //fTRDCalibraFillHisto->DestroyDebugStreamer();
-
   AliHLTReadoutList rdList(AliHLTReadoutList::kTRD);
 
   EORCalibration();
@@ -462,7 +458,7 @@ Int_t AliHLTTRDCalibrationComponent::ShipDataToFXS(const AliHLTComponentEventDat
 
   HLTDebug("Size of the fOutArray is %d\n",fOutArray->GetEntriesFast());
 
-  PushToFXS((TObject*)fOutArray, "TRD", "GAINDRIFTPRF", rdList.Buffer() );
+  PushToFXS((TObject*)fOutArray, "TRD", "GAINDRIFTPRF", &rdList );
   //PushToFXS((TObject*)fOutArray->FindObject("CH2d"), "TRD", "GAINDRIFTPRF", rdList.Buffer() );
 
   return 0;
@@ -485,10 +481,10 @@ Int_t AliHLTTRDCalibrationComponent::EORCalibration()
   //Gain
   calibra->SetMinEntries(100);
   calibra->AnalyseCH(hCH2d);
-  Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(0))
-    + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(0));
-  Int_t nbfit       = calibra->GetNumberFit();
-  Int_t nbE         = calibra->GetNumberEnt();
+  //Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(0))
+  //  + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(0));
+  //Int_t nbfit       = calibra->GetNumberFit();
+  //Int_t nbE         = calibra->GetNumberEnt();
   TH1F *coefgain = 0x0;
   // enough statistics
   //if ((nbtg >                  0) && 
@@ -505,9 +501,9 @@ Int_t AliHLTTRDCalibrationComponent::EORCalibration()
   calibra->SetMinEntries(100); // If there is less than 100
   hVdriftLinearFit->FillPEArray();
   calibra->AnalyseLinearFitters(hVdriftLinearFit);
-  nbtg = 540;
-  nbfit = calibra->GetNumberFit();
-  nbE   = calibra->GetNumberEnt();
+  //nbtg = 540;
+  //nbfit = calibra->GetNumberFit();
+  //nbE   = calibra->GetNumberEnt();
   TH1F *coefdriftsecond = 0x0;
   // enough statistics
   //if ((nbtg >                  0) && 
@@ -524,10 +520,10 @@ Int_t AliHLTTRDCalibrationComponent::EORCalibration()
   // vdrift first method
   calibra->SetMinEntries(100*20); // If there is less than 20000
   calibra->AnalysePH(hPH2d);
-  nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
-    + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
-  nbfit        = calibra->GetNumberFit();
-  nbE          = calibra->GetNumberEnt();
+  //nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
+  //  + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
+  //nbfit        = calibra->GetNumberFit();
+  //nbE          = calibra->GetNumberEnt();
   TH1F *coefdrift = 0x0;
   TH1F *coeft0 = 0x0;
   // enough statistics
@@ -549,10 +545,10 @@ Int_t AliHLTTRDCalibrationComponent::EORCalibration()
   //PRF
   calibra->SetMinEntries(200); 
   calibra->AnalysePRFMarianFit(hPRF2d);
-  nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(2))
-    + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(2));
-  nbfit        = calibra->GetNumberFit();
-  nbE          = calibra->GetNumberEnt();
+  //nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(2))
+  //  + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(2));
+  //nbfit        = calibra->GetNumberFit();
+  //nbE          = calibra->GetNumberEnt();
   TH1F *coefprf = 0x0;
   // enough statistics
   //if ((nbtg >                  0) && 
@@ -570,17 +566,14 @@ Int_t AliHLTTRDCalibrationComponent::EORCalibration()
   coefdrift->SetName("coefdrift");
   coefdriftsecond->SetName("coefdriftsecond");
   coeft0->SetName("coeft0");
-  if(coefgain) fAfterRunArray->Add(coefgain);
-  if(coefprf) fAfterRunArray->Add(coefprf);
-  if(coefdrift) fAfterRunArray->Add(coefdrift);
-  if(coefdriftsecond) fAfterRunArray->Add(coefdriftsecond);
-  if(coeft0) fAfterRunArray->Add(coeft0);
-  
-
-  if(coefgain||coefprf||coefdrift||coeft0||coefdriftsecond) {
-    PushBack(fAfterRunArray, AliHLTTRDDefinitions::fgkEORCalibrationDataType);
-  }
+  fAfterRunArray->Add(coefgain);
+  fAfterRunArray->Add(coefprf);
+  fAfterRunArray->Add(coefdrift);
+  fAfterRunArray->Add(coefdriftsecond);
+  fAfterRunArray->Add(coeft0);
 
+  PushBack(fAfterRunArray, AliHLTTRDDefinitions::fgkEORCalibrationDataType);
+  
   // TString fileName="/tmp/CalibHistoDump_run";
   // fileName+=AliCDBManager::Instance()->GetRun();
   // fileName+=".root";