]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EMCAL/AliEMCALTriggerData.cxx
Fix tru index calculation (Nicola and Rachid)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerData.cxx
CommitLineData
916f1e76 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpeateose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17
18
19EMCal trigger data container
20for persistency of produced data presently stored in TTreeD
21Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
22*/
23
24#include "AliEMCALTriggerData.h"
25#include "AliEMCALTriggerPatch.h"
26
27ClassImp(AliEMCALTriggerData)
28
29//_____________
30AliEMCALTriggerData::AliEMCALTriggerData() : TObject(),
31fL0Patches( new TClonesArray("AliEMCALTriggerPatch") ),
32fL0NPatches(),
33fL0RegionSize(0,0),
34fL0SubRegionSize(0,0),
35fL0PatchSize(0,0),
36fL0Peaks(),
37fL1GammaPatches( new TClonesArray("AliEMCALTriggerPatch") ),
38fL1JetPatches( new TClonesArray("AliEMCALTriggerPatch") ),
39fL1RegionSize(0,0),
40fL1GammaPatchSize(0,0),
41fL1GammaSubRegionSize(0,0),
42fL1JetPatchSize(0,0),
43fL1JetSubRegionSize(0,0)
44{
45 for (Int_t i=0;i<32;i++) fL0NPatches[i] = 0;
46 for (Int_t i=0;i<48;i++) for (Int_t j=0;j<64;j++) fL1Region[i][j] = 0;
47
48 fL1V0[0] = fL1V0[1] = 0;
49}
50
51//_____________
52AliEMCALTriggerData::~AliEMCALTriggerData()
53{
54}
55
56//_____________
57void AliEMCALTriggerData::SetL0Patches(Int_t i, const TClonesArray& patches)
58{
59 Int_t new_size = patches.GetEntriesFast();
60 Int_t old_size = fL0Patches->GetEntriesFast();
61
62 fL0NPatches[i] = new_size;
63
64 Int_t size = 0;
65 for (Int_t j=0;j<=i;j++) size += fL0NPatches[j];
66
67 fL0Patches->Expand( size );
68
69 for (Int_t j=0;j<new_size;j++)
70 {
71 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
72 new((*fL0Patches)[old_size+j]) AliEMCALTriggerPatch( *p );
73 }
74}
75
76//_____________
77void AliEMCALTriggerData::SetL1GammaPatches(const TClonesArray& patches)
78{
79 Int_t size = patches.GetEntriesFast();
80 fL1GammaPatches->Expand( size );
81
82 for (Int_t j=0;j<size;j++)
83 {
84 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
85 new((*fL1GammaPatches)[j]) AliEMCALTriggerPatch( *p );
86 }
87}
88
89//_____________
90void AliEMCALTriggerData::SetL1JetPatches(const TClonesArray& patches)
91{
92 Int_t size = patches.GetEntriesFast();
93
94 fL1JetPatches->Expand( size );
95
96 for (Int_t j=0;j<size;j++)
97 {
98 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
99 new((*fL1JetPatches)[j]) AliEMCALTriggerPatch( *p );
100 }
101}
102
103//_____________
104void AliEMCALTriggerData::SetL1Region(Int_t**& region)
105{
106 //
107 for (Int_t i=0;i<48;i++)
108 for (Int_t j=0;j<64;j++)
109 {
110 fL1Region[i][j] = region[i][j];
111 }
112}
113
114//_____________
115void AliEMCALTriggerData::SetL1V0(const Int_t*& arr)
116{
117 for (Int_t i=0;i<2;i++) fL1V0[i] = arr[i];
118}
119
120//_____________
121void AliEMCALTriggerData::Scan() const
122{
123 //
124 printf("L0:\n");
125 for (Int_t i=0;i<32;i++) printf("\tFound %2d patches in TRU %2d\n",fL0NPatches[i],i);
126
127 printf("L1:\n");
128 printf("\tRegion of size.....................(%2d,%2d)\n",int(fL1RegionSize.X()),int(fL1RegionSize.Y()));
129 printf("\tGamma sub-region size..............(%2d,%2d)\n",int(fL1GammaSubRegionSize.X()),int(fL1GammaSubRegionSize.Y()));
130 printf("\tJet sub-region size................(%2d,%2d)\n",int(fL1JetSubRegionSize.X()),int(fL1JetSubRegionSize.Y()));
131 printf("\tFound %4d gamma patches of size...(%2d,%2d)\n",fL1GammaPatches->GetEntriesFast(),int(fL1GammaPatchSize.X()),int(fL1GammaPatchSize.Y()));
132 printf("\tFound %4d jet patches of size.....(%2d,%2d)\n",fL1JetPatches->GetEntriesFast(),int(fL1JetPatchSize.X()),int(fL1JetPatchSize.Y()));
133}
134
135//_____________
136void AliEMCALTriggerData::Reset()
137{
138 //
139 if (fL0Patches) fL0Patches->Delete();
140 if (fL1GammaPatches) fL1GammaPatches->Delete();
141 if (fL1JetPatches) fL1JetPatches->Delete();
142
143 for (Int_t i=0;i<32;i++) fL0NPatches[i] = 0;
144 for (Int_t i=0;i<48;i++) for (Int_t j=0;j<64;j++) fL1Region[i][j] = 0;
145 fL1V0[0] = fL1V0[1] = 0;
146}
147
148
149