]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
update the macro to create OADB for bad channels to include first LHC12 periods,...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Jun 2012 12:56:03 +0000 (12:56 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 14 Jun 2012 12:56:03 +0000 (12:56 +0000)
EMCAL/macros/OADB/AliEMCALOCDBTenderConverter.cxx [new file with mode: 0644]
EMCAL/macros/OADB/CreateEMCAL_OADB_BadChannels.C
EMCAL/macros/OADB/CreateHistoFile.sh [new file with mode: 0644]

diff --git a/EMCAL/macros/OADB/AliEMCALOCDBTenderConverter.cxx b/EMCAL/macros/OADB/AliEMCALOCDBTenderConverter.cxx
new file mode 100644 (file)
index 0000000..b69e432
--- /dev/null
@@ -0,0 +1,67 @@
+// Script to convert OCDB files to tender used files
+// Author: Jiri Kral
+
+#if !defined(__CINT__)
+#include <TString.h>
+#include <TH2.h>
+#include <TF1.h>
+
+#include "AliRun.h"
+#include "AliCaloCalibPedestal.h"
+#include "AliEMCALGeoParams.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBId.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#endif
+
+
+void AliEMCALOCDBTenderConverter( Int_t runNum, char *outFileName ){
+       Int_t i;
+       char buf[100];
+
+       TH2D *histo;
+
+       TFile *outFile;
+       
+       AliCDBManager *man;
+       AliCDBStorage *stor;
+       AliCaloCalibPedestal *ped;
+
+       // created the OCDB manager
+       man = AliCDBManager::Instance();
+
+       // point it to local storage
+       // !!! careful, one must build an exact path of OCDB directories
+       // and store the file in those
+       // here "./OCDB/EMCAL/Calib/Pedestals/Run*.root) for masks
+       stor = man->GetStorage( "local://$ALICE_ROOT/OCDB");
+       
+       // load the file data
+       ped = (AliCaloCalibPedestal*)(stor->Get("EMCAL/Calib/Pedestals", runNum)->GetObject());
+
+       // get the array of histos
+       TObjArray map = ped->GetDeadMap();
+
+       outFile = new TFile( outFileName, "RECREATE" );
+
+       // rename the histos and save
+       for( i = 0; i < map.GetEntries(); i++ ){
+               histo = (TH2D*)(map[i]);
+                printf("\n !!! EMCALBadChannelMap_Mod%d",i );
+               sprintf( buf, "EMCALBadChannelMap_Mod%d", i );
+
+               histo->SetName( buf );
+               histo->SetTitle( buf );
+
+               histo->Write();
+       }
+
+       // cleanup
+       delete outFile;
+       delete ped;
+       delete stor;
+       delete man;
+       
+}
\ No newline at end of file
index d2f96b006d48266c03851d604d4b032842631250..a93a318c427e1648ac369b418a67ae6bd4411367 100644 (file)
@@ -17,8 +17,10 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10     =       "BadChannels2010.root
                                  const char *fileName11f       =       "BadChannels2011_11f.root",
                                  const char *fileName11h       =       "BadChannels2011_11h.root",
                                  const char *fileName12a       =       "BadChannels2012_12a.root",
+                                 const char *fileName12b1      =       "BadChannels2012_12b1.root",
+                                 const char *fileName12b2      =       "BadChannels2012_12b2.root",
+                                 const char *fileName12b3      =       "BadChannels2012_12b3.root"                                                             
                                )
-
 {
 
     gSystem->Load("libOADB");      
@@ -49,11 +51,16 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10    =       "BadChannels2010.root
 
     //LHC11h
     TObjArray array11h(12);            array11h.SetName("BadChannels11h");
-    
+
     //LHC12a
     TObjArray array12a(12);            array12a.SetName("BadChannels12a");
-    
 
+    //LHC12b
+    TObjArray array12b1(12);           array12b1.SetName("BadChannels12b1");
+    TObjArray array12b2(12);           array12b2.SetName("BadChannels12b2");
+    TObjArray array12b3(12);           array12b3.SetName("BadChannels12b3");
+    
+    
     TFile      *f10    =       new TFile(fileName10,"read"); 
     TFile      *f11a   =       new TFile(fileName11a,"read");
     TFile      *f11b   =       new TFile(fileName11b,"read");
@@ -64,8 +71,12 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10     =       "BadChannels2010.root
     TFile      *f11e   =       new TFile(fileName11e,"read");
     TFile      *f11f   =       new TFile(fileName11f,"read");
     TFile      *f11h   =       new TFile(fileName11h,"read");
-    TFile      *f12a   =       new TFile(fileName11h,"read");
+    TFile      *f12a   =       new TFile(fileName12a,"read");
+    TFile      *f12b1  =       new TFile(fileName12b1,"read");
+    TFile      *f12b2  =       new TFile(fileName12b2,"read");
+    TFile      *f12b3  =       new TFile(fileName12b3,"read");
 
+    
     //Create OADB container for BadChannels
     AliOADBContainer* con = new AliOADBContainer("AliEMCALBadChannels");
 
@@ -79,7 +90,7 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10      =       "BadChannels2010.root
            array10.Add(f10->Get(name));
        }
            sprintf(name,"EMCALBadChannelMap_Mod%d",mod);
