#ifndef BRAT_BrRawDataOutput #define BRAT_BrRawDataOutput // $Id: BrRawDataOutput.h,v 1.1.1.1 2001/06/21 14:55:09 hagel Exp $ // // $Log: BrRawDataOutput.h,v $ // Revision 1.1.1.1 2001/06/21 14:55:09 hagel // Initial revision of brat2 // // Revision 1.7 2000/06/28 09:21:55 hagel // Added const's to Open Args in BrRawDataInput // // Revision 1.6 2000/06/11 01:26:02 hagel // Removed const from Open method args // // Revision 1.5 2000/06/03 18:18:38 videbaek // Removed methods that belongs to base classes. // // Revision 1.4 2000/05/20 18:18:33 hito // I (Hiro) added the Silicon strip detector. // // Revision 1.3 1999/10/26 15:35:29 videbaek // Fix -maybe temporary for missing constant // // Revision 1.2 1999/10/21 22:11:21 hagel // Changes to make compile on Linux // // Revision 1.1 1999/10/15 20:26:27 hagel // Modifications to make BrRawDataOutput compile // // // Brat raw data // // /////////////////////////////////////////////////////////////////////// // // // BRAHMS raw data class // // // // BrRawDataOutput Generate and write BrRawEvent using digitized // // data // // // // the class is derived from the BrIOModule class // // // // Author : K. Hagel // // Created : Oct 1999 // // Version : 1.0 // // Changed : // // /////////////////////////////////////////////////////////////////////// #ifndef BRAT_BrIOModule #include "BrIOModule.h" #endif #ifndef ROOT_TObject #include "TObject.h" #endif #ifndef ROOT_BrRawDataInput #include "BrRawDataInput.h" #endif #ifndef BRAT_BrRawEvent #include "BrRawEvent.h" #endif #ifndef BrRawIOProxyH #include "BrRawIOProxy.h" #endif #ifndef BrDisIProxyOH #include "BrDisIOProxy.h" #endif #ifndef BRAT_BrEventNode #include "BrEventNode.h" #endif #include //ZDC Left 3-4 ADC L2249 x ? ADC+TDC 10010 //ZDC Right 3-4 ADC L2249 x ? ADC+TDC 10011 //BBC Left 45 ADC L1885F x x ADC+TDC 10012 // TDC P7186 //BBC Right 36 ADC L1885F x x ADC+TDC 10013 // TDC P7186 //MultSi 192 ADC L4300 x - ADCBLK 10014 //MultTiles 40 ADC L1885F x ? ADC+TDC 10015 //----------------------------------------------------------- // Mid-Rapidity Spectrometer (MRS) //----------------------------------------------------------- //MTP1 (tpc) //MTP2 (tpc) //WM1 320 TDC L1879 - x TDC 111xx //WM2 320 TDC L1879 - x TDC 112xx //TOFW 240 TDC P7186 x x ADC+TDC 113xx // ADC L1885F //TOFW-2 240 TDC P7186 x x ADC+TDC 114xx // ADC L1885F //----------------------------------------------------------- // Forward Spectrometer (FFS and BFS) //----------------------------------------------------------- //T1 (tpc) //T2 (tpc) //WF1 280 TDC L1879 - x TDC 121xx //WF2 280 TDC L1879 - x TDC 122xx //H1 80 ADC L1885F x x ADC+TDC 12612 // TDC P7186 //H2 64 ADC L1885F x x ADC+TDC 12613 // TDC P7186 //C1 32 ADC L1885F x ? ADC+TDC 12614 //T3 (D.C.) TDC L1877S - x TDC 123xx //T4 (D.C.) TDC L1877S - x TDC 124xx //T5 (D.C.) TDC L1877S - x TDC 125xx //RICH 320 ADC L1885F x ? ADCBLK 12615 /* enum ERawMagic { kEventHeader = 1, kZDCLeft = 10010, kZDCRight = 10011, kBBCLeft = 10012, kBBCRight = 10013, kMultSi = 10014, kMultTiles = 10015, kH1 = 12612, kH2 = 12613, kC1 = 12614, kMTP1 = 11100, kMTP2 = 11101 }; enum ESpecID { kGlobal = 10, kMRS = 11, kFS = 12 }; //Definitions for fReadMode const Int_t kNULLMode = 0; const Int_t kDiskFile = 1; const Int_t kEventBuilder = 2; */ class BrEventIO; class BrRawDataOutput : public BrIOModule { public: BrRawDataOutput(); BrRawDataOutput(Char_t *filename); virtual ~BrRawDataOutput(); virtual Bool_t Open(const Char_t *fname, const Option_t *option=""); virtual Bool_t Close(); virtual void Event(BrEvent* event); virtual void SkipEvent(Int_t numevt); //Methods to control which parts of the event are unpacked //Unpack everything virtual void SetAllOn(const Bool_t val=kTRUE){ fAllOn = val; SetFSOn(val); SetMRSOn(val); SetGlobalOn(val); } //Unpack nothing (except header) virtual void SetAllOff() {SetAllOn(kFALSE);} //Unpack FS virtual void SetFSOn(const Bool_t val=kTRUE){ fFSOn = val; SetFFSOn(val); SetBFSOn(val); } //Don't unpack FS virtual void SetFSOff(){SetFSOn(kFALSE);} //Unpack FFS virtual void SetFFSOn(const Bool_t val=kTRUE) { fFFSOn = val; SetT1On(val); SetT2On(val); SetC1On(val); SetH1On(val); } virtual void SetT1On(const Bool_t val=kTRUE) {fT1On = val;} virtual void SetT2On(const Bool_t val=kTRUE) {fT2On = val;} virtual void SetC1On(const Bool_t val=kTRUE) {fC1On = val;} virtual void SetH1On(const Bool_t val=kTRUE) {fH1On = val;} //Don't unpack FFS virtual void SetFFSOff(){SetFFSOn(kFALSE);} virtual void SetT1Off() {SetT1On(kFALSE);} virtual void SetT2Off() {SetT2On(kFALSE);} virtual void SetC1Off() {SetC1On(kFALSE);} virtual void SetH1Off() {SetH1On(kFALSE);} //Unpack BFS virtual void SetBFSOn(const Bool_t val=kTRUE) { fBFSOn = val; SetT3On(val); SetT4On(val); SetT5On(val); SetH2On(val); } virtual void SetT3On(const Bool_t val=kTRUE) {fT3On = val;} virtual void SetT4On(const Bool_t val=kTRUE) {fT4On = val;} virtual void SetT5On(const Bool_t val=kTRUE) {fT5On = val;} virtual void SetH2On(const Bool_t val=kTRUE) {fH2On = val;} //Don't unpack BFS virtual void SetBFSOff(){SetBFSOn(kFALSE);} virtual void SetT3Off() {SetT3On(kFALSE);} virtual void SetT4Off() {SetT4On(kFALSE);} virtual void SetT5Off() {SetT5On(kFALSE);} virtual void SetH2Off() {SetH2On(kFALSE);} //Unpack MRS virtual void SetMRSOn(const Bool_t val=kTRUE){ fMRSOn = val; SetMTP1On(val); SetMTP2On(val); SetTOFWOn(val); } virtual void SetMTP1On(const Bool_t val=kTRUE) {fMTP1On = val;} virtual void SetMTP2On(const Bool_t val=kTRUE) {fMTP2On = val;} virtual void SetTOFWOn(const Bool_t val=kTRUE) {fTOFWOn = val;} //Don't unpack MRS virtual void SetMRSOff(){SetMRSOn(kFALSE);} virtual void SetMTP1Off() {SetMTP1On(kFALSE);} virtual void SetMTP2Off() {SetMTP2On(kFALSE);} virtual void SetTOFWOff() {SetTOFWOn(kFALSE);} //Unpack Global virtual void SetGlobalOn(const Bool_t val=kTRUE) { fGlobalOn = val; SetMultOn(val); SetBBOn(val); SetZDCOn(val); } virtual void SetMultOn(const Bool_t val=kTRUE) {fMultOn = val;} virtual void SetBBOn(const Bool_t val=kTRUE) {fBBOn = val;} virtual void SetZDCOn(const Bool_t val=kTRUE) {fZDCOn = val;} //Don't unpack Global virtual void SetGlobalOff(){SetGlobalOn(kFALSE);} virtual void SetMultOff() {SetMultOn(kFALSE);} virtual void SetBBOff() {SetBBOn(kFALSE);} virtual void SetZDCOff() {SetZDCOn(kFALSE);} private: Int_t fEventCounter; //! Event counter Char_t fFileName[256]; //! File name raw event file BrRawIOProxy *fFileDescriptor; //! file descriptor BrDisIOProxy *fDispatcher; //! pointer to dispatcher BrRawEvent *fRawEvent; //! Pointer to raw BRAHMS event BrEventIO *fDigitizedEventIO; //! Pointer to digitized event Int_t fRecordFormat; //! Record format, used internally Int_t fReadMode; //! Read mode; disk file, or event builder Int_t fReqBatch; //! Number of events requested at a time Int_t fBatchNumber; //! Counter to keep track of where it is //Event Nodes BrEventNode *fGlobalNode; //!Global node BrEventNode *fMRSNode; //!MRS node BrEventNode *fFSNode; //!FS node BrEventNode *fFFSNode; //!FFS node BrEventNode *fBFSNode; //!BFS node //Data Tables BrDataTable *fZDCTable; //!ZDC table BrDataTable *fBBLeftTable; //!BB Left BrDataTable *fBBRightTable; //!BB Left BrDataTable *fMultTilesTable; //!Mult Tiles BrDataTable *fMultSiTable; //!MultSi BrDataTable *fH1Table; //!H1 table BrDataTable *fH2Table; //!H2 table BrDataTable *fC1Table; //!C1 table BrDataTable *fT1Table; //!T1 table BrDataTable *fT2Table; //!T2 table BrDataTable *fT3Table; //!T3 table BrDataTable *fT4Table; //!T4 table BrDataTable *fT5Table; //!T5 table //Switches to turn on/off unpacking of different elements //Everything Bool_t fAllOn; //FS Bool_t fFSOn; //FFS Bool_t fFFSOn; Bool_t fT1On; Bool_t fT2On; Bool_t fC1On; Bool_t fH1On; //BFS Bool_t fBFSOn; Bool_t fT3On; Bool_t fT4On; Bool_t fT5On; Bool_t fH2On; //MRS Bool_t fMRSOn; Bool_t fMTP1On; Bool_t fMTP2On; Bool_t fTOFWOn; //Global Bool_t fGlobalOn; Bool_t fMultOn; Bool_t fBBOn; Bool_t fZDCOn; virtual void Init(); virtual void ZeroNodesAndTables(); virtual void BuildRawEvent(BrEvent *event); virtual void BuildEventHeader(const Int_t recordId,BrEvent *event); virtual void DecodeFS(const Int_t recordId,BrEvent *event); virtual void DecodeBFS(const Int_t recordId); virtual void DecodeFFS(const Int_t recordId); virtual void DecodeMRS(const Int_t recordId,BrEvent *event); virtual void DecodeGlobal(const Int_t recordId,BrEvent *event); public: ClassDef(BrRawDataOutput,0) // Interface to Raw Event files }; #endif