~ajdobbs/maus/event-selection

« back to all changes in this revision

Viewing changes to src/input/InputCppDAQData/UnpackEventLib.cc

  • Committer: Yordan Karadzhov
  • Date: 2016-07-01 11:05:05 UTC
  • Revision ID: yordan.karadzhov@cern.ch-20160701110505-6c8a0osghvnwffjy
EpicsInterface and TriggerEngine are added to the Data structure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1225
1225
void DBBChainCppDataProcessor::fill_daq_data() {
1226
1226
  _daq_data->GetEMRDaqPtr()->SetDBBArray(_spill);
1227
1227
}
 
1228
 
 
1229
 
 
1230
////////////////////////////////////////////////////////////////////////////////
 
1231
 
 
1232
int TriggerEngineCppDataProcessor::Process(MDdataContainer* aFragPtr) {
 
1233
  /**
 
1234
   * Cast the argument to structure it points to.
 
1235
   * This process should be called only with MDfragmentV1495 argument.
 
1236
   */
 
1237
//   cerr << "This is TriggerEngineCppDataProcessor::Process " << endl;
 
1238
 
 
1239
  if ( typeid(*aFragPtr) != typeid(MDfragmentV1495) ) return CastError;
 
1240
  MDfragmentV1495* xV1495Fragment = static_cast<MDfragmentV1495*>(aFragPtr);
 
1241
 
 
1242
  if ( !xV1495Fragment->IsValid() )
 
1243
    return GenericError;
 
1244
 
 
1245
  _tr_spill.SetLdcId(this->GetLdcId());
 
1246
  _tr_spill.SetTimeStamp(this->GetTimeStamp());
 
1247
  _tr_spill.SetPhysEventNumber(this->GetPhysEventNumber());
 
1248
 
 
1249
  ParticleTrigger xPT;
 
1250
  int nTr = xV1495Fragment->GetNumTriggers();
 
1251
  for (int i = 0; i < nTr; ++i) {
 
1252
    xPT.SetTimeStamp(xV1495Fragment->GetTriggerTime(i));
 
1253
    xPT.SetTof0Pattern(xV1495Fragment->GetPatternTOF0(i));
 
1254
    xPT.SetTof1Pattern(xV1495Fragment->GetPatternTOF1(i));
 
1255
    xPT.SetTof2Pattern(xV1495Fragment->GetPatternTOF2(i));
 
1256
    _tr_spill.GetParticleTriggerArrayPtr()->push_back(xPT);
 
1257
  }
 
1258
 
 
1259
  return OK;
 
1260
}
 
1261
 
 
1262
void TriggerEngineCppDataProcessor::fill_daq_data() {
 
1263
  _daq_data->SetTriggerEngine(_tr_spill);
 
1264
}
 
1265
 
 
1266
void TriggerEngineCppDataProcessor::reset() {
 
1267
  _tr_spill.GetParticleTriggerArrayPtr()->clear();
 
1268
}
 
1269
 
 
1270
////////////////////////////////////////////////////////////////////////////////
 
1271
 
 
1272
int EpicsInterfaceCppDataProcessor::Process(MDdataContainer* aFragPtr) {
 
1273
  /**
 
1274
   * Cast the argument to structure it points to.
 
1275
   * This process should be called only with MDfragmentEpicsInterface argument.
 
1276
   */
 
1277
//   cerr << "This is EpicsInterfaceCppDataProcessor::Process " << endl;
 
1278
 
 
1279
  if ( typeid(*aFragPtr) != typeid(MDfragmentEI) ) return CastError;
 
1280
  MDfragmentEI* xEIFragment = static_cast<MDfragmentEI*>(aFragPtr);
 
1281
 
 
1282
  if ( !xEIFragment->IsValid() )
 
1283
    return GenericError;
 
1284
 
 
1285
  _ei_spill.SetLdcId(this->GetLdcId());
 
1286
  _ei_spill.SetGeo(xEIFragment->GetGeo());
 
1287
  _ei_spill.SetPhysEventNumber(this->GetPhysEventNumber());
 
1288
 
 
1289
  int nPVs = xEIFragment->GetNPVs();
 
1290
  for (int i = 0; i < nPVs; ++i) {
 
1291
    _ei_spill.AddHallProbe(xEIFragment->GetPvId(i),
 
1292
                           xEIFragment->GetPvValue(i));
 
1293
  }
 
1294
 
 
1295
  return OK;
 
1296
}
 
1297
 
 
1298
void EpicsInterfaceCppDataProcessor::fill_daq_data() {
 
1299
  _daq_data->SetEpicsInterface(_ei_spill);
 
1300
}
 
1301
 
 
1302
void EpicsInterfaceCppDataProcessor::reset() {
 
1303
  _ei_spill.GetPvIdArrayPtr()->clear();
 
1304
  _ei_spill.GetPvValueArrayPtr()->clear();
 
1305
}
1228
1306
}
1229
1307
//////////////////////////////////////////////////////////////////////////////////////////////