|
BrRawDataInputclass description - source file - inheritance tree class BrRawDataInput : public BrIOModuleprivate: Data Membersprivate: Class DescriptionBrRawDataInput provides an interface to raw data The class is derived from the general input/output class BrIOModule and falls natural into the hierachi of module classes. The connection can be made to a diskfile, or the EventBuilder using the DAQ connections (port 7772). This module can be used in a module pipeline, see class descriptions for BrIOModule, BrModule, BrModuleContainer. However, unlike for BrIOModule, we have only two modes of how to handle the files opened: From disk-resident file (kBrRawDiskFile): These modules reads data from the disk resident raw file(s) and puts it into a BrEvent object From the event builders output stream (kBrEventBuilderStream): These modules reads from port 7772 on opus.brahms.bnl.gov and stores the event in a BrEvent object. Of course, there are still the 2 modes for the lifetime of the file(s), kBrRunFile and kBrJobFile. However, I think only kBrJobFile makes sense for kBrEventBuilderStream modules. To use this module in a pipeline, do something like // Then the input module BrIOModule* input = new BrRawDataInput("in", "Input"); cont->AddModule(input); input->SetIOMode(BrRawDataInput::kBrRunFile | BrRawDataInput::kBrRawDiskFile); By default All raw data record are converted to Root digitized objects If a given analysis is not going to use all data conversions of any subset can be turned off. This is most conviniently done by means of the BrRawDataInput::SetOn methods, preferentially to be used by referencing to the EBrDetectorBits definitions from BrDetectorList e.g. Do not unpack anything from the forward spectrometer except H1 and H2. Notice the slight (?!) inconsistency in naming H1 as TOF1 here (and in gbrahms, while in other connections it is H1. input->SetOff(kBrFS); input->SetOn(kBrTOF1); input->SetOn(kBrTOF2); BrRawDataInput() Constructor. Set fFilePointer and fEventCounter to NULL In root environment use the named constructor normally. BrRawDataInput(Char_t *name, Char_t* title) : BrIOModule(name, (title ? title : name)) Constructor. Set fFilePointer and fEventCounter to NULL name becomes Name and Title for the Module. No data file is opened this has to be done in the Open() method. ~BrRawDataInput() Destructor for BrRawDataInput. Close the file if open. void SetOn(const Char_t* part, Bool_t val) Bool_t Open(const Char_t *fname, const Option_t *option) Open the raw data file with fname or make a connection to the BRAHMS event builder. Returns kFALSE if the file can't be opened or cannot make connection to BRAHMS event builder. Options: "DISKFILE" => Open diskfile; default "EVB" => Open connection to event builder void OpenNext() PRIVATE METHOD: Open the next file registered with the module, if one such exists. This implements BrIOModule::OpenNext() again, since we need the to non-standard options kBrRawDiskFile for disk resident files kBrEventBuilderStream for reading the event stream from DAQ Bool_t OpenDiskFile(const Char_t *fname) Open the raw data file with name fname. Return the status of the open Bool_t OpenEventBuilder(const Char_t *fname) Open a connection to the event builder Return the status of the connection. fDispatcher = new BrDisIOProxy(); //create the interface object fDispatcher->create(); //create DisIO object in there Bool_t Close() Close the file Opened by the object. Return kFALSE if no file was open. void SkipEvent(Int_t numevt) Skip numevent events. This is done by simply doing a read over the number of events specified. void Event(BrEvent* event) Reads one event from the raw data file or from the BRAHMS event builder. The BrEvent object has the data from the different detectors added to the Event. This object is filled with data read from the file. It is the responsibility of the calling program to have created the event. Releasing the memory for this event is the responsibility of the function/script calling Event(); Status of the reading can be checked via the methods IsError() and IsEof(). The Event is build as an event node with the following sub nodes: Symbolic name | Name | Title --------------+----------+------- FSNode: | "FS" | "raw" FFSNode : | "FFS" | "raw" BFSNode : | "BFS" | "raw" MRSNode: | "MRS" | "raw" GlobalNode | "Global" | "raw" Each of the node has the datatables/objects for the proper detectors included here. See the individual Decode methods for more details. void ZeroNodesAndTables() Zero all nodes and table pointers. void BuildEvent(BrEvent *event) The table from the previous code is really obsolete The proper place to check for current values is in the ~daq/config/defaultmap.txt which also exists as an HTML file in the daq documentation. void BuildEventHeader(const Int_t recordId, BrEvent *event) Routine to transfer raw event header to BrEventHeader from event Used internally by the BrRawDataInput Class void AddTriggerWord(BrEvent *event) Routine to transfer trigger words to BrEventHeader from event Used internally by the BrRawDataInput Class void AddScalerRecord(BrEvent *event) Routine to transfer scaler records to BrTriggerScalers class and add that to the event. void DecodeFS(const Int_t recordId, BrEvent *event) Decode the forward Spectrometer Part of the data void DecodeFFS(const Int_t recordId) void DecodeBFS(const Int_t recordId) void DecodeMRS(const Int_t recordId,BrEvent *event) private method to look for and fill datatable for detectors in the MidRapidity Spectrometer. void DecodeGlobal(const Int_t recordId,BrEvent *event) Internal method to decode the global Raw Data events Bool_t UnpackBeamBeam(const Int_t recordId) Unpack either the Left or the right beam-Beam counter module Unfortunately a hardware error was found and re-mapping dependent on run-number is beeing introduced. Fix at RUN 6061 (properly present for most of 2001/2002 run in error at 4671.. Bool_t UnpackTriggerBB(const Int_t recordId) trigger pipeline data Bool_t UnpackT3(const Int_t recordId) Unpack raw data for T3. There will be a wide variety of recordId's each of which corresponds to a different plane. They will be managed /here and assembled into proper DigDC's returns kTRUE if unpacking successful returns kFALSE if not successful, ie if recordId does not correspond to something for T3 Bool_t UnpackT4(const Int_t recordId) Unpack raw data for T4. There will be a wide variety of recordId's each of which corresponds to a different plane. They will be managed here and assembled into proper DigDC's returns kTRUE if unpacking successful returns kFALSE if not successful, ie if recordId does not correspond to something for T4 Bool_t UnpackT5(const Int_t recordId) Unpack raw data for T5. There will be a wide variety of recordId's each of which corresponds to a different plane. They will be managed here and assembled into proper DigDC's returns kTRUE if unpacking successful returns kFALSE if not successful, ie if recordId does not correspond to something for T5 Bool_t UnpackTOFW(const Int_t recordId) Unpack raw data for TOFW. There will be two recordId's kTOFWB which corresponds to the bottom of the slats and kTOFWT which corresponds to the top of the slats. They will be managed here and assembled into proper DigTof's returns kTRUE if unpacking successful returns kFALSE if not successful, ie if recordId does not correspond to something for TOFW The code expects to look for two recorsId namely kTOFWBottom and kTOFWTop. We do not know which comes first. In any case it will look for both and manipuate tables at once. This avaoid the unpleasant issue on numbers of 83, 125 (but not least the data run for part of last year was 96 not 83 in the mapping. Pick if nhits==96 ->83 otherwise use numbers. Bool_t UnpackTOFWCal(const Int_t recordId) Unpack raw data for TOFWCal. There is a single record There are mapped alternate left/right channels. Bool_t UnpackH1Cal(const Int_t recordId) Unpack raw data for H1Cal. There is a single record There are mapped alternate left/right channels. Bool_t UnpackDriftVel(const Int_t recordId) Unpack raw data for DriftVelocity. These data will eventually only exsist for record type 103 but at present are read together with the normal events (102) and with a special trigger. Bool_t UnpackTpcFib(const Int_t recordId) Calibration fibers in MRS. Consist of at most 6 adc channels but always 6 in raw record. Likely 0 if not there. iform user and get out as what we would do would be bogus anyway Bool_t UnpackTrigStart(const Int_t recordId) Unpack raw data for Trigger starts. Bool_t UnpackInelRing(const Int_t recordId) Unpack raw data for Trigger starts. Bool_t UnpackInel(const Int_t recordId) Unpack raw data for Trigger starts. Bool_t UnpackTriggerD1(const Int_t recordId) Unpack raw data for Trigger counter in front of D1 Treat as a TOF counter. So real easy. There are mapped alternate left/right channels. Bool_t UnpackTriggerMrs(const Int_t recordId) Unpack raw data for Trigger counter in front of MRS and behind MRS Treat as a TOF counter. So real easy. There are mapped alternate left/right channels. Change this to let slat 1 -> TMrsF and 2-7 ->TMrsB This will make tofsoftware much more happy. Bool_t UnpackTrigClock(const Int_t recordId) Unpack raw data for Trigger clock information raw record 10024 implemented 11/23/01 Int_t Test() A method for Kris to test some things. Not to be used for anything seriously Inline Functionsvoid SetDataState(Bool_t state) Bool_t GetDataState() const void SetOn(EBrSectorBit m) void SetOn(EBrDetectorBit b, Bool_t v) void SetOn(EBrSectorBit m, Bool_t v) void SetOff(EBrDetectorBit b) void SetOff(EBrSectorBit m) Bool_t IsOn(EBrDetectorBit b) const Bool_t IsOn(EBrSectorBit m) const void SetOn(const Char_t* part, Bool_t val = kTRUE) void SetOff(const Char_t* part) void SetAllOn(Bool_t val = kTRUE) void SetAllOff() void SetFSOn(Bool_t val = kTRUE) void SetFSOff() void SetFFSOn(Bool_t val = kTRUE) void SetT1On(Bool_t val = kTRUE) void SetT2On(Bool_t val = kTRUE) void SetC1On(Bool_t val = kTRUE) void SetH1On(Bool_t val = kTRUE) void SetFFSOff() void SetT1Off() void SetT2Off() void SetC1Off() void SetH1Off() void SetBFSOn(Bool_t val = kTRUE) void SetT3On(Bool_t val = kTRUE) void SetT4On(Bool_t val = kTRUE) void SetT5On(Bool_t val = kTRUE) void SetH2On(Bool_t val = kTRUE) void SetRICHOn(Bool_t val = kTRUE) void SetBFSOff() void SetT3Off() void SetT4Off() void SetT5Off() void SetH2Off() void SetRICHOff() void SetMRSOn(Bool_t val = kTRUE) void SetMTP1On(Bool_t val = kTRUE) void SetMTP2On(Bool_t val = kTRUE) void SetTOFWOn(Bool_t val = kTRUE) void SetMRSOff() void SetMTP1Off() void SetMTP2Off() void SetTOFWOff() void SetGlobalOn(Bool_t val = kTRUE) void SetMultOn(Bool_t val = kTRUE) void SetBBOn(Bool_t val = kTRUE) void SetZDCOn(Bool_t val = kTRUE) void SetGlobalOff() void SetMultOff() void SetBBOff() void SetZDCOff() Bool_t UnpackTrigZdc(const Int_t recordId) TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) BrRawDataInput BrRawDataInput(BrRawDataInput&) |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|