]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleYPt.cxx
Bring AliFemto up to date with latest code developements
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoCutMonitorParticleYPt.cxx
1 ////////////////////////////////////////////////////////////////////////////////
2 //                                                                            //
3 // AliFemtoCutMonitorParticleYPt - the cut monitor for particles to study    //
4 // the difference between reconstructed and true momentum                     //
5 //                                                                            //
6 ////////////////////////////////////////////////////////////////////////////////
7 #include <TH1D.h>
8 #include <TH2D.h>
9 #include "AliFemtoCutMonitorParticleYPt.h"
10 #include "AliFemtoModelHiddenInfo.h"
11
12 AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt():
13   fYPt(0),
14   fMass(0.13957)
15 {
16   // Default constructor
17   fYPt = new TH2D("YPt", "Rapidity vs Pt", 100, -1.0, 1.0, 100, 0.1, 2.0);
18 }
19
20 AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt(const char *aName, float aMass):
21   fYPt(0),
22   fMass(aMass)
23 {
24   // Normal constructor
25   char name[200];
26   snprintf(name, 200, "YPt%s", aName);
27   fYPt = new TH2D(name, "Rapdity vs Pt", 100, -1.0, 1.0, 100, 0.1, 2.0);
28 }
29
30 AliFemtoCutMonitorParticleYPt::AliFemtoCutMonitorParticleYPt(const AliFemtoCutMonitorParticleYPt &aCut):
31   fYPt(0),
32   fMass(0.13957)
33 {
34   // copy constructor
35   if (fYPt) delete fYPt;
36   fYPt = new TH2D(*aCut.fYPt);
37   fMass = aCut.fMass; 
38 }
39
40 AliFemtoCutMonitorParticleYPt::~AliFemtoCutMonitorParticleYPt()
41 {
42   // Destructor
43   delete fYPt;
44 }
45
46 AliFemtoCutMonitorParticleYPt& AliFemtoCutMonitorParticleYPt::operator=(const AliFemtoCutMonitorParticleYPt& aCut)
47 {
48   // assignment operator
49   if (this == &aCut) 
50     return *this;
51
52   if (fYPt) delete fYPt;
53   fYPt = new TH2D(*aCut.fYPt);
54   
55   return *this;
56 }
57
58 AliFemtoString AliFemtoCutMonitorParticleYPt::Report(){ 
59   // Prepare report from the execution
60   string stemp = "*** AliFemtoCutMonitorParticleYPt report"; 
61   AliFemtoString returnThis = stemp;
62   return returnThis; 
63 }
64
65 void AliFemtoCutMonitorParticleYPt::Fill(const AliFemtoTrack* aTrack)
66 {
67   // Fill in the monitor histograms with the values from the current track
68   float tEnergy = ::sqrt(aTrack->P().mag2()+fMass*fMass);
69   float tRapidity = 0.5*::log((tEnergy+aTrack->P().z())/(tEnergy-aTrack->P().z()));
70   float tPt = ::sqrt((aTrack->P().x())*(aTrack->P().x())+(aTrack->P().y())*(aTrack->P().y()));
71   fYPt->Fill(tRapidity, tPt);
72 }
73
74 void AliFemtoCutMonitorParticleYPt::Write()
75 {
76   // Write out the relevant histograms
77   fYPt->Write();
78 }
79