]>
Commit | Line | Data |
---|---|---|
88f843f1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | // Author: Andrei Gheata, 28/07/2009 | |
18 | ||
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 | //============================================================================== | |
24 | ||
25 | #include "AliTrigDigitalCircuit.h" | |
79e35bac | 26 | #include "AliTrigConnector.h" |
88f843f1 | 27 | |
28 | ClassImp(AliTrigDigitalCircuit) | |
29 | ||
88f843f1 | 30 | //______________________________________________________________________________ |
31 | AliTrigDigitalCircuit::~AliTrigDigitalCircuit() | |
32 | { | |
33 | // Destructor | |
34 | if (fConnector) delete fConnector; | |
35 | } | |
36 | ||
37 | //______________________________________________________________________________ | |
79e35bac | 38 | Bool_t AliTrigDigitalCircuit::Connect(Int_t output, AliTrigDevice *other, Int_t at_input) |
88f843f1 | 39 | { |
40 | // Connect to an input of another device. | |
79e35bac | 41 | if (!fConnector) fConnector = new AliTrigConnector(Form("wire_%s_%d", GetName(), output), (AliTrigDevice*)this, 0); |
88f843f1 | 42 | fConnector->Connect(other, at_input); |
70854dfe | 43 | return kTRUE; |
88f843f1 | 44 | } |
45 | ||
46 | //______________________________________________________________________________ | |
79e35bac | 47 | Bool_t AliTrigDigitalCircuit::Response(Int_t /*output*/) |
88f843f1 | 48 | { |
49 | // Response function of the digital circuit. Calling user-defined one. | |
79e35bac | 50 | fLastOutput = Trigger(); |
88f843f1 | 51 | if (fConnector) fConnector->Transmit(fLastOutput); |
52 | return fLastOutput; | |
53 | } |