]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFRunParams.cxx
fix debug print
[u/mrichter/AliRoot.git] / TOF / AliTOFRunParams.cxx
index 15a6a70634a7d201de37718b3c8bd4dd46b847c4..e7fc0e2b79148da7ecd742d487ce5960955c3a0a 100644 (file)
@@ -41,7 +41,8 @@ AliTOFRunParams::AliTOFRunParams() :
   fNRuns(0),
   fRunNb(NULL),
   fRunFirstPoint(NULL),
-  fRunLastPoint(NULL)
+  fRunLastPoint(NULL),
+  fUseLHCClockPhase(kFALSE)
 {
   /*
    * default constructor
@@ -60,7 +61,8 @@ AliTOFRunParams::AliTOFRunParams(Int_t nPoints, Int_t nRuns) :
   fNRuns(nRuns),
   fRunNb(new UInt_t[nRuns]),
   fRunFirstPoint(new UInt_t[nRuns]),
-  fRunLastPoint(new UInt_t[nRuns])
+  fRunLastPoint(new UInt_t[nRuns]),
+  fUseLHCClockPhase(kFALSE)
 {
   /*
    * standard constructor
@@ -96,7 +98,8 @@ AliTOFRunParams::AliTOFRunParams(const AliTOFRunParams &source) :
   fNRuns(source.fNRuns),
   fRunNb(new UInt_t[source.fNRuns]),
   fRunFirstPoint(new UInt_t[source.fNRuns]),
-  fRunLastPoint(new UInt_t[source.fNRuns])
+  fRunLastPoint(new UInt_t[source.fNRuns]),
+  fUseLHCClockPhase(source.fUseLHCClockPhase)
 {
   /*
    * copy constructor
@@ -164,6 +167,8 @@ AliTOFRunParams::operator=(const AliTOFRunParams &source)
     fRunLastPoint[i] = source.fRunLastPoint[i];
   }
 
+  fUseLHCClockPhase = source.fUseLHCClockPhase;
+
   return *this;
 }
 
@@ -277,6 +282,7 @@ AliTOFRunParams::Average(Float_t *data, Int_t first, Int_t last)
     value += data[i];
     npt++;
   }
+  if (npt <= 0) return 0.;
   value /= npt;
   return value;
 
@@ -338,3 +344,20 @@ AliTOFRunParams::DrawGraph(Float_t *data, Option_t* option)
   graph->Draw(option);
   return graph;
 }
+
+//_________________________________________________________
+
+TGraph *
+AliTOFRunParams::DrawCorrelationGraph(Float_t *datax, Float_t *datay, Option_t* option)
+{
+  /*
+   * draw
+   */
+
+  if (fNPoints == 0 || !datax || !datay) return NULL;
+
+  TGraph *graph = new TGraph(fNPoints, datax, datay);
+  graph->Draw(option);
+  return graph;
+}
+