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 "AliT0Loader.h"
26 #include "AliT0digit.h"
27 #include "AliT0Trigger.h"
29 //----------------------------------------------------------------------
30 ClassImp(AliT0Trigger)
32 //----------------------------------------------------------------------
33 AliT0Trigger::AliT0Trigger()
34 : AliTriggerDetector(),
42 //----------------------------------------------------------------------
43 void AliT0Trigger::CreateInputs()
47 // Do not create inputs again!!
48 if( fInputs.GetEntriesFast() > 0 ) return;
50 fInputs.AddLast( new AliTriggerInput( "START_A_L0", "Signal on T0-A", 0x0100 ) );
51 fInputs.AddLast( new AliTriggerInput( "START_C_L0", "Signal on T0-C", 0x0200 ) );
52 fInputs.AddLast( new AliTriggerInput( "START_Vertex_L0", " Vertex T0-C&T0-A ", 0x0400 ) );
53 fInputs.AddLast( new AliTriggerInput( "START_Centr_L0", "Centrality central", 0x0800 ) );
54 fInputs.AddLast( new AliTriggerInput( "START_SemiCentral_L0", "Centrality semicentral", 0x1000 ) );
57 //----------------------------------------------------------------------
58 void AliT0Trigger::Trigger()
60 AliRunLoader* runLoader = gAlice->GetRunLoader();
61 AliLoader * fT0Loader = runLoader->GetLoader("T0Loader");
62 // AliT0digit *fDigits;
63 fT0Loader->LoadDigits("READ");
64 // Creating T0 data container
66 TTree* treeD = fT0Loader->TreeD();
68 AliError("no digits tree");
71 AliT0digit *fDigits = new AliT0digit();
73 TBranch *brDigits = treeD->GetBranch("T0");
75 brDigits->SetAddress(&fDigits);
77 AliError("Branch T0 DIGIT not found");
80 brDigits->GetEntry(0);
81 Int_t besttimeA = fDigits->BestTimeA();
82 Int_t besttimeC = fDigits->BestTimeC();
83 Int_t timeDiff = fDigits->TimeDiff();
84 Int_t sumMult= fDigits->SumMult();
86 if (besttimeA > 0 && besttimeA <99999 ) SetInput("START_A_L0");
87 if (besttimeC>0 && besttimeC<99999) SetInput("START_C_L0");
88 //6093 corrsponds to vertex -20cm, 6202 vertex +20 with delay 150nc eqalized on the TVDC unit
89 if (timeDiff >6090 && timeDiff < 6210) SetInput("START_Vertex_L0");
90 if (sumMult > 175) SetInput("START_Centr_L0");
91 if (sumMult>155 && sumMult <= 175) SetInput("START_SemiCentral_L0");;