]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDBaseDA.cxx
Removed generated files@
[u/mrichter/AliRoot.git] / FMD / AliFMDBaseDA.cxx
index 71fbc91766ad1605be29e711622a3ef979c3b01f..e9c14346672eb12527fc8bd980389f147b669aaa 100644 (file)
@@ -35,6 +35,7 @@
 #include "AliRawEventHeaderBase.h"
 #include <TDatime.h>
 #include <TSystem.h>
+#include <TH2F.h>
 
 //_____________________________________________________________________
 ClassImp(AliFMDBaseDA)
@@ -136,12 +137,14 @@ AliFMDBaseDA::AliFMDBaseDA() :
   fOutputFile(),
   fConditionsFile(),
   fSaveHistograms(kFALSE),
+  fMakeSummaries(kFALSE),
   fDetectorArray(),
   fPulseSize(10),
   fPulseLength(10),
   fRequiredEvents(0),
   fCurrentEvent(0), 
-  fRunno(0)
+  fRunno(0),
+  fSummaries(0)
 {
   //Constructor
   fSeenDetectors[0] = fSeenDetectors[1] = fSeenDetectors[2] = kFALSE;
@@ -156,12 +159,14 @@ AliFMDBaseDA::AliFMDBaseDA(const AliFMDBaseDA & baseDA) :
   fOutputFile(),
   fConditionsFile(),
   fSaveHistograms(baseDA.fSaveHistograms),
+  fMakeSummaries(baseDA.fMakeSummaries),
   fDetectorArray(baseDA.fDetectorArray),
   fPulseSize(baseDA.fPulseSize),
   fPulseLength(baseDA.fPulseLength),
   fRequiredEvents(baseDA.fRequiredEvents),
   fCurrentEvent(baseDA.fCurrentEvent),
-  fRunno(baseDA.fRunno)
+  fRunno(baseDA.fRunno),
+  fSummaries(0)
 {
   //Copy constructor
   fSeenDetectors[0] = baseDA.fSeenDetectors[0];
@@ -200,7 +205,12 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
   Bool_t sodread = kFALSE;
   
   for(Int_t i=0;i<3;i++) {
-    reader->NextEvent(); // Read Start-of-Run / Start-of-Files event
+    if (reader->NextEvent()) { 
+      // Read Start-of-Run / Start-of-Files event
+      AliWarning(Form("Failed to read the %d%s event",
+                     i+1, (i == 0 ? "st" : (i == 1 ? "nd" : "rd"))));
+      break;
+    }
     
     UInt_t eventType = reader->GetType();
     if(eventType == AliRawEventHeaderBase::kStartOfData || 
@@ -255,6 +265,9 @@ void AliFMDBaseDA::Run(AliRawReader* reader)
       Char_t   ring = (ir == 0 ? 'O' : 'I');
       UShort_t nsec = (ir == 0 ? 40  : 20);
       UShort_t nstr = (ir == 0 ? 256 : 512);
+
+      if (fMakeSummaries) MakeSummary(det, ring);
+
       std::cout << " Ring " << ring << ": " << std::flush;
       for(UShort_t sec =0; sec < nsec;  sec++)  {
        for(UShort_t strip = 0; strip < nstr; strip++) {
@@ -415,6 +428,9 @@ void AliFMDBaseDA::WriteConditionsData(AliFMDRawReader* fmdReader)
       }
     }
   }
+  // sampleRate->WriteToFile(std::cout, fSeenDetectors);
+  // stripRange->WriteToFile(std::cout, fSeenDetectors);
+
   if(fConditionsFile.is_open()) {
     
     fConditionsFile.write("# EOF\n",6);
@@ -482,6 +498,24 @@ void AliFMDBaseDA::Rotate(const char* base, int max) const
   }
 }
 
+//_____________________________________________________________________ 
+TH2*
+AliFMDBaseDA::MakeSummaryHistogram(const char* prefix, const char* title, 
+                                  UShort_t d, Char_t r) 
+{
+  Int_t nX = ((d == 1 || r == 'I' || r == 'i') ?  20 :  40);
+  Int_t nY = ((d == 1 || r == 'I' || r == 'i') ? 512 : 256);
+  
+  TH2* ret = new TH2F(Form("%sFMD%d%c", prefix, d, r), 
+                     Form("%s for FMD%d%c", title, d, r), 
+                     nX, -0.5, nX-0.5, nY, -0.5, nY-0.5);
+  ret->SetXTitle("Sector #");
+  ret->SetYTitle("Strip #");
+
+  // if (!fSummaries) fSummaries = new TObjArray;
+  fSummaries.Add(ret);
+  return ret;
+}
 
 //_____________________________________________________________________ 
 //