]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AliBaseMCTrackDensity.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliBaseMCTrackDensity.cxx
index 39191024218773401e3ee73ddd6f98a4cb9c4e3f..8c8100d78cd8d0e5ce47cd04eb9ed661fc2d1087 100644 (file)
@@ -318,7 +318,7 @@ AliBaseMCTrackDensity::ProcessTracks(const AliMCEvent& event,
     // track back to the original primary?
     if (fUseOnlyPrimary && !isPrimary) continue;
 
-    const AliMCParticle* mother = GetMother(iTr, event);
+    const AliMCParticle* mother = isPrimary ? particle : GetMother(iTr, event);
     ProcessTrack(particle, mother);
 
   } // Loop over tracks
@@ -333,18 +333,28 @@ AliBaseMCTrackDensity::CalculateWeight(Double_t eta, Double_t pt,
 {
   return fWeights.CalcWeight(eta, pt, phi, id, fPhiR, fB);
 }
+
+#define PF(N,V,...)                                    \
+  AliForwardUtil::PrintField(N,V, ## __VA_ARGS__)
+#define PFB(N,FLAG)                            \
+  do {                                                                 \
+    AliForwardUtil::PrintName(N);                                      \
+    std::cout << std::boolalpha << (FLAG) << std::noboolalpha << std::endl; \
+  } while(false)
+#define PFV(N,VALUE)                                   \
+  do {                                                 \
+    AliForwardUtil::PrintName(N);                      \
+    std::cout << (VALUE) << std::endl; } while(false)
+
 //____________________________________________________________________
 void
 AliBaseMCTrackDensity::Print(Option_t* /*option*/) const 
 {
-  char ind[gROOT->GetDirLevel()+1];
-  for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
-  ind[gROOT->GetDirLevel()] = '\0';
-  std::cout << ind << ClassName() << ": " << GetName() << '\n'
-           << std::boolalpha 
-           << ind << " Only primary tracks:    " << fUseOnlyPrimary << '\n'
-           << ind << " Use flow after burner:  " << fUseFlowWeights 
-           << std::noboolalpha << std::endl;
+  AliForwardUtil::PrintTask(*this);
+  gROOT->IncreaseDirLevel();  
+  PFB("Only primary tracks", fUseOnlyPrimary);
+  PFB("Use flow after burner", fUseFlowWeights);
+  gROOT->DecreaseDirLevel();
   
 }