]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/AliVZEROPreprocessor.cxx
List of run types added
[u/mrichter/AliRoot.git] / VZERO / AliVZEROPreprocessor.cxx
index d3d9eca4556fd173f8f85681463dee91f3c85434..9743db9fac28cae3d33275f2aaf1954d8a0a0211 100644 (file)
@@ -22,13 +22,18 @@ AliVZEROPreprocessor::AliVZEROPreprocessor(AliShuttleInterface* shuttle) :
   fData(0)
  
 {
   fData(0)
  
 {
-  // constructor
+  // constructor  
+  
+  AddRunType("PHYSICS");
+    
 }
 
 //______________________________________________________________________________________________
 AliVZEROPreprocessor::~AliVZEROPreprocessor()
 {
   // destructor
 }
 
 //______________________________________________________________________________________________
 AliVZEROPreprocessor::~AliVZEROPreprocessor()
 {
   // destructor
+  
+   delete fData;
 }
 
 //______________________________________________________________________________________________
 }
 
 //______________________________________________________________________________________________
@@ -37,17 +42,18 @@ void AliVZEROPreprocessor::Initialize(Int_t run, UInt_t startTime,
 {
   // Creates AliZDCDataDCS object
 
 {
   // Creates AliZDCDataDCS object
 
-  AliPreprocessor::Initialize(run, startTime, endTime);
-
-       Log(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
+   AliPreprocessor::Initialize(run, startTime, endTime);
+  
+   Log(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
                TTimeStamp(startTime).AsString(),
                TTimeStamp(endTime).AsString()));
 
                TTimeStamp(startTime).AsString(),
                TTimeStamp(endTime).AsString()));
 
-       fRun = run;
-        fStartTime = startTime;
-        fEndTime = endTime;
+   fRun       = run;
+   fStartTime = startTime;
+   fEndTime   = endTime;
 
 
-       fData = new AliVZERODataDCS(fRun, fStartTime, fEndTime);
+   fData      = new AliVZERODataDCS(fRun, fStartTime, fEndTime);
+   
 }
 
 //______________________________________________________________________________________________
 }
 
 //______________________________________________________________________________________________
@@ -86,9 +92,9 @@ UInt_t AliVZEROPreprocessor::Process(TMap* dcsAliasMap)
 
        TList* sourceList = GetFileSources(kDAQ, SourcesId.Data());
        if (!sourceList)  {
 
        TList* sourceList = GetFileSources(kDAQ, SourcesId.Data());
        if (!sourceList)  {
-               AliError(Form("No sources found for id %s", SourcesId.Data()));                 
+               Log(Form("No sources found for id %s", SourcesId.Data()));                      
                return 1; }
                return 1; }
-       AliInfo(Form("The following sources produced files with the id %s",SourcesId.Data()));
+       Log(Form("The following sources produced files with the id %s",SourcesId.Data()));
        sourceList->Print();    
 
        TIter iter(sourceList);
        sourceList->Print();    
 
        TIter iter(sourceList);
@@ -97,10 +103,10 @@ UInt_t AliVZEROPreprocessor::Process(TMap* dcsAliasMap)
        while((source=dynamic_cast<TObjString*> (iter.Next()))){
                fileName = GetFile(kDAQ, SourcesId.Data(), source->GetName());
                if (fileName.Length() > 0)
        while((source=dynamic_cast<TObjString*> (iter.Next()))){
                fileName = GetFile(kDAQ, SourcesId.Data(), source->GetName());
                if (fileName.Length() > 0)
-               AliInfo(Form("Got the file %s, now we can extract some values.", fileName.Data()));
+               Log(Form("Got the file %s, now we can extract some values.", fileName.Data()));
                FILE *file;
                if((file = fopen(fileName.Data(),"r")) == NULL){
                FILE *file;
                if((file = fopen(fileName.Data(),"r")) == NULL){
-                                  AliError(Form("Cannot open file %s",fileName.Data()));
+                                  Log(Form("Cannot open file %s",fileName.Data()));
                                   return 1;}
                Float_t Pedestals[128], Sigmas[128], Gains[128];
                for(Int_t j=0; j<128; j++)fscanf(file,"%f %f %f ",
                                   return 1;}
                Float_t Pedestals[128], Sigmas[128], Gains[128];
                for(Int_t j=0; j<128; j++)fscanf(file,"%f %f %f ",
@@ -110,8 +116,7 @@ UInt_t AliVZEROPreprocessor::Process(TMap* dcsAliasMap)
                calibData->SetPedestal(Pedestals);
                calibData->SetSigma(Sigmas);                    
                calibData->SetGain(Gains); }                            
                calibData->SetPedestal(Pedestals);
                calibData->SetSigma(Sigmas);                    
                calibData->SetGain(Gains); }                            
-               
-       delete sourceList; 
+
        delete source;      
   
   // Check that everything was properly transmitted
        delete source;      
   
   // Check that everything was properly transmitted
@@ -122,16 +127,21 @@ UInt_t AliVZEROPreprocessor::Process(TMap* dcsAliasMap)
 //   for(Int_t j=0; j<64; j++){printf("MeanHV[%d] -> %f \n",j,calibData->GetMeanHV(j));}
 //   for(Int_t j=0; j<64; j++){printf("WidthHV[%d] -> %f \n",j,calibData->GetWidthHV(j));}
   
 //   for(Int_t j=0; j<64; j++){printf("MeanHV[%d] -> %f \n",j,calibData->GetMeanHV(j));}
 //   for(Int_t j=0; j<64; j++){printf("WidthHV[%d] -> %f \n",j,calibData->GetWidthHV(j));}
   
-  // Now we  store the VZERO Calibration Object into CalibrationDB
+  // Now we store the VZERO Calibration Object into CalibrationDB
   
   
-  AliCDBMetaData metaData;
-  metaData.SetBeamPeriod(0);
-  metaData.SetResponsible("Brigitte Cheynis");
-  metaData.SetComment("This preprocessor fills an AliVZEROCalibData object");
+  Bool_t result = kFALSE;
+  if(sourceList && sourceList->GetEntries()>0)
+  {
+       AliCDBMetaData metaData;
+       metaData.SetBeamPeriod(0);
+       metaData.SetResponsible("Brigitte Cheynis");
+       metaData.SetComment("This preprocessor fills an AliVZEROCalibData object");
 
 
-  Bool_t result = Store("Calib", "Data", calibData, &metaData, 0, kTRUE);
+       result = Store("Calib", "Data", calibData, &metaData, 0, kTRUE);
+  }
 
   delete calibData;
 
   delete calibData;
+  delete sourceList; 
 
   if (!result) return 1;   
   return 0;
 
   if (!result) return 1;   
   return 0;