]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
merging with svn
authorodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Oct 2009 12:16:32 +0000 (12:16 +0000)
committerodjuvsla <odjuvsla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Oct 2009 12:16:32 +0000 (12:16 +0000)
16 files changed:
HLT/CALO/AliHLTCaloChannelDataStruct.h
HLT/CALO/AliHLTCaloMapper.cxx
HLT/CALO/AliHLTCaloMapper.h
HLT/CALO/AliHLTCaloRawAnalyzerComponentv3.cxx
HLT/CALO/AliHLTCaloSharedMemoryInterfacev2.cxx
HLT/EMCAL/AliHLTEMCALMapper.cxx
HLT/EMCAL/AliHLTEMCALMapper.h
HLT/EMCAL/OnlineDisplay/AliHLTEMCALOnlineDisplayEventTab.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzerComponentv3.cxx
HLT/PHOS/AliHLTPHOSRawAnalyzerComponentv3.h
HLT/trigger/AliHLTTriggerBarrelGeomMultiplicity.cxx
HLT/trigger/AliHLTTriggerDecisionParameters.cxx
HLT/trigger/AliHLTTriggerDetectorGeom.cxx
HLT/trigger/AliHLTTriggerDetectorGeom.h
HLT/trigger/AliHLTTriggerDetectorGeomRectangle.cxx
HLT/trigger/AliHLTTriggerDetectorGeomRectangle.h

index a069c3f906a38e15a73541310ea36f30f21fa664..59079359109570a067d3dfa1ec2a240c71d60b62 100644 (file)
@@ -31,11 +31,17 @@ struct AliHLTCaloChannelDataStruct
 {
   Float_t fEnergy;
   Float_t fTime;
-  UShort_t fChannelID;
+  //  UShort_t fChannelID;
+  
+
   Short_t fCrazyness;
+  int fChannelID;
+  
   //  Short_t fRawDataSize; //the size of the raw data
   //private:
-  virtual ~AliHLTCaloChannelDataStruct(){};
+  //  virtual ~AliHLTCaloChannelDataStruct(){};
+
+  /*
   AliHLTCaloChannelDataStruct(): fEnergy(0),
                                 fTime(0),
                                 fChannelID(0),
@@ -43,7 +49,9 @@ struct AliHLTCaloChannelDataStruct
                                 
   {
   }
-};
+  */
+}
+;
 
 #endif
 
index 850c42dfe0e5ea35669a46b3f77a1d1176cc2690..00eb99ba09beab288d0dd3420ce985054e2313fb 100644 (file)
@@ -37,6 +37,7 @@ using namespace CaloHLTConst;
 
 AliHLTCaloMapper::AliHLTCaloMapper( const unsigned long  specification ) :  AliHLTLogging(), 
                                                                            fHw2geomapPtr(0),
+                                                                           fCellSize(0),
                                                                            fSpecification(specification),
                                                                            fIsInitializedMapping(false),
                                                                            fSpecificationMapPtr(0)
@@ -77,9 +78,7 @@ AliHLTCaloMapper::GetFilePath()
 
 
 void
-//AliHLTPHOSMapper::GetChannelCoord(const UShort_t channelId,    &AliHLTPHOSCoordinate channelCoord)
-//AliHLTCaloMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCoordinate &channelCoord)
-AliHLTCaloMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCoordinate &channelCoord)
+AliHLTCaloMapper::ChannelId2Coordinate(const int channelId,    AliHLTCaloCoordinate &channelCoord)
 {
   channelCoord.fX = channelId&0x3f;
   channelCoord.fZ = (channelId >> 6)&0x3f;
@@ -89,7 +88,6 @@ AliHLTCaloMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCo
 }
 
 
-
 int  
 AliHLTCaloMapper::GetDDLFromSpec( const AliHLTUInt32_t spec )
 {
@@ -109,8 +107,11 @@ AliHLTCaloMapper::GetDDLFromSpec( const AliHLTUInt32_t spec )
   return tmpIndex;
 }
 
+
   
