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>
22#include <Math/Vector3D.h>
56 h_time =
new TH2F(
"h_time",
"Detector # vs. time", 20, 0., 20., 1000, 0., 750.);
58 h_timeWeighted =
new TH2F(
"h_timeWeigthed",
"Detector # vs. time weighted by the energy deposited", 20, 0., 20., 1000, 0., 750.);
60 h_timeThres =
new TH2F(
"h_timeThres",
"Detector # vs. time", 20, 0., 20., 750, 0., 750.);
62 h_timeWeightedThres =
new TH2F(
"h_timeWeigthedThres",
"Detector # vs. time weighted by the energy deposited", 20, 0., 20., 750, 0.,
65 h_edep =
new TH2F(
"h_edep",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
67 h_edep1 =
new TH2F(
"h_edep1",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
69 h_edep2 =
new TH2F(
"h_edep2",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
71 h_edep3 =
new TH2F(
"h_edep3",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
74 h_edepThres =
new TH2F(
"h_edepThres",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
76 h_edepThres1 =
new TH2F(
"h_edepThres1",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
78 h_edepThres2 =
new TH2F(
"h_edepThres2",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
80 h_edepThres3 =
new TH2F(
"h_edepThres3",
"Time bin # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
82 for (
int i = 0; i < 3; i++) {
83 h_zvedep[i] =
new TH1F(TString::Format(
"h_zvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
86 h_xvzvedep[i] =
new TH2F(TString::Format(
"h_xvzvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
89 h_yvzvedep[i] =
new TH2F(TString::Format(
"h_yvzvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
92 h_rvzvedep[i] =
new TH2F(TString::Format(
"h_rvzvedep_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
95 h_xvyvedep[i] =
new TH2F(TString::Format(
"h_xvyvedep_%d", i),
"edep [MeV] vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
98 h_zvedepW[i] =
new TH1F(TString::Format(
"h_zvedepW_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
101 h_xvzvedepW[i] =
new TH2F(TString::Format(
"h_xvzvedepW_%d", i),
"edep [MeV] vs. x vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
104 h_yvzvedepW[i] =
new TH2F(TString::Format(
"h_yvzvedepW_%d", i),
"edep [MeV] vs. y vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
107 h_xvyvedepW[i] =
new TH2F(TString::Format(
"h_xvyvedepW_%d", i),
"edep [MeV] vs. x vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
110 h_rvzvedepW[i] =
new TH2F(TString::Format(
"h_rvzvedepW_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
114 h_zvedepT[i] =
new TH1F(TString::Format(
"h_zvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
117 h_xvzvedepT[i] =
new TH2F(TString::Format(
"h_xvzvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
120 h_yvzvedepT[i] =
new TH2F(TString::Format(
"h_yvzvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
123 h_rvzvedepT[i] =
new TH2F(TString::Format(
"h_rvzvedepT_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
126 h_xvyvedepT[i] =
new TH2F(TString::Format(
"h_xvyvedepT_%d", i),
"edep [MeV] vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
129 h_zvedepWT[i] =
new TH1F(TString::Format(
"h_zvedepWT_%d", i),
"edep [MeV] vs. z [cm]", 2000, -25., 25.);
132 h_xvzvedepWT[i] =
new TH2F(TString::Format(
"h_xvzvedepWT_%d", i),
"edep [MeV] vs. x vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
135 h_yvzvedepWT[i] =
new TH2F(TString::Format(
"h_yvzvedepWT_%d", i),
"edep [MeV] vs. y vs. z [cm]", 2000, -25., 25., 2000, -25., 25.);
138 h_xvyvedepWT[i] =
new TH2F(TString::Format(
"h_xvyvedepWT_%d", i),
"edep [MeV] vs. x vs. y [cm]", 2000, -25., 25., 2000, -25., 25.);
141 h_rvzvedepWT[i] =
new TH2F(TString::Format(
"h_rvzvedepWT_%d", i),
"edep [MeV] vs. z [cm]", 2000, 0., 25., 2000, -25., 25.);
144 h_Edep =
new TH2F(
"h_Edep",
"det # # vs. energy deposited", 20, 0., 20., 1000, 0., 10.);
145 h_pxNb =
new TH2F(
"h_pxNb",
"det # # vs. nb pixel", 20, 0., 20., 1000, 0., 1000.);
146 for (
int i = 0; i < 15; i++) {
147 h_cvr[i] =
new TH2F(TString::Format(
"cvr_%d", i),
" col v. row", 80, 0., 80., 336, 0., 336.);
154 B2INFO(
"FANGSStudyModule: Initialize");
163 fctQ_Calib1 =
new TF1(
"fctQ_Calib1",
"[0]*([1]*x-[2])/([3]-x)", 0., 15.);
166 fctQ_Calib2 =
new TF1(
"fctQ_Calib2",
"[0]*([1]*x-[2])/([3]-x)", 0., 15.);
194 if (olddetNb != detNb) {
196 h_Edep->Fill(detNb, esum);
197 h_pxNb->Fill(detNb, ipix);
201 for (
int j = 0; j < maxSIZE; j++) {
215 h_cvr[detNb]->Fill(col, row);
223 for (
int i = 0; i < nSimHits; i++) {
228 double timeBin = aHit->
getTime();
231 ROOT::Math::XYZVector position = aHit->
getPosEntry();
232 double r =
sqrt(position.X() * position.X() + position.Y() * position.Y());
233 int detNB = (lad - 1) * 5 + sen - 1;
236 h_time->Fill(detNB, timeBin);
237 h_edep->Fill(detNB, adep * 1e3);
241 if (adep > 50.*1
e-6) {
248 h_zvedep[lad - 1]->Fill(position.Z());
249 h_xvzvedep[lad - 1]->Fill(position.X(), position.Z());
250 h_yvzvedep[lad - 1]->Fill(position.Y(), position.Z());
251 h_xvyvedep[lad - 1]->Fill(position.X(), position.Y());
253 h_zvedepW[lad - 1]->Fill(position.Z(), adep * 1e3);
254 h_xvzvedepW[lad - 1]->Fill(position.X(), position.Z(), adep * 1e3);
255 h_yvzvedepW[lad - 1]->Fill(position.Y(), position.Z(), adep * 1e3);
256 h_xvyvedepW[lad - 1]->Fill(position.X(), position.Y(), adep * 1e3);
257 h_rvzvedepW[lad - 1]->Fill(r, position.Z(), adep * 1e3);
258 if (adep > 50.*1
e-6) {
260 h_xvzvedepT[lad - 1]->Fill(position.X(), position.Z());
261 h_yvzvedepT[lad - 1]->Fill(position.Y(), position.Z());
262 h_xvyvedepT[lad - 1]->Fill(position.X(), position.Y());
264 h_zvedepWT[lad - 1]->Fill(position.Z(), adep * 1e3);
265 h_xvzvedepWT[lad - 1]->Fill(position.X(), position.Z(), adep * 1e3);
266 h_yvzvedepWT[lad - 1]->Fill(position.Y(), position.Z(), adep * 1e3);
267 h_xvyvedepWT[lad - 1]->Fill(position.X(), position.Y(), adep * 1e3);
268 h_rvzvedepWT[lad - 1]->Fill(r, position.Z(), adep * 1e3);
277 GearDir content =
GearDir(
"/Detector/DetectorComponent[@name=\"FANGS\"]/Content/");
287 m_TOTA1 = content.getDouble(
"TOTA1");
288 m_TOTB1 = content.getDouble(
"TOTB1");
289 m_TOTC1 = content.getDouble(
"TOTC1");
290 m_TOTQ1 = content.getDouble(
"TOTQ1");
291 m_TOTA2 = content.getDouble(
"TOTA2");
292 m_TOTB2 = content.getDouble(
"TOTB2");
293 m_TOTC2 = content.getDouble(
"TOTC2");
294 m_TOTQ2 = content.getDouble(
"TOTQ2");
297 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.