Skip to content

Commit

Permalink
Merge pull request #5 from mpurschke/master
Browse files Browse the repository at this point in the history
mlp - add the digitizer hitformats for 12 and 16 samples.
  • Loading branch information
mpurschke authored Jun 2, 2017
2 parents a7a9b56 + 133e52e commit b51a40c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
4 changes: 3 additions & 1 deletion newbasic/A_Event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,9 @@ Packet *A_Event::makePacket(PHDWORD *pp, const int hitFormat)
return new Packet_id4scaler(pp);
break;

case IDDIGITIZERV2:
case IDDIGITIZER_12S:
case IDDIGITIZER_16S:
case IDDIGITIZER_31S:
return new Packet_iddigitizerv2(pp);
break;

Expand Down
6 changes: 5 additions & 1 deletion newbasic/packetConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,11 @@
#define IDCDEVDESCR 2017
#define IDSTARSCALER 2098

#define IDDIGITIZERV2 93
#define IDDIGITIZER_31S 93
#define IDDIGITIZER_12S 94
#define IDDIGITIZER_16S 95




// EMC data header and trailer length
Expand Down
21 changes: 15 additions & 6 deletions newbasic/packet_iddigitizerv2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,27 @@ int Packet_iddigitizerv2::decode ()

int *SubeventData = (int *) findPacketDataStart(packet);

// _nsamples = (SubeventData[0] >> 24 ) & 0xff;
switch ( getHitFormat() )
{
case IDDIGITIZER_12S:
_nsamples = 12;
break;

case IDDIGITIZER_16S:
_nsamples = 16;
break;

default:
_nsamples = 31;
break;
}


_evtnr = SubeventData[0] & 0xffff;
_detid = SubeventData[2] & 0xffff;

_module_address = SubeventData[3] & 0xffff;
_clock = SubeventData[4] & 0xffff;
_nsamples = SubeventData[5] & 0xff;

// if we are looking at older data without the nr_samples encoded,
// they are 31 samples wide.
if ( _nsamples == 0xff) _nsamples = 31;

_fem_slot[0] = SubeventData[6] & 0xffff;
_fem_evtnr[0] = SubeventData[7] & 0xffff;
Expand Down
4 changes: 3 additions & 1 deletion newbasic/packet_mnemonic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const char *get_mnemonic (const int structure, const int format)
case(ID4EVT): return "ID4EVT";
case(ID2SUP): return "ID2SUP";
case(ID4SCALER): return "ID4SCALER";
case(IDDIGITIZERV2): return "IDDIGITIZERV2";
case(IDDIGITIZER_12S): return "IDDIGITIZER_12S";
case(IDDIGITIZER_16S): return "IDDIGITIZER_16S";
case(IDDIGITIZER_31S): return "IDDIGITIZER_31S";
case(IDHAMMOND): return "IDHAMMOND";
case(IDSAM): return "IDSAM";
case(IDDCFEM): return "IDDCFEM";
Expand Down

0 comments on commit b51a40c

Please sign in to comment.