]>
Commit | Line | Data |
---|---|---|
5ac84465 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
2b699217 | 18 | #include <Riostream.h> |
5ac84465 | 19 | #include "AliLog.h" |
20 | #include "AliRun.h" | |
21 | #include "AliRunLoader.h" | |
22 | #include "AliTriggerInput.h" | |
23 | ||
24 | #include "AliSTART.h" | |
25 | #include "AliSTARTLoader.h" | |
26 | #include "AliSTARTdigit.h" | |
27 | #include "AliSTARTTrigger.h" | |
28 | ||
29 | //---------------------------------------------------------------------- | |
30 | ClassImp(AliSTARTTrigger) | |
31 | ||
32 | //---------------------------------------------------------------------- | |
33 | AliSTARTTrigger::AliSTARTTrigger() | |
34 | : AliTriggerDetector() | |
35 | { | |
36 | SetName("START"); | |
37 | CreateInputs(); | |
38 | } | |
39 | ||
40 | //---------------------------------------------------------------------- | |
41 | void AliSTARTTrigger::CreateInputs() | |
42 | { | |
43 | // inputs | |
44 | ||
45 | // Do not create inputs again!! | |
46 | if( fInputs.GetEntriesFast() > 0 ) return; | |
47 | ||
2b699217 | 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 ) ); | |
5ac84465 | 53 | } |
54 | ||
55 | //---------------------------------------------------------------------- | |
56 | void AliSTARTTrigger::Trigger() | |
57 | { | |
5ac84465 | 58 | AliRunLoader* runLoader = gAlice->GetRunLoader(); |
59 | AliLoader * fSTARTLoader = runLoader->GetLoader("STARTLoader"); | |
60 | // AliSTARTdigit *fDigits; | |
61 | fSTARTLoader->LoadDigits("READ"); | |
62 | // Creating START data container | |
2b699217 | 63 | |
5ac84465 | 64 | TTree* treeD = fSTARTLoader->TreeD(); |
65 | if (!treeD) { | |
66 | AliError("no digits tree"); | |
67 | return; | |
68 | } | |
2b699217 | 69 | AliSTARTdigit *fDigits = new AliSTARTdigit(); |
5ac84465 | 70 | |
71 | TBranch *brDigits = treeD->GetBranch("START"); | |
72 | if (brDigits) { | |
73 | brDigits->SetAddress(&fDigits); | |
74 | }else{ | |
75 | AliError("Branch START DIGIT not found"); | |
2b699217 | 76 | return; |
5ac84465 | 77 | } |
78 | brDigits->GetEntry(0); | |
79 | Int_t besttimeright = fDigits->BestTimeRight(); | |
80 | Int_t besttimeleft = fDigits->BestTimeLeft(); | |
81 | Int_t timeDiff = besttimeright-besttimeleft; | |
2b699217 | 82 | Int_t sumMult= fDigits->SumMult(); |
5ac84465 | 83 | |
2b699217 | 84 | if (besttimeright>0 && besttimeright<10000) SetInput("START_A_L0"); |
85 | if (besttimeleft>0 && besttimeleft<10000) SetInput("START_C_L0"); | |
86 | if (TMath::Abs(timeDiff) < 5) SetInput("START_Vertex_L0"); | |
87 | if (sumMult>2300) SetInput("START_Centr_L0"); | |
88 | if (sumMult>1800) SetInput("START_SemiCentral_L0");; | |
5ac84465 | 89 | |
5ac84465 | 90 | |
91 | } |