PandaRoot
PndEmcFWEndcapDigi.h
Go to the documentation of this file.
1 //#pragma once
2 
3 #ifndef PNDEMCFWENDCAPDIGI_H_
4 #define PNDEMCFWENDCAPDIGI_H_
5 
6 #include <PndPersistencyTask.h>
7 #include "PndEmcHighLowPSA.h"
11 
12 #include "FairTask.h"
13 
14 #include "TRandom.h"
15 
16 #include <string>
17 #include <fstream>
18 //#include <vector>
19 
20 class PndEmcHit;
22 class PndEmcWaveform;
23 
24 class TClonesArray;
26 class PndEmcRecoPar;
27 class PndEmcGeoPar;
28 class PndEmcAbsPSA;
31 
41 {
42 public:
43  // Constructors
44  PndEmcFWEndcapDigi(Int_t verbose=0, Bool_t storedigis=kTRUE);
45  // Destructor
46  virtual ~PndEmcFWEndcapDigi();
47 
48  virtual InitStatus Init();
49  virtual void Exec(Option_t* opt);
50 
51  void SetStorageOfData(Bool_t val); // Method to specify whether digis are stored or not.
52  void RunTimeBased(){fTimeOrderedDigi = kTRUE;};
53 
54  void SetPSAAlgorithms(PndEmcAbsPSA* highgain, PndEmcAbsPSA* lowgain) {
55  fHighgainPSA = dynamic_cast<PndEmcPSAFPGASampleAnalyser*>(highgain);
56  fLowgainPSA = dynamic_cast<PndEmcPSAFPGASampleAnalyser*>(lowgain);
57 
58  if (fHighgainPSA == nullptr || fLowgainPSA == nullptr) {
59  std::cerr << "-E- in PndEmcFWEndcapDigi::SetPSAAlgorithms: PSA must be a PndEmcPSAFPGASampleAnalyser. External PSA setting has no effect" << std::endl;
60  }
61  }
62 
64  fCalibrator = dynamic_cast<PndEmcSimCrystalCalibrator*>(Cal);
65  if (fCalibrator == nullptr) {
66  std::cerr << "-E- in PndEmcFWEndcapDigi::SetCrystalCalibrator: Calibrator must be a PndEmcSimCrystalCalibrator. External Calibrator setting has no effect" << std::endl;
67  }
68  };
69 protected:
71  virtual void SetParContainers();
72 private:
73  // don't allow copying (-Weffc++)
74  PndEmcFWEndcapDigi(const PndEmcFWEndcapDigi&); // no implementation
75  PndEmcFWEndcapDigi& operator= (const PndEmcFWEndcapDigi&); // no implementation
76 
77 private:
78 
80  TClonesArray* fWaveformArray;
81 
83  TClonesArray* fDigiArray;
84  TClonesArray* fDigiArray2;
85  TClonesArray* fHitArray;
86 
87  Double_t fEnergyDigiThreshold;
88  TString fDigiPosMethod; //"surface" or "depth"
89  Double_t fEmcDigiRescaleFactor;
90  Double_t fEmcDigiPositionDepthPWO;
91  Double_t fEmcDigiPositionDepthShashlyk;
92 
93  PndEmcPSAFPGASampleAnalyser* fHighgainPSA;
94  PndEmcPSAFPGASampleAnalyser* fLowgainPSA;
95  PndEmcHighLowPSA fHighLowPSA;
96 
97  PndEmcSimCrystalCalibrator *fCalibrator;
98 
99  PndEmcFWEndcapDigiPar* fDigiPar;
100  PndEmcRecoPar* fRecoPar;
101  PndEmcGeoPar* fGeoPar;
102 
104  Int_t fVerbose;
105 
106  Int_t fNrOfEvents;
107  Int_t evtCounter;
108  Int_t nFwDigiProg;
109 
110  Bool_t fStoreDigis;
111  Bool_t fTimeOrderedDigi;
112 
113  std::ofstream Energy;
114 
115  Double_t GetEnergyDepTimeResolution(Double_t);
116 
117  ClassDef(PndEmcFWEndcapDigi,1);
118 };
119 
120 #endif
void SetPSAAlgorithms(PndEmcAbsPSA *highgain, PndEmcAbsPSA *lowgain)
virtual ~PndEmcFWEndcapDigi()
virtual InitStatus Init()
virtual void Exec(Option_t *opt)
Taks to create waveforms from hits.
Wrapping class to manage two independent PSAs for high, resp. low gain.
stores crystal index coordinates (x,y) or (theta,phi)
PndEmcFWEndcapDigi(Int_t verbose=0, Bool_t storedigis=kTRUE)
Task to create digis from waveforms.
parameter set for the FWEndcap variant of waveform simulation
virtual void SetCrystalCalibrator(PndEmcAbsCrystalCalibrator *Cal)
Class to simulate a Calibration.
represents a simulated waveform in an emc crystal
Baseclass for pulseshapeanalysis ( featureextraction )
Definition: PndEmcAbsPSA.h:21
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:28
pulseshape interface
Abstract interface for a emc calibrator.
virtual void SetParContainers()
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:12
void SetStorageOfData(Bool_t val)