ROOT logo
#ifndef MAPS_DIGMAPS_H
#define MAPS_DIGMAPS_H

///////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                           //
//     DIGMAPS                                                                               //
//                                                                                           //
//    Main Class of DIGMAPS                                                                  //
// Contains pointers to all other classes and to the root tree                               //
//   units are all in micrometer.                                                            //
//       ROOT->ProcessLine(".L MAPS_digitiser.cxx+");                                        //
//                                                                                           //
//                                                                                           //
//                                                                                           //
///////////////////////////////////////////////////////////////////////////////////////////////

#include <TNamed.h>
#include <TList.h>
#include <TGraph.h>
#include <TCanvas.h>
#include "Riostream.h"
#include "vector"
#include <TRandom3.h>

// ROOT classes
#include "TStopwatch.h"
#include "TString.h"
#include "TObject.h"
#include "TVector.h"
#include "TFile.h"
#include "TSystem.h"
#include "TRandom.h"
#include "TH1.h"
#include "TH2.h"
#include "TObjArray.h"
#include "TTree.h"
#include "TBranch.h"
#include "TClonesArray.h"

#include "dighistograms.h"


using namespace std;

class DIGInitialize;
class DIGPlane;
class DIGADC;
class DIGBeam;
class DIGTransport;
class DIGParticle;
class DIGAction;
class DIGEvent;
class DIGMAPS;
class DIGHistograms;

static const Double_t PI=3.14159265358979312;
extern Int_t GlobalSeed;
// DIGInitialize test("read","test","/home/abesson/SAVE/ILCSOFT/DIGITISEUR/","input.txt")
class DIGMAPS : public TNamed, public DIGHistograms {
 public:
  DIGMAPS();
  DIGMAPS(char *name,char *title, TString aCP, TString aCFN,  TString action);
  DIGMAPS(char *name,char *title, TString aCP, TString aCFN,  TString outp, TString outf, TString action );
  virtual ~DIGMAPS();
  void         Run() ;
  void         RunConfiguration(Int_t configcounter, Int_t BeamNumber, Int_t PlaneNumber, Int_t ADCNumber, Int_t TransportNumber);
  void         ReadTree(TString StringTree) ;
  void         PrintConfigurations();
  void         ChargeGeneration(DIGParticle &aDIGParticle, Float_t StartingSegmentSize, 
				Float_t MaximumSegmentSize,
				Float_t MaximumChargePerSegment);

  void         ActionPlot();
  void         InspectEvent(Int_t EventNumber);
  void         PlotAConfiguration(Int_t confignumber, Bool_t newcanvas);

  void         SetConfigPath(TString aCP) ;
  void         SetConfigFileName(TString aCFN) ;
  void         SetConfigPathAndFileName() ;
  void         SetConfigPathAndFileName(TString aCP,TString aCFN) ;
  void         SetOutputPath(TString outp) ;
  void         SetOutputFileName(TString outf) ;
  void         SetOutputPathAndFileName() ;
  void         SetOutputPathAndFileName(TString outp,TString outf) ;
  void         SetIsOutputfile(Bool_t IsOutputfile);
  void         SetNumberOfConfigurations(Int_t NumberOfConfiguration); 
  void         SetfAction(TString action) ;
  void         SetAction(DIGAction *aDIGAction) ;

  TString         GetConfigPath() ;
  TString         GetConfigFileName() ;
  TString         GetConfigPathAndFileName() ;
  TString         GetOutputPath()             {return fOutputPath ;}
  TString         GetOutputFileName()         {return fOutputFileName; } 
  TString         GetOutputPathAndFileName()  {return fOutputPathAndFileName;}
  Bool_t           GetIsOutputfile()  {return fIsOutputfile;}
  DIGInitialize   *GetDIGInitialize(){     return fDIGInitialize; }
  Int_t            GetPlanesN()                               { return  fPlanesN;      } 
  DIGPlane        *GetPlane(Int_t aPlaneNumber);
  Int_t            GetADCN()                               { return  fADCN;      } 
  DIGADC          *GetADC(Int_t anADCNumber);
  Int_t            GetTransportN()                               { return  fTransportN;      } 
  DIGTransport    *GetTransport(Int_t aTransportNumber);
  Int_t            GetBeamN()                               { return  fBeamN;      } 
  DIGBeam         *GetBeam(Int_t aBeamNumber);
  DIGEvent        *GetEvent(){ return  fdigevent;}
  //DIGHistograms   *GetHistograms() { return   fdighistograms;}
  Int_t            GetNumberOfConfigurations()                               { return  fNumberOfConfigurations;      } 
  DIGAction           *GetAction(){return fDIGAction;}
  TString         GetfAction(){return fAction;}

  Int_t            PoissonLaw(Float_t Lambda);
  Double_t         LandauLaw(Double_t mean, Double_t sigma);
  Double_t         GaussianLaw(Double_t mean, Double_t sigma); 
  Double_t         Lorentz2D(Double_t *x, Double_t *par);




  TStopwatch timer1;

 protected:

   ClassDef(DIGMAPS,1);
   TString      fConfigPath;                 // name of the configuration path
   TString      fConfigFileName;             // name of the configuration file
   TString      fConfigPathAndFileName;      // both path and file name appended

   Bool_t       fIsOutputfile;
   TString      fOutputPath;                 // name of the configuration path
   TString      fOutputFileName;             // name of the configuration file
   TString      fOutputPathAndFileName;      // both path and file name appended
   TString      fAction;

