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 "AliLoader.h"
30 #include "AliRunLoader.h"
31 #include "AliTriggerInput.h"
32 #include "AliT0Parameters.h"
33 #include "AliT0TriggerParameters.h"
34 #include <AliCDBManager.h>
35 #include <AliCDBEntry.h>
36 #include <AliCDBStorage.h>
39 #include "AliT0digit.h"
40 #include "AliT0Trigger.h"
42 #include "Riostream.h"
44 //----------------------------------------------------------------------
45 ClassImp(AliT0Trigger)
47 //----------------------------------------------------------------------
48 AliT0Trigger::AliT0Trigger()
49 : AliTriggerDetector(),
56 AliCDBManager *stor =AliCDBManager::Instance();
58 AliCDBEntry* fCalibentry = stor->Get("T0/Calib/TriggerParam");
60 fTrigPar = (AliT0TriggerParameters*)fCalibentry->GetObject();
62 AliWarning(" No trigger parameters in CDB , use default");
67 //----------------------------------------------------------------------
68 void AliT0Trigger::CreateInputs()
72 // Do not create inputs again!!
73 if( fInputs.GetEntriesFast() > 0 ) return;
75 fInputs.AddLast( new AliTriggerInput( "0T0A", "T0", 0 ) );
76 fInputs.AddLast( new AliTriggerInput( "0T0C", "T0", 0 ) );
77 fInputs.AddLast( new AliTriggerInput( "0TVX", "T0", 0 ) );
78 fInputs.AddLast( new AliTriggerInput( "T0_Centr_L0", "T0", 0 ) );
79 fInputs.AddLast( new AliTriggerInput( "T0_SemiCentral_L0", "T0", 0 ) );
83 //----------------------------------------------------------------------
84 void AliT0Trigger::Trigger()
88 AliRunLoader* runLoader = AliRunLoader::Instance();
89 AliLoader * fT0Loader = runLoader->GetLoader("T0Loader");
90 // AliT0digit *fDigits;
91 fT0Loader->LoadDigits("READ");
92 // Creating T0 data container
94 TTree* treeD = fT0Loader->TreeD();
96 AliError("no digits tree");
99 fDigits = new AliT0digit();
101 TBranch *brDigits = treeD->GetBranch("T0");
103 brDigits->SetAddress(&fDigits);
105 AliError("Branch T0 DIGIT not found");
108 brDigits->GetEntry(0);
109 Int_t besttimeA = fDigits->BestTimeA();
110 Int_t besttimeC = fDigits->BestTimeC();
111 Int_t timeDiff = fDigits->TimeDiff();
112 Int_t sumMult= fDigits->SumMult();
114 //trigger parameteres
116 Float_t timeWindowLow = fTrigPar->GetTimeWindowLow();
117 Float_t timeWindowHigh = fTrigPar->GetTimeWindowHigh();
118 Int_t ampCentr = fTrigPar->GetAmpCentr();
119 Int_t ampSemiCentr = fTrigPar->GetAmpSemiCentr();
121 if (besttimeA > 0 && besttimeA <99999) SetInput("0T0A");
122 if (besttimeC > 0 && besttimeC<99999) SetInput("0T0C");
123 //6093 corrsponds to vertex -20cm, 6202 vertex +20 with delay 150nc eqalized on the TVDC unit
124 if (timeDiff >timeWindowLow && timeDiff < timeWindowHigh) SetInput("0TVX");
125 if (sumMult > ampCentr) SetInput("T0_Centr_L0");
126 if (sumMult> ampSemiCentr && sumMult <= ampCentr) SetInput("T0_SemiCentral_L0");;