hot channels and modulewise mean values are taken care of in the preprocessor
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Jun 2009 07:35:15 +0000 (07:35 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 22 Jun 2009 07:35:15 +0000 (07:35 +0000)
PMD/AliPMDMeanSm.cxx [new file with mode: 0644]
PMD/AliPMDMeanSm.h [new file with mode: 0644]
PMD/AliPMDPreprocessor.cxx
PMD/CMake_libPMDbase.txt
PMD/PMDbaseLinkDef.h
PMD/libPMDbase.pkg

diff --git a/PMD/AliPMDMeanSm.cxx b/PMD/AliPMDMeanSm.cxx
new file mode 100644 (file)
index 0000000..89e574f
--- /dev/null
@@ -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 (file)
index 0000000..7576cca
--- /dev/null
@@ -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
index 12ea0ff..795d1c5 100644 (file)
@@ -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<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;
index a43da1d..61691df 100644 (file)
@@ -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
index a092fff..677dfc5 100644 (file)
@@ -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
index 0b25bf4..76d8e75 100644 (file)
@@ -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)