]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFPreprocessorFDR.cxx
- changes to the Material budget, resolution and QA code
[u/mrichter/AliRoot.git] / TOF / AliTOFPreprocessorFDR.cxx
index 82a11df16ddc272d3d89e9fa6b5e75c0f44fa864..c407b476a576be8d56b14c35372fdc23b985a5d2 100644 (file)
 
 /* 
 $Log$
+Revision 1.4  2007/12/05 13:55:18  zampolli
+Initialization bug fixed.
+
+Revision 1.3  2007/11/27 13:12:30  zampolli
+CDB object run range upper limit extended to AliCDBRunRange::Infinity()
+
+Revision 1.2  2007/11/27 07:24:41  zampolli
+Log used, fData member removed
+
+Revision 1.1  2007/11/24 18:36:27  zampolli
+TOF Preprocessor for FDR
+
 */
 
-#include <Riostream.h>
-#include <stdio.h>
-#include <stdlib.h>
+//#include <Riostream.h>
+//#include <stdio.h>
+//#include <stdlib.h>
 
-#include <TFile.h>
+//#include <TFile.h>
 #include <TH1.h>
-#include <TH1F.h>
-#include <TH1S.h>
-#include <TH2S.h>
 #include <TMath.h>
 #include <TObjArray.h>
-#include <TObjString.h>
+//#include <TObjString.h>
 #include <TTimeStamp.h>
 
 #include "AliCDBMetaData.h"
 #include "AliLog.h"
-#include "AliTOFChannelOnline.h"
-#include "AliTOFDataDCS.h"
-#include "AliTOFGeometry.h"
+
+//#include "AliTOFDataDCS.h"
+//#include "AliTOFGeometry.h"
 #include "AliTOFPreprocessorFDR.h"
 #include "AliTOFFormatDCS.h"
 #include "AliDCSValue.h"
 
-class TF1;
-class AliDCSValue;
-class AliTOFGeometry;
-
 // TOF preprocessor class.
 // It takes data from DCS and passes them to the class AliTOFDataDCS, which
 // processes them. The result is then written to the CDB.
@@ -58,10 +63,10 @@ ClassImp(AliTOFPreprocessorFDR)
 
 AliTOFPreprocessorFDR::AliTOFPreprocessorFDR(AliShuttleInterface* shuttle) :
   AliPreprocessor("TOF", shuttle),
-  fData(0),
   fStoreRefData(kTRUE)
 {
   // constructor
+  AddRunType("PHYSICS");
 
 }
 
@@ -70,10 +75,6 @@ AliTOFPreprocessorFDR::AliTOFPreprocessorFDR(AliShuttleInterface* shuttle) :
 AliTOFPreprocessorFDR::~AliTOFPreprocessorFDR()
 {
   // destructor
-  if (fData){
-    delete fData;
-    fData = 0;
-  }
 }
 
 //______________________________________________________________________________
@@ -84,11 +85,10 @@ void AliTOFPreprocessorFDR::Initialize(Int_t run, UInt_t startTime,
 
   AliPreprocessor::Initialize(run, startTime, endTime);
 
-       AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
+       Log(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
                TTimeStamp(startTime).AsString(),
                TTimeStamp(endTime).AsString()));
 
-       fData = new AliTOFDataDCS(fRun, fStartTime, fEndTime);
 }
 
 //_____________________________________________________________________________
@@ -129,28 +129,32 @@ UInt_t AliTOFPreprocessorFDR::ProcessDCSDataPoints(TMap* aliasMap)
     TObjArray *array = new TObjArray(4);
     array->SetOwner();
 
-    AliTOFFormatDCS *lv_i48_02 = new AliTOFFormatDCS();
-    AliTOFFormatDCS *lv_v48_02 = new AliTOFFormatDCS();
-    AliTOFFormatDCS *lv_i33_02 = new AliTOFFormatDCS();
-    AliTOFFormatDCS *lv_v33_02 = new AliTOFFormatDCS();
+    AliTOFFormatDCS *lvI4802 = new AliTOFFormatDCS();
+    AliTOFFormatDCS *lvV4802 = new AliTOFFormatDCS();
+    AliTOFFormatDCS *lvI3302 = new AliTOFFormatDCS();
+    AliTOFFormatDCS *lvV3302 = new AliTOFFormatDCS();
     
