]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coding conventions and minor fixes
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2007 23:16:38 +0000 (23:16 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 22 Nov 2007 23:16:38 +0000 (23:16 +0000)
28 files changed:
HLT/PHOS/AliHLTPHOSBase.cxx
HLT/PHOS/AliHLTPHOSBase.h
HLT/PHOS/AliHLTPHOSConfig.h
HLT/PHOS/AliHLTPHOSDigitMakerComponent.cxx
HLT/PHOS/AliHLTPHOSDigitMakerComponent.h
HLT/PHOS/AliHLTPHOSProcessor.cxx
HLT/PHOS/AliHLTPHOSProcessor.h
HLT/PHOS/AliHLTPHOSRawAnalyzer.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzer.h
HLT/PHOS/AliHLTPHOSRawAnalyzerComponent.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzerComponent.h
HLT/PHOS/AliHLTPHOSRawAnalyzerPeakFinder.cxx
HLT/PHOS/AliHLTPHOSRcuDigitMakerComponent.cxx
HLT/PHOS/AliHLTPHOSRcuProcessor.cxx
HLT/PHOS/AliHLTPHOSRcuTreeMaker.cxx
HLT/PHOS/AliHLTPHOSRcuTreeMaker.h
HLT/PHOS/AliHLTPHOSRcuTreeMakerComponent.cxx
HLT/PHOS/AliHLTPHOSRcuTreeMakerComponent.h
HLT/PHOS/AliHLTPHOSSanityInspector.cxx
HLT/PHOS/AliHLTPHOSSanityInspector.h
HLT/PHOS/AliHLTPHOSTreeMaker.cxx
HLT/PHOS/AliHLTPHOSTreeMaker.h
HLT/PHOS/AliHLTPHOSTreeMakerComponent.cxx
HLT/PHOS/AliHLTPHOSTreeMakerComponent.h
HLT/PHOS/Makefile
HLT/PHOS/OnlineDisplay/Makefile
HLT/PHOS/hltAltroConfig.txt
HLT/PHOS/testDecoder.cxx

index a50d1b41a50e08b7f0ea69d901599602ce5b5cbc..1d6cdf4cc8510a3fab332db5e14f470b303474ee 100644 (file)
@@ -24,8 +24,7 @@
 AliHLTPHOSBase::AliHLTPHOSBase(): AliHLTPHOSConfig(),  
                                  AliHLTPHOSAltroConfig()
 {
-  //  fConfigPtr = new AliHLTPHOSConfig();
-  //  fAltroConfigPtr = new AliHLTPHOSAltroConfig();
+
 }
 
 
@@ -34,3 +33,20 @@ AliHLTPHOSBase::~AliHLTPHOSBase()
 
 }
 
+
+bool
+AliHLTPHOSBase::CheckFile(const char *fileName, const char *opt) const
+{
+  FILE *fp = fopen(fileName, opt);
+
+  if(fp == 0)
+    {
+      cout <<"Error: from" << typeid(*this).name()  <<"could not open file: "<< fileName <<endl; 
+      return false;
+     }
+  else
+    {
+      fclose(fp); 
+      return true;
+    }
+}
index f4d2ef3b32a2ecf3d9e476bd72ccd6913c1bdf10..60e6a27743643fdf491ad7cf2f71d4e22cb6df59 100644 (file)
@@ -31,14 +31,12 @@ using namespace PhosHLTConst;
 using namespace std;
 
 
-class AliHLTPHOSConfig;
-class AliHLTPHOSAltroConfig;
-
 class  AliHLTPHOSBase : public AliHLTPHOSConfig, public AliHLTPHOSAltroConfig
 {
-public:
+ public:
   AliHLTPHOSBase();
   virtual ~AliHLTPHOSBase();
+  bool CheckFile(const char *fileName, const char *opt) const;
 
 
   template<typename T> 
@@ -53,7 +51,6 @@ public:
          }
 
        cout << array[i]<< "\t";
-
       }
   }
 
@@ -69,8 +66,6 @@ public:
   template<typename T> 
   T  MaxValue(T *array, int N)
   {
-    //   Double_t tmpMax = 0;
-      
     T tmpMax = 0;
 
     for(int i = 0; i < N; i++)
index 00f438d640ea624467a200d223f4a7a07c06e54d..b43ef9db26ec032ef7bb9d8b23530a3aa41dec5a 100644 (file)
@@ -28,9 +28,14 @@ public:
   virtual ~AliHLTPHOSConfig();
   void SetSoftwareBaselineSubtraction(bool isSoftwareBaselineSubtraction);
   void PrintDefaultValues();
+  
 
 protected:
   bool fIsSoftwareBaselineSubtraction;
+  //  int fRunNumber;
+  
+ private:
+  //  void ScanRunNumberFromFile();
 };
 
 #endif
index e31eb5991795ca1e8699b5ee162d940615d8e17f..5c7a7d0f8bb45f4bbe2c09adac4fe5d8b1d6642f 100644 (file)
@@ -30,8 +30,8 @@ AliHLTPHOSDigitMakerComponent gAliHLTPHOSDigitMakerComponent;
 
 AliHLTPHOSDigitMakerComponent::AliHLTPHOSDigitMakerComponent() :
   AliHLTPHOSProcessor(),
-  fDigitMakerPtr(0),
-  fEvtCnt(0)
+  fDigitMakerPtr(0)
+  //  fEvtCnt(0)
 {
   //comment
 }
@@ -94,17 +94,11 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
                                        std::vector<AliHLTComponentBlockData>& outputBlocks)
 {
    //Do event
-     
   UInt_t tSize            = 0;
   UInt_t offset           = 0; 
   UInt_t mysize           = 0;
-  //Int_t nRecPoints        = 0;
-  //Int_t index             = 0;
-  
-  //Int_t fileCount = 0;
   Int_t digitCount = 0;
-  //char filename [50];
-
+  //  cout << " AliHLTPHOSDigitMakerComponent::DoEven  fEvtCnt = " << fEvtCnt <<endl; 
 
   AliHLTUInt8_t* outBPtr;
   outBPtr = outputPtr;
@@ -126,7 +120,8 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
        }
       digitCount = fDigitMakerPtr->MakeDigits(reinterpret_cast<AliHLTPHOSRcuCellEnergyDataStruct*>(iter->fPtr));
     }
-  fEvtCnt++;
+
+  fPhosEventCount++;
   
   mysize = 0;
   offset = tSize;
@@ -154,9 +149,9 @@ AliHLTPHOSDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtData,
       
   fDigitMakerPtr->Reset();
   
-  if(fEvtCnt % 10 == 0)
+  if(fPhosEventCount % 10 == 0)
     {
-      cout << "Event #: " << fEvtCnt << endl;
+      cout << "Event #: " << fPhosEventCount << endl;
       cout << "  - Number of digits found: " << digitCount << endl;
     }
   
index 7143e5b93013f40f9dd3ff5c21937942ae0ca698..d5679785ea189c273de8729696fc3c55fe4df96e 100644 (file)
@@ -16,9 +16,6 @@
 #define ALIHLTPHOSDIGITMAKERCOMPONENT_H
 
 #include "AliHLTPHOSProcessor.h"
-//#include "AliHLTPHOSDigitMaker.h"
-//#include "TTree.h"
-//#include "TClonesArray.h"
 
 
 class AliHLTPHOSDigitMaker;
@@ -56,8 +53,8 @@ protected:
 private:
   AliHLTPHOSDigitMaker *fDigitMakerPtr; //comment
   AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //comment
-  UInt_t fEvtCnt; //comment
-  Int_t fRunNb; //comment
+  //  UInt_t fEvtCnt; //comment
+  //  Int_t fRunNb; //comment
 
   static const AliHLTComponentDataType fgkInputDataTypes[];     //HLT input data type
 
