Draft DB schema for StEmcDecoder

Update 2008-11-06: minor naming revisions:

  • use crate/crateChannel instead of crate/sequence in bemcMapping
  • use rdo/rdoChannel instead of crate/position in smd and prs mapping

Update 2008-11-03: I posted a new version of the schemas. The changes are:

  • drop softID field in favor of elementID, as the latter has a special meaning in STAR’s DB API.
  • add eta and phi float fields to give the physical position of each element.
  • rename module-eta-sub to m-e-s so we can redefine eta as above.
  • added PMTbox, MAPMT, and pixel fields in the PRS table.
  • renamed fiber to crate in the SMD and PRS tables.
CREATE TABLE bemcMapping (
`dataID` int(11) NOT NULL auto_increment,
`entryTime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`nodeID` int(11) NOT NULL default '0',
`elementID` smallint(4) NOT NULL default '0',
`beginTime` datetime NOT NULL default '1970-01-01 00:00:00',
`endTime` datetime NOT NULL default '2037-01-01 00:00:00',
`flavor` varchar(32) NOT NULL default 'ofl',
`schemaID` int(11) NOT NULL default '1',
`deactive` int(10) unsigned NOT NULL default '0',

`m` tinyint(3) unsigned,
`e` tinyint(2) unsigned,
`s` tinyint(1) unsigned,
`daqID` smallint(4) unsigned,
`crate` tinyint(2) unsigned,
`crateChannel` tinyint(3) unsigned,
`TDC` tinyint(2) unsigned,
`triggerPatch` smallint(3) unsigned,
`jetPatch` tinyint(2) unsigned,
`DSM` smallint(3) unsigned,
`eta` float(6),
`phi` float(6),
`comment` varchar(255),

PRIMARY KEY (`nodeID`,`beginTime`,`flavor`,`elementID`,`deactive`),
KEY `dataID` (`dataID`),
KEY `entryTime` (`entryTime`)
);
CREATE TABLE bsmdeMapping (
`dataID` int(11) NOT NULL auto_increment,
`entryTime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`nodeID` int(11) NOT NULL default '0',
`elementID` smallint(5) NOT NULL default '0',
`beginTime` datetime NOT NULL default '1970-01-01 00:00:00',
`endTime` datetime NOT NULL default '2037-01-01 00:00:00',
`flavor` varchar(32) NOT NULL default 'ofl',
`schemaID` int(11) NOT NULL default '1',
`deactive` int(10) unsigned NOT NULL default '0',

`m` tinyint(3) unsigned,
`e` tinyint(3) unsigned,
`s` tinyint(1) unsigned,
`rdo` tinyint(1) unsigned,
`rdoChannel` smallint(4) unsigned,
`wire` tinyint(2) unsigned,
`feeA` tinyint(1) unsigned,
`eta` float(6),
`phi` float(6),
`comment` varchar(255),

PRIMARY KEY (`nodeID`,`beginTime`,`flavor`,`elementID`,`deactive`),
KEY `dataID` (`dataID`),
KEY `entryTime` (`entryTime`)
);
CREATE TABLE bprsMapping (
`dataID` int(11) NOT NULL auto_increment,
`entryTime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`nodeID` int(11) NOT NULL default '0',
`elementID` smallint(4) NOT NULL default '0',
`beginTime` datetime NOT NULL default '1970-01-01 00:00:00',
`endTime` datetime NOT NULL default '2037-01-01 00:00:00',
`flavor` varchar(32) NOT NULL default 'ofl',
`schemaID` int(11) NOT NULL default '1',
`deactive` int(10) unsigned NOT NULL default '0',

`m` tinyint(3) unsigned,
`e` tinyint(2) unsigned,
`s` tinyint(1) unsigned,
`PMTbox` tinyint(2) unsigned,
`MAPMT` tinyint(1) unsigned,
`pixel` tinyint(2) unsigned,
`rdo` tinyint(1) unsigned,
`rdoChannel` smallint(4) unsigned,
`wire` tinyint(2) unsigned,
`feeA` tinyint(1) unsigned,
`SCA` tinyint(1) unsigned,
`SCAChannel` tinyint(2) unsigned,
`eta` float(6),
`phi` float(6),
`comment` varchar(255),

PRIMARY KEY (`nodeID`,`beginTime`,`flavor`,`elementID`,`deactive`),
KEY `dataID` (`dataID`),
KEY `entryTime` (`entryTime`)
);