]>
Commit | Line | Data |
---|---|---|
3b2353d8 | 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 | ||
445096c0 | 18 | #include "AliMUONTrigger.h" |
7ca4655f | 19 | |
3b2353d8 | 20 | #include "AliLog.h" |
445096c0 | 21 | #include "AliMUONGlobalTrigger.h" |
22 | #include "AliMUONVTriggerStore.h" | |
3b2353d8 | 23 | #include "AliRun.h" |
24 | #include "AliRunLoader.h" | |
25 | #include "AliTriggerInput.h" | |
26 | ||
85fec35d | 27 | /// |
28 | /// \class AliMUONTrigger | |
29 | /// | |
30 | /// Implementation of AliTriggerDetector for MUON detector | |
31 | /// | |
32 | /// So far, the inputs are taken from AliMUONTriggerDecision object | |
f57d136a | 33 | /// April 06, E.L.T. |
34 | /// May 06, taken info from Global Trigger branch (Ch.F) | |
85fec35d | 35 | |
3b2353d8 | 36 | //---------------------------------------------------------------------- |
71a2d3aa | 37 | /// \cond CLASSIMP |
3b2353d8 | 38 | ClassImp(AliMUONTrigger) |
71a2d3aa | 39 | /// \endcond |
3b2353d8 | 40 | |
41 | //---------------------------------------------------------------------- | |
42 | AliMUONTrigger::AliMUONTrigger() | |
445096c0 | 43 | : AliTriggerDetector(), fTriggerStore(0x0) |
3b2353d8 | 44 | { |
71a2d3aa | 45 | /// Default constructor |
46 | ||
3b2353d8 | 47 | SetName("MUON"); |
48 | CreateInputs(); | |
49 | } | |
50 | ||
71a2d3aa | 51 | //---------------------------------------------------------------------- |
52 | AliMUONTrigger::~AliMUONTrigger() | |
53 | { | |
445096c0 | 54 | /// Destructor |
55 | delete fTriggerStore; | |
71a2d3aa | 56 | } |
57 | ||
3b2353d8 | 58 | //---------------------------------------------------------------------- |
59 | void AliMUONTrigger::CreateInputs() | |
60 | { | |
71a2d3aa | 61 | /// inputs |
3b2353d8 | 62 | |
63 | // Do not create inputs again!! | |
64 | if( fInputs.GetEntriesFast() > 0 ) return; | |
65 | ||
8d4fefab | 66 | fInputs.AddLast( new AliTriggerInput( "MUON_Single_LPt_L0", "Single Low Pt", 0x01 ) ); |
67 | fInputs.AddLast( new AliTriggerInput( "MUON_Single_HPt_L0", "Single High Pt", 0x02 ) ); | |
3b2353d8 | 68 | |
8d4fefab | 69 | fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "Dimuon Unlike Sign pair Low Pt", 0x04 ) ); |
70 | fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "Dimuon Unlike Sign pair High Pt", 0x08 ) ); | |
3b2353d8 | 71 | |
8d4fefab | 72 | fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "Dimuon Like Sign pair Low Pt", 0x10 ) ); |
73 | fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "Dimuon Like Sign pair High Pt", 0x20 ) ); | |
3b2353d8 | 74 | } |
75 | ||
76 | //---------------------------------------------------------------------- | |
77 | void AliMUONTrigger::Trigger() | |
78 | { | |
71a2d3aa | 79 | /// sets the trigger inputs |
80 | ||
3b2353d8 | 81 | AliRunLoader* runLoader = gAlice->GetRunLoader(); |
445096c0 | 82 | |
83 | AliLoader * muonLoader = runLoader->GetDetectorLoader("MUON"); | |
84aac932 | 84 | muonLoader->LoadDigits("READ"); |
f57d136a | 85 | |
445096c0 | 86 | TTree* treeD = muonLoader->TreeD(); |
87 | ||
88 | if (!treeD) | |
89 | { | |
90 | AliError("No TreeD available. Cannot make trigger"); | |
698b2e52 | 91 | return; |
92 | } | |
445096c0 | 93 | |
94 | if (!fTriggerStore) | |
95 | { | |
96 | fTriggerStore = AliMUONVTriggerStore::Create(*treeD); | |
97 | if (!fTriggerStore) | |
98 | { | |
99 | AliError("Could not create triggerStore from treeD"); | |
100 | return; | |
101 | } | |
102 | } | |
f57d136a | 103 | |
445096c0 | 104 | Bool_t ok = fTriggerStore->Connect(*treeD,kTRUE); |
105 | ||
106 | if (!ok) | |
107 | { | |
108 | AliError("Could not read trigger from TreeD !"); | |
f57d136a | 109 | return; |
110 | } | |
3b2353d8 | 111 | |
445096c0 | 112 | treeD->GetEvent(0); |
3b2353d8 | 113 | |
445096c0 | 114 | AliMUONGlobalTrigger* globalTrigger = fTriggerStore->Global(); |
115 | if (globalTrigger == 0x0) | |
116 | { | |
117 | AliWarning("No Global Trigger available"); | |
118 | } | |
119 | else | |
120 | { | |
121 | // set CTP | |
122 | if (globalTrigger->SingleLpt()) SetInput("MUON_Single_LPt_L0"); | |
123 | if (globalTrigger->SingleHpt()) SetInput("MUON_Single_HPt_L0"); | |
124 | ||
125 | if (globalTrigger->PairUnlikeLpt()) SetInput("MUON_Unlike_LPt_L0"); | |
126 | if (globalTrigger->PairUnlikeHpt()) SetInput("MUON_Unlike_HPt_L0"); | |
127 | ||
128 | if (globalTrigger->PairLikeLpt()) SetInput("MUON_Like_LPt_L0"); | |
129 | if (globalTrigger->PairLikeHpt()) SetInput("MUON_Like_HPt_L0"); | |
130 | } | |
f57d136a | 131 | muonLoader->UnloadDigits(); |
445096c0 | 132 | fTriggerStore->Clear(); |
3b2353d8 | 133 | } |