From 4e4204d5bc68354355fbeaa94f8e15570e762e96 Mon Sep 17 00:00:00 2001 From: basanta Date: Mon, 22 Jun 2009 07:35:15 +0000 Subject: [PATCH] hot channels and modulewise mean values are taken care of in the preprocessor --- PMD/AliPMDMeanSm.cxx | 116 +++++++++++++++++++++++++++++++++++++ PMD/AliPMDMeanSm.h | 35 +++++++++++ PMD/AliPMDPreprocessor.cxx | 69 +++++++++++++++++++++- PMD/CMake_libPMDbase.txt | 2 +- PMD/PMDbaseLinkDef.h | 1 + PMD/libPMDbase.pkg | 2 +- 6 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 PMD/AliPMDMeanSm.cxx create mode 100644 PMD/AliPMDMeanSm.h diff --git a/PMD/AliPMDMeanSm.cxx b/PMD/AliPMDMeanSm.cxx new file mode 100644 index 00000000000..89e574f885e --- /dev/null +++ b/PMD/AliPMDMeanSm.cxx @@ -0,0 +1,116 @@ +/*************************************************************************** + * 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"); + } + } +} diff --git a/PMD/AliPMDMeanSm.h b/PMD/AliPMDMeanSm.h new file mode 100644 index 00000000000..7576ccaf9d2 --- /dev/null +++ b/PMD/AliPMDMeanSm.h @@ -0,0 +1,35 @@ +#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 diff --git a/PMD/AliPMDPreprocessor.cxx b/PMD/AliPMDPreprocessor.cxx index 12ea0ff2317..795d1c579f8 100644 --- a/PMD/AliPMDPreprocessor.cxx +++ b/PMD/AliPMDPreprocessor.cxx @@ -30,6 +30,7 @@ #include "AliCDBMetaData.h" #include "AliPMDCalibData.h" #include "AliPMDHotData.h" +#include "AliPMDMeanSm.h" #include "AliPMDPedestal.h" #include "AliPMDPreprocessor.h" @@ -241,7 +242,7 @@ UInt_t AliPMDPreprocessor::Process(TMap* pdaqAliasMap) Log("Error storing"); return 1; } - //---------------------------------------------------- + //------------------For Storing HOT Data-------------------------// AliPMDHotData *hotda = new AliPMDHotData(); TList* filesource = GetFileSources(kDAQ, "PMD_HOT.root"); @@ -315,9 +316,71 @@ UInt_t AliPMDPreprocessor::Process(TMap* pdaqAliasMap) 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 (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 (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; diff --git a/PMD/CMake_libPMDbase.txt b/PMD/CMake_libPMDbase.txt index a43da1dcece..61691df2322 100644 --- a/PMD/CMake_libPMDbase.txt +++ b/PMD/CMake_libPMDbase.txt @@ -1,7 +1,7 @@ # -*- 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 diff --git a/PMD/PMDbaseLinkDef.h b/PMD/PMDbaseLinkDef.h index a092fffb7bf..677dfc59197 100644 --- a/PMD/PMDbaseLinkDef.h +++ b/PMD/PMDbaseLinkDef.h @@ -24,4 +24,5 @@ #pragma link C++ class AliPMDQAChecker+; #pragma link C++ class AliPMDMisAligner+; #pragma link C++ class AliPMDHotData+; +#pragma link C++ class AliPMDMeanSm+; #endif diff --git a/PMD/libPMDbase.pkg b/PMD/libPMDbase.pkg index 0b25bf46e75..76d8e7565b0 100644 --- a/PMD/libPMDbase.pkg +++ b/PMD/libPMDbase.pkg @@ -1,7 +1,7 @@ #-*- 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) -- 2.43.0