int gotAliceTrigger;
int bufferData;
+struct commonDataHeaderStruct *cdhRef = NULL;
+
void dumpPayload( const struct payloadDescriptorStruct *p ) {
char *c;
int i;
fileName,
payload );
if ( bufferData ) {
- if ( handleCDH ) {
+ if ( handleCDH &&
+ strncmp(fileName,"TRG_",4) != 0 ) {
struct commonDataHeaderStruct *cdh =
(struct commonDataHeaderStruct *)payload->data;
} /* End of createEor */
void loadCdh( struct commonDataHeaderStruct * const cdh,
- eventIdType * const eventId ) {
+ eventIdType * const eventId,
+ equipmentIdType id ) {
if ( !handleCDH ) return;
+ // CTP raw-data does not contain CDH
+ if ( id == 4352) return;
+
if ( gotAliceTrigger ) {
cdh->cdhEventId1 = EVENT_ID_GET_BUNCH_CROSSING( *eventId );
cdh->cdhEventId2 = EVENT_ID_GET_ORBIT( *eventId );
cdh->cdhMiniEventId = cdh->cdhEventId1;
}
void decodeCDH( struct ldcEventDescriptorStruct * const ldc,
- const struct payloadDescriptorStruct * const payloadDesc );
+ const struct payloadDescriptorStruct * const payloadDesc,
+ equipmentIdType id );
void createEvent( void ) {
assert( workingAs == ldc || workingAs == gdc );
for ( eq = ldc->head; eq != NULL; eq = eq->next ) {
if ( !bufferData ) {
loadBuffer( eq->payload );
- if ( !currGdc->loaded ) decodeCDH( ldc, eq->payload );
+ decodeCDH( ldc, eq->payload, eq->id );
}
loadCdh( (struct commonDataHeaderStruct*)eq->payload->data,
- &currEventId );
+ &currEventId,
+ eq->id);
}
if ( !currGdc->loaded ) {
currGdc->loaded = TRUE;
}
}
+ cdhRef = NULL;
} else if ( workingAs == ldc ) {
struct equipmentEventDescriptorStruct *eq;
for ( eq = currLdc->head; eq != NULL; eq = eq->next ) {
if ( !bufferData ) {
loadBuffer( eq->payload );
- if ( !currLdc->loaded ) decodeCDH( currLdc, eq->payload );
+ decodeCDH( currLdc, eq->payload, eq->id );
}
loadCdh( (struct commonDataHeaderStruct*)eq->payload->data,
- &currEventId );
+ &currEventId,
+ eq->id);
currLdc->loaded = TRUE;
}
+ cdhRef = NULL;
}
ADD_EVENT_ID( currEventId, oneEventDelta );
} /* End of initEquipment */
void decodeCDH( struct ldcEventDescriptorStruct * const ldc,
- const struct payloadDescriptorStruct * const payloadDesc ) {
- if ( handleCDH ) {
- static struct commonDataHeaderStruct *cdhRef = NULL;
+ const struct payloadDescriptorStruct * const payloadDesc,
+ equipmentIdType id ) {
+ if ( handleCDH &&
+ id != 4352 ) {
struct commonDataHeaderStruct *cdh;
static int softwareTriggerIndicator = FALSE;
int attr;
ATTR_ORBIT_BC );
eq->header.equipmentSize = eq->payload->size + sizeof( eq->header );
ldc->header.eventSize += eq->header.equipmentSize;
- decodeCDH( ldc, eq->payload );
+ decodeCDH( ldc, eq->payload, eq->id );
OR_ALL_ATTRIBUTES( eq->header.equipmentTypeAttribute,
ldc->header.eventTypeAttribute );
OR_ALL_ATTRIBUTES( eq->header.equipmentTypeAttribute,
}
gdc->header.eventSize += ldc->header.eventSize;
}
+ cdhRef = NULL;
}
DBG_VERBOSE {
ATTR_ORBIT_BC );
eq->header.equipmentSize = eq->payload->size + sizeof( eq->header );
ldc->header.eventSize += eq->header.equipmentSize;
- decodeCDH( ldc, eq->payload );
+ decodeCDH( ldc, eq->payload, eq->id );
OR_ALL_ATTRIBUTES( eq->header.equipmentTypeAttribute,
ldc->header.eventTypeAttribute );
}
+ cdhRef = NULL;
}
DBG_VERBOSE {
printf( "Headers:\n" );