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 ////////////////////////////////////////////////////////////////////////
21 // Simulates generation of Fast-OR signals from SPD (if needed). //
22 // Processes the Fast-OR signals generated in AliITSsimulationSPD. //
23 // Provides inputs for AliCentralTrigger. //
25 // Version 2, Henrik Tydesjo, Feb 2009 //
26 // Version 1, D. Elia, C. Jorgensen, Mar 2006 //
27 // Version 0, J. Conrad, E. Lopez Torres, Oct 2005 //
29 ////////////////////////////////////////////////////////////////////////
32 #include "AliITSTrigger.h"
35 #include "AliRunLoader.h"
36 #include "AliITSLoader.h"
37 #include "AliTriggerInput.h"
39 ClassImp(AliITSTrigger)
41 //______________________________________________________________________
42 AliITSTrigger::AliITSTrigger() :
46 //standard constructor
49 //______________________________________________________________________
50 AliITSTrigger::AliITSTrigger(AliITSTriggerConditions* cond) :
54 // optional constructor
57 //______________________________________________________________________
58 void AliITSTrigger::SetTriggerConditions(AliITSTriggerConditions* cond) {
59 // Sets the trigger conditions, normally coming from OCDB
60 fPITprocessor.SetTriggerConditions(cond);
62 //______________________________________________________________________
63 void AliITSTrigger::CreateInputs() {
64 // Create inputs, based on OCDB Pixel Trigger Conditions
65 if( fInputs.GetEntriesFast() > 0 ) return; // Inputs already created, no need to proceed
67 // Load trigger conditions from OCDB if needed
68 if (! fPITprocessor.TriggerConditionsSet() ) {
69 AliError("Trigger conditions not set. No inputs created.");
73 UInt_t numInputs = fPITprocessor.GetNumOutputs();
74 AliInfo(Form("Number of trigger inputs: %d",numInputs));
75 for (UInt_t inp=0; inp<numInputs; inp++) {
76 fInputs.AddLast( new AliTriggerInput(fPITprocessor.GetOutputLabel(inp), "SPD", 0) );
79 //______________________________________________________________________
80 void AliITSTrigger::Trigger() {
81 // Performs Pixel Trigger processing of the simulated fast-or signals
83 // Get the FO signals for this event
84 AliITSFOSignalsSPD* foSignals = NULL;
85 AliRunLoader* runLoader = AliRunLoader::Instance();
86 AliITSLoader* itsLoader = (AliITSLoader*) runLoader->GetLoader("ITSLoader");
88 AliError("ITS loader is NULL.");
92 itsLoader->LoadDigits();
93 TTree *tree = itsLoader->TreeD();
95 AliError("TreeD not available");
96 itsLoader->UnloadDigits();
99 foSignals = (AliITSFOSignalsSPD*)tree->GetUserInfo()->FindObject("AliITSFOSignalsSPD");
100 if(!foSignals) AliError("FO signals not retrieved");
103 // Process the FO signals
105 fPITprocessor.PreprocessFOSignals(foSignals);
106 UInt_t numInputs = fPITprocessor.GetNumOutputs();
107 for (UInt_t inp=0; inp<numInputs; inp++) {
108 if (fPITprocessor.ProcessFOSignalsIndex(inp, foSignals)) {
109 SetInput(fPITprocessor.GetOutputLabel(inp));
114 AliError("Fast-OR signals not available. No trigger processing done.");
116 if (itsLoader) itsLoader->UnloadDigits();