ROOT logo
#ifndef __TMrbMesytec_Mdpp16_h__
#define __TMrbMesytec_Mdpp16_h__

//_________________________________________________[C++ CLASS DEFINITION FILE]
//////////////////////////////////////////////////////////////////////////////
// Name:           expconf/inc/TMrbMesytec_Mdpp16.h
// Purpose:        Define experimental configuration for MARaBOU
// Class:          TMrbMesytec_Mdpp16        -- VME adc
// Description:    Class definitions to implement a configuration front-end for MARaBOU
// Author:         R. Lutter
// Revision:       $Id: TMrbMesytec_Mdpp16.h,v 1.17 2012-01-18 11:11:32 Marabou Exp $
// Date:
// Keywords:
//////////////////////////////////////////////////////////////////////////////

namespace std {} using namespace std;

#include <cstdlib>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>

#include "Rtypes.h"
#include "TSystem.h"
#include "TEnv.h"
#include "TObject.h"

class TMrbVMEChannel;

//______________________________________________________[C++ CLASS DEFINITION]
//////////////////////////////////////////////////////////////////////////////
// Name:           TMrbMesytec_Mdpp16
// Purpose:        Define a VME module type Mesytec MDPP16
// Description:    Defines a VME module MDPP16
// Keywords:
//////////////////////////////////////////////////////////////////////////////

class TMrbMesytec_Mdpp16 : public TMrbVMEModule {

	public:
		enum				{	kSegSize		=	0x10000L	};
		enum				{	kAddrMod		=	0x09		};

		enum				{	kNofChannels		=	16	};
		enum				{	kNofChannelPairs	=	8	};

		enum				{	kChanAct		=	0x20	};

		enum EMrbRegisters	{	kRegAddrSource,
								kRegAddrReg,
								kRegModuleId,
								kRegDataWidth,
								kRegMultiEvent,
								kRegXferData,
								kRegMarkingType,
								kRegTdcResolution,
								kRegAdcResolution,
								kRegOutputFormat,
								kRegWinStart,
								kRegWinWidth,
								kRegTrigSource,
								kRegFirstHit,
								kRegTrigOutput,
								kRegEcl3,
								kRegEcl2,
								kRegEcl1,
								kRegEcl0,
								kRegNim4,
								kRegNim3,
								kRegNim2,
								kRegNim1,
								kRegNim0,
								kRegPulserStatus,
								kRegPulserAmplitude,
								kRegMonitor,
								kRegMonitorChannel,
								kRegMonitorWave,
								kRegTsSource,
								kRegTsDivisor,
								kRegMultHighLimit,
								kRegMultLowLimit,
								kRegChannelPair,
								kRegTFIntDiff,
								kRegPoleZero,
								kRegGain,
								kRegThresh,
								kRegShaping,
								kRegBaseLineRes,
								kRegResetTime,
								kRegRiseTime
							};

		enum EMrbAddressSource			{	kAddressBoard		=	0,
											kAddressRegister
										};

		enum EMrbDataWidth				{	kDataWidth8		=	0,
											kDataWidth16,
											kDataWidth32,
											kDataWidth64
										};

		enum EMrbMultiEvent				{	kMultiEvtNo			=	0,
											kMultiEvtYes		=	1,
											kMultiEvt1By1		=	3,
											kMultiEvtNoBerr		=	5
										};

		enum EMrbMarkingType			{	kMarkingTypeEvent	=	0x0,
											kMarkingTypeTs		=	0x1,
											kMarkingTypeXts 	=	0x3
										};

		enum EMrbOutputFormat			{	kOutFmtStandard		=	0,
											kOutFmtAmplitude,
											kOutFmtTime
										};

		enum EMrbAdcResolution			{	kAdcRes16			=	0,
											kAdcRes15,
											kAdcRes14,
											kAdcRes13,
											kAdcRes12
										};

		enum EMrbTdcResolution			{	kTdcRes781_32		=	5,
											kTdcRes391_64		=	4,
											kTdcRes195_128		=	3,
											kTdcRes98_256		=	2,
											kTdcRes49_512		=	1,
											kTdcRes24_1024		=	0
										};

		enum							{	kWinStartDefault	=	0x3ff0	};
		enum							{	kWinWidthDefault	=	0x20	};
		
		enum EMrbFirstHit	 			{	kFirstHitOnly		=	1,
											kFirstHitAll		=	0
										};

		enum EMrbEcl3		 			{	kEcl3Off		 	=	0,
											kEcl3Trig0 			=	BIT(0),
											kEcl3UnTerm 	 	=	BIT(4)
										};

		enum EMrbEcl2		 			{	kEcl2Off	 		=	0,
											kEcl2Sync 			=	BIT(0),
											kEcl2Trig1			=	BIT(1),
											kEcl2UnTerm 	 	=	BIT(4)
										};

		enum EMrbEcl1		 			{	kEcl1Off	 		=	0,
											kEcl1Reset 			=	BIT(0),
											kEcl1UnTerm 	 	=	BIT(4)
										};

		enum EMrbEcl0		 			{	kEcl0Off	 		=	0,
											kEcl0Busy 			=	BIT(2),
											kEcl0DataReady		=	BIT(3)
										};

		enum EMrbNim4		 			{	kNim4Off			=	0,
											kNim4Trig0			=	BIT(0)
										};

		enum EMrbNim3		 			{	kNim3Off			=	0,
											kNim3Sync			=	BIT(1)
										};

		enum EMrbNim2		 			{	kNim2Off			=	0,
											kNim2Trig1			=	BIT(0),
											kNim2Reset			=	BIT(1)
										};

		enum EMrbNim0		 			{	kNim0Off			=	0,
											kNim0Cbus			=	BIT(0),
											kNim0BusyOut		=	BIT(2),
											kNim0DataReady		=	BIT(3)
										};

		enum EMrbPulserStatus		 	{	kPulserOff			=	0,
											kPulserOn			=	1
										};

