Line data Source code
1 : // -*- mode: c++ -*-
2 : /**************************************************************************
3 : * This file is property of and copyright by the Relativistic Heavy Ion *
4 : * Group (RHIG), Department of Physics Yale University, US, 2010 *
5 : * *
6 : * Author: Per Thomas Hille <perthomas.hille@yale.edu> for the ALICE EMCAL*
7 : * project. Contributors are mentioned in the code where appropriate. *
8 : * Please report bugs to perthomas.hille@yale.edu *
9 : * *
10 : * Permission to use, copy, modify and distribute this software and its *
11 : * documentation strictly for non-commercial purposes is hereby granted *
12 : * without fee, provided that the above copyright notice appears in all *
13 : * copies and that both the copyright notice and this permission notice *
14 : * appear in the supporting documentation. The authors make no claims *
15 : * about the suitability of this software for any purpose. It is *
16 : * provided "as is" without express or implied warranty. *
17 : **************************************************************************/
18 :
19 : //Container class for Peak Finder vectors
20 :
21 : #include "AliCaloPeakFinderVectors.h"
22 : #include <iostream>
23 :
24 :
25 : using namespace std;
26 :
27 :
28 :
29 42 : ClassImp( AliCaloPeakFinderVectors)
30 :
31 :
32 :
33 2 : AliCaloPeakFinderVectors::AliCaloPeakFinderVectors()
34 10 : {
35 2 : ResetVectors();
36 4 : }
37 :
38 :
39 : AliCaloPeakFinderVectors::~AliCaloPeakFinderVectors()
40 0 : {
41 :
42 0 : }
43 :
44 :
45 : void
46 : AliCaloPeakFinderVectors::ResetVectors()
47 : {
48 : // As implied by function name
49 18 : for(int i=0; i < PF::MAXSTART; i++ )
50 : {
51 192 : for(int j=0; j < PF::SAMPLERANGE; j++)
52 : {
53 90 : if(i < PF::MAXSTART && j < PF::SAMPLERANGE )
54 : {
55 18180 : for(int k = 0; k < 100; k++)
56 : {
57 9000 : fPFAmpV[i][j][k] = 0 ;
58 9000 : fPFTofV[i][j][k] = 0 ;
59 9000 : fPFAmpVC[i][j][k] = 0 ;
60 9000 : fPFTofVC[i][j][k] = 0 ;
61 : }
62 90 : }
63 : }
64 : }
65 2 : }
66 :
67 :
68 : void
69 : AliCaloPeakFinderVectors::SetVector(const int i, const int j, const Double_t *const a, const Double_t *const t,
70 : const Double_t *const ac, const Double_t *const tc )
71 : {
72 : // As implied by function name
73 0 : if(i < PF::MAXSTART && j < PF::SAMPLERANGE )
74 : {
75 0 : for(int k = 0; k < 100; k++)
76 : {
77 0 : fPFAmpV[i][j][k] = a[k];
78 0 : fPFTofV[i][j][k] = t[k];
79 0 : fPFAmpVC[i][j][k] = ac[k];
80 0 : fPFTofVC[i][j][k] = tc[k];
81 : }
82 0 : }
83 0 : }
84 :
85 :
86 : void
87 : AliCaloPeakFinderVectors::GetVector(const int i, const int j, Double_t *const a, Double_t *const t,
88 : Double_t *const ac, Double_t *const tc ) const
89 : {
90 : // As implied by function name
91 0 : if(i < PF::MAXSTART && j < PF::SAMPLERANGE )
92 : {
93 0 : for( int k = 0; k < 100; k++)
94 : {
95 0 : a[k] = fPFAmpV[i][j][k];
96 0 : t[k] = fPFTofV[i][j][k];
97 0 : ac[k] = fPFAmpVC[i][j][k];
98 0 : tc[k] = fPFTofVC[i][j][k];
99 : }
100 0 : }
101 0 : }
102 :
103 :
104 : void
105 : AliCaloPeakFinderVectors::PrintVectors() const
106 : {
107 : // As implied by function name
108 0 : cout << __FILE__ << __LINE__ << __FUNCTION__ << endl;
109 0 : for(int i= 0; i < PF::MAXSTART; i++ )
110 : {
111 0 : for(int j=0; j < PF::SAMPLERANGE; j++ )
112 : {
113 0 : for(int k=0; k < 10; k++ )
114 : {
115 0 : cout << fPFAmpV[i][j][k] << "\t";
116 : }
117 0 : cout << endl;
118 : }
119 0 : cout << endl;
120 : }
121 0 : }
122 :
|