Add the possibiloity to save cut settings in the ROOT file
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 May 2007 09:01:42 +0000 (09:01 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 May 2007 09:01:42 +0000 (09:01 +0000)
17 files changed:
PWG2/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoAnalysis.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoBaseAnalysis.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoBasicTrackCut.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoDummyPairCut.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESD.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoPairCut.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoParticleCut.h
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.cxx
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoESDTrackCut.h
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.cxx
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.h
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.cxx
PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoShareQualityPairCut.h

index 5c9a579..a1a6901 100644 (file)
@@ -501,3 +501,40 @@ void AliFemtoAnalysis::AddEventProcessed() {
   // Increase count of processed events
   fNeventsProcessed++;
 }
+//_________________________
+TList* AliFemtoAnalysis::ListSettings()
+{
+  TList *tListSettings = new TList();
+
+  TList *p1Cut = fFirstParticleCut->ListSettings();
+
+  TListIter nextp1(p1Cut);
+  while (TObject *obj = nextp1.Next()) {
+    TString cuts(obj->GetName());
+    cuts.Prepend("AliFemtoAnalysis.");
+    tListSettings->Add(new TObjString(cuts.Data()));
+  }
+
+  if (fSecondParticleCut != fFirstParticleCut) {
+    TList *p2Cut = fSecondParticleCut->ListSettings();
+    
+    TIter nextp2(p2Cut);
+    while (TObject *obj = nextp2()) {
+      TString cuts(obj->GetName());
+      cuts.Prepend("AliFemtoAnalysis.");
+      tListSettings->Add(new TObjString(cuts.Data()));
+    }
+  }
+
+  TList *pairCut = fPairCut->ListSettings();
+
+  TIter nextpair(pairCut);
+  while (TObject *obj = nextpair()) {
+    TString cuts(obj->GetName());
+    cuts.Prepend("AliFemtoAnalysis.");
+    tListSettings->Add(new TObjString(cuts.Data()));
+  }
+
+  return tListSettings;
+  
+}
index 17517b0..06b5c18 100644 (file)
@@ -58,6 +58,7 @@ class AliFemtoAnalysis : public AliFemtoBaseAnalysis {
 
   bool AnalyzeIdenticalParticles() const;
   virtual AliFemtoString Report();       //! returns reports of all cuts applied and correlation functions being done
+  virtual TList* ListSettings();         // return list of cut settings for the analysis
 
   virtual void EventBegin(const AliFemtoEvent* TheEventToBegin); // startup for EbyE
   virtual void ProcessEvent(const AliFemtoEvent* EventToProcess);
index 8cb6a69..36426dd 100644 (file)
@@ -6,6 +6,8 @@
 #define AliFemtoBaseAnalysis_hh
 
 #include "AliFemtoTypes.h"
+#include <TList.h>
+#include <TObjString.h>
 
 class AliFemtoEvent;
 
@@ -21,6 +23,7 @@ public:
 #endif 
   
   virtual AliFemtoString Report() = 0;       //! returns reports of all cuts applied and correlation functions being done
+  virtual TList* ListSettings() = 0;         // return list of cut settings for the analysis
 
   virtual void ProcessEvent(const AliFemtoEvent* aEventToAnalyze) = 0;
 
index 1e52790..8bcc80c 100644 (file)
@@ -133,3 +133,45 @@ AliFemtoString AliFemtoBasicTrackCut::Report(){
   AliFemtoString returnThis = tStemp;
   return returnThis;
 }
+
+TList *AliFemtoBasicTrackCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.mass=%lf", this->Mass());
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.charge=%i", fCharge);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmapion.minimum=%lf", fNSigmaPion[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmapion.maximum=%lf", fNSigmaPion[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmakaon.minimum=%lf", fNSigmaKaon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmakaon.maximum=%lf", fNSigmaKaon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmaproton.minimum=%lf", fNSigmaProton[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nsigmaproton.maximum=%lf", fNSigmaProton[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nhits.minimum=%i", fNHits[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.nhits.maximum=%i", fNHits[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.pt.minimum=%lf", fPt[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.pt.maximum=%lf", fPt[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.rapidity.minimum=%lf", fRapidity[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.rapidity.maximum=%lf", fRapidity[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.dca.minimum=%lf", fDCA[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoBasicTrackCut.dca.maximum=%lf", fDCA[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  return tListSetttings;
+}
index 40b8abd..d7ba801 100644 (file)
@@ -25,7 +25,7 @@ public:
   virtual bool Pass(const AliFemtoTrack* tr);
 
   virtual AliFemtoString Report();
-
+  virtual TList *ListSettings();
 
   void SetNSigmaPion(const float& lo, const float& hi);
   void SetNSigmaKaon(const float& lo, const float& hi);
index 52023b8..e33d6e4 100644 (file)
@@ -11,6 +11,9 @@
  ***************************************************************************
  *
  * $Log$
+ * Revision 1.1  2007/05/16 10:22:11  akisiel
+ * Making the directory structure of AliFemto flat. All files go into one common directory
+ *
  * Revision 1.2  2007/05/03 09:41:06  akisiel
  * Fixing Effective C++ warnings
  *
@@ -75,3 +78,10 @@ AliFemtoString AliFemtoDummyPairCut::Report(){
   return returnThis;
 }
 //__________________
+TList *AliFemtoDummyPairCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+
+  return tListSetttings;
+}
index 2a0871c..af7d546 100644 (file)
@@ -11,6 +11,9 @@
  ***************************************************************************
  *
  * $Log$
+ * Revision 1.1  2007/05/16 10:22:11  akisiel
+ * Making the directory structure of AliFemto flat. All files go into one common directory
+ *
  * Revision 1.2  2007/05/03 09:41:06  akisiel
  * Fixing Effective C++ warnings
  *
@@ -79,6 +82,7 @@ public:
 
   virtual bool Pass(const AliFemtoPair*);
   virtual AliFemtoString Report();
+  virtual TList *ListSettings();
   AliFemtoDummyPairCut* Clone();
 
 
index 6ff311c..1ae7983 100644 (file)
@@ -11,6 +11,9 @@
 /*
  *$Id$
  *$Log$
+ *Revision 1.1  2007/05/16 10:22:11  akisiel
+ *Making the directory structure of AliFemto flat. All files go into one common directory
+ *
  *Revision 1.5  2007/05/03 09:45:20  akisiel
  *Fixing Effective C++ warnings
  *
@@ -247,6 +250,7 @@ void AliFemtoEventReaderESD::SetInputFile(const char* inputFile)
 //setting the next file to read        
 bool AliFemtoEventReaderESD::GetNextFile()
 {      
+  // Begin reading the next file
   if (fCurFile>=fListOfFiles.size())
     return false;
   fFileName=fListOfFiles.at(fCurFile); 
index f6fc326..5a44517 100644 (file)
@@ -1,13 +1,14 @@
 ////////////////////////////////////////////////////////////////////////////////
-///                                                                          ///
-/// AliFemtoEventReaderESDChain - the reader class for the Alice ESD         ///
-/// tailored for the Task framework                                 ///
-/// Reads in AliESDfriend to create shared hit/quality information           ///
-/// Authors: Adam Kisiel kisiel@mps.ohio-state.edu                           ///
-///                                                                          ///
+//                                                                            //
+// AliFemtoEventReaderESDChain - the reader class for the Alice ESD           //
+// tailored for the Task framework                                            //
+// Reads in AliESDfriend to create shared hit/quality information             //
+// Authors: Adam Kisiel kisiel@mps.ohio-state.edu                             //
+//                                                                            //
 ////////////////////////////////////////////////////////////////////////////////
-#ifndef AliFemtoEventReaderESDChain_hh
-#define AliFemtoEventReaderESDChain_hh
+#ifndef ALIFEMTOEVENTREADERESDCHAIN_H
+#define ALIFEMTOEVENTREADERESDCHAIN_H
+
 #include "AliFemtoEventReader.h"
 #include "AliFemtoEnumeration.h"
 
index ed5c4f1..f503ab7 100644 (file)
@@ -14,6 +14,8 @@ class AliFemtoBaseAnalysis;
 #include "AliFemtoEvent.h"
 #include "AliFemtoPair.h"
 #include "AliFemtoCutMonitorHandler.h"
+#include <TList.h>
+#include <TObjString.h>
 
 class AliFemtoPairCut : public AliFemtoCutMonitorHandler {
 
@@ -29,6 +31,7 @@ public:
   virtual bool Pass(const AliFemtoPair* pair) =0;  // true if passes, false if not
 
   virtual AliFemtoString Report() =0;    // user-written method to return string describing cuts
+  virtual TList *ListSettings() =0;
   virtual void EventBegin(const AliFemtoEvent* aEvent) { /* no-op */ }
   virtual void EventEnd(const AliFemtoEvent* aEvent) { /* no-op */ }
   virtual AliFemtoPairCut* Clone() { return 0;}
index 63c73df..50310a2 100644 (file)
@@ -1,13 +1,17 @@
 ////////////////////////////////////////////////////////////////////////////////
-/// AliFemtoParticleCut - the pure virtual base class for the particle cut   ///
-/// All particle cuts must inherit from this one                             ///
+//                                                                            //
+// AliFemtoParticleCut - the pure virtual base class for the particle cut     //
+// All particle cuts must inherit from this one                               //
+//                                                                            //
 ////////////////////////////////////////////////////////////////////////////////
 
-#ifndef AliFemtoParticleCut_hh
-#define AliFemtoParticleCut_hh
+#ifndef ALIFEMTOPARTICLECUT_H
+#define ALIFEMTOPARTICLECUT_H
 
 #include "AliFemtoTypes.h"
 #include "AliFemtoCutMonitorHandler.h"
+#include <TObjString.h>
+#include <TList.h>
 
 class AliFemtoBaseAnalysis;
 
@@ -22,6 +26,7 @@ public:
   AliFemtoParticleCut& operator=(const AliFemtoParticleCut& aCut);
 
   virtual AliFemtoString Report() =0;    // user-written method to return string describing cuts
+  virtual TList* ListSettings();      // user-written list of settings which is stored in the result file
 
   double Mass(){return fMass;};       // mass of the particle being selected
   virtual void SetMass(const double& mass) {fMass = mass;};
@@ -54,4 +59,13 @@ inline AliFemtoParticleCut::AliFemtoParticleCut(const AliFemtoParticleCut& c): A
 }
 inline void AliFemtoParticleCut::SetAnalysis(AliFemtoBaseAnalysis* analysis) { fyAnalysis = analysis; }
 inline AliFemtoParticleCut& AliFemtoParticleCut::operator=(const AliFemtoParticleCut& aCut) { if (this == &aCut) return *this; fyAnalysis = aCut.fyAnalysis; fMass=aCut.fMass; return *this; }
+  inline TList *AliFemtoParticleCut::ListSettings() { 
+    TList *tListSetttings = new TList(); 
+    char buf[100];
+    snprintf(buf, 100, "AliFemtoParticleCut.mass=%lf", fMass);
+    TObjString *str = new TObjString(buf);
+    tListSetttings->Add(str);
+    return tListSetttings;
+  }
+  
 #endif
index 4e5bd02..438976d 100644 (file)
@@ -11,6 +11,9 @@
  ***************************************************************************
  *
  * $Log$
+ * Revision 1.2  2007/05/21 10:38:25  akisiel
+ * More coding rule conformance
+ *
  * Revision 1.1  2007/05/16 10:25:06  akisiel
  * Making the directory structure of AliFemtoUser flat. All files go into one common directory
  *
@@ -212,3 +215,48 @@ AliFemtoString AliFemtoESDTrackCut::Report()
   AliFemtoString returnThis = tStemp;
   return returnThis;
 }
+TList *AliFemtoESDTrackCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoESDTrackCut.mass=%lf", this->Mass());
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoESDTrackCut.charge=%i", fCharge);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.minimum=%lf", fPidProbPion[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobpion.maximum=%lf", fPidProbPion[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.minimum=%lf", fPidProbKaon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobkaon.maximum=%lf", fPidProbKaon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.minimum=%lf", fPidProbProton[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobproton.maximum=%lf", fPidProbProton[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.minimum=%lf", fPidProbElectron[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobelectron.maximum=%lf", fPidProbElectron[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.minimum=%lf", fPidProbMuon[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pidprobMuon.maximum=%lf", fPidProbMuon[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.minimumtpcclusters=%i", fminTPCclsF);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.minimumitsclusters=%i", fminTPCclsF);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pt.minimum=%lf", fPt[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.pt.maximum=%lf", fPt[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.minimum=%lf", fRapidity[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+  snprintf(buf, 200, "AliFemtoESDTrackCut.rapidity.maximum=%lf", fRapidity[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  return tListSetttings;
+}
index 50359a2..4322b13 100644 (file)
@@ -27,6 +27,7 @@ class AliFemtoESDTrackCut : public AliFemtoTrackCut
   virtual bool Pass(const AliFemtoTrack* aTrack);
 
   virtual AliFemtoString Report();
+  virtual TList *ListSettings();
 
   void SetPt(const float& lo, const float& hi);
   void SetRapidity(const float& lo, const float& hi);
index 2a830f7..22919bb 100644 (file)
@@ -7,6 +7,9 @@
  ***************************************************************************
  *
  * $Log$
+ * Revision 1.1  2007/05/16 10:25:06  akisiel
+ * Making the directory structure of AliFemtoUser flat. All files go into one common directory
+ *
  * Revision 1.4  2007/05/03 09:46:10  akisiel
  * Fixing Effective C++ warnings
  *
@@ -85,3 +88,34 @@ AliFemtoString AliFemtoQPairCut::Report()
   return returnThis;
 }
 //__________________
+TList *AliFemtoQPairCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoQPairCut.qout.maximum=%lf", fQout[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qout.minimum=%lf", fQout[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qside.maximum=%lf", fQside[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qside.minimum=%lf", fQside[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qlong.maximum=%lf", fQlong[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qlong.minimum=%lf", fQlong[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qinv.maximum=%lf", fQinv[0]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  snprintf(buf, 200, "AliFemtoQPairCut.qinv.minimum=%lf", fQinv[1]);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  return tListSetttings;
+}
index dfe174b..90fe35a 100644 (file)
@@ -8,6 +8,9 @@
  ***************************************************************************
  *
  * $Log$
+ * Revision 1.1  2007/05/16 10:25:06  akisiel
+ * Making the directory structure of AliFemtoUser flat. All files go into one common directory
+ *
  * Revision 1.1.1.1  2007/04/25 15:38:41  panos
  * Importing the HBT code dir
  *
@@ -35,6 +38,8 @@ public:
 
   virtual bool Pass(const AliFemtoPair*);
   virtual AliFemtoString Report();
+  virtual TList *ListSettings();
+
   void Setqlong(const float& lo, const float& hi);
   void Setqout(const float& lo, const float& hi);
   void Setqside(const float& lo, const float& hi);
index 80101a8..22d5100 100644 (file)
@@ -109,3 +109,14 @@ void AliFemtoShareQualityPairCut::SetShareQualityMax(Double_t aShareQualityMax)
 Double_t AliFemtoShareQualityPairCut::GetAliFemtoShareQualityMax() {
   return fShareQualityMax;
 }
+
+TList *AliFemtoShareQualityPairCut::ListSettings()
+{
+  // return a list of settings in a writable form
+  TList *tListSetttings = new TList();
+  char buf[200];
+  snprintf(buf, 200, "AliFemtoShareQualityPairCut.sharequalitymax=%lf", fShareQualityMax);
+  tListSetttings->AddLast(new TObjString(buf));
+
+  return tListSetttings;
+}
index ea49c10..33aa755 100644 (file)
@@ -32,6 +32,7 @@ public:
 
   virtual bool Pass(const AliFemtoPair*);
   virtual AliFemtoString Report();
+  virtual TList *ListSettings();
   AliFemtoShareQualityPairCut* Clone();
   void SetShareQualityMax(Double_t aAliFemtoShareQualityMax);
   Double_t GetAliFemtoShareQualityMax();