Line data Source code
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: AliTRDTrigger.cxx 31904 2009-04-08 16:42:03Z cblume $ */
17 :
18 : ///////////////////////////////////////////////////////////////////////////////
19 : // //
20 : // TRD trigger interface class to CTP //
21 : // from here the trigger simulation for L0 (pretrigger) and L1 (GTU) are //
22 : // called //
23 : // //
24 : ///////////////////////////////////////////////////////////////////////////////
25 :
26 : #include "TClonesArray.h"
27 :
28 : #include "AliLog.h"
29 : #include "AliTriggerInput.h"
30 : #include "AliTriggerDetector.h"
31 :
32 : #include "AliTRDTrigger.h"
33 : #include "AliTRDTriggerL0.h"
34 : #include "AliTRDTriggerL1.h"
35 :
36 : AliTRDTrigger::AliTRDTrigger() :
37 4 : AliTriggerDetector(),
38 4 : fTriggers()
39 20 : {
40 : // default constructor
41 :
42 12 : fTriggers.AddLast(new AliTRDTriggerL0());
43 12 : fTriggers.AddLast(new AliTRDTriggerL1());
44 :
45 4 : SetName("TRD");
46 8 : }
47 :
48 : AliTRDTrigger::~AliTRDTrigger()
49 24 : {
50 : // destructor
51 4 : TIter trigger(&fTriggers);
52 28 : while (AliTriggerDetector *trgDet = (AliTriggerDetector*) trigger())
53 24 : delete trgDet;
54 :
55 4 : fInputs.Clear(); // inputs are deleted either by CTP or submodule
56 12 : }
57 :
58 : void AliTRDTrigger::AssignInputs(const TObjArray& inputs)
59 : {
60 : // Create inputs for all registered trigger modules.
61 8 : if( fInputs.GetEntriesFast() > 0 ) return;
62 :
63 4 : TIter trigger(&fTriggers);
64 32 : while (AliTriggerDetector *trgDet = (AliTriggerDetector*) trigger()) {
65 8 : trgDet->AssignInputs(inputs);
66 8 : fInputs.AddAll(trgDet->GetInputs());
67 8 : }
68 8 : }
69 :
70 : void AliTRDTrigger::CreateInputs()
71 : {
72 :
73 0 : }
74 :
75 : void AliTRDTrigger::Trigger()
76 : {
77 : // TRD trigger steering
78 : // all registered TRD trigger mechanism are
79 : // run from here
80 :
81 8 : TIter trigger(&fTriggers);
82 32 : while (AliTriggerDetector *trgDet = (AliTriggerDetector*) trigger()) {
83 8 : trgDet->Trigger();
84 8 : }
85 4 : }
|