Belle II Software development
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/* ECL headers. */
12#include <ecl/dataobjects/ECLElementNumbers.h>
13
14/* Basf2 headers. */
15#include <framework/core/HistoModule.h>
16#include <framework/datastore/StoreArray.h>
17
18/* C++ headers. */
19#include <vector>
20
21class TH1F;
22class TH2F;
23
24namespace Belle2 {
30 class ECLSimHit;
31 class MCParticle;
32 class ECLShower;
33 class BeamBackHit;
34 class ECLCrystalData;
35
36#ifdef DOARICH
37 class ARICHGeometryPar;
38#endif
39
42
43 public:
44
47
49 virtual ~ECLBackgroundModule();
50
52 virtual void initialize() override;
53
55 virtual void beginRun() override;
56
58 virtual void event() override;
59
61 virtual void endRun() override;
62
64 virtual void terminate() override;
65
67 virtual void defineHisto() override;
68
69 private:
70
73
76
79
82
85
88
90 std::vector<int> m_CryInt;
91
93 int m_nEvent{0};
94
96 TH1F* h_nECLSimHits{nullptr};
97
99 TH1F* h_CrystalRadDoseTheta{nullptr};
101 TH1F* h_CrystalRadDose{nullptr};
103 TH1F* h_CrystalThetaID2{nullptr};
105 TH1F* h_CrystalThetaID67{nullptr};
107 TH2F* h_HitLocations{nullptr};
109 TH1F* h_BarrelDose{nullptr};
110
112 TH1F* hEdepPerRing{nullptr};
113
115 TH1F* hNevtPerRing{nullptr};
116
117
118
120 TH1F* h_DiodeRadDose{nullptr};
122 TH1F* h_NeutronFlux{nullptr};
124 TH1F* h_NeutronFluxThetaID2{nullptr};
128 TH1F* h_NeutronE{nullptr};
130 TH1F* h_NeutronEThetaID0{nullptr};
132 TH1F* h_PhotonE{nullptr};
133
134
136 TH2F* h_ShowerVsTheta{nullptr};
138 TH1F* h_Shower{nullptr};
139
141 TH1F* h_ProdVert{nullptr};
143 TH2F* h_ProdVertvsThetaId{nullptr};
144
146 const double usInYr = 1e13;
148 const double GeVtoJ = 1.6e-10;
149
152
154 int FillARICHBeamBack(BeamBackHit* aBBHit);
156 int BuildECL();
157 // Transform Histograms //
158
160 int SetPosHistos(TH1F* h, TH2F* hFWD, TH2F* hBAR, TH2F* hBWD);
162 TH2F* BuildPosHisto(TH1F* h, const char* sub);
164 TH1F* BuildThetaIDWideHisto(TH1F* h_cry);
166 TH1F* BuildARICHringIDHisto(TH1F* h_cell);
168 int ARICHmod2row(int modID);
169
170 //ECL channels
172 static const int nECLThetaID = 69;
173
174 //ECL Pin Diodes
176 const double DiodeArea = 2 * 2;
178 const double DiodeThk = 0.1;
180 const double SiRho = 2.33e-3;
182 const double DiodeMass = DiodeArea * DiodeThk * SiRho;;
183
184
186#ifdef DOARICH
187 ARICHGeometryPar* m_arichgp {0};
188#endif
189
190 //Below are the density for the BOARDS (not the HAPD themselves)
191 //The values are Taken from Luka Å antelj's BeamBack_arich.cc
192
194 const double HAPDarea = 7.5 * 7.5;
196 const double HAPDthickness = 0.2;
198 const double HAPDmass = 47.25e-3;
199
200 //ARICH channels
202 const int nHAPD = 420;
204 const int nHAPDrings = 7;
206 const int nHAPDperRing[7] = {42, 48, 54, 60, 66, 72, 78};
207
208 // For shield studies
209
211 TH1F* hEMDose{nullptr};
212
214 TH1F* hEnergyPerCrystal{nullptr};
215
217 TH1F* hDiodeFlux{nullptr};
218
220 TH1F* hEgamma{nullptr};
222 TH1F* hEneu{nullptr};
223
224
226 TH1F* hARICHDoseBB{nullptr};
228 TH1F* hHAPDFlux{nullptr};
229
231 TH2F* hEnergyPerCrystalECF{nullptr};
233 TH2F* hEnergyPerCrystalECB{nullptr};
235 TH2F* hEnergyPerCrystalBAR{nullptr};
238
239
241 TH2F* hEMDoseECF{nullptr};
243 TH2F* hEMDoseECB{nullptr};
245 TH2F* hEMDoseBAR{nullptr};
247 TH1F* hEMDoseWideTID{nullptr};
248
250 TH2F* hDiodeFluxECF{nullptr};
252 TH2F* hDiodeFluxECB{nullptr};
254 TH2F* hDiodeFluxBAR{nullptr};
256 TH1F* hDiodeFluxWideTID{nullptr};
257
258 };
259
261} // 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.
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.
TH1F * BuildARICHringIDHisto(TH1F *h_cell)
Convert histogram vs ARICH channel ID to average per ring ID.
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.
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.
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.
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.
ECLCrystalData * Crystal[ECLElementNumbers::c_NCrystals]
Store crystal geometry and mass data.
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.
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
const int c_NCrystals
Number of crystals.
Abstract base class for different kinds of events.