 |
Belle II Software
release-05-02-19
|
11 #include <svd/modules/svdPerformance/SVDOccupancyAnalysisModule.h>
12 #include <hlt/softwaretrigger/core/FinalTriggerDecisionCalculator.h>
18 using namespace SoftwareTrigger;
22 SVDOccupancyAnalysisModule::SVDOccupancyAnalysisModule() :
Module()
25 setDescription(
"This module check performances of SVD reconstruction of VXD TB data");
27 addParam(
"outputFileName",
m_rootFileName,
"Name of output root file.", std::string(
"SVDOccupancyAnalysis_output.root"));
30 addParam(
"groupNevents", m_group,
"Number of events to group",
float(10000));
32 "FADC mode: if true the approximation to integer is done",
bool(
false));
33 addParam(
"minZScut", m_minZS,
"Minimum ZS cut",
float(3));
34 addParam(
"maxZScut", m_maxZS,
"Maximum ZS cut",
float(6));
35 addParam(
"pointsZScut", m_pointsZS,
"Number of ZS cuts",
int(8));
37 addParam(
"ShaperDigitsName", m_ShaperDigitName,
"Name of ShaperDigit Store Array.", std::string(
""));
40 SVDOccupancyAnalysisModule::~SVDOccupancyAnalysisModule()
64 m_occ_L3U->GetXaxis()->SetTitle(
"occupancy(%)");
66 m_occ_L3V->GetXaxis()->SetTitle(
"occupancy(%)");
68 m_occ_L4U->GetXaxis()->SetTitle(
"occupancy(%)");
70 m_occ_L4V->GetXaxis()->SetTitle(
"occupancy(%)");
72 m_occ_L5U->GetXaxis()->SetTitle(
"occupancy(%)");
74 m_occ_L5V->GetXaxis()->SetTitle(
"occupancy(%)");
76 m_occ_L6U->GetXaxis()->SetTitle(
"occupancy(%)");
78 m_occ_L6V->GetXaxis()->SetTitle(
"occupancy(%)");
85 for (
VxdID& aVxdID : sensors) {
94 TH1F h_dist(
"dist_L@layerL@ladderS@sensor@view",
95 "Occupancy Distribution (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
97 h_dist.GetXaxis()->SetTitle(
"occupancy (%)");
100 TH1F h_occ_768(
"occ768_L@layerL@ladderS@sensor@view",
"Occupancy (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
102 h_occ_768.GetXaxis()->SetTitle(
"cellID");
103 TH1F h_occ_512(
"occ512_L@layerL@ladderS@sensor@view",
"Occupancy (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
105 h_occ_512.GetXaxis()->SetTitle(
"cellID");
109 TH1F h_zsVSocc(
"occVSzs_L@layerL@ladderS@sensor@view",
110 "Average Occupancy VS Zero Suppression (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
m_pointsZS,
m_minZS,
112 h_zsVSocc.GetXaxis()->SetTitle(
"ZS cut");
116 TH1F h_zsVSoccSQ(
"zsVSoccSQ_L@layerL@ladderS@sensor@view",
117 "Average Occupancy VS (ZS cut)^2 (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)", 100, TMath::Power(
m_minZS,
118 2) - 5, TMath::Power(m_maxZS, 2));
119 h_zsVSoccSQ.GetXaxis()->SetTitle(
"(ZS cut)^2");
123 TH2F h_occtdep_768(
"occ768VSevt_L@layerL@ladderS@sensor@view",
124 "Average Occupancy VS Event Number (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
125 1000, 0, 1000, 768, 0, 768);
126 h_occtdep_768.GetXaxis()->SetTitle(Form(
"evt number/%1.0f",
m_group));
127 h_occtdep_768.GetYaxis()->SetTitle(
"cellID");
129 TH2F h_occtdep_512(
"occ512VSevt_L@layerL@ladderS@sensor@view",
130 "Average Occupancy VS Event Number (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
131 1000, 0, 1000, 512, 0, 512);
132 h_occtdep_512.GetXaxis()->SetTitle(Form(
"evt number/%1.0f",
m_group));
133 h_occtdep_512.GetYaxis()->SetTitle(
"cellID");
144 if (!eventAccepted)
return;
151 for (
int digi = 0 ; digi <
m_svdShapers.getEntries(); digi++) {
169 float cutMinSignal = (
m_minZS + step * z) * noise;
172 cutMinSignal = cutMinSignal + 0.5;
173 cutMinSignal = (int)cutMinSignal;
179 for (
int k = 0; k < 6; k ++)
180 if (samples_vec[k] > cutMinSignal)
183 if (nOKSamples > 0) {
192 for (
unsigned int i = 0; i <
m_SVDModules.size(); i++) {
194 float nStripsV = 512;
241 TDirectory* oldDir = gDirectory;
255 TString layerName = Form(
"occupancyL%d", layer.getLayerNumber());
256 TDirectory* dir_layer = oldDir->mkdir(layerName.Data());
258 for (
auto ladder : geoCache.getLadders(layer))
bool m_skipRejectedEvents
if true skip events rejected by HLT
bool m_skipRejectedEvents
if true skip events rejected by HLT
std::vector< VxdID > m_SVDModules
IDs of all SVD Modules to iterate over.
float m_distr_max
max of occupancy distributions
Class to uniquely identify a any structure of the PXD and SVD.
std::string m_ShaperDigitName
ShaperDigit StoreArray name.
float m_group
number of events to comput occupancy for occ VS time
void setDescription(const std::string &description)
Sets the description of the module.
StoreArray< SVDShaperDigit > m_svdShapers
SVDShaperDigit StoreArray.
TH1F * m_occ_L4V
occupancy distribution for L4 V-side sensors
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
SVDHistograms< TH1F > * m_histo_dist
occupancy distribution histograms
TH2F * getHistogram(int view)
get a reference to the histogram for
StoreObjPtr< SoftwareTriggerResult > m_resultStoreObjectPointer
if true, ZS done with same algorithm as on FADC
int m_nEvents
number of events
virtual void beginRun() override
Called when entering a new run.
SVDHistograms< TH2F > * m_histo_occtdep
occupancy VS event number
float m_minZS
minimum zero suppresion cut
Base class to provide Sensor Information for PXD and SVD.
void fill(int layer, int ladder, int sensor, int view, float value)
fill the histogram for
TH1F * m_occ_L3U
occupancy distribution for L3 U-side sensors
virtual void terminate() override
This method is called at the end of the event processing.
TH1F * m_occ_L5V
occupancy distribution for L5 V-side sensors
const std::vector< VxdID > getListOfSensors() const
Get list of all sensors.
std::string m_rootFileName
root file name
SVDHistograms< TH1F > * m_histo_occ
occupancy histograms
std::array< APVFloatSampleType, c_nAPVSamples > APVFloatSamples
array of APVFloatSampleType objects
unsigned short baseType
The base integer type for VxdID.
SVDSummaryPlots * m_hit
hit number summary histogram
TH1F * m_occ_L5U
occupancy distribution for L5 U-side sensors
std::string m_rootFileName
root file name
virtual void event() override
This method is the core of the module.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Abstract base class for different kinds of events.
TH1F * m_occ_L4U
occupancy distribution for L4 U-side sensors
float m_distr_Nbins
number of bins of occupancy distributions
virtual void endRun() override
This method is called if the current run ends.
float m_distr_min
min of occupancy distributions
SVDHistograms< TH1F > * m_histo_zsOcc
occupancy VS ZScut histograms
class to summarize SVD quantities per sensor and side
TH1F * m_occ_L6U
occupancy distribution for L6 U-side sensors
void fill(const VxdID &vxdID, int view, Types ... args)
fill the histogram for
int m_pointsZS
max zero suppression cut
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
float getNoise(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the noise.
H * getHistogram(const VxdID &vxdID, int view)
get a reference to the histogram for
TH1F * m_occ_L6V
occupancy distribution for L6 V-side sensors
TFile * m_rootFilePtr
pointer at root file used for storing histograms
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
virtual void initialize() override
Initialize the Module.
SVDHistograms< TH1F > * m_histo_zsOccSQ
occupancy VS ZS cut swuared histograms
TH1F * m_occ_L3V
occupancy distribution for L3 V-side sensors
StoreObjPtr< EventMetaData > m_eventMetaData
Event Meta Data StoreObjectPointer.
SVDNoiseCalibrations m_NoiseCal
SVDNoise calibrations db object.
float getValue(const VxdID &vxdID, int view)
get the value contained in the corresponding bin, given VxdID and view