SDD raw data format read from block attributes of CDH, RawStreamSDD instantiated...
[u/mrichter/AliRoot.git] / VZERO / AliVZEROTrigger.cxx
CommitLineData
7ca4655f 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
18#include <TClonesArray.h>
19
360938ba 20#include "AliRun.h"
21#include "AliRunLoader.h"
fad64858 22#include "AliTriggerInput.h"
360938ba 23
fad64858 24#include "AliVZEROdigit.h"
25#include "AliVZEROTriggerSimulator.h"
360938ba 26#include "AliVZEROTrigger.h"
27
28//______________________________________________________________________
29ClassImp(AliVZEROTrigger)
30////////////////////////////////////////////////////////////////////////
31//
32// Version 1
33//
34// AliVZEROTrigger:
35//
36////////////////////////////////////////////////////////////////////////
37
38//______________________________________________________________________
a055ee24 39
fad64858 40AliVZEROTrigger::AliVZEROTrigger():AliTriggerDetector()
360938ba 41{
42 SetName("VZERO");
43 CreateInputs();
360938ba 44}
360938ba 45//______________________________________________________________________
46void AliVZEROTrigger::CreateInputs()
47{
fad64858 48 // Do not create inputs again!!
49 if( fInputs.GetEntriesFast() > 0 ) return;
50
51 fInputs.AddLast( new AliTriggerInput( "VZERO_BBA_AND_BBC", "VZERO", 0 ) );
52 fInputs.AddLast( new AliTriggerInput( "VZERO_BBA_OR_BBC","VZERO", 0 ) );
53 fInputs.AddLast( new AliTriggerInput( "VZERO_BGA_AND_BBC", "VZERO", 0 ) );
54 fInputs.AddLast( new AliTriggerInput( "VZERO_BGA", "VZERO", 0 ) );
55 fInputs.AddLast( new AliTriggerInput( "VZERO_BGC_AND_BBA", "VZERO", 0 ) );
56 fInputs.AddLast( new AliTriggerInput( "VZERO_BGC", "VZERO", 0 ) );
57 fInputs.AddLast( new AliTriggerInput( "VZERO_CTA1_AND_CTC1", "VZERO", 0 ) );
58 fInputs.AddLast( new AliTriggerInput( "VZERO_CTA1_OR_CTC1", "VZERO", 0 ) );
59 fInputs.AddLast( new AliTriggerInput( "VZERO_CTA2_AND_CTC2", "VZERO", 0 ) );
60 fInputs.AddLast( new AliTriggerInput( "VZERO_CTA2_OR_CTC2", "VZERO", 0 ) );
61 fInputs.AddLast( new AliTriggerInput( "VZERO_MTA_AND_MTC", "VZERO", 0 ) );
62 fInputs.AddLast( new AliTriggerInput( "VZERO_MTA_OR_MTC", "VZERO", 0 ) );
63 fInputs.AddLast( new AliTriggerInput( "VZERO_BBA", "VZERO", 0 ) );
64 fInputs.AddLast( new AliTriggerInput( "VZERO_BBC", "VZERO", 0 ) );
65 fInputs.AddLast( new AliTriggerInput( "VZERO_BGA_OR_BGC", "VZERO", 0 ) );
66 fInputs.AddLast( new AliTriggerInput( "VZERO_BEAMGAS", "VZERO", 0 ) );
7bd4d308 67
68 // The following are kept for compatibility with the CTP configuration file. Will have to be removed at some point
69 fInputs.AddLast( new AliTriggerInput( "VZERO_AND", "VZERO", 0 ) );
70 fInputs.AddLast( new AliTriggerInput( "VZERO_OR","VZERO", 0 ) );
71 fInputs.AddLast( new AliTriggerInput( "VZERO_LEFT", "VZERO", 0 ) );
72 fInputs.AddLast( new AliTriggerInput( "VZERO_RIGHT", "VZERO", 0 ) );
73
360938ba 74}
75
76//______________________________________________________________________
77void AliVZEROTrigger::Trigger()
78{
360938ba 79 // ********** Get run loader for the current event **********
fad64858 80 AliRunLoader* runLoader = AliRunLoader::Instance();
81
82 AliLoader* loader = runLoader->GetLoader( "VZEROLoader" );
83
84 if(!loader) {
85 AliError("Can not get VZERO loader");
86 return;
87 }
88 loader->LoadDigits("READ");
89 TTree* vzeroDigitsTree = loader->TreeD();
90
91 if (!vzeroDigitsTree) {
92 AliError("Can not get the VZERO digit tree");
93 return;
94 }
95 TClonesArray* vzeroDigits = NULL;
96 TBranch* digitBranch = vzeroDigitsTree->GetBranch("VZERODigit");
97 digitBranch->SetAddress(&vzeroDigits);
98
99 AliVZEROTriggerSimulator * triggerSimulator = new AliVZEROTriggerSimulator(vzeroDigitsTree,vzeroDigits);
100
101 triggerSimulator->Run();
102
103 if(triggerSimulator->GetBBAandBBC()) SetInput( "VZERO_BBA_AND_BBC" );
104 if(triggerSimulator->GetBBAorBBC()) SetInput( "VZERO_BBA_OR_BBC" );
105 if(triggerSimulator->GetBGAandBBC()) SetInput( "VZERO_BGA_AND_BBC" );
106 if(triggerSimulator->GetBGA()) SetInput( "VZERO_BGA" );
107 if(triggerSimulator->GetBGCandBBA()) SetInput( "VZERO_BGC_AND_BBA" );
108 if(triggerSimulator->GetBGC()) SetInput( "VZERO_BGC" );
109 if(triggerSimulator->GetCTA1andCTC1()) SetInput( "VZERO_CTA1_AND_CTC1" );
110 if(triggerSimulator->GetCTA1orCTC1()) SetInput( "VZERO_CTA1_OR_CTC1" );
111 if(triggerSimulator->GetCTA2andCTC2()) SetInput( "VZERO_CTA2_AND_CTC2" );
112 if(triggerSimulator->GetCTA1orCTC1()) SetInput( "VZERO_CTA1_OR_CTC1" );
113 if(triggerSimulator->GetMTAandMTC()) SetInput( "VZERO_MTA_AND_MTC" );
114 if(triggerSimulator->GetMTAorMTC()) SetInput( "VZERO_MTA_OR_MTC" );
115 if(triggerSimulator->GetBBA()) SetInput( "VZERO_BBA" );
116 if(triggerSimulator->GetBBC()) SetInput( "VZERO_BBC" );
117 if(triggerSimulator->GetBGAorBGC()) SetInput( "VZERO_BGA_OR_BGC" );
118 if(triggerSimulator->GetBeamGas()) SetInput( "VZERO_BEAMGAS" );
360938ba 119
7bd4d308 120 // The following are kept for compatibility with the CTP configuration file. Will have to be removed at some point
121 if(triggerSimulator->GetBBAandBBC()) SetInput( "VZERO_AND" );
122 if(triggerSimulator->GetBBAorBBC()) SetInput( "VZERO_OR" );
123 if(triggerSimulator->GetBBA()) SetInput( "VZERO_LEFT" );
124 if(triggerSimulator->GetBBC()) SetInput( "VZERO_RIGHT" );
125
360938ba 126 return;
127}
128
7bd4d308 129