]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONVTriggerStore.cxx
Forgotten commit
[u/mrichter/AliRoot.git] / MUON / AliMUONVTriggerStore.cxx
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 //-----------------------------------------------------------------------------
19 /// \class AliMUONVTriggerStore
20 ///
21 /// Base class of a trigger container, which holds local, regional and
22 /// global information for one event.
23 ///
24 /// \author Laurent Aphecetche, Subatech
25 //-----------------------------------------------------------------------------
26
27 #include "AliMUONVTriggerStore.h"
28 #include "AliMUONLocalTrigger.h"
29 #include "AliMUONRegionalTrigger.h"
30 #include "AliMUONGlobalTrigger.h"
31
32 /// \cond CLASSIMP
33 ClassImp(AliMUONVTriggerStore)
34 /// \endcond
35
36 //_____________________________________________________________________________
37 AliMUONVTriggerStore::AliMUONVTriggerStore()
38 {
39   /// ctor
40 }
41
42 //_____________________________________________________________________________
43 AliMUONVTriggerStore::~AliMUONVTriggerStore()
44 {
45   /// dtor
46 }
47
48 //_____________________________________________________________________________
49 AliMUONVTriggerStore* 
50 AliMUONVTriggerStore::Create(TTree& tree)
51 {
52   /// Create a VTriggerStore from the tree (if possible).
53   return static_cast<AliMUONVTriggerStore*>(AliMUONVStore::Create(tree,"Trigger"));
54 }
55
56 //_____________________________________________________________________________
57 TIterator* 
58 AliMUONVTriggerStore::CreateIterator() const
59 {
60   /// Return local iterator
61   return CreateLocalIterator();
62 }
63
64 //_____________________________________________________________________________
65 Bool_t
66 AliMUONVTriggerStore::Add(TObject* object)
67 {
68   /// Add an object, if object of type local, regional or global
69   if (!object) return kFALSE;
70   AliMUONLocalTrigger* local = dynamic_cast<AliMUONLocalTrigger*>(object);
71   if (local) 
72   {
73     Add(*local);
74     return kTRUE;
75   }  
76   AliMUONRegionalTrigger* regional = dynamic_cast<AliMUONRegionalTrigger*>(object);
77   if (regional)
78   {
79     Add(*regional);
80     return kTRUE;
81   }
82   AliMUONGlobalTrigger* global = dynamic_cast<AliMUONGlobalTrigger*>(object);
83   if (global)
84   {
85     SetGlobal(*global);
86     return kTRUE;
87   }
88   return kFALSE;
89 }