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 **************************************************************************/
20 #include "AliRunLoader.h"
21 #include "AliTriggerInput.h"
24 #include "AliSTARTLoader.h"
25 #include "AliSTARTdigit.h"
26 #include "AliSTARTTrigger.h"
28 //----------------------------------------------------------------------
29 ClassImp(AliSTARTTrigger)
31 //----------------------------------------------------------------------
32 AliSTARTTrigger::AliSTARTTrigger()
33 : AliTriggerDetector()
39 //----------------------------------------------------------------------
40 void AliSTARTTrigger::CreateInputs()
44 // Do not create inputs again!!
45 if( fInputs.GetEntriesFast() > 0 ) return;
47 fInputs.AddLast( new AliTriggerInput( "START_A_L0", "Signal on T0-A", 0x01 ) );
48 fInputs.AddLast( new AliTriggerInput( "START_C_L0", "Signal on T0-C", 0x02 ) );
49 fInputs.AddLast( new AliTriggerInput( "START_Vertex_L0", " Vertex T0-C&T0-A ", 0x04 ) );
50 fInputs.AddLast( new AliTriggerInput( "START_Centr_L0", "Centrality central", 0x08 ) );
51 fInputs.AddLast( new AliTriggerInput( "START_SemiCentral_L0", "Centrality semicentral", 0x08 ) );
54 //----------------------------------------------------------------------
55 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");
70 TBranch *brDigits = treeD->GetBranch("START");
72 brDigits->SetAddress(&fDigits);
74 AliError("Branch START DIGIT not found");
77 brDigits->GetEntry(0);
78 Int_t besttimeright = fDigits->BestTimeRight();
79 Int_t besttimeleft = fDigits->BestTimeLeft();
80 Int_t timeDiff = besttimeright-besttimeleft;
81 Int_t meanTime = (besttimeright+besttimeleft)/2;
82 Int_t sumMult= fDigits->SumMult();
83 cout<<besttimeright<<" "<<besttimeleft<<" "<< timeDiff<<" "<<meanTime<<endl;
86 if (besttimeright<1000) trigg[0]=kTRUE;
87 if (besttimeleft<1000) trigg[1]=kTRUE;
88 if (timeDiff<5) trigg[2]=kTRUE;
89 if (sumMult>2300) trigg[3]=kTRUE;
90 if (sumMult>1800) trigg[4]=kTRUE;
93 if( trigg[0] ) SetInput("START_T0A_L0");
94 if( trigg[1] ) SetInput("START_T0C_L0");
95 if( trigg[2] ) SetInput("START_T0vertex_L0");
96 if( trigg[3] ) SetInput("START_T0Centr_L0");
97 if( trigg[4] ) SetInput("START_T0SemiCentral_L0");
98 cout<<" Trigger "<<trigg[0]<<" "<<trigg[1]<<endl;