Belle II Software  release-06-02-00
ECLBackgroundModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 //STL
12 #include <vector>
13 
14 //Framework
15 #include <framework/core/HistoModule.h>
16 #include <framework/datastore/StoreArray.h>
17 
18 
19 class TH1F;
20 class TH2F;
21 
22 namespace Belle2 {
28  class ECLSimHit;
29  class MCParticle;
30  class ECLShower;
31  class BeamBackHit;
32  class ECLCrystalData;
33 
34 #ifdef DOARICH
35  class ARICHGeometryPar;
36 #endif
37 
43 
44  public:
45 
48 
50  virtual ~ECLBackgroundModule();
51 
53  virtual void initialize() override;
54 
56  virtual void beginRun() override;
57 
59  virtual void event() override;
60 
62  virtual void endRun() override;
63 
65  virtual void terminate() override;
66 
68  virtual void defineHisto() override;
69 
70  private:
71 
74 
77 
80 
83 
86 
88  bool m_doARICH;
89 
91  std::vector<int> m_CryInt;
92 
94  int m_nEvent{0};
95 
97  TH1F* h_nECLSimHits{nullptr};
98 
100  TH1F* h_CrystalRadDoseTheta{nullptr};
102  TH1F* h_CrystalRadDose{nullptr};
104  TH1F* h_CrystalThetaID2{nullptr};
106  TH1F* h_CrystalThetaID67{nullptr};
108  TH2F* h_HitLocations{nullptr};
110  TH1F* h_BarrelDose{nullptr};
111 
113  TH1F* hEdepPerRing{nullptr};
114 
116  TH1F* hNevtPerRing{nullptr};
117 
118 
119 
121  TH1F* h_DiodeRadDose{nullptr};
123  TH1F* h_NeutronFlux{nullptr};
125  TH1F* h_NeutronFluxThetaID2{nullptr};
127  TH1F* h_NeutronFluxThetaID67{nullptr};
129  TH1F* h_NeutronE{nullptr};
131  TH1F* h_NeutronEThetaID0{nullptr};
133  TH1F* h_PhotonE{nullptr};
134 
135 
137  TH2F* h_ShowerVsTheta{nullptr};
139  TH1F* h_Shower{nullptr};
140 
142  TH1F* h_ProdVert{nullptr};
144  TH2F* h_ProdVertvsThetaId{nullptr};
145 
147  const double usInYr = 1e13;
149  const double GeVtoJ = 1.6e-10;
150 
153 
155  int FillARICHBeamBack(BeamBackHit* aBBHit);
157  int BuildECL();
158  // Transform Histograms //
159 
161  int SetPosHistos(TH1F* h, TH2F* hFWD, TH2F* hBAR, TH2F* hBWD);
163  TH2F* BuildPosHisto(TH1F* h, const char* sub);
165  TH1F* BuildThetaIDWideHisto(TH1F* h_cry);
167  TH1F* BuildARICHringIDHisto(TH1F* h_cell);
169  int ARICHmod2row(int modID);
170 
171  //ECL channels
173  static const int nECLCrystalTot = 8736;
175  const int nECLCrystalBAR = 6624;
177  const int nECLCrystalECF = 1152;
179  const int nECLCrystalECB = 960;
181  static const int nECLThetaID = 69;
182 
183  //ECL Pin Diodes
185  const double DiodeArea = 2 * 2;
187  const double DiodeThk = 0.1;
189  const double SiRho = 2.33e-3;
191  const double DiodeMass = DiodeArea * DiodeThk * SiRho;;
192 
193 
195 #ifdef DOARICH
196  ARICHGeometryPar* m_arichgp {0};
197 #endif
198 
199  //Below are the density for the BOARDS (not the HAPD themselves)
200  //The values are Taken from Luka Å antelj's BeamBack_arich.cc
201 
203  const double HAPDarea = 7.5 * 7.5;
205  const double HAPDthickness = 0.2;
207  const double HAPDmass = 47.25e-3;
208 
209  //ARICH channels
211  const int nHAPD = 420;
213  const int nHAPDrings = 7;
215  const int nHAPDperRing[7] = {42, 48, 54, 60, 66, 72, 78};
216 
217  // For shield studies
218 
220  TH1F* hEMDose{nullptr};
221 
223  TH1F* hEnergyPerCrystal{nullptr};
224 
226  TH1F* hDiodeFlux{nullptr};
227 
229  TH1F* hEgamma{nullptr};
231  TH1F* hEneu{nullptr};
232 
233 
235  TH1F* hARICHDoseBB{nullptr};
237  TH1F* hHAPDFlux{nullptr};
238 
240  TH2F* hEnergyPerCrystalECF{nullptr};
242  TH2F* hEnergyPerCrystalECB{nullptr};
244  TH2F* hEnergyPerCrystalBAR{nullptr};
246  TH1F* hEnergyPerCrystalWideTID{nullptr};
247 
248 
250  TH2F* hEMDoseECF{nullptr};
252  TH2F* hEMDoseECB{nullptr};
254  TH2F* hEMDoseBAR{nullptr};
256  TH1F* hEMDoseWideTID{nullptr};
257 
259  TH2F* hDiodeFluxECF{nullptr};
261  TH2F* hDiodeFluxECB{nullptr};
263  TH2F* hDiodeFluxBAR{nullptr};
265  TH1F* hDiodeFluxWideTID{nullptr};
266 
267  };
268 
270 } // end of Belle2 namespace
The Class for ARICH Geometry Parameters.
Class BeamBackHit - Stores hits from beam backgound simulation.
Definition: BeamBackHit.h:28
A module to study background campaigns and produce histograms.
const double SiRho
Density (silicium) [kg*cm^{-3}] of Si.
const double DiodeThk
Thickness [cm] of Diodes.
bool m_doARICH
Whether or not the ARICH plots are produced.
TH1F * h_DiodeRadDose
Diode Radiation Dose.
int SetPosHistos(TH1F *h, TH2F *hFWD, TH2F *hBAR, TH2F *hBWD)
Create 2D histograms indicating the position of each crystals.
StoreArray< ECLShower > m_eclShowerArray
Store array: ECLShower.
static const int nECLCrystalTot
Total number of ECL crystals
const double HAPDthickness
ARICH: Thickness (cm) of the HAPD boards.
TH2F * hEMDoseECF
Radiation Dose Forward Calorimeter.
TH2F * h_ShowerVsTheta
Shower Energy distribution vs theta.
TH2F * hEnergyPerCrystalBAR
Energy per crystal Barrel.
const int nECLCrystalECB
Number of BWD ECL end-capcrystals.
TH1F * hEnergyPerCrystal
Energy per cell.
static const int nECLThetaID
Number of thetaID values.
virtual void initialize() override
Initialize variables.
TH2F * hEnergyPerCrystalECB
Energy per crystal Backward Calorimeter.
TH1F * hEMDoseWideTID
Radiation Dose Wide bins.
const double HAPDmass
ARICH: Mass (kg) of the HAPD boards.
TH1F * hEneu
Log Spectrum of the neutrons hitting the diodes / 1 MeV.
virtual void event() override
Event method
const int nHAPD
ARICH parameter.
const int nECLCrystalBAR
Number of Barrel ECL crystals
TH1F * hARICHDoseBB
ARICH Yearly dose (rad) vs module index.
TH2F * hDiodeFluxECF
Diode Neutron Flux Forward Calorimeter.
const double HAPDarea
ARICH geometry paramaters.
TH2F * hEMDoseBAR
Radiation Dose Barrel.
virtual void endRun() override
endRun
TH2F * hEMDoseECB
Radiation Dose Backward Calorimeter.
TH2F * h_ProdVertvsThetaId
Production Vertex vs thetaID.
int BuildECL()
Builds geometry (fill Crystal look-up arrays)
std::vector< int > m_CryInt
Cell ID of crystal(s) of interest.
virtual void terminate() override
terminate
TH1F * h_CrystalRadDoseTheta
Crystal Radiation Dose, actual Theta.
TH1F * h_PhotonE
Photon Energy.
TH1F * h_ProdVert
Production Vertex.
TH1F * hNevtPerRing
Event counter averaged per ring (theta-id)
int ARICHmod2row(int modID)
Get ARICH ring ID from the module index.
const double DiodeArea
Frontal area [cm*cm] of Diodes.
const int nECLCrystalECF
Number of FWD ECL end-capcrystals.
TH2F * h_HitLocations
Hit locations.
const double usInYr
us in a year
int FillARICHBeamBack(BeamBackHit *aBBHit)
Populate ARICH HAPD dose and flux histograms (from the BeamBack hits array)
virtual void beginRun() override
beginRun
TH2F * BuildPosHisto(TH1F *h, const char *sub)
Convert histogram vs crystal index to geometrical positions.
TH1F * h_NeutronFluxThetaID67
Neutron flux in Diodes, ThetaID=67.
TH1F * hHAPDFlux
ARICH Yearly neutron flux vs module index.
TH1F * h_NeutronFluxThetaID2
Neutron flux in Diodes, ThetaID=2.
const int nHAPDperRing[7]
ARICH parameter.
TH1F * h_Shower
Shower Energy distribution.
const double DiodeMass
Mass [kg] of Diodes.
TH2F * hEnergyPerCrystalECF
Energy per crystal Forward Calorimeter.
StoreArray< BeamBackHit > m_BeamBackArray
Store array: BeamBackHit.
TH1F * hEdepPerRing
Energy averaged per ring.
TH1F * BuildARICHringIDHisto(TH1F *h_cell)
Convert histogram vs ARICH channel ID to average per ring ID.
StoreArray< ECLSimHit > m_eclArray
Store array: ECLSimHit.
TH1F * hEnergyPerCrystalWideTID
Energy per crystal Wide bins.
TH1F * hDiodeFluxWideTID
Diode Neutron Flux Wide bins.
StoreArray< MCParticle > m_mcParticles
Store array: MCParticle.
TH1F * h_CrystalThetaID2
Crystal Radiation Dose, ThetaID=2.
TH2F * hDiodeFluxECB
Diode Neutron Flux Backward Calorimeter.
TH1F * BuildThetaIDWideHisto(TH1F *h_cry)
Convert histogram vs crystal index to average per theta-ID (wide binning)
virtual ~ECLBackgroundModule()
Destructor.
TH1F * h_CrystalThetaID67
Crystal Radiation Dose, ThetaID=67.
TH1F * h_BarrelDose
Crystal Radiation Dose in Barrel, 12<thetaID<59.
TH1F * hEgamma
Log Spectrum of the photons hitting the crystals / 1 MeV.
TH1F * hEMDose
Radiation Dose per cell.
TH1F * h_NeutronFlux
Neutron Flux in Diodes.
const int nHAPDrings
ARICH parameter.
TH2F * hDiodeFluxBAR
Diode Neutron Flux Barrel.
TH1F * h_NeutronE
Neutron Energy.
const double GeVtoJ
Joules in a GeV.
TH1F * hDiodeFlux
Diode Neutron Flux per cell.
TH1F * h_CrystalRadDose
Crystal Radiation Dose.
TH1F * h_nECLSimHits
ECL Sim Hits.
int m_sampleTime
length of sample in us
virtual void defineHisto() override
Initalize the histograms.
TH1F * h_NeutronEThetaID0
Neutron Energy, First Crystal.
ECLCrystalData * Crystal[8736]
Store crystal geometry and mass data.
Class for obtaining crystal details for a given crystal cell An evolved look-up table.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Abstract base class for different kinds of events.