1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 #include "AliRunLoader.h"
21 #include "AliTriggerInput.h"
24 #include "AliMUONLoader.h"
25 #include "AliMUONData.h"
26 #include "AliMUONDigit.h"
27 #include "AliMUONGlobalTrigger.h"
28 #include "AliMUONTrigger.h"
31 /// \class AliMUONTrigger
33 /// Implementation of AliTriggerDetector for MUON detector
35 /// So far, the inputs are taken from AliMUONTriggerDecision object
37 /// May 06, taken info from Global Trigger branch (Ch.F)
39 //----------------------------------------------------------------------
40 ClassImp(AliMUONTrigger)
42 //----------------------------------------------------------------------
43 AliMUONTrigger::AliMUONTrigger()
44 : AliTriggerDetector()
50 //----------------------------------------------------------------------
51 void AliMUONTrigger::CreateInputs()
55 // Do not create inputs again!!
56 if( fInputs.GetEntriesFast() > 0 ) return;
58 fInputs.AddLast( new AliTriggerInput( "MUON_SPlus_LPt_L0", "Single Plus Low Pt", 0x01 ) );
59 fInputs.AddLast( new AliTriggerInput( "MUON_SPlus_HPt_L0", "Single Plus High Pt", 0x02 ) );
60 fInputs.AddLast( new AliTriggerInput( "MUON_SPlus_All_L0", "Single Plus All", 0x04 ) );
62 fInputs.AddLast( new AliTriggerInput( "MUON_SMinus_LPt_L0", "Single Minus Low Pt", 0x08 ) );
63 fInputs.AddLast( new AliTriggerInput( "MUON_SMinus_HPt_L0", "Single Minus High Pt", 0x10 ) );
64 fInputs.AddLast( new AliTriggerInput( "MUON_SMinus_All_L0", "Single Minus All", 0x20 ) );
66 fInputs.AddLast( new AliTriggerInput( "MUON_SUndef_LPt_L0", "Single Undefined Low Pt", 0x40 ) );
67 fInputs.AddLast( new AliTriggerInput( "MUON_SUndef_HPt_L0", "Single Undefined High Pt", 0x80 ) );
68 fInputs.AddLast( new AliTriggerInput( "MUON_SUndef_All_L0", "Single Undefined All", 0x100 ) );
70 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "Single Unlike Sign pair Low Pt", 0x200 ) );
71 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "Single Unlike Sign pair High Pt", 0x400 ) );
72 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_All_L0", "Single Unlike Sign pair All", 0x800 ) );
74 fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "Single Like Sign pair Low Pt", 0x1000 ) );
75 fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "Single Like Sign pair High Pt", 0x2000 ) );
76 fInputs.AddLast( new AliTriggerInput( "MUON_Like_All_L0", "Single Like Sign pair All", 0x4000 ) );
79 //----------------------------------------------------------------------
80 void AliMUONTrigger::Trigger()
82 // sets the trigger inputs
83 AliMUONGlobalTrigger* globalTrigger;
84 TClonesArray* globalTriggerArray;
86 AliRunLoader* runLoader = gAlice->GetRunLoader();
88 AliLoader * muonLoader = runLoader->GetLoader("MUONLoader");
89 muonLoader->LoadDigits("READ");
91 // Creating MUON data container
92 AliMUONData* muonData = new AliMUONData(muonLoader,"MUON","MUON");
95 muonData->SetTreeAddress("GLT");
96 muonData->GetTriggerD();
97 globalTriggerArray = muonData->GlobalTrigger();
98 if (globalTriggerArray == 0x0) {
99 AliWarning("No Global Trigger Array available");
102 globalTrigger = (AliMUONGlobalTrigger*)globalTriggerArray->UncheckedAt(0);
104 if (globalTrigger == 0x0) {
105 AliWarning("No Global Trigger available");
109 if (globalTrigger->SinglePlusLpt()) SetInput("MUON_SPlus_LPt_L0");
110 if (globalTrigger->SinglePlusHpt()) SetInput("MUON_SPlus_HPt_L0");
111 if (globalTrigger->SinglePlusApt()) SetInput("MUON_SPlus_All_L0");
113 if (globalTrigger->SingleMinusLpt()) SetInput("MUON_SMinus_LPt_L0");
114 if (globalTrigger->SingleMinusHpt()) SetInput("MUON_SMinus_HPt_L0");
115 if (globalTrigger->SingleMinusApt()) SetInput("MUON_SMinus_All_L0");
117 if (globalTrigger->SingleUndefLpt()) SetInput("MUON_SUndef_LPt_L0");
118 if (globalTrigger->SingleUndefHpt()) SetInput("MUON_SUndef_HPt_L0");
119 if (globalTrigger->SingleUndefApt()) SetInput("MUON_SUndef_All_L0");
121 if (globalTrigger->PairUnlikeLpt()) SetInput("MUON_Unlike_LPt_L0");
122 if (globalTrigger->PairUnlikeHpt()) SetInput("MUON_Unlike_HPt_L0");
123 if (globalTrigger->PairUnlikeApt()) SetInput("MUON_Unlike_All_L0");
125 if (globalTrigger->PairLikeLpt()) SetInput("MUON_Like_LPt_L0");
126 if (globalTrigger->PairLikeHpt()) SetInput("MUON_Like_HPt_L0");
127 if (globalTrigger->PairLikeApt()) SetInput("MUON_Like_All_L0");
129 muonData->ResetTrigger();
130 muonLoader->UnloadDigits();