index fe274204c17e0a38962124eff9a156956c2832bc..99844eef43148ec868099a8e905dfc5a634a921a 100644 (file)
  **************************************************************************/
 
 #include "AliHLTPHOSProcessor.h"
+#include "unistd.h"
 
 
 const AliHLTComponentDataType AliHLTPHOSProcessor::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
 
 
-AliHLTPHOSProcessor::AliHLTPHOSProcessor():AliHLTProcessor(), AliHLTPHOSBase(), fModuleID(0), fPrintInfoFrequncy(1000)
+AliHLTPHOSProcessor::AliHLTPHOSProcessor():AliHLTProcessor(), AliHLTPHOSBase(), fModuleID(0), fPrintInfoFrequncy(1000), fRunNumber(0)
 {
-
+  ScanRunNumberFromFile();
 }
 
 
@@ -32,3 +33,23 @@ AliHLTPHOSProcessor::~AliHLTPHOSProcessor()
 }
 
 
+void 
+AliHLTPHOSProcessor::ScanRunNumberFromFile()
+{
+  char tmpDirectory[512];
+  char tmpFileName[512];
+  sprintf(tmpDirectory, "%s", getenv("HOME"));  
+  sprintf(tmpFileName, "%s%s", tmpDirectory, "/rundir/runNumber.txt");
+
+  if(CheckFile(tmpFileName, "r") == true)
+    {
+      FILE *fp = fopen(tmpFileName, "r");
+      fscanf(fp, "%d", &fRunNumber);
+      fclose(fp);
+    }
+
+  else
+    {
+      cout << "ERROR, could not find file  " << tmpFileName <<endl;
+    }
+}
index 20358dfffd14ca96cac9fea6e2794b24f2f33357..e737fdef8c41c3e65ec1cf33d2868c7a3689b086 100644 (file)
@@ -24,12 +24,15 @@ class AliHLTPHOSProcessor:public AliHLTProcessor, public AliHLTPHOSBase
   virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) =0;
   virtual AliHLTComponent* Spawn() = 0; 
 
+
  protected:
+  void ScanRunNumberFromFile();
   int fPhosEventCount;                  /**<Global event counter for this component*/
   AliHLTUInt8_t  fModuleID;             /**<ID of the module this component read data from (0-4)*/
   Bool_t fPrintInfo;                    /**<wether or not to print debugg info to std out*/
   int fPrintInfoFrequncy;               /**<Defines the update frequency for information printet to std out*/
   static const AliHLTComponentDataType fgkInputDataTypes[]; /**<List of  datatypes that can be given to this component*/
+  int fRunNumber;
  private:
   AliHLTPHOSProcessor(const AliHLTPHOSProcessor & );
   AliHLTPHOSProcessor & operator = (const AliHLTPHOSProcessor &);
index e65b9e0461ced5ffaa35eb7acbd0d1f65226ceb6..7f9ca18cfefce0cd3850378ace2c2d585bfa122c 100644 (file)
@@ -97,7 +97,7 @@ AliHLTPHOSRawAnalyzer::GetEnergy() const
  * Set data array. Overrides data data array set in the constructor.
  **/
 void 
-AliHLTPHOSRawAnalyzer::SetData(UInt_t *data)
+AliHLTPHOSRawAnalyzer::SetData(const UInt_t *data) 
 {
   fIntDataPtr = data;
 }
@@ -106,7 +106,7 @@ AliHLTPHOSRawAnalyzer::SetData(UInt_t *data)
  * Set data array. Overrides data data array set in the constructor.
  **/
 void 
-AliHLTPHOSRawAnalyzer::SetData(double *data)
+AliHLTPHOSRawAnalyzer::SetData(const double *data) 
 {
   fFloatDataPtr = data;
 }
index 0fc6460e0feda2983e5ae709f0f4c024bb6d0b54..ef88f3e16d5ff1e4d0c6128f05dc40b16cded0eb 100644 (file)
@@ -22,8 +22,8 @@ class AliHLTPHOSRawAnalyzer: public AliHLTPHOSBase
   float GetTiming() const;
   float GetEnergy() const;
 
-  void SetData(double *data);
-  void SetData(UInt_t *data);
+  void SetData(const double *data);
+  void SetData(const UInt_t *data);
 
   void SetSampleFreq(double freq);
   void SetStartIndex(int startIndex);
@@ -35,8 +35,12 @@ class AliHLTPHOSRawAnalyzer: public AliHLTPHOSBase
   virtual void Evaluate(Int_t start = 0, Int_t lenght = 100) = 0;
 
  protected:
-  Double_t   *fFloatDataPtr;   /**<Float representation of data that should be fitted */
-  UInt_t     *fIntDataPtr;     /**<data that should be fitted */
+  //  mutable  Double_t   *fFloatDataPtr;   /**<Float representation of data that should be fitted */
+  //  mutable  UInt_t     *fIntDataPtr;     /**<data that should be fitted */
+  mutable const Double_t   *fFloatDataPtr;   /**<Float representation of data that should be fitted */
+  mutable const unsigned int     *fIntDataPtr;     /**<data that should be fitted */
+  //  mutable const UInt_t     *fIntDataPtr;     /**<data that should be fitted */
+  
   double     fSampleFrequency; /**<The ADC sample frequency in MHz used under data taking */
   double     fDTofGuess;       /**<Initial guess for t0*/
   double     fDAmplGuess;      /**<Initial guess for amplitude*/
index 901c10a7e066251ca3781a86ad9d37075b93aaaa..3e67ddffe621512fa219ff38117c8fbf097f47ad 100644 (file)
 #include "AliHLTPHOSRawAnalyzerComponent.h"
 #include "AliHLTPHOSRcuCellEnergyDataStruct.h"
 #include "AliHLTPHOSRcuChannelDataStruct.h"
-#include "AliHLTDDLDecoder.h"
-#include "AliHLTAltroData.h"
 #include "AliHLTPHOSMapper.h"
-#include "AliHLTAltroBunch.h"
 #include "AliHLTPHOSSanityInspector.h"
 #include "AliHLTPHOSBaseline.h"
 #include "TFile.h"
 #include "TTree.h"
 #include "TClonesArray.h"
-//using namespace std;
 
-AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTPHOSRcuProcessor(), fAnalyzerPtr(0), 
-                                                                fSendChannelData(kFALSE),fOutPtr(0), fMapperPtr(0), fDecoderPtr(0), 
-                                                                fAltroDataPtr(0), fAltroBunchPtr(0), fUseBaselineSubtraction(false), fDebugCnt(0)
+#include  "AliAltroDecoder.h"    // decoder for altro payload
+#include  "AliAltroData.h"       // container for altro payload
+#include  "AliAltroBunch.h"      // container for altro bunches
+
+
+AliHLTPHOSRawAnalyzerComponent::AliHLTPHOSRawAnalyzerComponent():AliHLTPHOSRcuProcessor(), 
+                                                                fAnalyzerPtr(0), 
+                                                                fSendChannelData(kFALSE),
+                                                                fOutPtr(0), 
+                                                                fMapperPtr(0), 
+                                                                fUseBaselineSubtraction(false), 
+                                                                fDecoderPtr(0),  
+                                                                fAltroDataPtr(0),
+                                                                fAltroBunchPtr(0)   
+                                                                //                                                              fRawMemoryReader(0), fPHOSRawStream(0) 
 {
   //comment
   fMapperPtr = new AliHLTPHOSMapper();
-  
-} 
+  fAltroDataPtr = new AliAltroData();
+  fAltroBunchPtr = new AliAltroBunch();
+  fDecoderPtr = new AliAltroDecoder();
+  fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+}
 
 
 AliHLTPHOSRawAnalyzerComponent::~AliHLTPHOSRawAnalyzerComponent()
@@ -95,9 +107,7 @@ AliHLTPHOSRawAnalyzerComponent::GetOutputDataSize(unsigned long& constBase, doub
 }
 
 
