]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/PHOS/AliHLTPHOSRcuHistogramProducer.cxx
Bug fix, mapping was not correct
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSRcuHistogramProducer.cxx
index bfad40f6005d6cf962c6131cf9b5c17e38bf2b3c..edf31fb77c1986ec396afe99791eae92a52d9a4f 100644 (file)
 
 #include "AliHLTPHOSRcuHistogramProducer.h"
 #include <iostream>
-#include "stdio.h"
-#include <cstdlib>
+//#include "stdio.h"
+#//include <cstdlib>
 #include "AliHLTPHOSRcuCellEnergyDataStruct.h"
 #include "TFile.h"
 
+using  namespace std;
+
+
 /*************************************************************************
-* Class AliHLTPHOSRcuHistogramProducer accumulating histograms     *
+* Class AliHLTPHOSRcuHistogramProducer accumulating histograms           *
 * with amplitudes per PHOS channel                                       *
 * It is intended to run at the HLT farm                                  *
 * and it fills the histograms with amplitudes per channel.               * 
 * Usage example see in PHOS/macros/Shuttle/AliPHOSCalibHistoProducer.C   *
 **************************************************************************/
-AliHLTPHOSRcuHistogramProducer:: AliHLTPHOSRcuHistogramProducer(): fEventCount(0), fEquippmentID(0), fModuleID(0), fRcuX(0), fRcuZ(0)
+
+
+AliHLTPHOSRcuHistogramProducer:: AliHLTPHOSRcuHistogramProducer(): fModuleID(0), fRcuX(0), fRcuZ(0)
+
 {
+  //Default constructor
   cout << "WARNING: You cannot invoke the AliHLTPHOSRcuHistogramProducer without arguments" << endl;
   cout << "Usage AliHLTPHOSRcuHistogramProducer(ModuleID, X. Z)" << endl;
-  //  Reset();
-  //  Init();
 } 
 
