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