9#include <svd/modules/svdPerformance/SVDOccupancyAnalysisModule.h>
10#include <hlt/softwaretrigger/core/FinalTriggerDecisionCalculator.h>
16using namespace SoftwareTrigger;
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"));
28 addParam(
"groupNevents",
m_group,
"Number of events to group",
float(10000));
30 "FADC mode: if true the approximation to integer is done",
bool(
false));
57 m_occ_L3U->GetXaxis()->SetTitle(
"occupancy(%)");
59 m_occ_L3V->GetXaxis()->SetTitle(
"occupancy(%)");
61 m_occ_L4U->GetXaxis()->SetTitle(
"occupancy(%)");
63 m_occ_L4V->GetXaxis()->SetTitle(
"occupancy(%)");
65 m_occ_L5U->GetXaxis()->SetTitle(
"occupancy(%)");
67 m_occ_L5V->GetXaxis()->SetTitle(
"occupancy(%)");
69 m_occ_L6U->GetXaxis()->SetTitle(
"occupancy(%)");
71 m_occ_L6V->GetXaxis()->SetTitle(
"occupancy(%)");
78 for (
VxdID& aVxdID : sensors) {
87 TH1F h_dist(
"dist_L@layerL@ladderS@sensor@view",
88 "Occupancy Distribution (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
90 h_dist.GetXaxis()->SetTitle(
"occupancy (%)");
93 TH1F h_occ_768(
"occ768_L@layerL@ladderS@sensor@view",
"Occupancy (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
95 h_occ_768.GetXaxis()->SetTitle(
"cellID");
96 TH1F h_occ_512(
"occ512_L@layerL@ladderS@sensor@view",
"Occupancy (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
98 h_occ_512.GetXaxis()->SetTitle(
"cellID");
102 TH1F h_zsVSocc(
"occVSzs_L@layerL@ladderS@sensor@view",
103 "Average Occupancy VS Zero Suppression (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
m_pointsZS,
m_minZS,
105 h_zsVSocc.GetXaxis()->SetTitle(
"ZS cut");
109 TH1F h_zsVSoccSQ(
"zsVSoccSQ_L@layerL@ladderS@sensor@view",
110 "Average Occupancy VS (ZS cut)^2 (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)", 100, TMath::Power(
m_minZS,
111 2) - 5, TMath::Power(
m_maxZS, 2));
112 h_zsVSoccSQ.GetXaxis()->SetTitle(
"(ZS cut)^2");
116 TH2F h_occtdep_768(
"occ768VSevt_L@layerL@ladderS@sensor@view",
117 "Average Occupancy VS Event Number (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
118 1000, 0, 1000, 768, 0, 768);
119 h_occtdep_768.GetXaxis()->SetTitle(Form(
"evt number/%1.0f",
m_group));
120 h_occtdep_768.GetYaxis()->SetTitle(
"cellID");
122 TH2F h_occtdep_512(
"occ512VSevt_L@layerL@ladderS@sensor@view",
123 "Average Occupancy VS Event Number (layer @layer, ladder @ladder, sensor @sensor, side@view/@side)",
124 1000, 0, 1000, 512, 0, 512);
125 h_occtdep_512.GetXaxis()->SetTitle(Form(
"evt number/%1.0f",
m_group));
126 h_occtdep_512.GetYaxis()->SetTitle(
"cellID");
137 if (!eventAccepted)
return;
144 for (
int digi = 0 ; digi <
m_svdShapers.getEntries(); digi++) {
162 float cutMinSignal = (
m_minZS + step * z) * noise;
165 cutMinSignal = cutMinSignal + 0.5;
166 cutMinSignal = (int)cutMinSignal;
172 for (
int k = 0; k < 6; k ++)
173 if (samples_vec[k] > cutMinSignal)
176 if (nOKSamples > 0) {
185 for (
unsigned int i = 0; i <
m_SVDModules.size(); i++) {
187 float nStripsV = 512;
228 TDirectory* oldDir = gDirectory;
242 TString layerName = Form(
"occupancyL%d", layer.getLayerNumber());
243 TDirectory* dir_layer = oldDir->mkdir(layerName.Data());
245 for (
auto ladder : geoCache.getLadders(layer))
void setDescription(const std::string &description)
Sets the description of the module.
template class for SVd histograms
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
check StoreArrays & create rootfile
TH1F * m_occ_L4V
occupancy distribution for L4 V-side sensors
virtual void event() override
fill histograms
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
write histogrmas
SVDOccupancyAnalysisModule()
constructor
float m_group
number of events to compute occupancy for occ VS time
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
create histograms
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
static bool getFinalTriggerDecision(const SoftwareTriggerResult &result, bool forgetTotalResult=false)
Calculate the final cut decision using all "total_results" of all sub triggers in the software trigge...
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.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.