noise cut database classes added
authorbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Jan 2010 03:26:24 +0000 (03:26 +0000)
committerbasanta <basanta@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Jan 2010 03:26:24 +0000 (03:26 +0000)
PMD/AliPMDNoiseCut.cxx [new file with mode: 0644]
PMD/AliPMDNoiseCut.h [new file with mode: 0644]
PMD/CreateNoiseCut.C [new file with mode: 0644]
PMD/PMDrecLinkDef.h
PMD/ReadNoiseCut.C [new file with mode: 0644]
PMD/libPMDrec.pkg

diff --git a/PMD/AliPMDNoiseCut.cxx b/PMD/AliPMDNoiseCut.cxx
new file mode 100644 (file)
index 0000000..849041b
--- /dev/null
@@ -0,0 +1,83 @@
+/***************************************************************************
+ * 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 : 
+//
+#include "TNamed.h"
+#include "AliCDBEntry.h"
+#include "AliPMDNoiseCut.h"
+
+
+ClassImp(AliPMDNoiseCut)
+
+AliPMDNoiseCut::AliPMDNoiseCut()
+{
+  // Default constructor
+}
+// ----------------------------------------------------------------- //
+AliPMDNoiseCut::AliPMDNoiseCut(const char* name)
+{
+  //constructor
+  TString namst = "Calib_";
+  namst += name;
+  SetName(namst.Data());
+  SetTitle(namst.Data());
+}
+// ----------------------------------------------------------------- //
+AliPMDNoiseCut::AliPMDNoiseCut(const AliPMDNoiseCut& noisecut) :
+  TNamed(noisecut)
+{
+  // copy constructor
+  SetName(noisecut.GetName());
+  SetTitle(noisecut.GetName());
+  for(Int_t imod = 0; imod < 48; imod++)
+    {
+      fNoiseCut[imod] = noisecut.GetNoiseCut(imod);
+    }
+
+}
+// ----------------------------------------------------------------- //
+AliPMDNoiseCut &AliPMDNoiseCut::operator =(const AliPMDNoiseCut& noisecut)
+{
+  //asignment operator
+  SetName(noisecut.GetName());
+  SetTitle(noisecut.GetName());
+
+  for(Int_t imod = 0; imod < 48; imod++)
+    {
+      fNoiseCut[imod] = noisecut.GetNoiseCut(imod);
+    }
+
+  return *this;
+}
+// ----------------------------------------------------------------- //
+AliPMDNoiseCut::~AliPMDNoiseCut()
+{
+  //destructor
+}
+// ----------------------------------------------------------------- //
+
+void AliPMDNoiseCut::Print(Option_t *) const
+{
+  printf("\n ######Noise Cut for each Module ####\n");
+
+
+  for(Int_t imod = 0; imod < 48; imod++)
+    {
+      printf("%d %f\n",imod,fNoiseCut[imod]);
+      printf("\n");
+    }
+
+}
diff --git a/PMD/AliPMDNoiseCut.h b/PMD/AliPMDNoiseCut.h
new file mode 100644 (file)
index 0000000..3396281
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef ALIPMDNOISECUT_H
+#define ALIPMDNOISECUT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+
+class TNamed;
+class AliCDBEntry;
+
+class AliPMDNoiseCut: public TNamed
+{
+ public:
+  AliPMDNoiseCut();
+  AliPMDNoiseCut(const char* name);
+  AliPMDNoiseCut(const AliPMDNoiseCut &noisecut);
+  AliPMDNoiseCut& operator= (const AliPMDNoiseCut &noisecut);
+  virtual ~AliPMDNoiseCut();
+
+  Int_t GetNoiseCut(Int_t imod) const {return fNoiseCut[imod];}
+
+  void  SetNoiseCut(Int_t imod, Float_t cut) {fNoiseCut[imod] = cut;}
+
+  virtual void Print(Option_t *) const;
+  
+ protected:
+
+  Float_t fNoiseCut[48];
+
+
+  ClassDef(AliPMDNoiseCut,1) // calibration class for gainfactors
+};
+#endif
diff --git a/PMD/CreateNoiseCut.C b/PMD/CreateNoiseCut.C
new file mode 100644 (file)
index 0000000..61911e1
--- /dev/null
@@ -0,0 +1,23 @@
+void CreateNoiseCut()
+{
+
+  AliCDBManager* man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");  
+  AliPMDNoiseCut *ncut = new AliPMDNoiseCut();
+
+
+  for(Int_t imod = 0; imod < 48; imod++)
+    {
+      Float_t cut = 4.;
+      ncut->SetNoiseCut(imod,cut);
+    }
+
+  AliCDBMetaData *md= new AliCDBMetaData();
+  md->SetResponsible("Basanta Nandi");
+  md->SetComment("Noise cut for different modules of PMD");
+
+  AliCDBId id("PMD/Calib/NoiseCut",0,AliCDBRunRange::Infinity());
+
+  man->GetDefaultStorage()->Put(ncut,id, md);
+
+}
index 45e217c..b81ebba 100644 (file)
@@ -29,4 +29,5 @@
 #pragma link C++ class  AliPMDisocell+;
 #pragma link C++ class  AliPMDrecdata+;
 #pragma link C++ class  AliPMDRecoParam+;
+#pragma link C++ class  AliPMDNoiseCut+;
 #endif
diff --git a/PMD/ReadNoiseCut.C b/PMD/ReadNoiseCut.C
new file mode 100644 (file)
index 0000000..9bac1bf
--- /dev/null
@@ -0,0 +1,18 @@
+void ReadNoiseCut()
+{
+  TFile * f = TFile::Open("$ALICE_ROOT/OCDB/PMD/Calib/NoiseCut/Run0_999999999_v0_s0.root");
+
+  f->ls();
+  if (!AliCDBEntry)
+    {
+      printf("Something is wrong ************ \n");
+    }
+  else if(AliCDBEntry)
+    {
+      AliCDBEntry->PrintId(); 
+      AliCDBEntry->PrintMetaData();
+      AliPMDNoiseCut * ncut = 0;
+      ncut = (AliPMDNoiseCut*)AliCDBEntry->GetObject();
+      ncut->Print(); 
+    }
+}
index 0a5d2da..2d61123 100644 (file)
@@ -1,7 +1,7 @@
 #-*- Mode: Makefile -*-
 # $Id$
 
-SRCS:= AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx AliPMDCalibPedestal.cxx AliPMDCalibGain.cxx AliPMDQADataMakerRec.cxx AliPMDisocell.cxx AliPMDrecdata.cxx AliPMDRecoParam.cxx
+SRCS:= AliPMDRecPoint.cxx AliPMDUtility.cxx AliPMDrecpoint1.cxx AliPMDrechit.cxx AliPMDcluster.cxx AliPMDClusteringV1.cxx AliPMDClusteringV2.cxx AliPMDclupid.cxx AliPMDEmpDiscriminator.cxx AliPMDClusterFinder.cxx AliPMDtracker.cxx AliPMDReconstructor.cxx AliPMDcludata.cxx AliPMDCalibPedestal.cxx AliPMDCalibGain.cxx AliPMDQADataMakerRec.cxx AliPMDisocell.cxx AliPMDrecdata.cxx AliPMDRecoParam.cxx AliPMDNoiseCut.cxx
 
 HDRS:= $(SRCS:.cxx=.h) AliPMDClustering.h AliPMDDiscriminator.h AliPMDcludata.h