]>
Commit | Line | Data |
---|---|---|
5e319bd5 | 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 | /* $Id: AliADTrigger.cxx 49869 2011-05-18 04:49:51Z hristov $ */ | |
16 | // --------------------- | |
17 | // Class AliADTrigger | |
18 | // --------------------- | |
19 | // Top class to simulate the AD trigger response | |
20 | // This class is only used for interface with AliTriggerDetector | |
21 | // Its create and Set Inputs of the CTP | |
22 | // | |
23 | ||
24 | ||
25 | #include <TClonesArray.h> | |
26 | #include <TTree.h> | |
27 | ||
28 | #include "AliRun.h" | |
29 | #include "AliLoader.h" | |
30 | #include "AliLog.h" | |
31 | #include "AliRunLoader.h" | |
32 | #include "AliTriggerInput.h" | |
33 | ||
34 | #include "AliADdigit.h" | |
35 | #include "AliADTrigger.h" | |
36 | ||
37 | //______________________________________________________________________ | |
38 | ClassImp(AliADTrigger) | |
39 | ||
40 | //______________________________________________________________________ | |
41 | ||
42 | AliADTrigger::AliADTrigger():AliTriggerDetector() | |
43 | { | |
44 | SetName("AD"); | |
45 | CreateInputs(); | |
46 | } | |
47 | //______________________________________________________________________ | |
48 | void AliADTrigger::CreateInputs() | |
49 | { | |
50 | // Do not create inputs again!! | |
51 | if( fInputs.GetEntriesFast() > 0 ) return; | |
52 | ||
53 | fInputs.AddLast( new AliTriggerInput( "AD_ADA", "AD", 0 ) ); | |
54 | fInputs.AddLast( new AliTriggerInput( "AD_ADD","AD", 0 ) ); | |
55 | fInputs.AddLast( new AliTriggerInput( "AD_ADA2", "AD", 0 ) ); | |
56 | fInputs.AddLast( new AliTriggerInput( "AD_ADD2","AD", 0 ) ); | |
57 | } | |
58 | ||
59 | //______________________________________________________________________ | |
60 | void AliADTrigger::Trigger() | |
61 | { | |
62 | // ********** Get run loader for the current event ********** | |
63 | AliRunLoader* runLoader = AliRunLoader::Instance(); | |
64 | ||
65 | AliLoader* loader = runLoader->GetLoader( "ADLoader" ); | |
66 | ||
67 | if(!loader) { | |
68 | AliError("Can not get AD loader"); | |
69 | return; | |
70 | } | |
71 | loader->LoadDigits("update"); | |
72 | TTree* vzeroDigitsTree = loader->TreeD(); | |
73 | ||
74 | if (!vzeroDigitsTree) { | |
75 | AliError("Can not get the AD digit tree"); | |
76 | return; | |
77 | } | |
78 | TClonesArray* vzeroDigits = NULL; | |
79 | TBranch* digitBranch = vzeroDigitsTree->GetBranch("ADDigit"); | |
80 | digitBranch->SetAddress(&vzeroDigits); | |
81 | ||
82 | // Check trigger contitions | |
83 | // .... Ex. number of digit over threshold | |
84 | // | |
85 | ||
86 | loader->UnloadDigits(); | |
87 | ||
88 | ||
89 | // if( ) SetInput( "AD_ADA" ); | |
90 | // if( ) SetInput( "AD_ADD" ); | |
91 | ||
92 | return; | |
93 | } | |
94 | ||
95 | ||
96 |