]>
Commit | Line | Data |
---|---|---|
3f85ae73 | 1 | // $Id$ |
2 | // | |
3 | // Jet model task to copy tracks while making small change | |
4 | // - make particles massless | |
5 | // | |
6 | // Author: M. Verweij | |
7 | ||
8 | #include "AliJetModelCopyTracks.h" | |
9 | ||
10 | #include <TClonesArray.h> | |
11 | #include <TFolder.h> | |
12 | #include <TLorentzVector.h> | |
13 | #include <TParticle.h> | |
14 | #include <TParticlePDG.h> | |
15 | #include <TRandom3.h> | |
16 | #include <TProfile.h> | |
17 | #include <TGrid.h> | |
18 | #include <TFile.h> | |
19 | #include <TF1.h> | |
20 | #include "AliAnalysisManager.h" | |
21 | #include "AliEMCALDigit.h" | |
22 | #include "AliEMCALGeometry.h" | |
23 | #include "AliEMCALRecPoint.h" | |
24 | #include "AliGenerator.h" | |
25 | #include "AliHeader.h" | |
26 | #include "AliLog.h" | |
27 | #include "AliPicoTrack.h" | |
28 | #include "AliRun.h" | |
29 | #include "AliRunLoader.h" | |
30 | #include "AliStack.h" | |
31 | #include "AliStack.h" | |
32 | #include "AliVCluster.h" | |
33 | #include "AliVEvent.h" | |
34 | ||
35 | ClassImp(AliJetModelCopyTracks) | |
36 | ||
37 | //________________________________________________________________________ | |
38 | AliJetModelCopyTracks::AliJetModelCopyTracks() : | |
39 | AliAnalysisTaskEmcal("AliJetModelCopyTracks",kTRUE), | |
40 | fTracksOutName(""), | |
41 | fTracksOut(0x0), | |
42 | fParticleMass(kMassive), | |
43 | fHistPtOut(0) | |
44 | { | |
45 | // Default constructor. | |
46 | SetMakeGeneralHistograms(kTRUE); | |
47 | } | |
48 | ||
49 | //________________________________________________________________________ | |
50 | AliJetModelCopyTracks::AliJetModelCopyTracks(const char *name) : | |
51 | AliAnalysisTaskEmcal(name,kTRUE), | |
52 | fTracksOutName(""), | |
53 | fTracksOut(0x0), | |
54 | fParticleMass(kMassive), | |
55 | fHistPtOut(0) | |
56 | { | |
57 | // Standard constructor. | |
58 | SetMakeGeneralHistograms(kTRUE); | |
59 | } | |
60 | ||
61 | //________________________________________________________________________ | |
62 | AliJetModelCopyTracks::~AliJetModelCopyTracks() | |
63 | { | |
64 | // Destructor | |
65 | ||
66 | } | |
67 | ||
68 | //________________________________________________________________________ | |
69 | void AliJetModelCopyTracks::ExecOnce() | |
70 | { | |
71 | // Exec only once. | |
72 | ||
73 | AliAnalysisTaskEmcal::ExecOnce(); | |
74 | ||
75 | if (!fTracksOutName.IsNull()) { | |
76 | fTracksOut = new TClonesArray("AliPicoTrack"); | |
77 | fTracksOut->SetName(fTracksOutName); | |
78 | if (InputEvent()->FindListObject(fTracksOutName)) { | |
79 | AliFatal(Form("%s: Collection %s is already present in the event!", GetName(), fTracksOutName.Data())); | |
80 | return; | |
81 | } | |
82 | else { | |
83 | InputEvent()->AddObject(fTracksOut); | |
84 | } | |
85 | } | |
86 | } | |
87 | ||
88 | //________________________________________________________________________ | |
89 | void AliJetModelCopyTracks::UserCreateOutputObjects() | |
90 | { | |
91 | AliAnalysisTaskEmcal::UserCreateOutputObjects(); | |
92 | ||
93 | const Int_t nBinPt = 100; | |
94 | Double_t binLimitsPt[nBinPt+1]; | |
95 | for(Int_t iPt = 0;iPt <= nBinPt;iPt++){ | |
96 | if(iPt == 0){ | |
97 | binLimitsPt[iPt] = 0.0; | |
98 | } else {// 1.0 | |
99 | binLimitsPt[iPt] = binLimitsPt[iPt-1] + 1.0; | |
100 | } | |
101 | } | |
102 | ||
103 | fHistPtOut = new TH1F("fHistPtOut","fHistPtOut;#it{p}_{T};N",nBinPt,binLimitsPt); | |
104 | fOutput->Add(fHistPtOut); | |
105 | ||
106 | PostData(1, fOutput); // Post data for ALL output slots > 0 here. | |
107 | } | |
108 | ||
109 | ||
110 | //________________________________________________________________________ | |
111 | Bool_t AliJetModelCopyTracks::Run() | |
112 | { | |
113 | CopyTracks(); | |
114 | return kTRUE; | |
115 | } | |
116 | ||
117 | //________________________________________________________________________ | |
118 | void AliJetModelCopyTracks::CopyTracks() | |
119 | { | |
120 | //Apply toy detector simulation to tracks | |
3c923384 | 121 | fTracksOut->Delete(); |
122 | ||
3f85ae73 | 123 | Int_t nt = 0; |
124 | const Int_t nTracks = fTracks->GetEntriesFast(); | |
125 | for (Int_t i = 0; i < nTracks; ++i) { | |
126 | AliPicoTrack *picotrack = static_cast<AliPicoTrack*>(fTracks->At(i)); | |
127 | if (!picotrack) | |
128 | continue; | |
129 | ||
130 | Double_t mass = picotrack->M(); | |
131 | if(fParticleMass==kMassless) mass = 0.; | |
132 | if(fParticleMass==kPionMass) mass = 0.13957; | |
3c923384 | 133 | |
3f85ae73 | 134 | AliPicoTrack *track = new ((*fTracksOut)[nt]) AliPicoTrack(picotrack->Pt(), |
135 | picotrack->Eta(), | |
136 | picotrack->Phi(), | |
137 | picotrack->Charge(), | |
138 | picotrack->GetLabel(), | |
139 | AliPicoTrack::GetTrackType(picotrack), | |
140 | picotrack->GetTrackEtaOnEMCal(), | |
141 | picotrack->GetTrackPhiOnEMCal(), | |
142 | picotrack->GetTrackPtOnEMCal(), | |
143 | picotrack->IsEMCAL(), | |
144 | mass); | |
145 | track->SetBit(TObject::kBitMask,1); | |
146 | fHistPtOut->Fill(track->Pt()); | |
147 | nt++; | |
148 | } | |
149 | } | |
150 | ||
151 | ||
152 | ||
153 | ||
154 |