9#include <beast/fangs/modules/FANGSStudyModule.h>
10#include <beast/fangs/dataobjects/FANGSSimHit.h>
11#include <beast/fangs/dataobjects/FANGSHit.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/gearbox/GearDir.h>
14#include <framework/logging/Logger.h>
15#include <framework/gearbox/Const.h>
21#include <Math/Vector3D.h>
53 h_time =
new TH2F(
"h_time",
"Detector # vs. time", 20, 0., 20., 1000, 0., 750.);
55 h_timeWeighted =
new TH2F(
"h_timeWeigthed",
"Detector # vs. time weighted by the energy deposited", 20, 0., 20., 1000, 0., 750.);
57 h_timeThres =
new TH2F(
"h_timeThres",
"Detector # vs. time", 20, 0., 20., 750, 0., 750.);
59 h_timeWeightedThres =
new TH2F(
"h_timeWeigthedThres",
"Detector # vs. time weighted by the energy deposited", 20, 0., 20., 750, 0.,
62 h_edep =
new TH2F(
"h_edep",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
64 h_edep1 =
new TH2F(
"h_edep1",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
66 h_edep2 =
new TH2F(
"h_edep2",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
68 h_edep3 =
new TH2F(
"h_edep3",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
71 h_edepThres =
new TH2F(
"h_edepThres",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
73 h_edepThres1 =
new TH2F(
"h_edepThres1",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
75 h_edepThres2 =
new TH2F(
"h_edepThres2",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
77 h_edepThres3 =
new TH2F(
"h_edepThres3",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
79 for (
int i = 0; i < 3; i++) {
80 h_zvedep[i] =
new TH1F(TString::Format(
"h_zvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
83 h_xvzvedep[i] =
new TH2F(TString::Format(
"h_xvzvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
86 h_yvzvedep[i] =
new TH2F(TString::Format(
"h_yvzvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
89 h_rvzvedep[i] =
new TH2F(TString::Format(
"h_rvzvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
92 h_xvyvedep[i] =
new TH2F(TString::Format(
"h_xvyvedep_%d", i),
"edep [MeV] vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
95 h_zvedepW[i] =
new TH1F(TString::Format(
"h_zvedepW_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
98 h_xvzvedepW[i] =
new TH2F(TString::Format(
"h_xvzvedepW_%d", i),
"edep [MeV] vs. x vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
101 h_yvzvedepW[i] =
new TH2F(TString::Format(
"h_yvzvedepW_%d", i),
"edep [MeV] vs. y vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
104 h_xvyvedepW[i] =
new TH2F(TString::Format(
"h_xvyvedepW_%d", i),
"edep [MeV] vs. x vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
107 h_rvzvedepW[i] =
new TH2F(TString::Format(
"h_rvzvedepW_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
111 h_zvedepT[i] =
new TH1F(TString::Format(
"h_zvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
114 h_xvzvedepT[i] =
new TH2F(TString::Format(
"h_xvzvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
117 h_yvzvedepT[i] =
new TH2F(TString::Format(
"h_yvzvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
120 h_rvzvedepT[i] =
new TH2F(TString::Format(
"h_rvzvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
123 h_xvyvedepT[i] =
new TH2F(TString::Format(
"h_xvyvedepT_%d", i),
"edep [MeV] vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
126 h_zvedepWT[i] =
new TH1F(TString::Format(
"h_zvedepWT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
129 h_xvzvedepWT[i] =
new TH2F(TString::Format(
"h_xvzvedepWT_%d", i),
"edep [MeV] vs. x vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
132 h_yvzvedepWT[i] =
new TH2F(TString::Format(
"h_yvzvedepWT_%d", i),
"edep [MeV] vs. y vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
135 h_xvyvedepWT[i] =
new TH2F(TString::Format(
"h_xvyvedepWT_%d", i),
"edep [MeV] vs. x vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
138 h_rvzvedepWT[i] =
new TH2F(TString::Format(
"h_rvzvedepWT_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
141 h_Edep =
new TH2F(
"h_Edep",
"det # # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
142 h_pxNb =
new TH2F(
"h_pxNb",
"det # # vs. nb pixel", 20, 0., 20., 1000, 0., 1000.);
143 for (
int i = 0; i < 15; i++) {
144 h_cvr[i] =
new TH2F(TString::Format(
"cvr_%d", i),
" col v. row", 80, 0., 80., 336, 0., 336.);
151 B2INFO(
"FANGSStudyModule: Initialize");
160 fctQ_Calib1 =
new TF1(
"fctQ_Calib1",
"[0]*([1]*x-[2])/([3]-x)", 0., 15.);
163 fctQ_Calib2 =
new TF1(
"fctQ_Calib2",
"[0]*([1]*x-[2])/([3]-x)", 0., 15.);
191 if (olddetNb != detNb) {
193 h_Edep->Fill(detNb, esum);
194 h_pxNb->Fill(detNb, ipix);
198 for (
int j = 0; j < maxSIZE; j++) {
212 h_cvr[detNb]->Fill(col, row);
220 for (
int i = 0; i < nSimHits; i++) {
225 double timeBin = aHit->
getTime();
228 ROOT::Math::XYZVector position = aHit->
getPosEntry();
229 double r =
sqrt(position.X() * position.X() + position.Y() * position.Y());
230 int detNB = (lad - 1) * 5 + sen - 1;
233 h_time->Fill(detNB, timeBin);
234 h_edep->Fill(detNB, adep * 1e3);
238 if (adep > 50.*1
e-6) {
245 h_zvedep[lad - 1]->Fill(position.Z());
246 h_xvzvedep[lad - 1]->Fill(position.X(), position.Z());
247 h_yvzvedep[lad - 1]->Fill(position.Y(), position.Z());
248 h_xvyvedep[lad - 1]->Fill(position.X(), position.Y());
250 h_zvedepW[lad - 1]->Fill(position.Z(), adep * 1e3);
251 h_xvzvedepW[lad - 1]->Fill(position.X(), position.Z(), adep * 1e3);
252 h_yvzvedepW[lad - 1]->Fill(position.Y(), position.Z(), adep * 1e3);
253 h_xvyvedepW[lad - 1]->Fill(position.X(), position.Y(), adep * 1e3);
254 h_rvzvedepW[lad - 1]->Fill(r, position.Z(), adep * 1e3);
255 if (adep > 50.*1
e-6) {
257 h_xvzvedepT[lad - 1]->Fill(position.X(), position.Z());
258 h_yvzvedepT[lad - 1]->Fill(position.Y(), position.Z());
259 h_xvyvedepT[lad - 1]->Fill(position.X(), position.Y());
261 h_zvedepWT[lad - 1]->Fill(position.Z(), adep * 1e3);
262 h_xvzvedepWT[lad - 1]->Fill(position.X(), position.Z(), adep * 1e3);
263 h_yvzvedepWT[lad - 1]->Fill(position.Y(), position.Z(), adep * 1e3);
264 h_xvyvedepWT[lad - 1]->Fill(position.X(), position.Y(), adep * 1e3);
265 h_rvzvedepWT[lad - 1]->Fill(r, position.Z(), adep * 1e3);
274 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"FANGS\"]/Content/");
284 m_TOTA1 = content.getDouble(
"TOTA1");
285 m_TOTB1 = content.getDouble(
"TOTB1");
286 m_TOTC1 = content.getDouble(
"TOTC1");
287 m_TOTQ1 = content.getDouble(
"TOTQ1");
288 m_TOTA2 = content.getDouble(
"TOTA2");
289 m_TOTB2 = content.getDouble(
"TOTB2");
290 m_TOTC2 = content.getDouble(
"TOTC2");
291 m_TOTQ2 = content.getDouble(
"TOTQ2");
294 m_Workfct = content.getDouble(
"Workfct");
int getPDGCode() const
PDG code.
static const ParticleType photon
photon particle
static const ChargedStable electron
electron particle
ClassFANGSHit - digitization simulated hit for the FANGS detector.
int getBCID() const
Return the BCID.
int getrow() const
Return the row.
int getTOT() const
Return the TOT.
int getdetNb() const
Return the TPC number.
int getcolumn() const
Return the column.
Class FANGSSimHit - Geant4 simulated hit for the FANGS detector.
ROOT::Math::XYZVector getPosEntry() const
Return the entry track position.
float getTime() const
Return the global time.
float getEnergyDep() const
Return the energy deposition in electrons.
int getLadder() const
Return the Ladder number (starting at 1, increasing with phi)
int getSensor() const
Return the Sensor number (starting at 1, increasing with decreasing z)
int getPDG() const
Return the PDG number of the track.
GearDir is the basic class used for accessing the parameter store.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
TH2F * h_timeThres
Time distribution with energy threshold applied.
double m_TOTC1
TOT factor C1.
double m_ChipRowY
Chip row y dimension.
TH2F * h_rvzvedepW[3]
Energy vs x vs y.
double m_TOTA1
TOT factor A1.
TH2F * h_yvzvedepWT[3]
Energy vs y vs z.
TH2F * h_edepThres1
Energy deposited above threshold per time bin.
TH2F * h_edep
Energy deposited per time bin.
TH2F * h_edep1
Energy deposited per time bin.
double m_PixelTimeBin
Pixel time bin.
TH2F * h_timeWeighted
Time distribution weighted per the energy deposited.
virtual void initialize() override
Initialize the Module.
TH2F * h_cvr[20]
col v raw
virtual void event() override
Event processor.
TH2F * h_edep3
Energy deposited per time bin.
double m_TOTB1
TOT factor B1.
TH2F * h_time
Time distribution.
virtual void endRun() override
End-of-run action.
double m_ChipColumnX
Chip column x dimension.
virtual void getXMLData()
reads data from FANGS.xml
virtual void terminate() override
Termination action.
double m_TOTQ2
TOT factor Q2.
double m_v_sensor
Drift velocity in sensor.
TH2F * h_yvzvedepT[3]
Energy vs y vs z.
TH2F * h_xvzvedepT[3]
Energy vs x vs z.
FANGSStudyModule()
Constructor: Sets the description, the properties and the parameters of the module.
TH2F * h_yvzvedep[3]
Energy vs y vs z.
TH2F * h_edep2
Energy deposited per time bin.
TH1F * h_zvedepW[3]
Energy deposited vs z.
TH2F * h_xvzvedep[3]
Energy vs x vs z.
TH2F * h_rvzvedepT[3]
Energy vs x vs y.
TH2F * h_xvyvedepWT[3]
Energy vs x vs y.
TH2F * h_Edep
Digitized energy deposited per detector.
TH1F * h_zvedepWT[3]
Energy deposited vs z.
float y[maxSIZE]
y point of the track
TH1F * h_zvedep[3]
Energy deposited vs z.
TH1F * h_zvedepT[3]
Energy deposited vs z.
double m_sensor_width
sensor width
virtual ~FANGSStudyModule()
Destructor.
virtual void beginRun() override
Called when entering a new run.
TH2F * h_rvzvedepWT[3]
Energy vs x vs y.
TH2F * h_timeWeightedThres
Time distribution weighted per the energy deposited with energy threshold applied.
double m_TOTC2
TOT factor C2.
TH2F * h_edepThres2
Energy deposited above threshold per time bin.
TH2F * h_edepThres
Energy deposited above threshold per time bin.
TH2F * h_xvyvedep[3]
Energy vs x vs y.
int m_ChipRowNb
Chip row number.
TH2F * h_rvzvedep[3]
Energy vs x vs y.
TH2F * h_yvzvedepW[3]
Energy vs y vs z.
TF1 * fctQ_Calib2
Define Q calib 2.
TH2F * h_xvzvedepW[3]
Energy vs x vs z.
int m_PixelTimeBinNb
Pixel time number of bin.
int m_ChipColumnNb
Chip column number.
double m_Workfct
Work function.
TH2F * h_xvzvedepWT[3]
Energy vs x vs z.
double m_TOTA2
TOT factor A2.
TH2F * h_pxNb
Pixel number per detector.
TF1 * fctQ_Calib1
Define Q calib 1.
TH2F * h_xvyvedepW[3]
Energy vs x vs y.
int m_PixelThresholdRMS
Pixel threshold RMS.
int m_PixelThreshold
Pixel threshold.
float e[maxSIZE]
e point of the track
float x[maxSIZE]
x point of the track
TH2F * h_xvyvedepT[3]
Energy vs x vs y.
float z[maxSIZE]
z point of the track
TH2F * h_edepThres3
Energy deposited above threshold per time bin.
virtual void defineHisto() override
Defines the histograms.
double m_TOTB2
TOT factor B2.
double m_TOTQ1
TOT factor Q1.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.