/* $Id$ */
-//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
+//-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
// August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
// of new IO (à la PHOS)
// Mar 2007, Aleksei Pavlinov - new algoritmh of pseudo clusters
fMinECut = 0.45; // Best value for 2 GeV gamma merged with Ideal HIJING. Retune later?
fCalibData = 0 ;
+
+ // If reconstruction parameters are found in OCDB, take them from it
+
+ AliEMCALLoader *emcalLoader =
+ dynamic_cast<AliEMCALLoader*>(AliRunLoader::GetRunLoader()->GetDetectorLoader("EMCAL"));
+ AliEMCALRecParam *recParamDB = emcalLoader->RecParam();
+ if (recParamDB != 0) {
+ fECAClusteringThreshold = recParamDB->GetClusteringThreshold();
+ fECAW0 = recParamDB->GetW0();
+ fMinECut = recParamDB->GetMinECut();
+ AliDebug(1,Form("Reconstruction parameters were taken from OCDB: fECAClusteringThreshold=%.3f, fECAW=%.3f, fMinECut=%.3f",
+ fECAClusteringThreshold,fECAW0,fMinECut));
+ }
+
}
//____________________________________________________________________________
const TString AliEMCALLoader::fgkECARecPointsBranchName("EMCALECARP");//Name for branch with ECA Reconstructed Points
AliEMCALCalibData* AliEMCALLoader::fgCalibData = 0; //calibation data
+AliEMCALRecParam * AliEMCALLoader::fgRecParam = 0; //reconstruction parameters
//____________________________________________________________________________
AliEMCALLoader::AliEMCALLoader()
}
+//____________________________________________________________________________
+AliEMCALRecParam* AliEMCALLoader::RecParam()
+{
+ // Check if the instance of AliEMCALRecParam exists, if not, create it if
+ // the OCDB is available, and finally return it.
+
+ if(!fgRecParam && (AliCDBManager::Instance()->IsDefaultStorageSet())) {
+ AliCDBEntry *entry = (AliCDBEntry*)
+ AliCDBManager::Instance()->Get("EMCAL/RecParam/Data");
+ if (entry) fgRecParam = (AliEMCALRecParam*) entry->GetObject();
+ }
+
+ if(!fgRecParam)
+ AliWarning("Recostruction parameters not found in CDB!");
+
+ return fgRecParam;
+
+}
+
//____________________________________________________________________________
Int_t AliEMCALLoader::CalibrateRaw(Double_t energy, Int_t module,
Int_t column, Int_t row)
// --- AliRoot header files ---
#include "AliLoader.h"
#include "AliEMCALCalibData.h"
+#include "AliEMCALRecParam.h"
class AliLoader ;
class AliEMCAL ;
void SetCalibData(AliEMCALCalibData* calibda) { fgCalibData = calibda; }
AliEMCALCalibData * CalibData(); // to get the calibration CDB object
+ AliEMCALRecParam * RecParam(); // to get rec.parameters from CDB
+
private:
static const TString fgkECARecPointsBranchName; //! Name of branch with ECA Reconstructed Points
TObjArray *fRecPoints; //! TClonesArray of recpoints (for tree reading)
static AliEMCALCalibData * fgCalibData; // calibration data
+ static AliEMCALRecParam * fgRecParam ; // reconstruction parameters
- ClassDef(AliEMCALLoader,0) // Algorithm class that provides methods to retrieve objects from a list knowing the index
+ ClassDef(AliEMCALLoader,1) // Algorithm class that provides methods to retrieve objects from a list knowing the index
};
--- /dev/null
+ /**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+/* $Id$ */
+// --- AliRoot header files ---
+#include "AliEMCALRecParam.h"
+#include "AliLog.h"
+
+ClassImp(AliEMCALRecParam)
+
+//-----------------------------------------------------------------------------
+// Container of EMCAL reconstruction parameters
+// The purpose of this object is to store it to OCDB
+// and retrieve it in AliEMCALClusterizerv1
+// Author: Yuri Kharlov
+//-----------------------------------------------------------------------------
+
+AliEMCALRecParam::AliEMCALRecParam():
+ fClusteringThreshold(0),fW0(0),fMinECut(0)
+{}
+
+//-----------------------------------------------------------------------------
+void AliEMCALRecParam::Print(Option_t *) const
+{
+ printf("AliEMCALRecParam::Print()\n");
+ // Print reconstruction parameters to stdout
+ AliInfo(Form("Reconstruction parameters:\n fClusteringThreshold=%.3f,\n fW0=%.3f,\n fMinECut=%.3f",
+ fClusteringThreshold,fW0,fMinECut));
+
+}
--- /dev/null
+#ifndef ALIEMCALRECPARAM_H
+#define ALIEMCALRECPARAM_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+//-----------------------------------------------------------------------------
+// Container of EMCAL reconstruction parameters
+// The purpose of this object is to store it to OCDB
+// and retrieve it in AliEMCALClusterizerv1
+// Author: Yuri Kharlov
+//-----------------------------------------------------------------------------
+
+// --- ROOT system ---
+
+#include "TObject.h"
+
+class AliEMCALRecParam : public TObject
+{
+public:
+
+ AliEMCALRecParam() ;
+ virtual ~AliEMCALRecParam() {}
+ Float_t GetClusteringThreshold() {return fClusteringThreshold;}
+ Float_t GetW0 () {return fW0 ;}
+ Float_t GetMinECut () {return fMinECut ;}
+ void SetClusteringThreshold(Float_t thrsh) {fClusteringThreshold = thrsh;}
+ void SetW0 (Float_t w0) {fW0 = w0 ;}
+ void SetMinECut (Float_t minEcut) {fMinECut = minEcut ;}
+ virtual void Print(Option_t * option="") const ;
+
+private:
+ Float_t fClusteringThreshold ; // minimum energy to seed a EC digit in a cluster
+ Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
+ Float_t fMinECut; // Minimum energy for a digit to be a member of a cluster
+
+ ClassDef(AliEMCALRecParam,1) // Reconstruction parameters
+
+} ;
+
+#endif // ALIEMCALRECPARAM_H
#pragma link C++ class AliEMCALTrack+;
#pragma link C++ class AliEMCALTracker+;
#pragma link C++ class AliEMCALPID+;
+#pragma link C++ class AliEMCALRecParam+;
#endif
AliEMCALClusterizerv1.cxx \
AliEMCALTrack.cxx \
AliEMCALTracker.cxx \
-AliEMCALPID.cxx
+AliEMCALPID.cxx \
+AliEMCALRecParam.cxx
HDRS= $(SRCS:.cxx=.h)
--- /dev/null
+// Script to create reconstruction parameters and store them into CDB
+// Author: Yuri Kharlov
+
+/* $Id$ */
+
+#if !defined(__CINT__)
+#include "TControlBar.h"
+#include "TString.h"
+
+#include "AliEMCALRecParam.h"
+#include "AliCDBMetaData.h"
+#include "AliCDBId.h"
+#include "AliCDBEntry.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#endif
+
+
+void AliEMCALSetRecParamCDB()
+{
+ TControlBar *menu = new TControlBar("vertical","EMCAL CDB");
+ menu->AddButton("Help to run EMCAL CDB","Help()",
+ "Explains how to use EMCAL CDS menus");
+ menu->AddButton("Set RecParam","SetRecParam()",
+ "Set clusterization parameters");
+ menu->AddButton("Get RecParam","GetRecParam()",
+ "Get clusterization parameters");
+ menu->AddButton("Exit","gApplication->Terminate(0)","Quit aliroot session");
+ menu->Show();
+}
+
+//------------------------------------------------------------------------
+void Help()
+{
+ char *string =
+ "\n\nSet reconstruction parameters and write them into ALICE OCDB. \nPress button \"Set RecParam\" to create an object AliEMCALRecParam \nand store it to OCDB. \nPress button \"Get RecParam\" to read reconstruction parameters from OCDB \nand print then to stdout.\n\n";
+ printf(string);
+}
+
+//------------------------------------------------------------------------
+void SetRecParam()
+{
+ // Create an object AliEMCALRecParam and store it to OCDB
+
+ TString DBFolder;
+ Int_t firstRun = 0;
+ Int_t lastRun = 999999;
+ Int_t beamPeriod = 1;
+ char* objFormat = "";
+
+ DBFolder ="local://LocalCDB";
+ objFormat = "EMCAL reconstruction parameters";
+
+ // Create reconstruction parameter object and set parameter values
+
+ AliEMCALRecParam *recParamDB = new AliEMCALRecParam();
+ recParamDB->SetClusteringThreshold(0.5);
+ recParamDB->SetW0(4.5);
+ recParamDB->SetMinECut(0.45);
+
+ // Store calibration data into database
+
+ AliCDBMetaData md;
+ md.SetComment(objFormat);
+ md.SetBeamPeriod(beamPeriod);
+ md.SetResponsible("Yuri Kharlov");
+
+ AliCDBId id("EMCAL/RecParam/Data",firstRun,lastRun);
+
+ AliCDBManager* man = AliCDBManager::Instance();
+ AliCDBStorage* loc = man->GetStorage(DBFolder.Data());
+ loc->Put(recParamDB, id, &md);
+ recParamDB->Print();
+}
+
+//------------------------------------------------------------------------
+void GetRecParam()
+{
+ // Read reconstruction parameters from OCDB
+
+ TString DBFolder;
+
+ DBFolder ="local://LocalCDB";
+ Int_t runNumber = 0;
+
+ AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBManager::Instance()->SetSpecificStorage("EMCAL/*",DBFolder.Data());
+
+ AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("EMCAL/RecParam/Data",runNumber);
+ if (cdbEntry == 0) {
+ cerr << "No CDBEntry found at path "<<DBFolder.Data()<<"/"<<"EMCAL/RecParam/Data"<<endl;
+ return;
+ }
+
+ AliEMCALRecParam* recParam = (AliEMCALRecParam*)cdbEntry->GetObject();
+ if (recParam != 0) recParam->Print("");
+ else
+ cerr << "GetRecParam(): no AliEMCALRecParam object is found in OCDB" << endl;
+
+}