1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // Author: Andrei Gheata, 28/07/2009
19 //==============================================================================
20 // AliTrigDigitalCircuit - Device that has N Boolean inputs and one Boolean
21 // output. This is a base class and derived digital circuits must implement the
22 // response function Trigger()
23 //==============================================================================
25 #include "AliTrigDigitalCircuit.h"
27 ClassImp(AliTrigDigitalCircuit)
29 //______________________________________________________________________________
30 AliTrigDigitalCircuit::AliTrigDigitalCircuit(const AliTrigDigitalCircuit &other)
31 :AliTrigDevice(other),
32 fLastOutput(other.fLastOutput),
34 fInputs(other.fInputs)
37 if (other.fConnector) fConnector = new AliTrigConnector(*other.fConnector);
40 //______________________________________________________________________________
41 AliTrigDigitalCircuit::~AliTrigDigitalCircuit()
44 if (fConnector) delete fConnector;
47 //______________________________________________________________________________
48 AliTrigDigitalCircuit& AliTrigDigitalCircuit::operator=(const AliTrigDigitalCircuit &other)
51 if (&other == this) return *this;
52 AliTrigDevice::operator=(other);
53 fLastOutput = other.fLastOutput;
54 if (other.fConnector) fConnector = new AliTrigConnector(*other.fConnector);
56 fInputs = other.fInputs;
60 //______________________________________________________________________________
61 Bool_t AliTrigDigitalCircuit::Connect(UInt_t output, AliTrigDevice *other, UInt_t at_input)
63 // Connect to an input of another device.
64 if (!fConnector) fConnector = new AliTrigConnector(this, 0);
65 fConnector->Connect(other, at_input);
68 //______________________________________________________________________________
69 Bool_t AliTrigDigitalCircuit::Response(UInt_t /*output*/)
71 // Response function of the digital circuit. Calling user-defined one.
72 fLastOutput = CircuitResponse();
73 if (fConnector) fConnector->Transmit(fLastOutput);