Belle II Software  release-05-02-19
CsIStudyModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: beaulieu *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef CSISTUDYMODULE_H
12 #define CSISTUDYMODULE_H
13 
14 #include <framework/core/HistoModule.h>
15 #include <framework/datastore/StoreArray.h>
16 #include <beast/csi/dataobjects/CsiSimHit.h>
17 #include <beast/csi/dataobjects/CsiHit.h>
18 #include <beast/csi/dataobjects/CsiDigiHit.h>
19 
20 //C++/C standard lib elements.
21 #include <string>
22 
23 
24 //ROOT
25 #include <TH1F.h>
26 
27 namespace Belle2 {
43  class CsIStudyModule : public HistoModule {
44 
45  public:
46 
51 
53  virtual ~CsIStudyModule();
54 
56  virtual void initialize() override;
57 
59  virtual void beginRun() override;
60 
62  virtual void endRun() override;
63 
64 
66  virtual void event() override;
67 
69  virtual void terminate() override;
70 
71 
73  /*
74  Histogram definitions such as TH1(), TH2(), TNtuple(), TTree().... are supposed
75  to be placed in this function.
76  */
77  virtual void defineHisto() override;
78 
79 
88  bool* readDPPStatusBits(char packedbits);
89 
90  private:
91 
97  // Parameters
98  double m_paramTemplate;
99  int m_nWFSamples
100  ;
101  std::string m_waveformFilename ;
104  //Othe rmembers
105  TFile* fWF;
107  // Histograms
110  TH1F* h_CrystalRadDose;
111  TH1F* h_CrystalRadDoseSH;
112  TH1F* h_NhitCrystal;
114  TH1S* h_Waveform;
115  TH1C* h_Gate;
116  TH1F* h_Charge ;
117  TH1F* h_TrueEdep;
118  TH1F* h_Height;
119  TH1F* h_Weight;
123  // Constants
124  const double GeVtoJ = 1.6e-10;
125  const double Sampletime = 1000.0;
126  const double usInYr = 1.0e13;
127  };
129 }
130 
131 #endif /* CSISTUDYMODULE_H */
Belle2::CsIStudyModule::h_CrystalSpectrum
TH1F * h_CrystalSpectrum
Distribution of the energy of each simhit.
Definition: CsIStudyModule.h:117
Belle2::CsIStudyModule::h_Charge
TH1F * h_Charge
Distribution of the integrated charge from the pulse processing algorithm.
Definition: CsIStudyModule.h:124
Belle2::CsIStudyModule::h_CrystalEdep
TH1F * h_CrystalEdep
Energy deposited in each crystal.
Definition: CsIStudyModule.h:116
Belle2::CsIStudyModule::h_LightYieldCrystal
TH1F * h_LightYieldCrystal
Number of photons hits in each crystal (to validate light yield..)
Definition: CsIStudyModule.h:121
Belle2::CsIStudyModule::m_waveformFilename
std::string m_waveformFilename
Path where to save the waveforms (root file)
Definition: CsIStudyModule.h:109
Belle2::CsIStudyModule::h_Weight
TH1F * h_Weight
Event weight assigned by the generator.
Definition: CsIStudyModule.h:127
Belle2::CsIStudyModule::event
virtual void event() override
Read each event, calculate doses and fill histograms.
Definition: CsIStudyModule.cc:108
Belle2::CsIStudyModule::beginRun
virtual void beginRun() override
To do at the beginning of each runs.
Definition: CsIStudyModule.cc:97
Belle2::CsIStudyModule::readDPPStatusBits
bool * readDPPStatusBits(char packedbits)
Reads and unpacks the status bits of the digitizer Unpacks in the appropriate booleans.
Definition: CsIStudyModule.cc:223
Belle2::CsIStudyModule::~CsIStudyModule
virtual ~CsIStudyModule()
Empty destructor.
Definition: CsIStudyModule.cc:66
Belle2::CsIStudyModule::h_Height
TH1F * h_Height
Max height of the peak signa(.
Definition: CsIStudyModule.h:126
Belle2::CsIStudyModule::CsIStudyModule
CsIStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition: CsIStudyModule.cc:38
Belle2::CsIStudyModule::initialize
virtual void initialize() override
Initialization: building histograms.
Definition: CsIStudyModule.cc:86
Belle2::CsIStudyModule::h_Waveform
TH1S * h_Waveform
Contains the digitized waveform (if enabled in the digitizer)
Definition: CsIStudyModule.h:122
Belle2::CsIStudyModule::m_nWFSamples
int m_nWFSamples
Number of samples in each of the waveforms (in the near future this should be imported from the digi ...
Definition: CsIStudyModule.h:108
Belle2::CsIStudyModule::h_Gate
TH1C * h_Gate
Contains the integration gate (if waveforms are enabled in the digitizer)
Definition: CsIStudyModule.h:123
Belle2::CsIStudyModule::h_CrystalRadDoseSH
TH1F * h_CrystalRadDoseSH
Yearly radiation dose deposited in each crystal (for hit-simhit check)
Definition: CsIStudyModule.h:119
Belle2::CsIStudyModule::h_NhitCrystal
TH1F * h_NhitCrystal
Number of hits in each crystal (to get hit rate)
Definition: CsIStudyModule.h:120
Belle2::CsIStudyModule::usInYr
const double usInYr
Conversion between us to nominal year.
Definition: CsIStudyModule.h:134
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::CsIStudyModule::m_hits
StoreArray< CsiHit > m_hits
Array of the crystal hits (1 per event)
Definition: CsIStudyModule.h:101
Belle2::CsIStudyModule::defineHisto
virtual void defineHisto() override
function to define histograms
Definition: CsIStudyModule.cc:70
Belle2::CsIStudyModule::terminate
virtual void terminate() override
Clean everything up.
Definition: CsIStudyModule.cc:217
Belle2::CsIStudyModule::m_paramTemplate
double m_paramTemplate
Template of an input parameter.
Definition: CsIStudyModule.h:106
Belle2::CsIStudyModule::Sampletime
const double Sampletime
Sample time in us.
Definition: CsIStudyModule.h:133
Belle2::CsIStudyModule::GeVtoJ
const double GeVtoJ
Conversion between GeV to Joule.
Definition: CsIStudyModule.h:132
Belle2::CsIStudyModule::endRun
virtual void endRun() override
To do at the end of each runs.
Definition: CsIStudyModule.cc:101
Belle2::CsIStudyModule::h_CrystalRadDose
TH1F * h_CrystalRadDose
Yearly radiation dose deposited in each crystal.
Definition: CsIStudyModule.h:118
Belle2::CsIStudyModule::h_TrueEdep
TH1F * h_TrueEdep
Distribution of the true total deposited energy in the event.
Definition: CsIStudyModule.h:125
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::CsIStudyModule::m_simhits
StoreArray< CsiSimHit > m_simhits
Array of the simulated hits in the crystals (incl.
Definition: CsIStudyModule.h:100
Belle2::CsIStudyModule::fWF
TFile * fWF
ROOT file to save waveforms.
Definition: CsIStudyModule.h:113
Belle2::CsIStudyModule::m_digihits
StoreArray< CsiDigiHit > m_digihits
Array of the crystal digitized hits (1 per event per fired crystal)
Definition: CsIStudyModule.h:103