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 **************************************************************************/
17 /***************************************************************
18 * T0 trigger class for T0 trigger signals:
22 * - T0 semi central event for ions
23 * - T0 central for ions
24 ****************************************************************/
29 #include "AliRunLoader.h"
30 #include "AliTriggerInput.h"
33 #include "AliT0digit.h"
34 #include "AliT0Trigger.h"
36 //----------------------------------------------------------------------
37 ClassImp(AliT0Trigger)
39 //----------------------------------------------------------------------
40 AliT0Trigger::AliT0Trigger()
41 : AliTriggerDetector(),
49 //----------------------------------------------------------------------
50 void AliT0Trigger::CreateInputs()
54 // Do not create inputs again!!
55 if( fInputs.GetEntriesFast() > 0 ) return;
57 fInputs.AddLast( new AliTriggerInput( "T0_A_L0", "T0", 0 ) );
58 fInputs.AddLast( new AliTriggerInput( "T0_C_L0", "T0", 0 ) );
59 fInputs.AddLast( new AliTriggerInput( "T0_Vertex_L0", "T0", 0 ) );
60 fInputs.AddLast( new AliTriggerInput( "T0_Centr_L0", "T0", 0 ) );
61 fInputs.AddLast( new AliTriggerInput( "T0_SemiCentral_L0", "T0", 0 ) );
64 //----------------------------------------------------------------------
65 void AliT0Trigger::Trigger()
69 AliRunLoader* runLoader = AliRunLoader::Instance();
70 AliLoader * fT0Loader = runLoader->GetLoader("T0Loader");
71 // AliT0digit *fDigits;
72 fT0Loader->LoadDigits("READ");
73 // Creating T0 data container
75 TTree* treeD = fT0Loader->TreeD();
77 AliError("no digits tree");
80 fDigits = new AliT0digit();
82 TBranch *brDigits = treeD->GetBranch("T0");
84 brDigits->SetAddress(&fDigits);
86 AliError("Branch T0 DIGIT not found");
89 brDigits->GetEntry(0);
90 Int_t besttimeA = fDigits->BestTimeA();
91 Int_t besttimeC = fDigits->BestTimeC();
92 Int_t timeDiff = fDigits->TimeDiff();
93 Int_t sumMult= fDigits->SumMult();
95 if (besttimeA > 0 && besttimeA <99999 ) SetInput("T0_A_L0");
96 if (besttimeC>0 && besttimeC<99999) SetInput("T0_C_L0");
97 //6093 corrsponds to vertex -20cm, 6202 vertex +20 with delay 150nc eqalized on the TVDC unit
98 if (timeDiff >6090 && timeDiff < 6210) SetInput("T0_Vertex_L0");
99 if (sumMult > 175) SetInput("T0_Centr_L0");
100 if (sumMult>155 && sumMult <= 175) SetInput("T0_SemiCentral_L0");;