]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
from Per Thomas: files for generation of PeakFinder OCDB object
authordsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Nov 2010 18:20:10 +0000 (18:20 +0000)
committerdsilverm <dsilverm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 29 Nov 2010 18:20:10 +0000 (18:20 +0000)
EMCAL/macros/PeakFinder/MakeEMCALPF.C [new file with mode: 0644]
EMCAL/macros/PeakFinder/peakfindervectors2.root [new file with mode: 0644]
EMCAL/macros/PeakFinder/pfocdbmaker.C [new file with mode: 0644]
EMCAL/macros/PeakFinder/pfvectors.root [new file with mode: 0644]
EMCAL/macros/PeakFinder/readpf.C [new file with mode: 0644]
EMCAL/macros/PeakFinder/vectors-emcal.tar.bz2 [new file with mode: 0644]

diff --git a/EMCAL/macros/PeakFinder/MakeEMCALPF.C b/EMCAL/macros/PeakFinder/MakeEMCALPF.C
new file mode 100644 (file)
index 0000000..9d4ae87
--- /dev/null
@@ -0,0 +1,60 @@
+void MakeEMCALPF(){
+  const char* macroname = "MakeEMCALPF.C";
+  TFile *f2 = new TFile("peakfindervectors2.root",  "read" ); 
+  //  AliCaloPeakFinderVectors *pfv =  (AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors"); 
+
+  //  AliCaloPeakFinderVectors *pfv =  *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); 
+  // AliCaloPeakFinderVectors pfv =  *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); 
+  // AliCaloPeakFinderVectors *p = f2->Get("AliCaloPeakFinderVectors");
+  
+  // AliCaloPeakFinderVectors pfv =  *((AliCaloPeakFinderVectors* )f2->GetKey( "AliCaloPeakFinderVectors")); 
+  AliCaloPeakFinderVectors *pfv = (f2->Get("AliCaloPeakFinderVectors"));
+  
+  pfv->PrintVectors();
+  //  p->PrintVectors();
+
+  f2->Close();
+  {
+    //    TString Storage = "local://home/perthi/aliroot-current/OCDB/";
+    TString Storage = "local://OCDB/";  
+
+    if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
+      Error(macroname ,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
+      return;
+    }
+    
+    
+    Info(macroname,"Saving PF objects in CDB storage %s",
+        Storage.Data());
+    AliCDBManager* cdb = AliCDBManager::Instance();
+
+    AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
+    if(!storage)
+      {
+       Error(macroname,"Unable to open storage %s\n",Storage.Data());
+       return;
+      }
+    
+    AliCDBMetaData* md = new AliCDBMetaData();
+    md->SetResponsible("Per Thomas Hille");
+    md->SetComment("Peak-Finder vectors for EMCAL");
+    md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+    AliCDBId id("EMCAL/Calib/PeakFinder",0,AliCDBRunRange::Infinity());
+    
+    if ( storage != 0 )
+      {
+       Bool_t ret = storage->Put( pfv,id,md);
+       if(ret ==  kFALSE )
+         {
+           cout << __FILE__ << ":" << __LINE__ << ": ERROR !!!  storage->Put( pfv,id,md) returned false " << endl;
+         }
+       else
+         {
+           cout << __FILE__ << ":" << __LINE__ << ": INFO  !!!  storage->Put( pfv,id,md) returned TRUE " << endl;
+         }
+
+      }
+  }
+
+}
+
diff --git a/EMCAL/macros/PeakFinder/peakfindervectors2.root b/EMCAL/macros/PeakFinder/peakfindervectors2.root
new file mode 100644 (file)
index 0000000..5aec51b
Binary files /dev/null and b/EMCAL/macros/PeakFinder/peakfindervectors2.root differ
diff --git a/EMCAL/macros/PeakFinder/pfocdbmaker.C b/EMCAL/macros/PeakFinder/pfocdbmaker.C
new file mode 100644 (file)
index 0000000..7a40687
--- /dev/null
@@ -0,0 +1,26 @@
+#include  "AliCaloRawAnalyzerPeakFinder.h"
+//#include  "AliCaloRawAnalyzerPeakFinder.h"
+
+#include "AliCaloPeakFinderVectors.h"
+#define MAXSTART 3
+#define SAMPLERANGE 15
+#define SHIF 0.5
+
+
+void pfocdbmaker()
+{
+  AliCDBEntry e;
+  AliCaloRawAnalyzerPeakFinder *p = new  AliCaloRawAnalyzerPeakFinder();
+  e.SetObject(p);
+  TFile *f = new TFile("pfvectors.root", "recreate" );
+  //Read in the Peak finder vecors from file
+  p->Write();
+  //  e.Write();
+  f->Close();
+}
+
+
+
+
+
+
diff --git a/EMCAL/macros/PeakFinder/pfvectors.root b/EMCAL/macros/PeakFinder/pfvectors.root
new file mode 100644 (file)
index 0000000..9bafb07
Binary files /dev/null and b/EMCAL/macros/PeakFinder/pfvectors.root differ
diff --git a/EMCAL/macros/PeakFinder/readpf.C b/EMCAL/macros/PeakFinder/readpf.C
new file mode 100644 (file)
index 0000000..479e97c
--- /dev/null
@@ -0,0 +1,30 @@
+
+void readpf()
+{
+  cout << "HELLO WORLD" << endl;
+  TFile *f = new TFile("peakfindervectors2.root", "read");
+  
+  //   f->ls();
+  //   f->Print();
+  //   AliCaloRawAnalyzerPeakFinder *p = (AliCaloRawAnalyzerPeakFinder*)f->GetKey("AliCaloRawAnalyzerPeakFinder");
+  
+  AliCaloPeakFinderVectors *p = f->Get("AliCaloPeakFinderVectors");
+
+  if ( p == 0 )
+    {
+      cout << "ERROR, P == 0" << endl;
+    }
+  else
+    {
+      cout << "INFO, p = "<< p  << endl;
+      p->PrintVectors();
+    }
+
+  cout << endl <<  "********** !!!!!!!!!!!!!! " << endl;
+  
+  
+  // AliCaloRawAnalyzerPeakFinder *p2 =  new AliCaloRawAnalyzerPeakFinder();
+  //  p2->PrintVectors();
+}
+
+
diff --git a/EMCAL/macros/PeakFinder/vectors-emcal.tar.bz2 b/EMCAL/macros/PeakFinder/vectors-emcal.tar.bz2
new file mode 100644 (file)
index 0000000..560f904
Binary files /dev/null and b/EMCAL/macros/PeakFinder/vectors-emcal.tar.bz2 differ