]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fixed violations
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Jan 2008 09:23:16 +0000 (09:23 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Jan 2008 09:23:16 +0000 (09:23 +0000)
T0/AliT0Align.cxx
T0/AliT0Align.h
T0/AliT0DataDCS.cxx
T0/AliT0DataDCS.h
T0/AliT0Preprocessor.cxx
T0/AliT0Preprocessor.h

index ac82c400a66cc1efe8d818790a67ed23ea3c36ff..e0bfe45751a424990488e0a347b247fecea47569 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-// Class creating the T0 aligmnent objects from the surveys.
+/*
+$Log: AliT0Align.cxx,v $
+ Revision   2008/01/30
+Removing code violations 
 
-//
-//  Creates the T0 align object
-//
+ Version 1.1  2006/10
+Preliminary test version (T.Malkiewicz)
+*/
 
 #include "AliT0Align.h"
-//
 #include "TROOT.h"
 #include "Riostream.h"
 #include "TFile.h"
 #include "TMath.h"
 #include "TSystem.h"
 #include "AliSurveyObj.h"
-#include "AliSurveyPoint.h"
 #include "AliAlignObjParams.h"
 #include "AliCDBStorage.h"
 #include <TClonesArray.h>
 #include <TFile.h>
 #include "AliLog.h"
 #include "AliCDBManager.h"
+#include "AliSurveyPoint.h" 
+
+// Class creating the T0 aligmnent objects 
+// from the surveys done by surveyers at Point2.
+// Survey results are fetched from 
+// Survey Depot, based on survey results 
+// position of T0 alignment objects is computed.
+
 
 ClassImp(AliT0Align)
 
 AliT0Align::AliT0Align() :
   TObject(),
+  fFileGlob(0x0),
   fT0AAlignObj(0x0),
   fT0CAlignObj(0x0),
-  fFileGlob(0x0),
+  fDebug(0),
   fXPos(0.),
   fYPos(0.),
-  fDebug(0),
   fRepLoc(0)
-{
+
+ {
   //
   //  default constructor
   //
@@ -54,12 +64,12 @@ AliT0Align::AliT0Align() :
 //________________________________________________________________________
 AliT0Align::AliT0Align(Int_t reportloc, Int_t reportglob) :
   TObject(),
+  fFileGlob(0x0),
   fT0AAlignObj(0x0),
   fT0CAlignObj(0x0),
-  fFileGlob(0x0),
+  fDebug(0),
   fXPos(0.),
   fYPos(0.),
-  fDebug(0),
   fRepLoc(0)
 {
   //
@@ -78,12 +88,12 @@ AliT0Align::AliT0Align(Int_t reportloc, Int_t reportglob) :
 //_________________________________________________________________________
 AliT0Align::AliT0Align(const AliT0Align &align) :
   TObject(),
+  fFileGlob(0x0),
   fT0AAlignObj(0x0),
   fT0CAlignObj(0x0),
-  fFileGlob(0x0),
+  fDebug(0),
   fXPos(0.),
   fYPos(0.),
-  fDebug(0),
   fRepLoc(0)
 {
   //
@@ -178,7 +188,7 @@ Double_t AliT0Align::ComputePosition()
 {
  //  Float_t fZPos, shift;
  //  fZPos = surveyedPoints[3] - shift;
-  return 99999;
+       
 }
 //_______________________________________________________________________
 void AliT0Align::CreateAlignObj(){
@@ -217,6 +227,9 @@ void AliT0Align::Run(){
 
 void AliT0Align::StoreAlignObj()
 {
+ //
+ // Storing T0 alignment objects 
+ //
  AliCDBManager* cdb = AliCDBManager::Instance();
  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
  //
index 81e514374b65fc952da7194c532607ed2f6479fa..fb80568370142060a64f42e6f754b99eed305d4f 100644 (file)
 #include <TMatrixDfwd.h>
 #include <TMatrixT.h>
 
+// Class creating the T0 aligmnent objects
+// from the surveys done by surveyers at Point2.
+// Position of T0 alignment objects is computed.
+
 class AliT0Align : public TObject {
 
  public:
@@ -35,8 +39,8 @@ class AliT0Align : public TObject {
   AliAlignObjParams *fT0AAlignObj;  // T0-A alignment object
   AliAlignObjParams *fT0CAlignObj;  // T0-C alignment object
   Int_t fDebug;                     // debug flag
-  Float_t fXPos;
-  Float_t fYPos;  
+  Float_t fXPos;                   // "x" coordinate of T0-C with respect to Global Reference System  
+  Float_t fYPos;                   // "y" coordinate of T0-C with respect to Global Reference System
   Int_t fRepLoc;                   // Location of the report: 0 - DCDB (Grid), 1,2 ... - file on local disc    
 
   ClassDef(AliT0Align,0);
index 37b4fa76cc1e26082188d6b67a54fd131e555375..364d87a04a2655cbe8c4026a32d9fcd6d8a1180c 100644 (file)
@@ -1,3 +1,26 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, 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.                  *
+ **************************************************************************/
+
+/*
+$Log: AliT0DataDCS.cxx,v $
+ Revision   2008/01/30 
+Fetching data points from DCS, calculating mean and storing data to Reference DB 
+ Version 1.1  2006/10
+Preliminary test version (T.Malkiewicz)
+*/
+
 #include "AliT0DataDCS.h"
 
 #include "AliCDBMetaData.h"
 #include <TStyle.h>
 #include <TCanvas.h>
 
+// AliT0DataDCS class
+// declaring DCS aliases for T0
+// fetching T0 data points from DCS, 
+// calculating mean values for the entire run
+// and storing the result to Reference DB
+
 ClassImp(AliT0DataDCS)
 
 //---------------------------------------------------------------
 AliT0DataDCS::AliT0DataDCS():
        TObject(),
-       fRun(0),
+       fRun(0),        
        fStartTime(0),
        fEndTime(0),
        fIsProcessed(kFALSE)
@@ -49,55 +78,49 @@ AliT0DataDCS::~AliT0DataDCS() {
 //---------------------------------------------------------------
 Bool_t AliT0DataDCS::ProcessData(TMap& aliasMap)
 {
-               Float_t t0_scaler[32]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+               Float_t t0_scaler[32];
+               Int_t aliasEntr[32];
                TObjArray *aliasArr;
-               AliDCSValue* aValue;
                for(int j=0; j<kNAliases; j++)
                {
-                  aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
+                 for (Int_t k=0;k<32;k++) 
+                 {
+                   t0_scaler[k]=0;
+                   aliasEntr[k]=0;     
+                 }
+                 aliasArr = (TObjArray*) aliasMap.GetValue(fAliasNames[j].Data());
                   if(!aliasArr)
                   {
                         AliError(Form("Alias %s not found!", fAliasNames[j].Data()));
                         continue;
                   }
-                  // Introduce(j, aliasArr);
-
                   if(aliasArr->GetEntries()<2)
                   {
                         AliError(Form("Alias %s has just %d entries!",
                                         fAliasNames[j].Data(),aliasArr->GetEntries()));
                         continue;
                   }
-
-                 for(int j=0; j<32; j++)
+                 aliasEntr[j] = aliasArr->GetEntries();
+                 for(int l=0; l<aliasEntr[j]; l++)
                  {
-                   TString aliasName =Form("t00_ac_scaler_%d",j);
-                    // printf("aliasname: %s\n",aliasName.Data());
-                    //aliasArr = dynamic_cast<TObjArray*> (aliasMap->GetValue(aliasName.Data()));
-                    if(!aliasArr)
-                   {
-                      AliError(Form("Alias %s not found!", aliasName.Data()));
-                      continue;
-                    }
-                  AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(j));
-                  // printf("I'm here! %f %x\n", aValue->GetFloat(), aValue->GetTimeStamp());
-                 t0_scaler[j]= aValue->GetFloat();
+                  AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(l));
+                 t0_scaler[j]+= aValue->GetFloat();
                  }
+               fScalerMean[j] = t0_scaler[j] / aliasEntr[j] ;
                }
-       CalcScalerMean(t0_scaler);
        fIsProcessed=kTRUE;
+       return kTRUE;
 }
 
 //---------------------------------------------------------------
 void AliT0DataDCS::Init()
 {
-
-       TH1::AddDirectory(kFALSE);
-
+       TString sindex;
        for(int i=0;i<kNAliases;i++)
        {
-               fAliasNames[i] = "DCSAlias";
-               fAliasNames[i] += i;
+               fAliasNames[i] = "t00_ac_scaler_";
+                sindex.Form("%02d",i);
+               fAliasNames[i] += sindex;
        }
 
 }
@@ -111,14 +134,5 @@ void AliT0DataDCS::Introduce(UInt_t numAlias, const TObjArray* aliasArr){
 
 }
 
-//---------------------------------------------------------------
-
-void AliT0DataDCS::CalcScalerMean(Float_t *t0_scal)
-{
-  for (Int_t i=0; i<23; i++)
-    {
-        SetScalerMean(i,t0_scal[i]);
-    }
-}
 
 
index 84bac79559e9c445e593f78afc1700d456a9af6d..ad59799a9d2e6febdbfb9bfe54f1131592c4eb25 100644 (file)
@@ -1,16 +1,20 @@
 #ifndef AliT0DataDCS_H
 #define AliT0DataDCS_H
 
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
 #include <TMap.h>
 #include <TClonesArray.h>
-#include <TH2F.h>
 #include <TGraph.h>
-#include <TF1.h>
+
+// AliT0DataDCS class
+// fetching T0 data points from DCS, calculating mean values for the run
+// and storing the result to Reference DB
 
 class AliT0DataDCS : public TObject {
 public:
-       enum {kNAliases=6};
-
+       enum {kNAliases=32};
 
        AliT0DataDCS();
        AliT0DataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime);
@@ -19,39 +23,25 @@ public:
        void SetRun(Int_t run) {fRun = run;}
        void SetStartTime(Int_t startTime) {fStartTime = startTime;}
        void SetEndTime(Int_t endTime) {fEndTime = endTime;}
-       Int_t GetRun() {return fRun;}
-       Int_t GetStartTime() {return fStartTime;}
-       Int_t GetEndTime() {return fEndTime;}
+       Int_t GetRun() const {return fRun;}
+       Int_t GetStartTime() const {return fStartTime;}
+       Int_t GetEndTime() const {return fEndTime;}
 
        Bool_t ProcessData(TMap& aliasMap);
 
-       //const char* GetAliasName(UInt_t pos)
-       //              {return pos<kNAliases ? fAliasNames[pos].Data() : 0;}
-
-       void CalcScalerMean(Float_t* t0_scal);
-
-
 private:
        void Init();
        void Introduce(UInt_t numAlias, const TObjArray* aliasArr);
 
-       Int_t fRun;
-       UInt_t fStartTime;
-       UInt_t fEndTime;
-
-
-       TString fAliasNames[kNAliases];
-
-       Bool_t fIsProcessed;
-       void SetScalerMean(Int_t channel, Float_t val) {fScalerMean[channel]=val;}
-       Float_t  GetScalerMean(Int_t channel)        const {return fScalerMean[channel];}
-       Float_t* GetScalerMean()          const {return (float*)fScalerMean;}
-
-
+       Int_t fRun;     // Run number
+       UInt_t fStartTime;      // Start time
+       UInt_t fEndTime;        // End time
+       Float_t fScalerMean[32];        // Mean value of T0 scaler counts from the entire run 
+       TString fAliasNames[kNAliases];         // T0 data points aliases  
+       Bool_t fIsProcessed;                    // status - was processing data successful
        ClassDef(AliT0DataDCS, 2);
 
 protected:
-       Float_t     fScalerMean[24];    
 };
 
 #endif
index a021c5c31b83007eb66cc277a7a9cb9913fc6928..f55572d6c996055e4cad788bd8a5ca2a7dc8bd7a 100644 (file)
@@ -30,12 +30,6 @@ Preprocessor storing data to OCDB (T.Malkiewicz)
 Version 1.1  2006/10   
 Preliminary test version (T.Malkiewicz)
 */   
-// T0 preprocessor:
-// 1) takes data from DCS and passes it to the class AliTOFDataDCS 
-// for processing and writes the result to the Reference DB.
-// 2) takes data form DAQ (both from Laser Calibration and Physics runs), 
-// processes it, and stores either to OCDB or to Reference DB.
-
 
 #include "AliT0Preprocessor.h"
 #include "AliT0DataDCS.h"
@@ -52,13 +46,17 @@ Preliminary test version (T.Malkiewicz)
 #include <TNamed.h>
 #include "AliT0Dqclass.h"
 
+// T0 preprocessor:
+// 1) takes data from DCS and passes it to the class AliTOFDataDCS 
+// for processing and writes the result to the Reference DB.
+// 2) takes data form DAQ (both from Laser Calibration and Physics runs), 
+// processes it, and stores either to OCDB or to Reference DB.
+
 
 ClassImp(AliT0Preprocessor)
 
 //____________________________________________________
-AliT0Preprocessor::AliT0Preprocessor(AliShuttleInterface* shuttle) : 
-  AliPreprocessor("T00", shuttle), 
-  fData(0)
+AliT0Preprocessor::AliT0Preprocessor(AliShuttleInterface* shuttle) : AliPreprocessor("T00", shuttle), fData(0)
 {
   //constructor
 }
@@ -105,7 +103,7 @@ UInt_t AliT0Preprocessor::Process(TMap* dcsAliasMap )
         }
         else
         {
-         /*
+         
           resultDCSMap=fData->ProcessData(*dcsAliasMap);
           if(!resultDCSMap)
           {
@@ -114,22 +112,19 @@ UInt_t AliT0Preprocessor::Process(TMap* dcsAliasMap )
           }
           else
           {
-           Float_t *meanScaler[24] = fData->GetScalerMean();
-               
             AliCDBMetaData metaDataDCS;
             metaDataDCS.SetBeamPeriod(0);
             metaDataDCS.SetResponsible("Tomasz Malkiewicz");
             metaDataDCS.SetComment("This preprocessor fills an AliTODataDCS object.");
             AliInfo("Storing DCS Data");
-            resultDCSStore = Store("Calib","DCSData",meanScaler, &metaDataDCS);
+            resultDCSStore = StoreReferenceData("Calib","DCSData", fData, &metaDataDCS);
             if (!resultDCSStore)
             {
               Log("Some problems occurred while storing DCS data results in ReferenceDB");
-              return 2;// return error Code for processed DCS data not stored
+              //return 2;// return error Code for processed DCS data not stored
             }
 
           }
-         */
         }
 
         // processing DAQ
index 6d66f110a64b701021297923cc9f027f8a2b6518..5f74eda82941e79030ce8cd47b8f7af701cfba28 100644 (file)
@@ -6,22 +6,22 @@
 
 /* $Id$ */
 
+#include "AliPreprocessor.h"
 
 // T0 preprocessor. 
 // Takes data from DCS and passes it to the class AliTOFDataDCS for processing and writes the result to the Reference DB.
 // Takes data form DAQ (both from Laser Calibration and Physics runs), processes it, and stores either to OCDB or to Reference DB.
 
-#include "AliPreprocessor.h"
-
 class AliT0DataDCS;
 
 class AliT0Preprocessor: public AliPreprocessor 
 {
   public:
-        AliT0Preprocessor(): AliPreprocessor("T00",0),  
-         fData(0)
- { }
+        AliT0Preprocessor(): AliPreprocessor("T00",0),
+         fData(0) { }
         AliT0Preprocessor(AliShuttleInterface* shuttle);
+       AliT0Preprocessor& operator= (const AliT0Preprocessor &) { return *this;};
+
        virtual ~AliT0Preprocessor();
   
   protected:
@@ -30,11 +30,8 @@ class AliT0Preprocessor: public AliPreprocessor
 
   private:
        AliT0Preprocessor(const AliT0Preprocessor & proc); // copy constructor  
-       AliT0Preprocessor& operator=(const AliT0Preprocessor&); //operator
-       AliT0DataDCS *fData;                    // Data member to process DCS data      
-       ClassDef(AliT0Preprocessor, 2)
+       AliT0DataDCS *fData;                    // Data member to process DCS data      
+       ClassDef(AliT0Preprocessor, 1)
 };
 
 typedef AliT0Preprocessor AliSTARTPreprocessor; // for backward compatibility