-//int 
-//AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventD  //  AliHLTPHOSRcuCellEnergyDebugDataStruct* fOutPtr;ata& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, 
-//                                      AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
+
 int 
 AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, 
                                         AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
@@ -108,47 +118,25 @@ AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData
   UInt_t tSize            = 0;
   Float_t baseline = 0;
   AliHLTUInt8_t* outBPtr;
-  //AliHLTAltroBunch *bunchPtr;
   outBPtr = outputPtr;
   const AliHLTComponentBlockData* iter = NULL; 
   unsigned long ndx;
-  
-  //  printf("\n% \n", ndx);
 
-  //  cout << "evtData block count =   " <<  evtData.fBlockCnt  << endl;
-
-
-  fDebugCnt++;
-  
+  //  fDebugCnt++;
 
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
-      //      cout <<"TP0"<< endl;
-     Int_t tmpChannelCnt     = 0;
+      Int_t tmpChannelCnt     = 0;
       iter = blocks+ndx;
       mysize = 0;
       offset = tSize;
-      //      cout <<"TP1"<< endl;
-      //Int_t *dt = (Int_t*)(reinterpret_cast<UChar_t*>( iter->fPtr ));
-      //      cout <<"TP2"<< endl;
       Int_t crazyness = 0;
 
       if ( iter->fDataType != AliHLTPHOSDefinitions::fgkDDLPackedRawDataType )
        {
-         //      cout <<"WARNING: not AliHLTPHOSDefinitions::fgkDDLPackedRawDataType  "  << endl;
-         //      cout <<  "equippment "<< fkEquippmentID << " Event count =" <<  fDebugCnt   <<"    AliHLTPHOSRawAnalyzerComponent::DoEvent ,  ERROR"<< endl;
          continue; 
-
-         //      if(fPhosEventCount < 10)
-         //        { 
-         //          continue; //!!!!! Commented out to read TPC data, remember to put back
-         //        }
-       }
-      else
-       {
-         //      cout << "equippment " << fkEquippmentID << " Event count =" <<  fDebugCnt  << " Dat type is:  AliHLTPHOSDefinitions::fgkDDLPackedRawDataType" << endl;
        }
       
       if( fPhosEventCount%100 == 0)
        {
@@ -157,23 +145,8 @@ AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData
        } 
 
     
-      /*
-      printf("\Common data header for equippment %d\n",  fkEquippmentID);
-      printf("Event#: %d -- RCU X: %d - RCU Z: %d\n\n", fPhosEventCount, fRcuX, fRcuZ);
-
-      for(Int_t n = 0; n < 8; n++)
-       {
-         printf("CDH(%d): 0x%X\n", n, dt[n]);
-       }
-
-      printf("\n");    
-      */
-    
-
       fDecoderPtr->SetMemory(reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize);
-      //    fDecoderPtr->SetMemory2(reinterpret_cast<UChar_t*>( iter->fPtr ), iter->fSize);
       fDecoderPtr->Decode();
-  
       fOutPtr =  (AliHLTPHOSRcuCellEnergyDataStruct*)outBPtr;
       fOutPtr->fRcuX = fRcuX;
       fOutPtr->fRcuZ = fRcuZ;
@@ -181,38 +154,45 @@ AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData
       
       while( fDecoderPtr->NextChannel(fAltroDataPtr) == true )
        {
-         
-         //      if(fAltroDataPtr->fDataSize != 72)
-         //      if(fAltroDataPtr->fDataSize != 142)
-         if(fAltroDataPtr->fDataSize != (fNTotalSamples +2))
+         if(fAltroDataPtr->GetDataSize() != (fNTotalSamples +2))
            {
-             cout << "Error, fDataSize = " << fAltroDataPtr->fDataSize << endl;
+             cout << "Error, fDataSize = " << fAltroDataPtr->GetDataSize() << endl;
              continue;
            }
 
-         crazyness = fSanityInspectorPtr->CheckInsanity(fAltroDataPtr->fData, fAltroDataPtr->fDataSize - 2);
-         fAnalyzerPtr->SetData(fAltroDataPtr->fData);  //  AliHLTPHOSRcuCellEnergyDebugDataStruct* fOutPtr;
-         fAnalyzerPtr->Evaluate(0, fAltroDataPtr->fDataSize -2);  
+         crazyness = fSanityInspectorPtr->CheckInsanity(fAltroDataPtr->GetData(), fAltroDataPtr->GetDataSize() - 2);
+
+         fAnalyzerPtr->SetData(fAltroDataPtr->GetData());  
+         fAnalyzerPtr->Evaluate(0, fAltroDataPtr->GetDataSize() -2);  
+         fOutPtr->fValidData[tmpChannelCnt].fZ  = fMapperPtr->hw2geomapPtr[fAltroDataPtr->GetHadd()].zRow;
+         fOutPtr->fValidData[tmpChannelCnt].fX  = fMapperPtr->hw2geomapPtr[fAltroDataPtr->GetHadd()].xCol; 
+         fOutPtr->fValidData[tmpChannelCnt].fGain  = fMapperPtr->hw2geomapPtr[fAltroDataPtr->GetHadd()].gain; 
+
 
-         fOutPtr->fValidData[tmpChannelCnt].fZ  = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].zRow;
-         fOutPtr->fValidData[tmpChannelCnt].fX  = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].xCol; 
-         fOutPtr->fValidData[tmpChannelCnt].fGain  = fMapperPtr->hw2geomapPtr[fAltroDataPtr->fHadd].gain; 
          if(fUseBaselineSubtraction)
-          {
-            baseline = fBaselines[fOutPtr->fValidData[tmpChannelCnt].fX][fOutPtr->fValidData[tmpChannelCnt].fZ][ fOutPtr->fValidData[tmpChannelCnt].fGain];
-          }
+           {
+             baseline = fBaselines[fOutPtr->fValidData[tmpChannelCnt].fX][fOutPtr->fValidData[tmpChannelCnt].fZ][ fOutPtr->fValidData[tmpChannelCnt].fGain];
+           }
+
+         
          fOutPtr->fValidData[tmpChannelCnt].fEnergy  = (float)fAnalyzerPtr->GetEnergy() - baseline;
+
+
          fOutPtr->fValidData[tmpChannelCnt].fTime    = (float)fAnalyzerPtr->GetTiming();
+
+
          fOutPtr->fValidData[tmpChannelCnt].fCrazyness = (int)crazyness;
+
+         const UInt_t *tmpData =  fAltroDataPtr->GetData();
+
          for(Int_t sample = 0; sample < fNTotalSamples; sample++)
            {
-             //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-             (fOutPtr->fValidData[tmpChannelCnt].fData)[sample] = fAltroDataPtr->fData[sample] - (int)baseline;
+             (fOutPtr->fValidData[tmpChannelCnt].fData)[sample] = tmpData[sample] - (int)baseline;
            }
          
          tmpChannelCnt ++;
-         
        }
+
       fOutPtr->fCnt =  tmpChannelCnt;
       mysize += sizeof(AliHLTPHOSRcuCellEnergyDataStruct);
 
@@ -220,11 +200,11 @@ AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData
       FillBlockData( bd );
       bd.fOffset = offset;
       bd.fSize = mysize;
+
       bd.fDataType = AliHLTPHOSDefinitions::fgkCellEnergyDataType;
       bd.fSpecification = 0xFFFFFFFF;
       outputBlocks.push_back( bd );
+
       tSize += mysize;
       outBPtr += mysize;
       
@@ -238,15 +218,11 @@ AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData
          return EMSGSIZE;
        }
        
-      //   fDecoderPtr->GetFailureRate();
-     
     }
-  
 
+  
   fPhosEventCount++; 
 
