From: hristov Date: Sun, 24 Jun 2007 21:55:59 +0000 (+0000) Subject: Store DCS identification string for each sensor. Read Config entry from OCDB (Haavard) X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=24cd438b1320d0f48379335ad5b3151c725eb1f3;ds=sidebyside Store DCS identification string for each sensor. Read Config entry from OCDB (Haavard) --- diff --git a/STEER/AliDCSSensor.cxx b/STEER/AliDCSSensor.cxx index fe3c456550d..663851646a4 100644 --- a/STEER/AliDCSSensor.cxx +++ b/STEER/AliDCSSensor.cxx @@ -47,6 +47,7 @@ const Double_t kSecInHour = 3600.; // seconds in one hour AliDCSSensor::AliDCSSensor(): fId(), fIdDCS(0), + fStringID(), fStartTime(0), fEndTime(0), fGraph(0), @@ -64,6 +65,7 @@ AliDCSSensor::AliDCSSensor(const AliDCSSensor& source) : TNamed(source), fId(source.fId), fIdDCS(source.fIdDCS), + fStringID(source.fStringID), fStartTime(source.fStartTime), fEndTime(source.fEndTime), fGraph(source.fGraph), @@ -155,4 +157,46 @@ TGraph* AliDCSSensor::MakeGraph(Int_t nPoints) const return graph; } +//_____________________________________________________________________________ + +TClonesArray * AliDCSSensor::ReadTree(TTree* tree) { + // + // read values from ascii file + // + + Int_t nentries = tree->GetEntries(); + + char stringId[100]; + Int_t num=0; + Int_t idDCS=0; + Double_t x=0; + Double_t y=0; + Double_t z=0; + + tree->SetBranchAddress("StringID",&stringId); + tree->SetBranchAddress("IdDCS",&idDCS); + tree->SetBranchAddress("Num",&num); + tree->SetBranchAddress("X",&x); + tree->SetBranchAddress("Y",&y); + tree->SetBranchAddress("Z",&z); + + // firstSensor = (Int_t)tree->GetMinimum("ECha"); + // lastSensor = (Int_t)tree->GetMaximum("ECha"); + + TClonesArray * array = new TClonesArray("AliDCSSensor",nentries); + printf ("nentries = %d\n",nentries); + + for (Int_t isensor=0; isensorGetEntry(isensor); + sens->SetId(isensor); + sens->SetIdDCS(idDCS); + sens->SetStringID(TString(stringId)); + sens->SetX(x); + sens->SetY(y); + sens->SetZ(z); + + } + return array; +} diff --git a/STEER/AliDCSSensor.h b/STEER/AliDCSSensor.h index 072e6750d4b..09b3a9263a9 100644 --- a/STEER/AliDCSSensor.h +++ b/STEER/AliDCSSensor.h @@ -38,6 +38,7 @@ public: Int_t GetId() const {return fId; } Int_t GetIdDCS() const {return fIdDCS; } + const TString& GetStringID() const {return fStringID; } Double_t GetX() const {return fX; } Double_t GetY() const {return fY; } @@ -52,6 +53,7 @@ public: void SetId (Int_t id) {fId = id; } void SetIdDCS (Int_t iddcs) {fIdDCS = iddcs; } + void SetStringID (const TString& stringID) {fStringID = stringID; } void SetX (Double_t x) {fX = x; } void SetY (Double_t y) {fY = y; } @@ -67,15 +69,13 @@ public: Double_t GetValue(TTimeStamp time); Double_t Eval(const TTimeStamp& time) const; TGraph *MakeGraph (Int_t nPoints=100) const; + static TClonesArray * ReadTree(TTree *tree); - -// static TClonesArray * ReadList(const char *fname); -// static TClonesArray * ReadListInd(const char *fname, -// Int_t& firstSensor, Int_t& lastSensor); protected: - Int_t fId; // Internal number of sensor id (array index) - Int_t fIdDCS; // ID number in DCS + Int_t fId; // Internal number of sensor id (array index) + Int_t fIdDCS; // ID number in DCS + TString fStringID; // Amanda String ID UInt_t fStartTime; // start time for DCS map/fit UInt_t fEndTime; // end time for DCS map/fit TGraph * fGraph; // graph with values @@ -84,6 +84,7 @@ protected: Double_t fY; //Y-position of the sensor Double_t fZ; //Z-position of the sensor - ClassDef(AliDCSSensor,2); + ClassDef(AliDCSSensor,3); }; #endif +