AliPhysics  04715ba (04715ba)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliReducedPatchContainer.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, 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 purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include <TObjArray.h>
16 
17 #include "AliReducedPatchInfo.h"
19 
23 
24 namespace HighPtTracks {
25 
31 AliReducedPatchContainer::AliReducedPatchContainer(Bool_t doAlloc) :
32  TObject()
33 {
34  if(doAlloc){
35  for(int icont = 0; icont < 4; icont++){
36  fOnlinePatches[icont] = new TObjArray;
37  fOnlinePatches[icont]->SetOwner(kTRUE);
38  fOfflinePatches[icont] = new TObjArray;
39  fOfflinePatches[icont]->SetOwner(kTRUE);
40  }
41  } else {
42  memset(fOnlinePatches, 0, sizeof(TObjArray *) *4);
43  memset(fOfflinePatches, 0, sizeof(TObjArray *) *4);
44  }
45 }
46 
52  TObject(ref)
53 {
54  ref.Copy(*this);
55 }
56 
63  if(&ref != this){
65  TObject::operator=(ref);
66  ref.Copy(*this);
67  }
68  return *this;
69 }
70 
77  AliReducedPatchContainer *targetcont = dynamic_cast<AliReducedPatchContainer *>(&target);
78  if(!targetcont) return;
79  for(int icont = 0; icont < 4; icont++){
80  targetcont->fOnlinePatches[icont] = new TObjArray;
81  targetcont->fOnlinePatches[icont]->SetOwner(kTRUE);
82  for(TIter refIter = TIter(fOnlinePatches[icont]).Begin(); refIter != TIter::End(); ++ refIter){
83  targetcont->fOnlinePatches[icont]->Add(new AliReducedPatchInfo(*(static_cast<AliReducedPatchInfo *>(*refIter))));
84  }
85  targetcont->fOfflinePatches[icont] = new TObjArray;
86  targetcont->fOfflinePatches[icont]->SetOwner(kTRUE);
87  for(TIter refIter = TIter(fOfflinePatches[icont]).Begin(); refIter != TIter::End(); ++ refIter){
88  targetcont->fOfflinePatches[icont]->Add(new AliReducedPatchInfo(*(static_cast<AliReducedPatchInfo *>(*refIter))));
89  }
90  }
91 }
92 
97  for(int icont = 0; icont < 4; icont++){
98  if(fOnlinePatches[icont]) delete fOnlinePatches[icont];
99  if(fOfflinePatches[icont]) delete fOfflinePatches[icont];
100  }
101 }
102 
113  TObjArray *contpointer = isOffline ? fOfflinePatches[patchtype] : fOnlinePatches[patchtype];
114  contpointer->Add(new AliReducedPatchInfo(energy, amplitude, eta, phi));
115 }
116 
124  return isOffline ? fOfflinePatches[patchtype] : fOnlinePatches[patchtype];
125 }
126 
127 
128 } /* namespace HighPtTracks */
Reduced information of EMCAL trigger patches.
AliReducedPatchContainer & operator=(const AliReducedPatchContainer &cont)
Declaration of class AlliReducedPatchInfo.
energy
Definition: HFPtSpectrum.C:44
Container structure for reduced trigger patches.
Declaration of class AliReducedPatchContainer, a container for reduced trigger patches.
TObjArray * fOfflinePatches[4]
Trigger type dependent container for offline patches.
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
TObjArray * fOnlinePatches[4]
Trigger type dependent container for online patches.
bool Bool_t
Definition: External.C:53
void AddTriggerPatch(Bool_t isOffline, PatchType_t patchtype, Float_t energy, Int_t amplitude, Float_t eta, Float_t phi)
TObjArray * GetTriggerPatches(Bool_t isOffline, PatchType_t patchtype)