-  //  cout << "event cunt =" <<   fPhosEventCount << endl;
-
   if(fPrintInfo == kTRUE)
     {
      if(fPhosEventCount%fPrintInfoFrequncy == 0)
@@ -262,12 +238,9 @@ AliHLTPHOSRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData
 int
 AliHLTPHOSRawAnalyzerComponent::DoInit( int argc, const char** argv )
 {
-  //comment
+  //See base class for documentation
   cout <<"AliHLTPHOSRawAnalyzerComponent::DoInit( int argc, const char** argv ) "<< endl;
-  fAltroDataPtr = new AliHLTAltroData();
-  fAltroBunchPtr = new AliHLTAltroBunch();
-  fDecoderPtr = new AliHLTDDLDecoder();
-  fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+
   fSendChannelData = kFALSE;
   fPrintInfo = kFALSE;
   Reset();
@@ -297,9 +270,7 @@ AliHLTPHOSRawAnalyzerComponent::DoInit( int argc, const char** argv )
       iResult = 0; 
       //      fRawMemoryReader->SetEquipmentID(fkEquippmentID);
     }
-  
-  //  return iResult;
-  //  return 0;
+
   return iResult;
 }
 
index f6831950df3dcad54fc6e821c382e974e81f2e12..e6e8750ad5afae542a24e8bbc212f06ac16c2c3b 100644 (file)
@@ -9,10 +9,11 @@ class AliHLTPHOSRawAnalyzer;
 class AliHLTPHOSRcuCellEnergyDataStruct;
 class AliHLTPHOSRcuChannelDataStruct;
 class AliHLTPHOSMapper;
-class AliHLTDDLDecoder;
-class AliHLTAltroData;
-class AliHLTAltroBunch;
 class AliHLTPHOSSanityInspector;
+class  AliAltroDecoder;      // decoder for altro payload
+class  AliAltroData;         // container for altro payload
+class  AliAltroBunch;        // container for altro bunches
+
 
 class AliHLTPHOSRawAnalyzerComponent: public AliHLTPHOSRcuProcessor
 {
@@ -41,18 +42,16 @@ class AliHLTPHOSRawAnalyzerComponent: public AliHLTPHOSRcuProcessor
   Bool_t fSendChannelData;       /**<wether or not to send raw data from the component into shared memory*/
   Double_t fTmpChannelData[ALTRO_MAX_SAMPLES];                        /**<temporary variable to store raw samples from a single altro channel*/
   Double_t fMaxValues[N_MODULES][N_ZROWS_MOD][N_XCOLUMNS_MOD][N_GAINS]; /**<array to store cell energies*/
-  // AliHLTPHOSRcuCellEnergyDataStruct* fOutPtr;         /**<Pointer to outputbuffer to write results from the component into shared memory*/
 
   AliHLTPHOSRcuCellEnergyDataStruct* fOutPtr;  //comment
-  AliHLTPHOSMapper *fMapperPtr; //comment
-  AliHLTDDLDecoder *fDecoderPtr; //comment
-  AliHLTAltroData  *fAltroDataPtr; //comment
-  AliHLTAltroBunch *fAltroBunchPtr; //comment
+  AliHLTPHOSMapper *fMapperPtr; //Mapping from harware address to geometrical address
   AliHLTPHOSSanityInspector *fSanityInspectorPtr; //comment
   Bool_t fUseBaselineSubtraction; //comment
   Float_t fBaselines[N_XCOLUMNS_RCU][N_ZROWS_RCU][N_GAINS]; //comment
-  int fDebugCnt; //comment
-  
+  //  int fDebugCnt; //comment
+  AliAltroDecoder *fDecoderPtr;           // decoder for altro payload
+  AliAltroData    *fAltroDataPtr;         // container for altro payload
+  AliAltroBunch   *fAltroBunchPtr;        // container for altro bunches
 };
 #endif
 
index f5936f29be9a7e4d3a3e2b89fa8f2552b2975f80..b250a58c0b5828da2a13df3047596a3b204480c8 100644 (file)
@@ -127,6 +127,7 @@ AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(Int_t /*start*/, Int_t length)
        {  
          //      fDAmpl += fAVectorPtr[i]*fFloatDataPtr[i];    
          fDAmpl += fAVectorPtr[i]*fIntDataPtr[i];   
+         
        }
 
       for(int i=0; i < tmpLength; i++)