		enum EMrbMonitor			 	{	kMonitorOff			=	0,
											kMonitorOn			=	1
										};

		enum							{	kPulserMaxAmpl		=	0xFFF	};
		
		enum EMrbTsSource		 		{	kTstampVME			=	0,
											kTstampExtern		=	BIT(0),
											kTstampReset		=	BIT(1)
										};
										
		enum EMrbMultLimit				{	kMultHighLimit	=	255,
											kMultLowLimit	=	0
										};

		enum EMrbBaseLineRes			{	kBaseLineResOff		=	0,
											kBaseLineResSoft	=	1,
											kBaseLineResStrict	=	2
										};
										
		enum							{	kValueNotSet		=	-1	};
		enum							{	kValueToBeInit		=	-2	};
		
		enum							{	kTFIntDiffDefault	=	2	};
		enum							{	kPoleZeroDefault	=	0xFFFF	};
		enum							{	kGainDefault		=	200	};
		enum							{	kThreshDefault		=	0xFF	};
		enum							{	kShapingDefault		=	0x64	};
		enum							{	kBLResDefault		=	2	};
		enum							{	kResetTimeDefault	=	16	};
		enum							{	kRiseTimeDefault	=	0	};

	public:

		TMrbMesytec_Mdpp16() {};  													// default ctor
		TMrbMesytec_Mdpp16(const Char_t * ModuleName, UInt_t BaseAddr); 			// define a new module
		~TMrbMesytec_Mdpp16() {};													// default dtor

		Bool_t MakeReadoutCode(ofstream & RdoStrm, TMrbConfig::EMrbModuleTag TagIndex);  	// generate part of code
		Bool_t MakeReadoutCode(ofstream & RdoStrm, TMrbConfig::EMrbModuleTag TagIndex, TMrbVMEChannel * Channel, Int_t Value = 0);  	// generate code for given channel

		virtual inline const Char_t * GetMnemonic() const { return("mdpp16"); }; 	// module mnemonic

		inline void SetBlockXfer(Bool_t Flag = kTRUE) { fBlockXfer = Flag; };
		inline Bool_t BlockXferEnabled() { return(fBlockXfer); };

		inline void RepairRawData(Bool_t Flag = kTRUE) { fRepairRawData = Flag; };
		inline Bool_t RawDataToBeRepaired() { return(fRepairRawData); };

		inline Bool_t SetAddressSource(Int_t AddrSource) { return(this->Set(TMrbMesytec_Mdpp16::kRegAddrSource, AddrSource)); };
		inline Bool_t SetAddressSource(Char_t * AddrSource) { return(this->Set(TMrbMesytec_Mdpp16::kRegAddrSource, AddrSource)); };
		inline Int_t GetAddressSource() { return(this->Get(TMrbMesytec_Mdpp16::kRegAddrSource)); };

		inline Bool_t SetAddressRegister(Int_t Address) { return(this->Set(TMrbMesytec_Mdpp16::kRegAddrReg, Address)); };
		inline Int_t GetAddressRegister() { return(this->Get(TMrbMesytec_Mdpp16::kRegAddrReg)); };

		inline Bool_t SetModuleId(Int_t ModuleId) { return(this->Set(TMrbMesytec_Mdpp16::kRegModuleId, ModuleId)); };
		inline Int_t GetModuleId() { return(this->Get(TMrbMesytec_Mdpp16::kRegModuleId)); };

		inline Bool_t SetXferData(Int_t Length) { return(this->Set(TMrbMesytec_Mdpp16::kRegXferData, Length)); };
		inline Int_t GetXferData() { return(this->Get(TMrbMesytec_Mdpp16::kRegXferData)); };

		inline Bool_t SetDataWidth(Int_t Format) { return(this->Set(TMrbMesytec_Mdpp16::kRegDataWidth, Format)); };
		inline Bool_t SetDataWidth(Char_t * Format) { return(this->Set(TMrbMesytec_Mdpp16::kRegDataWidth, Format)); };
		inline Int_t GetDataWidth() { return(this->Get(TMrbMesytec_Mdpp16::kRegDataWidth)); };

		inline Bool_t SetMultiEvent(Int_t Mode) { return(this->Set(TMrbMesytec_Mdpp16::kRegMultiEvent, Mode)); };
		inline Bool_t SetMultiEvent(Char_t * Mode) { return(this->Set(TMrbMesytec_Mdpp16::kRegMultiEvent, Mode)); };
		inline Int_t GetMultiEvent() { return(this->Get(TMrbMesytec_Mdpp16::kRegMultiEvent)); };

		inline Bool_t SetMarkingType(Int_t Mtype) { return(this->Set(TMrbMesytec_Mdpp16::kRegMarkingType, Mtype)); };
		inline Bool_t SetMarkingType(Char_t * Mtype) { return(this->Set(TMrbMesytec_Mdpp16::kRegMarkingType, Mtype)); };
		inline Int_t GetMarkingType() { return(this->Get(TMrbMesytec_Mdpp16::kRegMarkingType)); };

		inline Bool_t SetTdcResolution(Int_t Res) { return(this->Set(TMrbMesytec_Mdpp16::kRegTdcResolution, Res)); };
		inline Bool_t SetTdcResolution(Char_t * Res) { return(this->Set(TMrbMesytec_Mdpp16::kRegTdcResolution, Res)); };
		inline Int_t GetTdcResolution() { return(this->Get(TMrbMesytec_Mdpp16::kRegTdcResolution)); };

		inline Bool_t SetAdcResolution(Int_t Res) { return(this->Set(TMrbMesytec_Mdpp16::kRegAdcResolution, Res)); };
		inline Bool_t SetAdcResolution(Char_t * Res) { return(this->Set(TMrbMesytec_Mdpp16::kRegAdcResolution, Res)); };
		inline Int_t GetAdcResolution() { return(this->Get(TMrbMesytec_Mdpp16::kRegAdcResolution)); };

