AliPhysics  4e47bdd (4e47bdd)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  fRunNumber(0),
40  fCentralityPercentile(100.),
41  fVertexZ(-999.9),
42  fMCHeader(NULL),
43  fIsMinBias(kFALSE),
44  fReducedPatchInfo(NULL),
45  fReducedClusterInfo(NULL),
46  fReducedParticleInfo(NULL),
47  fReducedTrackInfo(NULL)
48 {
49  for(int i = 0; i < 2; i++){
50  fJetTriggerString[i] = kFALSE;
51  fGammaTriggerString[i] = kFALSE;
52  }
53  if(doAlloc){
56  fReducedClusterInfo->SetOwner(kTRUE);
58  fReducedTrackInfo->SetOwner(kTRUE);
59  }
60 }
61 
68  TObject(ref),
69  fRunNumber(0),
70  fCentralityPercentile(ref.fCentralityPercentile),
71  fVertexZ(ref.fVertexZ),
72  fMCHeader(NULL),
73  fIsMinBias(ref.fIsMinBias),
74  fReducedPatchInfo(NULL),
75  fReducedClusterInfo(NULL),
76  fReducedParticleInfo(NULL),
77  fReducedTrackInfo(NULL)
78 {
79  ref.Copy(*this);
80 }
81 
88  if(this != &ref){
89  this->~AliReducedHighPtEvent();
90  TObject::operator=(ref);
91  ref.Copy(*this);
92 
93  }
94  return *this;
95 }
96 
102  if(fMCHeader) delete fMCHeader;
106 }
107 
114  AliReducedHighPtEvent *targetevent = dynamic_cast<AliReducedHighPtEvent *>(&target);
115  if(!targetevent) return;
117  targetevent->fVertexZ = fVertexZ;
118  targetevent->fIsMinBias = fIsMinBias;
119  memcpy(targetevent->fGammaTriggerString, fGammaTriggerString, sizeof(Bool_t) *2);
120  memcpy(targetevent->fJetTriggerString, fJetTriggerString, sizeof(Bool_t) *2);
121  if(fMCHeader) targetevent->fMCHeader = new AliReducedMCHeader(*fMCHeader);
124  targetevent->fReducedClusterInfo = new TObjArray;
125  targetevent->fReducedClusterInfo->SetOwner(kTRUE);
126  for(TIter clustiter = TIter(fReducedClusterInfo).Begin(); clustiter != TIter::End(); ++clustiter)
127  targetevent->fReducedClusterInfo->Add(new AliReducedEmcalCluster(*(static_cast<AliReducedEmcalCluster *>(*clustiter))));
128  }
130  targetevent->fReducedParticleInfo = new TObjArray;
131  targetevent->fReducedParticleInfo->SetOwner(kTRUE);
132  for(TIter partiter = TIter(fReducedParticleInfo).Begin(); partiter != TIter::End(); ++partiter)
133  targetevent->fReducedParticleInfo->Add(new AliReducedGeneratedParticle(*(static_cast<const AliReducedGeneratedParticle *>(*partiter))));
134  }
135  if(fReducedTrackInfo){
136  targetevent->fReducedTrackInfo = new TObjArray;
137  targetevent->fReducedTrackInfo->SetOwner(kTRUE);
138  for(TIter partiter = TIter(fReducedTrackInfo).Begin(); partiter != TIter::End(); ++partiter)
139  targetevent->fReducedTrackInfo->Add(new AliReducedReconstructedTrack(*(static_cast<const AliReducedReconstructedTrack *>(*partiter))));
140  }
141 }
142 
149  if(!fReducedClusterInfo) return NULL;
150  AliReducedEmcalCluster *foundCluster = NULL, *tmpcluster = NULL;
151  for(TIter clustIter = TIter(fReducedClusterInfo).Begin(); clustIter != TIter::End(); ++clustIter){
152  tmpcluster = static_cast<AliReducedEmcalCluster *>(*clustIter);
153  if(tmpcluster->GetClusterID() == index){
154  foundCluster = tmpcluster;
155  break;
156  }
157  }
158  return foundCluster;
159 }
160 
167  if(!fReducedParticleInfo) return NULL;
168  AliReducedGeneratedParticle *foundparticle(NULL), *tmpparticle(NULL);
169  for(TIter partiter = TIter(fReducedParticleInfo).Begin(); partiter != TIter::End(); ++partiter){
170  tmpparticle = static_cast<AliReducedGeneratedParticle *>(*partiter);
171  if(tmpparticle->GetID() == index){
172  foundparticle = tmpparticle;
173  break;
174  }
175  }
176  return foundparticle;
177 }
178 
184  if(!fReducedClusterInfo){
185  AliError("Cluster container not allocated");
186  return;
187  }
188  fReducedClusterInfo->Add(cluster);
189 }
190 
198  fReducedParticleInfo->SetOwner(kTRUE);
199  }
200  fReducedParticleInfo->Add(part);
201 }
202 
208  if(!fReducedTrackInfo){
209  AliError("Track container not allocated");
210  return;
211  }
212  fReducedTrackInfo->Add(trk);
213 }
214 
219 std::vector<HighPtTracks::AliReducedEmcalCluster*> AliReducedHighPtEvent::GetClusterVector() const {
220  std::vector<HighPtTracks::AliReducedEmcalCluster*> resultvec;
221  for(TIter clustIter = TIter(fReducedClusterInfo).Begin(); clustIter != TIter::End(); ++clustIter){
222  resultvec.push_back(static_cast<AliReducedEmcalCluster *>(*clustIter));
223  }
224  return resultvec;
225 }
226 
231 std::vector<HighPtTracks::AliReducedGeneratedParticle*> AliReducedHighPtEvent::GetParticleVector() const {
232  std::vector<HighPtTracks::AliReducedGeneratedParticle*> resultvec;
233  for(TIter partIter = TIter(fReducedParticleInfo).Begin(); partIter != TIter::End(); ++partIter){
234  resultvec.push_back(static_cast<AliReducedGeneratedParticle *>(*partIter));
235  }
236  return resultvec;
237 }
238 
243 std::vector<HighPtTracks::AliReducedReconstructedTrack*> HighPtTracks::AliReducedHighPtEvent::GetTrackVector() const {
244  std::vector<HighPtTracks::AliReducedReconstructedTrack*> resultvec;
245  for(TIter trackIter = TIter(fReducedTrackInfo).Begin(); trackIter != TIter::End(); ++trackIter){
246  resultvec.push_back(static_cast<AliReducedReconstructedTrack *>(*trackIter));
247  }
248  return resultvec;
249 }
250 
251 
252 } /* namespace HighPtTracks */
253 
Reduced event structure for high- analysis.
Reduced EMCAL cluster information.
AliReducedGeneratedParticle * GetParticleForIndex(Int_t index)
std::vector< HighPtTracks::AliReducedEmcalCluster * > GetClusterVector() const
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
std::vector< HighPtTracks::AliReducedGeneratedParticle * > GetParticleVector() const
void AddReducedGeneratedParticle(AliReducedGeneratedParticle *part)
AliReducedMCHeader * fMCHeader
Reduced Monte-Carlo header.
int Int_t
Definition: External.C:63
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)
std::vector< HighPtTracks::AliReducedReconstructedTrack * > GetTrackVector() const
Bool_t fIsMinBias
Flag event as min. bias event.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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)
bool Bool_t
Definition: External.C:53
TObjArray * fReducedTrackInfo
Container for reduced reconstructed tracks.
Bool_t fJetTriggerString[2]
jet trigger selection from trigger string