Belle II Software  release-05-02-19
ECLBackgroundModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Sam de Jong *
7  * Alexandre Beaulieu *
8  * Poyuan Chen *
9  * *
10  * This software is provided "as is" without any warranty. *
11  **************************************************************************/
12 
13 #pragma once
14 
15 //STL
16 #include <vector>
17 
18 //Framework
19 #include <framework/core/HistoModule.h>
20 #include <framework/datastore/StoreArray.h>
21 
22 
23 class TH1F;
24 class TH2F;
25 
26 namespace Belle2 {
32  class ECLSimHit;
33  class MCParticle;
34  class ECLShower;
35  class BeamBackHit;
36  class ECLCrystalData;
37 
38 #ifdef DOARICH
39  class ARICHGeometryPar;
40 #endif
41 
47 
48  public:
49 
52 
54  virtual ~ECLBackgroundModule();
55 
57  virtual void initialize() override;
58 
60  virtual void beginRun() override;
61 
63  virtual void event() override;
64 
66  virtual void endRun() override;
67 
69  virtual void terminate() override;
70 
72  virtual void defineHisto() override;
73 
74  private:
75 
78 
81 
84 
87 
90 
92  bool m_doARICH;
93 
95  std::vector<int> m_CryInt;
96 
98  int m_nEvent{0};
99 
101  TH1F* h_nECLSimHits{nullptr};
102 
104  TH1F* h_CrystalRadDoseTheta{nullptr};
106  TH1F* h_CrystalRadDose{nullptr};
108  TH1F* h_CrystalThetaID2{nullptr};
110  TH1F* h_CrystalThetaID67{nullptr};
112  TH2F* h_HitLocations{nullptr};
114  TH1F* h_BarrelDose{nullptr};
115 
117  TH1F* hEdepPerRing{nullptr};
118 
120  TH1F* hNevtPerRing{nullptr};
121 
122 
123 
125  TH1F* h_DiodeRadDose{nullptr};
127  TH1F* h_NeutronFlux{nullptr};
129  TH1F* h_NeutronFluxThetaID2{nullptr};
131  TH1F* h_NeutronFluxThetaID67{nullptr};
133  TH1F* h_NeutronE{nullptr};
135  TH1F* h_NeutronEThetaID0{nullptr};
137  TH1F* h_PhotonE{nullptr};
138 
139 
141  TH2F* h_ShowerVsTheta{nullptr};
143  TH1F* h_Shower{nullptr};
144 
146  TH1F* h_ProdVert{nullptr};
148  TH2F* h_ProdVertvsThetaId{nullptr};
149 
151  const double usInYr = 1e13;
153  const double GeVtoJ = 1.6e-10;
154 
155  //from Alex Beaulieu's implementation
156 
159 
161  int FillARICHBeamBack(BeamBackHit* aBBHit);
163  int BuildECL();
164  // Transform Histograms //
165 
167  int SetPosHistos(TH1F* h, TH2F* hFWD, TH2F* hBAR, TH2F* hBWD);
169  TH2F* BuildPosHisto(TH1F* h, const char* sub);
171  TH1F* BuildThetaIDWideHisto(TH1F* h_cry);
173  TH1F* BuildARICHringIDHisto(TH1F* h_cell);
175  int ARICHmod2row(int modID);
176 
177  //ECL channels
179  static const int nECLCrystalTot = 8736;
181  const int nECLCrystalBAR = 6624;
183  const int nECLCrystalECF = 1152;
185  const int nECLCrystalECB = 960;
187  static const int nECLThetaID = 69;
188 
189  //ECL Pin Diodes
191  const double DiodeArea = 2 * 2;
193  const double DiodeThk = 0.1;
195  const double SiRho = 2.33e-3;
197  const double DiodeMass = DiodeArea * DiodeThk * SiRho;;
198 
199 
201 #ifdef DOARICH
202  ARICHGeometryPar* m_arichgp {0};
203 #endif
204 
205  //Below are the density for the BOARDS (not the HAPD themselves)
206  //The values are Taken from Luka Å antelj's BeamBack_arich.cc
207 
209  const double HAPDarea = 7.5 * 7.5;
211  const double HAPDthickness = 0.2;
213  const double HAPDmass = 47.25e-3;
214 
215  //ARICH channels
217  const int nHAPD = 420;
219  const int nHAPDrings = 7;
221  const int nHAPDperRing[7] = {42, 48, 54, 60, 66, 72, 78};
222 
223  // For shield studies
224 
226  TH1F* hEMDose{nullptr};
227 
229  TH1F* hEnergyPerCrystal{nullptr};
230 
232  TH1F* hDiodeFlux{nullptr};
233 
235  TH1F* hEgamma{nullptr};
237  TH1F* hEneu{nullptr};
238 
239 
241  TH1F* hARICHDoseBB{nullptr};
243  TH1F* hHAPDFlux{nullptr};
244 
246  TH2F* hEnergyPerCrystalECF{nullptr};
248  TH2F* hEnergyPerCrystalECB{nullptr};
250  TH2F* hEnergyPerCrystalBAR{nullptr};
252  TH1F* hEnergyPerCrystalWideTID{nullptr};
253 
254 
256  TH2F* hEMDoseECF{nullptr};
258  TH2F* hEMDoseECB{nullptr};
260  TH2F* hEMDoseBAR{nullptr};
262  TH1F* hEMDoseWideTID{nullptr};
263 
265  TH2F* hDiodeFluxECF{nullptr};
267  TH2F* hDiodeFluxECB{nullptr};
269  TH2F* hDiodeFluxBAR{nullptr};
271  TH1F* hDiodeFluxWideTID{nullptr};
272 
273  };
274 
276 } // end of Belle2 namespace
Belle2::ECLBackgroundModule::h_CrystalRadDose
TH1F * h_CrystalRadDose
Crystal Radiation Dose.
Definition: ECLBackgroundModule.h:106
Belle2::ECLCrystalData
Class for obtaining crystal details for a given crystal cell An evolved look-up table.
Definition: ECLCrystalData.h:31
Belle2::ECLBackgroundModule::SetPosHistos
int SetPosHistos(TH1F *h, TH2F *hFWD, TH2F *hBAR, TH2F *hBWD)
Create 2D histograms indicating the position of each crystals.
Definition: ECLBackgroundModule.cc:480
Belle2::ECLBackgroundModule::h_BarrelDose
TH1F * h_BarrelDose
Crystal Radiation Dose in Barrel, 12<thetaID<59.
Definition: ECLBackgroundModule.h:114
Belle2::ECLBackgroundModule
A module to study background campaigns and produce histograms.
Definition: ECLBackgroundModule.h:46
Belle2::ECLBackgroundModule::hDiodeFluxECF
TH2F * hDiodeFluxECF
Diode Neutron Flux Forward Calorimeter.
Definition: ECLBackgroundModule.h:265
Belle2::ECLBackgroundModule::h_CrystalRadDoseTheta
TH1F * h_CrystalRadDoseTheta
Crystal Radiation Dose, actual Theta.
Definition: ECLBackgroundModule.h:104
Belle2::ECLBackgroundModule::BuildPosHisto
TH2F * BuildPosHisto(TH1F *h, const char *sub)
Convert histogram vs crystal index to geometrical positions.
Definition: ECLBackgroundModule.cc:516
Belle2::ECLBackgroundModule::hHAPDFlux
TH1F * hHAPDFlux
ARICH Yearly neutron flux vs module index.
Definition: ECLBackgroundModule.h:243
Belle2::ECLBackgroundModule::h_NeutronFlux
TH1F * h_NeutronFlux
Neutron Flux in Diodes.
Definition: ECLBackgroundModule.h:127
Belle2::ECLBackgroundModule::h_NeutronE
TH1F * h_NeutronE
Neutron Energy.
Definition: ECLBackgroundModule.h:133
Belle2::ECLBackgroundModule::defineHisto
virtual void defineHisto() override
Initalize the histograms.
Definition: ECLBackgroundModule.cc:70
Belle2::ECLBackgroundModule::hDiodeFluxECB
TH2F * hDiodeFluxECB
Diode Neutron Flux Backward Calorimeter.
Definition: ECLBackgroundModule.h:267
Belle2::ECLBackgroundModule::BuildECL
int BuildECL()
Builds geometry (fill Crystal look-up arrays)
Definition: ECLBackgroundModule.cc:471
Belle2::ECLBackgroundModule::m_CryInt
std::vector< int > m_CryInt
Cell ID of crystal(s) of interest.
Definition: ECLBackgroundModule.h:95
Belle2::ECLBackgroundModule::DiodeArea
const double DiodeArea
Frontal area [cm*cm] of Diodes.
Definition: ECLBackgroundModule.h:191
Belle2::ECLBackgroundModule::h_CrystalThetaID67
TH1F * h_CrystalThetaID67
Crystal Radiation Dose, ThetaID=67.
Definition: ECLBackgroundModule.h:110
Belle2::ECLBackgroundModule::h_CrystalThetaID2
TH1F * h_CrystalThetaID2
Crystal Radiation Dose, ThetaID=2.
Definition: ECLBackgroundModule.h:108
Belle2::ECLBackgroundModule::beginRun
virtual void beginRun() override
beginRun
Definition: ECLBackgroundModule.cc:178
Belle2::ECLBackgroundModule::hDiodeFluxBAR
TH2F * hDiodeFluxBAR
Diode Neutron Flux Barrel.
Definition: ECLBackgroundModule.h:269
Belle2::ECLBackgroundModule::nECLCrystalECF
const int nECLCrystalECF
Number of FWD ECL end-capcrystals.
Definition: ECLBackgroundModule.h:183
Belle2::ECLBackgroundModule::h_nECLSimHits
TH1F * h_nECLSimHits
ECL Sim Hits.
Definition: ECLBackgroundModule.h:101
Belle2::ECLBackgroundModule::nECLCrystalECB
const int nECLCrystalECB
Number of BWD ECL end-capcrystals.
Definition: ECLBackgroundModule.h:185
Belle2::ECLBackgroundModule::hEMDoseWideTID
TH1F * hEMDoseWideTID
Radiation Dose Wide bins.
Definition: ECLBackgroundModule.h:262
Belle2::ECLBackgroundModule::HAPDthickness
const double HAPDthickness
ARICH: Thickness (cm) of the HAPD boards.
Definition: ECLBackgroundModule.h:211
Belle2::ECLBackgroundModule::usInYr
const double usInYr
us in a year
Definition: ECLBackgroundModule.h:151
Belle2::ECLBackgroundModule::hEneu
TH1F * hEneu
Log Spectrum of the neutrons hitting the diodes / 1 MeV.
Definition: ECLBackgroundModule.h:237
Belle2::ECLBackgroundModule::nHAPDperRing
const int nHAPDperRing[7]
ARICH parameter.
Definition: ECLBackgroundModule.h:221
Belle2::ECLBackgroundModule::m_eclShowerArray
StoreArray< ECLShower > m_eclShowerArray
Store array: ECLShower.
Definition: ECLBackgroundModule.h:86
Belle2::ECLBackgroundModule::endRun
virtual void endRun() override
endRun
Definition: ECLBackgroundModule.cc:387
Belle2::ECLBackgroundModule::GeVtoJ
const double GeVtoJ
Joules in a GeV.
Definition: ECLBackgroundModule.h:153
Belle2::ECLBackgroundModule::HAPDmass
const double HAPDmass
ARICH: Mass (kg) of the HAPD boards.
Definition: ECLBackgroundModule.h:213
Belle2::ECLBackgroundModule::hEdepPerRing
TH1F * hEdepPerRing
Energy averaged per ring.
Definition: ECLBackgroundModule.h:117
Belle2::ECLBackgroundModule::h_PhotonE
TH1F * h_PhotonE
Photon Energy.
Definition: ECLBackgroundModule.h:137
Belle2::ECLBackgroundModule::h_DiodeRadDose
TH1F * h_DiodeRadDose
Diode Radiation Dose.
Definition: ECLBackgroundModule.h:125
Belle2::ECLBackgroundModule::hNevtPerRing
TH1F * hNevtPerRing
Event counter averaged per ring (theta-id)
Definition: ECLBackgroundModule.h:120
Belle2::ECLBackgroundModule::h_ProdVert
TH1F * h_ProdVert
Production Vertex.
Definition: ECLBackgroundModule.h:146
Belle2::ECLBackgroundModule::h_NeutronFluxThetaID67
TH1F * h_NeutronFluxThetaID67
Neutron flux in Diodes, ThetaID=67.
Definition: ECLBackgroundModule.h:131
Belle2::ECLBackgroundModule::Crystal
ECLCrystalData * Crystal[8736]
Store crystal geometry and mass data.
Definition: ECLBackgroundModule.h:158
Belle2::ECLBackgroundModule::hEnergyPerCrystal
TH1F * hEnergyPerCrystal
Energy per cell.
Definition: ECLBackgroundModule.h:229
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLBackgroundModule::nECLCrystalTot
static const int nECLCrystalTot
Total number of ECL crystals
Definition: ECLBackgroundModule.h:179
Belle2::ECLBackgroundModule::BuildThetaIDWideHisto
TH1F * BuildThetaIDWideHisto(TH1F *h_cry)
Convert histogram vs crystal index to average per theta-ID (wide binning)
Definition: ECLBackgroundModule.cc:573
Belle2::ECLBackgroundModule::h_HitLocations
TH2F * h_HitLocations
Hit locations.
Definition: ECLBackgroundModule.h:112
Belle2::ECLBackgroundModule::m_doARICH
bool m_doARICH
Whether or not the ARICH plots are produced.
Definition: ECLBackgroundModule.h:92
Belle2::ECLBackgroundModule::nECLThetaID
static const int nECLThetaID
Number of thetaID values.
Definition: ECLBackgroundModule.h:187
Belle2::ECLBackgroundModule::nECLCrystalBAR
const int nECLCrystalBAR
Number of Barrel ECL crystals
Definition: ECLBackgroundModule.h:181
Belle2::ECLBackgroundModule::ECLBackgroundModule
ECLBackgroundModule()
Constructor.
Definition: ECLBackgroundModule.cc:53
Belle2::ECLBackgroundModule::DiodeMass
const double DiodeMass
Mass [kg] of Diodes.
Definition: ECLBackgroundModule.h:197
Belle2::ARICHGeometryPar
The Class for ARICH Geometry Parameters.
Definition: ARICHGeometryPar.h:36
Belle2::ECLBackgroundModule::DiodeThk
const double DiodeThk
Thickness [cm] of Diodes.
Definition: ECLBackgroundModule.h:193
Belle2::ECLBackgroundModule::SiRho
const double SiRho
Density (silicium) [kg*cm^{-3}] of Si.
Definition: ECLBackgroundModule.h:195
Belle2::ECLBackgroundModule::hARICHDoseBB
TH1F * hARICHDoseBB
ARICH Yearly dose (rad) vs module index.
Definition: ECLBackgroundModule.h:241
Belle2::ECLBackgroundModule::HAPDarea
const double HAPDarea
ARICH geometry paramaters.
Definition: ECLBackgroundModule.h:209
Belle2::ECLBackgroundModule::hEMDoseECF
TH2F * hEMDoseECF
Radiation Dose Forward Calorimeter.
Definition: ECLBackgroundModule.h:256
Belle2::ECLBackgroundModule::h_NeutronFluxThetaID2
TH1F * h_NeutronFluxThetaID2
Neutron flux in Diodes, ThetaID=2.
Definition: ECLBackgroundModule.h:129
Belle2::ECLBackgroundModule::nHAPD
const int nHAPD
ARICH parameter.
Definition: ECLBackgroundModule.h:217
Belle2::ECLBackgroundModule::~ECLBackgroundModule
virtual ~ECLBackgroundModule()
Destructor.
Definition: ECLBackgroundModule.cc:65
Belle2::ECLBackgroundModule::event
virtual void event() override
Event method
Definition: ECLBackgroundModule.cc:182
Belle2::ECLBackgroundModule::BuildARICHringIDHisto
TH1F * BuildARICHringIDHisto(TH1F *h_cell)
Convert histogram vs ARICH channel ID to average per ring ID.
Belle2::ECLBackgroundModule::m_nEvent
int m_nEvent
Event counter.
Definition: ECLBackgroundModule.h:98
Belle2::ECLBackgroundModule::hEMDoseBAR
TH2F * hEMDoseBAR
Radiation Dose Barrel.
Definition: ECLBackgroundModule.h:260
Belle2::ECLBackgroundModule::hEgamma
TH1F * hEgamma
Log Spectrum of the photons hitting the crystals / 1 MeV.
Definition: ECLBackgroundModule.h:235
Belle2::ECLBackgroundModule::hEnergyPerCrystalECB
TH2F * hEnergyPerCrystalECB
Energy per crystal Backward Calorimeter.
Definition: ECLBackgroundModule.h:248
Belle2::ECLBackgroundModule::hEnergyPerCrystalBAR
TH2F * hEnergyPerCrystalBAR
Energy per crystal Barrel.
Definition: ECLBackgroundModule.h:250
Belle2::ECLBackgroundModule::initialize
virtual void initialize() override
Initialize variables.
Definition: ECLBackgroundModule.cc:161
Belle2::ECLBackgroundModule::nHAPDrings
const int nHAPDrings
ARICH parameter.
Definition: ECLBackgroundModule.h:219
Belle2::ECLBackgroundModule::terminate
virtual void terminate() override
terminate
Definition: ECLBackgroundModule.cc:425
Belle2::ECLBackgroundModule::ARICHmod2row
int ARICHmod2row(int modID)
Get ARICH ring ID from the module index.
Definition: ECLBackgroundModule.cc:620
Belle2::ECLBackgroundModule::h_ShowerVsTheta
TH2F * h_ShowerVsTheta
Shower Energy distribution vs theta.
Definition: ECLBackgroundModule.h:141
Belle2::ECLBackgroundModule::h_ProdVertvsThetaId
TH2F * h_ProdVertvsThetaId
Production Vertex vs thetaID.
Definition: ECLBackgroundModule.h:148
Belle2::ECLBackgroundModule::hEnergyPerCrystalWideTID
TH1F * hEnergyPerCrystalWideTID
Energy per crystal Wide bins.
Definition: ECLBackgroundModule.h:252
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::ECLBackgroundModule::h_Shower
TH1F * h_Shower
Shower Energy distribution.
Definition: ECLBackgroundModule.h:143
Belle2::ECLBackgroundModule::hEMDoseECB
TH2F * hEMDoseECB
Radiation Dose Backward Calorimeter.
Definition: ECLBackgroundModule.h:258
Belle2::BeamBackHit
Class BeamBackHit - Stores hits from beam backgound simulation.
Definition: BeamBackHit.h:39
Belle2::ECLBackgroundModule::FillARICHBeamBack
int FillARICHBeamBack(BeamBackHit *aBBHit)
Populate ARICH HAPD dose and flux histograms (from the BeamBack hits array)
Definition: ECLBackgroundModule.cc:468
Belle2::ECLBackgroundModule::m_BeamBackArray
StoreArray< BeamBackHit > m_BeamBackArray
Store array: BeamBackHit.
Definition: ECLBackgroundModule.h:83
Belle2::ECLBackgroundModule::m_eclArray
StoreArray< ECLSimHit > m_eclArray
Store array: ECLSimHit.
Definition: ECLBackgroundModule.h:77
Belle2::ECLBackgroundModule::h_NeutronEThetaID0
TH1F * h_NeutronEThetaID0
Neutron Energy, First Crystal.
Definition: ECLBackgroundModule.h:135
Belle2::ECLBackgroundModule::hEMDose
TH1F * hEMDose
Radiation Dose per cell.
Definition: ECLBackgroundModule.h:226
Belle2::ECLBackgroundModule::m_mcParticles
StoreArray< MCParticle > m_mcParticles
Store array: MCParticle.
Definition: ECLBackgroundModule.h:80
Belle2::ECLBackgroundModule::hDiodeFluxWideTID
TH1F * hDiodeFluxWideTID
Diode Neutron Flux Wide bins.
Definition: ECLBackgroundModule.h:271
Belle2::ECLBackgroundModule::hEnergyPerCrystalECF
TH2F * hEnergyPerCrystalECF
Energy per crystal Forward Calorimeter.
Definition: ECLBackgroundModule.h:246
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Belle2::ECLBackgroundModule::hDiodeFlux
TH1F * hDiodeFlux
Diode Neutron Flux per cell.
Definition: ECLBackgroundModule.h:232
Belle2::ECLBackgroundModule::m_sampleTime
int m_sampleTime
length of sample in us
Definition: ECLBackgroundModule.h:89