New interface of a VStore to hold hits (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUONVHitStore.cxx
CommitLineData
85c7a460 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 AliMUONVHitStore
19///
20/// Base class of a MUON hit store
21///
22/// \author Laurent Aphecetche, Subatech
23///
24
25#include "AliMUONVHitStore.h"
26#include "AliMUONHit.h"
27#include "AliLog.h"
28
29/// \cond CLASSIMP
30ClassImp(AliMUONVHitStore)
31/// \endcond
32
33//_____________________________________________________________________________
34AliMUONVHitStore::AliMUONVHitStore()
35{
36 /// ctor
37}
38
39//_____________________________________________________________________________
40AliMUONVHitStore::~AliMUONVHitStore()
41{
42 /// dtor
43}
44
45//_____________________________________________________________________________
46Bool_t
47AliMUONVHitStore::Add(TObject* object)
48{
49 /// Add an object, if of the right type
50 if (object)
51 {
52 AliMUONHit* hit = dynamic_cast<AliMUONHit*>(object);
53 if (hit)
54 {
55 Add(*hit);
56 return kTRUE;
57 }
58 else
59 {
60 AliError(Form("object not of expected AliMUONHit type but %s",object->ClassName()));
61 }
62 }
63 return kFALSE;
64}
65
66//_____________________________________________________________________________
67AliMUONVHitStore*
68AliMUONVHitStore::Create(TTree& tree)
69{
70 /// Create a VHitStore from the tree (if possible)
71 return static_cast<AliMUONVHitStore*>(AliMUONVStore::Create(tree,"Hit"));
72}