Time data monitoring (Raphael)
authorcheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Sep 2009 09:13:49 +0000 (09:13 +0000)
committercheynis <cheynis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Sep 2009 09:13:49 +0000 (09:13 +0000)
VZERO/AliVZEROTrending.cxx [new file with mode: 0644]
VZERO/AliVZEROTrending.h [new file with mode: 0644]

diff --git a/VZERO/AliVZEROTrending.cxx b/VZERO/AliVZEROTrending.cxx
new file mode 100644 (file)
index 0000000..55dff47
--- /dev/null
@@ -0,0 +1,101 @@
+/**************************************************************************\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
+ *                                                                        *\r
+ * Author: The ALICE Off-line Project.                                    *\r
+ * Contributors are mentioned in the code where appropriate.              *\r
+ *                                                                        *\r
+ * Permission to use, copy, modify and distribute this software and its   *\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r
+ * without fee, provided that the above copyright notice appears in all   *\r
+ * copies and that both the copyright notice and this permission notice   *\r
+ * appear in the supporting documentation. The authors make no claims     *\r
+ * about the suitability of this software for any purpose. It is          *\r
+ * provided "as is" without express or implied warranty.                  *\r
+ **************************************************************************/\r
+\r
+// \r
+// Class AliVZEROTrending\r
+// ---------------------------\r
+// \r
+//  class used in QA to publish variables evolution versus time in AMORE. \r
+//  These histo are the one which will be looked at by QA Shifter\r
+// \r
+#include "TGraph.h"\r
+\r
+#include "AliLog.h"\r
+#include "AliVZEROTrending.h"\r
+\r
+ClassImp(AliVZEROTrending)\r
+\r
+//_____________________________________________________________________________\r
+AliVZEROTrending::AliVZEROTrending() : TH1(), fNEntries(0)\r
+{\r
+       // Default constructor\r
+}\r
+//_____________________________________________________________________________\r
+AliVZEROTrending::AliVZEROTrending(const char* name, const char* title) : TH1(), fNEntries(0)\r
+{\r
+       SetName(name);\r
+       SetTitle(title);\r
+}\r
+//_____________________________________________________________________________\r
+AliVZEROTrending::AliVZEROTrending(const AliVZEROTrending &trend) : \r
+       TH1(), fNEntries(trend.fNEntries)\r
+{\r
+       // Copy constructor\r
+       SetName(trend.GetName());\r
+       SetTitle(trend.GetTitle());\r
+       for (int i = 0; i < kDataSize; i++) {\r
+               fTime[i] = trend.fTime[i];\r
+               for (int j = 0; j < 8; j++) {\r
+                       fData[j][i] = trend.fData[j][i];\r
+               }\r
+       }\r
+}\r
+\r
+//_____________________________________________________________________________\r
+AliVZEROTrending::~AliVZEROTrending(){\r
+       // Destructor\r
+}\r
+// -----------------------------------------------------------------                   \r
+void AliVZEROTrending::AddEntry(Double_t * data, UInt_t time)\r
+{\r
+\r
+       if(fNEntries<kDataSize){\r
+               for (int i = 0; i < 8; i++)\r
+               {\r
+                       fData[i][fNEntries] = data[i];\r
+                       fTime[fNEntries] = (double) time;\r
+               }\r
+               fNEntries++;    \r
+       }else{\r
+\r
+               for (int i = 0; i < kDataSize-1; i++){\r
+                       fTime[i] = fTime[i+1];\r
+                       for (int ich = 0; ich < 8; ich++){              \r
+                               fData[ich][i] = fData[ich][i+1];\r
+                       }       \r
+               }\r
+               for (int i = 0; i < 8; i++)\r
+               {\r
+                       fData[i][fNEntries-1] = data[i];\r
+                       fTime[fNEntries-1] = (double) time;\r
+               }\r
+               \r
+       }\r
+       //printf("sizeof UInt_t Double_t %d %d\n",sizeof(UInt_t),sizeof(Double_t));\r
+       //printf("Add Entry %d @ %f : %f %f %f %f %f %f %f %f \n",fNEntries,fTime[fNEntries-1], \r
+       //      data[0],data[1],data[2],data[3],data[4],data[5],data[6],data[7]);\r
+}                      \r
+// -----------------------------------------------------------------                   \r
+void AliVZEROTrending::PrintEntry(UInt_t entry)\r
+{\r
+\r
+       if(entry>=fNEntries){\r
+               AliError(Form("maximum entry is %d\n",fNEntries-1));\r
+       }else{\r
+               AliInfo(Form("Entry %d @ %f : %f %f %f %f %f %f %f %f \n",entry, fTime[entry],\r
+                       fData[0][entry],fData[1][entry],fData[2][entry],fData[3][entry],fData[4][entry],fData[5][entry],fData[6][entry],fData[7][entry]));\r
+\r
+       }\r
+}                      \r
diff --git a/VZERO/AliVZEROTrending.h b/VZERO/AliVZEROTrending.h
new file mode 100644 (file)
index 0000000..cd5a3ce
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef ALIVZEROTRENDING_H\r
+#define ALIVZEROTRENDING_H\r
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights\r
+ * reserved. \r
+ *\r
+ * See cxx source for full Copyright notice                               \r
+ */\r
+\r
+\r
+// \r
+// Class AliVZEROTrending\r
+// ---------------------------\r
+// \r
+//  class used in QA to publish variables evolution versus time in AMORE. \r
+//  These histo are the one which will be looked at by QA Shifter\r
+// \r
+\r
+\r
+#include <TH1.h>\r
+\r
+class TGraph;\r
+\r
+class AliVZEROTrending  : public TH1 {\r
+public:\r
+       AliVZEROTrending();\r
+       AliVZEROTrending(const char* name, const char* title);\r
+       virtual ~AliVZEROTrending();\r
+       AliVZEROTrending(const AliVZEROTrending &trend);\r
+               \r
+       Double_t * GetTime(){return fTime;};\r
+       Double_t * GetChannel(Int_t i){return fData[i];};\r
+       Double_t  GetLastTime(){return fTime[fNEntries-1];};\r
+       Double_t  GetLastChannel(Int_t i){return fData[i][fNEntries];};\r
+       UInt_t GetNEntries(){return fNEntries;};\r
+       void AddEntry(Double_t * data, UInt_t time);\r
+       void PrintEntry(UInt_t entry);  \r
+\r
+private:\r
+       \r
+       AliVZEROTrending& operator= (const AliVZEROTrending & /*trend*/); // Not implemented\r
+       enum{kDataSize = 500};\r
+       Double_t fData[8][kDataSize];\r
+       Double_t fTime[kDataSize];\r
+       UInt_t fNEntries;\r
+       \r
+       \r
+       ClassDef( AliVZEROTrending, 1 )  \r
+       \r
+};\r
+\r
+#endif // ALIVZEROTRENDING_H\r
+\r
+\r