]>
Commit | Line | Data |
---|---|---|
1 | // $Id$ | |
2 | // | |
3 | // Jet embedding task. | |
4 | // | |
5 | // Author: S.Aiola, C.Loizides | |
6 | ||
7 | #include <TRandom3.h> | |
8 | ||
9 | #include "AliJetEmbeddingTask.h" | |
10 | ||
11 | ClassImp(AliJetEmbeddingTask) | |
12 | ||
13 | //________________________________________________________________________ | |
14 | AliJetEmbeddingTask::AliJetEmbeddingTask() : | |
15 | AliJetModelBaseTask("AliJetEmbeddingTask"), | |
16 | fMassless(kFALSE), | |
17 | fNeutralFraction(0), | |
18 | fNeutralMass(0.135) | |
19 | { | |
20 | // Default constructor. | |
21 | SetSuffix("Embedded"); | |
22 | } | |
23 | ||
24 | //________________________________________________________________________ | |
25 | AliJetEmbeddingTask::AliJetEmbeddingTask(const char *name) : | |
26 | AliJetModelBaseTask(name), | |
27 | fMassless(kFALSE), | |
28 | fNeutralFraction(0), | |
29 | fNeutralMass(0.135) | |
30 | { | |
31 | // Standard constructor. | |
32 | SetSuffix("Embedded"); | |
33 | } | |
34 | ||
35 | //________________________________________________________________________ | |
36 | AliJetEmbeddingTask::~AliJetEmbeddingTask() | |
37 | { | |
38 | // Destructor | |
39 | } | |
40 | ||
41 | //________________________________________________________________________ | |
42 | void AliJetEmbeddingTask::Run() | |
43 | { | |
44 | // Embed particles. | |
45 | ||
46 | if (fNClusters > 0 && fOutClusters) { | |
47 | if (fCopyArray) | |
48 | CopyClusters(); | |
49 | for (Int_t i = 0; i < fNClusters; ++i) { | |
50 | AddCluster(); | |
51 | } | |
52 | } | |
53 | ||
54 | if (fNTracks > 0 && fOutTracks) { | |
55 | if (fCopyArray) | |
56 | CopyTracks(); | |
57 | for (Int_t i = 0; i < fNTracks; ++i) { | |
58 | Double_t mass = 0.1396; | |
59 | Short_t charge = 1; | |
60 | if(fNeutralFraction>0.) { | |
61 | Double_t rnd = gRandom->Rndm(); | |
62 | if(rnd<fNeutralFraction) { | |
63 | charge = 0; | |
64 | mass = fNeutralMass; | |
65 | } | |
66 | } | |
67 | if(fMassless) mass = 0.; | |
68 | AddTrack(-1,-999,-1,0,0,0,0,kFALSE,0,charge,mass); | |
69 | } | |
70 | } | |
71 | } |