Bug fix
authorlietava <lietava@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Oct 2009 14:37:16 +0000 (14:37 +0000)
committerlietava <lietava@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Oct 2009 14:37:16 +0000 (14:37 +0000)
STEER/AliCTPInputTimeParams.cxx
STEER/AliCTPInputTimeParams.h
STEER/AliCTPTimeParams.cxx
STEER/AliCTPTimeParams.h

index fa0c124..eb9875e 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id: AliCTPInputTimeParams.cxx 22322 2007-11-22 11:43:14Z cvetan $ */
 
 #include <Riostream.h>
 
-
 #include "TObject.h"
 #include "AliLog.h"   
 #include "AliCTPInputTimeParams.h"
index 5ce1889..c1c3dec 100644 (file)
@@ -1,14 +1,9 @@
-#ifndef ALITIMESTAMP_H
-#define ALITIMESTAMP_H
+#ifndef ALICTPINPUTTIMEPARAMS_H
+#define ALICTPINPUTTIMEPARAMS_H
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id: AliCTPInputTimeParams.h 22322 2007-11-22 11:43:14Z cvetan $ */
-
-///////////////////////////////////////////////////////////////////////////////
-//
-
+* See cxx source for full Copyright notice */
+/* $Id$ */
 
 class TObject;
 
index c50bb99..3f44c5a 100644 (file)
@@ -1,3 +1,19 @@
+/*************************************************************************
+* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  * 
+**************************************************************************/
+
+
 #include <Riostream.h>
 
 #include <TObjArray.h>
@@ -6,8 +22,6 @@
 #include <TString.h>
 #include <TSystem.h>
 #include <TFile.h>
-#include <TCint.h>
-#include <TROOT.h>
 
 #include "AliLog.h"
 #include "AliCTPTimeParams.h"
@@ -15,8 +29,6 @@
 
 ClassImp(AliCTPTimeParams)
 
-const TString AliCTPTimeParams::fgkCTPTimeParamsFileName("/data/CTPTimeParams.root");
-
 //______________________________________________________________________________
 AliCTPTimeParams::AliCTPTimeParams():
 TNamed(),
@@ -31,7 +43,8 @@ fCTPInputTimeParams()
 AliCTPTimeParams::AliCTPTimeParams(const AliCTPTimeParams &timeparams):
  TNamed(),
  fDelayL1L0(timeparams.fDelayL1L0),
- fDelayL2L0(timeparams.fDelayL2L0)
+ fDelayL2L0(timeparams.fDelayL2L0),
+ fCTPInputTimeParams()
 {
  for (Int_t i = 0; i < timeparams.fCTPInputTimeParams.GetSize(); i++) {
  if ( timeparams.fCTPInputTimeParams[i] ) fCTPInputTimeParams.Add(timeparams.fCTPInputTimeParams[i]->Clone());
@@ -84,7 +97,7 @@ AliCTPTimeParams* AliCTPTimeParams::LoadCTPTimeParams(TString filename)
  // By default files are stored in GRP/CTP folder
  // The filename is constructed as GRP/CTP/<file>.cfg
   if( gSystem->AccessPathName( filename.Data() )) {
-  //AliErrorClass( Form( "File (%s) not found!", filename.Data()));
+ // AliError( Form( "File (%s) not found!", filename.Data()));
   return NULL;
  }
 
@@ -133,13 +146,14 @@ AliCTPTimeParams* AliCTPTimeParams::LoadCTPTimeParamsFromString(const char* time
 
      if (ctptime->ProcessCTPTimeParamsLine(string->String()) == kFALSE)
      {
-        delete ctptime;
+        ctptime  = 0x0;
         break;
      }
    }
 
    delete tokens;
-   return ctptime;
+   if (ctptime) return ctptime;
+   else return NULL;
 }
 
 //______________________________________________________________________________
@@ -159,7 +173,9 @@ Bool_t AliCTPTimeParams::ProcessCTPTimeParamsLine(const char* line)
    if (strline.BeginsWith("0")) { level = 0; }   // determine the input level (0, 1 or 2)
    else if (strline.BeginsWith("1")) { level = 1; }
    else if (strline.BeginsWith("2")) { level = 2; } 
-   else return 0; // file not in the right format!
+   else {
+          return 0; // file not in the right format!
+   }
    
    TObjArray *tokens = strline.Tokenize(" \t");
    AddInput(((TObjString*)tokens->At(0))->String(), level, ((TObjString*)tokens->At(2))->String().Atoi(), ((TObjString*)tokens->At(1))->String() );
@@ -169,17 +185,6 @@ return kTRUE;
 }
 
 //______________________________________________________________________________
-Bool_t AliCTPTimeParams::GetCTPTimeParamsDAQLog()
-{
-
-}
-
-//______________________________________________________________________________
-Bool_t AliCTPTimeParams::WriteCTPTimeParamsOCDB()
-{
-
-}
-//______________________________________________________________________________
 void AliCTPTimeParams::Print(const Option_t*) const
 {
   //Print
index d88a411..fef8ea6 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef ALICTPTIMEPARAMS_H
 #define ALICTPTIMEPARAMS_H
 
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice */
+/* $Id$ */
 
 #include<TNamed.h>
 #include<TObjArray.h>
@@ -20,33 +23,19 @@ public:
        static AliCTPTimeParams* LoadCTPTimeParams(TString filename);   
        static AliCTPTimeParams* LoadCTPTimeParamsFromString(const char* timeparams);
                Bool_t ProcessCTPTimeParamsLine(const char* line);
-               Bool_t WriteCTPTimeParamsOCDB();
-               Bool_t GetCTPTimeParamsDAQLog();
                  void AddInput( TString& inputName, UInt_t& inputLevel, UInt_t inputDelay, TString inputEdge );
                  void AddDelayL0L1L2(UInt_t delayL1L0, UInt_t delayL2L0);
          virtual void Print(const Option_t* opt="") const;
                //Setters
 
                //Getters
-               UInt_t GetDelayL1L0()   const { return fDelayL1L0; }
-               UInt_t GetDelayL2L0()   const { return fDelayL2L0; }
-/*             UInt_t* GetDelayInputs() { return fDelayInputs; }
-               Bool_t* GetInputIndex()  { return fInputIndex; }                
-               UInt_t* GetInputLevel()  { return fInputLevel; }*/
-
+               UInt_t  GetDelayL1L0()   const { return fDelayL1L0; }
+               UInt_t  GetDelayL2L0()   const { return fDelayL2L0; }                  const TObjArray* GetInputTimeParams() const { return &fCTPInputTimeParams; }
                 enum {kNMaxInputs = 60}; //CTP can manage up to 60 trigger detector inputs
 private:
                        UInt_t fDelayL1L0;
                        UInt_t fDelayL2L0;
                        TObjArray fCTPInputTimeParams;
-/*
-                       UInt_t fInputDelay[kNMaxInputs];
-                       Bool_t fInputFlag[kNMaxInputs];
-                       UInt_t fInputLevel[kNMaxInputs];
-                      TString fInputName[kNMaxInputs];
-                        Char_t fInputEdge[kNMaxInputs];
-*/
-          static const TString fgkCTPTimeParamsFileName;   //Name of file containing the CTPTimeParams
 
   ClassDef( AliCTPTimeParams, 1 ) 
 };