+//AliHLTPHOSRcuHistogramProducer::AliHLTPHOSRcuHistogramProducer(AliHLTUInt8_t moduleID, AliHLTUInt8_t rcuX, AliHLTUInt8_t rcuZ)
 AliHLTPHOSRcuHistogramProducer::AliHLTPHOSRcuHistogramProducer(AliHLTUInt8_t moduleID, AliHLTUInt8_t rcuX, AliHLTUInt8_t rcuZ)
 {
+  //Se header file for documentation
   SetModuleID(moduleID);
   SetRcuX(rcuX); 
   SetRcuZ(rcuZ); 
@@ -46,13 +53,14 @@ AliHLTPHOSRcuHistogramProducer::AliHLTPHOSRcuHistogramProducer(AliHLTUInt8_t mod
 
 AliHLTPHOSRcuHistogramProducer::~ AliHLTPHOSRcuHistogramProducer()
 {
-
+  //Destructor
 }
 
 
 void
 AliHLTPHOSRcuHistogramProducer::Init()
 {
+  //See header file for documentation
   char tmpHistoName[256];
   int geomx;
   int geomz;
@@ -73,15 +81,10 @@ AliHLTPHOSRcuHistogramProducer::Init()
              fHits[x][z][gain]                = 0;
              sprintf(tmpHistoName, "Edistribution_%d_%d_%d_%d",(int)fModuleID,  geomx, geomz, gain);
              fEnergyHistogramPtrs[x][z][gain] = 0;
-
              fEnergyHistogramPtrs[x][z][gain] = new TH1F( tmpHistoName, tmpHistoName, N_BINS, XBIN_LOW, XBIN_UP);
-
              sprintf(tmpHistoName, "TOFdistribution_%d_%d_%d_%d",(int)fModuleID,  geomx, geomz, gain);
-       
              fTimingHistogramPtrs[x][z][gain] = 0;
-
              fTimingHistogramPtrs[x][z][gain] = new TH1F(tmpHistoName , tmpHistoName, N_BINS, XBIN_LOW, XBIN_UP);
-
              fCellAccEnergy.fAccumulatedEnergies[x][z][gain] = 0;
              fCellAccEnergy.fHits[x][z][gain] = 0;
              fCellAccEnergy.fModuleID = 0;
@@ -92,46 +95,41 @@ AliHLTPHOSRcuHistogramProducer::Init()
     } 
 }
 
-int 
-AliHLTPHOSRcuHistogramProducer::GetEquippmentId()
-{
-  return  fEquippmentID;
-}
-
 
 void 
 AliHLTPHOSRcuHistogramProducer::SetRcuX(AliHLTUInt8_t X)
 {
+  //See header file for documentation
   fRcuX = X; 
   fCellAccEnergy.fRcuX = X;
 }
 
 
+
 void 
 AliHLTPHOSRcuHistogramProducer::SetRcuZ(AliHLTUInt8_t Z)
 {
+  //See header file for documentation
   fRcuZ = Z; 
   fCellAccEnergy.fRcuZ = Z;
 }
 
 
-void 
-AliHLTPHOSRcuHistogramProducer::SetModuleID(AliHLTUInt8_t moduleID)
-{
- fModuleID = moduleID;
-}
 
 
 void 
-AliHLTPHOSRcuHistogramProducer::SetEquippmentId(int id)
+AliHLTPHOSRcuHistogramProducer::SetModuleID(AliHLTUInt8_t moduleID)
 {
-  fEquippmentID = id;
+  //See header file for documentation
+ fModuleID = moduleID;
 }
 
 
 void 
 AliHLTPHOSRcuHistogramProducer::FillEnergy(AliHLTUInt8_t x, AliHLTUInt8_t z,  AliHLTUInt8_t gain, float energy)
 {
+  //  cout << "AliHLTPHOSRcuHistogramProducer::FillEnergy x = " << (int)x<< "  z=  " << (int)z<<endl;
+  //See header file for documentation
   fCellAccEnergy.fAccumulatedEnergies[x][z][gain] += energy;
   fCellAccEnergy.fHits[x][z][gain] ++; 
   fEnergyHistogramPtrs[x][z][gain]->Fill(energy);
@@ -141,6 +139,7 @@ AliHLTPHOSRcuHistogramProducer::FillEnergy(AliHLTUInt8_t x, AliHLTUInt8_t z,  Al
 void 
 AliHLTPHOSRcuHistogramProducer::FillTime(AliHLTUInt8_t x, AliHLTUInt8_t z, AliHLTUInt8_t gain, float time)
 {
+  //See header file for documentation
   fTimingHistogramPtrs[x][z][gain]->Fill(time);
 }
 
@@ -151,17 +150,11 @@ AliHLTPHOSRcuHistogramProducer::GetCellAccumulatedEnergies()
   return fCellAccEnergy ;
 }
 
-int 
-AliHLTPHOSRcuHistogramProducer::IncrementEventCounter()
-{
-   fEventCount ++;
-   return  fEventCount;
-}
-
 
 void
 AliHLTPHOSRcuHistogramProducer::Reset()
 {
+  //See header file for documentation
   for(int x = 0; x < N_XCOLUMNS_RCU; x ++)
     {
       for(int z = 0; z < N_ZROWS_RCU; z ++)
@@ -182,9 +175,11 @@ AliHLTPHOSRcuHistogramProducer::Reset()
     }
 }
 
+
 void 
 AliHLTPHOSRcuHistogramProducer::WriteEnergyHistograms()
 {
+  //See header file for documentation
   char tmpFileName[256];
   sprintf(tmpFileName,"/home/aliphoshlt/rundir/outdata/calibHisto_%d_%d_%d.root", (int)fModuleID, (int)fRcuX, (int)fRcuZ);
   TFile *histoFile =  new TFile(tmpFileName,"update");