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 <Riostream.h>
21 #include "AliRunLoader.h"
22 #include "AliTriggerInput.h"
25 #include "AliSTARTLoader.h"
26 #include "AliSTARTdigit.h"
27 #include "AliSTARTTrigger.h"
29 //----------------------------------------------------------------------
30 ClassImp(AliSTARTTrigger)
32 //----------------------------------------------------------------------
33 AliSTARTTrigger::AliSTARTTrigger()
34 : AliTriggerDetector()
40 //----------------------------------------------------------------------
41 void AliSTARTTrigger::CreateInputs()
45 // Do not create inputs again!!
46 if( fInputs.GetEntriesFast() > 0 ) return;
48 fInputs.AddLast( new AliTriggerInput( "START_A_L0", "Signal on T0-A", 0x0100 ) );
49 fInputs.AddLast( new AliTriggerInput( "START_C_L0", "Signal on T0-C", 0x0200 ) );
50 fInputs.AddLast( new AliTriggerInput( "START_Vertex_L0", " Vertex T0-C&T0-A ", 0x0400 ) );
51 fInputs.AddLast( new AliTriggerInput( "START_Centr_L0", "Centrality central", 0x0800 ) );
52 fInputs.AddLast( new AliTriggerInput( "START_SemiCentral_L0", "Centrality semicentral", 0x1000 ) );
55 //----------------------------------------------------------------------
56 void AliSTARTTrigger::Trigger()
58 AliRunLoader* runLoader = gAlice->GetRunLoader();
59 AliLoader * fSTARTLoader = runLoader->GetLoader("STARTLoader");
60 // AliSTARTdigit *fDigits;
61 fSTARTLoader->LoadDigits("READ");
62 // Creating START data container
64 TTree* treeD = fSTARTLoader->TreeD();
66 AliError("no digits tree");
69 AliSTARTdigit *fDigits = new AliSTARTdigit();
71 TBranch *brDigits = treeD->GetBranch("START");
73 brDigits->SetAddress(&fDigits);
75 AliError("Branch START DIGIT not found");
78 brDigits->GetEntry(0);
79 Int_t besttimeright = fDigits->BestTimeRight();
80 Int_t besttimeleft = fDigits->BestTimeLeft();
81 Int_t timeDiff = fDigits->TimeDiff();
82 Int_t sumMult= fDigits->SumMult();
84 if (besttimeright > 0 && besttimeright <99999 ) SetInput("START_A_L0");
85 if (besttimeleft>0 && besttimeleft<99999) SetInput("START_C_L0");
86 if (timeDiff >5500 && timeDiff < 6500) SetInput("START_Vertex_L0");
87 if (sumMult > 175) SetInput("START_Centr_L0");
88 if (sumMult>155 && sumMult <= 175) SetInput("START_SemiCentral_L0");;