From: odjuvsla Date: Fri, 19 Mar 2010 16:45:29 +0000 (+0000) Subject: - added handlers for reconstruction parameters X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=09dce353f6129a0f1e52f1fc669b484a7746f1d8;p=u%2Fmrichter%2FAliRoot.git - added handlers for reconstruction parameters --- diff --git a/HLT/CALO/AliHLTCaloRecoParamHandler.cxx b/HLT/CALO/AliHLTCaloRecoParamHandler.cxx new file mode 100644 index 00000000000..caf1257737c --- /dev/null +++ b/HLT/CALO/AliHLTCaloRecoParamHandler.cxx @@ -0,0 +1,33 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Oystein Djuvsland * + * * + * 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. * + **************************************************************************/ + +#include "AliHLTCaloRecoParamHandler.h" + +AliHLTCaloRecoParamHandler::AliHLTCaloRecoParamHandler ( TString det ) : +AliHLTCaloConstantsHandler(det) +,fLogWeight(4.5) +,fRecPointMemberThreshold(0.01) +,fRecPointThreshold(0.1) +{ + // See header file for class documentation + +} + + +AliHLTCaloRecoParamHandler::~AliHLTCaloRecoParamHandler() +{ + // See header file for class documentation + +} + diff --git a/HLT/CALO/AliHLTCaloRecoParamHandler.h b/HLT/CALO/AliHLTCaloRecoParamHandler.h new file mode 100644 index 00000000000..d19f6226da4 --- /dev/null +++ b/HLT/CALO/AliHLTCaloRecoParamHandler.h @@ -0,0 +1,73 @@ + +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Oystein Djuvsland * + * * + * 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. * + **************************************************************************/ + + +#ifndef ALIHLTCALORECOPARAMHANDLER_H +#define ALIHLTCALORECOPARAMHANDLER_H + +#include "AliHLTCaloConstantsHandler.h" + +class AliHLTCaloRecoParamHandler: public AliHLTCaloConstantsHandler + { + + public: + + /** Constructor, */ + AliHLTCaloRecoParamHandler(TString det); // See above + + /** Destructor */ + virtual ~AliHLTCaloRecoParamHandler(); // See above + + /** Get the parameters from CDB, must be implemented by the child classes */ + virtual Int_t GetParametersFromCDB() = 0; // See above + + /** Get the corrected energy, should really be implemented by the child classes */ + virtual Float_t GetCorrectedEnergy(Float_t e) { return e; } + + /** Get the log weight */ + Float_t GetLogWeight() { return fLogWeight; } + + /** Get rec point threshold */ + Float_t GetRecPointThreshold() { return fRecPointThreshold; } + + /** Get rec point member threshold */ + Float_t GetRecPointMemberThreshold() { return fRecPointMemberThreshold; } + + protected: + /** The log weight used in calculating the cluster position */ + Float_t fLogWeight; //COMMENT + + /** The threshold for adding a digit to a recpoint */ + Float_t fRecPointMemberThreshold; //COMMENT + + /** The threshold for starting a recpoint */ + Float_t fRecPointThreshold; //COMMENT + + + private: + + /** Default constructor, inhibited */ + AliHLTCaloRecoParamHandler(); // See above + + /** Copy constructor, not implemented */ + AliHLTCaloRecoParamHandler (const AliHLTCaloRecoParamHandler &); //COMMENT + + /** Assignment operator, not implemented */ + AliHLTCaloRecoParamHandler & operator = (const AliHLTCaloRecoParamHandler &); //COMMENT + + + }; + +#endif // ALIHLTCALORECOPARAMHANDLER_H diff --git a/HLT/EMCAL/AliHLTEMCALRecoParamHandler.cxx b/HLT/EMCAL/AliHLTEMCALRecoParamHandler.cxx new file mode 100644 index 00000000000..bb0e8405dbe --- /dev/null +++ b/HLT/EMCAL/AliHLTEMCALRecoParamHandler.cxx @@ -0,0 +1,75 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Oystein Djuvsland * + * * + * 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. * + **************************************************************************/ + +#include "AliHLTEMCALRecoParamHandler.h" +#include "AliCDBManager.h" +#include "AliCDBEntry.h" + +AliHLTEMCALRecoParamHandler::AliHLTEMCALRecoParamHandler() : +AliHLTCaloRecoParamHandler("EMCAL") +{ + // See header file for class documentation + + fEMCALPidPtr = new AliEMCALPIDv1(); + +} + + +AliHLTEMCALRecoParamHandler::~AliHLTEMCALRecoParamHandler() +{ + // See header file for class documentation + if(fRecoParamPtr) delete fRecoParamPtr; fRecoParamPtr = 0; + +} + +Int_t AliHLTEMCALRecoParamHandler::GetParametersFromCDB() +{ + // See header file for documentation + AliCDBPath path("EMCAL","Calib","RecoParam"); + if(path.GetPath()) + { +// HLTInfo("configure from entry %s", path.GetPath()); + AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); + if (pEntry) + { + if(!fRecoParamPtr) + { + delete fRecoParamPtr; + fRecoParamPtr = 0; + } + TObjArray *paramArray = dynamic_cast(pEntry->GetObject()); + fRecoParamPtr = dynamic_cast(paramArray)->At(0); + if(!fRecoParamPtr) + { + return -1; + } + fLogWeight = fRecoParamPtr->GetEMCLogWeight(); + fRecPointMemberThreshold = fRecoParamPtr->GetEMCMinE(); + fRecPointThreshold = fRecoParamPtr->GetEMCClusteringThreshold(); + } + else + { +// HLTError("can not fetch object \"%s\" from OCDB", path); + return -1; + } + } + return 0; +} + +Float_t AliHLTEMCALRecoParamHandler::GetCorrectedEnergy ( Float_t e ) +{ + // See header file for class documentation + return e; +} + diff --git a/HLT/EMCAL/AliHLTEMCALRecoParamHandler.h b/HLT/EMCAL/AliHLTEMCALRecoParamHandler.h new file mode 100644 index 00000000000..6d30ada2c43 --- /dev/null +++ b/HLT/EMCAL/AliHLTEMCALRecoParamHandler.h @@ -0,0 +1,58 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Oystein Djuvsland * + * * + * 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. * + **************************************************************************/ + +#ifndef ALIHLTEMCALRECOPARAMHANDLER_H +#define ALIHLTEMCALRECOPARAMHANDLER_H + +#include "AliHLTCaloRecoParamHandler.h" + +class AliEMCALRecoParam; +class AliEMCALPIDv1; + +class AliHLTEMCALRecoParamHandler : public AliHLTCaloRecoParamHandler + { + public: + + /** Constructor */ + AliHLTEMCALRecoParamHandler(); + + /** Destructor */ + virtual ~AliHLTEMCALRecoParamHandler(); + + /** See base class for documentation */ + virtual Int_t GetParametersFromCDB(); + + /** Get the energy corrected for non-linear effects etc. */ + virtual Float_t GetCorrectedEnergy(Float_t e); + + /** Get the log weight */ + Float_t GetLogWeight() { return fLogWeight; } + + /** Get rec point threshold */ + Float_t GetRecPointThreshold() { return fRecPointThreshold; } + + /** Get rec point member threshold */ + Float_t GetRecPointMemberThreshold() { return fRecPointMemberThreshold; } + + private: + + /** Copy constructor, not implemented */ + AliHLTEMCALRecoParamHandler (const AliHLTEMCALRecoParamHandler &); //COMMENT + + /** Assignment operator, not implemented */ + AliHLTEMCALRecoParamHandler & operator = (const AliHLTEMCALRecoParamHandler &); //COMMENT + + }; + +#endif // ALIHLTPHOSRECOPARAMHANDLER_H diff --git a/HLT/PHOS/AliHLTPHOSRecoParamHandler.cxx b/HLT/PHOS/AliHLTPHOSRecoParamHandler.cxx new file mode 100644 index 00000000000..40f1244c712 --- /dev/null +++ b/HLT/PHOS/AliHLTPHOSRecoParamHandler.cxx @@ -0,0 +1,80 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Oystein Djuvsland * + * * + * 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. * + **************************************************************************/ + +#include "AliHLTPHOSRecoParamHandler.h" +#include "AliCDBManager.h" +#include "AliCDBEntry.h" +#include "AliPHOSRecoParam.h" +#include "AliPHOSPIDv1.h" +#include "TObjArray.h" + +AliHLTPHOSRecoParamHandler::AliHLTPHOSRecoParamHandler() : +AliHLTCaloRecoParamHandler("PHOS") +,fRecoParamPtr(0), +fPHOSPidPtr(0) +{ + // See header file for class documentation + + fPHOSPidPtr = new AliPHOSPIDv1(); + +} + + +AliHLTPHOSRecoParamHandler::~AliHLTPHOSRecoParamHandler() +{ + // See header file for class documentation + if(fRecoParamPtr) delete fRecoParamPtr; fRecoParamPtr = 0; + +} + +Int_t AliHLTPHOSRecoParamHandler::GetParametersFromCDB() +{ + // See header file for documentation + AliCDBPath path("PHOS","Calib","RecoParam"); + if(path.GetPath()) + { +// HLTInfo("configure from entry %s", path.GetPath()); + AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); + if (pEntry) + { + if(!fRecoParamPtr) + { + delete fRecoParamPtr; + fRecoParamPtr = 0; + } + TObjArray *paramArray = dynamic_cast(pEntry->GetObject()); + fRecoParamPtr = dynamic_cast(paramArray->At(0)); + if(!fRecoParamPtr) + { + return -1; + } + fLogWeight = fRecoParamPtr->GetEMCLogWeight(); + fRecPointMemberThreshold = fRecoParamPtr->GetEMCMinE(); + fRecPointThreshold = fRecoParamPtr->GetEMCClusteringThreshold(); + } + else + { +// HLTError("can not fetch object \"%s\" from OCDB", path); + return -1; + } + } + return 0; +} + +Float_t AliHLTPHOSRecoParamHandler::GetCorrectedEnergy ( Float_t e ) +{ + // See header file for class documentation + return fPHOSPidPtr->GetCalibratedEnergy(e); +} + diff --git a/HLT/PHOS/AliHLTPHOSRecoParamHandler.h b/HLT/PHOS/AliHLTPHOSRecoParamHandler.h new file mode 100644 index 00000000000..3c7b8d3b6af --- /dev/null +++ b/HLT/PHOS/AliHLTPHOSRecoParamHandler.h @@ -0,0 +1,55 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Authors: Oystein Djuvsland * + * * + * 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. * + **************************************************************************/ + +#ifndef ALIHLTPHOSRECOPARAMHANDLER_H +#define ALIHLTPHOSRECOPARAMHANDLER_H + +#include "AliHLTCaloRecoParamHandler.h" + +class AliPHOSRecoParam; +class AliPHOSPIDv1; + +class AliHLTPHOSRecoParamHandler : public AliHLTCaloRecoParamHandler + { + public: + + /** Constructor */ + AliHLTPHOSRecoParamHandler(); + + /** Destructor */ + virtual ~AliHLTPHOSRecoParamHandler(); + + /** See base class for documentation */ + virtual Int_t GetParametersFromCDB(); + + /** Get the energy corrected for non-linear effects etc. */ + virtual Float_t GetCorrectedEnergy(Float_t e); + + private: + + /** Copy constructor, not implemented */ + AliHLTPHOSRecoParamHandler (const AliHLTPHOSRecoParamHandler &); //COMMENT + + /** Assignment operator, not implemented */ + AliHLTPHOSRecoParamHandler & operator = (const AliHLTPHOSRecoParamHandler &); //COMMENT + + /** The reco param object */ + AliPHOSRecoParam *fRecoParamPtr; // COMMENT + + /** PHOS PID class */ + AliPHOSPIDv1 *fPHOSPidPtr; // COMMENT + + }; + +#endif // ALIHLTPHOSRECOPARAMHANDLER_H