/[PAMELA software]/trieste/pamVMC/include/PamVMCSDMgr.h
ViewVC logotype

Contents of /trieste/pamVMC/include/PamVMCSDMgr.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Wed Mar 4 12:51:10 2009 UTC (15 years, 9 months ago) by pamelats
Branch: MAIN, pamVMC
CVS Tags: start, v0r00, HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
Test pamVMC

1 #ifndef PAMVMCSDMGR_H
2 #define PAMVMCSDMGR_H
3 #include <iostream>
4
5 #include "TString.h"
6 #include "TObjString.h"
7 #include "TMap.h"
8 #include "PamVMCDetectorSD.h"
9
10
11 class PamVMCSDMgr: public TObject {
12
13 private:
14
15 static PamVMCSDMgr * fsd;
16 TMap fsdmap;
17
18 protected:
19 PamVMCSDMgr() {;};
20
21 public:
22
23 static PamVMCSDMgr * Instance();
24
25 ~PamVMCSDMgr() {fsdmap.DeleteAll();};
26
27 PamVMCDetectorSD * GetSD(const char *name){
28 return (PamVMCDetectorSD*)fsdmap(name);
29 }
30
31 void SetSD(const char *name, PamVMCDetectorSD *detSD){
32 fsdmap.Add(new TObjString(name),detSD);
33 }
34
35 void Register(){
36 // std::cout <<" Into Register() " << std::endl;
37 TMapIter *n= (TMapIter *)fsdmap.MakeIterator();
38 TObject *o; while( o=(TObject *) n->Next()) {
39 //cout<<"!!KEY=<<"<< endl;
40 ((PamVMCDetectorSD *)fsdmap.GetValue(o))->Register();
41 }
42 }
43
44 void Clear(const Option_t* =""){
45 TMapIter *n= (TMapIter *)fsdmap.MakeIterator();
46 TObject *o; while( o=(TObject *) n->Next()) {
47 ((PamVMCDetectorSD *)fsdmap.GetValue(o))->ClearHitColl();
48 }
49 }
50
51 void Compress(const Option_t* =""){
52 TMapIter *n= (TMapIter *)fsdmap.MakeIterator();
53 TObject *o; while( o=(TObject *) n->Next()) {
54 ((PamVMCDetectorSD *)fsdmap.GetValue(o))->Compress();
55 }
56 }
57
58
59 void PreEvent(const Option_t* =""){
60 TMapIter *n= (TMapIter *)fsdmap.MakeIterator();
61 TObject *o; while( o=(TObject *) n->Next()) {
62 ((PamVMCDetectorSD *)fsdmap.GetValue(o))->PreEvent();
63 }
64 }
65
66 void Digitize(const Option_t* =""){
67 TMapIter *n= (TMapIter *)fsdmap.MakeIterator();
68 TObject *o; while( o=(TObject *) n->Next()) {
69 ((PamVMCDetectorSD *)fsdmap.GetValue(o))->Digitize();
70 }
71 }
72
73
74 void Print( const Option_t* ="") const {
75 cout << "PamVMCSDMgr, list of SD stored " << endl;
76 fsdmap.Print();
77 }
78
79 };
80
81 #endif

  ViewVC Help
Powered by ViewVC 1.1.23