]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fixing implementation of EMCal tender supply
authorcnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Jan 2013 21:13:20 +0000 (21:13 +0000)
committercnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Jan 2013 21:13:20 +0000 (21:13 +0000)
PWGLF/totEt/macros/AddTaskEMCALTenderForEtAnalysis.C
PWGLF/totEt/macros/runCaloEt.C

index 77e37db8289fd6cc711bbacfcb36d2a980eb8689..184424d26b271152d044cd59277683a77d78e4b7 100644 (file)
@@ -1,27 +1,6 @@
 // EMCal tender task adder
 // Author: Jiri Kral
 
-// Script to recover AliEMCALRecParam from OCDB
-// 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 "AliEMCALRecParam.h"
-#include "AliCDBMetaData.h"
-#include "AliCDBId.h"
-#include "AliCDBEntry.h"
-#include "AliCDBManager.h"
-#include "AliCDBStorage.h"
-#endif
-
-
-
 AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", AliEMCALRecParam *pars = 0 )
 {
   // Parameters: geoname = "EMCAL_FIRSTYEARV1" or "EMCAL_COMPLETEV1" or ""
@@ -49,7 +28,7 @@ AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", AliEMCALRe
        if( pars == 0 ){
                // you can write your reco params here to avoid loading them automatically
                // from OCDB during execution time
-/*             AliEMCALRecParam *params = new AliEMCALRecParam();
+               AliEMCALRecParam *params = new AliEMCALRecParam();
                // reclustering parameters
                // use v1 for pp and v2 for PbPb
                params->SetClusterizerFlag(AliEMCALRecParam::kClusterizerv2);
@@ -61,7 +40,7 @@ AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", AliEMCALRe
                params->SetTimeMin(-1);
                params->SetTimeMax(1e6);//s
 
-               EMCALSupply->SetRecParam(params);*/
+               EMCALSupply->SetRecParam(params);
        }
        else{
                cout << "------- TENDER is using supplied reco params -------" << endl;
@@ -85,8 +64,8 @@ AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", AliEMCALRe
   EMCALSupply->SwitchOnCutEtaPhiSum(); 
   EMCALSupply->SetRCut(0.025);
   //EMCALSupply->SwitchOnCutEtaPhiSeparate();
-  //EMCALSupply->SetEtaCut(0.025);
-  //EMCALSupply->SetPhiCut(0.05);
+  EMCALSupply->SetEtaCut(0.025);
+  EMCALSupply->SetPhiCut(0.05);
 
   // switches ---------------------------------------------------------------
   EMCALSupply->SwitchOnBadCellRemove();
@@ -120,55 +99,3 @@ AliTender *AddTaskEMCALTender(const char *geoname="EMCAL_COMPLETEV1", AliEMCALRe
   return ana;
 }
  
-
-AliEMCALRecParam* GetOCDBRecParam( Int_t runNum, char *datatype="pp", Bool_t grid=kTRUE ){
-
-       AliCDBManager *man;
-
-       AliEMCALRecParam *pars;
-       TObjArray *arr;
-       
-       if( grid ){
-               cout << "======= Will get reco params from OCDB on grid ============= " << endl;
-               if(!gGrid) {
-                       if (!TGrid::Connect("alien://")){
-                               cout << "Error: can't connect to grid" << endl;
-                               exit(1);
-                       }
-               }
-       }
-       else{
-               cout << "======= Will get reco params from local ODCB =============== " << endl;
-       }
-       
-       // 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
-       if( grid )
-               man->SetDefaultStorageFromRun( runNum );
-       else
-               man->SetDefaultStorage( "local://$ALICE_ROOT/OCDB" );
-       
-       // load the file data
-       arr = (TObjArray*)(man->Get("EMCAL/Calib/RecoParam", runNum)->GetObject());
-
-  if( !strcmp( datatype, "pp" ))
-               pars = (AliEMCALRecParam*)arr->FindObject( "Low Flux - p+p" );
-       else
-               pars = (AliEMCALRecParam*)arr->FindObject( "High Flux - Pb+Pb" );
-
-       // cleanup
-       arr->Clear();
-       delete arr;
-       man->ClearCache();
-       man->DestroyActiveStorages();
-       man->Destroy();
-
-       cout << "======= Reco parames retrieval finished ==================== " << endl;
-       
-       return pars;
-}
index 7774327613ec33966c083e5fc0f38ebca57b68a3..20de3c3a9cb67416b8484abb6dc2316bfa74c5bd 100644 (file)
@@ -5,9 +5,9 @@
 //With the argument true this submits jobs to the grid
 //As written this requires an xml script tag.xml in the ~/et directory on the grid to submit jobs
 void runCaloEt(bool submit = false, // true or false 
-              const char *dataType="realPbPb", // "sim" or "real" etc.
-              const char *pluginRunMode="test", // "test" or "full" or "terminate"
-              const char *det = "EMCalDetail") // "PHOS" or "EMCAL" or EMCalDetail
+              const char *dataType="simPbPb", // "sim" or "real" etc.
+              const char *pluginRunMode="full", // "test" or "full" or "terminate"
+              const char *det = "EMCAL") // "PHOS" or "EMCAL" or EMCalDetail
 {
   TStopwatch timer;
   timer.Start();
@@ -59,6 +59,27 @@ void runCaloEt(bool submit = false, // true or false
   gROOT->ProcessLine(".L AliAnalysisEmEtReconstructed.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisTaskTotEt.cxx+g");
 
+  TString detStr(det);
+  TString dataStr(dataType);
+  if ( detStr.Contains("PHOS") ) {
+    gSystem->CopyFile("calocorrections.PHOS.root","calocorrections.root",kTRUE);
+    if ( dataStr.Contains("sim") ) {
+      gSystem->CopyFile("ConfigEtMonteCarlo.PHOS.C","ConfigEtMonteCarlo.C",kTRUE);
+    }
+    else{
+      gSystem->CopyFile("ConfigEtMonteCarlo.PHOS.data.C","ConfigEtMonteCarlo.C",kTRUE);
+    }
+  }
+  else{
+    gSystem->CopyFile("calocorrections.EMCAL.root","calocorrections.root",kTRUE);
+    if ( dataStr.Contains("sim") ) {
+      gSystem->CopyFile("ConfigEtMonteCarlo.EMCAL.C","ConfigEtMonteCarlo.C",kTRUE);
+    }
+    else{
+      gSystem->CopyFile("ConfigEtMonteCarlo.EMCAL.data.C","ConfigEtMonteCarlo.C",kTRUE);
+    }
+  }
+
 
   char *kTreeName = "esdTree" ;
   TChain * chain   = new TChain(kTreeName,"myESDTree") ;
@@ -73,13 +94,11 @@ void runCaloEt(bool submit = false, // true or false
   // Make the analysis manager
   AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager");
   
-  TString detStr(det);
   TString taskName = "TaskTotEt" + detStr;
-  TString dataStr(dataType);
   TString dataStrName(dataType);
   dataStrName.ReplaceAll("/",".");
   TString outputName = "Et.ESD." + dataStrName + "." + detStr + ".root";
-  TString outputDir = "totEt" + dataStr;
+  TString outputDir = "totEt" + dataStr + detStr;
 
   cout << " taskName " << taskName
        << " outputName " << outputName 
@@ -103,7 +122,7 @@ void runCaloEt(bool submit = false, // true or false
     cout << " MC " << endl;
     if ( dataStr.Contains("PbPb") ) { // a la: simPbPb/LHC10e18a
       cout << " PbPb " << endl;
-      TString fileLocation = "/home/dsilverm/data/E_T/" + dataStr + "/dir/AliESDs.root";
+      TString fileLocation = "/data/LHC10h8/137161/999/AliESDs.root";//"/home/dsilverm/data/E_T/" + dataStr + "/dir/AliESDs.root";
       cout << "fileLocation " << fileLocation.Data() << endl; 
       chain->Add(fileLocation.Data()); // link to local test file
     }
@@ -124,13 +143,13 @@ void runCaloEt(bool submit = false, // true or false
   }
 
 
-  if(!isMc && detStr.Contains("EMC")){
+  //if(!isMc && detStr.Contains("EMC")){
+  if(detStr.Contains("EMC")){
     cout<<"You are running over EMCal data and using the tender supply"<<endl;
     gSystem->Load("libTENDER.so");
     gSystem->Load("libTENDERSupplies.so"); 
     gROOT->ProcessLine(".include $ALICE_ROOT/Tender/"); 
     gSystem->AddIncludePath("-I$ALICE_ROOT/ANALYSIS "); 
-
     //this macro is downloaded from the EMCal tender supply twiki 
     //hopefully it will be replaced by something checked in to aliroot
     //I have added the function from GetOCDBRecParam.C in Jiri's example to this so that we don't add gobs of macros to the code
@@ -141,13 +160,13 @@ void runCaloEt(bool submit = false, // true or false
 //    gROOT->LoadMacro("./GetOCDBRecParam.C");
 //     // run num, data type pp/PbPb, from grid
 //Gets calibration factors from grid if jobs are to be submitted to the grid
-       AliEMCALRecParam* pars = GetOCDBRecParam( 137161, "PbPb", submit);
+//     AliEMCALRecParam* pars = GetOCDBRecParam( 137161, "PbPb", submit);
 
     AliTender *tender = AddTaskEMCALTender( "EMCAL_COMPLETEV1", 0);
     //this also likely needs modification
-    tender->SelectCollisionCandidates( AliVEvent::kMB | AliVEvent::kEMCEGA | AliVEvent::kEMC1 | AliVEvent::kEMC7 );
-    if(submit){tender->SetDefaultCDBStorage("raw://");} //uncomment if you work on grid
-    else{tender->SetDefaultCDBStorage("local://$ALICE_ROOT/OCDB");} //uncomment if you work local
+//     tender->SelectCollisionCandidates( AliVEvent::kMB | AliVEvent::kEMCEGA | AliVEvent::kEMC1 | AliVEvent::kEMC7 );
+//     if(submit){tender->SetDefaultCDBStorage("raw://");} //uncomment if you work on grid
+//     else{tender->SetDefaultCDBStorage("local://$ALICE_ROOT/OCDB");} //uncomment if you work local
 
     if(submit){
       cout<<"Setting tender to run on grid"<<endl;