		inline Bool_t SetOutputFormat(Int_t Format) { return(this->Set(TMrbMesytec_Mdpp16::kRegOutputFormat, Format)); };
		inline Bool_t SetOutputFormat(Char_t * Format) { return(this->Set(TMrbMesytec_Mdpp16::kRegOutputFormat, Format)); };
		inline Int_t GetOutputFormat() { return(this->Get(TMrbMesytec_Mdpp16::kRegOutputFormat)); };

		inline Bool_t SetWinStart(Int_t Offset) { return(this->Set(TMrbMesytec_Mdpp16::kRegWinStart, Offset)); };
		inline Bool_t GetWinStart() { return(this-Get(TMrbMesytec_Mdpp16::kRegWinStart)); };
		inline Bool_t SetWinWidth(Int_t Width) { return(this->Set(TMrbMesytec_Mdpp16::kRegWinWidth, Width)); };
		inline Bool_t GetWinWidth() { return(this->Get(TMrbMesytec_Mdpp16::kRegWinWidth)); };

		inline Bool_t SetTrigSource(Int_t TrigSource) { return(this->Set(TMrbMesytec_Mdpp16::kRegTrigSource, TrigSource)); };
		Bool_t SetTrigSource(Int_t Trig, Int_t Chan, Int_t Bank);
		inline Int_t GetTrigSource() { return(this->Get(TMrbMesytec_Mdpp16::kRegTrigSource)); };
		Bool_t GetTrigSource(TArrayI & TrigSource);

		inline Bool_t SetFirstHit(Int_t Hit) { return(this->Set(TMrbMesytec_Mdpp16::kRegFirstHit, Hit)); };
		inline Bool_t SetFirstHit(Char_t * Hit) { return(this->Set(TMrbMesytec_Mdpp16::kRegFirstHit, Hit)); };
		inline Int_t GetFirstHit() { return(this->Get(TMrbMesytec_Mdpp16::kRegFirstHit)); };

		inline Bool_t SetTrigOutput(Int_t TrigOutput) { return(this->Set(TMrbMesytec_Mdpp16::kRegTrigOutput, TrigOutput)); };
		Bool_t SetTrigOutput(Int_t Chan, Int_t Bank);
		inline Int_t GetTrigOutput() { return(this->Get(TMrbMesytec_Mdpp16::kRegTrigOutput)); };
		Bool_t GetTrigOutput(TArrayI & TrigOutput);

