StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdCollection.cxx
1 /***************************************************************************
2  *
3  * $Id: StMtdCollection.cxx,v 2.2 2012/02/28 01:25:32 perev Exp $
4  *
5  * Author: Frank Geurts, April 25, 2011
6  ***************************************************************************
7  *
8  * Description:
9  *
10  * Persistent data which is written into StEvent
11  * directly from the reco chain.
12  *
13  ***************************************************************************
14  *
15  * $Log: StMtdCollection.cxx,v $
16  * Revision 2.2 2012/02/28 01:25:32 perev
17  * Browse(...) added
18  *
19  * Revision 2.1 2011/04/25 21:24:02 ullrich
20  * Initial Revision.
21  *
22  *
23  **************************************************************************/
24 #include "TBrowser.h"
25 #include "StMtdCollection.h"
26 
27 static const char rcsid[] = "$Id: StMtdCollection.cxx,v 2.2 2012/02/28 01:25:32 perev Exp $";
28 
29 ClassImp(StMtdCollection)
30 
32 {
33  mMtdHeader = 0;
34 }
35 
36 StMtdCollection::~StMtdCollection()
37 {
38  if(mMtdHeader) delete mMtdHeader;
39 }
40 
42 StMtdCollection::mtdHeader() { return mMtdHeader; }
43 
44 const StMtdHeader*
45 StMtdCollection::mtdHeader() const { return mMtdHeader; }
46 
47 const StSPtrVecMtdHit&
48 StMtdCollection::mtdHits() const { return mMtdHits; }
49 
50 StSPtrVecMtdHit&
51 StMtdCollection::mtdHits() { return mMtdHits; }
52 
53 const StSPtrVecMtdRawHit&
54 StMtdCollection::mtdRawHits() const { return mMtdRawHits; }
55 
56 StSPtrVecMtdRawHit&
57 StMtdCollection::mtdRawHits() { return mMtdRawHits; }
58 
59 void
60 StMtdCollection::setHeader(StMtdHeader* val) { mMtdHeader = val; }
61 
62 void
63 StMtdCollection::addHit(const StMtdHit* aHit)
64 {
65  if (aHit) mMtdHits.push_back(aHit);
66 }
67 
68 void
69 StMtdCollection::addRawHit(const StMtdRawHit* aRawHit)
70 {
71  if (aRawHit) mMtdRawHits.push_back(aRawHit);
72 }
73 
74 bool
75 StMtdCollection::hitsPresent() const { return mMtdHits.size(); }
76 
77 bool
78 StMtdCollection::rawHitsPresent() const { return mMtdRawHits.size(); }
79 //_____________________________________________________________________________
80 void StMtdCollection::Browse(TBrowser *b)
81 {
82  mMtdHits.Browse(b);
83  mMtdRawHits.Browse(b);
84 // // Browse this event (called by TBrowser).
85 // for (int i=0; i<(int)mMtdHits.size(); i++) {
86 // TObject *obj = mMtdHits[i]; if (!obj) continue;
87 // TString ts(obj->GetName()); ts+="#"; ts+=i;
88 // b->Add(obj,ts.Data());
89 // }
90 // for (int i=0; i<(int)mMtdRawHits.size(); i++) {
91 // TObject *obj = mMtdRawHits[i]; if (!obj) continue;
92 // TString ts(obj->GetName()); ts+="#"; ts+=i;
93 // b->Add(obj,ts.Data());
94 // }
95 }