]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSRcuTreeMaker.cxx
Coding conventions and minor fixes
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSRcuTreeMaker.cxx
1  
2  /**************************************************************************
3  * This file is property of and copyright by the ALICE HLT Project        * 
4  * All rights reserved.                                                   *
5  *                                                                        *
6  * Primary Authors: Oystein Djuvsland                                     *
7  *                                                                        *
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  **************************************************************************/
16
17
18 #include "AliHLTPHOSRcuTreeMaker.h"
19 #include "AliHLTPHOSBase.h"
20 #include "AliHLTPHOSRcuDigitContainerDataStruct.h"
21 #include "AliHLTPHOSDigitDataStruct.h"
22 #include "AliHLTPHOSDigit.h"
23 #include "TClonesArray.h"
24 #include "TTree.h"
25
26 ClassImp(AliHLTPHOSRcuTreeMaker);
27
28 void
29 AliHLTPHOSRcuTreeMaker::FUCK()
30 {
31   cout << "AliHLTPHOSTreeMaker::FUCK"  << endl;
32 }
33
34 AliHLTPHOSRcuTreeMaker::AliHLTPHOSRcuTreeMaker() :
35   AliHLTPHOSBase(),
36   fDigitArrayPtr(0),
37   fDigitTreePtr(0)
38 {
39
40   fDigitArrayPtr = new TClonesArray("AliHLTPHOSRcuDigit", 300); //!!!!!!!!!!!!!!!!
41   fDigitTreePtr = new TTree("digitTree", "Digits Tree");
42
43   fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);
44
45 }
46
47 AliHLTPHOSRcuTreeMaker::~AliHLTPHOSRcuTreeMaker()
48 {
49 }
50
51 Int_t
52 AliHLTPHOSRcuTreeMaker::MakeDigitArray(AliHLTPHOSRcuDigitContainerDataStruct *digitContainer, Int_t nDigits)
53 {
54   AliHLTPHOSDigit *digit = 0;
55   AliHLTPHOSDigitDataStruct *digitStruct = 0;
56
57   for(UInt_t i = 0; i < digitContainer->fNDigits; i++)
58     {
59       digitStruct = &(digitContainer->fDigitDataStruct[i]);
60       digit = (AliHLTPHOSDigit*)fDigitArrayPtr->New(i + nDigits);
61       digit->SetX(digitStruct->fX);
62       digit->SetZ(digitStruct->fZ);
63       digit->SetAmplitude(digitStruct->fAmplitude);
64       digit->SetTime(digitStruct->fTime);
65       digit->SetGain(digitStruct->fGain);
66       digit->SetRawData(digitStruct->fData);
67       digit->SetCrazyness(digitStruct->fCrazyness);
68       digit->SetBaseline(digitStruct->fBaseline);
69     }
70   return digitContainer->fNDigits;
71 }
72
73 void
74 AliHLTPHOSRcuTreeMaker::FillDigitTree()
75 {
76   fDigitTreePtr->Fill();
77   fDigitArrayPtr->Clear();
78 }
79  
80 void 
81 AliHLTPHOSRcuTreeMaker::SetDigitTree(TTree *tree) 
82
83   fDigitTreePtr = tree; 
84   fDigitTreePtr->Branch("Digit", &fDigitArrayPtr);
85 }