]>
Commit | Line | Data |
---|---|---|
762e8424 | 1 | // $Id$ |
2 | // | |
297edd60 | 3 | // Jet randomizer task. |
762e8424 | 4 | // |
297edd60 | 5 | // Author: S.Aiola, C.Loizides |
762e8424 | 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 "AliJetRandomizerTask.h" | |
21 | ||
22 | ClassImp(AliJetRandomizerTask) | |
23 | ||
24 | //________________________________________________________________________ | |
25 | AliJetRandomizerTask::AliJetRandomizerTask() : | |
26 | AliJetModelBaseTask("AliJetRandomizerTask") | |
27 | { | |
28 | // Default constructor. | |
5f93a9f5 | 29 | |
762e8424 | 30 | SetSuffix("Randomized"); |
a825589f | 31 | SetMarkMC(kFALSE); |
762e8424 | 32 | } |
33 | ||
34 | //________________________________________________________________________ | |
35 | AliJetRandomizerTask::AliJetRandomizerTask(const char *name) : | |
36 | AliJetModelBaseTask(name) | |
37 | { | |
38 | // Standard constructor. | |
5f93a9f5 | 39 | |
762e8424 | 40 | SetSuffix("Randomized"); |
a825589f | 41 | SetMarkMC(kFALSE); |
762e8424 | 42 | } |
43 | ||
44 | //________________________________________________________________________ | |
45 | AliJetRandomizerTask::~AliJetRandomizerTask() | |
46 | { | |
47 | // Destructor | |
48 | } | |
49 | ||
ffe32451 | 50 | //________________________________________________________________________ |
51 | void AliJetRandomizerTask::UserExec(Option_t *) | |
52 | { | |
53 | // Execute per event. | |
54 | ||
55 | if (!fCopyArray) { | |
56 | AliWarning("fCopyArray == kFALSE not allowed for AliJetRandomizerTask, will set kTRUE"); | |
57 | fCopyArray = kTRUE; | |
58 | } | |
59 | ||
60 | if (!fIsInit) { | |
61 | ExecOnce(); | |
62 | fIsInit = 1; | |
63 | } | |
64 | ||
65 | Run(); | |
66 | } | |
67 | ||
762e8424 | 68 | //________________________________________________________________________ |
69 | void AliJetRandomizerTask::Run() | |
70 | { | |
71 | // Randomize particles. | |
72 | ||
73 | if (fNClusters > 0 && fOutClusters) { | |
8613f8d9 | 74 | const Int_t nClusters = fClusters->GetEntriesFast(); |
762e8424 | 75 | for (Int_t i = 0; i < nClusters; ++i) { |
76 | AliVCluster *cluster = dynamic_cast<AliVCluster*>(fClusters->At(i)); | |
77 | if (!cluster) | |
78 | continue; | |
79 | if (!cluster->IsEMCAL()) | |
80 | continue; | |
8613f8d9 | 81 | |
82 | Float_t pos[3]; | |
83 | cluster->GetPosition(pos); | |
84 | TVector3 clusVec(pos); | |
85 | ||
86 | AddCluster(cluster->E(), clusVec.Eta()); | |
762e8424 | 87 | } |
88 | } | |
89 | ||
90 | if (fNTracks > 0 && fOutTracks) { | |
8613f8d9 | 91 | const Int_t nTracks = fTracks->GetEntriesFast(); |
762e8424 | 92 | for (Int_t i = 0; i < nTracks; ++i) { |
93 | AliPicoTrack *track = dynamic_cast<AliPicoTrack*>(fTracks->At(i)); | |
94 | if (!track) | |
95 | continue; | |
8613f8d9 | 96 | |
97 | AddTrack(track->Pt(), track->Eta()); | |
762e8424 | 98 | } |
99 | } | |
100 | } |