BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcHitMapGuts.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: MdcHitMapGuts.cxx,v 1.4 2009/09/22 06:28:08 zhangy Exp $
4//
5// Description:
6//
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author(s): Steve Schaffner
12//
13//------------------------------------------------------------------------
15#include "MdcData/MdcHit.h"
16#include "MdcGeom/MdcDetector.h"
17#include "MdcGeom/MdcLayer.h"
18#include <iostream>
19
20MdcHitMapGuts::MdcHitMapGuts(const MdcDetector& gm)
21 : _hits(gm.nLayer())
22{
23 unsigned n = _hits.size();
24 for (unsigned l = 0; l < n; ++l) {
25 const MdcLayer* lay = gm.Layer(l);
26 _hits[l].resize(lay->nWires(),0); // resizes and zeroes
27 }
28}
29
31{
32}
33
35MdcHitMapGuts::instance(const MdcDetector& gm)
36{
37 static MdcHitMapGuts theInstance(gm);
38 theInstance.clear();
39 return &theInstance;
40}
41
42void
44{
45 for (MdcHitMap_t::iterator j = _hits.begin(); j != _hits.end(); ++j) {
46 std::fill(j->begin(),j->end(),static_cast<MdcHit *>(0));
47 }
48}
49
50void
52{
53 _hits[theHit.layernumber()][theHit.wirenumber()] = &theHit;
54}
55
const Int_t n
const MdcLayer * Layer(unsigned id) const
Definition: MdcDetector.h:33
void addHit(MdcHit &theHit)
virtual ~MdcHitMapGuts()
Definition: MdcHit.h:44
unsigned layernumber() const
Definition: MdcHit.h:61
unsigned wirenumber() const
Definition: MdcHit.h:62
int nWires(void) const
Definition: MdcLayer.h:30