// $Id$ /************************************************************************** * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. * * * * Authors: Boris Polichtchouk & Per Thomas Hille for the ALICE * * offline/HLT 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. * **************************************************************************/ #include "AliHLTPHOSRcuAltroPatternTest.h" #include #include "AliHLTPHOSPattern.h" #include "AliHLTPHOSConstants.h" using namespace PhosHLTConst; using namespace std; // fPatternTestPtr = new AliHLTPHOSRcuAltroPatternTest(fModuleID, fRcuX, fRcuZ, tmpPattern, ALTRO_MAX_SAMPLES ); AliHLTPHOSRcuAltroPatternTest::AliHLTPHOSRcuAltroPatternTest(const AliHLTUInt8_t moduleID, const AliHLTUInt8_t rcuX, const AliHLTUInt8_t rcuZ, const int *pattern, const int length): AliHLTPHOSBase(), fModuleID(moduleID), fRcuX(rcuX), fRcuZ(rcuZ), fReferenceAltroPattern(0), fCnt(0) { fReferenceAltroPattern = new AliHLTPHOSPattern(pattern, length); for(int z=0; z < NZROWSRCU; z++) { for(int x=0; x < NXCOLUMNSRCU; x++) { for(int gain = 0; gain < NGAINS; gain ++) { fNEqual[z][x][gain] = 0; fNNotEqual[z][x][gain] = 0; fPerChannelPatterns[z][x][gain] = 0; } } } } AliHLTPHOSRcuAltroPatternTest::~ AliHLTPHOSRcuAltroPatternTest() { //Destructor } int AliHLTPHOSRcuAltroPatternTest::ValidateAltroPattern(const int *inputPattern, const int samples, const int presamples) const { if(fReferenceAltroPattern !=0) { return fReferenceAltroPattern->ValidatePattern(inputPattern, samples, presamples); } else { return -99; } } int AliHLTPHOSRcuAltroPatternTest::AddPattern(const int *inputPattern, const int z, const int x, const int gain, const int nSamples, const int nPresamples) { if(fPerChannelPatterns[z][x][gain] == 0) { // cout << "AliHLTPHOSRcuAltroPatternTest::AddPattern creating new pattern z = "<< z <<" x =" << x <<" gain = "<< gain < 2) { cout << "z = "<< z <<" x " << x << " gain "<< gain << " Has "<< tmp <<" patterns " <(tmpPattern)->PrintPattern(); tmpPattern = tmpPattern->GetNextPtr(); } cout <