Skip to content

Commit

Permalink
update stu raw stream decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
guernane committed Dec 4, 2015
1 parent b5a806b commit e22b204
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 48 deletions.
56 changes: 13 additions & 43 deletions EMCAL/EMCALbase/AliEMCALTriggerSTURawStream.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
Expand All @@ -14,6 +13,13 @@
* provided "as is" without express or implied warranty. *
**************************************************************************/

//_________________________________________________________________________
// This class provides access to EMCAL/DCAL STU DDL raw data.
//--
// Author : Hiroki Yokoyama (Univ. of TSUKUBA / Univ. of Grenoble)
// contact : [email protected]
// Last Update : 23. Nov. 2015
//_________________________________________________________________________

#include "AliEMCALTriggerSTURawStream.h"
#include "AliRawReader.h"
Expand Down Expand Up @@ -184,14 +190,12 @@ Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad()
eqId = fRawReader->GetEquipmentId();
eqSize = fRawReader->GetEquipmentSize();
}
if(iword > max_payload_size -1 )return kFALSE ;
word32[iword++] = w32;
//cout<<dec<<iword<<" , "<<hex<<w32<<endl;

//cout<<dec<<setw(5)<<iword<<" , "<<hex<<setw(10)<<w32<<dec<<setw(10)<<w32<<endl;
}

Int_t poffset = 0 ;
//firmware vesion confirmation (DCAL)
//Bool_t isDCALfirst = ((word32[20] & 0x0000f000) == 0x0000d000)? kTRUE : kFALSE ;//DCAL first

//payload type selector
if(false){}
Expand Down Expand Up @@ -249,34 +253,6 @@ Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad()
fPayload = V2EMCALRaw ;
fDetector = kEMCAL ;
}

//else if(iword==(kPayLoadSizeV2_DCAL + kPayLoadSizeV2_EMCAL )){
// //poffset = (fDetector == kDCAL)? 0 : kPayLoadSizeV2_DCAL ;
// if(isDCALfirst) poffset = (fDetector == kDCAL )? 0 : kPayLoadSizeV2_DCAL ;//DCAL first
// else poffset = (fDetector == kEMCAL)? 0 : kPayLoadSizeV2_EMCAL ;//EMCAL first
// fPayload = (fDetector == kDCAL)? V2DCAL : V2EMCAL ;
//}
//
//else if(iword==(kPayLoadSizeV2_DCAL + kPayLoadSizeV2_EMCAL + kPayLoadSizeV2_EMCAL_Raw)){
// //poffset = (fDetector == kDCAL)? 0 : kPayLoadSizeV2_DCAL ;
// if(isDCALfirst) poffset = (fDetector == kDCAL )? 0 : kPayLoadSizeV2_DCAL ;//DCAL first
// else poffset = (fDetector == kEMCAL)? 0 : kPayLoadSizeV2_EMCAL + kPayLoadSizeV2_EMCAL_Raw ;//EMCAL first
// fPayload = (fDetector == kDCAL)? V2DCAL : V2EMCALRaw ;
//}
//
//else if(iword==(kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw + kPayLoadSizeV2_EMCAL )){
// //poffset = (fDetector == kDCAL)? 0 : kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw ;
// if(isDCALfirst) poffset = (fDetector == kDCAL )? 0 : kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw ;//DCAL first
// else poffset = (fDetector == kEMCAL)? 0 : kPayLoadSizeV2_EMCAL ;//EMCAL first
// fPayload = (fDetector == kDCAL)? V2DCALRaw : V2EMCAL ;
//}
//
//else if(iword==(kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw + kPayLoadSizeV2_EMCAL + kPayLoadSizeV2_EMCAL_Raw)){
// poffset = (fDetector == kDCAL)? 0 : kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw ;
// if(isDCALfirst) poffset = (fDetector == kDCAL )? 0 : kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw ;//DCAL first
// else poffset = (fDetector == kEMCAL)? 0 : kPayLoadSizeV2_EMCAL + kPayLoadSizeV2_EMCAL_Raw ;//EMCAL first
// fPayload = (fDetector == kDCAL)? V2DCALRaw : V2EMCALRaw ;
//}