-UInt_t 
+// UInt_t 
+// AliHLTCaloMapper::GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd)
+int 
 AliHLTCaloMapper::GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd)
 {
   Short_t index = GetDDLFromSpec(spec);
index 05c1188d0bf044481da542aaaf42743a7f70e53b..e44311217086063754bf6ad000e65520aed0fb13 100644 (file)
@@ -36,58 +36,39 @@ class AliHLTCaloCoordinate;
 class AliHLTCaloMapper : public AliHLTLogging
 {
 public:
-
-  //  AliHLTCaloMapper(const int speficication);
-
   AliHLTCaloMapper(const unsigned long speficication);
   virtual ~AliHLTCaloMapper();
-
-  // virtual void InitAltroMapping( const int specification ) = 0; 
   virtual void InitAltroMapping( const unsigned long specification ) = 0; 
-
   virtual void InitDDLSpecificationMapping() = 0;
   bool GetIsInitializedMapping();
   char* GetFilePath();
-  //const virtual int GetDDLFromSpec( const AliHLTUInt32_t spec );
-  // const virtual int GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
-
-  //  static int GetDDLFromSpec( const AliHLTUInt32_t spec );
   int GetDDLFromSpec( const AliHLTUInt32_t spec );
-
-  
   static unsigned long GetSpecFromDDLIndex( const int ddlindex );
+  //  UInt_t  GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
+  int  GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
+  static void ChannelId2Coordinate(const int channelId,    AliHLTCaloCoordinate &channelCoord);
 
-
-
-  UInt_t  GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
-  static void ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCoordinate &channelCoord);
-  
-  // static unsigned long GetSpecFromDDLIndex( const int ddlindex );
-  // static int GetChannelID(const AliHLTUInt32_t spec, const Int_t hadd);
-  // static void ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCoordinate &channelCoord);
+  // static void GetLocalCoord(const int channelId, Float_t* localCoord) = 0; 
   
+  virtual void GetLocalCoord(const int channelId, Float_t* localCoord) const = 0; 
 
 struct fAltromap{ 
-    int fZRow; // Coordinate in Z direction (beam direction) relatve too one RCU
-    int fXCol; // Coordinate in X direction (perpendicular too beam direction an parallell to ground) relatve too one RCU
-    int fGain; // Gain (high gain = 1, low gain = 0)
+ struct fAltromap{ 
+    char fZRow; // Coordinate in Z direction (beam direction) relatve to one Module
+    char fXCol; // Coordinate in X direction (perpendicular too beam direction an parallell to ground) relatve to one Module
+    char fGain; // Gain (high gain = 1, low gain = 0)
   };
   
   struct fDDLSpecificationMap{ 
-    UInt_t fRcuX; // Coordinate in Z direction (beam direction) relatve too one RCU
-    UInt_t fRcuZ; // Coordinate in X direction (perpendicular too beam direction an parallell to ground) relatve too one RCU
-    UInt_t fRcuXOffset;
-    UInt_t fRcuZOffset;
-    int fModId; 
+    char fModId; 
   };
+  
 
   fAltromap *fHw2geomapPtr; //pointer to structure holding information about geometrical address 
 
   char fFilepath[1024];
 
 protected:
+  float fCellSize;
   int fSpecification;
   bool fIsInitializedMapping;
   fDDLSpecificationMap* fSpecificationMapPtr;
index 8395635648d557aafd029e9f23ef70225a1a49c8..66abde66da38ed610e03c18f19e8b7acc6b684d5 100644 (file)
@@ -136,25 +136,17 @@ AliHLTCaloRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtDa
   UInt_t totSize           = 0;
   const AliHLTComponentBlockData* iter = NULL; 
   unsigned long ndx;
-  //  cout << __FILE__  << ":" << __LINE__ << "TP0"  << endl;
+
   for( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
     {
-      //     cout << __FILE__  << ":" << __LINE__ << "TP1"  << endl;
       iter = blocks+ndx;
       if( CheckInputDataType(  iter->fDataType ) == false )
        {
-         //      cout << __FILE__  << ":" << __LINE__ <<  ": wrong !! datatype" << endl; 
-         //      cout << "The datatype recieved was"  << endl;
-         //      cout << "the datatype is " <<   iter->fDataType.fID << ":" << iter->fDataType.fOrigin  << endl;
          continue;
        }
       else
        {
-         //      cout << __FILE__  << ":" << __LINE__ <<  ":" << "data is of type fgkDDLPackedRawDataType, continue processing " << endl;
-         //      cout << "the datatype is " <<   iter->fDataType.fID << ":" << iter->fDataType.fOrigin  << endl;
-         //      cout << __FILE__  << ":" << __LINE__ << "T10"  << endl;
          InitMapping( iter->fSpecification); 
-         //     cout << __FILE__  << ":" << __LINE__ << "TP2"  << endl; 
          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.
            {
@@ -162,8 +154,6 @@ AliHLTCaloRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtDa
            }
          
          totSize += blockSize; //Keeping track of the used size
-         // HLTDebug("Output data size: %d - Input data size: %d", totSize, iter->fSize);
-         //Filling the block data
          AliHLTComponentBlockData bdChannelData;
          FillBlockData( bdChannelData );
          bdChannelData.fOffset = 0; //FIXME
@@ -189,15 +179,18 @@ AliHLTCaloRawAnalyzerComponentv3::DoEvent( const AliHLTComponentEventData& evtDa
 Int_t
 AliHLTCaloRawAnalyzerComponentv3::DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize)
 {
-  //  cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T0"  << endl; 
-
- //comment
+  //comment
   int tmpsize=  0;
   Int_t crazyness          = 0;
   Int_t nSamples           = 0;
   Short_t channelCount     = 0;
 
-   // Firs we want to write a header to the output
+
+  //  Firs we want to write a header to the output
+  //  cout << __FILE__ << __LINE__ << "The size of AliHLTCaloChannelDataHeaderStruct is " << sizeof(AliHLTCaloChannelDataHeaderStruct ) << endl;
+  //  cout << __FILE__ << __LINE__ << "The size of AliHLTCaloChannelDataStruct is " << sizeof(AliHLTCaloChannelDataStruct ) << endl;
+
+
   AliHLTCaloChannelDataHeaderStruct *channelDataHeaderPtr = reinterpret_cast<AliHLTCaloChannelDataHeaderStruct*>(outputPtr); 
   AliHLTCaloChannelDataStruct *channelDataPtr = reinterpret_cast<AliHLTCaloChannelDataStruct*>(outputPtr+sizeof(AliHLTCaloChannelDataHeaderStruct)); 
   //Adding to the total size of data written
@@ -239,10 +232,10 @@ AliHLTCaloRawAnalyzerComponentv3::DoIt(const AliHLTComponentBlockData* iter, Ali
            UShort_t* firstBunchPtr = 0;
 
            //   UShort_t chId = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress()); 
-           UInt_t chId = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress()); 
-
-           //       cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T4"  << endl; 
+           //   UInt_t chId = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress()); 
            
+           int chId = fMapperPtr->GetChannelID(iter->fSpecification, fAltroRawStreamPtr->GetHWAddress()); 
+
            if( fkDoPushRawData == true)
              {
                fRawDataWriter->SetChannelId( chId );
@@ -267,13 +260,9 @@ AliHLTCaloRawAnalyzerComponentv3::DoIt(const AliHLTComponentBlockData* iter, Ali
                return -1;
              }
 
-           
-           //      cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T6"  << endl; 
            fAnalyzerPtr->SetData( firstBunchPtr, nSamples);
-           //      cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T6.1"  << endl; 
            fAnalyzerPtr->Evaluate(0, nSamples);  
-           //      cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T6.2"  << endl; 
-          
+           
            //        if(fAnalyzerPtr->GetTiming() > fMinPeakPosition && fAnalyzerPtr->GetTiming() < fMaxPeakPosition)
            {
              //              cout << __FILE__  << ":" << __LINE__ << ":" <<__FUNCTION__ << "T7"  << endl; 
index f7ccdce269f6cc3bf653fd281d0a4dc5e33225dc..5fa0537d5982e9ef633efa8aba9e95265d2480de 100644 (file)
@@ -66,8 +66,7 @@ struct AliHLTCaloChannelDataStruct
   //  Short_t fRawDataSize; //the size of the raw data
 };
 */
-
-AliHLTCaloChannelDataStruct*   
+AliHLTCaloChannelDataStruct*
 AliHLTCaloSharedMemoryInterfacev2::NextChannel()
 {
   // Comment
@@ -77,53 +76,54 @@ AliHLTCaloSharedMemoryInterfacev2::NextChannel()
       tmpChannelPtr = reinterpret_cast<AliHLTCaloChannelDataStruct*>(fChannelDataPtr);
       fCurrentCnt++;
       fChannelDataPtr += sizeof(AliHLTCaloChannelDataStruct);
+      
       if(fHasRawData == true)
+      //     if( false )       
        {
          fRawData.fEnergy = tmpChannelPtr->fEnergy;
          fRawData.fTime = tmpChannelPtr->fTime;
-         fRawData.fChannelID = tmpChannelPtr->fChannelID; 
-         fRawData.fCrazyness  = tmpChannelPtr->fCrazyness; 
+         fRawData.fChannelID = tmpChannelPtr->fChannelID;
+         fRawData.fCrazyness = tmpChannelPtr->fCrazyness;
          Reset(fRawData);
-         //AliHLTCaloMapper::ChannelId2Coordinate(const UShort_t channelId,    AliHLTCaloCoordinate &channelCoord) 
-
-         
+         //AliHLTCaloMapper::ChannelId2Coordinate(const UShort_t channelId, AliHLTCaloCoordinate &channelCoord)
          AliHLTCaloMapper::ChannelId2Coordinate( fRawData.fChannelID, fRawData.fCoordinate);
          
-         
-         
-
-         
-         if( fRawData.fChannelID ==  fRawDataPtr[0]  )
+         if( fRawData.fChannelID == fRawDataPtr[0] )
            {
              Reset(fRawData);
-             //      cout << __FILE__ << __LINE__ << "fRawData.fChannelID ==  fRawDataPtr[0] =  " << fRawDataPtr[0]  << endl;
-             //    cout << "  copying raw dat not yet implemnted " << endl;
-             UShort_t tmpTotSize =  fRawDataPtr[1];
-             UShort_t tmpStartBin   =  fRawDataPtr[2];
-             UShort_t tmpBunchtSize =  fRawDataPtr[3];
-             //    fRawDataPtr
-             UShort_t tmpSamplesLeft = tmpTotSize -4; 
+             // cout << __FILE__ << __LINE__ << "fRawData.fChannelID == fRawDataPtr[0] = " << fRawDataPtr[0] << endl;
+             // cout << " copying raw dat not yet implemnted " << endl;
+             UShort_t tmpTotSize = fRawDataPtr[1];
+             UShort_t tmpStartBin = fRawDataPtr[2];
+             UShort_t tmpBunchtSize = fRawDataPtr[3];
+             // fRawDataPtr
+             //     UShort_t tmpSamplesLeft = tmpTotSize -4;
+             int tmpSamplesLeft = tmpTotSize -4;
 
-             fRawData.nSamplesUsed =  tmpTotSize +  tmpStartBin;
+             fRawData.nSamplesUsed = tmpTotSize + tmpStartBin;
 
-             while(tmpSamplesLeft > 0)
+             if(tmpSamplesLeft > 0 )
                {
-                 for(int i=0; i < tmpBunchtSize; i++ )
+                 while(tmpSamplesLeft > 0)
                    {
-                     fRawData.fDataPtr[i + tmpStartBin] = fRawDataPtr[ i+ 4];
-                     tmpSamplesLeft --;
+                     for(int i=0; i < tmpBunchtSize; i++ )
+                       {
+                         fRawData.fDataPtr[i + tmpStartBin] = fRawDataPtr[ i+ 4];
+                         tmpSamplesLeft --;
+                       }
                    }
+                 fRawDataPtr+= tmpTotSize;
                }
-             fRawDataPtr+= tmpTotSize;
-             
            }
          else
            {
-             //              cout << __FILE__ << __LINE__ << "ERROR! fRawData.fChannelID = "<<  fRawData.fChannelID  << "  but  fRawDataPtr[0] =  " << fRawDataPtr[0]  << endl;
+             // cout << __FILE__ << __LINE__ << "ERROR! fRawData.fChannelID = "<< fRawData.fChannelID << " but fRawDataPtr[0] = " << fRawDataPtr[0] << endl;
            }
-         
-
-         //      HLTDebug("Raw data interface not yet implemented, ignoring raw data");
+         // HLTDebug("Raw data interface not yet implemented, ignoring raw data");
        }
       return tmpChannelPtr;
     }
@@ -135,6 +135,79 @@ AliHLTCaloSharedMemoryInterfacev2::NextChannel()
   return 0;
 }
 
+/*
+  AliHLTCaloChannelDataStruct*   
+  AliHLTCaloSharedMemoryInterfacev2::NextChannel()
+  {
+  cout << __FILE__ << __LINE__ << " TP0" << endl;
+
+  AliHLTCaloChannelDataStruct* tmpChannelPtr = 0;
+  if(fCurrentCnt < fMaxCnt)
+  {
+  cout << __FILE__ << __LINE__ << " TP1" << endl;  
+  tmpChannelPtr = reinterpret_cast<AliHLTCaloChannelDataStruct*>(fChannelDataPtr);
+  fCurrentCnt++;
+  fChannelDataPtr += sizeof(AliHLTCaloChannelDataStruct);
+   
+  //    if(fHasRawData == true)
+  if(false)    
+  {
+  cout << __FILE__ << __LINE__ << " TP2" << endl; 
+  fRawData.fEnergy = tmpChannelPtr->fEnergy;
+  fRawData.fTime = tmpChannelPtr->fTime;
+  fRawData.fChannelID = tmpChannelPtr->fChannelID; 
+  fRawData.fCrazyness  = tmpChannelPtr->fCrazyness; 
+  Reset(fRawData);
+  AliHLTCaloMapper::ChannelId2Coordinate( fRawData.fChannelID, fRawData.fCoordinate);
+  cout << __FILE__ << __LINE__ << " TP3" << endl; 
+  if( fRawData.fChannelID ==  fRawDataPtr[0]  )
+  {
+  cout << __FILE__ << __LINE__ << " TP4" << endl; 
+  Reset(fRawData);
+  cout << __FILE__ << __LINE__ << " TP5" << endl; 
+  UShort_t tmpTotSize =  fRawDataPtr[1];
+  UShort_t tmpStartBin   =  fRawDataPtr[2];
+  UShort_t tmpBunchtSize =  fRawDataPtr[3];
+  UShort_t tmpSamplesLeft = tmpTotSize -4; 
+  fRawData.nSamplesUsed =  tmpTotSize +  tmpStartBin;
+  cout << __FILE__ << __LINE__ << " TP6" << endl; 
+
+  while(tmpSamplesLeft > 0)
+  {
+  if ( (tmpBunchtSize <  ( ALTROMAXSAMPLES +4)) && tmpBunchtSize > 0   )
+  {
+  cout << __FILE__ << __LINE__ << " TP7" << endl; 
+  for(int i=0; i < tmpBunchtSize; i++ )
+  {
+  cout << __FILE__ << __LINE__ << "  TMP tot size =" <<  tmpBunchtSize <<  tmpTotSize  << endl;
+  cout << __FILE__ << __LINE__ << "  TMP bunch size =" <<  tmpTotSize  << endl;
+  cout << __FILE__ << __LINE__ << " TP8, i=" << i <<", tmpStartBin = "<< tmpStartBin  << " fCurrentCnt = "<< fCurrentCnt << endl; 
+  cout << __FILE__ << __LINE__ << " acessing fRawData.fDataPtr["<<  i + tmpStartBin  << "]" << endl; 
+  fRawData.fDataPtr[ i + tmpStartBin ] = fRawDataPtr[ i+ 4];
+  //                       cout << __FILE__ << __LINE__ << " acessing fRawData.fDataPtr["<<  i + tmpStartBin  << "]" << endl; 
+  tmpSamplesLeft --;
+  }
+  fRawDataPtr+= tmpTotSize;
+  }
+  else
+  {
+  tmpSamplesLeft = -1;
+  }
+  }
+  }
+  }
+  return tmpChannelPtr;
+  } 
+  else
+  {
+  Reset();
+  return 0;
+  }
+  return 0;
+  //   }
+  }
+*/
+
 
 void  
 AliHLTCaloSharedMemoryInterfacev2::NextRawChannel( )
index b110e73b1fa5e75047750cfeb2b1c3589b03606a..721d99f6b48615c1d5d88a97cc25af4c6ead0357 100644 (file)
@@ -18,7 +18,7 @@
 #include "AliHLTEMCALMapper.h"
 
 #include "AliHLTEMCALConstants.h"
-
+#include "assert.h"
 
 
 using namespace EmcalHLTConst;
@@ -26,8 +26,10 @@ using namespace EmcalHLTConst;
 //AliHLTCaloMapper
 
 
-AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification) 
+
+AliHLTEMCALMapper::AliHLTEMCALMapper(const unsigned long specification ) : AliHLTCaloMapper(specification)
 {
+  fCellSize = 6;
   InitAltroMapping(specification);
   InitDDLSpecificationMapping();
   fIsInitializedMapping = true; //CRAP PTH, must check is the initilization actually went ok
@@ -38,6 +40,18 @@ AliHLTEMCALMapper::~AliHLTEMCALMapper()
 {
 
 }
+  
+
+
+// channelCoord[0] = (static_cast<Float_t>(channelId&0x3f) - NXCOLUMNSMOD/2)* fCellStep;
+// channelCoord[1] = (static_cast<Float_t>((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellStep;
+
+void 
+AliHLTEMCALMapper::GetLocalCoord(const int channelId, Float_t* localCoord) const
+{
+  localCoord[0] = ( ( Float_t )(channelId&0x3f) - NXCOLUMNSMOD/2)  * fCellSize;
+  localCoord[1] = ( (Float_t)((channelId >> 6)&0x3f) - NZROWSMOD/2) * fCellSize;
+}
 
 
 void 
@@ -54,7 +68,14 @@ AliHLTEMCALMapper::InitAltroMapping(const unsigned long specification )
   
   if(base !=0)
     {
+      //      int tmpddlindex =  GetDDLFromSpec( specification )%2; 
+
       sprintf(fFilepath, "%s/EMCAL/mapping/%s", base,   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
+      sprintf(fFilepath, "%s/EMCAL/mapping/%s", base,   DDL2RcuMapFileName( GetDDLFromSpec( specification ) ) ); 
+
+      //   assert("DDL spec is  %d", GetDDLFromSpec( specification ) );
+     
+      cout << __FILE__ <<":"<< __LINE__ <<"DDL spec is " <<   GetDDLFromSpec( specification )  << endl;
       cout << __FILE__ <<":"<< __LINE__ <<"mapping filename is " <<  fFilepath << endl;
        // sprintf(fFilepath,"%s/PHOS/mapping/RCU0.data", base);
       FILE *fp = fopen(fFilepath, "r");
@@ -106,19 +127,10 @@ AliHLTEMCALMapper::InitDDLSpecificationMapping()
   
   for(Int_t ddl = 0; ddl < EmcalHLTConst::NMODULES*EmcalHLTConst::NRCUSPERMODULE; ddl++)
     {
-      fSpecificationMapPtr[ddl].fModId = ddl/EmcalHLTConst::NRCUSPERMODULE;
-      fSpecificationMapPtr[ddl].fRcuX = 0; 
-      fSpecificationMapPtr[ddl].fRcuZ = ddl%2; 
-      //      fSpecificationMapPtr[ddl].fRcuZOffset = NZROWSRCU*(fSpecificationMapPtr[ddl].fRcuZ);
-      //      fSpecificationMapPtr[ddl].fRcuXOffset = NXCOLUMNSRCU*(fSpecificationMapPtr[ddl].fRcuX);
+      fSpecificationMapPtr[ddl].fModId = ddl/(EmcalHLTConst::NRCUSPERMODULE);
     }
 }
 
-
-
-//RCU1C.data
-
-
 const char* 
 AliHLTEMCALMapper::DDL2RcuMapFileName(const int ddlIndex) const //0=4608, 1=4607 etc...
 {
@@ -133,42 +145,9 @@ AliHLTEMCALMapper::DDL2RcuMapFileName(const int ddlIndex) const //0=4608, 1=4607
     {
       tmpSide  = 'C';
     }
-  
-  sprintf(rname,"RCU%d%c.data", ddlIndex/NRCUSPERSECTOR, tmpSide );
+  int tmprcuindex = ddlIndex%2;
+  sprintf(rname,"RCU%d%c.data",  tmprcuindex,  tmpSide );
+  //sprintf(rname,"RCU%d%c.data", ddlIndex/NRCUSPERSECTOR, tmpSide );
   return rname;
-  // rname.fSector = ddlIndex/NRCUSPERSECTOR;
 }
  
-
-/*
-unsigned long 
-AliHLTEMCALMapper::GetSpecFromDDLIndex( const int ddlindex )
-{
-  return ( (unsigned long)1  <<  ddlindex ));
-}
-*/
-
-/*
-AliHLTEMCALMapper::GlobalX2ModuleId( const int globalX )
-{
-  return globalX/NXCOLUMNSMOD;  
-}
-*/
-
- /*
-static  const int 
-AliHLTEMCALMapper::GlobalZ2ModuleId( const int globalZ )
-{
-  return globalZ/NZROWSMOD;
-  }
- */
-
-
-  /*
- const int 
- AliHLTEMCALMapper::Global2ModuleId( const int globalZ,  const int globalX )
-{
-  int tmpModX = 
-}
-  */
index 9a08e6bb421c4b8c9ab72689a9dbb2423e884d18..85674e266313ca55dde520de54ac2df78131534a 100644 (file)
@@ -31,7 +31,7 @@ class  AliHLTEMCALMapper : public AliHLTCaloMapper
   virtual ~AliHLTEMCALMapper();
   virtual void InitAltroMapping( const unsigned long specification ); 
   virtual void InitDDLSpecificationMapping();
-  
+  virtual void GetLocalCoord(const int channelId, Float_t* localCoord) const; 
   //  static  const int GlobalX2ModuleId(const int globalX);
   //  static  const int GlobalZ2ModuleId(const int globalZ);
 
index b23031ae72cf8966db28b2ddf37d6dabc0b34246..03680747ee927d0bf818eaf950aa8e96ba26ebd6 100644 (file)
@@ -201,33 +201,55 @@ AliHLTEMCALOnlineDisplayEventTab::ReadBlockData(AliHLTHOMERReader *homeReaderPtr
   //  AliHLTEMCALCoordinate tmpCoord;
   AliHLTCaloCoordinate tmpCoord;
   
+  long wcnt = 0;
 
+  //  cout << __FILE__ << ":" << __LINE__ << "TP0"   << endl ;
+  
   while ( blk != ~(unsigned long)0 ) 
     {
-      
+      //     cout << __FILE__ << ":" << __LINE__ << "TP1"    << endl ;
+      //    cout << wcnt << "\t"; 
+
+      wcnt ++;
       //   AliHLTEMCALChannelDataHeaderStruct* cellEnergiesPtr = (AliHLTEMCALChannelDataHeaderStruct*)homeReaderPtr->GetBlockData( blk ); 
       AliHLTCaloChannelDataHeaderStruct* cellEnergiesPtr = (AliHLTCaloChannelDataHeaderStruct*)homeReaderPtr->GetBlockData( blk );    
 
       Int_t* tmpPtr = 0;
       fShmPtr->SetMemory(cellEnergiesPtr);
       currentChannel = fShmPtr->NextChannel();
-
+  
+      //    cout << __FILE__ << ":" << __LINE__ << "TP1.2"    << endl ;
+    
       while(currentChannel != 0)
        {
+         //      cout << cnt << "\t"; 
+
          cnt ++;
+         //       cout << __FILE__ << ":" << __LINE__ << "TP1.3"    << endl ;
          AliHLTEMCALMapper::ChannelId2Coordinate( currentChannel->fChannelID, tmpCoord );
+         //      cout << __FILE__ << ":" << __LINE__ << "TP1.4"    << endl ; 
          fgLegoPlotPtr[ tmpCoord.fGain ]->Fill(  tmpCoord.fModuleId*NXCOLUMNSMOD +   tmpCoord.fX,   tmpCoord.fZ, currentChannel->fEnergy );
+         //      cout << __FILE__ << ":" << __LINE__ << "TP1.5"    << endl ;
          fChannelEnergy[tmpCoord.fModuleId][tmpCoord.fZ][ tmpCoord.fX][tmpCoord.fGain] =  currentChannel->fEnergy;
+         cout << __FILE__ << ":" << __LINE__ << "TP1.6"    << endl ;
          
+         /*
          if(cellEnergiesPtr->fHasRawData == true)
            {
              FillRawData(fShmPtr->GetRawData());
            }
+         */
+         
          currentChannel = fShmPtr->NextChannel();
+
+         cout << __FILE__ << ":" << __LINE__ << "TP1.7"    << endl ;
        }
       //      blk = homeReaderPtr->FindBlockNdx("RENELLEC","SOHP", 0xFFFFFFFF, blk+1);
+      //   cout << __FILE__ << ":" << __LINE__ << "TP2"    << endl ;
       blk = homeReaderPtr->FindBlockNdx("TLENNAHC","SOHP", 0xFFFFFFFF, blk+1 );
-    }
+      //   cout << __FILE__ << ":" << __LINE__ << "TP3"    << endl ;
+   }
 }
 
 
index e56fa66460b075e8aaf840eed90ee3961e6d9919..8372987ca6796c8270a92aa7c820ecba7dd3dfae 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+#include "AliHLTPHOSRawAnalyzer.h"
 #include "AliHLTPHOSRawAnalyzerComponentv3.h"
+#include "AliHLTPHOSChannelDataHeaderStruct.h"
+#include "AliHLTPHOSChannelDataStruct.h"
 #include "AliHLTPHOSMapper.h"
-#include "AliHLTPHOSDefinitions.h"
+#include "AliHLTPHOSSanityInspector.h"
+
+#include "AliAltroRawStreamV3.h"
+#include "AliCaloRawStreamV3.h"
+#include "AliRawReaderMemory.h"
+
+
 #include "AliHLTPHOSUtilities.h"
 
 AliHLTPHOSRawAnalyzerComponentv3::AliHLTPHOSRawAnalyzerComponentv3():
-  AliHLTCaloRawAnalyzerComponentv3()
+  AliHLTPHOSRcuProcessor(), 
+  fAnalyzerPtr(0), 
+  fMapperPtr(0), 
+  fSanityInspectorPtr(0),
+  fRawReaderMemoryPtr(0),
+  fAltroRawStreamPtr(0),
+  fAlgorithm(0),
+  fOffset(0),
+  fBunchSizeCut(0),
+  fMinPeakPosition(0),
+  fMaxPeakPosition(100),
+  fkDoPushRawData(true),
+
+  fRawDataWriter(0)
 {
   //comment
+  fMapperPtr = new AliHLTPHOSMapper();
+
+  fRawReaderMemoryPtr = new AliRawReaderMemory();
+
+  fAltroRawStreamPtr = new AliAltroRawStreamV3(fRawReaderMemoryPtr);
+
+  fSanityInspectorPtr = new AliHLTPHOSSanityInspector();
+
+  if( fkDoPushRawData == true  )
+    {
+      
+      fRawDataWriter  = new AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter();
+
+    }
+
 }
 
 
 AliHLTPHOSRawAnalyzerComponentv3::~AliHLTPHOSRawAnalyzerComponentv3()
 {
   //comment
+  Deinit();
 }
 
 int 
 AliHLTPHOSRawAnalyzerComponentv3::Deinit()
 {
   //comment
+  if(fAnalyzerPtr)
+    {
+      delete fAnalyzerPtr;
+      fAnalyzerPtr = 0;
+    }
+  if(fMapperPtr)
+    {
+      delete  fMapperPtr;
+      fMapperPtr = 0;
+    }
+  if(fRawReaderMemoryPtr)
+    {
+      delete fRawReaderMemoryPtr;
+      fRawReaderMemoryPtr = 0;
+    }
+  if(fAltroRawStreamPtr)
+    {
+      delete fAltroRawStreamPtr;
+      fAltroRawStreamPtr = 0;
+    }
   return 0;
 }
 
+const char* 
+AliHLTPHOSRawAnalyzerComponentv3::GetComponentID()
+{
+  //comment
+  return "PhosRawAnalyzerv3";
+}
+
+
 void
 AliHLTPHOSRawAnalyzerComponentv3::GetInputDataTypes( vector<AliHLTComponentDataType>& list)
 {
@@ -227,30 +293,156 @@ AliHLTPHOSRawAnalyzerComponentv3::DoIt(const AliHLTComponentBlockData* iter, Ali
  
 
 int 
-AliHLTPHOSRawAnalyzerComponentv3::WriteRawData(AliHLTPHOSChannelDataStruct *dtaPtr)
+AliHLTPHOSRawAnalyzerComponentv3::WriteRawData(AliHLTPHOSChannelDataStruct*) //dtaPtr)
 {
   return 0;
 }
 
 int
-AliHLTPHOSRawAnalyzerComponentv3::InitMapping( const int spec)
+AliHLTPHOSRawAnalyzerComponentv3::DoInit( int argc, const char** argv )
 { 
 
   //See base class for documentation
   // fPrintInfo = kFALSE;
+  int iResult=0;
+  fMapperPtr = new AliHLTPHOSMapper();
 
-  if(fMapperPtr == 0)
+  for(int i = 0; i < argc; i++)
     {
-      fMapperPtr = new AliHLTPHOSMapper();
+      if(!strcmp("-offset", argv[i]))
+       {
+         fOffset = atoi(argv[i+1]);
+       }
+      if(!strcmp("-bunchsizecut", argv[i]))
+       {
+         fBunchSizeCut = atoi(argv[i+1]);
+       }
+      if(!strcmp("-minpeakposition", argv[i]))
+       {
+         fMinPeakPosition = atoi(argv[i+1]);
+       }
+      if(!strcmp("-maxpeakposition", argv[i]))
+       {
+         fMaxPeakPosition = atoi(argv[i+1]);
+       }  
     }
  
   if(fMapperPtr->GetIsInitializedMapping() == false)
     {
-      HLTError("%d:%d, ERROR, mapping not initialized ", __FILE__, __LINE__ );
-      exit(-2);
+      Logging(kHLTLogFatal, __FILE__ , IntToChar(  __LINE__ ) , "AliHLTPHOSMapper::Could not initialise mapping from file %s, aborting", fMapperPtr->GetFilePath());
+      return -4;
     }
 
   return iResult;
 }
 
 
+
+
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::RawDataWriter() :  //fIsFirstChannel(true),
+                                                                   fRawDataBuffer(0),
+                                                                   fCurrentChannelSize(0),
+                                                                   //    fIsFirstChannel(true),
+                                                                   fBufferIndex(0),
+                                                                   fBufferSize( NZROWSRCU*NXCOLUMNSRCU*ALTROMAXSAMPLES*NGAINS +1000 ),
+                                                                   fCurrentChannelIdPtr(0),
+                                                                   fCurrentChannelSizePtr(0),
+                                                                   fCurrentChannelDataPtr(0),
+                                                                   fTotalSize(0)
+{
+  fRawDataBuffer = new UShort_t[fBufferSize];
+  Init();
+}
+
+
+   
+void  
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::Init()
+{
+  fCurrentChannelIdPtr = fRawDataBuffer;
+  fCurrentChannelSizePtr = fRawDataBuffer +1;
+  fCurrentChannelDataPtr = fRawDataBuffer +2;
+  ResetBuffer();
+}
+
+void
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::NewEvent()
+{
+  Init();
+  fTotalSize = 0;
+}
+
+
+void
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::NewChannel( )
+{
+  *fCurrentChannelSizePtr   = fCurrentChannelSize;
+  fCurrentChannelIdPtr     += fCurrentChannelSize;
+  fCurrentChannelSizePtr    += fCurrentChannelSize;
+  fCurrentChannelDataPtr   += fCurrentChannelSize;
+  fBufferIndex = 0;
+  fCurrentChannelSize = 2;
+  fTotalSize += 2;
+}
+
+
+void 
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::WriteBunchData(const UShort_t *bunchdata,  const int length,   const UInt_t starttimebin )
+{
+  fCurrentChannelDataPtr[fBufferIndex] = starttimebin;
+  fCurrentChannelSize ++;
+  fBufferIndex++;
+  fCurrentChannelDataPtr[fBufferIndex] = length;
+  fCurrentChannelSize ++;
+  fBufferIndex++;
+
+  fTotalSize +=2;
+
+  for(int i=0; i < length; i++)
+    {
+      fCurrentChannelDataPtr[ fBufferIndex + i ] =  bunchdata[i];
+    }
+
+  fCurrentChannelSize += length;
+  fTotalSize += length;
+  fBufferIndex += length;
+}
+
+
+void
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::SetChannelId( const UShort_t channeldid  )
+{
+  *fCurrentChannelIdPtr =  channeldid;
+}
+
+
+void
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::ResetBuffer()
+{
+  for(int i=0; i < fBufferSize ; i++ )
+    {
+      fRawDataBuffer[i] = 0;
+    }
+}
+
+
+int
+AliHLTPHOSRawAnalyzerComponentv3::RawDataWriter::CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused )
+{
+  int sizerequested =  (sizeof(int)*fTotalSize + sizeused);
+
+  if(  sizerequested   > sizetotal  )
+    {
+      return 0;
+  }
+  else
+    {
+      for(int i=0; i < fTotalSize; i++)
+       {
+         memPtr[i] = fRawDataBuffer[i]; 
+       }
+      return fTotalSize;
+   }
+}
+  
index f48ab391f248cfb47a71cfbf433e1f47f3d5abd4..2933f1cbf9937ac7ef3287ae9cc74710a20f9f1f 100644 (file)
@@ -25,7 +25,7 @@
  * @file   AliHLTPHOSRawAnalyzerComponentv3.h
  * @author Oystein Djuvsland
  * @date   
- * @brief  A raw analyzer component for PHOS HLT
+ * @brief  A clusterizer component for PHOS HLT
 */
 
 // see below for class documentation
@@ -53,6 +53,49 @@ class AliHLTPHOSChannelDataStruct;
 
 /**
  * @class AliHLTPHOSRawAnalyzerComponentv3
+ * This the new and fast version of the component taking care of the decoding and energy and timing 
+ * extraction of the raw data from PHOS.
+ *
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b PhosRawAnalyzerv3 <br>
+ * Library: \b libAliHLTPHOS.so     <br>
+ * Input Data Types: @ref <br>
+ * Output Data Types: @ref AliHLTPHOSDefinitions::fgkChannelDataType<br>
+ *
+ * <h2>Mandatory arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li No mandatory arguments for component                           <br>
+ *
+ * <h2>Optional arguments:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -offset      <i> value </i> <br>
+ *      gives the offset added to the data during zero suppression (default value: 0)
+ * \li -bunchsizecut <i> value </i> <br>
+ *      minimum number of samples a bunch must contain to be considered  (default value: 0)
+ * \li -minpeakposition <i> value </i> <br>
+ *      cut on minimum postion of the peak in the bunch (defaul value: 0)
+ * \li -maxpeakposition <i> value </i> <br>
+ *      cut on maximum postion of the peak in the bunch (defaul value: 100)
+ *
+ * <h2>Configuration:</h2>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li No configuration arguments 
+ *
+ * <h2>Default CDB entries:</h2>
+ * \li No CDB entry yet, will come.
+ *
+ * <h2>Performance:</h2>
+ * Pretty good (~ 3 kHz), depends on amount of data...
+ *
+ * <h2>Memory consumption:</h2>
+ * Depends on the amount of data, but pretty godd
+ *
+ * <h2>Output size:</h2>
+ * Depends on the amount of data...
+ *
+ * More detailed description. (Soon)
+ *
  * @ingroup alihlt_phos
  */ 
 
@@ -90,27 +133,107 @@ class AliHLTPHOSRawAnalyzerComponentv3 : public AliHLTPHOSRcuProcessor
 
  protected:
 
+  /** interface function, see @ref AliHLTComponent for description */
+  using AliHLTPHOSRcuProcessor::DoEvent;
+
+  /** interface function, see @ref AliHLTComponent for description */
+  virtual int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
+                    AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
+                      AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );  
+
   /** 
-   * Check for correct input data type (raw data from PHOS) 
-   * @datatype is the data type specifier
-   * @return true if the data type is correct
+   * Do the real processing in the component 
+   * @param iter is the pointer to the data blocks
+   * @param outputPtr is the pointer to the output buffer
+   * @param size is the available size for output
+   * @param totSize is the total size used for output
+   * @return the size output size used
    */
-  virtual bool CheckInputDataType(const AliHLTComponentDataType &datatype);
+  virtual Int_t DoIt(const AliHLTComponentBlockData* iter, AliHLTUInt8_t* outputPtr, const AliHLTUInt32_t size, UInt_t& totSize); 
+
+
+  /** Pointer to an analyzer object used for raw data anlysis */ 
+  AliHLTPHOSRawAnalyzer *fAnalyzerPtr;   //COMMENT
 
  private:
 
+  int WriteRawData( AliHLTPHOSChannelDataStruct *dtaPtr );
+
   /** Keep the copy constructor private since it should not be used */
   AliHLTPHOSRawAnalyzerComponentv3(const AliHLTPHOSRawAnalyzerComponentv3 & );
 
   /** Keep the assignement operator private since it should not be used */
   AliHLTPHOSRawAnalyzerComponentv3 & operator = (const AliHLTPHOSRawAnalyzerComponentv3 &);
+
+  /** Mapping from harware address to geometrical address */
+  AliHLTPHOSMapper *fMapperPtr;                       //!transient 
+
+  /** Pointer to object which may check the integrity of the data */
+  AliHLTPHOSSanityInspector *fSanityInspectorPtr;     //!transient
+
+  /** Pointer to the raw data reader which reads from memory */
+  AliRawReaderMemory* fRawReaderMemoryPtr;            //!transient
   
-  /** 
-   * Initialise the mapping according to the specification
-   * @specification is the specification provided by the HLT framework
-   */
-  virtual void InitMapping(const int specification);
+  /** Pointer to the raw stream */
+  AliAltroRawStreamV3* fAltroRawStreamPtr;              //!transient
+
+  /** Describing which algorithm we are using */
+  Short_t fAlgorithm;                                 //COMMENT
 
+  /** The offset applied before ZS */
+  Int_t fOffset;                                      //COMMENT
+
+  /** The minimum length a bunch can have to be considered */
+  Int_t fBunchSizeCut;                                //COMMENT
+
+  /** The lowest position a peak can have to be considered */
+  Int_t fMinPeakPosition;                             //COMMENT
+  
+  /** The maximum position a peak can have to be considered */
+  Int_t fMaxPeakPosition;                             //COMMENT
+
+
+  const bool fkDoPushRawData;
+  
+  // const UShort_t* fRawDataBuffer;
+  // RawDataWriter *fRawDataWriter; 
+
+  //  class RawDataWriter : public AliHLTLogging
+  class RawDataWriter 
+  {
+  public:
+    RawDataWriter();
+    ~RawDataWriter();
+    //   void WriteChannelId(const UShort_t channeldid );
+    void NewChannel( );
+    void WriteBunchData(const UShort_t *bunchdata,  const int length,   const UInt_t starttimebin );
+    void ResetBuffer();
+    void SetChannelId( const UShort_t channeldid );
+
+    //void CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused );
+    int CopyBufferToSharedMemory(UShort_t *memPtr, const int sizetotal, const int sizeused );
+  
+ void NewEvent();
+ private:
+    RawDataWriter (const RawDataWriter  & );
+    RawDataWriter & operator = (const RawDataWriter &);
+    
+    void Init();
+    
+    //    bool fIsFirstChannel;
+    UShort_t* fRawDataBuffer;
+    int fCurrentChannelSize;
+    int fBufferIndex;
+    int fBufferSize;
+    UShort_t *fCurrentChannelIdPtr;
+    UShort_t *fCurrentChannelSizePtr; 
+    UShort_t *fCurrentChannelDataPtr; 
+    int fTotalSize;
+ };
+
+  RawDataWriter *fRawDataWriter; 
 
 };
 
index 1b461cfaf3838792eddebcde123c9d4adb6d84bc..3f16ae05e9c2ec898ae477875042e628068c0b6b 100644 (file)
@@ -36,7 +36,6 @@
 #include "TObjArray.h"
 #include "TObjString.h"
 #include "TObjArray.h"
-#include "TVector3.h"
 #include "AliCDBEntry.h"
 #include "AliCDBManager.h"
 #include "TFile.h"
@@ -59,6 +58,7 @@ AliHLTTriggerBarrelGeomMultiplicity::AliHLTTriggerBarrelGeomMultiplicity()
   // refer to README to build package
   // or
   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
+  fDetectorArray = new TObjArray(1);
 
   fDetectorArray = new TObjArray;
 
@@ -142,20 +142,27 @@ int AliHLTTriggerBarrelGeomMultiplicity::DoTrigger()
        }
     }
 
-
   if (numberOfTracks>=fMinTracks) 
     {
-      SetDescription(fTriggerDecisionPars->GetDescription());
-      AliHLTReadoutList readout(fTriggerDecisionPars->GetReadoutListParameter());
-      AliHLTTriggerDecision decision(
-                                    true,
-                                    fTriggerDecisionPars->GetTriggerName().Data(),
-                                    AliHLTTriggerDomain(readout),
-                                    fTriggerDecisionPars->GetDescription()
-                                    );
-      TriggerEvent(&decision);
+      if(fTriggerDecisionPars)
+       {
+
+         SetDescription(fTriggerDecisionPars->GetDescription());
+         AliHLTReadoutList readout(fTriggerDecisionPars->GetReadoutListParameter());
+         AliHLTTriggerDecision decision(
+                                        true,
+                                        fTriggerDecisionPars->GetTriggerName().Data(),
+                                        AliHLTTriggerDomain(readout),
+                                        fTriggerDecisionPars->GetDescription()
+                                        );
+         TriggerEvent(&decision);
+         HLTDebug("Geometrical acceptance trigger %s triggered", fTriggerDecisionPars->GetTriggerName().Data());
+       }
+      else
+       {
+         HLTError("Trigger decision parameters not set, event not triggered");
+       }
     }
-  
   return iResult;
 
 }
@@ -230,9 +237,20 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const cha
 {
     // see header file for function documentation
   int nDetectorGeoms=0;
+
+  if(fDetectorArray)
+    {
+      fDetectorArray->Clear();
+    }
+  else
+    {
+      fDetectorArray = new TObjArray();
+    }
+  
   const char *path = cdbEntry;
-  if(!path) path = fOCDBEntry;
 
+  if(!path) path = fOCDBEntry;
+  
   if(path)
     {
       //     const char* chainId=GetChainId();
@@ -254,7 +272,7 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const cha
                    {
                      fDetectorArray->AddLast(dynamic_cast<AliHLTTriggerDetectorGeom*>(pArr->At(i)));
                      nDetectorGeoms++;
-                     HLTWarning("received detector geometry of type %s", pArr->At(i)->ClassName());
+                     HLTDebug("received detector geometry of type %s", pArr->At(i)->ClassName());
                    }
                  else
                    {
@@ -274,6 +292,9 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromCDBObject(const cha
          nDetectorGeoms=-ENOENT;
        }
     }
+
+  HLTInfo("received %d detector geometries", nDetectorGeoms);
+
   return nDetectorGeoms;
 }
 
@@ -282,6 +303,16 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *fi
     // see header file for function documentation
   int nDetectorGeoms=0;
 
+  if(fDetectorArray)
+    {
+      fDetectorArray->Clear();
+    }
+  else
+    {
+      fDetectorArray = new TObjArray();
+    }
+  
+
   if (filename) 
     {
       TFile *geomfile = TFile::Open(filename, "READ");
@@ -303,7 +334,7 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *fi
                    {
                      fDetectorArray->AddLast(dynamic_cast<AliHLTTriggerDetectorGeom*>(pArr->At(i)));
                      nDetectorGeoms++;
-                     HLTWarning("received detector geometry of type %s", pArr->At(i)->ClassName());
+                     HLTDebug("received detector geometry of type %s", pArr->At(i)->ClassName());
                    }
                  else
                    {
@@ -323,7 +354,12 @@ int AliHLTTriggerBarrelGeomMultiplicity::GetDetectorGeomsFromFile(const char *fi
          nDetectorGeoms=-ENOENT;
        }
     }
-  HLTWarning("received TObjArray with %d detector geometries", nDetectorGeoms);
+  else
+    {
+      HLTError("ROOT file name not specified");
+    }
+  HLTInfo("received %d detector geometries", nDetectorGeoms);
+
 
   return nDetectorGeoms;
 }
@@ -357,3 +393,4 @@ int AliHLTTriggerBarrelGeomMultiplicity::ScanConfigurationArgument(int argc, con
   }    
   return 0;
 }
+
index 74592596e6c21ff50a536a5a164a1e411f509f98..06e2b9029432df191c0522510300cc5ad82bb392 100644 (file)
@@ -15,6 +15,7 @@
 //**************************************************************************
 
 #include "AliHLTTriggerDecisionParameters.h"
+
 AliHLTTriggerDecisionParameters::AliHLTTriggerDecisionParameters() :
   TObject()
   ,fTriggerName()
index f54fe3a2b1f90a4344758ca8446fbc2d2e9a0f41..48f69628520736a1de2eaea5b30906c0b1bcb6ae 100644 (file)
@@ -74,14 +74,12 @@ void AliHLTTriggerDetectorGeom::SetNormVector(Double_t *nVector)
 void AliHLTTriggerDetectorGeom::GetInitialPoint(Double_t *point)
 {
   // See header file for class documentation
-
   for(int i = 0; i < 3; i++)
     {
       point[i] = fInitalPoint[i];
     }
 }
 
-
 void AliHLTTriggerDetectorGeom::GetNormVector(Double_t *vec)
 {
   // See header file for class documentation
@@ -100,7 +98,6 @@ void AliHLTTriggerDetectorGeom::PrintDetectorGeom(std::ostream &out)
   out << "Eta Max: " << fEtaMax << std::endl;
   out << "Phi Min: " << fPhiMin << std::endl;
   out << "Phi Max: " << fPhiMax << std::endl;
-
   out << "Initial Point: {" << fInitalPoint[0] << ", " << fInitalPoint[1] << ", " << fInitalPoint[2] << "}" << std::endl; 
   out << "Normal Vector: {" << fNormVector[0] << ", " << fNormVector[1] << ", " << fNormVector[2] << "}" << std::endl; 
 }
index 606eb8e7904ed60e71d495a5f198e6656a7e0df4..df9357e6506dac28292d3384c48e82b2d48a5be1 100644 (file)
@@ -15,8 +15,6 @@
 #include "TString.h"
 #include <ostream>
 #include "TObject.h"
-#include "TString.h"
-#include <ostream>
 
 /**
  * @class  AliHLTTriggerDetectorGeom
index 322eb3652a9c836585627cf9239edab460f8d466..1c45715dba025a4f2818f60ea8f53e604ca37327 100644 (file)
@@ -48,7 +48,6 @@ Bool_t AliHLTTriggerDetectorGeomRectangle::IsInDetector(Double_t point[3])
   // See header file for class documentation
   TVector3 trackPos(point);
   
-
   Double_t phi = 0;
 
   if(trackPos.Phi() < 0) phi = trackPos.Phi() + 2*TMath::Pi();
@@ -65,6 +64,17 @@ Bool_t AliHLTTriggerDetectorGeomRectangle::IsInDetector(Double_t point[3])
 
   //  printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - false\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
 
+  if(trackPos.Eta() >= fEtaMin && 
+     trackPos.Eta() <= fEtaMax &&
+     phi >= fPhiMin &&
+     phi <= fPhiMax)
+    {
+      //      printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - true\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
+      return true;
+    }
+
+  //  printf("Checking point: Eta: %f Phi: %f against cuts EtaMin: %f EtaMax: %f PhiMin: %f PhiMax: %f - false\n", trackPos.Eta(), phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax);
+
   return false;
 }
 
index 5fa97f56892638cd0ba0385900b1b3dd19772162..97ac0c8723037b73c4df24bf449bceed941b392b 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "AliHLTTriggerDetectorGeom.h"
 
-
 /**
  * @class  AliHLTTriggerDetectorGeomRectangle
  * HLT class describing simple rectangular geometry cuts of (sub-)detectors.
@@ -22,6 +21,8 @@
  * \ingroup alihlt_trigger
  */
 
+#include "AliHLTTriggerDetectorGeom.h"
+
 class AliHLTTriggerDetectorGeomRectangle : public AliHLTTriggerDetectorGeom
 {
 public: