]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALJetTasks/AliJetEmbeddingTask.cxx
coverity fix
[u/mrichter/AliRoot.git] / PWGGA / EMCALJetTasks / AliJetEmbeddingTask.cxx
1 // $Id$
2 //
3 // Jet embedding task.
4 //
5 // Author: S.Aiola, C.Loizides
6
7 #include <TClonesArray.h>
8 #include <TLorentzVector.h>
9 #include <TRandom3.h>
10
11 #include "AliAnalysisManager.h"
12 #include "AliVEvent.h"
13 #include "AliVCluster.h"
14 #include "AliEMCALDigit.h"
15 #include "AliEMCALRecPoint.h"
16 #include "AliPicoTrack.h"
17 #include "AliEMCALGeometry.h"
18 #include "AliLog.h"
19
20 #include "AliJetEmbeddingTask.h"
21
22 ClassImp(AliJetEmbeddingTask)
23
24 //________________________________________________________________________
25 AliJetEmbeddingTask::AliJetEmbeddingTask() : 
26   AliJetModelBaseTask("AliJetEmbeddingTask")
27 {
28   // Default constructor.
29   SetSuffix("Embedded");
30 }
31
32 //________________________________________________________________________
33 AliJetEmbeddingTask::AliJetEmbeddingTask(const char *name) : 
34   AliJetModelBaseTask(name)
35 {
36   // Standard constructor.
37   SetSuffix("Embedded");
38 }
39
40 //________________________________________________________________________
41 AliJetEmbeddingTask::~AliJetEmbeddingTask()
42 {
43   // Destructor
44 }
45
46 //________________________________________________________________________
47 void AliJetEmbeddingTask::UserExec(Option_t *) 
48 {
49   // Execute per event.
50
51   if (!fIsInit) {
52     ExecOnce();
53     fIsInit = 1;
54   }
55   Run();
56 }
57
58 //________________________________________________________________________
59 void AliJetEmbeddingTask::Run() 
60 {
61   // Embed particles.
62   
63   if (fNClusters > 0 && fOutClusters) {
64     if (fCopyArray) 
65       CopyClusters();
66     for (Int_t i = 0; i < fNClusters; ++i) {
67       AddCluster();
68     }
69   }
70  
71   if (fNTracks > 0 && fOutTracks) {
72     if (fCopyArray) 
73       CopyTracks();
74     for (Int_t i = 0; i < fNTracks; ++i) {
75       AddTrack();
76     }
77   }
78 }