else{
AliError(Form("STU payload (eqId: %d, eqSize: %d) doesn't match expected size! %d word32", eqId, eqSize, iword));
Expand All @@ -290,14 +266,6 @@ Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad()
default : {}
}//end case

//std::cout <<"Selected DDL Configuration : "
// <<" eqId : " << eqId
// <<" eqSize : " << eqSize
// <<" detector : "<< fDetector
// <<" payload : " << fPayload
// <<" RawData : " << fGetRawData
// <<endl;

int index = poffset;
int offset = 0;
int nJetThresh = 0;
Expand Down Expand Up @@ -533,7 +501,9 @@ void AliEMCALTriggerSTURawStream::DecodeL1JetPatchIndexes(const int i, UInt_t *w
for (Int_t ix = 0; ix < nSubregion_eta - (jetSize-1) ; ix++){
UInt_t currentrow = word32[offset + ix];
for (Int_t iy = 0; iy < nSubregion_phi - (jetSize-1); iy++){
if (currentrow & (1 << iy)){
Int_t bit = (fDetector == kDCAL)? (currentrow & (1 << iy)) : (currentrow & (1<<(nSubregion_phi-jetSize-iy)));
//if (currentrow & (1 << iy))
if (bit){
fNL1JetPatch[i] = fNL1JetPatch[i] + 1;
fL1JetPatchIndex[fNL1JetPatch[i] - 1][i] = ((ix << 8) & 0xFF00) | (iy & 0xFF);
}
Expand Down Expand Up @@ -656,7 +626,7 @@ void AliEMCALTriggerSTURawStream::DecodeTRUADC(UInt_t *word32, const int offset)
//_____________________________________________________________________________
void AliEMCALTriggerSTURawStream::DecodePHOSSubregion(UInt_t *word32, const int offset){
for (Int_t index=0;index<36;index++){
fPHOSSubregion[index] = word32[offset + index] & 0x7FFFF ;
fPHOSSubregion[index] = word32[offset + index] & 0xFFFFFFFF ;
}
}

Expand Down
9 changes: 4 additions & 5 deletions EMCAL/EMCALbase/AliEMCALTriggerSTURawStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */

/*
Author: H. Yokoyama (Univ. of TSUKUBA/ Univ. of Grenoble)
*/

#ifndef ROOT_TObject
# include "TObject.h"
#endif
Expand Down Expand Up @@ -92,16 +96,11 @@ class AliEMCALTriggerSTURawStream: public TObject
static const Int_t kPayLoadSizeV1_2 = 390 ;
static const Int_t kPayLoadSizeV1_2_Raw = 1536 ;

//static const Int_t kPayLoadSizeV2_EMCAL = 401 ;//10+17+11+11+96+128+128
static const Int_t kPayLoadSizeV2_EMCAL = 391 ;//17+11+11+96+128+128
static const Int_t kPayLoadSizeV2_EMCAL_Raw = 1536 ;//96*32/2
//static const Int_t kPayLoadSizeV2_DCAL = 207 ;//10+21+11+11+42+ 56+ 56
static const Int_t kPayLoadSizeV2_DCAL = 197 ;//21+11+11+42+ 56+ 56
static const Int_t kPayLoadSizeV2_DCAL_Raw = 708 ;//96*14/2 +36

//static const Int_t max_payload_size = kPayLoadSizeV2_DCAL + kPayLoadSizeV2_DCAL_Raw
// + kPayLoadSizeV2_EMCAL + kPayLoadSizeV2_EMCAL_Raw ;
//static const Int_t max_payload_size = 915 + 1937 ;
static const Int_t max_payload_size = 1937 ;

static const Int_t max_L0GammaPatchIndex = 3100 ; // (48-1)*(64-1) = 2961 (EMCAL)
Expand Down

0 comments on commit e22b204

Please sign in to comment.