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