Trigger inputs for AOD MC
[u/mrichter/AliRoot.git] / TRIGGER / AliTrigDigitalCircuit.h
CommitLineData
88f843f1 1#ifndef ALITRIGDIGITALCIRCUIT_H
2#define ALITRIGDIGITALCIRCUIT_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7// Author: Andrei Gheata, 27/07/2009
8
9//==============================================================================
10// AliTrigDigitalCircuit - Base class for digital circuits having N Boolean
11// inputs and one Boolean output. Derived classes must implement the pure
12// virtual method Trigger() that will return the Boolean response
13// of the circuit as function of the inputs.
14//==============================================================================
15
16#ifndef ALITRIGDEVICE_H
17#include "AliTrigDevice.h"
18#endif
19
20#ifndef ROOT_TBits
21#include "TBits.h"
22#endif
23
24class AliTrigEvent;
25class AliTrigConnector;
26
27class AliTrigDigitalCircuit : public AliTrigDevice {
28
29public:
30 AliTrigDigitalCircuit() : AliTrigDevice(), fLastOutput(kFALSE), fConnector(0), fInputs() {}
31 AliTrigDigitalCircuit(const char *name, UInt_t ninputs) : AliTrigDevice(name, ninputs, 1), fLastOutput(kFALSE), fConnector(0), fInputs(ninputs) {}
79e35bac 32 virtual ~AliTrigDigitalCircuit();
88f843f1 33
79e35bac 34 virtual Bool_t Connect(Int_t output, AliTrigDevice *other, Int_t at_input);
35 virtual Bool_t Response(Int_t output);
88f843f1 36 // Get/Set inputs
79e35bac 37 Bool_t GetInputValue(Int_t input) const {return fInputs.TestBitNumber(input);}
88f843f1 38 virtual void ResetInputs() {fInputs.ResetAllBits();}
79e35bac 39 virtual Bool_t SetInputType(Int_t /*input*/, const char */*classname*/) {return kFALSE;}
40 virtual Bool_t SetInputValue(Int_t input, Bool_t value) {fInputs.SetBitNumber(input,value); return kTRUE;}
41 virtual Bool_t SetInputValue(Int_t /*input*/, AliTrigEvent */*signal*/) {return kFALSE;}
88f843f1 42private:
43 // Circuit response function.
79e35bac 44 AliTrigDigitalCircuit(const AliTrigDigitalCircuit &other);
45 AliTrigDigitalCircuit &operator=(const AliTrigDigitalCircuit &other);
88f843f1 46 virtual Bool_t Trigger() = 0;
47
48protected:
49 Bool_t fLastOutput; // Output recorded after the last Response() call.
50 AliTrigConnector *fConnector; // Connector for the circuit output
51 TBits fInputs;
52
53 ClassDef(AliTrigDigitalCircuit,1) // Base class for digital circuits
54};
55#endif