]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticleVertPos.cxx
Add global hidden info type
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoCutMonitorParticleVertPos.cxx
CommitLineData
00114ecb 1////////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoCutMonitorParticleVertPos - the cut monitor for particles to study //
4// the difference between reconstructed and true momentum //
5// //
6////////////////////////////////////////////////////////////////////////////////
7#include "AliFemtoCutMonitorParticleVertPos.h"
8#include "AliFemtoModelHiddenInfo.h"
4c399116 9#include "AliFemtoModelGlobalHiddenInfo.h"
00114ecb 10#include <TH1D.h>
11#include <TH2D.h>
12#include <TList.h>
13#include <TMath.h>
14
15AliFemtoCutMonitorParticleVertPos::AliFemtoCutMonitorParticleVertPos():
16 fVertPos(0),
4c399116 17 fEtaZ(0),
18 fRadPos(0)
00114ecb 19{
20 // Default constructor
21 fVertPos = new TH2D("VertPos", "Vertex position", 200, -20.0, 20.0, 200, -20.0, 20.0);
22 fEtaZ = new TH2D("EtaZPos", "Z vs. Eta", 200, -100.0, 100.0, 100, -1.5, 1.5);
4c399116 23 fRadPos = new TH1D("RadPos", "Radial position", 200, 0.0, 1.0);
00114ecb 24}
25
26AliFemtoCutMonitorParticleVertPos::AliFemtoCutMonitorParticleVertPos(const char *aName):
27 AliFemtoCutMonitor(),
28 fVertPos(0),
29 fEtaZ(0)
30{
31 // Normal constructor
32 char name[200];
33 snprintf(name, 200, "VertPos%s", aName);
34 fVertPos = new TH2D(name, "Rapdity vs Pt", 200, -20.0, 20.0, 200, -20.0, 20.0);
35 snprintf(name, 200, "EtaZPos%s", aName);
36 fEtaZ = new TH2D(name, "Z vs. Eta", 200, -100.0, 100.0, 100, -1.5, 1.5);
4c399116 37 snprintf(name, 200, "RadPos%s", aName);
38 fRadPos = new TH1D(name, "Radial position", 200, 0.0, 1.0);
00114ecb 39}
40
41AliFemtoCutMonitorParticleVertPos::AliFemtoCutMonitorParticleVertPos(const AliFemtoCutMonitorParticleVertPos &aCut):
42 AliFemtoCutMonitor(),
43 fVertPos(0),
44 fEtaZ(0)
45
46{
47 // copy constructor
48 if (fVertPos) delete fVertPos;
49 fVertPos = new TH2D(*aCut.fVertPos);
50 if (fEtaZ) delete fEtaZ;
51 fEtaZ = new TH2D(*aCut.fEtaZ);
4c399116 52 if (fRadPos) delete fRadPos;
53 fRadPos = new TH1D(*aCut.fRadPos);
00114ecb 54}
55
56AliFemtoCutMonitorParticleVertPos::~AliFemtoCutMonitorParticleVertPos()
57{
58 // Destructor
59 delete fVertPos;
60 delete fEtaZ;
4c399116 61 delete fRadPos;
00114ecb 62}
63
64AliFemtoCutMonitorParticleVertPos& AliFemtoCutMonitorParticleVertPos::operator=(const AliFemtoCutMonitorParticleVertPos& aCut)
65{
66 // assignment operator
67 if (this == &aCut)
68 return *this;
69
70 if (fVertPos) delete fVertPos;
71 fVertPos = new TH2D(*aCut.fVertPos);
72 if (fEtaZ) delete fEtaZ;
73 fEtaZ = new TH2D(*aCut.fEtaZ);
4c399116 74 if (fRadPos) delete fRadPos;
75 fRadPos = new TH1D(*aCut.fRadPos);
00114ecb 76
77 return *this;
78}
79
80AliFemtoString AliFemtoCutMonitorParticleVertPos::Report(){
81 // Prepare report from the execution
82 string stemp = "*** AliFemtoCutMonitorParticleVertPos report";
83 AliFemtoString returnThis = stemp;
84 return returnThis;
85}
86
87void AliFemtoCutMonitorParticleVertPos::Fill(const AliFemtoTrack* aTrack)
88{
89 // Fill in the monitor histograms with the values from the current track
4c399116 90 AliFemtoModelGlobalHiddenInfo *hinfo = dynamic_cast<AliFemtoModelGlobalHiddenInfo *>(aTrack->GetHiddenInfo());
00114ecb 91 if (hinfo) {
92 float tEta = -TMath::Log(TMath::Tan(hinfo->GetTrueMomentum()->theta()/2.0));
93
4c399116 94 fVertPos->Fill(hinfo->GetGlobalEmissionPoint()->x(), hinfo->GetGlobalEmissionPoint()->y());
95 fEtaZ->Fill(hinfo->GetGlobalEmissionPoint()->z(), tEta);
96 fRadPos->Fill(hinfo->GetGlobalEmissionPoint()->perp());
00114ecb 97 }
98}
99
100void AliFemtoCutMonitorParticleVertPos::Write()
101{
102 // Write out the relevant histograms
103 fVertPos->Write();
104 fEtaZ->Write();
4c399116 105 fRadPos->Write();
00114ecb 106}
107
108TList *AliFemtoCutMonitorParticleVertPos::GetOutputList()
109{
110 TList *tOutputList = new TList();
111 tOutputList->Add(fVertPos);
112 tOutputList->Add(fEtaZ);
4c399116 113 tOutputList->Add(fRadPos);
00114ecb 114
115 return tOutputList;
116}