added access to cluster structures
authorfronchet <fronchet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 May 2011 13:44:50 +0000 (13:44 +0000)
committerfronchet <fronchet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 23 May 2011 13:44:50 +0000 (13:44 +0000)
HLT/EMCAL/AliHLTEMCALRawHistoMaker.cxx
HLT/EMCAL/AliHLTEMCALRawHistoMaker.h
HLT/EMCAL/AliHLTEMCALRawHistoMakerComponent.cxx
HLT/EMCAL/AliHLTEMCALRawHistoMakerComponent.h

index 524b86f..5351ef5 100644 (file)
-/**************************************************************************\r
- * This file is property of and copyright by the ALICE HLT Project        * \r
- * All rights reserved.                                                   *\r
- * INFN Laboratori Nazionali di Frascati                                  *\r
- * Primary Authors: Federico Ronchetti                                    *\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
- * @file   AliHLTEMCALRawHistoMaker.cxx\r
- * @author Federico Ronchetti\r
- * @date \r
- * @brief  Histogram maker/pusher for EMCAL HLT  \r
- */\r
-  \r
-\r
-#include "AliHLTEMCALRawHistoMaker.h"\r
-#include "AliHLTEMCALConstants.h"\r
-#include "AliHLTEMCALMapper.h"\r
-#include "AliHLTCaloChannelDataStruct.h"\r
-#include "AliHLTCaloChannelDataHeaderStruct.h"\r
-#include "AliHLTCaloSharedMemoryInterfacev2.h"\r
-//#include "AliHLTCaloRawAnalyzer.h"\r
-#include "AliCaloRawAnalyzer.h"\r
-#include "AliCaloBunchInfo.h"\r
-#include "AliCaloFitResults.h"\r
-\r
-ClassImp(AliHLTEMCALRawHistoMaker);\r
-\r
-AliHLTEMCALRawHistoMaker::AliHLTEMCALRawHistoMaker():\r
-  AliHLTCaloConstantsHandler("EMCAL"),\r
-  fShmPtr(0),\r
-  fMapperPtr(0),\r
-  fRawCounterMemoryPtr(0),\r
-  fAltroRawStreamPtr(0),\r
-  fRawStreamPtr(0),\r
-  fSTURawStreamPtr(0),\r
-  fAnalyzerPtr(0),\r
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ * INFN Laboratori Nazionali di Frascati                                  *
+ * Primary Authors: Federico Ronchetti                                    *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          * 
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/**
+ * @file   AliHLTEMCALRawHistoMaker.cxx
+ * @author Federico Ronchetti
+ * @date 
+ * @brief  Online Monitoring Histogram maker for EMCAL  
+ */
+  
+
+#include "AliHLTEMCALRawHistoMaker.h"
+#include "AliHLTEMCALConstants.h"
+#include "AliHLTEMCALMapper.h"
+//#include "AliHLTCaloChannelDataStruct.h"
+
+#include "AliHLTCaloChannelDataHeaderStruct.h"
+#include "AliHLTCaloSharedMemoryInterfacev2.h"
+
+//#include "AliCaloRawAnalyzer.h"
+//#include "AliCaloBunchInfo.h"
+//#include "AliCaloFitResults.h"
+
+
+
+
+ClassImp(AliHLTEMCALRawHistoMaker);
+
+AliHLTEMCALRawHistoMaker::AliHLTEMCALRawHistoMaker():
+  AliHLTCaloConstantsHandler("EMCAL"),
+  fShmPtr(0),
+  fMapperPtr(0),
+  //  fRawCounterMemoryPtr(0),
+  //fAltroRawStreamPtr(0),
+  //fRawStreamPtr(0),
+  //fSTURawStreamPtr(0),
+  //fAnalyzerPtr(0),
   fEMCALConstants(NULL),
   hList(0),
