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 **************************************************************************/
18 #include <TClonesArray.h>
21 #include "AliRunLoader.h"
22 #include "AliTriggerInput.h"
24 #include "AliVZEROdigit.h"
25 #include "AliVZEROTriggerSimulator.h"
26 #include "AliVZEROTrigger.h"
28 //______________________________________________________________________
29 ClassImp(AliVZEROTrigger)
30 ////////////////////////////////////////////////////////////////////////
36 ////////////////////////////////////////////////////////////////////////
38 //______________________________________________________________________
40 AliVZEROTrigger::AliVZEROTrigger():AliTriggerDetector()
45 //______________________________________________________________________
46 void AliVZEROTrigger::CreateInputs()
48 // Do not create inputs again!!
49 if( fInputs.GetEntriesFast() > 0 ) return;
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 ) );
70 //______________________________________________________________________
71 void AliVZEROTrigger::Trigger()
73 // ********** Get run loader for the current event **********
74 AliRunLoader* runLoader = AliRunLoader::Instance();
76 AliLoader* loader = runLoader->GetLoader( "VZEROLoader" );
79 AliError("Can not get VZERO loader");
82 loader->LoadDigits("READ");
83 TTree* vzeroDigitsTree = loader->TreeD();
85 if (!vzeroDigitsTree) {
86 AliError("Can not get the VZERO digit tree");
89 TClonesArray* vzeroDigits = NULL;
90 TBranch* digitBranch = vzeroDigitsTree->GetBranch("VZERODigit");
91 digitBranch->SetAddress(&vzeroDigits);
93 AliVZEROTriggerSimulator * triggerSimulator = new AliVZEROTriggerSimulator(vzeroDigitsTree,vzeroDigits);
95 triggerSimulator->Run();
97 if(triggerSimulator->GetBBAandBBC()) SetInput( "VZERO_BBA_AND_BBC" );
98 if(triggerSimulator->GetBBAorBBC()) SetInput( "VZERO_BBA_OR_BBC" );
99 if(triggerSimulator->GetBGAandBBC()) SetInput( "VZERO_BGA_AND_BBC" );
100 if(triggerSimulator->GetBGA()) SetInput( "VZERO_BGA" );
101 if(triggerSimulator->GetBGCandBBA()) SetInput( "VZERO_BGC_AND_BBA" );
102 if(triggerSimulator->GetBGC()) SetInput( "VZERO_BGC" );
103 if(triggerSimulator->GetCTA1andCTC1()) SetInput( "VZERO_CTA1_AND_CTC1" );
104 if(triggerSimulator->GetCTA1orCTC1()) SetInput( "VZERO_CTA1_OR_CTC1" );
105 if(triggerSimulator->GetCTA2andCTC2()) SetInput( "VZERO_CTA2_AND_CTC2" );
106 if(triggerSimulator->GetCTA1orCTC1()) SetInput( "VZERO_CTA1_OR_CTC1" );
107 if(triggerSimulator->GetMTAandMTC()) SetInput( "VZERO_MTA_AND_MTC" );
108 if(triggerSimulator->GetMTAorMTC()) SetInput( "VZERO_MTA_OR_MTC" );
109 if(triggerSimulator->GetBBA()) SetInput( "VZERO_BBA" );
110 if(triggerSimulator->GetBBC()) SetInput( "VZERO_BBC" );
111 if(triggerSimulator->GetBGAorBGC()) SetInput( "VZERO_BGA_OR_BGC" );
112 if(triggerSimulator->GetBeamGas()) SetInput( "VZERO_BEAMGAS" );