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