2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * All rights reserved. *
6 * Primary Authors: Oystein Djuvsland *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
18 #include "AliHLTPHOSTreeMaker.h"
19 #include "AliHLTPHOSBase.h"
20 #include "AliHLTPHOSDigitContainerDataStruct.h"
21 #include "AliHLTPHOSDigitDataStruct.h"
22 #include "AliHLTPHOSDigit.h"
23 #include "TClonesArray.h"
26 ClassImp(AliHLTPHOSTreeMaker);
28 AliHLTPHOSTreeMaker::AliHLTPHOSTreeMaker() :
34 fDigitArrayPtr = new TClonesArray("AliHLTPHOSDigit", 300); //!!!!!!!!!!!!!!!!
35 fDigitTreePtr = new TTree("digitTree", "Digits Tree");
37 fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);
41 AliHLTPHOSTreeMaker::~AliHLTPHOSTreeMaker()
46 AliHLTPHOSTreeMaker::MakeDigitArray(AliHLTPHOSDigitContainerDataStruct *digitContainer, Int_t nDigits)
48 AliHLTPHOSDigit *digit = 0;
49 AliHLTPHOSDigitDataStruct *digitStruct = 0;
51 for(UInt_t i = 0; i < digitContainer->fNDigits; i++)
53 digitStruct = &(digitContainer->fDigitDataStruct[i]);
54 digit = (AliHLTPHOSDigit*)fDigitArrayPtr->New(i + nDigits);
55 digit->SetX(digitStruct->fX);
56 digit->SetZ(digitStruct->fZ);
57 digit->SetAmplitude(digitStruct->fAmplitude);
58 digit->SetTime(digitStruct->fTime);
59 digit->SetGain(digitStruct->fGain);
60 digit->SetRawData(digitStruct->fData);
61 digit->SetCrazyness(digitStruct->fCrazyness);
62 digit->SetBaseline(digitStruct->fBaseline);
64 return digitContainer->fNDigits;
68 AliHLTPHOSTreeMaker::FillDigitTree()
70 fDigitTreePtr->Fill();
71 fDigitArrayPtr->Clear();
75 AliHLTPHOSTreeMaker::SetDigitTree(TTree *tree)
78 fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);