   DIGInitialize        *fDIGInitialize;                           // pointer to configuration
   //  DIGPlane        *fDIGPlane;                           // pointer to DIGPlanes
   Int_t            fPlanesN;                  // number of planes 
   TObjArray       *fDIGPlaneArray;	       // pointer to array of planes			    
   Int_t            fADCN;                     // number of ADCs
   TObjArray       *fDIGADCArray;	       // pointer to array of ADCs
   Int_t            fTransportN;                     // number of charge transport models
   TObjArray       *fDIGTransportArray;	       // pointer to array of models
   Int_t            fBeamN;                    // number of beams
   TObjArray       *fDIGBeamArray;	       // pointer to array of beams
   Int_t fNumberOfConfigurations; // number of configurations to study = number of planes x number of ADCs
   DIGAction *fDIGAction;
   ofstream     fOutputFileStream;

   TFile *ffile;
   TTree *ftree;
   DIGBeam *fdigbeam;
   DIGPlane *fdigplane;
   DIGADC *fdigadc;
   DIGTransport *fdigtransport;
   DIGEvent *fdigevent;
   //DIGHistograms *fdighistograms;
 
   TCanvas *MainCanvas1; //canvas 1
   TCanvas *MainCanvas2;
   TCanvas *MainCanvas3;
   TCanvas *MainCanvas4;
   //TRandom3 *r3;

};



//==============================================================================
#endif
 digmaps.h:1
 digmaps.h:2
 digmaps.h:3
 digmaps.h:4
 digmaps.h:5
 digmaps.h:6
 digmaps.h:7
 digmaps.h:8
 digmaps.h:9
 digmaps.h:10
 digmaps.h:11
 digmaps.h:12
 digmaps.h:13
 digmaps.h:14
 digmaps.h:15
 digmaps.h:16
 digmaps.h:17
 digmaps.h:18
 digmaps.h:19
 digmaps.h:20
 digmaps.h:21
 digmaps.h:22
 digmaps.h:23
 digmaps.h:24
 digmaps.h:25
 digmaps.h:26
 digmaps.h:27
 digmaps.h:28
 digmaps.h:29
 digmaps.h:30
 digmaps.h:31
 digmaps.h:32
 digmaps.h:33
 digmaps.h:34
 digmaps.h:35
 digmaps.h:36
 digmaps.h:37
 digmaps.h:38
 digmaps.h:39
 digmaps.h:40
 digmaps.h:41
 digmaps.h:42
 digmaps.h:43
 digmaps.h:44
 digmaps.h:45
 digmaps.h:46
 digmaps.h:47
 digmaps.h:48
 digmaps.h:49
 digmaps.h:50
 digmaps.h:51
 digmaps.h:52
 digmaps.h:53
 digmaps.h:54
 digmaps.h:55
 digmaps.h:56
 digmaps.h:57
 digmaps.h:58
 digmaps.h:59
 digmaps.h:60
 digmaps.h:61
 digmaps.h:62
 digmaps.h:63
 digmaps.h:64
 digmaps.h:65
 digmaps.h:66
 digmaps.h:67
 digmaps.h:68
 digmaps.h:69
 digmaps.h:70
 digmaps.h:71
 digmaps.h:72
 digmaps.h:73
 digmaps.h:74
 digmaps.h:75
 digmaps.h:76
 digmaps.h:77
 digmaps.h:78
 digmaps.h:79
 digmaps.h:80
 digmaps.h:81
 digmaps.h:82
 digmaps.h:83
 digmaps.h:84
 digmaps.h:85
 digmaps.h:86
 digmaps.h:87
 digmaps.h:88
 digmaps.h:89
 digmaps.h:90
 digmaps.h:91
 digmaps.h:92
 digmaps.h:93
 digmaps.h:94
 digmaps.h:95
 digmaps.h:96
 digmaps.h:97
 digmaps.h:98
 digmaps.h:99
 digmaps.h:100
 digmaps.h:101
 digmaps.h:102
 digmaps.h:103
 digmaps.h:104
 digmaps.h:105
 digmaps.h:106
 digmaps.h:107
 digmaps.h:108
 digmaps.h:109
 digmaps.h:110
 digmaps.h:111
 digmaps.h:112
 digmaps.h:113
 digmaps.h:114
 digmaps.h:115
 digmaps.h:116
 digmaps.h:117
 digmaps.h:118
 digmaps.h:119
 digmaps.h:120
 digmaps.h:121
 digmaps.h:122
 digmaps.h:123
 digmaps.h:124
 digmaps.h:125
 digmaps.h:126
 digmaps.h:127
 digmaps.h:128
 digmaps.h:129
 digmaps.h:130
 digmaps.h:131
 digmaps.h:132
 digmaps.h:133
 digmaps.h:134
 digmaps.h:135
 digmaps.h:136
 digmaps.h:137
 digmaps.h:138
 digmaps.h:139
 digmaps.h:140
 digmaps.h:141
 digmaps.h:142
 digmaps.h:143
 digmaps.h:144
 digmaps.h:145
 digmaps.h:146
 digmaps.h:147
 digmaps.h:148
 digmaps.h:149
 digmaps.h:150
 digmaps.h:151
 digmaps.h:152
 digmaps.h:153
 digmaps.h:154
 digmaps.h:155
 digmaps.h:156
 digmaps.h:157
 digmaps.h:158
 digmaps.h:159
 digmaps.h:160
 digmaps.h:161
 digmaps.h:162
 digmaps.h:163
 digmaps.h:164
 digmaps.h:165
 digmaps.h:166
 digmaps.h:167
 digmaps.h:168
 digmaps.h:169