-           cout<<"BadChannels2011:"<<name<<endl;
+           cout<<"BadChannels 2011 and 2012:"<<name<<endl;
            array11a.Add(f11a->Get(name));
            array11b.Add(f11b->Get(name));
            array11c1.Add(f11c1->Get(name));
@@ -90,6 +101,9 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10     =       "BadChannels2010.root
            array11f.Add(f11f->Get(name));
            array11h.Add(f11h->Get(name));
            array12a.Add(f12a->Get(name));
+           array12b1.Add(f12b1->Get(name));
+           array12b2.Add(f12b2->Get(name));
+           array12b3.Add(f12b3->Get(name));
            
     } //mod
     
@@ -104,7 +118,9 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10    =       "BadChannels2010.root
     con->AddDefaultObject(&array11f);
     con->AddDefaultObject(&array11h);
     con->AddDefaultObject(&array12a);
-   
+    con->AddDefaultObject(&array12b1);
+    con->AddDefaultObject(&array12b2);
+    con->AddDefaultObject(&array12b3);
     
     //Establishing run number with the correct objects
     con->AppendObject(&array10,100000,140000);
@@ -117,7 +133,16 @@ void CreateEMCAL_OADB_BadChannels(const char *fileName10   =       "BadChannels2010.root
     con->AppendObject(&array11e,160670,162740);
     con->AppendObject(&array11f,162933,165746);
     con->AppendObject(&array11h,166529,170673);
-    con->AppendObject(&array12a,177320,999999999);
+
+    con->AppendObject(&array12a,172439,177296);
+    
+    con->AppendObject(&array12b1,177384,177443);
+    con->AppendObject(&array12b1,177683,177843);
+    con->AppendObject(&array12b1,177850,178220);
+    
+    con->AppendObject(&array12b2,177444,177682); 
+    con->AppendObject(&array12b3,177844,177849);
+    
     
     con->WriteToFile("BetaBadChannels.root");   
 }
diff --git a/EMCAL/macros/OADB/CreateHistoFile.sh b/EMCAL/macros/OADB/CreateHistoFile.sh
new file mode 100644 (file)
index 0000000..9d6d621
--- /dev/null
@@ -0,0 +1,22 @@
+#! bash
+# How to create the badchannels root files with histogramas SM by SM.
+# First argument of the macro = run number(normally, one can use any number within the specific period)
+# Second argument=Filename.root (this will be used in the CreateEMCAL_OADB_BadChannels.C)
+# Carefull, one needs the current OCDB downloaded in $ALICE_ROOT/OCDB/EMCAL/Calib/Pedestals(Default) or any ./OCDB/EMCAL/Calib/Pedestals specified (see AliEMCALOCDBTenderConverter.cxx)
+
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(146860,"BadChannels2011_11a.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(150629,"BadChannels2011_11b.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(152700,"BadChannels2011_11c1.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(153570,"BadChannels2011_11c2.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(155384,"BadChannels2011_11c3.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(159635,"BadChannels2011_11d.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(162740,"BadChannels2011_11e.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(165745,"BadChannels2011_11f.root")'
+# aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(166530,"BadChannels2011_11h.root")'
+
+
+aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(172439,"BadChannels2012_12a.root")'
+aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(177384,"BadChannels2012_12b1.root")'
+aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(177444,"BadChannels2012_12b2.root")'
+aliroot -b -q 'AliEMCALOCDBTenderConverter.cxx(177844,"BadChannels2012_12b3.root")'
+