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