--- /dev/null
+/***************************************************************************
+ * 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. *
+ **************************************************************************/
+//
+// Author : Z. Ahmed
+//
+#include "TNamed.h"
+#include "AliCDBEntry.h"
+#include "AliPMDMeanSm.h"
+
+
+ClassImp(AliPMDMeanSm)
+
+AliPMDMeanSm::AliPMDMeanSm()
+{
+ // Default constructor
+ Reset();
+}
+// ----------------------------------------------------------------- //
+AliPMDMeanSm::AliPMDMeanSm(const char* name)
+{
+ //constructor
+ TString namst = "Calib_";
+ namst += name;
+ SetName(namst.Data());
+ SetTitle(namst.Data());
+ Reset();
+
+}
+// ----------------------------------------------------------------- //
+AliPMDMeanSm::AliPMDMeanSm(const AliPMDMeanSm& meanda) :
+ TNamed(meanda)
+{
+ // copy constructor
+ SetName(meanda.GetName());
+ SetTitle(meanda.GetName());
+ Reset();
+ for(Int_t det = 0; det < kDet; det++)
+ {
+ for(Int_t smn = 0; smn < kModule; smn++)
+ {
+ fMeanSm[det][smn] = meanda.GetMeanSm(det,smn);
+ }
+ }
+}
+// ----------------------------------------------------------------- //
+AliPMDMeanSm &AliPMDMeanSm::operator =(const AliPMDMeanSm& meanda)
+{
+ //asignment operator
+ SetName(meanda.GetName());
+ SetTitle(meanda.GetName());
+ Reset();
+ for(Int_t det = 0; det < kDet; det++)
+ {
+ for(Int_t smn = 0; smn < kModule; smn++)
+ {
+ fMeanSm[det][smn] = meanda.GetMeanSm(det,smn);
+ }
+ }
+ return *this;
+}
+// ----------------------------------------------------------------- //
+AliPMDMeanSm::~AliPMDMeanSm()
+{
+ //destructor
+}
+// ----------------------------------------------------------------- //
+void AliPMDMeanSm::Reset()
+{
+ //memset(fgainfact ,1,2*24*48*96*sizeof(Float_t));
+
+ for(Int_t det = 0; det < kDet; det++)
+ {
+ for(Int_t smn = 0; smn < kModule; smn++)
+ {
+ fMeanSm[det][smn] = 1.;
+ }
+ }
+}
+// ----------------------------------------------------------------- //
+Float_t AliPMDMeanSm:: GetMeanSm(Int_t det, Int_t smn) const
+{
+ return fMeanSm[det][smn];
+}
+// ----------------------------------------------------------------- //
+void AliPMDMeanSm::SetMeanSm(Int_t det, Int_t smn, Float_t smmean)
+{
+ fMeanSm[det][smn]= smmean;
+}
+
+// ----------------------------------------------------------------- //
+void AliPMDMeanSm::Print(Option_t *) const
+{
+ printf("\n ######Mean Values of Super Modules are ####\n");
+ for(Int_t det = 0; det < kDet; det++)
+ {
+ for(Int_t smn = 0; smn < kModule; smn++)
+ {
+ {
+ printf("Gain[%d,%d]= %2.1f \n",det,smn,fMeanSm[det][smn]);
+ }
+ printf("\n");
+ }
+ }
+}
--- /dev/null
+#ifndef ALIPMDMEANSM_H
+#define ALIPMDMEANSM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+
+class TNamed;
+class AliCDBEntry;
+class AliPMD;
+
+class AliPMDMeanSm: public TNamed
+{
+ public:
+ AliPMDMeanSm();
+ AliPMDMeanSm(const char* name);
+ AliPMDMeanSm(const AliPMDMeanSm &meanda);
+ AliPMDMeanSm& operator= (const AliPMDMeanSm &meanda);
+ virtual ~AliPMDMeanSm();
+ void Reset();
+ void SetMeanSm(Int_t det, Int_t smn,Float_t meansm);
+ Float_t GetMeanSm(Int_t det, Int_t smn) const;
+ virtual void Print(Option_t *) const;
+
+ protected:
+
+ enum
+ {
+ kDet = 2, // Number of plane
+ kModule = 24 // Modules per plane
+ };
+ Float_t fMeanSm[kDet][kModule];
+
+ ClassDef(AliPMDMeanSm,0) // calibration class for gainfactors
+};
+#endif
#include "AliCDBMetaData.h"
#include "AliPMDCalibData.h"
#include "AliPMDHotData.h"
+#include "AliPMDMeanSm.h"
#include "AliPMDPedestal.h"
#include "AliPMDPreprocessor.h"
Log("Error storing");
return 1;
}
- //----------------------------------------------------
+ //------------------For Storing HOT Data-------------------------//
AliPMDHotData *hotda = new AliPMDHotData();
TList* filesource = GetFileSources(kDAQ, "PMD_HOT.root");
return 1;
}
//-------------------------------------------------------------------
-
+//-----------------------------------for storing SM MEAN--------------//
+
+ //------------------For Storing HOT Data-------------------------//
+ AliPMDMeanSm *smmeanda = new AliPMDMeanSm();
+ TList* filesourc = GetFileSources(kDAQ, "PMD_MEAN_SM.root");
- // Store DCS data for reference
+ if(!filesourc) {
+ Log(Form("No sources found for PMD_MEAN_SM.root!"));
+ return 1;
+ }
+
+ AliInfo("Here's the list of sources for PMD_MEAN_SM.root");
+ filesourc->Print();
+
+ TIter iter3(filesourc);
+ TObjString* sourc;
+ UInt_t meanresult = 0;
+ TString filenam;
+ while((sourc=dynamic_cast<TObjString*> (iter3.Next()))){
+ filenam = GetFile(kDAQ, "PMD_MEAN_SM.root", sourc->GetName());
+ if(filenam.Length() == 0) {
+ Log(Form("Error retrieving file from source %s failed!", sourc->GetName()));
+ delete filesourc;
+ return 1;
+ }
+
+ Log(Form("File with id PMD_MEAN_SM.root got from %s", sourc->GetName()));
+
+ Int_t det, sm ;
+ Float_t smmean;
+
+ TFile *f3= new TFile(filenam.Data());
+ if(!f3 || !f3->IsOpen())
+ {
+ Log(Form("Error opening file with Id PMD_MEAN_SM.root from source %s!", sourc->GetName()));
+ return 1;
+ }
+ TTree *tree2 = dynamic_cast<TTree *> (f3->Get("mean"));
+ if (!tree2)
+ {
+ Log("Could not find object \"hot\" in DAQ file!");
+ return 1;
+ }
+
+ tree2->SetBranchAddress("det", &det);
+ tree2->SetBranchAddress("sm", &sm);
+ tree2->SetBranchAddress("smmean", &smmean);
+
+ Int_t nEntries = (Int_t) tree2->GetEntries();
+ for(Int_t j = 0; j < nEntries; j++)
+ {
+ tree2->GetEntry(j);
+ smmeanda->SetMeanSm(det,sm,smmean);
+ }
+ f3->Close();
+ delete f3;
+ }
+ meanresult = Store("Calib","SMMEAN", smmeanda, &metaData);
+ delete smmeanda;
+ if(meanresult==0)
+ {
+ Log("Error storing");
+ return 1;
+ }
+ // -------------Store DCS data for reference------------//
AliCDBMetaData metadata;
metadata.SetComment("DCS data for PMD");
Bool_t resStore = kFALSE;
# -*- mode: cmake -*-
set(SRCS
-AliPMDLoader.cxx AliPMDdigit.cxx AliPMDBlockHeader.cxx AliPMDDspHeader.cxx AliPMDPatchBusHeader.cxx AliPMDddldata.cxx AliPMDRawStream.cxx AliPMDCalibData.cxx AliPMDCalibrator.cxx AliPMDPreprocessor.cxx AliPMDRawToSDigits.cxx AliPMDPedestal.cxx AliPMDsdigit.cxx AliPMDQAChecker.cxx AliPMDMisAligner.cxx AliPMDHotData.cxx
+AliPMDLoader.cxx AliPMDdigit.cxx AliPMDBlockHeader.cxx AliPMDDspHeader.cxx AliPMDPatchBusHeader.cxx AliPMDddldata.cxx AliPMDRawStream.cxx AliPMDCalibData.cxx AliPMDCalibrator.cxx AliPMDPreprocessor.cxx AliPMDRawToSDigits.cxx AliPMDPedestal.cxx AliPMDsdigit.cxx AliPMDQAChecker.cxx AliPMDMisAligner.cxx AliPMDHotData.cxx AliPMDMeanSm.cxx
)
# fill list of header files from list of source files
#pragma link C++ class AliPMDQAChecker+;
#pragma link C++ class AliPMDMisAligner+;
#pragma link C++ class AliPMDHotData+;
+#pragma link C++ class AliPMDMeanSm+;
#endif
#-*- Mode: Makefile -*-
# $Id$
-SRCS:= AliPMDLoader.cxx AliPMDdigit.cxx AliPMDBlockHeader.cxx AliPMDDspHeader.cxx AliPMDPatchBusHeader.cxx AliPMDddldata.cxx AliPMDRawStream.cxx AliPMDCalibData.cxx AliPMDCalibrator.cxx AliPMDPreprocessor.cxx AliPMDRawToSDigits.cxx AliPMDPedestal.cxx AliPMDsdigit.cxx AliPMDQAChecker.cxx AliPMDMisAligner.cxx AliPMDHotData.cxx
+SRCS:= AliPMDLoader.cxx AliPMDdigit.cxx AliPMDBlockHeader.cxx AliPMDDspHeader.cxx AliPMDPatchBusHeader.cxx AliPMDddldata.cxx AliPMDRawStream.cxx AliPMDCalibData.cxx AliPMDCalibrator.cxx AliPMDPreprocessor.cxx AliPMDRawToSDigits.cxx AliPMDPedestal.cxx AliPMDsdigit.cxx AliPMDQAChecker.cxx AliPMDMisAligner.cxx AliPMDHotData.cxx AliPMDMeanSm.cxx
HDRS:= $(SRCS:.cxx=.h)