* 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
//
//________________________________________________________________________
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)
{
//
//_________________________________________________________________________
AliT0Align::AliT0Align(const AliT0Align &align) :
TObject(),
+ fFileGlob(0x0),
fT0AAlignObj(0x0),
fT0CAlignObj(0x0),
- fFileGlob(0x0),
+ fDebug(0),
fXPos(0.),
fYPos(0.),
- fDebug(0),
fRepLoc(0)
{
//
{
// Float_t fZPos, shift;
// fZPos = surveyedPoints[3] - shift;
- return 99999;
+
}
//_______________________________________________________________________
void AliT0Align::CreateAlignObj(){
void AliT0Align::StoreAlignObj()
{
+ //
+ // Storing T0 alignment objects
+ //
AliCDBManager* cdb = AliCDBManager::Instance();
if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
//
#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:
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);
+/**************************************************************************
+ * 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)
//---------------------------------------------------------------
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;
}
}
}
-//---------------------------------------------------------------
-
-void AliT0DataDCS::CalcScalerMean(Float_t *t0_scal)
-{
- for (Int_t i=0; i<23; i++)
- {
- SetScalerMean(i,t0_scal[i]);
- }
-}
#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);
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
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"
#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
}
}
else
{
- /*
+
resultDCSMap=fData->ProcessData(*dcsAliasMap);
if(!resultDCSMap)
{
}
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
/* $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:
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