+++ /dev/null
-#ifndef ALIHLTPHOSRCUCHANNELDATASTRUCT_H
-#define ALIHLTPHOSRCUCHANNELDATASTRUCT_H
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary Author: Per Thomas Hille <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 "AliHLTPHOSCommonDefs.h"
-#include "AliHLTPHOSValidChannelDataStruct.h"
-#include "AliHLTPHOSConstants.h"
-
-using namespace PhosHLTConst;
-
-struct AliHLTPHOSRcuChannelDataStruct
-{
- AliHLTUInt32_t fNValidChannels;
- AliHLTUInt8_t fModuleID;
- AliHLTUInt8_t fRcuX;
- AliHLTUInt8_t fRcuZ;
- // AliHLTPHOSValidChannelDataStruct fValidData[N_ROWS_RCU*N_COLUMNS_RCU*N_GAINS];
- // AliHLTPHOSValidChannelDataStruct fValidData[512];
- AliHLTPHOSValidChannelDataStruct fValidData[N_ZROWS_RCU*N_XCOLUMNS_RCU*N_GAINS];
- // AliHLTUInt16_t fBuffer[(ALTRO_MAX_SAMPLES+2)*N_ZROWS_RCU*N_XCOLUMNS_RCU*N_GAINS];
-
-
-};
-
-
-
-#endif
+++ /dev/null
-
-#include "AliHLTPHOSRcuDigitMaker.h"
-#include "AliHLTPHOSDigit.h"
-#include "AliHLTPHOSConstants.h"
-#include "AliHLTPHOSBaseline.h"
-#include "TTree.h"
-#include "TBranch.h"
-#include "TClonesArray.h"
-#include "TFile.h"
-
-#include "AliHLTPHOSValidCellDataStruct.h"
-#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-//#include "AliHLTPHOSDigitContainerStruct.h"
-#include "AliHLTPHOSDigitDataStruct.h"
-#include "AliHLTPHOSRcuDigitContainerDataStruct.h"
-
-
-//ClassImp(AliHLTPHOSRcuDigitMaker);
-
-using namespace PhosHLTConst;
-
-AliHLTPHOSRcuDigitMaker::AliHLTPHOSRcuDigitMaker() :
- AliHLTPHOSBase(),
- fCellDataPtr(0),
- // fDigitContainerStructPtr(0),
- fDigitArrayPtr(0),
- fDigitPtr(0),
- // fDigitStructPtr(0),
- fDigitCount(0),
- fNrPresamples(10),
- fDigitThreshold(0)
-{
- //comment
-}
-
-AliHLTPHOSRcuDigitMaker::~AliHLTPHOSRcuDigitMaker()
-
-{
-}
-
-Int_t
-AliHLTPHOSRcuDigitMaker::MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuData)
-{
- //comment
- Int_t i = 0;
- Int_t j = 0;
- Int_t x = -1;
- Int_t z = -1;
- Float_t amplitude = 0;
- for ( i = 0; i < rcuData->fCnt; i++ )
- {
- fCellDataPtr = & ( rcuData->fValidData[i] );
- x = fCellDataPtr->fX;
- z = fCellDataPtr->fZ;
- amplitude = fCellDataPtr->fEnergy;
- if ( amplitude > fDigitThreshold )
- {
- fDigitStructPtr = & ( fDigitContainerStructPtr->fDigitDataStruct[j + fDigitCount] );
- fDigitStructPtr->fX = fCellDataPtr->fX;
- fDigitStructPtr->fZ = fCellDataPtr->fZ;
- fDigitStructPtr->fAmplitude = ( amplitude );
- fDigitStructPtr->fTime = fCellDataPtr->fTime ;
- fDigitStructPtr->fGain = ( fCellDataPtr->fGain );
- fDigitStructPtr->SetRawData ( fCellDataPtr->fData );
- fDigitStructPtr->fCrazyness = fCellDataPtr->fCrazyness;
- fDigitStructPtr->fBaseline = -1;
- j++;
- }
- }
- fDigitCount += j;
- return fDigitCount;
-}
-/*
-Int_t
-AliHLTPHOSRcuDigitMaker::SetDigitsTree(TTree *tree)
-{
- TBranch * digBranch = tree->Branch("digits","TClonesArray",fDebugDigitArrayPtr);
-}
-*/
-
-void
-AliHLTPHOSRcuDigitMaker::Reset()
-{
- // fDigitArrayPtr->Clear();
- fDigitCount = 0;
-}
-
-
-
-
-
+++ /dev/null
-//insert copyright
-
-#ifndef ALIHLTPHOSRCUDIGITMAKER_H
-#define ALIHLTPHOSRCUDIGITMAKER_H
-
-#include "AliHLTPHOSBase.h"
-#include "AliHLTPHOSConstants.h"
-//#include "AliHLTPHOSRcuProcessor.h"
-
-
-class AliHLTPHOSDigit;
-class TClonesArray;
-class TTree;
-class AliHLTPHOSValidCellDataStruct;
-class AliHLTPHOSRcuCellEnergyDataStruct;
-class AliHLTPHOSRcuDigitContainerDataStruct;
-class AliHLTPHOSDigitDataStruct;
-
-using namespace PhosHLTConst;
-
-class AliHLTPHOSRcuDigitMaker : public AliHLTPHOSBase
-{
-public:
- AliHLTPHOSRcuDigitMaker();
- virtual ~AliHLTPHOSRcuDigitMaker();
-
- // void SetValidCellData(AliHLTPHOSValidCellDataStruct *data) { fCellDataPtr = data; }
- // void SetDigitContainerStruct(AliHLTPHOSDigitContainerStruct *container)
- //{ fDigitContainerStructPtr = container; }
-
- void SetDigitContainerStruct(AliHLTPHOSRcuDigitContainerDataStruct *container)
- { fDigitContainerStructPtr = container; }
-
- void SetDigitArray(TClonesArray *array) { fDigitArrayPtr = array; }
- void ResetDigitCount() { fDigitCount = 0; }
- void SetDigitThreshold(Int_t threshold) { fDigitThreshold = threshold; }
- void SetNrPresamples(Int_t n) { fNrPresamples = n; }
- Int_t MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct*);
- void Reset();
- // virtual void De
-
-private:
-
- AliHLTPHOSValidCellDataStruct *fCellDataPtr; //comment
- AliHLTPHOSRcuDigitContainerDataStruct *fDigitContainerStructPtr; //comment
- TClonesArray *fDigitArrayPtr; //comment
- AliHLTPHOSDigit *fDigitPtr; //comment
- //AliHLTPHOSDigitDataStruct *fDigitStructPtr;
- AliHLTPHOSDigitDataStruct *fDigitStructPtr; //comment
- Int_t fDigitCount; //comment
- Int_t fNrPresamples; //comment
-
- Float_t fDigitThreshold; //comment
-
- // ClassDef(AliHLTPHOSRcuDigitMaker, 1);
-};
-
-
-#endif
-
+++ /dev/null
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary 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 "AliHLTPHOSRcuDigitMakerComponent.h"
-#include "AliHLTPHOSRcuDigitMaker.h"
-#include "TTree.h"
-#include "AliHLTPHOSRcuProcessor.h"
-#include "AliHLTPHOSRcuCellEnergyDataStruct.h"
-#include "AliHLTPHOSRcuDigitContainerDataStruct.h"
-#include "TClonesArray.h"
-#include "TFile.h"
-#include <sys/stat.h>
-#include <sys/types.h>
-
-const AliHLTComponentDataType AliHLTPHOSRcuDigitMakerComponent::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}};
-
-AliHLTPHOSRcuDigitMakerComponent gAliHLTPHOSRcuDigitMakerComponent;
-
-AliHLTPHOSRcuDigitMakerComponent::AliHLTPHOSRcuDigitMakerComponent() :
- AliHLTPHOSRcuProcessor(),
- fDigitMakerPtr(0),
- fEvtCnt(0)
-{
- //comment
-}
-
-AliHLTPHOSRcuDigitMakerComponent::~AliHLTPHOSRcuDigitMakerComponent()
-{
- //comment
-}
-
-int
-AliHLTPHOSRcuDigitMakerComponent::Deinit()
-{
- //comment
- if(fDigitMakerPtr)
- {
- delete fDigitMakerPtr;
- fDigitMakerPtr = 0;
- }
- return 0;
-}
-
-const char*
-AliHLTPHOSRcuDigitMakerComponent::GetComponentID()
-{
- //comment
- return "PhosRcuDigitMaker";
-}
-
-void
-
-AliHLTPHOSRcuDigitMakerComponent::GetInputDataTypes(vector<AliHLTComponentDataType>& list)
-{
- //Get datatypes for input
- const AliHLTComponentDataType* pType=fgkInputDataTypes;
- while (pType->fID!=0) {
- list.push_back(*pType);
- pType++;
- }
-}
-
-AliHLTComponentDataType
-AliHLTPHOSRcuDigitMakerComponent::GetOutputDataType()
-{
- //comment
- return AliHLTPHOSDefinitions::fgkAliHLTDigitDataType;
-}
-
-
-void
-AliHLTPHOSRcuDigitMakerComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
-{
- //comment
- constBase = 30;
- inputMultiplier = 1;
-}
-
-int
-AliHLTPHOSRcuDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
- std::vector<AliHLTComponentBlockData>& outputBlocks)
-{
- cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP1" << endl;
-
- //Do event
-
- UInt_t tSize = 0;
- UInt_t offset = 0;
- UInt_t mysize = 0;
- //Int_t nRecPoints = 0;
- //Int_t index = 0;
-
- //Int_t fileCount = 0;
- Int_t digitCount = 0;
- //char filename [50];
-
-
- AliHLTUInt8_t* outBPtr;
- outBPtr = outputPtr;
- const AliHLTComponentBlockData* iter = 0;
- unsigned long ndx;
-
- cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP2" << endl;
- fDigitContainerPtr = (AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr;
- //fDigitMakerPtr->SetDigitContainerStruct(fDigitContainerPtr);
- fDigitMakerPtr->SetDigitContainerStruct((AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr);
- cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP3" << endl;
- for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
- {
- iter = blocks+ndx;
-
- if(iter->fDataType != AliHLTPHOSDefinitions::fgkCellEnergyDataType)
- {
- // cout << "Warning: data type is not fgkCellEnergyDataType " << endl;
- continue;
-
- }
-
-
-
- digitCount = fDigitMakerPtr->MakeDigits(reinterpret_cast<AliHLTPHOSRcuCellEnergyDataStruct*>(iter->fPtr));
- }
- fEvtCnt++;
-
- mysize = 0;
- offset = tSize;
-
- mysize += sizeof(AliHLTPHOSRcuDigitContainerDataStruct);
- ((AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr)->fNDigits = digitCount;
- AliHLTComponentBlockData bd;
- FillBlockData( bd );
- bd.fOffset = offset;
- bd.fSize = mysize;
- bd.fDataType = AliHLTPHOSDefinitions::fgkAliHLTDigitDataType;
- bd.fSpecification = 0xFFFFFFFF;
- outputBlocks.push_back( bd );
-
- tSize += mysize;
- outBPtr += mysize;
-
- if( tSize > size )
- {
- Logging( kHLTLogFatal, "HLT::AliHLTPHOSRcuDigitMakerComponent::DoEvent", "Too much data",
- "Data written over allowed buffer. Amount written: %lu, allowed amount: %lu."
- , tSize, size );
- return EMSGSIZE;
- }
-
- fDigitMakerPtr->Reset();
-
- if(fEvtCnt % 10 == 0)
- {
- cout << "Event #: " << fEvtCnt << endl;
- cout << " - Number of digits found: " << digitCount << endl;
- }
-
- return 0;
-}
-
-
-int
-AliHLTPHOSRcuDigitMakerComponent::DoInit(int argc, const char** argv )
-{
- //Do initialization
-
- fDigitMakerPtr = new AliHLTPHOSRcuDigitMaker();
-
- for(int i = 0; i < argc; i++)
- {
- if(!strcmp("-threshold", argv[i]))
- fDigitMakerPtr->SetDigitThreshold(atoi(argv[i+1]));
- if(!strcmp("-presamples", argv[i]))
- fDigitMakerPtr->SetNrPresamples(atoi(argv[i+1]));
- }
-
- //fDigitMakerPtr->SetDigitThreshold(2);
-
- return 0;
-}
-
-AliHLTComponent*
-AliHLTPHOSRcuDigitMakerComponent::Spawn()
-{
- //comment
- return new AliHLTPHOSRcuDigitMakerComponent();
-}
+++ /dev/null
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary 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 ALIHLTPHOSRCUDIGITMAKERCOMPONENT_H
-#define ALIHLTPHOSRCUDIGITMAKERCOMPONENT_H
-
-#include "AliHLTPHOSRcuProcessor.h"
-//#include "AliHLTPHOSDigitMaker.h"
-//#include "TTree.h"
-//#include "TClonesArray.h"
-
-
-class AliHLTPHOSRcuDigitMaker;
-class TTree;
-class TClonesArray;
-class AliHLTPHOSRcuDigitContainerDataStruct;
-
-
-
-class AliHLTPHOSRcuDigitMakerComponent : public AliHLTPHOSRcuProcessor
-{
-public:
- AliHLTPHOSRcuDigitMakerComponent();
- virtual ~AliHLTPHOSRcuDigitMakerComponent();
-
- const char* GetComponentID();
-
- void GetInputDataTypes(std::vector<AliHLTComponentDataType>& list);
-
- AliHLTComponentDataType GetOutputDataType();
-
- void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
-
- int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
- AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
- std::vector<AliHLTComponentBlockData>& outputBlocks);
-
- AliHLTComponent* Spawn();
-
-protected:
- using AliHLTPHOSRcuProcessor::DoEvent;
- int DoInit(int argc, const char** argv);
- virtual int Deinit(); ////////// PTH WARNING you should Define a class AliHLTPHOSModuleProcessor
-
-private:
- AliHLTPHOSRcuDigitMaker *fDigitMakerPtr; //comment
- AliHLTPHOSRcuDigitContainerDataStruct *fDigitContainerPtr; //comment
- UInt_t fEvtCnt; //comment
- Int_t fRunNb; //comment
-
- static const AliHLTComponentDataType fgkInputDataTypes[]; //HLT input data type
-
-};
-#endif
-
+++ /dev/null
-
- /**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * All rights reserved. *
- * *
- * Primary 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 "AliHLTPHOSRcuTreeMaker.h"
-#include "AliHLTPHOSBase.h"
-#include "AliHLTPHOSRcuDigitContainerDataStruct.h"
-#include "AliHLTPHOSDigitDataStruct.h"
-#include "AliHLTPHOSDigit.h"
-#include "TClonesArray.h"
-#include "TTree.h"
-
-ClassImp(AliHLTPHOSRcuTreeMaker);
-
-void
-AliHLTPHOSRcuTreeMaker::FUCK()
-{
- cout << "AliHLTPHOSTreeMaker::FUCK" << endl;
-}
-
-AliHLTPHOSRcuTreeMaker::AliHLTPHOSRcuTreeMaker() :
- AliHLTPHOSBase(),
- fDigitArrayPtr(0),
- fDigitTreePtr(0)
-{
-
- fDigitArrayPtr = new TClonesArray("AliHLTPHOSRcuDigit", 300); //!!!!!!!!!!!!!!!!
- fDigitTreePtr = new TTree("digitTree", "Digits Tree");
-
- fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);
-
-}
-
-AliHLTPHOSRcuTreeMaker::~AliHLTPHOSRcuTreeMaker()
-{
-}
-
-Int_t
-AliHLTPHOSRcuTreeMaker::MakeDigitArray(AliHLTPHOSRcuDigitContainerDataStruct *digitContainer, Int_t nDigits)
-{
- AliHLTPHOSDigit *digit = 0;
- AliHLTPHOSDigitDataStruct *digitStruct = 0;
-
- for(UInt_t i = 0; i < digitContainer->fNDigits; i++)
- {
- digitStruct = &(digitContainer->fDigitDataStruct[i]);
- digit = (AliHLTPHOSDigit*)fDigitArrayPtr->New(i + nDigits);
- digit->SetX(digitStruct->fX);
- digit->SetZ(digitStruct->fZ);
- digit->SetAmplitude(digitStruct->fAmplitude);
- digit->SetTime(digitStruct->fTime);
- digit->SetGain(digitStruct->fGain);
- digit->SetRawData(digitStruct->fData);
- digit->SetCrazyness(digitStruct->fCrazyness);
- digit->SetBaseline(digitStruct->fBaseline);
- }
- return digitContainer->fNDigits;
-}
-
-void
-AliHLTPHOSRcuTreeMaker::FillDigitTree()
-{
- fDigitTreePtr->Fill();
- fDigitArrayPtr->Clear();
-}
-
-void
-AliHLTPHOSRcuTreeMaker::SetDigitTree(TTree *tree)
-{
- fDigitTreePtr = tree;
- fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);
-}