8#include <svd/modules/svdOccupancyCalibrationsCollector/SVDOccupancyCalibrationsCollectorModule.h>
9#include <hlt/softwaretrigger/core/FinalTriggerDecisionCalculator.h>
29 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"));
45 TH1F hOccupancy768(
"Occupancy768_L@layerL@ladderS@sensor@view",
"Strip Occupancy of @layer.@ladder.@sensor @view/@side side", 768,
48 hOccupancy768.GetXaxis()->SetTitle(
"cellID");
49 TH1F hOccupancy512(
"Occupancy512_L@layerL@ladderS@sensor@view",
"Strip Occupancy of @layer.@ladder.@sensor @view/@side side", 512,
52 hOccupancy512.GetXaxis()->SetTitle(
"cellID");
62 m_hnevents =
new TH1F(
"hnevents",
"Number of events", 3, 0, 2);
76 for (
auto ladder : geoCache.getLadders(layer)) {
78 for (
int view = SVDHistograms<TH2F>::VIndex ; view < SVDHistograms<TH2F>::UIndex + 1; view++) {
95 if (!eventAccepted)
return;
106 while (i < nDigits) {
128 B2RESULT(
"number of events " << nevents);
132 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
133 while ((itSvdLayers != svdLayers.end())
134 && (itSvdLayers->getLayerNumber() != 7)) {
136 std::set<Belle2::VxdID> svdLadders = aGeometry.
getLadders(*itSvdLayers);
137 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
139 while (itSvdLadders != svdLadders.end()) {
141 std::set<Belle2::VxdID> svdSensors = aGeometry.
getSensors(*itSvdLadders);
142 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
144 while (itSvdSensors != svdSensors.end()) {
146 for (
int k = 0; k <
m_nSides; k ++) {
149 m_layer = itSvdSensors->getLayerNumber();
150 m_ladder = itSvdSensors->getLadderNumber();
151 m_sensor = itSvdSensors->getSensorNumber();
void registerObject(std::string name, T *obj)
Register object with a name, takes ownership, do not access the pointer beyond prepare()
CalibrationCollectorModule()
Constructor. Sets the default prefix for calibration dataobjects.
T * getObjectPtr(std::string name)
Calls the CalibObjManager to get the requested stored collector data.
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 prepare() override final
Initialize the module.
TH1F * m_hist
pointer to occupancy histogram
StoreArray< SVDShaperDigit > m_storeDigits
shaper digits store array
bool m_skipRejectedEvents
if true skip events rejected by HLT (default)
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.
StoreObjPtr< SoftwareTriggerResult > m_resultStoreObjectPointer
Store Object for reading the trigger decision.
TTree * m_histogramTree
tree containing as events the histograms per layer, ladder, sensor, side
void startRun() override final
Called when entering a new run.
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 facilitate easy access to sensor information of the VXD like coordinate transformations or p...
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.