]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Initializing a rawanalyzer object in
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Apr 2010 21:33:19 +0000 (21:33 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Apr 2010 21:33:19 +0000 (21:33 +0000)
the PeakFinder component.

HLT/EMCAL/AliHLTEMCALRawAnalyzerComponent.cxx
HLT/EMCAL/AliHLTEMCALRawAnalyzerPeakFinderComponent.cxx
HLT/EMCAL/AliHLTEMCALRecoParamHandler.cxx
HLT/EMCAL/AliHLTEMCALRecoParamHandler.h

index a318e0ea367998effb269f5f3d9fd1a7ecb47491..eede8c9edb1b22711feb87eb49ac23d64e1d181f 100644 (file)
 // --------------
 
 
+
 #include "AliHLTEMCALRawAnalyzerComponent.h"
 #include "AliHLTEMCALMapper.h"
 #include "AliHLTEMCALDefinitions.h"
 #include "AliHLTCaloChannelDataHeaderStruct.h"
 //#include "unistd.h"
 
-//#include  "TStopwatch.h"
-//TStopwatch  fgWatch; //CRAP PTH
+
+#include  "TStopwatch.h"
+TStopwatch  fgWatch; //CRAP PTH
 
 
 AliHLTEMCALRawAnalyzerComponent::AliHLTEMCALRawAnalyzerComponent() : AliHLTCaloRawAnalyzerComponentv3("EMCAL")
@@ -81,16 +83,31 @@ AliHLTEMCALRawAnalyzerComponent::DoInit()
  
 }
 
+/*
+struct AliHLTComponentDataType
+  {
+    AliHLTUInt32_t fStructSize;                            /// Size of this structure in bytes.
+    char fID[kAliHLTComponentDataTypefIDsize];             /// Data type identifier.
+    char fOrigin[kAliHLTComponentDataTypefOriginSize];     /// Subsystem or detector origin of the data.
+  };
+*/
+
 bool 
 AliHLTEMCALRawAnalyzerComponent::CheckInputDataType(const AliHLTComponentDataType &datatype)
 {
   // Cheking if datatype is the correct one before processing 
+  //    cout << __FILE__ << __LINE__ << "  :  fID  = " << datatype.fID <<  " : fOrigin = " <<  datatype.fOrigin << endl;
+  //  cout << __FILE__ << __LINE__ << "fgkDDLRawDataType->fID = " << AliHLTEMCALDefinitions::fgkDDLRawDataType.fID <<
+  //  "fgkDDLRawDataType->fOrigin = " << AliHLTEMCALDefinitions::fgkDDLRawDataType.fOrigin << endl;
+
+
   if ( datatype  == AliHLTEMCALDefinitions::fgkDDLRawDataType  )
      {
        return true;
      }
    else
      {
+       //    return true;
        return false;
      }
 }
@@ -107,7 +124,7 @@ AliHLTEMCALRawAnalyzerComponent::InitMapping( const int specification )
 
   if(fMapperPtr->GetIsInitializedMapping() == false )
     {
-      HLTError("%d:%d, ERROR, mapping not initialized ", __FILE__, __LINE__ );
+      //      HLTError("%d:%d, ERROR, mapping not initialized ", __FILE__, __LINE__ );
       exit(-2);
     }
 }
@@ -117,13 +134,23 @@ int
 AliHLTEMCALRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, 
                                         AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks )
 {
-  //-----------------------
-  static int evntcnt = 0;
-//  static double wlast = -1;
- // static double wcurrent = 0;
 
+  static int evntcnt = 0;
+  static double wlast = -1;
+  static double wcurrent = 0;
   evntcnt  ++;
   
+  if( evntcnt %1000 == 0  )
+    {
+      cout << __FILE__ << __LINE__ << " : Processing event "  << evntcnt   << endl; 
+      wlast =  wcurrent;
+      wcurrent = fgWatch.RealTime();
+      cout << wlast << ":" << wcurrent << endl;
+      cout << __FILE__ << __LINE__ << "The event rate is " <<  1000/( wcurrent  -  wlast ) << "  Hz" << endl; 
+      fgWatch.Start(kFALSE); 
+      //     wlast =  fgWatch.RealTime(); 
+    }
+  
   /*
   if( evntcnt %100 == 0  )
     {
@@ -146,18 +173,23 @@ AliHLTEMCALRawAnalyzerComponent::DoEvent( const AliHLTComponentEventData& evtDat
 
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
+      //   cout << __FILE__ << __LINE__ <<  "ndx =" << ndx  << endl;
       iter = blocks+ndx;
       if(  ! CheckInputDataType(iter->fDataType) )
        {
+         //      cout << __FILE__ << __LINE__ <<  "  continue" << endl; 
          continue;
        }
       else
        {
+         //      cout << __FILE__ << __LINE__ <<  "  else" << endl;  
+
          InitMapping( iter->fSpecification); 
          blockSize = DoIt(iter, outputPtr, size, totSize); // Processing the block
          
          if(blockSize == -1) // If the processing returns -1 we are out of buffer and return an error msg.
            {
+             //             cout << __FILE__ << __LINE__ <<  "  return -ENOBUFS " << endl;   
              return -ENOBUFS;
            }
          
index cca389532919cbfbcbea61c8002bb0ced472b540..bff8f3f53ef24b596591a41ada0b6cd9efd480db 100644 (file)
@@ -32,8 +32,12 @@ AliHLTEMCALRawAnalyzerPeakFinderComponent  gAliHLTEMCALRawAnalyzerPeakFinderComp
 
 AliHLTEMCALRawAnalyzerPeakFinderComponent::AliHLTEMCALRawAnalyzerPeakFinderComponent (): AliHLTEMCALRawAnalyzerComponent()
 {
+
+  fAnalyzerPtr = new    AliCaloRawAnalyzerPeakFinder();
+
   // constructor
   //  fAnalyzerPtr = new    AliCaloRawAnalyzerPeakFinder();
+
 }
 
 
index 5cfda137a66e0a1f05bfd67b297bb9103a625845..3b90797e570cb47300a38a3894405dde2c8a1bac 100644 (file)
@@ -36,6 +36,15 @@ Float_t AliHLTEMCALRecoParamHandler::GetCorrectedEnergy ( Float_t e )
    return e;
 }
 
+
+Int_t 
+AliHLTEMCALRecoParamHandler::GetParametersFromCDB()
+{
+  // Avoiding linking error in EMCAL
+}
+
+
+
 void AliHLTEMCALRecoParamHandler::FillParameters()
 {
    //See header file for class documentation
index aa538ec3b3c5378d33a06537523e3cb606535123..683dcf60a29005e78bd49c8efd0a63768eb81e83 100644 (file)
@@ -28,7 +28,7 @@ class AliHLTEMCALRecoParamHandler : public AliHLTCaloRecoParamHandler
         virtual ~AliHLTEMCALRecoParamHandler();
         
         /** See base class for documentation */
-        // virtual Int_t GetParametersFromCDB(); //- no impl. changed by MP
+        virtual Int_t GetParametersFromCDB();
         
         /** Get the energy corrected for non-linear effects etc. */
         virtual Float_t GetCorrectedEnergy(Float_t e);