]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Remove unneeded parameter. Protect against missing Hidden Info
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jun 2008 10:45:24 +0000 (10:45 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jun 2008 10:45:24 +0000 (10:45 +0000)
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.cxx
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoCutMonitorParticleMomRes.h

index 5e8d0a736a3990ff3b1e09f516f71220ecd6c470..2e65281c73dc5d53139b484e6b5a7c04029507a3 100644 (file)
@@ -18,8 +18,7 @@ AliFemtoCutMonitorParticleMomRes::AliFemtoCutMonitorParticleMomRes():
   fMomResZvsP(0),
   fImpactXY(0),
   fImpactZ(0),
-  fSigma(0),
-  fMass(0.13957)
+  fSigma(0)
 {
   // Default constructor
   fMomRes3D = new TH3D("MomRes3D", "Momentum resolution", 100, -0.05, 0.05, 100, -0.05, 0.05, 100, -0.05, 0.05);
@@ -31,15 +30,14 @@ AliFemtoCutMonitorParticleMomRes::AliFemtoCutMonitorParticleMomRes():
   fSigma      = new TH2D("Sigma",     "Sigma to vertex vs P" , 100, 0.1, 2.0, 200, -5.0, 5.0);
 }
 
-AliFemtoCutMonitorParticleMomRes::AliFemtoCutMonitorParticleMomRes(const char *aName, float aMass):
+AliFemtoCutMonitorParticleMomRes::AliFemtoCutMonitorParticleMomRes(const char *aName):
   fMomRes3D(0),
   fMomResXvsP(0),
   fMomResYvsP(0),
   fMomResZvsP(0),
   fImpactXY(0),
   fImpactZ(0),
-  fSigma(0),
-  fMass(aMass)
+  fSigma(0)
 {
   // Normal constructor
   char name[200];
@@ -67,8 +65,7 @@ AliFemtoCutMonitorParticleMomRes::AliFemtoCutMonitorParticleMomRes(const AliFemt
   fMomResZvsP(0),
   fImpactXY(0),
   fImpactZ(0),
-  fSigma(0),
-  fMass(0.13957)
+  fSigma(0)
 {
   // copy constructor
   if (fMomRes3D) delete fMomRes3D;
@@ -85,7 +82,6 @@ AliFemtoCutMonitorParticleMomRes::AliFemtoCutMonitorParticleMomRes(const AliFemt
   fImpactZ = new TH2D(*aCut.fImpactZ);
   if (fSigma) delete fSigma;
   fSigma = new TH2D(*aCut.fSigma);
-  fMass = aCut.fMass; 
 }
 
 AliFemtoCutMonitorParticleMomRes::~AliFemtoCutMonitorParticleMomRes()
@@ -135,22 +131,24 @@ void AliFemtoCutMonitorParticleMomRes::Fill(const AliFemtoTrack* aTrack)
 {
   // Fill momentum resolution histograms for the particle
   AliFemtoModelHiddenInfo *tInf = ( AliFemtoModelHiddenInfo *) aTrack->GetHiddenInfo();
-  fMomRes3D->Fill(tInf->GetTrueMomentum()->x() - aTrack->P().x(),
-                 tInf->GetTrueMomentum()->y() - aTrack->P().y(),
-                 tInf->GetTrueMomentum()->z() - aTrack->P().z());
-
-  fMomResXvsP->Fill(aTrack->P().mag(),
-                   tInf->GetTrueMomentum()->x() - aTrack->P().x());
-  fMomResYvsP->Fill(aTrack->P().mag(),
-                   tInf->GetTrueMomentum()->y() - aTrack->P().y());
-  fMomResZvsP->Fill(aTrack->P().mag(),
+  if (tInf) {
+    fMomRes3D->Fill(tInf->GetTrueMomentum()->x() - aTrack->P().x(),
+                   tInf->GetTrueMomentum()->y() - aTrack->P().y(),
                    tInf->GetTrueMomentum()->z() - aTrack->P().z());
-  fImpactXY->Fill(aTrack->P().mag(),
-                 aTrack->ImpactD());
-  fImpactZ->Fill(aTrack->P().mag(),
-                aTrack->ImpactZ());
-  fSigma->Fill(aTrack->P().mag(),
-              aTrack->SigmaToVertex());
+    
+    fMomResXvsP->Fill(aTrack->P().mag(),
+                     tInf->GetTrueMomentum()->x() - aTrack->P().x());
+    fMomResYvsP->Fill(aTrack->P().mag(),
+                     tInf->GetTrueMomentum()->y() - aTrack->P().y());
+    fMomResZvsP->Fill(aTrack->P().mag(),
+                     tInf->GetTrueMomentum()->z() - aTrack->P().z());
+    fImpactXY->Fill(aTrack->P().mag(),
+                   aTrack->ImpactD());
+    fImpactZ->Fill(aTrack->P().mag(),
+                  aTrack->ImpactZ());
+    fSigma->Fill(aTrack->P().mag(),
+                aTrack->SigmaToVertex());
+  }
 }
 
 void AliFemtoCutMonitorParticleMomRes::Write()
index d5c36b5f1bc2625b5a3621f8b989e44b7ba4661c..068e9312e852910a7d307c1beaf5312b44ff1590 100644 (file)
@@ -24,7 +24,7 @@ class AliFemtoCutMonitorParticleMomRes : public AliFemtoCutMonitor{
   
 public:
   AliFemtoCutMonitorParticleMomRes();
-  AliFemtoCutMonitorParticleMomRes(const char *aName, float aMass);
+  AliFemtoCutMonitorParticleMomRes(const char *aName);
   AliFemtoCutMonitorParticleMomRes(const AliFemtoCutMonitorParticleMomRes &aCut);
   virtual ~AliFemtoCutMonitorParticleMomRes();
 
@@ -51,7 +51,6 @@ private:
   TH2D *fImpactXY;    // XY impact parameter
   TH2D *fImpactZ;     // Z impact parameter
   TH2D *fSigma;       // Sigma to vertex vs momentum
-  float fMass;        // Mass hypothesis
 };
 
 #endif