AliPhysics  vAN-20150429 (ffa5c54)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliReducedHighPtEvent.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 "AliLog.h"
18 
19 #include "AliReducedEmcalCluster.h"
21 #include "AliReducedMCHeader.h"
24 #include "AliReducedHighPtEvent.h"
25 
29 
30 namespace HighPtTracks {
31 
37 AliReducedHighPtEvent::AliReducedHighPtEvent(Bool_t doAlloc):
38  TObject(),
39  fCentralityPercentile(100.),
40  fVertexZ(-999.9),
41  fMCHeader(NULL),
42  fIsMinBias(kFALSE),
43  fReducedPatchInfo(NULL),
44  fReducedClusterInfo(NULL),
45  fReducedParticleInfo(NULL),
46  fReducedTrackInfo(NULL)
47 {
48  for(int i = 0; i < 2; i++){
49  fJetTriggerString[i] = kFALSE;
50  fGammaTriggerString[i] = kFALSE;
51  }
52  if(doAlloc){
54  fReducedClusterInfo = new TObjArray;
55  fReducedClusterInfo->SetOwner(kTRUE);
56  fReducedTrackInfo = new TObjArray;
57  fReducedTrackInfo->SetOwner(kTRUE);
58  }
59 }
60 
67  TObject(ref),
68  fCentralityPercentile(ref.fCentralityPercentile),
69  fVertexZ(ref.fVertexZ),
70  fMCHeader(NULL),
71  fIsMinBias(ref.fIsMinBias),
72  fReducedPatchInfo(NULL),
73  fReducedClusterInfo(NULL),
74  fReducedParticleInfo(NULL),
75  fReducedTrackInfo(NULL)
76 {
77  ref.Copy(this);
78 }
79 
86  if(this != &ref){
87  this->~AliReducedHighPtEvent();
88  TObject::operator=(ref);
89  ref.Copy(this);
90 
91  }
92  return *this;
93 }
94 
100  if(fMCHeader) delete fMCHeader;
104 }
105 
111 void AliReducedHighPtEvent::Copy(TObject* target) const {
112  AliReducedHighPtEvent *targetevent = dynamic_cast<AliReducedHighPtEvent *>(target);
113  if(!targetevent) return;
115  targetevent->fVertexZ = fVertexZ;
116  targetevent->fIsMinBias = fIsMinBias;
117  memcpy(targetevent->fGammaTriggerString, fGammaTriggerString, sizeof(Bool_t) *2);
118  memcpy(targetevent->fJetTriggerString, fJetTriggerString, sizeof(Bool_t) *2);
119  if(fMCHeader) targetevent->fMCHeader = new AliReducedMCHeader(*fMCHeader);
122  targetevent->fReducedClusterInfo = new TObjArray;
123  targetevent->fReducedClusterInfo->SetOwner(kTRUE);
124  for(TIter clustiter = TIter(fReducedClusterInfo).Begin(); clustiter != TIter::End(); ++clustiter)
125  targetevent->fReducedClusterInfo->Add(new AliReducedEmcalCluster(*(static_cast<AliReducedEmcalCluster *>(*clustiter))));
126  }
128  targetevent->fReducedParticleInfo = new TObjArray;
129  targetevent->fReducedParticleInfo->SetOwner(kTRUE);
130  for(TIter partiter = TIter(fReducedParticleInfo).Begin(); partiter != TIter::End(); ++partiter)
131  targetevent->fReducedParticleInfo->Add(new AliReducedGeneratedParticle(*(static_cast<const AliReducedGeneratedParticle *>(*partiter))));
132  }
133  if(fReducedTrackInfo){
134  targetevent->fReducedTrackInfo = new TObjArray;
135  targetevent->fReducedTrackInfo->SetOwner(kTRUE);
136  for(TIter partiter = TIter(fReducedTrackInfo).Begin(); partiter != TIter::End(); ++partiter)
137  targetevent->fReducedTrackInfo->Add(new AliReducedReconstructedTrack(*(static_cast<const AliReducedReconstructedTrack *>(*partiter))));
138  }
139 }
140 
147  if(!fReducedClusterInfo) return NULL;
148  AliReducedEmcalCluster *foundCluster = NULL, *tmpcluster = NULL;
149  for(TIter clustIter = TIter(fReducedClusterInfo).Begin(); clustIter != TIter::End(); ++clustIter){
150  tmpcluster = static_cast<AliReducedEmcalCluster *>(*clustIter);
151  if(tmpcluster->GetClusterID() == index){
152  foundCluster = tmpcluster;
153  break;
154  }
155  }
156  return foundCluster;
157 }
158 
165  if(!fReducedParticleInfo) return NULL;
166  AliReducedGeneratedParticle *foundparticle(NULL), *tmpparticle(NULL);
167  for(TIter partiter = TIter(fReducedParticleInfo).Begin(); partiter != TIter::End(); ++partiter){
168  tmpparticle = static_cast<AliReducedGeneratedParticle *>(*partiter);
169  if(tmpparticle->GetID() == index){
170  foundparticle = tmpparticle;
171  break;
172  }
173  }
174  return foundparticle;
175 }
176 
182  if(!fReducedClusterInfo){
183  AliError("Cluster container not allocated");
184  return;
185  }
186  fReducedClusterInfo->Add(cluster);
187 }
188 
195  fReducedParticleInfo = new TObjArray;
196  fReducedParticleInfo->SetOwner(kTRUE);
197  }
198  fReducedParticleInfo->Add(part);
199 }
200 
206  if(!fReducedTrackInfo){
207  AliError("Track container not allocated");
208  return;
209  }
210  fReducedTrackInfo->Add(trk);
211 }
212 
213 } /* namespace HighPtTracks */
Reduced event structure for high- analysis.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Reduced EMCAL cluster information.
AliReducedGeneratedParticle * GetParticleForIndex(Int_t index)
void AddReducedCluster(AliReducedEmcalCluster *cluster)
Float_t fCentralityPercentile
Centrality percentile.
AliReducedPatchContainer * fReducedPatchInfo
Container for reduced trigger patches.
Container structure for reduced trigger patches.
Declaration of class AliReducedPatchContainer, a container for reduced trigger patches.
void AddReducedReconstructedParticle(AliReducedReconstructedTrack *trk)
Bool_t fGammaTriggerString[2]
gamma trigger selection from trigger string
void AddReducedGeneratedParticle(AliReducedGeneratedParticle *part)
AliReducedMCHeader * fMCHeader
Reduced Monte-Carlo header.
Declaration of a reduced MC event header.
TObjArray * fReducedParticleInfo
Container for reduced true particles.
Declaration of class AliReducedGeneratedParticle.
Structure for reduced particle information at generator level.
Event structure for high-pt analysis.
AliReducedHighPtEvent & operator=(const AliReducedHighPtEvent &ref)
Bool_t fIsMinBias
Flag event as min. bias event.
Reduced information about reconstructed EMCAL clusters.
Float_t fVertexZ
z-position of the primary vertex
Structure for reconstructed track information.
A reduced event header with MC information for the reduced event structure.
TObjArray * fReducedClusterInfo
Container for reduced EMCAL clusters.
AliReducedEmcalCluster * GetClusterForIndex(Int_t index)
TObjArray * fReducedTrackInfo
Container for reduced reconstructed tracks.
Bool_t fJetTriggerString[2]
jet trigger selection from trigger string