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