/[PAMELA software]/PamVMC/include/PamVMCCutContMgr.h
ViewVC logotype

Annotation of /PamVMC/include/PamVMCCutContMgr.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Feb 19 16:50:35 2009 UTC (15 years, 9 months ago) by nikolas
Branch: MAIN
File MIME type: text/plain
Cleaning before committing

1 nikolas 1.1 #ifndef PAMVMCCUTCONTMGR_H
2     #define PAMVMCCUTCONTMGR_H
3     #include <iostream>
4    
5     #include "TString.h"
6     #include "TObjString.h"
7     #include "TMap.h"
8     #include "TVirtualMC.h"
9     #include "pCutControl.h"
10    
11    
12     class PamVMCCutContMgr: public TObject {
13    
14     private:
15    
16     static PamVMCCutContMgr * fcutcont;
17     TMap fcutcontmap;
18    
19     protected:
20     ~PamVMCCutContMgr() {fcutcontmap.DeleteAll();};
21    
22     public:
23    
24     static PamVMCCutContMgr * Instance();
25    
26     pCutControl * GetCutCont(const char *medname){
27     return (pCutControl*)fcutcontmap(medname);
28     }
29    
30     void SetCutCont(const char *medname, pCutControl * pCC){
31     fcutcontmap.Add(new TObjString(medname),pCC);
32     }
33    
34     void SetCuts(){
35     TMapIter *n= (TMapIter *)fcutcontmap.MakeIterator();
36     TObject *o; while( o=(TObject *) n->Next()) {
37    
38     ((pCutControl*)fcutcontmap.GetValue(o))->SetCuts();
39    
40     }
41     }
42    
43     void Print(const Option_t* ="") const{
44    
45     std::cout<<"LIST OF CUTS AND CONTROLS FOR REGISTERED MEDIA"<<std::endl;
46     TMapIter *n= (TMapIter *)fcutcontmap.MakeIterator();
47     TObject *o; while( o=(TObject *) n->Next()) {
48     TString medname =(*(TObjString*)o).GetString();
49     std::cout<<"MEDIA: "<<medname<<std::endl;
50     ((pCutControl*)fcutcontmap.GetValue(o))->Print();
51     }
52     }
53    
54     };
55     #endif

  ViewVC Help
Powered by ViewVC 1.1.23