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

Diff of /PamVMC/include/PamVMCDigMgr.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by nikolas, Thu Feb 19 16:50:36 2009 UTC revision 1.6 by pam-rm2, Mon Jul 13 12:27:06 2009 UTC
# Line 22  class PamVMCDigMgr: public TObject { Line 22  class PamVMCDigMgr: public TObject {
22    static PamVMCDigMgr * fdig;    static PamVMCDigMgr * fdig;
23    TMap fdigmap;    TMap fdigmap;
24    
25    /* This method calls only from manager. It is owner of all  
    digitizer objects */  
   void SetDIG(const char *name, PamVMCDigitizer *detDIG){  
     fdigmap.Add(new TObjString(name),detDIG);  
     fdigmap.Print();  
   }  
     
26    
27   protected:   protected:
28    PamVMCDigMgr(){    PamVMCDigMgr(){
# Line 39  class PamVMCDigMgr: public TObject { Line 33  class PamVMCDigMgr: public TObject {
33      SetDIG("TSPA", new PamVMCTrkDig());      SetDIG("TSPA", new PamVMCTrkDig());
34      SetDIG("S4",new PamVMCS4Dig());      SetDIG("S4",new PamVMCS4Dig());
35      SetDIG("NDTI",new PamVMCNDDig());      SetDIG("NDTI",new PamVMCNDDig());
36      SetDIG("RunHeader", new PamVMCDigRunHeader());      //SetDIG("RunHeader", new PamVMCDigRunHeader());
37      SetDIG("RunTrailer", new PamVMCDigRunTrailer());      //SetDIG("RunTrailer", new PamVMCDigRunTrailer());
38    }    }
39    
40   public:   public:
# Line 53  class PamVMCDigMgr: public TObject { Line 47  class PamVMCDigMgr: public TObject {
47      return (PamVMCDigitizer*)fdigmap(name);      return (PamVMCDigitizer*)fdigmap(name);
48    }    }
49    
50      /* This method calls from manager and from external digitizer. It is owner of all
51       digitizer objects */
52      void SetDIG(const char *name, PamVMCDigitizer *detDIG){
53        fdigmap.Add(new TObjString(name),detDIG);
54        fdigmap.Print();
55      }
56      /* This method needs only for external digitizer, kill all default digitizers */
57      void Reset() { fdigmap.Delete(); }
58    
59      /* Setting pointer to random objects for all Digitizers */
60    /* All digitizers load calibrations and calibrate */    /* All digitizers load calibrations and calibrate */
61    void LoadCalib(){    void Initialize(TRandom* random){
62      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();
63      TObject *o; while( o=(TObject *) n->Next()) {      TObject *o; while( (o=(TObject *) n->Next())) {
64      ((PamVMCDigitizer *)fdigmap.GetValue(o))->LoadCalib();      ((PamVMCDigitizer *)fdigmap.GetValue(o))->LoadCalib();
65        ((PamVMCDigitizer *)fdigmap.GetValue(o))->SetRandom(random);
66      }      }
67    }    }
68    
69    /* This calls digitization for all detector */    /* This calls digitization for all detector */
70    void Digitize(Int_t EventNo, Int_t PrimaryPDG){    void Digitize(Int_t EventNo, Int_t PrimaryPDG){
71      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();
72      TObject *o; while( o=(TObject *) n->Next()) {      TObject *o; while( (o=(TObject *) n->Next())) {
73      ((PamVMCDigitizer *)fdigmap.GetValue(o))->Digitize();      ((PamVMCDigitizer *)fdigmap.GetValue(o))->Digitize();
74      }      }
75            
# Line 112  class PamVMCDigMgr: public TObject { Line 117  class PamVMCDigMgr: public TObject {
117       to raw-file only once, when run is over */       to raw-file only once, when run is over */
118    void FinishRun(){    void FinishRun(){
119      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();
120      TObject *o; while( o=(TObject *) n->Next()) {      TObject *o; while( (o=(TObject *) n->Next())) {
121      ((PamVMCDigitizer *)fdigmap.GetValue(o))->FinishRun();      ((PamVMCDigitizer *)fdigmap.GetValue(o))->FinishRun();
122      }      }
123    }    }
# Line 121  class PamVMCDigMgr: public TObject { Line 126  class PamVMCDigMgr: public TObject {
126    
127    void PrintCollections(){    void PrintCollections(){
128      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();      TMapIter *n= (TMapIter *)fdigmap.MakeIterator();
129      TObject *o; while( o=(TObject *) n->Next()) {      TObject *o; while( (o=(TObject *) n->Next())) {
130        ((PamVMCDigitizer *)fdigmap.GetValue(o))->PrintCollections();        ((PamVMCDigitizer *)fdigmap.GetValue(o))->PrintCollections();
131      }      }
132    }    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23