		inline Bool_t SetEcl3(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl3, Bits)); };
		inline Bool_t SetEcl3(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl3, Bits)); };
		inline Int_t GetEcl3() { return(this->Get(TMrbMesytec_Mdpp16::kRegEcl3)); };
		
		inline Bool_t SetEcl2(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl2, Bits)); };
		inline Bool_t SetEcl2(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl2, Bits)); };
		inline Int_t GetEcl2() { return(this->Get(TMrbMesytec_Mdpp16::kRegEcl2)); };
		
		inline Bool_t SetEcl1(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl1, Bits)); };
		inline Bool_t SetEcl1(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl1, Bits)); };
		inline Int_t GetEcl1() { return(this->Get(TMrbMesytec_Mdpp16::kRegEcl1)); };
		
		inline Bool_t SetEcl0(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl0, Bits)); };
		inline Bool_t SetEcl0(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegEcl0, Bits)); };
		inline Int_t GetEcl0() { return(this->Get(TMrbMesytec_Mdpp16::kRegEcl0)); };
		
		inline Bool_t SetNim4(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim4, Bits)); };
		inline Bool_t SetNim4(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim4, Bits)); };
		inline Int_t GetNim4() { return(this->Get(TMrbMesytec_Mdpp16::kRegNim4)); };
		
		inline Bool_t SetNim3(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim3, Bits)); };
		inline Bool_t SetNim3(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim3, Bits)); };
		inline Int_t GetNim3() { return(this->Get(TMrbMesytec_Mdpp16::kRegNim3)); };
		
		inline Bool_t SetNim2(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim2, Bits)); };
		inline Bool_t SetNim2(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim2, Bits)); };
		inline Int_t GetNim2() { return(this->Get(TMrbMesytec_Mdpp16::kRegNim2)); };
		
		inline Bool_t SetNim0(Int_t Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim0, Bits)); };
		inline Bool_t SetNim0(Char_t * Bits) { return(this->Set(TMrbMesytec_Mdpp16::kRegNim0, Bits)); };
		inline Int_t GetNim0() { return(this->Get(TMrbMesytec_Mdpp16::kRegNim0)); };
		
		inline Bool_t TurnPulserOn() { return(this->Set(TMrbMesytec_Mdpp16::kRegPulserStatus, TMrbMesytec_Mdpp16::kPulserOn)); };
		inline Bool_t TurnPulserOff() { return(this->Set(TMrbMesytec_Mdpp16::kRegPulserStatus, TMrbMesytec_Mdpp16::kPulserOff)); };
		inline Bool_t PulserOn() { return(this->Get(TMrbMesytec_Mdpp16::kRegPulserStatus) == TMrbMesytec_Mdpp16::kPulserOn ? kTRUE : kFALSE); };

		inline Bool_t SetPulserAmplitude(Int_t Ampl) { return(this->Set(TMrbMesytec_Mdpp16::kRegPulserAmplitude, Ampl)); };
		inline Int_t GetPulserAmplitude() { return(this->Get(TMrbMesytec_Mdpp16::kRegPulserAmplitude)); };

		inline Bool_t SetTsSource(Int_t Source) { return(this->Set(TMrbMesytec_Mdpp16::kRegTsSource, Source)); };
		inline Bool_t SetTsSource(Char_t * Source) { return(this->Set(TMrbMesytec_Mdpp16::kRegTsSource, Source)); };
		inline Int_t GetTsSource() { return(this->Get(TMrbMesytec_Mdpp16::kRegTsSource)); };

		inline Bool_t SetTsDivisor(Int_t Divisor) { return(this->Set(TMrbMesytec_Mdpp16::kRegTsDivisor, Divisor)); };
		inline Int_t GetTsDivisor() { return(this->Get(TMrbMesytec_Mdpp16::kRegTsDivisor)); };

		inline Bool_t TurnMonitorOn() { return(this->Set(TMrbMesytec_Mdpp16::kRegMonitor, TMrbMesytec_Mdpp16::kMonitorOn)); };
		inline Bool_t TurnMonitorOff() { return(this->Set(TMrbMesytec_Mdpp16::kRegMonitor, TMrbMesytec_Mdpp16::kMonitorOff)); };
		inline Bool_t MonitorOn() { return(this->Get(TMrbMesytec_Mdpp16::kRegMonitor) == TMrbMesytec_Mdpp16::kMonitorOn ? kTRUE : kFALSE); };

		inline Bool_t SetMonitorChannel(Int_t Channel) { return(this->Set(TMrbMesytec_Mdpp16::kRegMonitorChannel, Channel)); };
		inline Int_t GetMonitorChannel() { return(this->Get(TMrbMesytec_Mdpp16::kRegMonitorChannel)); };
		inline Bool_t SetMonitorWave(Int_t Wave) { return(this->Set(TMrbMesytec_Mdpp16::kRegMonitorWave, Wave)); };
		inline Int_t GetMonitorWave() { return(this->Get(TMrbMesytec_Mdpp16::kRegMonitorWave)); };

		inline Bool_t SetMultHighLimit(Int_t Limit) { return(this->Set(TMrbMesytec_Mdpp16::kRegMultHighLimit, Limit)); };
		inline Int_t GetMultHighLimit() { return(this->Get(TMrbMesytec_Mdpp16::kRegMultHighLimit)); };
		inline Bool_t SetMultLowLimit(Int_t Limit) { return(this->Set(TMrbMesytec_Mdpp16::kRegMultLowLimit, Limit)); };
		inline Int_t GetMultLowLimit() { return(this->Get(TMrbMesytec_Mdpp16::kRegMultLowLimit)); };

		inline Bool_t SetTFIntDiff(Int_t TFval, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegTFIntDiff, TFval, Chan)); };
		inline Int_t GetTFIntDiff(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegTFIntDiff, Chan)); };

		inline Bool_t SetPoleZero(Int_t PZval, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegPoleZero, PZval, Chan)); };
		inline Int_t GetPoleZero(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegPoleZero, Chan)); };

		inline Bool_t SetGain(Int_t Gain, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegGain, Gain, Chan)); };
		inline Int_t GetGain(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegGain,Chan)); };

		inline Bool_t SetThresh(Int_t Thresh, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegThresh, Thresh, Chan)); };
		inline Int_t GetThresh(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegThresh, Chan)); };

		inline Bool_t SetShaping(Int_t Shaping, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegShaping, Shaping, Chan)); };
		inline Int_t GetShaping(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegShaping, Chan)); };

		inline Bool_t SetBaseLineRes(Int_t BLRval, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegBaseLineRes, BLRval, Chan)); };
		inline Int_t GetBaseLineRes(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegBaseLineRes, Chan)); };

		inline Bool_t SetResetTime(Int_t Reset, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegResetTime, Reset, Chan)); };
		inline Int_t GetResetTime(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegResetTime, Chan)); };

		inline Bool_t SetRiseTime(Int_t Rise, Int_t Chan) { return(this->Set(TMrbMesytec_Mdpp16::kRegRiseTime, Rise)); };
		inline Int_t GetRiseTime(Int_t Chan) { return(this->Get(TMrbMesytec_Mdpp16::kRegRiseTime, Chan)); };
		
		TEnv * UseSettings(const Char_t * SettingsFile = NULL);
		Bool_t SaveSettings(const Char_t * SettingsFile = NULL);
		inline TEnv * Settings() { return fSettings; };

		inline void EnableMCST(UInt_t Signature, Bool_t FirstInChain= kFALSE, Bool_t LastInChain = kFALSE) { fMCSTSignature = Signature; fFirstInChain = FirstInChain; fLastInChain = LastInChain; };
		inline void EnableCBLT(UInt_t Signature, Bool_t FirstInChain= kFALSE, Bool_t LastInChain = kFALSE) { fCBLTSignature = Signature; fFirstInChain = FirstInChain; fLastInChain = LastInChain; };
		inline void SetMcstSignature(UInt_t Signature) { fMCSTSignature = Signature; };
		inline void SetCbltSignature(UInt_t Signature) { fCBLTSignature = Signature; };
		inline void SetFirstInChain(Bool_t Flag) { fFirstInChain = Flag; };
		inline void SetLastInChain(Bool_t Flag) { fLastInChain = Flag; };
		inline Bool_t McstEnabled() { return (fMCSTSignature != 0); };
		inline Bool_t CbltEnabled() { return (fCBLTSignature != 0); };
		inline Bool_t IsFirstInChain() { return fFirstInChain; };
		inline Bool_t IsLastInChain() { return fLastInChain; };

		void PrintSettings(ostream & OutStrm);
		inline void PrintSettings() { this->PrintSettings(cout); };
		const Char_t * FormatValue(TString & Value, Int_t Index, Int_t SubIndex = -1, Int_t Base = 10);

		inline Bool_t HasPrivateCode() const { return(kTRUE); }; 			// use private code files
		inline const Char_t * GetPrivateCodeFile() const { return("Module_Mesytec"); };

		inline Bool_t HasBlockXfer() const { return(kTRUE); };				// module is capable of using BLT
		inline Bool_t UseA32Addressing() const { return(kTRUE); };			// we use a32 regardless of address

		virtual Bool_t CheckSubeventType(TMrbSubevent * Subevent) const;		// check if subevent type is [10,8x]

		inline Char_t * GetDeviceStruct() { return(Form("s_%s", this->GetName())); };

		inline void Help() { gSystem->Exec(Form("mrbHelp %s", this->ClassName())); };

	protected:
		void DefineRegisters(); 							// define vme registers
		Bool_t UpdateSettings();							// update settings

	protected:
		TString fSettingsFile;
		TEnv * fSettings;

		Bool_t fBlockXfer;
		Bool_t fRepairRawData;

		Bool_t fMonitorOn;
		
		UInt_t fMCSTSignature;
		UInt_t fCBLTSignature;
		Bool_t fFirstInChain;
		Bool_t fLastInChain;
		
		Int_t fAllTFIntDiff;
		Int_t fAllPoleZero;
		Int_t fAllGain;
		Int_t fAllThresh;
		Int_t fAllShaping;
		Int_t fAllBaseLineRes;
		Int_t fAllResetTime;
		Int_t fAllRiseTime;

	ClassDef(TMrbMesytec_Mdpp16, 1)		// [Config] MDPP-16 tracing adc
};

