StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
StEmcDecoder Class Reference

#include <StEmcDecoder.h>

Inheritance diagram for StEmcDecoder:

Public Member Functions

 StEmcDecoder (unsigned int date=20330101, unsigned int time=000000, bool TowerMapBug=false)
 StEmcDecoder constructor.
 
virtual ~StEmcDecoder ()
 StEmcDecoder destructor.
 
void SetDateTime (const TDatime &dt)
 
void SetDateTime (unsigned int date, unsigned int time)
 Sets the timestamp to be used.
 
bool GetFixTowerMapBug (void) const
 Shows if the tower map bug is being fixed on the fly.
 
void SetFixTowerMapBug (bool fix)
 Sets the tower map bug fix.
 
int GetTowerBugCorrectionShift (int id_original, int &shift) const
 Returns the index shift for the tower in original map. More...
 
int GetPreshowerBugCorrectionShift (int id_original, int &shift) const
 Returns the index shift for the preshower in original map. More...
 
int GetSmdBugCorrectionShift (int id_original, int &shift) const
 Returns the index shift for the SMD in original map. More...
 
int GetTowerBin (int softId, int &m, int &e, int &s) const
 Convert from softId to m,e,s for towers only. More...
 
int GetDaqIdFromTowerId (int softId, int &RDO) const
 Get Daq Id from Software Id for towers. More...
 
int GetCrateFromTowerId (int softId, int &crate, int &sequence) const
 Get crate number and position in crate for Software Id.
 
int GetTDCFromTowerId (int softId, int &TDC) const
 Get TDC channel from Software Id.
 
int GetTriggerPatchFromTowerId (int softId, int &patchId) const
 Get trigger patch that contains software Id.
 
int GetJetPatchFromTowerId (int softId, int &jetPatch) const
 Get jet patch that contains software Id.
 
int GetTowerIdFromBin (int m, int e, int s, int &softId) const
 Get Software Id from (m,e,s) space.
 
int GetTowerIdFromDaqId (int RDO, int &softId) const
 Get Sofwtare Id from Daq Id for towers. More...
 
int GetTowerIdFromCrate (int crate, int sequence, int &softId) const
 Get Software Id from Crate number and position in crate for towers. More...
 
int GetTowerIdFromTDC (int TDC, int sequence, int &softId) const
 Get Software Id from TDC channel number and position in TDC for towers. More...
 
int GetTowerCrateFromDaqId (int RDO, int &crate, int &sequence) const
 Get crate number from Daq Id for towers. More...
 
int GetTowerCrateFromTDC (int TDC, int &crate) const
 Get crate number from TDC channel for towers. More...
 
int GetTowerTDCFromCrate (int crate, int &TDC) const
 Get TDC channel from crate number for towers. More...
 
int GetTowerTDCFromDaqId (int RDO, int &TDC) const
 Get TDC channel from Daq Id for towers. More...
 
int GetTriggerPatchFromCrate (int crate, int sequence, int &patchId) const
 returns the trigger patch from crate and sequence in the crate More...
 
int GetCrateAndSequenceFromTriggerPatch (int patchId, int &crate, int &sequence) const
 returns the crate number and start point for a given trigger patch More...
 
int GetTriggerPatchFromJetPatch (int jetPatch, int sequence, int &patchId) const
 returns the trigger patch from big jet patch and the sequence in it More...
 
int GetJetPatchAndSequenceFromTriggerPatch (int patchId, int &jetPatch, int &sequence) const
 return the big jet patch and sequence number within it from the More...
 
int GetDSMFromTriggerPatch (int patchId, int &dsmModule) const
 dsmModule is set to the DSM module containing this trigger patch (0-299)
 
int GetTriggerPatchesFromDSM (int dsmModule, int *triggerPatches) const
 triggerPatches is an int[10]; contents will be set to the TPs of the supplied DSM #
 
int GetSmdCoord (int RDO, int posInFiber, int &det, int &m, int &e, int &s, bool print=false) const
 Get SMD detector (3==SMDE, 4==SMDP), m, e, s from RDO and position for SMD. More...
 
int GetSmdCoord (int RDO, int posInFiber, int &det, int &m, int &e, int &s, int &wire, int &A_value, bool print=false) const
 Get SMD detector (3==SMDE, 4==SMDP), m, e, s from RDO and position for SMD. Also returns smd-wire and A_value. More...
 
int GetSmdRDO (int detector, int m, int e, int s, int &RDO, int &posInFiber) const
 Get SMD fiber and position from detector number (3==SMDE, 4==SMDP), m, e, s. More...
 
int GetPsdId (int RDO, int posInFiber, int &softId, bool print=false) const
 Get PSD id. More...
 
int GetPsdId (int RDO, int posInFiber, int &softId, int &PMTbox, int &wire, int &A_value, bool print=false) const
 Get PSD id. Also returns PMTBox, wire number and FEE value. More...
 
int GetPsdRDO (int softId, int &RDO, int &posInFiber) const
 Get PSD fiber and position from id. More...
 
