+
+ //set default configuration options
+ Double_t updateInterval=30; //seconds
+ TString laserTriggerName("C0LSR-ABCE-NOPF-CENT");
+ TString forceLaserTriggerId("-1");
+ TString monitorAttributes=Form("%d",ATTR_ORIGINAL_EVENT);
+ Bool_t skipAmore=kFALSE;
+
+ //amore update interval
+ Double_t valConf=config.GetValue("AmoreUpdateInterval");
+ if ( valConf>0 ) updateInterval=valConf;
+
+ //laser trigger class name
+ if ( config.GetConfigurationMap()->GetValue("LaserTriggerName") ) {
+ laserTriggerName=config.GetConfigurationMap()->GetValue("LaserTriggerName")->GetName();
+ printf("TPCRAWda: Laser trigger class name set to: %s.\n",laserTriggerName.Data());
+ }
+ //force laser trigger id
+ if ( config.GetConfigurationMap()->GetValue("ForceLaserTriggerId") ) {
+ forceLaserTriggerId=config.GetConfigurationMap()->GetValue("ForceLaserTriggerId")->GetName();
+ printf("TPCRAWda: Force laser trigger Id: %s.\n",forceLaserTriggerId.Data());
+ }
+ //skip the amore part
+ if ( config.GetConfigurationMap()->GetValue("SkipAmore") ) {
+ skipAmore=((TObjString*)config.GetConfigurationMap()->GetValue("SkipAmore"))->GetString().Atoi();
+ printf("TPCRAWda: Skip Amore set in config\n");
+ }
+ //monitoring Attributes
+ if ( config.GetConfigurationMap()->GetValue("MonitorAttributes") ) {
+ monitorAttributes=config.GetConfigurationMap()->GetValue("MonitorAttributes")->GetName();
+ printf("TPCRAWda: Monitor attributes set in config: %s\n",monitorAttributes.Data());
+ }
+
+
+ //reject laser triggers in a global partition if we have interleaved laser events
+ unsigned char classId=0;
+ int retClassId=daqDA_getClassIdFromName(laserTriggerName.Data(),&classId);
+ //chek if we shall force the laser trigger id. Mainly for test purposes
+ if (forceLaserTriggerId!="-1"){
+ retClassId=0;
+ classId=static_cast<unsigned char>(forceLaserTriggerId.Atoi());
+ }
+ //create trigger mask
+ if (retClassId==0){
+ //interleaved laser in physics runs
+ //reject laser triggered events
+ TString triggerClasses;
+ //TODO
+ //TODO: in the next release of daq put 49 back to 50!!!
+ //TODO
+ for (unsigned char iclassId=0; iclassId<50; ++iclassId){
+ if (iclassId==classId) continue; //exclude laser trigger
+ triggerClasses+=Form("%u|",(unsigned int)iclassId);
+ }
+ triggerClasses.Chop();
+ char *table[5] = {"PHY",
+ "Y",
+ const_cast<char*>(monitorAttributes.Data()),
+ const_cast<char*>(triggerClasses.Data()),NULL};
+ monitorDeclareTableExtended(table);
+ printf("TPCRAWda: Using laser trigger class Id: %u\n",(unsigned int)classId);
+ printf("TPCRAWda: Accepted trigger class Ids: %s\n",triggerClasses.Data());
+ printf("TPCRAWda: Monitor attributes used: %s\n",monitorAttributes.Data());
+ }