#endif
 TMrbMesytec_Mdpp16.h:1
 TMrbMesytec_Mdpp16.h:2
 TMrbMesytec_Mdpp16.h:3
 TMrbMesytec_Mdpp16.h:4
 TMrbMesytec_Mdpp16.h:5
 TMrbMesytec_Mdpp16.h:6
 TMrbMesytec_Mdpp16.h:7
 TMrbMesytec_Mdpp16.h:8
 TMrbMesytec_Mdpp16.h:9
 TMrbMesytec_Mdpp16.h:10
 TMrbMesytec_Mdpp16.h:11
 TMrbMesytec_Mdpp16.h:12
 TMrbMesytec_Mdpp16.h:13
 TMrbMesytec_Mdpp16.h:14
 TMrbMesytec_Mdpp16.h:15
 TMrbMesytec_Mdpp16.h:16
 TMrbMesytec_Mdpp16.h:17
 TMrbMesytec_Mdpp16.h:18
 TMrbMesytec_Mdpp16.h:19
 TMrbMesytec_Mdpp16.h:20
 TMrbMesytec_Mdpp16.h:21
 TMrbMesytec_Mdpp16.h:22
 TMrbMesytec_Mdpp16.h:23
 TMrbMesytec_Mdpp16.h:24
 TMrbMesytec_Mdpp16.h:25
 TMrbMesytec_Mdpp16.h:26
 TMrbMesytec_Mdpp16.h:27
 TMrbMesytec_Mdpp16.h:28
 TMrbMesytec_Mdpp16.h:29
 TMrbMesytec_Mdpp16.h:30
 TMrbMesytec_Mdpp16.h:31
 TMrbMesytec_Mdpp16.h:32
 TMrbMesytec_Mdpp16.h:33
 TMrbMesytec_Mdpp16.h:34
 TMrbMesytec_Mdpp16.h:35
 TMrbMesytec_Mdpp16.h:36
 TMrbMesytec_Mdpp16.h:37
 TMrbMesytec_Mdpp16.h:38
 TMrbMesytec_Mdpp16.h:39
 TMrbMesytec_Mdpp16.h:40
 TMrbMesytec_Mdpp16.h:41
 TMrbMesytec_Mdpp16.h:42
 TMrbMesytec_Mdpp16.h:43
 TMrbMesytec_Mdpp16.h:44
 TMrbMesytec_Mdpp16.h:45
 TMrbMesytec_Mdpp16.h:46
 TMrbMesytec_Mdpp16.h:47
 TMrbMesytec_Mdpp16.h:48
 TMrbMesytec_Mdpp16.h:49
 TMrbMesytec_Mdpp16.h:50
 TMrbMesytec_Mdpp16.h:51
 TMrbMesytec_Mdpp16.h:52
 TMrbMesytec_Mdpp16.h:53
 TMrbMesytec_Mdpp16.h:54
 TMrbMesytec_Mdpp16.h:55
 TMrbMesytec_Mdpp16.h:56
 TMrbMesytec_Mdpp16.h:57
 TMrbMesytec_Mdpp16.h:58
 TMrbMesytec_Mdpp16.h:59
 TMrbMesytec_Mdpp16.h:60
 TMrbMesytec_Mdpp16.h:61
 TMrbMesytec_Mdpp16.h:62
 TMrbMesytec_Mdpp16.h:63
 TMrbMesytec_Mdpp16.h:64
 TMrbMesytec_Mdpp16.h:65
 TMrbMesytec_Mdpp16.h:66
 TMrbMesytec_Mdpp16.h:67
 TMrbMesytec_Mdpp16.h:68
 TMrbMesytec_Mdpp16.h:69
 TMrbMesytec_Mdpp16.h:70
 TMrbMesytec_Mdpp16.h:71
 TMrbMesytec_Mdpp16.h:72
 TMrbMesytec_Mdpp16.h:73
 TMrbMesytec_Mdpp16.h:74
 TMrbMesytec_Mdpp16.h:75
 TMrbMesytec_Mdpp16.h:76
 TMrbMesytec_Mdpp16.h:77
 TMrbMesytec_Mdpp16.h:78
 TMrbMesytec_Mdpp16.h:79
 TMrbMesytec_Mdpp16.h:80
 TMrbMesytec_Mdpp16.h:81
 TMrbMesytec_Mdpp16.h:82
 TMrbMesytec_Mdpp16.h:83
 TMrbMesytec_Mdpp16.h:84
 TMrbMesytec_Mdpp16.h:85
 TMrbMesytec_Mdpp16.h:86
 TMrbMesytec_Mdpp16.h:87
 TMrbMesytec_Mdpp16.h:88
 TMrbMesytec_Mdpp16.h:89
 TMrbMesytec_Mdpp16.h:90
 TMrbMesytec_Mdpp16.h:91
 TMrbMesytec_Mdpp16.h:92
 TMrbMesytec_Mdpp16.h:93
 TMrbMesytec_Mdpp16.h:94
 TMrbMesytec_Mdpp16.h:95
 TMrbMesytec_Mdpp16.h:96
 TMrbMesytec_Mdpp16.h:97
 TMrbMesytec_Mdpp16.h:98
 TMrbMesytec_Mdpp16.h:99
 TMrbMesytec_Mdpp16.h:100
 TMrbMesytec_Mdpp16.h:101
 TMrbMesytec_Mdpp16.h:102
 TMrbMesytec_Mdpp16.h:103
 TMrbMesytec_Mdpp16.h:104
 TMrbMesytec_Mdpp16.h:105
 TMrbMesytec_Mdpp16.h:106
 TMrbMesytec_Mdpp16.h:107
 TMrbMesytec_Mdpp16.h:108
 TMrbMesytec_Mdpp16.h:109
 TMrbMesytec_Mdpp16.h:110
 TMrbMesytec_Mdpp16.h:111
 TMrbMesytec_Mdpp16.h:112
 TMrbMesytec_Mdpp16.h:113
 TMrbMesytec_Mdpp16.h:114
 TMrbMesytec_Mdpp16.h:115
 TMrbMesytec_Mdpp16.h:116
 TMrbMesytec_Mdpp16.h:117
 TMrbMesytec_Mdpp16.h:118
 TMrbMesytec_Mdpp16.h:119
 TMrbMesytec_Mdpp16.h:120
 TMrbMesytec_Mdpp16.h:121
 TMrbMesytec_Mdpp16.h:122
 TMrbMesytec_Mdpp16.h:123
 TMrbMesytec_Mdpp16.h:124
 TMrbMesytec_Mdpp16.h:125
 TMrbMesytec_Mdpp16.h:126
 TMrbMesytec_Mdpp16.h:127
 TMrbMesytec_Mdpp16.h:128
 TMrbMesytec_Mdpp16.h:129
 TMrbMesytec_Mdpp16.h:130
 TMrbMesytec_Mdpp16.h:131
 TMrbMesytec_Mdpp16.h:132
 TMrbMesytec_Mdpp16.h:133
 TMrbMesytec_Mdpp16.h:134
 TMrbMesytec_Mdpp16.h:135
 TMrbMesytec_Mdpp16.h:136
 TMrbMesytec_Mdpp16.h:137
 TMrbMesytec_Mdpp16.h:138
 TMrbMesytec_Mdpp16.h:139
 TMrbMesytec_Mdpp16.h:140
 TMrbMesytec_Mdpp16.h:141
 TMrbMesytec_Mdpp16.h:142
 TMrbMesytec_Mdpp16.h:143
 TMrbMesytec_Mdpp16.h:144
 TMrbMesytec_Mdpp16.h:145
 TMrbMesytec_Mdpp16.h:146
 TMrbMesytec_Mdpp16.h:147
 TMrbMesytec_Mdpp16.h:148
 TMrbMesytec_Mdpp16.h:149
 TMrbMesytec_Mdpp16.h:150
 TMrbMesytec_Mdpp16.h:151
 TMrbMesytec_Mdpp16.h:152
 TMrbMesytec_Mdpp16.h:153
 TMrbMesytec_Mdpp16.h:154
 TMrbMesytec_Mdpp16.h:155
 TMrbMesytec_Mdpp16.h:156
 TMrbMesytec_Mdpp16.h:157
 TMrbMesytec_Mdpp16.h:158
 TMrbMesytec_Mdpp16.h:159
 TMrbMesytec_Mdpp16.h:160
 TMrbMesytec_Mdpp16.h:161
 TMrbMesytec_Mdpp16.h:162
 TMrbMesytec_Mdpp16.h:163
 TMrbMesytec_Mdpp16.h:164
 TMrbMesytec_Mdpp16.h:165
 TMrbMesytec_Mdpp16.h:166
 TMrbMesytec_Mdpp16.h:167
 TMrbMesytec_Mdpp16.h:168
 TMrbMesytec_Mdpp16.h:169
 TMrbMesytec_Mdpp16.h:170
 TMrbMesytec_Mdpp16.h:171
 TMrbMesytec_Mdpp16.h:172
 TMrbMesytec_Mdpp16.h:173
 TMrbMesytec_Mdpp16.h:174
 TMrbMesytec_Mdpp16.h:175
 TMrbMesytec_Mdpp16.h:176
 TMrbMesytec_Mdpp16.h:177
 TMrbMesytec_Mdpp16.h:178
 TMrbMesytec_Mdpp16.h:179
 TMrbMesytec_Mdpp16.h:180
 TMrbMesytec_Mdpp16.h:181
 TMrbMesytec_Mdpp16.h:182
 TMrbMesytec_Mdpp16.h:183
 TMrbMesytec_Mdpp16.h:184
 TMrbMesytec_Mdpp16.h:185
 TMrbMesytec_Mdpp16.h:186
 TMrbMesytec_Mdpp16.h:187
 TMrbMesytec_Mdpp16.h:188
 TMrbMesytec_Mdpp16.h:189
 TMrbMesytec_Mdpp16.h:190
 TMrbMesytec_Mdpp16.h:191
 TMrbMesytec_Mdpp16.h:192
 TMrbMesytec_Mdpp16.h:193
 TMrbMesytec_Mdpp16.h:194
 TMrbMesytec_Mdpp16.h:195
 TMrbMesytec_Mdpp16.h:196
 TMrbMesytec_Mdpp16.h:197
 TMrbMesytec_Mdpp16.h:198
 TMrbMesytec_Mdpp16.h:199
 TMrbMesytec_Mdpp16.h:200
 TMrbMesytec_Mdpp16.h:201
 TMrbMesytec_Mdpp16.h:202
 TMrbMesytec_Mdpp16.h:203
 TMrbMesytec_Mdpp16.h:204
 TMrbMesytec_Mdpp16.h:205
 TMrbMesytec_Mdpp16.h:206
 TMrbMesytec_Mdpp16.h:207
 TMrbMesytec_Mdpp16.h:208
 TMrbMesytec_Mdpp16.h:209
 TMrbMesytec_Mdpp16.h:210
 TMrbMesytec_Mdpp16.h:211
 TMrbMesytec_Mdpp16.h:212
 TMrbMesytec_Mdpp16.h:213
 TMrbMesytec_Mdpp16.h:214
 TMrbMesytec_Mdpp16.h:215
 TMrbMesytec_Mdpp16.h:216
 TMrbMesytec_Mdpp16.h:217
 TMrbMesytec_Mdpp16.h:218
 TMrbMesytec_Mdpp16.h:219
 TMrbMesytec_Mdpp16.h:220
 TMrbMesytec_Mdpp16.h:221
 TMrbMesytec_Mdpp16.h:222
 TMrbMesytec_Mdpp16.h:223
 TMrbMesytec_Mdpp16.h:224
 TMrbMesytec_Mdpp16.h:225
 TMrbMesytec_Mdpp16.h:226
 TMrbMesytec_Mdpp16.h:227
 TMrbMesytec_Mdpp16.h:228
 TMrbMesytec_Mdpp16.h:229
 TMrbMesytec_Mdpp16.h:230
 TMrbMesytec_Mdpp16.h:231
 TMrbMesytec_Mdpp16.h:232
 TMrbMesytec_Mdpp16.h:233
 TMrbMesytec_Mdpp16.h:234
 TMrbMesytec_Mdpp16.h:235
 TMrbMesytec_Mdpp16.h:236
 TMrbMesytec_Mdpp16.h:237
 TMrbMesytec_Mdpp16.h:238
 TMrbMesytec_Mdpp16.h:239
 TMrbMesytec_Mdpp16.h:240
 TMrbMesytec_Mdpp16.h:241
 TMrbMesytec_Mdpp16.h:242
 TMrbMesytec_Mdpp16.h:243
 TMrbMesytec_Mdpp16.h:244
 TMrbMesytec_Mdpp16.h:245
 TMrbMesytec_Mdpp16.h:246
 TMrbMesytec_Mdpp16.h:247
 TMrbMesytec_Mdpp16.h:248
 TMrbMesytec_Mdpp16.h:249
 TMrbMesytec_Mdpp16.h:250
 TMrbMesytec_Mdpp16.h:251
 TMrbMesytec_Mdpp16.h:252
 TMrbMesytec_Mdpp16.h:253
 TMrbMesytec_Mdpp16.h:254
 TMrbMesytec_Mdpp16.h:255
 TMrbMesytec_Mdpp16.h:256
 TMrbMesytec_Mdpp16.h:257
 TMrbMesytec_Mdpp16.h:258
 TMrbMesytec_Mdpp16.h:259
 TMrbMesytec_Mdpp16.h:260
 TMrbMesytec_Mdpp16.h:261
 TMrbMesytec_Mdpp16.h:262
 TMrbMesytec_Mdpp16.h:263
 TMrbMesytec_Mdpp16.h:264
 TMrbMesytec_Mdpp16.h:265
 TMrbMesytec_Mdpp16.h:266
 TMrbMesytec_Mdpp16.h:267
 TMrbMesytec_Mdpp16.h:268
 TMrbMesytec_Mdpp16.h:269
 TMrbMesytec_Mdpp16.h:270
 TMrbMesytec_Mdpp16.h:271
 TMrbMesytec_Mdpp16.h:272
 TMrbMesytec_Mdpp16.h:273
 TMrbMesytec_Mdpp16.h:274
 TMrbMesytec_Mdpp16.h:275
 TMrbMesytec_Mdpp16.h:276
 TMrbMesytec_Mdpp16.h:277
 TMrbMesytec_Mdpp16.h:278
 TMrbMesytec_Mdpp16.h:279
 TMrbMesytec_Mdpp16.h:280
 TMrbMesytec_Mdpp16.h:281
 TMrbMesytec_Mdpp16.h:282
 TMrbMesytec_Mdpp16.h:283
 TMrbMesytec_Mdpp16.h:284
 TMrbMesytec_Mdpp16.h:285
 TMrbMesytec_Mdpp16.h:286
 TMrbMesytec_Mdpp16.h:287
 TMrbMesytec_Mdpp16.h:288
 TMrbMesytec_Mdpp16.h:289
 TMrbMesytec_Mdpp16.h:290
 TMrbMesytec_Mdpp16.h:291
 TMrbMesytec_Mdpp16.h:292
 TMrbMesytec_Mdpp16.h:293
 TMrbMesytec_Mdpp16.h:294
 TMrbMesytec_Mdpp16.h:295
 TMrbMesytec_Mdpp16.h:296
 TMrbMesytec_Mdpp16.h:297
 TMrbMesytec_Mdpp16.h:298
 TMrbMesytec_Mdpp16.h:299
 TMrbMesytec_Mdpp16.h:300
 TMrbMesytec_Mdpp16.h:301
 TMrbMesytec_Mdpp16.h:302
 TMrbMesytec_Mdpp16.h:303
 TMrbMesytec_Mdpp16.h:304
 TMrbMesytec_Mdpp16.h:305
 TMrbMesytec_Mdpp16.h:306
 TMrbMesytec_Mdpp16.h:307
 TMrbMesytec_Mdpp16.h:308
 TMrbMesytec_Mdpp16.h:309
 TMrbMesytec_Mdpp16.h:310
 TMrbMesytec_Mdpp16.h:311
 TMrbMesytec_Mdpp16.h:312
 TMrbMesytec_Mdpp16.h:313
 TMrbMesytec_Mdpp16.h:314
 TMrbMesytec_Mdpp16.h:315
 TMrbMesytec_Mdpp16.h:316
 TMrbMesytec_Mdpp16.h:317
 TMrbMesytec_Mdpp16.h:318
 TMrbMesytec_Mdpp16.h:319
 TMrbMesytec_Mdpp16.h:320
 TMrbMesytec_Mdpp16.h:321
 TMrbMesytec_Mdpp16.h:322
 TMrbMesytec_Mdpp16.h:323
 TMrbMesytec_Mdpp16.h:324
 TMrbMesytec_Mdpp16.h:325
 TMrbMesytec_Mdpp16.h:326
 TMrbMesytec_Mdpp16.h:327
 TMrbMesytec_Mdpp16.h:328
 TMrbMesytec_Mdpp16.h:329
 TMrbMesytec_Mdpp16.h:330
 TMrbMesytec_Mdpp16.h:331
 TMrbMesytec_Mdpp16.h:332
 TMrbMesytec_Mdpp16.h:333
 TMrbMesytec_Mdpp16.h:334
 TMrbMesytec_Mdpp16.h:335
 TMrbMesytec_Mdpp16.h:336
 TMrbMesytec_Mdpp16.h:337
 TMrbMesytec_Mdpp16.h:338
 TMrbMesytec_Mdpp16.h:339
 TMrbMesytec_Mdpp16.h:340
 TMrbMesytec_Mdpp16.h:341
 TMrbMesytec_Mdpp16.h:342
 TMrbMesytec_Mdpp16.h:343
 TMrbMesytec_Mdpp16.h:344
 TMrbMesytec_Mdpp16.h:345
 TMrbMesytec_Mdpp16.h:346
 TMrbMesytec_Mdpp16.h:347
 TMrbMesytec_Mdpp16.h:348
 TMrbMesytec_Mdpp16.h:349
 TMrbMesytec_Mdpp16.h:350
 TMrbMesytec_Mdpp16.h:351
 TMrbMesytec_Mdpp16.h:352
 TMrbMesytec_Mdpp16.h:353
 TMrbMesytec_Mdpp16.h:354
 TMrbMesytec_Mdpp16.h:355
 TMrbMesytec_Mdpp16.h:356
 TMrbMesytec_Mdpp16.h:357
 TMrbMesytec_Mdpp16.h:358
 TMrbMesytec_Mdpp16.h:359
 TMrbMesytec_Mdpp16.h:360
 TMrbMesytec_Mdpp16.h:361
 TMrbMesytec_Mdpp16.h:362
 TMrbMesytec_Mdpp16.h:363
 TMrbMesytec_Mdpp16.h:364
 TMrbMesytec_Mdpp16.h:365
 TMrbMesytec_Mdpp16.h:366
 TMrbMesytec_Mdpp16.h:367
 TMrbMesytec_Mdpp16.h:368
 TMrbMesytec_Mdpp16.h:369
 TMrbMesytec_Mdpp16.h:370
 TMrbMesytec_Mdpp16.h:371
 TMrbMesytec_Mdpp16.h:372
 TMrbMesytec_Mdpp16.h:373
 TMrbMesytec_Mdpp16.h:374
 TMrbMesytec_Mdpp16.h:375
 TMrbMesytec_Mdpp16.h:376
 TMrbMesytec_Mdpp16.h:377
 TMrbMesytec_Mdpp16.h:378
 TMrbMesytec_Mdpp16.h:379
 TMrbMesytec_Mdpp16.h:380
 TMrbMesytec_Mdpp16.h:381
 TMrbMesytec_Mdpp16.h:382
 TMrbMesytec_Mdpp16.h:383
 TMrbMesytec_Mdpp16.h:384
 TMrbMesytec_Mdpp16.h:385
 TMrbMesytec_Mdpp16.h:386
 TMrbMesytec_Mdpp16.h:387
 TMrbMesytec_Mdpp16.h:388
 TMrbMesytec_Mdpp16.h:389
 TMrbMesytec_Mdpp16.h:390
 TMrbMesytec_Mdpp16.h:391
 TMrbMesytec_Mdpp16.h:392
 TMrbMesytec_Mdpp16.h:393
 TMrbMesytec_Mdpp16.h:394
 TMrbMesytec_Mdpp16.h:395
 TMrbMesytec_Mdpp16.h:396
 TMrbMesytec_Mdpp16.h:397
 TMrbMesytec_Mdpp16.h:398
 TMrbMesytec_Mdpp16.h:399
 TMrbMesytec_Mdpp16.h:400
 TMrbMesytec_Mdpp16.h:401
 TMrbMesytec_Mdpp16.h:402
 TMrbMesytec_Mdpp16.h:403
 TMrbMesytec_Mdpp16.h:404
 TMrbMesytec_Mdpp16.h:405
 TMrbMesytec_Mdpp16.h:406
 TMrbMesytec_Mdpp16.h:407
 TMrbMesytec_Mdpp16.h:408
 TMrbMesytec_Mdpp16.h:409
 TMrbMesytec_Mdpp16.h:410
 TMrbMesytec_Mdpp16.h:411
 TMrbMesytec_Mdpp16.h:412
 TMrbMesytec_Mdpp16.h:413
 TMrbMesytec_Mdpp16.h:414
 TMrbMesytec_Mdpp16.h:415
 TMrbMesytec_Mdpp16.h:416
 TMrbMesytec_Mdpp16.h:417
 TMrbMesytec_Mdpp16.h:418
 TMrbMesytec_Mdpp16.h:419
 TMrbMesytec_Mdpp16.h:420
 TMrbMesytec_Mdpp16.h:421
 TMrbMesytec_Mdpp16.h:422
 TMrbMesytec_Mdpp16.h:423
 TMrbMesytec_Mdpp16.h:424
 TMrbMesytec_Mdpp16.h:425
 TMrbMesytec_Mdpp16.h:426
 TMrbMesytec_Mdpp16.h:427
 TMrbMesytec_Mdpp16.h:428
 TMrbMesytec_Mdpp16.h:429
 TMrbMesytec_Mdpp16.h:430
 TMrbMesytec_Mdpp16.h:431
 TMrbMesytec_Mdpp16.h:432
 TMrbMesytec_Mdpp16.h:433
 TMrbMesytec_Mdpp16.h:434
 TMrbMesytec_Mdpp16.h:435
 TMrbMesytec_Mdpp16.h:436