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),
37 fL1GammaPatches( new TClonesArray("AliEMCALTriggerPatch") ),
38 fL1JetPatches( new TClonesArray("AliEMCALTriggerPatch") ),
40 fL1GammaPatchSize(0,0),
41 fL1GammaSubRegionSize(0,0),
43 fL1JetSubRegionSize(0,0)
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;
48 fL1V0[0] = fL1V0[1] = 0;
52 AliEMCALTriggerData::~AliEMCALTriggerData()
57 void AliEMCALTriggerData::SetL0Patches(Int_t i, const TClonesArray& patches)
59 Int_t new_size = patches.GetEntriesFast();
60 Int_t old_size = fL0Patches->GetEntriesFast();
62 fL0NPatches[i] = new_size;
65 for (Int_t j=0;j<=i;j++) size += fL0NPatches[j];
67 fL0Patches->Expand( size );
69 for (Int_t j=0;j<new_size;j++)
71 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
72 new((*fL0Patches)[old_size+j]) AliEMCALTriggerPatch( *p );
77 void AliEMCALTriggerData::SetL1GammaPatches(const TClonesArray& patches)
79 Int_t size = patches.GetEntriesFast();
80 fL1GammaPatches->Expand( size );
82 for (Int_t j=0;j<size;j++)
84 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
85 new((*fL1GammaPatches)[j]) AliEMCALTriggerPatch( *p );
90 void AliEMCALTriggerData::SetL1JetPatches(const TClonesArray& patches)
92 Int_t size = patches.GetEntriesFast();
94 fL1JetPatches->Expand( size );
96 for (Int_t j=0;j<size;j++)
98 AliEMCALTriggerPatch* p = static_cast<AliEMCALTriggerPatch*>( patches.At(j) );
99 new((*fL1JetPatches)[j]) AliEMCALTriggerPatch( *p );
104 void AliEMCALTriggerData::SetL1Region(Int_t**& region)
107 for (Int_t i=0;i<48;i++)
108 for (Int_t j=0;j<64;j++)
110 fL1Region[i][j] = region[i][j];
115 void AliEMCALTriggerData::SetL1V0(const Int_t*& arr)
117 for (Int_t i=0;i<2;i++) fL1V0[i] = arr[i];
121 void AliEMCALTriggerData::Scan() const
125 for (Int_t i=0;i<32;i++) printf("\tFound %2d patches in TRU %2d\n",fL0NPatches[i],i);
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()));
136 void AliEMCALTriggerData::Reset()
139 if (fL0Patches) fL0Patches->Delete();
140 if (fL1GammaPatches) fL1GammaPatches->Delete();
141 if (fL1JetPatches) fL1JetPatches->Delete();
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;