From: phille Date: Tue, 6 May 2008 22:17:04 +0000 (+0000) Subject: Replacing "is a" with a "has a" relationship X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=82fb0dc84ade98e330430ffdeffcc0ed3d64fd32 Replacing "is a" with a "has a" relationship for several componets that "has" a RCU processor property but wich "is not" a RCU property. In addition this componenet was needed for the calibration processor since both the AliHLTPHOSRcuProcessor and the AliHLTCalibrationProcessor inheriths from the AliHLTProcessor, i.e ambigious inheritance that would have been quite ugly to clean up. --- diff --git a/HLT/PHOS/AliHLTPHOSRcuProperties.cxx b/HLT/PHOS/AliHLTPHOSRcuProperties.cxx new file mode 100644 index 00000000000..5f92c3ac29b --- /dev/null +++ b/HLT/PHOS/AliHLTPHOSRcuProperties.cxx @@ -0,0 +1,224 @@ +/************************************************************************** + * This file is property of and copyright by the Experimental Nuclear * + * Physics Group, Dep. of Physics * + * University of Oslo, Norway, 2007 * + * * + * Author: Per Thomas Hille for the ALICE HLT Project.* + * Contributors are mentioned in the code where appropriate. * + * Please report bugs to perthi@fys.uio.no * + * * + * 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 "AliHLTPHOSRcuProperties.h" +//#include "AliHLTPHOSConstants.h" + + +//#include "" + + +AliHLTPHOSRcuProperties::AliHLTPHOSRcuProperties() :fTest(-2), + fkEquippmentID(0), + fModID(2), + fRcuID(0), + fRcuX(0), + fRcuZ(0), + fRcuZOffset(0), + fRcuXOffset(0), + fPrintInfo(false), + fPrintInfoFrequncy(10000), + fIsSetEquippmentID(kFALSE), + fLog(), + fIsInitialized(false) +{ + +} + +AliHLTPHOSRcuProperties::~AliHLTPHOSRcuProperties() +{ + +} + + +const AliHLTUInt16_t +AliHLTPHOSRcuProperties::GetEquippmentID() const +{ + return fkEquippmentID; +} + + +const int +AliHLTPHOSRcuProperties::GetRCUID() const +{ + cout << "AliHLTPHOSRcuProperties::GetRCUI returning " << fRcuID << endl; + if(fIsInitialized == true) + { + cout <<"AliHLTPHOSRcuProperties::GetRCUID fIsInitialized = TRUE" << endl; + } + else + { + cout <<"AliHLTPHOSRcuProperties::GetRCUID fIsInitialized = FALSE" << endl; + } + + return fRcuID; + // cout << "AliHLTPHOSRcuProperties::GetRCUI returning " << fRcuID << endl; + + // int tmpRcuId = 0; + + + /* + if(fRcuZ ==0 && fRcuX == 0) + { + tmpRcuId = 0; + } + + if(fRcuZ ==1 && fRcuX == 0) + { + tmpRcuId = 1; + } + + if(fRcuZ ==1 && fRcuX == 1) + { + tmpRcuId = 2; + } + + if(fRcuZ ==0 && fRcuX == 1) + { + tmpRcuId = 3; + } + */ + + // return tmpRcuId; +} + + + +void +AliHLTPHOSRcuProperties::SetEquippmentID(AliHLTUInt16_t id) +{ + AliHLTUInt16_t &ref = const_cast(fkEquippmentID); + ref = id; +} + + +int +AliHLTPHOSRcuProperties::ScanArguments(int argc, const char** argv) +{ + fPrintInfo = kFALSE; + int iResult=0; + TString argument=""; + + for(int i=0; i=0; i++) + { + argument=argv[i]; + + + if (argument.IsNull()) + { + continue; + } + + if (argument.CompareTo("-equipmentID") == 0) + { + cout << "AliHLTPHOSRcuProperties:ScanArguments argument = -equipmentID " <"); + iResult = -3; + } + return iResult; +} + + +void +AliHLTPHOSRcuProperties::SetCoordinates(AliHLTUInt16_t /*equippmentID*/) +{ + // int rcuIndex = (fkEquippmentID - 1792)%N_RCUS_PER_MODULE; + + fRcuID = (fkEquippmentID - 1792)%N_RCUS_PER_MODULE; + // fModID = (fkEquippmentID -1792 -rcuIndex)/N_RCUS_PER_MODULE; + fModID = (fkEquippmentID -1792 - fRcuID)/N_RCUS_PER_MODULE; + + if( fRcuID == 0) + { + fRcuX = 0; + fRcuZ = 0; + } + + if( fRcuID == 1) + { + fRcuX = 0; + fRcuZ = 1; + } + + if( fRcuID == 2) + { + fRcuX = 1; + fRcuZ = 0; + } + + if( fRcuID == 3) + { + fRcuX = 1; + fRcuZ = 1; + } + + fRcuZOffset = N_ZROWS_RCU*fRcuZ; + fRcuXOffset = N_XCOLUMNS_RCU*fRcuX; + + // cout <<"********InitInfo************"<< endl; +// cout <<"AliHLTPHOSRcuProperties::SetCoordinate casted"<< endl; +// cout <<"rcuIndex"<< fRcuID < for the ALICE HLT Project.* + * Contributors are mentioned in the code where appropriate. * + * Please report bugs to perthi@fys.uio.no * + * * + * 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 "AliHLTDataTypes.h" +#include "AliHLTLogging.h" +#include "AliHLTPHOSConstants.h" + +using namespace PhosHLTConst; + +//class AliHLTPHOSRcuProperties : public AliHLTLogging +class AliHLTPHOSRcuProperties +{ +public: + AliHLTPHOSRcuProperties(); + virtual ~AliHLTPHOSRcuProperties(); + + const AliHLTUInt16_t GetEquippmentID() const; + const int GetRCUID() const; + virtual int ScanArguments(int argc, const char** argv); + void SetEquippmentID(AliHLTUInt16_t id); + void SetCoordinates(AliHLTUInt16_t equippmentID); + + + int fTest; + + protected: + const AliHLTUInt16_t fkEquippmentID; /**