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 **************************************************************************/
19 #include "AliMUONTrigger.h"
22 #include "AliMUONGlobalTrigger.h"
23 #include "AliMUONVTriggerStore.h"
25 #include "AliRunLoader.h"
26 #include "AliLoader.h"
27 #include "AliTriggerInput.h"
30 //-----------------------------------------------------------------------------
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 /// \author E. Lopez Torres
40 //-----------------------------------------------------------------------------
42 //----------------------------------------------------------------------
44 ClassImp(AliMUONTrigger)
47 //----------------------------------------------------------------------
48 AliMUONTrigger::AliMUONTrigger()
49 : AliTriggerDetector(), fTriggerStore(0x0)
51 /// Default constructor
57 //----------------------------------------------------------------------
58 AliMUONTrigger::~AliMUONTrigger()
64 //----------------------------------------------------------------------
65 void AliMUONTrigger::CreateInputs()
69 // Do not create inputs again!!
70 if( fInputs.GetEntriesFast() > 0 ) return;
72 fInputs.AddLast( new AliTriggerInput( "0MSL", "MUONTRG", 0 ) );
73 fInputs.AddLast( new AliTriggerInput( "0MSH", "MUONTRG", 0 ) );
75 fInputs.AddLast( new AliTriggerInput( "0MUL", "MUONTRG", 0 ) );
76 fInputs.AddLast( new AliTriggerInput( "0MUH", "MUONTRG", 0 ) );
78 fInputs.AddLast( new AliTriggerInput( "0MLL", "MUONTRG", 0 ) );
79 fInputs.AddLast( new AliTriggerInput( "0MLH", "MUONTRG", 0 ) );
82 //----------------------------------------------------------------------
83 void AliMUONTrigger::Trigger()
85 /// sets the trigger inputs
87 AliRunLoader* runLoader = AliRunLoader::Instance();
89 AliLoader * muonLoader = runLoader->GetDetectorLoader("MUON");
90 muonLoader->LoadDigits("READ");
92 TTree* treeD = muonLoader->TreeD();
96 AliError("No TreeD available. Cannot make trigger");
102 fTriggerStore = AliMUONVTriggerStore::Create(*treeD);
105 AliError("Could not create triggerStore from treeD");
110 Bool_t ok = fTriggerStore->Connect(*treeD,kTRUE);
114 AliError("Could not read trigger from TreeD !");
120 AliMUONGlobalTrigger* globalTrigger = fTriggerStore->Global();
121 if (globalTrigger == 0x0)
123 AliWarning("No Global Trigger available");
128 if (globalTrigger->SingleLpt()) SetInput("0MSL");
129 if (globalTrigger->SingleHpt()) SetInput("0MSH");
131 if (globalTrigger->PairUnlikeLpt()) SetInput("0MUL");
132 if (globalTrigger->PairUnlikeHpt()) SetInput("0MUH");
134 if (globalTrigger->PairLikeLpt()) SetInput("0MLL");
135 if (globalTrigger->PairLikeHpt()) SetInput("0MLH");
137 muonLoader->UnloadDigits();
138 fTriggerStore->Clear();