@@ -137,10 +138,9 @@ AliHLTPHOSRawAnalyzerPeakFinder::Evaluate(Int_t /*start*/, Int_t length)
       
       if(fDAmpl > 900)
        {
-         //      Double_t tmpMax = GetMaxValue(fFloatDataPtr, tmpLength);
-         //      Double_t tmpMax = GetMaxValue(fIntDataPtr, tmpLength);
-         Double_t tmpMax = MaxValue(fIntDataPtr, tmpLength); 
+
+         Double_t tmpMax = MaxValue(const_cast<unsigned int*>(fIntDataPtr), tmpLength); 
+
          
          if(tmpMax == 1023)
            {
index 84f99e2b4eccbf81a7c9fc65d96266979469221b..2c3e1f1485104e347a126f28e3e87bdc0607f25c 100644 (file)
@@ -93,6 +93,8 @@ AliHLTPHOSRcuDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtDat
                                        AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size,
                                        std::vector<AliHLTComponentBlockData>& outputBlocks)
 {
+  cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP1"  << endl;
+
    //Do event
      
   UInt_t tSize            = 0;
@@ -110,10 +112,12 @@ AliHLTPHOSRcuDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtDat
   outBPtr = outputPtr;
   const AliHLTComponentBlockData* iter = 0; 
   unsigned long ndx; 
+
+ cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP2"  << endl;
   fDigitContainerPtr = (AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr;
   //fDigitMakerPtr->SetDigitContainerStruct(fDigitContainerPtr);
   fDigitMakerPtr->SetDigitContainerStruct((AliHLTPHOSRcuDigitContainerDataStruct*)outBPtr);
-
+ cout << "AliHLTPHOSRcuDigitMakerComponent::DoEven TP3"  << endl;
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
       iter = blocks+ndx;
@@ -124,6 +128,9 @@ AliHLTPHOSRcuDigitMakerComponent::DoEvent(const AliHLTComponentEventData& evtDat
          continue;
 
        }
+      
+      
+
       digitCount = fDigitMakerPtr->MakeDigits(reinterpret_cast<AliHLTPHOSRcuCellEnergyDataStruct*>(iter->fPtr));
     }
   fEvtCnt++;
index 633582d8a5aff95797dc62f79581ea7a8ad891f0..3023781ffbf266a146aecbba6d89f1e6a9c334b8 100644 (file)
  **************************************************************************/
 #include "AliHLTPHOSRcuProcessor.h"
 
-AliHLTPHOSRcuProcessor::AliHLTPHOSRcuProcessor(): fkEquippmentID(0)
+AliHLTPHOSRcuProcessor::AliHLTPHOSRcuProcessor():AliHLTPHOSProcessor(), 
+                                                fkEquippmentID(0)
 {
-
+  //  cout << "AliHLTPHOSRcuProcessor::AliHLTPHOSRcuProcessor() "<< endl;
 }
 
 AliHLTPHOSRcuProcessor::~AliHLTPHOSRcuProcessor()
index e6f917998bcdf75563c07159b3c42c4536b9bab7..11dae5e0f46552732718e2d1e3adff022c146138 100644 (file)
 
 ClassImp(AliHLTPHOSRcuTreeMaker);
 
+void
+AliHLTPHOSRcuTreeMaker::FUCK()
+{
+  cout << "AliHLTPHOSTreeMaker::FUCK"  << endl;
+}
+
 AliHLTPHOSRcuTreeMaker::AliHLTPHOSRcuTreeMaker() :
   AliHLTPHOSBase(),
   fDigitArrayPtr(0),
index 0e663bc41f1f9133a371f0fdb330db0c88044b0f..fa76e7292f3018f2f8618e65fcf5a55aeaa570db 100644 (file)
@@ -25,6 +25,8 @@ class AliHLTPHOSRcuDigitContainerDataStruct;
 class TClonesArray;
 //class TTree;
 
+
+
 class AliHLTPHOSRcuTreeMaker : public AliHLTPHOSBase
 {
 public:
@@ -33,7 +35,7 @@ public:
   ~AliHLTPHOSRcuTreeMaker();
 
   Int_t MakeDigitArray(AliHLTPHOSRcuDigitContainerDataStruct* digitContainer, Int_t nDigits);
-
+  void FUCK();
   void FillDigitTree();
   
   void ResetDigitTree() { fDigitTreePtr->Reset(); }
index 13edabecdcc71b4671c3ff8aa574898644e1189e..abda344e86c932e9cc15824982fc505110577d88 100644 (file)
@@ -16,6 +16,9 @@
 
  
 #include "AliHLTPHOSRcuTreeMakerComponent.h"
+
+#include "AliHLTPHOSRcuDigitContainerDataStruct.h"
+
 #include "AliHLTPHOSRcuTreeMaker.h"
 #include "AliHLTPHOSRcuProcessor.h"
 #include "AliHLTPHOSDigitDataStruct.h"
@@ -34,7 +37,8 @@ AliHLTPHOSRcuTreeMakerComponent gAliHLTPHOSRcuTreeMakerComponent;
 AliHLTPHOSRcuTreeMakerComponent::AliHLTPHOSRcuTreeMakerComponent() :
   AliHLTPHOSRcuProcessor(),
   fDigitTreePtr(0),
-  fEventCount(0),
+  fTreeMakerPtr(0), 
+  //  fEventCount(0),
   fWriteInterval(1000)
 {
   //comment
@@ -114,6 +118,8 @@ AliHLTPHOSRcuTreeMakerComponent::DoEvent(const AliHLTComponentEventData& evtData
                                        std::vector<AliHLTComponentBlockData>& /*outputBlocks*/)
 
 {
+
+  cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0 " << endl;
   //Do event
 
   Bool_t digitEvent;
@@ -122,34 +128,86 @@ AliHLTPHOSRcuTreeMakerComponent::DoEvent(const AliHLTComponentEventData& evtData
 
   const AliHLTComponentBlockData* iter = 0;
   unsigned long ndx;
-
+ cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.1 " << endl;
   for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
       iter = blocks + ndx;
-
+      cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.2 " << endl;
       if ( iter->fDataType == AliHLTPHOSDefinitions::fgkAliHLTDigitDataType )
 
         {
-          digitEvent = true;
-          nDigits  = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSRcuDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
-          totalDigits += nDigits;
-         //cout << totalDigits << endl;
-          continue;
+          cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.2 " << endl;
+          digitEvent = true;
+          cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3 " << endl;
+
+          //      fTreeMakerPtr = new AliHLTPHOSRcuTreeMaker();
+
+          if( iter->fPtr == 0)
+            {
+              cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.1 " << endl;
+              cout << "ERROR" << endl;
+              cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.2 " << endl;
+            }
+          else
+            {
+             cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.3 " << endl;
+             
+             //              fTreeMakerPtr = new AliHLTPHOSRcuTreeMaker();
+             
+             if(fTreeMakerPtr == 0 )
+               {
+                 //      cout << "FUCK" << endl;
+               }  
+             else
+               {
+                 cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.4, -1 " << endl;
+                 //          nDigits  = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSRcuDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
+                 //
+
+                 nDigits  = fTreeMakerPtr->MakeDigitArray ( reinterpret_cast<AliHLTPHOSRcuDigitContainerDataStruct*> ( iter->fPtr ), totalDigits );
+
+                 //      AliHLTPHOSRcuDigitContainerDataStruct *tmp = new  AliHLTPHOSRcuDigitContainerDataStruct();
+                 
+                 //      nDigits  = fTreeMakerPtr->MakeDigitArray(tmp, totalDigits );
+
+                 //  nDigits  = fTreeMakerPtr->MakeDigitArray ( (AliHLTPHOSRcuDigitContainerDataStruct*) ( iter->fPtr ), totalDigits );
+
+                 fTreeMakerPtr->FUCK();
+                 cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.3.4 " << endl;
+            
+               }
+            }
+
+          cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.4 " << endl;
+          totalDigits += nDigits;
+          //cout << totalDigits << endl;
+          cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.5 " << endl;
+          continue;
         }
+     
       if ( iter->fDataType == AliHLTPHOSDefinitions::fgkAliHLTClusterDataType )
         {
-          //
+         cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP0.6 " << endl;
+       //
         }
     }
-  fEventCount++;
+
+  //  fEventCount++;
+  cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP1 " << endl;
+  fPhosEventCount++;
+
   fTreeMakerPtr->FillDigitTree();
-  
-  if(fEventCount%fWriteInterval == 0)
+  cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP2 " << endl;  
+  //  if(fEventCount%fWriteInterval == 0)
+  if(fPhosEventCount%fWriteInterval == 0)
     {
+      cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP3 " << endl;
       Write();
+      cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP4 " << endl;
       ResetTrees();
+      cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP5 " << endl;
     }
-
+  cout << "AliHLTPHOSRcuTreeMakerComponent::DoEvent TP6 " << endl;
 return 0;
 
 }
@@ -176,17 +234,17 @@ AliHLTPHOSRcuTreeMakerComponent::DoInit ( int argc, const char** argv )
 
   fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
     
-  fstream runNbFile;
+  //  fstream runNbFile;
   //Int_t newRunNb;
-  runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
-  runNbFile >> fRunNb;
-  runNbFile.close();
+  //  runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
+  //  runNbFile >> fRunNb;
+  //  runNbFile.close();
   /*  newRunNb = fRunNb + 1;
   runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
   runNbFile << newRunNb;
   runNbFile.close();*/
   
-  cout << endl << "Run number is: " << fRunNb  << "  -- Check that this is correct!!!\n";
+  cout << endl << "Run number is: " << fRunNumber  << "  -- Check that this is correct!!!\n" << endl;
 
   return 0;
   
@@ -207,7 +265,8 @@ AliHLTPHOSRcuTreeMakerComponent::Write()
   cout << "Writing file...";
 
   char filename [256];
-  sprintf(filename, "%s/run%d_%d_digitTree_mod%d_rcuX%d_rcuZ%d_.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1), fModuleID, fRcuX, fRcuZ);
+  //  sprintf(filename, "%s/run%d_%d_digitTree_mod%d_rcuX%d_rcuZ%d_.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1), fModuleID, fRcuX, fRcuZ);
+  sprintf(filename, "%s/run%d_%d_digitTree_mod%d_rcuX%d_rcuZ%d_.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval - 1), fModuleID, fRcuX, fRcuZ);
   TFile *outfile = new TFile(filename,"recreate");
   fDigitTreePtr->Write();
   delete outfile;
@@ -225,9 +284,7 @@ AliHLTPHOSRcuTreeMakerComponent::ResetTrees()
   fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
 }
   
-  
-  
-  
+
   
   
   
index 3396f6181a22b852a2cc8e92649fd77928936fb7..639ef55759ea411ae4da29043965bb2293711dd6 100644 (file)
@@ -49,6 +49,8 @@ class AliHLTPHOSRcuTreeMakerComponent : public AliHLTPHOSRcuProcessor
   
   AliHLTComponent* Spawn();
 
+
+  void FUCK();
   void Write(); 
   void ResetTrees();
    
@@ -63,9 +65,11 @@ class AliHLTPHOSRcuTreeMakerComponent : public AliHLTPHOSRcuProcessor
  private:  
   AliHLTPHOSRcuTreeMaker *fTreeMakerPtr;  //comment
   TTree *fDigitTreePtr; //comment
-  UInt_t fEventCount; //comment
+
+
+  //  UInt_t fEventCount; //comment
   UInt_t fWriteInterval; //comment
-  UInt_t fRunNb; //comment
+  //  UInt_t fRunNb; //comment
   char *fDirectory; //comment
  
   static const AliHLTComponentDataType fgkInputDataTypes[];     //HLT input data type
index 53e2de5520d1440a114f0fc4e3631ffccf688344..e5b4c2e6ee4a1b4c5eea0d9021e619be59030e44 100644 (file)
@@ -14,7 +14,6 @@
  **************************************************************************/
 
 #include "AliHLTPHOSSanityInspector.h"
-#include "AliHLTAltroData.h"
 #include "Rtypes.h"
 
 ClassImp(AliHLTPHOSSanityInspector);
@@ -34,10 +33,11 @@ AliHLTPHOSSanityInspector::~AliHLTPHOSSanityInspector()
 }
 
 
-Int_t  
-AliHLTPHOSSanityInspector::CheckInsanity(UInt_t* data, Int_t N)
+
+const Int_t  
+AliHLTPHOSSanityInspector::CheckInsanity(const UInt_t* data, const Int_t N) const
 {
-   //comment
+  //comment
   for(Int_t i = 1; i < N; i++)
     {
       if((((Int_t)data[i] - (Int_t)data[i-1]) > fMaxDifference) || (((Int_t)data[i-1] - (Int_t)data[i]) > fMaxDifference))
@@ -46,39 +46,15 @@ AliHLTPHOSSanityInspector::CheckInsanity(UInt_t* data, Int_t N)
   return 0;
 }
 
-Int_t
-AliHLTPHOSSanityInspector::CheckInsanity(Int_t* data, Int_t N)
-{
-   //comment
-  for(Int_t i = 1; i < N; i++)
-  {
-    if((((Int_t)data[i] - (Int_t)data[i-1]) > fMaxDifference) || (((Int_t)data[i-1] - (Int_t)data[i]) > fMaxDifference))
-      return 1;
-  }
-  return 0;
-}
 
 
 Int_t 
 AliHLTPHOSSanityInspector::CheckAndHealInsanity(UInt_t* data, Int_t N)
-//
+  //
 {
-   //comment
+  //comment
   Int_t crazyness = 0;
-  
-  /*  if(((data[0] - data[1]) > fMaxDifference) || ((data[1] - data[0]) > fMaxDifference))
-    {
-      if(((data[1] - data[2]) > fMaxDifference) || ((data[2] - data[1]) > fMaxDifference))
-       {
-         if(((data[2] - data[3]) > fMaxDifference) || ((data[3] - data[2]) > fMaxDifference))
-           {
-             return false;   //To much crazyness!
-           }
-         data[1] = (data[2] + data[0])/2;
-         crazyness++;
-       }
-    }
-  */
+
   if(N > 3)
     {
       //Require a stable start 
@@ -86,25 +62,8 @@ AliHLTPHOSSanityInspector::CheckAndHealInsanity(UInt_t* data, Int_t N)
        return -1;
       if((((Int_t)data[1] - (Int_t)data[2]) > fMaxDifference) || (((Int_t)data[2] - (Int_t)data[1]) > fMaxDifference))
        return -1;
-      /*
-       for(Int_t i = 2; i < altroData->fDataSize - 3; i++)
-       {
-       if(((data[i] - data[i+1]) > fMaxDifference) || ((data[i+1] - data[i]) > fMaxDifference))
-       {
-       if(((data[i+1] - data[i+2]) > fMaxDifference) || ((data[i+2] - data[i+1]) > fMaxDifference))
-       {
-       if(((data[i+2] - data[i+3]) > fMaxDifference) || ((data[i+3] - data[i+2]) > fMaxDifference))
-       {
-       return false;  //To0 crazy
-       }
-       data[i+1] = (data[i+2] + data[i])/2;
-       crazyness++;
-       }
-       else 
-       return false;   
-       }
-       }
-      */
+
+
       for(Int_t i = 2; i < N - 3; i++)
        {
          if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
@@ -154,96 +113,66 @@ AliHLTPHOSSanityInspector::CheckAndHealInsanity(UInt_t* data, Int_t N)
   
 }
 
+
+
 Int_t 
 AliHLTPHOSSanityInspector::CheckAndHealInsanity(Int_t* data, Int_t N)
-    //
 {
-   //comment
+  //comment
   Int_t crazyness = 0;
-  
-  /*  if(((data[0] - data[1]) > fMaxDifference) || ((data[1] - data[0]) > fMaxDifference))
-  {
-  if(((data[1] - data[2]) > fMaxDifference) || ((data[2] - data[1]) > fMaxDifference))
-  {
-  if(((data[2] - data[3]) > fMaxDifference) || ((data[3] - data[2]) > fMaxDifference))
-  {
-  return false;   //To much crazyness!
-}
-  data[1] = (data[2] + data[0])/2;
-  crazyness++;
-}
-}
-  */
+
   if(N > 3)
-  {
-      //Require a stable start 
-    if((((Int_t)data[0] - (Int_t)data[1]) > fMaxDifference) || (((Int_t)data[1] - (Int_t)data[0]) > fMaxDifference))
-      return -1;
-    if((((Int_t)data[1] - (Int_t)data[2]) > fMaxDifference) || (((Int_t)data[2] - (Int_t)data[1]) > fMaxDifference))
-      return -1;
-      /*
-    for(Int_t i = 2; i < altroData->fDataSize - 3; i++)
-    {
-    if(((data[i] - data[i+1]) > fMaxDifference) || ((data[i+1] - data[i]) > fMaxDifference))
-    {
-    if(((data[i+1] - data[i+2]) > fMaxDifference) || ((data[i+2] - data[i+1]) > fMaxDifference))
-    {
-    if(((data[i+2] - data[i+3]) > fMaxDifference) || ((data[i+3] - data[i+2]) > fMaxDifference))
     {
-    return false;  //To0 crazy
-  }
-    data[i+1] = (data[i+2] + data[i])/2;
-    crazyness++;
-  }
-    else 
-    return false;   
-  }
-  }
-      */
-    for(Int_t i = 2; i < N - 3; i++)
-    {
-      if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
-      {
-       i++;
-       if((((Int_t)data[i] -(Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
+      if((((Int_t)data[0] - (Int_t)data[1]) > fMaxDifference) || (((Int_t)data[1] - (Int_t)data[0]) > fMaxDifference))
+       return -1;
+      if((((Int_t)data[1] - (Int_t)data[2]) > fMaxDifference) || (((Int_t)data[2] - (Int_t)data[1]) > fMaxDifference))
+       return -1;
+
+
+      for(Int_t i = 2; i < N - 3; i++)
        {
-         i++;
          if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
-         {
-           return -2;  //Too crazy
-         }
-         data[i-1] = ((Int_t)data[i] + (Int_t)data[i-2])/2;
-         crazyness++;
+           {
+             i++;
+             if((((Int_t)data[i] -(Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
+               {
+                 i++;
+                 if((((Int_t)data[i] - (Int_t)data[i+1]) > fMaxDifference) || (((Int_t)data[i+1] - (Int_t)data[i]) > fMaxDifference))
+                   {
+                     return -2;  //Too crazy
+                   }
+                 data[i-1] = ((Int_t)data[i] + (Int_t)data[i-2])/2;
+                 crazyness++;
+               }
+             else 
+               return -3;    //Two spikes in a row? 
+           }
        }
-       else 
-         return -3;    //Two spikes in a row? 
-      }
-    }
       
       
       
-    if((((Int_t)data[N - 3] -(Int_t) data[N - 2]) > fMaxDifference) || 
-         (((Int_t)data[N - 2] - (Int_t)data[N - 3]) > fMaxDifference))
-    {
-      if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) || 
-           (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
-      {
-       data[N - 2] = ((Int_t)data[N - 3] +  (Int_t)data[N - 1])/2;
-       return crazyness++;
-      }
-      return -4;
+      if((((Int_t)data[N - 3] -(Int_t) data[N - 2]) > fMaxDifference) || 
+        (((Int_t)data[N - 2] - (Int_t)data[N - 3]) > fMaxDifference))
+       {
+         if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) || 
+            (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
+           {
+             data[N - 2] = ((Int_t)data[N - 3] +  (Int_t)data[N - 1])/2;
+             return crazyness++;
+           }
+         return -4;
 
-    }
+       }
       
-    if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) || 
-         (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
-    {
+      if((((Int_t)data[N - 2] - (Int_t)data[N - 1]) > fMaxDifference) || 
+        (((Int_t)data[N - 1] - (Int_t)data[N - 2]) > fMaxDifference))
+       {
          //      (Int_t)data[N - 3] = (Int_t)data[N - 4] -(Int_t) data[N - 5] + (Int_t)data[N-4];
-      data[N - 1] = data[N - 2];
-      return crazyness++;
-    }
+         data[N - 1] = data[N - 2];
+         return crazyness++;
+       }
       
-  }
+    }
   
   return crazyness;
   
index cad2037fdd41bf0f21ffc1b665f69df9b1f11e1c..3f8eb8b5929a967e0562dad99827cb6fc15adf4c 100644 (file)
 #define ALIHLTPHOSSANITYINSPECTOR_H
 
 #include "AliHLTPHOSBase.h"
-//#include "AliHLTAltroData.h"
 #include "Rtypes.h"
 
-class AliHLTAltroData;
-
 class AliHLTPHOSSanityInspector : public AliHLTPHOSBase
 {
   
 public:
   AliHLTPHOSSanityInspector();
-  
   virtual ~AliHLTPHOSSanityInspector();
-   
-  Int_t CheckInsanity(UInt_t* data, Int_t nSamples);
-  Int_t CheckInsanity(Int_t* data, Int_t nSamples);
-  
+  const Int_t CheckInsanity(const UInt_t* data, const Int_t nSamples) const;
   Int_t CheckAndHealInsanity(UInt_t* data, Int_t nSamples);  //Not completely reliable
   Int_t CheckAndHealInsanity(Int_t* data, Int_t nSamples);  //Not completely reliable
-
   void SetMaxDifference(Int_t maxDiff) { fMaxDifference = maxDiff; }
     
 private:
index fd99f42c1d870b60c777b4b7e944bcacea591ca2..384591d8b220fb9a6e3b5ba0ca976826751d44c9 100644 (file)
@@ -25,6 +25,8 @@
 
 ClassImp(AliHLTPHOSTreeMaker);
 
+
+
 AliHLTPHOSTreeMaker::AliHLTPHOSTreeMaker() :
   AliHLTPHOSBase(),
   fDigitArrayPtr(0),
@@ -38,8 +40,10 @@ AliHLTPHOSTreeMaker::AliHLTPHOSTreeMaker() :
 
 }
 
+
 AliHLTPHOSTreeMaker::~AliHLTPHOSTreeMaker()
 {
+
 }
 
 Int_t
index 4ed127ab9a95b62926d20f99f1357840203276d1..37e11fa0eb7a523fe035ba62e6aeaf7d91b243e3 100644 (file)
@@ -34,6 +34,7 @@ public:
 
   Int_t MakeDigitArray(AliHLTPHOSDigitContainerDataStruct* digitContainer, Int_t nDigits);
 
+
   void FillDigitTree();
   
   void ResetDigitTree() { fDigitTreePtr->Reset(); }
index 1abbf6b4f2ba78dbb4e1285f73e71095c16913f4..29851332fbbaffc8f81f28b218fd2c6e2750fdd9 100644 (file)
@@ -34,7 +34,7 @@ AliHLTPHOSTreeMakerComponent gAliHLTPHOSTreeMakerComponent;
 AliHLTPHOSTreeMakerComponent::AliHLTPHOSTreeMakerComponent() :
   AliHLTPHOSProcessor(),
   fDigitTreePtr(0),
-  fEventCount(0),
+  //  fEventCount(0),
   fWriteInterval(1000)
 {
   //comment
@@ -51,7 +51,13 @@ AliHLTPHOSTreeMakerComponent::Deinit()
   //comment
   cout << "Printing file...";
   char filename [50];
-  sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval));
+
+  //  sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval));
+
+  //  sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fEventCount/fWriteInterval));
+ sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval));
+
+
   TFile *outfile = new TFile(filename,"recreate");
   fDigitTreePtr->Write();
   delete outfile;
@@ -134,10 +140,12 @@ AliHLTPHOSTreeMakerComponent::DoEvent(const AliHLTComponentEventData& evtData, c
           //
         }
     }
-  fEventCount++;
+
+  fPhosEventCount++;
+
   fTreeMakerPtr->FillDigitTree();
   
-  if(fEventCount%fWriteInterval == 0)
+  if( (fPhosEventCount%fWriteInterval == 0 ) && (fPhosEventCount != 0))
     {
       Write();
       ResetTrees();
@@ -168,18 +176,9 @@ AliHLTPHOSTreeMakerComponent::DoInit ( int argc, const char** argv )
     }
 
   fTreeMakerPtr->SetDigitTree(fDigitTreePtr);
-    
-  fstream runNbFile;
-  //Int_t newRunNb;
-  runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
-  runNbFile >> fRunNb;
-  runNbFile.close();
-  /*  newRunNb = fRunNb + 1;
-  runNbFile.open("/opt/HLT-public/rundir/runNumber.txt");
-  runNbFile << newRunNb;
-  runNbFile.close();*/
-  
-  cout << endl << "Run number is: " << fRunNb  << "  -- Check that this is correct!!!\n";
+  cout << endl << "Run number is: " <<  fRunNumber  << "  -- Check that this is correct!!!\n" << endl;
+
+  // fRunNumber
 
   return 0;
   
@@ -199,7 +198,9 @@ AliHLTPHOSTreeMakerComponent::Write()
   //comment
   cout << "Writing file...";
   char filename [256];
-  sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1));
+  //  sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNb,(fEventCount/fWriteInterval - 1));
+  sprintf(filename, "%s/run%d_digitTree_%d.root", fDirectory, fRunNumber,(fPhosEventCount/fWriteInterval - 1));
+
   TFile *outfile = new TFile(filename,"recreate");
   fDigitTreePtr->Write();
   delete outfile;
index 66a655a599bd4680e3b87c0464282d83ec641e6e..2b1878e1a8813f9cdb198257075e0b90c97be7a7 100644 (file)
@@ -62,9 +62,9 @@ class AliHLTPHOSTreeMakerComponent : public AliHLTPHOSProcessor
  private:  
   AliHLTPHOSTreeMaker *fTreeMakerPtr; //comment
   TTree *fDigitTreePtr; //comment
-  UInt_t fEventCount; //comment
+  //  UInt_t fEventCount; //comment
   UInt_t fWriteInterval; //comment
-  UInt_t fRunNb; //comment
+  //  UInt_t fRunNb; //comment
   char *fDirectory; //comment
  
   static const AliHLTComponentDataType fgkInputDataTypes[];     //HLT input data type
index bba709131788809bcc2d9ecbd376c819da1c715b..2ed03d378912b7d1268184cd4a7dc1b222aff2fd 100755 (executable)
@@ -1,9 +1,22 @@
 include Makefile.arch
 
+ROOTLIBS         = `root-config --libs`  -lVMC -lGeom -lEG
+ALIROOTLIBS      = -L$(ALICE_ROOT)/lib/tgt_linux  -lESD -lRAWDatarec -lRAWDatabase -lSTEERBase
 
-MAINO       = testDecoder.$(ObjSuf) AliHLTAltroData.$(ObjSuf)  AliHLTAltroBunch.$(ObjSuf) AliHLTDDLDecoder.$(ObjSuf)
 
-MAINS       = testDecoder.$(SrcSuf) AliHLTAltroData.$(SrcSuf)  AliHLTAltroBunch.$(SrcSuf) AliHLTDDLDecoder.$(SrcSuf)
+#LIBS           = $(LIBS) $(ROOTLIBS) $(ALIROOTLIBS)
+LIBS            = $(ROOTLIBS) $(ALIROOTLIBS)
+
+ROOTINCLUDE      = -I$(ROOTSYS)/include
+ALIROOTINCLUDE   = -I$(ALICE_ROOT)/include  -I$(ALICE_ROOT)/RAW
+INCLUDES        =  $(ROOTINCLUDE) $(ALIROOTINCLUDE)
+
+#MAINO       = testDecoder.$(ObjSuf) AliHLTAltroData.$(ObjSuf)  AliHLTAltroBunch.$(ObjSuf) AliHLTDDLDecoder.$(ObjSuf)
+#MAINS       = testDecoder.$(SrcSuf) AliHLTAltroData.$(SrcSuf)  AliHLTAltroBunch.$(SrcSuf) AliHLTDDLDecoder.$(SrcSuf)
+
+
+MAINO       = testDecoder.$(ObjSuf)
+MAINS       = testDecoder.$(SrcSuf) 
 
 MAIN        = testDecoder$(ExeSuf)
 
@@ -18,7 +31,7 @@ all:            $(PROGRAMS)
 
 
 $(MAIN):       $(MAINO)
-               $(LD) $(LDFLAGS) $^ $(LIBS) $(GLIBS) -lTreePlayer -lMathCore -lThread -lpthread $(OutPutOpt)$(MAIN)
+               $(LD) $(LDFLAGS) $(INCLUDES) $^ $(LIBS) $(GLIBS) -lTreePlayer -lMathCore -lThread -lpthread $(OutPutOpt)$(MAIN)
                @echo "$@ done"
 
 
@@ -34,10 +47,12 @@ distclean:      clean
                -@cd RootShower && $(MAKE) distclean
 
 .SUFFIXES: .$(SrcSuf)
-       
-AliHLTAltroData.$(ObjSuf): AliHLTAltroData.h
-AliHLTDDLDecoder.$(ObjSuf): AliHLTDDLDecoder.h
-testDecoder.$(ObjSuf): AliHLTAltroData.h AliHLTDDLDecoder.h
+
+
+#AliHLTAltroData.$(ObjSuf): AliHLTAltroData.h
+#AliHLTDDLDecoder.$(ObjSuf): AliHLTDDLDecoder.h
+#testDecoder.$(ObjSuf): AliHLTAltroData.h AliHLTDDLDecoder.h
+testDecoder.$(ObjSuf): 
 
 .$(SrcSuf).$(ObjSuf):
-       $(CXX) $(CXXFLAGS) -c $<
+       $(CXX) $(CXXFLAGS) $(INCLUDES) -c $<
index 1be3ef0752dfb4c736e018d439281cd5e363b11f..ea2380304da230ea99e195cf561bf14956956cfa 100755 (executable)
@@ -9,6 +9,7 @@ HeadSuf         = h
 #              -lGeom -lGpad -lGraf -lGuiBld -lGui -lMatrix\
 #              -lRint -lRootAuth  -lThread -lVMC
 
+
 ROOTLIBS       = `root-config --libs --glibs`
 
 ###ALIROOTLIBS = -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) -lESD -lSTEER -lRAWDatarec   -lRAWDatabase 
@@ -17,7 +18,8 @@ ALIROOTLIBS   = -L$(ALIHLT_TOPDIR)/build/lib  -lHLTbase  -lAliHLTPHOS  -L$(ALICE_R
 
 #HLTLIBS               =-L$(ALIHLT_DC_DIR)/lib/Linux-x86_64-debug -lHOMER
 #HLTLIBS               =-L$(ALIHLT_DC_DIR)/lib/Linux-i686/  -lHOMER
-HLTLIBS                =-L$(ALIHLT_DC_DIR)/lib/Linux-x86_64-debug -lHOMER
+#HLTLIBS               =-L$(ALIHLT_DC_DIR)/lib/Linux-x86_64-debug -lHOMER
+HLTLIBS                =-L$(ALIHLT_DC_DIR)/lib/Linux-i686-debug -lHOMER
 
 HOMERINCLUDE   =$(ALIHLT_DC_DIR)/src/Util/HOMER/include 
 
index 5d741a466d6342de7a2b296d52d08043b4c78aaa..bf9c182a72daccae694a8888d5fa086a75fe7aa5 100644 (file)
@@ -1,3 +1,3 @@
-N_SAMPLES 55
+N_SAMPLES 125
 N_PRE_SAMPLES 15
 
index 8e337a5aae9a396086bc816d11d3acf11e83e209..c88258c720f5717a80e6fc30d288767280c31469 100644 (file)
@@ -1,7 +1,7 @@
+#include  "AliAltroDecoder.h"    // decoder for altro payload
+#include  "AliAltroData.h"       // container for altro payload
+#include  "AliAltroBunch.h"      // container for altro bunches
 
-#include "AliHLTDDLDecoder.h"
-
-#include "AliHLTAltroData.h"
 #include "Rtypes.h"
 #include <iostream>
 #include <fstream>
@@ -10,6 +10,7 @@
 #include <time.h>
 #include "stdio.h"
 
+#define MIN_BUNCH_SIZE 0
 
 using namespace std;
 
@@ -22,13 +23,13 @@ int main(int argc, const char** argv)
   clock_t  start;
   clock_t  end;
 
-  AliHLTAltroData altrodata;
-  AliHLTAltroBunch *altrobunchPtr = new AliHLTAltroBunch;
+  AliAltroData altrodata;
+  AliAltroBunch *altrobunchPtr = new AliAltroBunch;
 
   ifstream fin;
   int length;
   
-  AliHLTDDLDecoder *decoder = new AliHLTDDLDecoder();
+  AliAltroDecoder *decoder = new AliAltroDecoder();
   
   fin.open(argv[1], ios::binary);
   
@@ -55,30 +56,35 @@ int main(int argc, const char** argv)
       while(decoder->NextChannel(&altrodata) == true && channelCnt < 10)
        {
          channelCnt ++;
-  decoder->PrintInfo(altrodata, altrodata.fDataSize +4);          
-        
-         if(  altrodata.fDataSize != 0 )
+
+         //      decoder->PrintInfo(altrodata, altrodata.GetDataSize() +4);
+
+         if(  altrodata.GetDataSize() != 0 )
            {
              cnt = 0;
              
              while( altrodata.NextBunch(altrobunchPtr) == true)
                {
-                 printf("\n");
+                 //              printf("\n");
 
-                 if(cnt < 5)
+                 if(altrobunchPtr->GetBunchSize() > MIN_BUNCH_SIZE)
                    { 
                      printf("\n");
                      cout <<"cnt = "<< cnt <<endl;
-                     cout << "altrobunch.fDataSize = "    << altrobunchPtr->fBunchSize   << endl;
-                     cout << "altrobunch.fEndTimeBin = "  << altrobunchPtr->fEndTimeBin  << endl;
-                    
-                     for(int i=0; i<altrobunchPtr->fBunchSize+20; i++)
+                     cout << "altrobunch.fDataSize = "      << altrobunchPtr->GetBunchSize()   << endl;
+                     cout << "altrobunch.fEndTimeBin = "    << altrobunchPtr->GetEndTimeBin()  << endl;
+                     cout << "altrobunch.fStartTimeBin = "  << altrobunchPtr->GetStartTimeBin()  << endl;
+
+                     for(int i=0; i<altrobunchPtr->GetBunchSize() + 20; i++)
                        {
                          if(i != 0 && i%4==0)
                            {
                              printf("\n");
                            }
-                         printf("%d\t", altrobunchPtr->fData[i]);
+                         
+                         //                      printf("%d\t", altrobunchPtr->fData[i]);
+                         printf("%d\t", (altrobunchPtr->GetData())[i]); 
+
                        }
                        
                      printf("\n\n");