StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
digmaps.h
1 #ifndef MAPS_DIGMAPS_H
2 #define MAPS_DIGMAPS_H
3 
5 // //
6 // DIGMAPS //
7 // //
8 // Main Class of DIGMAPS //
9 // Contains pointers to all other classes and to the root tree //
10 // units are all in micrometer. //
11 // ROOT->ProcessLine(".L MAPS_digitiser.cxx+"); //
12 // //
13 // //
14 // //
16 
17 #include <TNamed.h>
18 #include <TList.h>
19 #include <TGraph.h>
20 #include <TCanvas.h>
21 #include "Riostream.h"
22 #include "vector"
23 #include <TRandom3.h>
24 
25 // ROOT classes
26 #include "TStopwatch.h"
27 #include "TString.h"
28 #include "TObject.h"
29 #include "TVector.h"
30 #include "TFile.h"
31 #include "TSystem.h"
32 #include "TRandom.h"
33 #include "TProfile.h"
34 #include "TH1.h"
35 #include "TH2.h"
36 #include "TObjArray.h"
37 #include "TTree.h"
38 #include "TBranch.h"
39 #include "TClonesArray.h"
40 
41 #include "dighistograms.h"
42 
43 
44 using namespace std;
45 
46 class DIGInitialize;
47 class DIGPlane;
48 class DIGADC;
49 class DIGBeam;
50 class DIGTransport;
51 class DIGParticle;
52 class DIGAction;
53 class DIGEvent;
54 class DIGMAPS;
55 class DIGHistograms;
56 class DIGResult;
57 
58 static const Double_t PI=3.14159265358979312;
59 extern Int_t GlobalSeed;
60 // DIGInitialize test("read","test","/home/abesson/SAVE/ILCSOFT/DIGITISEUR/","input.txt")
61 class DIGMAPS : public TNamed, public DIGHistograms {
62  public:
63  DIGMAPS();
64  DIGMAPS(char *name,char *title, TString aCP, TString aCFN, TString action);
65  DIGMAPS(char *name,char *title, TString aCP, TString aCFN, TString outp, TString outf, TString action );
66  virtual ~DIGMAPS();
67  void Run() ;
68  void RunConfiguration(Int_t configcounter, Int_t BeamNumber, Int_t PlaneNumber, Int_t ADCNumber, Int_t TransportNumber);
69  void ReadTree(TString StringTree) ;
70  void PrintConfigurations();
71  void ChargeGeneration(DIGParticle &aDIGParticle, Float_t StartingSegmentSize,
72  Float_t MaximumSegmentSize,
73  Float_t MaximumChargePerSegment);
74 
75  void ActionPlot();
76  void InspectEvent(Int_t EventNumber);
77  void PlotAConfiguration(Int_t confignumber, Bool_t newcanvas);
78  void PlotDigitalConfiguration(Bool_t newcanvas, Int_t *configlist, Int_t Nconfig);
79 
80  void SetConfigPath(TString aCP) ;
81  void SetConfigFileName(TString aCFN) ;
82  void SetConfigPathAndFileName() ;
83  void SetConfigPathAndFileName(TString aCP,TString aCFN) ;
84  void SetOutputPath(TString outp) ;
85  void SetOutputFileName(TString outf) ;
86  void SetOutputPathAndFileName() ;
87  void SetOutputPathAndFileName(TString outp,TString outf) ;
88  void SetIsOutputfile(Bool_t IsOutputfile);
89  void SetNumberOfConfigurations(Int_t NumberOfConfiguration);
90  void SetfAction(TString action) ;
91  void SetAction(DIGAction *aDIGAction) ;
92 
93  TString GetConfigPath() ;
94  TString GetConfigFileName() ;
95  TString GetConfigPathAndFileName() ;
96  TString GetOutputPath() {return fOutputPath ;}
97  TString GetOutputFileName() {return fOutputFileName; }
98  TString GetOutputPathAndFileName() {return fOutputPathAndFileName;}
99  Bool_t GetIsOutputfile() {return fIsOutputfile;}
100  DIGInitialize *GetDIGInitialize(){ return fDIGInitialize; }
101  Int_t GetPlanesN() { return fPlanesN; }
102  DIGPlane *GetPlane(Int_t aPlaneNumber);
103  Int_t GetADCN() { return fADCN; }
104  DIGADC *GetADC(Int_t anADCNumber);
105  Int_t GetTransportN() { return fTransportN; }
106  DIGTransport *GetTransport(Int_t aTransportNumber);
107  Int_t GetBeamN() { return fBeamN; }
108  DIGBeam *GetBeam(Int_t aBeamNumber);
109  DIGEvent *GetEvent(){ return fdigevent;}
110 
111  DIGResult *GetResult(Int_t aResultNumber){ return (DIGResult*)fDIGResultArray->At(aResultNumber);}
112 
113 
114  //DIGHistograms *GetHistograms() { return fdighistograms;}
115  Int_t GetNumberOfConfigurations() { return fNumberOfConfigurations; }
116  DIGAction *GetAction(){return fDIGAction;}
117  TString GetfAction(){return fAction;}
118 
119  Int_t PoissonLaw(Float_t Lambda);
120  Double_t LandauLaw(Double_t mean, Double_t sigma);
121  Double_t GaussianLaw(Double_t mean, Double_t sigma);
122  Double_t Lorentz2D(Double_t *x, Double_t *par);
123 
124 
125 
126 
127  TStopwatch timer1;
128 
129  protected:
130 
131 
132  ClassDef(DIGMAPS,1);
133  TString fConfigPath; // name of the configuration path
134  TString fConfigFileName; // name of the configuration file
135  TString fConfigPathAndFileName; // both path and file name appended
136 
137  Bool_t fIsOutputfile;
138  TString fOutputPath; // name of the configuration path
139  TString fOutputFileName; // name of the configuration file
140  TString fOutputPathAndFileName; // both path and file name appended
141  TString fAction;
142 
143  DIGInitialize *fDIGInitialize; // pointer to configuration
144  // DIGPlane *fDIGPlane; // pointer to DIGPlanes
145  Int_t fPlanesN; // number of planes
146  TObjArray *fDIGPlaneArray; // pointer to array of planes
147  Int_t fADCN; // number of ADCs
148  TObjArray *fDIGADCArray; // pointer to array of ADCs
149  Int_t fTransportN; // number of charge transport models
150  TObjArray *fDIGTransportArray; // pointer to array of models
151  Int_t fBeamN; // number of beams
152  TObjArray *fDIGBeamArray; // pointer to array of beams
153  Int_t fNumberOfConfigurations; // number of configurations to study = N planes x N ADCs x N charge transport models x N beams
154  DIGAction *fDIGAction;
155 
156  TObjArray *fDIGResultArray; // pointer to array of results
157 
158 
159  ofstream fOutputFileStream;
160 
161  TFile *ffile;
162  TTree *ftree;
163  DIGBeam *fdigbeam;
164  DIGPlane *fdigplane;
165  DIGADC *fdigadc;
166  DIGTransport *fdigtransport;
167  DIGEvent *fdigevent;
168  DIGResult *fdigresult;
169  //DIGHistograms *fdighistograms;
170 
171  TCanvas *MainCanvas1; //canvas 1
172  TCanvas *MainCanvas2;
173  TCanvas *MainCanvas3;
174  TCanvas *MainCanvas4;
175  TCanvas *MainCanvas5;
176  //TRandom3 *r3;
177 
178  Int_t ColorChosen;
179 
180 };
181 
182 
183 
184 //==============================================================================
185 #endif
Definition: digadc.h:36