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 ////////////////////////////////////////////////////////////////////////
31 #include "AliITSTrigger.h"
34 #include "AliRunLoader.h"
35 #include "AliITSLoader.h"
36 #include "AliTriggerInput.h"
38 ClassImp(AliITSTrigger)
40 //______________________________________________________________________
41 AliITSTrigger::AliITSTrigger() :
45 //standard constructor
48 //______________________________________________________________________
49 AliITSTrigger::AliITSTrigger(AliITSTriggerConditions* cond) :
53 // optional constructor
56 //______________________________________________________________________
57 void AliITSTrigger::SetTriggerConditions(AliITSTriggerConditions* cond) {
58 // Sets the trigger conditions, normally coming from OCDB
59 fPITprocessor.SetTriggerConditions(cond);
61 //______________________________________________________________________
62 void AliITSTrigger::CreateInputs() {
63 // Create inputs, based on OCDB Pixel Trigger Conditions
64 if( fInputs.GetEntriesFast() > 0 ) return; // Inputs already created, no need to proceed
66 // Load trigger conditions from OCDB if needed
67 if (! fPITprocessor.TriggerConditionsSet() ) {
68 AliError("Trigger conditions not set. No inputs created.");
72 UInt_t numInputs = fPITprocessor.GetNumOutputs();
73 AliInfo(Form("Number of trigger inputs: %d",numInputs));
74 for (UInt_t inp=0; inp<numInputs; inp++) {
75 fInputs.AddLast( new AliTriggerInput(fPITprocessor.GetOutputLabel(inp), "SPD", 0) );
78 //______________________________________________________________________
79 void AliITSTrigger::Trigger() {
80 // Performs Pixel Trigger processing of the simulated fast-or signals
82 // Get the FO signals for this event
83 AliITSFOSignalsSPD* foSignals = NULL;
84 AliRunLoader* runLoader = AliRunLoader::Instance();
85 AliITSLoader* itsLoader = (AliITSLoader*) runLoader->GetLoader("ITSLoader");
87 AliError("ITS loader is NULL.");
91 itsLoader->LoadDigits();
92 TTree *tree = itsLoader->TreeD();
94 AliError("TreeD not available");
95 itsLoader->UnloadDigits();
98 foSignals = (AliITSFOSignalsSPD*)tree->GetUserInfo()->FindObject("AliITSFOSignalsSPD");
99 if(!foSignals) AliError("FO signals not retrieved");
102 // Process the FO signals
104 fPITprocessor.PreprocessFOSignals(foSignals);
105 UInt_t numInputs = fPITprocessor.GetNumOutputs();
106 for (UInt_t inp=0; inp<numInputs; inp++) {
107 if (fPITprocessor.ProcessFOSignalsIndex(inp, foSignals)) {
108 SetInput(fPITprocessor.GetOutputLabel(inp));
113 AliError("Fast-OR signals not available. No trigger processing done.");
115 if (itsLoader) itsLoader->UnloadDigits();