-    array->AddAt(lv_i48_02,0);
-    array->AddAt(lv_v48_02,1);
-    array->AddAt(lv_i33_02,2);
-    array->AddAt(lv_v33_02,3);
+    array->AddAt(lvI4802,0);
+    array->AddAt(lvV4802,1);
+    array->AddAt(lvI3302,2);
+    array->AddAt(lvV3302,3);
 
     // processing DCS
     
     for (Int_t i=0;i<4;i++){
+      for (Int_t idelta =0;idelta<2;idelta++){
+       delta[idelta]=0;
+       timedelta[idelta]=0;
+      }
       TObjArray *aliasArr = (TObjArray*) aliasMap->GetValue(aliasDP[i].Data());
       
       if(!aliasArr){
-       AliError(Form("Alias %s not found!", aliasDP[i].Data()));
+       Log(Form("Alias %s not found!", aliasDP[i].Data()));
        return kFALSE;
       }
       
       if(aliasArr->GetEntries()<3){
-       AliError(Form("Alias %s has just %d entries!",
+       Log(Form("Alias %s has just %d entries!",
                      aliasDP[i].Data(),aliasArr->GetEntries()));
        continue;
       }
@@ -178,24 +182,24 @@ UInt_t AliTOFPreprocessorFDR::ProcessDCSDataPoints(TMap* aliasMap)
        val = aValue->GetFloat();
        time = (Float_t) (aValue->GetTimeStamp());
        if (i==0){
-         AliDebug(1,Form("tof_lv_i48: setting value %i to %f at %f",k,val,time));
-         lv_i48_02->SetFloat(k,val);
-         lv_i48_02->SetTimeStampFloat(k,time);
+         AliDebug(1,Form("tof_lv_i48_02: setting value %i to %f at %f",k,val,time));
+         lvI4802->SetFloat(k,val);
+         lvI4802->SetTimeStampFloat(k,time);
        }
        else if (i==1){
-         AliDebug(1,Form("tof_lv_v48: setting value %i to %f at %f",k,val,time));
-         lv_v48_02->SetFloat(k,val);
-         lv_v48_02->SetTimeStampFloat(k,time);
+         AliDebug(1,Form("tof_lv_v48_02: setting value %i to %f at %f",k,val,time));
+         lvV4802->SetFloat(k,val);
+         lvV4802->SetTimeStampFloat(k,time);
        }
        else if (i==2){
-         AliDebug(1,Form("tof_lv_i33: setting value %i to %f at %f",k,val,time));
-         lv_i33_02->SetFloat(k,val);
-         lv_i33_02->SetTimeStampFloat(k,time);
+         AliDebug(1,Form("tof_lv_i33_02: setting value %i to %f at %f",k,val,time));
+         lvI3302->SetFloat(k,val);
+         lvI3302->SetTimeStampFloat(k,time);
        }
        else if (i==3){
-         AliDebug(1,Form("tof_lv_v33: setting value %i to %f at %f",k,val,time));
-         lv_v33_02->SetFloat(k,val);
-         lv_v33_02->SetTimeStampFloat(k,time);
+         AliDebug(1,Form("tof_lv_v33_02: setting value %i to %f at %f",k,val,time));
+         lvV3302->SetFloat(k,val);
+         lvV3302->SetTimeStampFloat(k,time);
        }
       }
   
@@ -226,23 +230,23 @@ UInt_t AliTOFPreprocessorFDR::ProcessDCSDataPoints(TMap* aliasMap)
       for (Int_t kk=0;kk<2;kk++){
        if (i==0){
          AliDebug(1,Form("tof_lv_i48: setting variation %i to %f at %f",kk,delta[kk],timedelta[kk]));
-         lv_i48_02->SetDelta(kk,delta[kk]);
-         lv_i48_02->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
+         lvI4802->SetDelta(kk,delta[kk]);
+         lvI4802->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
        }
        else if (i==1){
          AliDebug(1,Form("tof_lv_v48: setting variation %i to %f at %f",kk,delta[kk],timedelta[kk]));
-         lv_v48_02->SetDelta(kk,delta[kk]);
-         lv_v48_02->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
+         lvV4802->SetDelta(kk,delta[kk]);
+         lvV4802->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
        }
        else if (i==2){
          AliDebug(1,Form("tof_lv_i33: setting variation %i to %f at %f",kk,delta[kk],timedelta[kk]));
-         lv_i33_02->SetDelta(kk,delta[kk]);
-         lv_i33_02->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
+         lvI3302->SetDelta(kk,delta[kk]);
+         lvI3302->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
        }
        else if (i==3){
          AliDebug(1,Form("tof_lv_v33: setting variation %i to %f at %f",kk,delta[kk],timedelta[kk]));
-         lv_v33_02->SetDelta(kk,delta[kk]);
-         lv_v33_02->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
+         lvV3302->SetDelta(kk,delta[kk]);
+         lvV3302->SetTimeStampDelta(kk,(Float_t)timedelta[kk]);
        }
       }
     }
@@ -251,7 +255,7 @@ UInt_t AliTOFPreprocessorFDR::ProcessDCSDataPoints(TMap* aliasMap)
     metaDataDCS.SetBeamPeriod(0);
     metaDataDCS.SetResponsible("Chiara Zampolli");
     metaDataDCS.SetComment("This preprocessor fills an AliTOFDataDCS object.");
-    AliInfo("Storing DCS Data");
+    Log("Storing DCS Data");
     resultDCSStore = StoreReferenceData("Calib","DCSData",array, &metaDataDCS);
     if (!resultDCSStore){
       Log("Some problems occurred while storing DCS data results in Reference Data, TOF exiting from Shuttle");
@@ -259,15 +263,15 @@ UInt_t AliTOFPreprocessorFDR::ProcessDCSDataPoints(TMap* aliasMap)
       // in reference data
     }
     
-    AliInfo("Storing DCS Data in OCDB");
-    resultDCSMap = Store("Calib","DCSData",array, &metaDataDCS);
-    if (!resultDCSStore){
+    Log("Storing DCS Data in OCDB");
+    resultDCSMap = Store("Calib","DCSData",array, &metaDataDCS,0,kTRUE);
+    if (!resultDCSMap){
       Log("Some problems occurred while storing DCS data results in OCDB, TOF exiting from Shuttle");
       return 3;// return error Code for processed DCS data not stored 
       // in reference data
     }
     
-    if (array) delete array;
+    delete array;
     return 0;
 
   }