void PrintTowerMap (ofstream *out) const
 Print Tower MAP.
 
void PrintSmdMap (ofstream *out) const
 Print SMD MAP.
 
void PrintPsdMap (ofstream *out) const
 Print SMD MAP.
 

Detailed Description

Author
Alexandre A. P. Suaide

This class makes the decodification from EMC daq and electronics scheme to software scheme. This class has methods to decode the numbers in both directions and it works for SMD and towers.

The current id's definitions are:

Definition at line 36 of file StEmcDecoder.h.

Member Function Documentation

int StEmcDecoder::GetCrateAndSequenceFromTriggerPatch ( int  PATCH,
int &  CRATE,
int &  crate_seq 
) const

returns the crate number and start point for a given trigger patch

Parameters
PATCHis the software id for towers
CRATEis the crate number
crate_seqis the position of the tower inside the crate (0 <= crate_seq <=159)

Definition at line 262 of file StEmcDecoder.cxx.

int StEmcDecoder::GetDaqIdFromTowerId ( int  TowerId,
int &  RDO 
) const

Get Daq Id from Software Id for towers.

Parameters
TowerIdis the software id for towers
RDOis the DAQ id

Definition at line 204 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::getBemcADCRaw(), and StBemcData::make().

int StEmcDecoder::GetJetPatchAndSequenceFromTriggerPatch ( int  triggerPatch,
int &  jetPatch,
int &  jetPatch_seq 
) const

return the big jet patch and sequence number within it from the

Parameters
jetPatchis the jet patch id (0 <= jetPatch <= 11)
jetPatch_seqis the trigger patch position within the jet patch (0 <= jetPatch_seq <= 24)
triggerPatchis the trigger patch id (0 <= triggerPatch <=299)

Definition at line 302 of file StEmcDecoder.cxx.

int StEmcDecoder::GetPreshowerBugCorrectionShift ( int  id_original,
int &  id_shift 
) const

Returns the index shift for the preshower in original map.

GetPreshowerBugCorrectionShift method - returns the id shift with respect to the preshower index (software) in the original map

Parameters
id_originalis the soft_id in the original map
id_shiftis the shift that should be applied to the id. In this case, id_corrected = Id_original+id_shift

Definition at line 89 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::makeHit().

int StEmcDecoder::GetPsdId ( int  RDO,
int  index,
int &  id,
bool  print = false 
) const

Get PSD id.

Parameters
RDOis the PSD fiber number
indexis the position in the fiber
idis the software Id
printenables/disables some printout information

The Pre Shower and SMD crates are identical and they share almost the same decoder.

Definition at line 426 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::makeHit(), and PrintPsdMap().

int StEmcDecoder::GetPsdId ( int  RDO,
int  index,
int &  softId,
int &  PMTBox,
int &  wire,
int &  A_value,
bool  print = false 
) const

Get PSD id. Also returns PMTBox, wire number and FEE value.

Parameters
RDOis the PSD fiber number
indexis the position in the fiber
idis the software Id
PMTis the PMT box number
wireis the equivalent mux-wire in the SMD/PSD crate
A_valueis the A_value in the FEE card
printenables/disables some printout information

The Pre Shower and SMD crates are identical and they share almost the same decoder.

Definition at line 443 of file StEmcDecoder.cxx.

int StEmcDecoder::GetPsdRDO ( int  id,
int &  RDO,
int &  index 
) const

Get PSD fiber and position from id.

Parameters
idis the software Id
RDOis the PSD fiber number
indexis the position in the fiber

Definition at line 462 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::getBemcADCRaw(), StBemcData::make(), and StBemcRaw::makeHit().

int StEmcDecoder::GetSmdBugCorrectionShift ( int  id_original,
int &  id_shift 
) const

Returns the index shift for the SMD in original map.

GetSmdBugCorrectionShift method - returns the id shift with respect to the SMD index (software) in the original map

Parameters
id_originalis the soft_id in the original map
id_shiftis the shift that should be applied to the id. In this case, id_corrected = Id_original+id_shift

Definition at line 102 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::makeHit().

int StEmcDecoder::GetSmdCoord ( int  RDO,
int  index,
int &  detector,
int &  module,
int &  eta,
int &  sub,
bool  print = false 
) const

Get SMD detector (3==SMDE, 4==SMDP), m, e, s from RDO and position for SMD.

Parameters
RDOis the SMD fiber number
indexis the position in the fiber
detectoris detector number (3 = SMDE, 4 = SMDP)
moduleis the module number
etais the eta division for towers
subis the sub division for towers
printenables/disables some printout information

Definition at line 371 of file StEmcDecoder.cxx.

Referenced by PrintSmdMap().

int StEmcDecoder::GetSmdCoord ( int  RDO,
int  index,
int &  det,
int &  m,
int &  e,
int &  s,
int &  wire,
int &  A_value,
bool  print = false 
) const

Get SMD detector (3==SMDE, 4==SMDP), m, e, s from RDO and position for SMD. Also returns smd-wire and A_value.

