8#include <svd/modules/svdOccupancyCalibrationsCollector/SVDOccupancyCalibrationsCollectorModule.h>
28 setDescription(
"This module collects hits from shaper digits to compute per sensor SVD occupancy ");
33 addParam(
"HistogramTree",
m_tree,
"Name of the tree in which the histograms are saved", std::string(
"tree"));
44 TH1F hOccupancy768(
"Occupancy768_L@layerL@ladderS@sensor@view",
"Strip Occupancy of @layer.@ladder.@sensor @view/@side side", 768,
47 hOccupancy768.GetXaxis()->SetTitle(
"cellID");
48 TH1F hOccupancy512(
"Occupancy512_L@layerL@ladderS@sensor@view",
"Strip Occupancy of @layer.@ladder.@sensor @view/@side side", 512,
51 hOccupancy512.GetXaxis()->SetTitle(
"cellID");
61 m_hnevents =
new TH1F(
"hnevents",
"Number of events", 1, 0, 1);
74 for (
auto ladder : geoCache.getLadders(layer)) {
102 while (i < nDigits) {
125 B2RESULT(
"number of events " << nevents);
129 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
131 while ((itSvdLayers != svdLayers.end())
132 && (itSvdLayers->getLayerNumber() != 7)) {
134 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
135 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
137 while (itSvdLadders != svdLadders.end()) {
139 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
140 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
142 while (itSvdSensors != svdSensors.end()) {
144 for (
int k = 0; k <
m_nSides; k ++) {
147 B2INFO(
"occupancy histo scaled by the number of events");
149 m_layer = itSvdSensors->getLayerNumber();
150 m_ladder = itSvdSensors->getLadderNumber();
151 m_sensor = itSvdSensors->getSensorNumber();
154 getObjectPtr<TTree>(
"HTreeOccupancyCalib")->Fill();
Calibration collector module base class.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
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
void prepare() override final
Initialize the module.
TH1F * m_hist
pointer to occupancy histogram
StoreArray< SVDShaperDigit > m_storeDigits
shaper digits store array
int m_ladder
SVD ladder identifier.
SVDHistograms< TH1F > * hm_occupancy
SVDHistograms.
int m_side
SVD side identifier.
int m_sensor
SVD sensor identifier.
std::string m_svdShaperDigitName
SVDShaperDigits.
static const int m_nSides
number of sides
StoreObjPtr< EventMetaData > m_eventMetaData
EventMetaData.
void closeRun() override final
End-of-run action.
void collect() override final
Event processor.
SVDOccupancyCalibrationsCollectorModule()
Constructor.
TH1F * m_hnevents
first bin of the histogram is counting the processed events
void finish() override
Termination action.
int m_layer
SVD layer identifier.
TTree * m_histogramTree
tree containing as events the histograms per layer, ladder, sensor, side
void startRun() override final
Called when entering a new run.
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Class to uniquely identify a any structure of the PXD and SVD.
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.