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 /// \class AliMUONTrigger
30 /// Implementation of AliTriggerDetector for MUON detector
32 /// So far, the inputs are taken from AliMUONTriggerDecision object
34 /// May 06, taken info from Global Trigger branch (Ch.F)
36 //----------------------------------------------------------------------
38 ClassImp(AliMUONTrigger)
41 //----------------------------------------------------------------------
42 AliMUONTrigger::AliMUONTrigger()
43 : AliTriggerDetector(), fTriggerStore(0x0)
45 /// Default constructor
51 //----------------------------------------------------------------------
52 AliMUONTrigger::~AliMUONTrigger()
58 //----------------------------------------------------------------------
59 void AliMUONTrigger::CreateInputs()
63 // Do not create inputs again!!
64 if( fInputs.GetEntriesFast() > 0 ) return;
66 fInputs.AddLast( new AliTriggerInput( "MUON_Single_LPt_L0", "Single Low Pt", 0x01 ) );
67 fInputs.AddLast( new AliTriggerInput( "MUON_Single_HPt_L0", "Single High Pt", 0x02 ) );
69 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_LPt_L0", "Dimuon Unlike Sign pair Low Pt", 0x04 ) );
70 fInputs.AddLast( new AliTriggerInput( "MUON_Unlike_HPt_L0", "Dimuon Unlike Sign pair High Pt", 0x08 ) );
72 fInputs.AddLast( new AliTriggerInput( "MUON_Like_LPt_L0", "Dimuon Like Sign pair Low Pt", 0x10 ) );
73 fInputs.AddLast( new AliTriggerInput( "MUON_Like_HPt_L0", "Dimuon Like Sign pair High Pt", 0x20 ) );
76 //----------------------------------------------------------------------
77 void AliMUONTrigger::Trigger()
79 /// sets the trigger inputs
81 AliRunLoader* runLoader = gAlice->GetRunLoader();
83 AliLoader * muonLoader = runLoader->GetDetectorLoader("MUON");
84 muonLoader->LoadDigits("READ");
86 TTree* treeD = muonLoader->TreeD();
90 AliError("No TreeD available. Cannot make trigger");
96 fTriggerStore = AliMUONVTriggerStore::Create(*treeD);
99 AliError("Could not create triggerStore from treeD");
104 Bool_t ok = fTriggerStore->Connect(*treeD,kTRUE);
108 AliError("Could not read trigger from TreeD !");
114 AliMUONGlobalTrigger* globalTrigger = fTriggerStore->Global();
115 if (globalTrigger == 0x0)
117 AliWarning("No Global Trigger available");
122 if (globalTrigger->SingleLpt()) SetInput("MUON_Single_LPt_L0");
123 if (globalTrigger->SingleHpt()) SetInput("MUON_Single_HPt_L0");
125 if (globalTrigger->PairUnlikeLpt()) SetInput("MUON_Unlike_LPt_L0");
126 if (globalTrigger->PairUnlikeHpt()) SetInput("MUON_Unlike_HPt_L0");
128 if (globalTrigger->PairLikeLpt()) SetInput("MUON_Like_LPt_L0");
129 if (globalTrigger->PairLikeHpt()) SetInput("MUON_Like_HPt_L0");
131 muonLoader->UnloadDigits();
132 fTriggerStore->Clear();