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 **************************************************************************/
15 /* $Id: AliADTrigger.cxx 49869 2011-05-18 04:49:51Z hristov $ */
16 // ---------------------
18 // ---------------------
19 // Top class to simulate the AD trigger response
20 // This class is only used for interface with AliTriggerDetector
21 // Its create and Set Inputs of the CTP
25 #include <TClonesArray.h>
29 #include "AliLoader.h"
31 #include "AliRunLoader.h"
32 #include "AliTriggerInput.h"
34 #include "AliADdigit.h"
35 #include "AliADTrigger.h"
37 //______________________________________________________________________
38 ClassImp(AliADTrigger)
40 //______________________________________________________________________
42 AliADTrigger::AliADTrigger():AliTriggerDetector()
47 //______________________________________________________________________
48 void AliADTrigger::CreateInputs()
50 // Do not create inputs again!!
51 if( fInputs.GetEntriesFast() > 0 ) return;
53 fInputs.AddLast( new AliTriggerInput( "AD_ADA", "AD", 0 ) );
54 fInputs.AddLast( new AliTriggerInput( "AD_ADD","AD", 0 ) );
55 fInputs.AddLast( new AliTriggerInput( "AD_ADA2", "AD", 0 ) );
56 fInputs.AddLast( new AliTriggerInput( "AD_ADD2","AD", 0 ) );
59 //______________________________________________________________________
60 void AliADTrigger::Trigger()
62 // ********** Get run loader for the current event **********
63 AliRunLoader* runLoader = AliRunLoader::Instance();
65 AliLoader* loader = runLoader->GetLoader( "ADLoader" );
68 AliError("Can not get AD loader");
71 loader->LoadDigits("update");
72 TTree* vzeroDigitsTree = loader->TreeD();
74 if (!vzeroDigitsTree) {
75 AliError("Can not get the AD digit tree");
78 TClonesArray* vzeroDigits = NULL;
79 TBranch* digitBranch = vzeroDigitsTree->GetBranch("ADDigit");
80 digitBranch->SetAddress(&vzeroDigits);
82 // Check trigger contitions
83 // .... Ex. number of digit over threshold
86 loader->UnloadDigits();
89 // if( ) SetInput( "AD_ADA" );
90 // if( ) SetInput( "AD_ADD" );