Parameters
RDOis the SMD fiber number
indexis the position in the fiber
detectoris detector number (3 = SMDE, 4 = SMDP)
moduleis the module number
etais the eta division for towers
subis the sub division for towers
wireis the SMD-wire number
A_valueis the A_value in the FEE card
printenables/disables some printout information

Definition at line 389 of file StEmcDecoder.cxx.

int StEmcDecoder::GetSmdRDO ( int  detector,
int  module,
int  eta,
int  sub,
int &  RDO,
int &  index 
) const

Get SMD fiber and position from detector number (3==SMDE, 4==SMDP), m, e, s.

Parameters
detectoris detector number (3 = SMDE, 4 = SMDP)
moduleis the module number
etais the eta division for towers
subis the sub division for towers
RDOis the SMD fiber number
indexis the position in the fiber

Definition at line 341 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::getBemcADCRaw(), and StBemcData::make().

int StEmcDecoder::GetTowerBin ( int  softId,
int &  module,
int &  eta,
int &  sub 
) const

Convert from softId to m,e,s for towers only.

Copy of StEmcGeom version

Parameters
TowerIdis the software id for towers
moduleis the module number
etais the eta division for towers
subis the sub division for towers

Definition at line 117 of file StEmcDecoder.cxx.

Referenced by PrintTowerMap().

int StEmcDecoder::GetTowerBugCorrectionShift ( int  id_original,
int &  id_shift 
) const

Returns the index shift for the tower in original map.

GetTowerBugCorrectionShift method - returns the id shift with respect to the tower index (software) in the original map

Parameters
id_originalis the soft_id in the original map
id_shiftis the shift that should be applied to the id. In this case, id_corrected = Id_original+id_shift

Definition at line 76 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::makeHit().

int StEmcDecoder::GetTowerCrateFromDaqId ( int  RDO,
int &  crate,
int &  crate_sequency 
) const

Get crate number from Daq Id for towers.

Parameters
RDOis the DAQ id
crateis the crate number
crate_sequencyis the position of the tower inside the crate

Definition at line 174 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::getBemcADCRaw(), StBemcData::make(), and PrintTowerMap().

int StEmcDecoder::GetTowerCrateFromTDC ( int  TDC,
int &  crate 
) const

Get crate number from TDC channel for towers.

Parameters
TDCis the TDC channel number
crateis the crate number

Definition at line 131 of file StEmcDecoder.cxx.

int StEmcDecoder::GetTowerIdFromCrate ( int  crate,
int  crate_sequency,
int &  TowerId 
) const

Get Software Id from Crate number and position in crate for towers.

Parameters
crateis the crate number
crate_sequencyis the position of the tower inside the crate
TowerIdis the software id for towers

Definition at line 218 of file StEmcDecoder.cxx.

int StEmcDecoder::GetTowerIdFromDaqId ( int  RDO,
int &  TowerId 
) const

Get Sofwtare Id from Daq Id for towers.

Parameters
RDOis the DAQ id
TowerIdis the software id for towers

Definition at line 190 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::convertFromDaq(), and PrintTowerMap().

int StEmcDecoder::GetTowerIdFromTDC ( int  TDC,
int  tdc_sequency,
int &  TowerId 
) const

Get Software Id from TDC channel number and position in TDC for towers.

Parameters
TDCis the crate number
tdc_sequencyis the position of the tower inside the crate
TowerIdis the software id for towers

Definition at line 232 of file StEmcDecoder.cxx.

int StEmcDecoder::GetTowerTDCFromCrate ( int  crate,
int &  TDC 
) const

Get TDC channel from crate number for towers.

Parameters
crateis the crate number
TDCis the TDC channel number

Definition at line 144 of file StEmcDecoder.cxx.

Referenced by StBemcRaw::checkBtowCrates().

int StEmcDecoder::GetTowerTDCFromDaqId ( int  RDO,
int &  TDC 
) const

Get TDC channel from Daq Id for towers.

Parameters
RDOis the DAQ id
TDCis the TDC channel number

Definition at line 157 of file StEmcDecoder.cxx.

Referenced by PrintTowerMap().

int StEmcDecoder::GetTriggerPatchFromCrate ( int  CRATE,
int  crate_seq,
int &  patchId 
) const

returns the trigger patch from crate and sequence in the crate

Parameters
CRATEis the crate number
crate_seqis the position of the tower inside the crate (0 <= crate_seq <=159)
patchIdis the software id for towers

Definition at line 246 of file StEmcDecoder.cxx.

int StEmcDecoder::GetTriggerPatchFromJetPatch ( int  jetPatch,
int  jetPatch_seq,
int &  triggerPatch 
) const

returns the trigger patch from big jet patch and the sequence in it

Parameters
jetPatchis the jet patch id (0 <= jetPatch <= 11)
jetPatch_seqis the trigger patch position within the jet patch (0 <= jetPatch_seq <= 24)
triggerPatchis the trigger patch id (0 <= triggerPatch <=299)

Definition at line 280 of file StEmcDecoder.cxx.


The documentation for this class was generated from the following files: