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 **************************************************************************/
16 /* $Id: AliTRDTriggerL0.cxx 31904 2009-04-08 16:42:03Z cblume $ */
18 ///////////////////////////////////////////////////////////////////////////////
20 // TRD trigger L0 (pretrigger) simulation //
21 // So far no real trigger decision is done. //
23 ///////////////////////////////////////////////////////////////////////////////
25 #include "TObjArray.h"
28 #include "AliTriggerInput.h"
29 #include "AliRunLoader.h"
30 #include "AliLoader.h"
32 #include "AliTRDptrgParam.h"
33 #include "AliTRDptrgCBB.h"
35 #include "AliTRDTriggerL0.h"
37 AliTRDTriggerL0::AliTRDTriggerL0()
42 AliTRDTriggerL0::~AliTRDTriggerL0()
47 void AliTRDTriggerL0::CreateInputs()
49 if (fInputs.GetEntriesFast() > 0)
52 fInputs.AddLast(new AliTriggerInput("0HWU", "TRD", 1)); // TRD wake up
53 fInputs.AddLast(new AliTriggerInput("0HSG", "TRD", 1)); // single gap
54 fInputs.AddLast(new AliTriggerInput("0HDG", "TRD", 1)); // double gap
57 void AliTRDTriggerL0::Trigger()
60 AliRunLoader *runLoader = AliRunLoader::Instance();
63 AliLoader *trdLoader = runLoader->GetLoader("TRDLoader");
67 AliTRDptrgParam* param = AliTRDptrgParam::Instance();
69 AliTRDptrgCBB* ptrgCBB = new AliTRDptrgCBB(runLoader, param, kDigits);
71 Int_t* simulationResult;
72 simulationResult = ptrgCBB->Simulate();
73 if (!simulationResult) {
76 for (Int_t iResult = 1; iResult <= simulationResult[0]; iResult++) {
77 AliDebug(5, Form("Result[%d]=0x%x\n",iResult,simulationResult[iResult]));
79 if ((simulationResult[0] > 0) || (simulationResult[1] > 0)) {
80 AliInfo("Fired single gap trigger");
84 if (simulationResult[2] > 0) {
85 AliInfo("Fired double gap trigger");
89 if (simulationResult[3] > 0) {
90 AliInfo("Fired TRD wake up call trigger");
95 delete[] simulationResult;
96 simulationResult = 0x0;
98 AliDebug(5, Form("memory state: %d", param->CheckVariables()));