]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTrigger.cxx
- Removed not implemented methods AddData(), GetGlobalTriggerPattern
[u/mrichter/AliRoot.git] / MUON / AliMUONTrigger.cxx
CommitLineData
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
7ca4655f 18#include <TClonesArray.h>
19
3b2353d8 20#include "AliLog.h"
21#include "AliRun.h"
22#include "AliRunLoader.h"
23#include "AliTriggerInput.h"
24
25#include "AliMUON.h"
26#include "AliMUONLoader.h"
27#include "AliMUONData.h"
28#include "AliMUONDigit.h"
f57d136a 29#include "AliMUONGlobalTrigger.h"
3b2353d8 30#include "AliMUONTrigger.h"
31
85fec35d 32///
33/// \class AliMUONTrigger
34///
35/// Implementation of AliTriggerDetector for MUON detector
36///
37/// So far, the inputs are taken from AliMUONTriggerDecision object
f57d136a 38/// April 06, E.L.T.
39/// May 06, taken info from Global Trigger branch (Ch.F)
85fec35d 40
3b2353d8 41//----------------------------------------------------------------------
42ClassImp(AliMUONTrigger)
43
44//----------------------------------------------------------------------
45AliMUONTrigger::AliMUONTrigger()
46 : AliTriggerDetector()
47{
48 SetName("MUON");
49 CreateInputs();
50}
51
52//----------------------------------------------------------------------
53void AliMUONTrigger::CreateInputs()
54{
55 // inputs
56
57 // Do not create inputs again!!
58 if( fInputs.GetEntriesFast() > 0 ) return;
59
8d4fefab 60 fInputs.AddLast( new AliTriggerInput( "MUON_Single_LPt_L0", "Single Low Pt", 0x01 ) );
61 fInputs.AddLast( new AliTriggerInput( "MUON_Single_HPt_L0", "Single High Pt", 0x02 ) );
3b2353d8 62
8d4fefab 63 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "Dimuon Unlike Sign pair Low Pt", 0x04 ) );
64 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "Dimuon Unlike Sign pair High Pt", 0x08 ) );
3b2353d8 65
8d4fefab 66 fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "Dimuon Like Sign pair Low Pt", 0x10 ) );
67 fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "Dimuon Like Sign pair High Pt", 0x20 ) );
3b2353d8 68}
69
70//----------------------------------------------------------------------
71void AliMUONTrigger::Trigger()
72{
85fec35d 73 // sets the trigger inputs
f57d136a 74 AliMUONGlobalTrigger* globalTrigger;
75 TClonesArray* globalTriggerArray;
3b2353d8 76
77 AliRunLoader* runLoader = gAlice->GetRunLoader();
78
84aac932 79 AliLoader * muonLoader = runLoader->GetLoader("MUONLoader");
80 muonLoader->LoadDigits("READ");
f57d136a 81
3b2353d8 82 // Creating MUON data container
84aac932 83 AliMUONData* muonData = new AliMUONData(muonLoader,"MUON","MUON");
f57d136a 84
85 // get global info
86 muonData->SetTreeAddress("GLT");
87 muonData->GetTriggerD();
88 globalTriggerArray = muonData->GlobalTrigger();
698b2e52 89 if (globalTriggerArray == 0x0) {
90 AliWarning("No Global Trigger Array available");
91 return;
92 }
f57d136a 93 globalTrigger = (AliMUONGlobalTrigger*)globalTriggerArray->UncheckedAt(0);
94
95 if (globalTrigger == 0x0) {
96 AliWarning("No Global Trigger available");
97 return;
98 }
99 // set CTP
8d4fefab 100 if (globalTrigger->SingleLpt()) SetInput("MUON_Single_LPt_L0");
101 if (globalTrigger->SingleHpt()) SetInput("MUON_Single_HPt_L0");
3b2353d8 102
f57d136a 103 if (globalTrigger->PairUnlikeLpt()) SetInput("MUON_Unlike_LPt_L0");
104 if (globalTrigger->PairUnlikeHpt()) SetInput("MUON_Unlike_HPt_L0");
3b2353d8 105
f57d136a 106 if (globalTrigger->PairLikeLpt()) SetInput("MUON_Like_LPt_L0");
107 if (globalTrigger->PairLikeHpt()) SetInput("MUON_Like_HPt_L0");
f57d136a 108
109 muonData->ResetTrigger();
110 muonLoader->UnloadDigits();
111
3b2353d8 112}