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 **************************************************************************/
18 #include "AliMUONTrigger.h"
21 #include "AliMUONGlobalTrigger.h"
22 #include "AliMUONVTriggerStore.h"
24 #include "AliRunLoader.h"
25 #include "AliTriggerInput.h"
28 //-----------------------------------------------------------------------------
29 /// \class AliMUONTrigger
31 /// Implementation of AliTriggerDetector for MUON detector
33 /// So far, the inputs are taken from AliMUONTriggerDecision object
35 /// May 06, taken info from Global Trigger branch (Ch.F)
37 /// \author E. Lopez Torres
38 //-----------------------------------------------------------------------------
40 //----------------------------------------------------------------------
42 ClassImp(AliMUONTrigger)
45 //----------------------------------------------------------------------
46 AliMUONTrigger::AliMUONTrigger()
47 : AliTriggerDetector(), fTriggerStore(0x0)
49 /// Default constructor
55 //----------------------------------------------------------------------
56 AliMUONTrigger::~AliMUONTrigger()
62 //----------------------------------------------------------------------
63 void AliMUONTrigger::CreateInputs()
67 // Do not create inputs again!!
68 if( fInputs.GetEntriesFast() > 0 ) return;
70 fInputs.AddLast( new AliTriggerInput( "MUON_Single_LPt_L0", "MUONTRG", 0 ) );
71 fInputs.AddLast( new AliTriggerInput( "MUON_Single_HPt_L0", "MUONTRG", 0 ) );
73 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "MUONTRG", 0 ) );
74 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "MUONTRG", 0 ) );
76 fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "MUONTRG", 0 ) );
77 fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "MUONTRG", 0 ) );
80 //----------------------------------------------------------------------
81 void AliMUONTrigger::Trigger()
83 /// sets the trigger inputs
85 AliRunLoader* runLoader = gAlice->GetRunLoader();
87 AliLoader * muonLoader = runLoader->GetDetectorLoader("MUON");
88 muonLoader->LoadDigits("READ");
90 TTree* treeD = muonLoader->TreeD();
94 AliError("No TreeD available. Cannot make trigger");
100 fTriggerStore = AliMUONVTriggerStore::Create(*treeD);
103 AliError("Could not create triggerStore from treeD");
108 Bool_t ok = fTriggerStore->Connect(*treeD,kTRUE);
112 AliError("Could not read trigger from TreeD !");
118 AliMUONGlobalTrigger* globalTrigger = fTriggerStore->Global();
119 if (globalTrigger == 0x0)
121 AliWarning("No Global Trigger available");
126 if (globalTrigger->SingleLpt()) SetInput("MUON_Single_LPt_L0");
127 if (globalTrigger->SingleHpt()) SetInput("MUON_Single_HPt_L0");
129 if (globalTrigger->PairUnlikeLpt()) SetInput("MUON_Unlike_LPt_L0");
130 if (globalTrigger->PairUnlikeHpt()) SetInput("MUON_Unlike_HPt_L0");
132 if (globalTrigger->PairLikeLpt()) SetInput("MUON_Like_LPt_L0");
133 if (globalTrigger->PairLikeHpt()) SetInput("MUON_Like_HPt_L0");
135 muonLoader->UnloadDigits();
136 fTriggerStore->Clear();