-  fChannelEMap(0), fChannelTMap(0), fChannelETMap(0), h2DTRU(0), h2DSTU(0)\r
-\r
-{\r
-  // See header file for documentation\r
-\r
-  fShmPtr = new AliHLTCaloSharedMemoryInterfacev2("EMCAL");\r
-\r
-  fRawCounterMemoryPtr = new AliRawReaderMemory();\r
-\r
-  fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawCounterMemoryPtr);\r
-\r
-  fRawStreamPtr = new AliCaloRawStreamV3(fRawCounterMemoryPtr, "EMCAL");\r
-\r
-  fSTURawStreamPtr = new AliEMCALTriggerSTURawStream(fRawCounterMemoryPtr);\r
-\r
+  fChannelEMap(0), fChannelTMap(0), fChannelETMap(0), h2DTRU(0), h2DSTU(0),
+  fClusterReaderPtr(0)
+
+{
+  // See header file for documentation
+
+  fShmPtr = new AliHLTCaloSharedMemoryInterfacev2("EMCAL");
+
+  //fRawCounterMemoryPtr = new AliRawReaderMemory();
+
+  //fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawCounterMemoryPtr);
+
+  //fRawStreamPtr = new AliCaloRawStreamV3(fRawCounterMemoryPtr, "EMCAL");
+
+  //fSTURawStreamPtr = new AliEMCALTriggerSTURawStream(fRawCounterMemoryPtr);
+
   fEMCALConstants = new AliHLTEMCALConstants();
-\r
-\r
-  // Booking sample histograms\r
-\r
-  char id[100];\r
-  char title[100];\r
\r
-  hList = new TObjArray;\r
-\r
-  fChannelEMap = new TProfile2D *[fCaloConstants->GetNMODULES()];\r
-  fChannelTMap = new TProfile2D *[fCaloConstants->GetNMODULES()];\r
-  fChannelETMap = new TH2F *[fCaloConstants->GetNMODULES()];\r
-  \r
-  h2DTRU = new TH2I ("h2DTRU","",24,0,24,4,0,4);\r
-  hList->Add(h2DTRU);\r
-\r
-  h2DSTU = new TH2I ("h2DSTU","",24,0,24,4,0,4);\r
-  hList->Add(h2DSTU);\r
-\r
-  \r
-  for (int i=0; i<fCaloConstants->GetNMODULES(); i++) {\r
-    sprintf(title, "E(X vs Z): SM %d ", i);\r
-    sprintf(id, "fChannelEMap%d", i);\r
-    fChannelEMap[i] = new TProfile2D(id,title,48 ,0, 47, 24, 0, 23);\r
-    \r
-    hList->Add(fChannelEMap[i]);\r
-    \r
-    sprintf(title, "T(X vs Z): SM %d ", i);\r
-    sprintf(id, "fChannelTMap%d", i);\r
-    fChannelTMap[i] = new TProfile2D(id,title,48 ,0, 47, 24, 0, 23);\r
-\r
-    hList->Add(fChannelTMap[i]);\r
-\r
-    printf(title, "(E vs T): SM %d ", i);\r
-    sprintf(id, "fChannelETMap%d", i);\r
-    fChannelETMap[i] = new TH2F(id,title,100 ,0, 50, 100, 0, 500);\r
-    \r
-    hList->Add(fChannelETMap[i]);\r
-  }\r
-  \r
-  \r
-}\r
-\r
-AliHLTEMCALRawHistoMaker::~AliHLTEMCALRawHistoMaker() \r
-{\r
-  //See header file for documentation\r
-}\r
-\r
-// Pointer for histograms objects\r
-TObjArray* AliHLTEMCALRawHistoMaker::GetHistograms()\r
-{\r
-  return hList;\r
-}\r
-\r
-\r
-Int_t\r
-AliHLTEMCALRawHistoMaker::MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,\r
-               const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,\r
-               const AliHLTUInt32_t size, int beverbose)\r
-{\r
-       //int tmpsize =  0;\r
-       Int_t crazyness          = 0;\r
-       Int_t nSamples           = 0;\r
-       Short_t channelCount     = 0;\r
-\r
+
+  fClusterReaderPtr = new AliHLTCaloClusterReader();
+
+  // Booking histograms
+
+  char id[100];
+  char title[100];
+  hList = new TObjArray;
+
+  fChannelEMap = new TProfile2D *[fCaloConstants->GetNMODULES()];
+  fChannelTMap = new TProfile2D *[fCaloConstants->GetNMODULES()];
+  fChannelETMap = new TH2F *[fCaloConstants->GetNMODULES()];
+  
+  h2DTRU = new TH2I ("h2DTRU","",24,0,24,4,0,4);
+  hList->Add(h2DTRU);
+
+  h2DSTU = new TH2I ("h2DSTU","",24,0,24,4,0,4);
+  hList->Add(h2DSTU);
+
+  
+  for (int i=0; i<fCaloConstants->GetNMODULES(); i++) {
+    sprintf(title, "E(X vs Z): SM %d ", i);
+    sprintf(id, "fChannelEMap%d", i);
+    fChannelEMap[i] = new TProfile2D(id,title,48 ,0, 47, 24, 0, 23);
+    
+    hList->Add(fChannelEMap[i]);
+    
+    sprintf(title, "T(X vs Z): SM %d ", i);
+    sprintf(id, "fChannelTMap%d", i);
+    fChannelTMap[i] = new TProfile2D(id,title,48 ,0, 47, 24, 0, 23);
+
+    hList->Add(fChannelTMap[i]);
+
+    sprintf(title, "(E vs T): SM %d ", i);
+    sprintf(id, "fChannelETMap%d", i);
+    fChannelETMap[i] = new TH2F(id,title,100 ,0, 50, 100, 0, 500);
+    
+    hList->Add(fChannelETMap[i]);
+  }
+  
+  
+}
+
+AliHLTEMCALRawHistoMaker::~AliHLTEMCALRawHistoMaker() 
+{
+  //See header file for documentation
+}
+
+// Pointer to histograms objects
+TObjArray* AliHLTEMCALRawHistoMaker::GetHistograms()
+{
+  return hList;
+}
+
+
+Int_t
+AliHLTEMCALRawHistoMaker::MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,  
+                                   AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr, 
+                                   int beverbose)
+{
+       //int tmpsize =  0;
+       Int_t crazyness          = 0;
+       Int_t nSamples           = 0;
+       Short_t channelCount     = 0;
+
+
+       // Channel variables
        AliHLTCaloCoordinate coord;
-       AliHLTCaloChannelDataStruct* currentchannel = 0;\r
-       fShmPtr->SetMemory(channelDataHeader);\r
-\r
-       AliHLTCaloChannelDataHeaderStruct *channelDataHeaderPtr = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(outputPtr);\r
-       AliHLTCaloChannelDataStruct *channelDataPtr = reinterpret_cast<AliHLTCaloChannelDataStruct*>(outputPtr+sizeof(AliHLTCaloChannelDataHeaderStruct));\r
-\r
-       fRawCounterMemoryPtr->SetMemory( reinterpret_cast<UChar_t*>( iter->fPtr ),  static_cast<ULong_t>( iter->fSize )  );\r
-       fRawCounterMemoryPtr->SetEquipmentID(    fMapperPtr->GetDDLFromSpec(  iter->fSpecification) + fCaloConstants->GetDDLOFFSET() );\r
-       fRawCounterMemoryPtr->Reset();\r
-\r
-       //fRawCounterMemoryPtr->NextEvent();\r
-\r
-       //--- from STU macro\r
-       //while ( rawReader->NextEvent() )\r
-\r
-       while (fRawCounterMemoryPtr->NextEvent())\r
-       {\r
-               fRawCounterMemoryPtr->Reset();\r
-               fRawCounterMemoryPtr->Select("EMCAL",44);\r
-\r
-               const UInt_t* evtId = fRawCounterMemoryPtr->GetEventId();\r
-               int evno_raw = (int)evtId[0];\r
-\r
-               UInt_t eventType = fRawCounterMemoryPtr->GetType();\r
-\r
-               if (beverbose)\r
-                       cout << "I-RAWHISTOMAKER: event type: " << eventType << endl;\r
-\r
-//             if (eventType != AliRawEventHeaderBase::kPhysicsEvent) continue;\r
-\r
-//             fRawCounterMemoryPtr->DumpData();\r
-\r
-//             fRawCounterMemoryPtr->Reset();\r
-\r
-               fSTURawStreamPtr->ReadPayLoad();\r
-//             fSTURawStreamPtr->DumpPayLoad("ALL");\r
-\r
-               UInt_t adc[96];\r
-\r
-               for (Int_t i=0;i<96;i++)\r
-                       adc[i] = 0;\r
-\r
-               fSTURawStreamPtr->GetADC(29, adc);\r
-\r
-               for (Int_t i=0;i<96;i++)\r
-               {\r
-                       Int_t x = i / 4;\r
-                       Int_t y = i % 4;\r
-\r
-                       h2DSTU->Fill( x , y , adc[i] );\r
-               }\r
-\r
-               fRawCounterMemoryPtr->Reset();\r
-               fRawCounterMemoryPtr->Select("EMCAL",0,43);\r
-\r
-               while (fRawStreamPtr->NextDDL())\r
-               {\r
-                       Int_t iRCU = fRawStreamPtr->GetDDLNumber() % 2;\r
-\r
-                       while (fRawStreamPtr->NextChannel())\r
-                       {\r
-                               Int_t iSM = fRawStreamPtr->GetModule();\r
-\r
-                               Int_t iTRUId = 3 * iSM + iRCU * fRawStreamPtr->GetBranch() + iRCU;\r
-\r
-                               if (iSM==0)\r
-                               {\r
-                                       Int_t nsamples = 0;\r
-                                       vector<AliCaloBunchInfo> bunchlist;\r
-                                       while (fRawStreamPtr->NextBunch())\r
-                                       {\r
-                                               nsamples += fRawStreamPtr->GetBunchLength();\r
-                                               bunchlist.push_back( AliCaloBunchInfo(fRawStreamPtr->GetStartTimeBin(), fRawStreamPtr->GetBunchLength(), fRawStreamPtr->GetSignals() ) );\r
-                                       }\r
-\r
-                                       Int_t max = 0;\r
-\r
-                                       for (std::vector<AliCaloBunchInfo>::iterator itVectorData = bunchlist.begin(); itVectorData != bunchlist.end(); itVectorData++)\r
-                                       {\r
-                        AliCaloBunchInfo bunch = *(itVectorData);\r
-\r
-                        const UShort_t* sig = bunch.GetData();\r
-                        Int_t startBin = bunch.GetStartBin();\r
-\r
-                        for (Int_t iS = 0; iS < bunch.GetLength(); iS++)\r
-                        {\r
-                                                       if ( sig[iS] > max ) max = sig[iS];\r
-                                               }\r
-                                       }\r
-\r
-                                       if (nsamples) // this check is needed for when we have zero-supp. on, but not sparse readout\r
-                                       {\r
-                                               if (fRawStreamPtr->IsTRUData() && fRawStreamPtr->GetColumn() < 96)\r
-                                               {\r
-                                                       if (iTRUId == 2)\r
-                                                       {\r
-                                                               Int_t x = fRawStreamPtr->GetColumn() / 4;\r
-                                                               Int_t y = fRawStreamPtr->GetColumn() % 4;\r
-\r
-                                                       h2DTRU->Fill( x , y , max );\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-\r
-//             c_0->cd(1);\r
-//             h2DTRU->Draw("TEXT");\r
-//\r
-//             c_0->cd(2);\r
-//             h2DSTU->Draw("TEXT");\r
-//\r
-//             c_0->Update();\r
-//\r
-//             h2DTRU->Reset();\r
-//             h2DSTU->Reset();\r
-       }\r
-\r
-       //--- end of while\r
-\r
-\r
-//------ FIXME\r
-//------ old stuff to be removed or re-utilized\r
-       //fRawDataWriter->NewEvent( );\r
-\r
-       if(fAltroRawStreamPtr->NextDDL())\r
-         {\r
-           int cnt = 0;\r
-           int fOffset = 0;\r
-\r
-           while( fAltroRawStreamPtr->NextChannel()  )\r
-             {\r
-               //       cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T3"  << endl;\r
-               if(  fAltroRawStreamPtr->GetHWAddress() < 128 || ( fAltroRawStreamPtr->GetHWAddress() ^ 0x800) < 128 )\r
-                 {\r
-                   continue;\r
-                 }\r
-               else\r
-                 {\r
-                   ++ cnt;\r
-                   UShort_t* firstBunchPtr = 0;\r
-                   int chId = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress());\r
-                   //HLTError("Channel HW address: %d", fAltroRawStreamPtr->GetHWAddress());\r
-\r
-\r
-                  //cout << fRawStreamPtr->GetCaloFlag() << endl;\r
-                   //      return 1;\r
-\r
-                   vector <AliCaloBunchInfo> bvctr;\r
-                   while( fAltroRawStreamPtr->NextBunch() == true )\r
-                     {\r
-                       bvctr.push_back( AliCaloBunchInfo( fAltroRawStreamPtr->GetStartTimeBin(), fAltroRawStreamPtr->GetBunchLength(), fAltroRawStreamPtr->GetSignals() ) );\r
-\r
-                       nSamples = fAltroRawStreamPtr->GetBunchLength();\r
-\r
-\r
-                          // fRawDataWriter->WriteBunchData( fAltroRawStreamPtr->GetSignals(), nSamples,  fAltroRawStreamPtr->GetEndTimeBin()  );\r
-                       firstBunchPtr = const_cast< UShort_t* >(  fAltroRawStreamPtr->GetSignals()  );\r
-                     }\r
-\r
-                   //return 1;\r
-\r
-\r
-                   //    fAnalyzerPtr->SetData( firstBunchPtr, nSamples);\r
-                 AliCaloFitResults res = fAnalyzerPtr->Evaluate( bvctr,  fAltroRawStreamPtr->GetAltroCFG1(), fAltroRawStreamPtr->GetAltroCFG2() );\r
-\r
-                   HLTDebug("Channel energy: %f, max sig: %d, gain = %d, x = %d, z = %d", res.GetAmp(), res.GetMaxSig(), (chId >> 12)&0x1, chId&0x3f, (chId >> 6)&0x3f);\r
-\r
-                   //        if(fAnalyzerPtr->GetTiming() > fMinPeakPosition && fAnalyzerPtr->GetTiming() < fMaxPeakPosition)\r
-                   {\r
-                     channelDataPtr->fChannelID =  chId;\r
-                     channelDataPtr->fEnergy = static_cast<Float_t>( res.GetAmp()  ) - fOffset;\r
-\r
-                     channelDataPtr->fTime = static_cast<Float_t>(  res.GetTof() );\r
-                     channelDataPtr->fCrazyness = static_cast<Short_t>(crazyness);\r
-                     channelCount++;\r
-                     channelDataPtr++; // Updating position of the free output.\r
-                   }\r
-                 }\r
-\r
-\r
-                 }\r
-\r
-                  //fRawDataWriter->NewChannel();\r
-\r
-         }\r
-\r
-\r
-//-------\r
-       currentchannel = fShmPtr->NextChannel();\r
-\r
-       while(currentchannel != 0) {\r
-\r
-               AliHLTCaloChannelRawDataStruct rawdata = fShmPtr->GetRawData();\r
-\r
-               fMapperPtr->ChannelId2Coordinate(currentchannel->fChannelID, coord);
-\r
-               fChannelTMap[coord.fModuleId]->Fill( coord.fZ,  coord.fX , currentchannel->fTime);\r
-               fChannelEMap[coord.fModuleId]->Fill( coord.fZ,  coord.fX , currentchannel->fEnergy);\r
-               fChannelETMap[coord.fModuleId]->Fill(currentchannel->fEnergy, currentchannel->fTime);\r
-
-               currentchannel = fShmPtr->NextChannel(); // Get the next channel\r
-\r
-       }\r
-\r
-\r
-return (0); \r
+       AliHLTCaloChannelDataStruct* currentchannel = 0;
+
+
+       // Cluster variables
+       // Pointer to Cluster struture
+       AliHLTCaloClusterDataStruct* caloClusterStructPtr = 0;
+       Int_t nClusters = 0;
+
+       if (!caloClusterHeaderPtr) {
+         
+         // NULL pointer
+         cout << "FROM HISTOMAKER NO CLUSTER POINTER: " << caloClusterHeaderPtr << endl;
+         
+       } else {
+         
+         // stuff to handle clusters here
+         fClusterReaderPtr->SetMemory(caloClusterHeaderPtr);
+
+         cout << "FROM HISTOMAKER WE HAVE THE CLUSTER POINTER: " << caloClusterHeaderPtr << endl;
+
+
+         while((caloClusterStructPtr = fClusterReaderPtr->NextCluster()) != 0)
+           { 
+              
+             cout << "cluster type: " << caloClusterStructPtr->fClusterType << endl;
+              
+             cout << " COORDINATES FROM HISTOMAKER: " << 
+               " fX:" << caloClusterStructPtr->fGlobalPos[0] <<
+               " fY:" << caloClusterStructPtr->fGlobalPos[1] <<
+               " fZ:" << caloClusterStructPtr->fGlobalPos[2] << endl;
+            
+
+             UShort_t *idArrayPtr = new UShort_t[caloClusterStructPtr->fNCells];
+             Double32_t *ampFracArrayPtr = new Double32_t[caloClusterStructPtr->fNCells];
+      
+             for(UInt_t index = 0; index < caloClusterStructPtr->fNCells; index++)
+               {
+                 fClusterReaderPtr->GetCell(caloClusterStructPtr, idArrayPtr[index], ampFracArrayPtr[index], index);
+                 printf("EM: cellId: %d\n", idArrayPtr[index]);;
+               }
+
+             delete [] idArrayPtr;
+             delete [] ampFracArrayPtr;
+
+             nClusters++;
+
+           }
+
+       }
+
+
+
+       // begin scan channel data and fill histograms
+
+       fShmPtr->SetMemory(channelDataHeader);
+
+       currentchannel = fShmPtr->NextChannel();
+
+       while(currentchannel != 0) {
+         
+         fMapperPtr->ChannelId2Coordinate(currentchannel->fChannelID, coord);
+
+         cout << " from histo maker ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>> " << currentchannel->fEnergy << endl;
+         cout << " fX: " << coord.fX << " fZ: " << coord.fZ << endl;
+
+         fChannelTMap[coord.fModuleId]->Fill( coord.fZ,  coord.fX , currentchannel->fTime);
+         fChannelEMap[coord.fModuleId]->Fill( coord.fZ,  coord.fX , currentchannel->fEnergy);
+         fChannelETMap[coord.fModuleId]->Fill(currentchannel->fEnergy, currentchannel->fTime);
+         
+         currentchannel = fShmPtr->NextChannel(); // Get the next channel
+         
+       }
+       
+       
+
+return (0); 
 }
index d8efe95..7d57249 100644 (file)
 
 
 #include "AliHLTCaloConstantsHandler.h"
-#include "AliHLTCaloDigitDataStruct.h"
+
+#include "AliHLTCaloClusterDataStruct.h"
 #include "AliHLTCaloChannelDataStruct.h"
+#include "AliHLTCaloClusterReader.h"
+
 #include "AliHLTDataTypes.h"
-#include "AliAltroRawStreamV3.h"
-#include "AliRawReaderMemory.h"
-#include "AliAltroRawStreamV3.h"
-#include "AliCaloRawStreamV3.h"
-#include "AliEMCALTriggerSTURawStream.h"
+
+
+// Includes for RAW data 
+
+//#include "AliAltroRawStreamV3.h"
+//#include "AliRawReaderMemory.h"
+//#include "AliAltroRawStreamV3.h"
+//#include "AliCaloRawStreamV3.h"
+//#include "AliEMCALTriggerSTURawStream.h"
+
 
 // include root stuff
 #include "TFile.h"
 
 
 class AliHLTEMCALConstants;
+class AliHLTEMCALMapper;
+
 class AliHLTCaloSharedMemoryInterfacev2;
+
 class AliHLTCaloChannelDataHeaderStruct;
-class AliHLTEMCALMapper;
-class AliRawReaderMemory;
-class AliAltroRawStreamV3;
-class AliEMCALTriggerSTURawStream;
-class AliCaloRawStreamV3;
-class AliCaloRawAnalyzer;
+class AliHLTCaloClusterHeaderStruct;
+
+class AliHLTCaloClusterReader;
+
+//class AliHLTCaloRecPointHeaderStruct;
+
+//class AliRawReaderMemory;
+//class AliAltroRawStreamV3;
+//class AliEMCALTriggerSTURawStream;
+//class AliCaloRawStreamV3;
+//class AliCaloRawAnalyzer;
+
 class TString;
 class TH2F;
 class TH2I;
@@ -70,11 +87,6 @@ public:
   /** Destructor */
   virtual ~AliHLTEMCALRawHistoMaker();
 
-  /** Assignment */
-  AliHLTEMCALRawHistoMaker & operator = (const AliHLTEMCALRawHistoMaker)
-  {
-    return *this; 
-  }
 
   /**
    * Make the digits for one event.
@@ -82,9 +94,7 @@ public:
    * @return the number of digits found
    */
 
-  Int_t MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,
-                 const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr,
-                 const AliHLTUInt32_t size, int beverbose);
+  Int_t MakeHisto(AliHLTCaloChannelDataHeaderStruct* channelDataHeader,  AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr, int beverbose);
 
   TObjArray * GetHistograms();
 
@@ -103,29 +113,27 @@ private:
   AliHLTCaloSharedMemoryInterfacev2* fShmPtr;                    //! transient
 
   /** Pointer to the raw data reader which reads from memory */
-   AliRawReaderMemory* fRawCounterMemoryPtr;            //!transient
+  //   AliRawReaderMemory* fRawCounterMemoryPtr;            //!transient
 
    /** Pointer to the raw stream */
-   AliAltroRawStreamV3* fAltroRawStreamPtr;               //!transient
+  //   AliAltroRawStreamV3* fAltroRawStreamPtr;               //!transient
 
    /** Pointer to the calo raw stream */
-   AliCaloRawStreamV3* fRawStreamPtr;              //!transient
+  // AliCaloRawStreamV3* fRawStreamPtr;              //!transient
 
    /** Pointer to the STU raw stream */
-   AliEMCALTriggerSTURawStream* fSTURawStreamPtr;
+  // AliEMCALTriggerSTURawStream* fSTURawStreamPtr;
 
   /** Mapper */
   AliHLTEMCALMapper* fMapperPtr;                                  //COMMENT
-
-
-  /** Pointer to an analyzer object used for raw data anlysis */
-  AliCaloRawAnalyzer *fAnalyzerPtr;   //COMMENT
-
   /** Constants class */
   AliHLTEMCALConstants* fEMCALConstants;
 
+  AliHLTCaloClusterReader* fClusterReaderPtr; // !transient The reader
+
   AliHLTEMCALRawHistoMaker(const AliHLTEMCALRawHistoMaker &);
-    //AliHLTEMCALRawHistoMaker & operator = (const AliHLTEMCALRawHistoMaker &);
+  AliHLTEMCALRawHistoMaker & operator = (const AliHLTEMCALRawHistoMaker &);
   
   ClassDef(AliHLTEMCALRawHistoMaker, 0); 
 
index d052ccb..9d2a12d 100644 (file)
 #include "AliHLTCaloChannelDataHeaderStruct.h"
 #include "AliHLTCaloChannelDataStruct.h"
 
+#include "AliHLTCaloDefinitions.h"
+
+#include "TString.h"
+
+
+
 // root stuff
 #include "TFile.h"
 #include "TProfile2D.h"
@@ -59,6 +65,34 @@ AliHLTEMCALRawHistoMakerComponent::~AliHLTEMCALRawHistoMakerComponent()
        //see header file for documentation
 }
 
+
+int
+AliHLTEMCALRawHistoMakerComponent::DoInit(int argc, const char** argv )
+{
+       //see header file for documentation
+
+       fRawHistoMakerPtr = new AliHLTEMCALRawHistoMaker();
+
+       for(int i = 0; i < argc; i++)
+       {
+               if(!strcmp("-roothistofilename", argv[i]))
+                       fRootFileName = argv[i+1];
+
+               if(!strcmp("-pushfraction", argv[i]))
+                       fPushFraction = atoi(argv[i+1]);
+
+               if(!strcmp("-beverbose", argv[i]))
+                       fBeVerbose = atoi(argv[i+1]);
+
+       }
+
+       if (fBeVerbose)
+               cout << "I-RAWHISTOMAKERCOMPONENT: local root file name is: " << fRootFileName << endl;
+
+       return 0;
+}
+
+
 int 
 AliHLTEMCALRawHistoMakerComponent::Deinit()
 { 
@@ -120,88 +154,91 @@ AliHLTEMCALRawHistoMakerComponent::DoEvent(const AliHLTComponentEventData& evtDa
        unsigned long ndx;
 
        UInt_t specification = 0;
+       
        AliHLTCaloChannelDataHeaderStruct* tmpChannelData = 0;
-
+       
+       AliHLTCaloClusterHeaderStruct *caloClusterHeaderPtr = 0;
 
        for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
        {
                iter = blocks+ndx;
-
+               
                if (fBeVerbose) {
                        PrintComponentDataTypeInfo(iter->fDataType);
-                       cout << "I-RAWHISTOMAKERCOMPONENT: verbose mode enabled:  " << fBeVerbose << endl;
-               }
-
-               if(iter->fDataType != AliHLTEMCALDefinitions::fgkChannelDataType)
-               {
-
-                       if (fBeVerbose)
-                               HLTWarning("I-RAWHISTOMAKERCOMPONENT: Data block is not of type fgkChannelDataType");
-                       else
-                               HLTDebug("I-RAWHISTOMAKERCOMPONENT: Data block is not of type fgkChannelDataType");
-
-                       continue;
+                       cout << "\nI-RAWHISTOMAKERCOMPONENT: verbose mode enabled:  " << fBeVerbose << endl;
                }
 
+               
+               if(iter->fDataType == kAliHLTDataTypeCaloCluster)
+                 {
+                   
+                   cout << "\nI-RAWHISTOMAKERCOMPONENT: cluster data handling HERE !" <<  endl;
+                   
+                   //specification |= iter->fSpecification;
+                   caloClusterHeaderPtr = reinterpret_cast<AliHLTCaloClusterHeaderStruct*>(iter->fPtr);
+                   cout << " --------------------> cluster pointer here !!!!!!!! ->>>>>>>>>>>>>>>>>>>>>: " << caloClusterHeaderPtr << endl;
+                 } 
+
+               else 
+
+                 {
+                   
+                   if (fBeVerbose)
+                     HLTWarning("\nI-RAWHISTOMAKERCOMPONENT: Data block does not contain clusters\n");
+                   else
+                     HLTDebug("\nI-RAWHISTOMAKERCOMPONENT: Data block does not contain clusters\n");
+                   
+                   // continue;
+
+                 }
+
+
+               if (iter->fDataType == AliHLTEMCALDefinitions::fgkChannelDataType)
+                 {
+                 
+
+                   tmpChannelData = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(iter->fPtr);
+                   cout << " --------------------> channel  pointer here !!!!!!!! ->>>>>>>>>>>>>>>>>>>>>: " << tmpChannelData  << endl;
+                   
+                   if (fBeVerbose)
+                     HLTWarning ("\nI-RAWHISTOMAKERCOMPONENT: reading channel number %d\n",tmpChannelData->fNChannels);
+
+               
+                 } 
+               
+               else
+                 
+                 {
+                   if (fBeVerbose)
+                     HLTWarning("\nI-RAWHISTOMAKERCOMPONENT: Data block does not contain signal amplitude\n");
+                   else
+                     HLTDebug("\nI-RAWHISTOMAKERCOMPONENT: Data block does not contain signal amplitude\n");
+
+                   continue;
+         }
+
+       
                specification |= iter->fSpecification;
-               tmpChannelData = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(iter->fPtr);
-
-               if (fBeVerbose)
-               HLTWarning ("I-RAWHISTOMAKERCOMPONENT: channel number %d",tmpChannelData->fNChannels);
-
-               ret = fRawHistoMakerPtr->MakeHisto(tmpChannelData, iter, outputPtr, size, fBeVerbose);
+               ret = fRawHistoMakerPtr->MakeHisto(tmpChannelData, caloClusterHeaderPtr, fBeVerbose);
 
-               //if(ret == -1)
-               //{
-               //  HLTError("Trying to write over buffer size");
-               //  return -ENOBUFS;
-               //}
-               //digitCount += ret;
        }
 
        fLocalEventCount++;
 
        TFile rootHistFile(fRootFileName,"recreate");
-
+       
        fRawHistoMakerPtr->GetHistograms()->Write();
-
+       
        if (fLocalEventCount%fPushFraction == 0) {
-
-               if (fBeVerbose)
-                       cout << "I-RAWHISTOMAKERCOMPONENT: pushback done at " << fLocalEventCount << " events " << endl;
-
-               PushBack(fRawHistoMakerPtr->GetHistograms(), kAliHLTDataTypeTObjArray | kAliHLTDataOriginEMCAL , specification);
+         
+         if (fBeVerbose)
+           cout << "I-RAWHISTOMAKERCOMPONENT: pushback done at " << fLocalEventCount << " events " << endl;
+         
+         PushBack(fRawHistoMakerPtr->GetHistograms(), kAliHLTDataTypeTObjArray | kAliHLTDataOriginEMCAL , specification);
        }
-
+       
        size = mysize;
-
-       return 0;
-}
-
-
-int
-AliHLTEMCALRawHistoMakerComponent::DoInit(int argc, const char** argv )
-{
-       //see header file for documentation
-
-       fRawHistoMakerPtr = new AliHLTEMCALRawHistoMaker();
-
-       for(int i = 0; i < argc; i++)
-       {
-               if(!strcmp("-roothistofilename", argv[i]))
-                       fRootFileName = argv[i+1];
-
-               if(!strcmp("-pushfraction", argv[i]))
-                       fPushFraction = atoi(argv[i+1]);
-
-               if(!strcmp("-beverbose", argv[i]))
-                       fBeVerbose = atoi(argv[i+1]);
-
-       }
-
-       if (fBeVerbose)
-               cout << "I-RAWHISTOMAKERCOMPONENT: local root file name is: " << fRootFileName << endl;
-
+       
        return 0;
 }
 
index e1bd102..972380a 100644 (file)
 
 
 #include "AliHLTCaloProcessor.h"
-#include  "AliHLTEMCALDefinitions.h"
+#include "AliHLTCaloClusterDataStruct.h"
+
+#include "AliHLTCaloConstantsHandler.h"
+#include "AliHLTEMCALDefinitions.h"
+#include "AliHLTDataTypes.h"
 #include "TString.h"
 
+
 class AliHLTEMCALRawHistoMaker;
+class AliHLTCaloClusterHeaderStruct;
+
 
 
 class AliHLTEMCALRawHistoMakerComponent : public AliHLTCaloProcessor
@@ -41,13 +48,6 @@ public:
        virtual ~AliHLTEMCALRawHistoMakerComponent();
 
 
-       /** Assignment */
-       AliHLTEMCALRawHistoMakerComponent & operator = (const AliHLTEMCALRawHistoMakerComponent)
-       {
-               //Assignment
-               return *this;
-       }
-
        /** interface function, see @ref AliHLTComponent for description */
        const char* GetComponentID();
 
@@ -82,6 +82,8 @@ protected:
        /** interface function, see @ref AliHLTComponent for description */
        virtual int Deinit(); ////////// PTH WARNING
 
+       
+
 private:
        TString fRootFileName;
        int fPushFraction;
@@ -91,8 +93,9 @@ private:
        /** Pointer to the histo maker itself */
        AliHLTEMCALRawHistoMaker *fRawHistoMakerPtr;                    //! transient
 
+       
        AliHLTEMCALRawHistoMakerComponent(const AliHLTEMCALRawHistoMakerComponent & );
-
+       AliHLTEMCALRawHistoMakerComponent & operator = (const AliHLTEMCALRawHistoMakerComponent &);
 };
 
 #endif