BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/BesDChain/include/BesDChain/Template/CDMud.cc
Go to the documentation of this file.
1#ifndef CLEODCHAIN_CDMUD_CC
2#define CLEODCHAIN_CDMUD_CC
3// -*- C++ -*-
4//
5// Package: CleoDChain
6// Module: CDMud
7//
8// Description: Manage the footprints for a given Evidence Class
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Mon Apr 20 20:47:30 PDT 1998
15// $Id: CDMud.cc,v 1.1.1.1 2009/03/03 06:05:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: CDMud.cc,v $
20// Revision 1.1.1.1 2009/03/03 06:05:56 maqm
21// first import of BesDChain
22//
23// Revision 1.1 2001/04/11 13:19:36 urner
24// transition to files with CD prefix. Addition of new files
25//
26// Revision 1.2 2000/12/19 15:11:34 cdj
27// removed report statement
28//
29// Revision 1.1.1.1 2000/12/18 22:17:27 cdj
30// imported CleoDChain
31//
32// Revision 1.4 1998/05/01 20:25:22 sjp
33// Put in correct include file path
34//
35// Revision 1.3 1998/05/01 20:21:59 sjp
36// Added line to handle g++ bug
37//
38// Revision 1.2 1998/04/22 01:24:02 sjp
39// Corrected logic that expands list of CDFootPrints.
40//
41// Revision 1.1 1998/04/21 05:17:22 sjp
42// New File
43//
44
45// system include files
46#include <vector>
47
48using std::vector;
49
50// user include files
51#include "BesDChain/CDFootPrint.h"
52#include "BesDChain/CDMud.h"
53
54//
55// constants, enums and typedefs
56//
57
58template <class Evidence>
59const CDFootPrint& CDMud<Evidence>::get( const Evidence* aEvidence ) {
60 unsigned int id( aEvidence->trackId() );
61 vector<const CDFootPrint*>& prints( footprints() );
62 while ( id >= prints.size() )
63 {
64 CDFootPrint* tmp( new CDFootPrint );
65 ( *tmp ).fresh();
66 prints.push_back( tmp );
67 }
68 return ( *( prints[id] ) );
69}
70
71template <class Evidence> void CDMud<Evidence>::clear() {
72 vector<const CDFootPrint*>& prints( footprints() );
73 vector<const CDFootPrint*>::const_iterator finished( prints.end() );
74 for ( vector<const CDFootPrint*>::const_iterator print( prints.begin() ); finished != print;
75 ++print )
76 {
77
78 // cast way const for delete to work
79 delete ( (CDFootPrint*)( *print ) );
80 }
81 prints.erase( prints.begin(), prints.end() );
82}
83
84template <class Evidence> vector<const CDFootPrint*>& CDMud<Evidence>::footprints() {
85 static vector<const CDFootPrint*> prints;
86 return ( prints );
87}
88
89//
90// constructors and destructor
91//
92
93//
94// assignment operators
95//
96
97//
98// member functions
99//
100
101//
102// const member functions
103//
104
105#endif /* CLEODCHAIN_CDMUD_CC */
static const CDFootPrint & get(const Evidence *aEvidence)
static std::vector< const CDFootPrint * > & footprints()