1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 EMCal trigger data container
20 for persistency of produced data presently stored in TTreeD
21 Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
24 #include "AliEMCALTriggerData.h"
25 #include "AliEMCALTriggerPatch.h"
27 ClassImp(AliEMCALTriggerData)
30 AliEMCALTriggerData::AliEMCALTriggerData() : TObject(),
31 fL0Patches( new TClonesArray("AliEMCALTriggerPatch") ),
34 fL0SubRegionSize(0,0),
36 fL1GammaPatches( new TClonesArray("AliEMCALTriggerPatch") ),
37 fL1JetPatches( new TClonesArray("AliEMCALTriggerPatch") ),
39 fL1GammaPatchSize(0,0),
40 fL1GammaSubRegionSize(0,0),
42 fL1JetSubRegionSize(0,0)
44 for (Int_t i=0;i<32;i++) fL0NPatches[i] = 0;
45 for (Int_t i=0;i<48;i++) for (Int_t j=0;j<64;j++) fL1Region[i][j] = 0;
47 fL1V0[0] = fL1V0[1] = 0;
51 AliEMCALTriggerData::~AliEMCALTriggerData()
56 void AliEMCALTriggerData::SetL0Patches(Int_t i, const TClonesArray& patches)
58 Int_t new_size = patches.GetEntriesFast();
59 Int_t old_size = fL0Patches->GetEntriesFast();
61 fL0NPatches[i] = new_size;
64 for (Int_t j=0;j<=i;j++) size += fL0NPatches[j];
66 fL0Patches->Expand( size );
68 for (Int_t j=0;j<new_size;j++)
70 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
71 new((*fL0Patches)[old_size+j]) AliEMCALTriggerPatch( *p );
76 void AliEMCALTriggerData::SetL1GammaPatches(const TClonesArray& patches)
78 Int_t size = patches.GetEntriesFast();
79 fL1GammaPatches->Expand( size );
81 for (Int_t j=0;j<size;j++)
83 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
84 new((*fL1GammaPatches)[j]) AliEMCALTriggerPatch( *p );
89 void AliEMCALTriggerData::SetL1JetPatches(const TClonesArray& patches)
91 Int_t size = patches.GetEntriesFast();
93 fL1JetPatches->Expand( size );
95 for (Int_t j=0;j<size;j++)
97 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
98 new((*fL1JetPatches)[j]) AliEMCALTriggerPatch( *p );
103 void AliEMCALTriggerData::SetL1Region(Int_t**& region)
106 for (Int_t i=0;i<48;i++)
107 for (Int_t j=0;j<64;j++)
109 fL1Region[i][j] = region[i][j];
114 void AliEMCALTriggerData::SetL1V0(const Int_t*& arr)
116 for (Int_t i=0;i<2;i++) fL1V0[i] = arr[i];
120 void AliEMCALTriggerData::Scan() const
124 for (Int_t i=0;i<32;i++) printf("\tFound %2d patches in TRU %2d\n",fL0NPatches[i],i);
127 printf("\tRegion of size.....................(%2d,%2d)\n",int(fL1RegionSize.X()),int(fL1RegionSize.Y()));
128 printf("\tGamma sub-region size..............(%2d,%2d)\n",int(fL1GammaSubRegionSize.X()),int(fL1GammaSubRegionSize.Y()));
129 printf("\tJet sub-region size................(%2d,%2d)\n",int(fL1JetSubRegionSize.X()),int(fL1JetSubRegionSize.Y()));
130 printf("\tFound %4d gamma patches of size...(%2d,%2d)\n",fL1GammaPatches->GetEntriesFast(),int(fL1GammaPatchSize.X()),int(fL1GammaPatchSize.Y()));
131 printf("\tFound %4d jet patches of size.....(%2d,%2d)\n",fL1JetPatches->GetEntriesFast(),int(fL1JetPatchSize.X()),int(fL1JetPatchSize.Y()));
135 void AliEMCALTriggerData::Reset()
138 if (fL0Patches) fL0Patches->Delete();
139 if (fL1GammaPatches) fL1GammaPatches->Delete();
140 if (fL1JetPatches) fL1JetPatches->Delete();
142 for (Int_t i=0;i<32;i++) fL0NPatches[i] = 0;
143 for (Int_t i=0;i<48;i++) for (Int_t j=0;j<64;j++) fL1Region[i][j] = 0;
144 fL1V0[0] = fL1V0[1] = 0;