]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 12ea0ff231750bd8d5ff21569c98dcda7ae1e1d1..795d1c579f8940ecc0782377fd8030c30ef6d887 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 a43da1dcece40a1e2a80be3063687c1ea1736a93..61691df232266e0fe7e86eb053789558f04c867c 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 a092fffb7bf9e9e6b0146fcbf4edd70c2285a696..677dfc59197467cb719b89a0a6d1da6d371fb4f8 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 0b25bf46e759250871695facbb5a6946359329a2..76d8e7565b0e6e41e5c54d164f989048959ebe3a 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)