9#include <svd/modules/svdCalibration/SVDChannelMappingModule.h>
10#include <vxd/geometry/GeoCache.h>
28 , hInterDictionary(172, [](const
Belle2::
VxdID & vxdid) {
return (
size_t)vxdid.getID(); })
35 addParam(
"outputFileName",
m_rootFileName,
"Name of output root file.", std::string(
"SVDChannelMapping.root"));
38 "name of the list of SVDShaperDigits", std::string(
""));
41 "name of the list of SVDClusters", std::string(
""));
44 "name of the list of interceptions", std::string(
""));
91 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
93 while (itSvdLayers != svdLayers.end()) {
96 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
98 while (itSvdLadders != svdLadders.end()) {
101 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
103 while (itSvdSensors != svdSensors.end()) {
105 string sensorid = std::to_string(itSvdSensors->getLayerNumber()) +
"_" + std::to_string(itSvdSensors->getLadderNumber()) +
"_" +
106 std::to_string(itSvdSensors->getSensorNumber());
112 name =
"hCoorU_" + sensorid;
113 title =
"U coordinate of the extrapolation in U for sensor " + sensorid;
114 tmp1D =
new TH1F(name.c_str(), title.c_str(), 100, -2.9, 2.9);
126 name =
"hCoorV_" + sensorid;
127 title =
"V coordinate of the extrapolation in V for sensor " + sensorid;
128 tmp1D =
new TH1F(name.c_str(), title.c_str(), 100, -6.15, 6.15);
141 name =
"hCoorU_vs_CoorV_" + sensorid;
142 title =
"U vs V intercept (cm) " + sensorid;
143 tmp2D =
new TH2F(name.c_str(), title.c_str(), 100, -2.9, 2.9, 100, -6.15, 6.15);
144 tmp2D->GetXaxis()->SetTitle(
"intercept U coor (cm)");
145 tmp2D->GetYaxis()->SetTitle(
"intercept V coor (cm)");
158 name =
"hStatErrU_" + sensorid;
159 title =
"stat error of the extrapolation in U for sensor " + sensorid;
160 tmp1D =
new TH1F(name.c_str(), title.c_str(), 100, 0, 0.35);
172 name =
"hStatErrV_" + sensorid;
173 title =
"stat error of the extrapolation in V for sensor " + sensorid;
174 tmp1D =
new TH1F(name.c_str(), title.c_str(), 100, 0, 0.35);
189 name =
"hDigitResidU_" + sensorid;
190 title =
"U residuals = intercept - digit, for sensor " + sensorid;
191 tmp1D =
new TH1F(name.c_str(), title.c_str(), 1000, -2.9, 2.9);
200 for (
auto& it : SVDShaperDigits)
201 if ((
int)it.getSensorID() == (
int)inter->
getSensorID()) {
214 name =
"hDigitResidV_" + sensorid;
215 title =
"V residuals = intercept - digit, for sensor " + sensorid;
216 tmp1D =
new TH1F(name.c_str(), title.c_str(), 1000, -6.15, 6.15);
225 for (
auto& it : SVDShaperDigits)
226 if ((
int)it.getSensorID() == (
int)inter->
getSensorID()) {
227 if (!it.isUStrip()) {
239 name =
"hDigitResidU_vs_DigitU_" + sensorid;
240 title =
"U residual (cm) vs digit U (cm) " + sensorid;
241 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -2.9, 2.9, 1000, -2.9, 2.9);
242 tmp2D->GetYaxis()->SetTitle(
"U resid (cm)");
243 tmp2D->GetXaxis()->SetTitle(
"U digit (cm)");
252 for (
auto& it : SVDShaperDigits)
253 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && it.isUStrip()) {
264 name =
"hDigitResidV_vs_DigitV_" + sensorid;
265 title =
"V residual (cm) vs digit V (cm) " + sensorid;
266 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -6.15, 6.15, 1000, -6.15, 6.15);
267 tmp2D->GetYaxis()->SetTitle(
"V resid (cm)");
268 tmp2D->GetXaxis()->SetTitle(
"V digit (cm)");
277 for (
auto& it : SVDShaperDigits)
278 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && (!it.isUStrip())) {
291 name =
"hCoorU_vs_DigitU_" + sensorid;
292 title =
"U intercept (cm) vs U digit (cm) " + sensorid;
293 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -2.9, 2.9, 1000, -2.9, 2.9);
294 tmp2D->GetXaxis()->SetTitle(
"intercept U coor (cm)");
295 tmp2D->GetYaxis()->SetTitle(
"digit U coor (cm)");
304 for (
auto& it : SVDShaperDigits)
305 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && (it.isUStrip())) {
315 name =
"hCoorV_vs_DigitV_" + sensorid;
316 title =
"V intercept (cm) vs V digit (ID) " + sensorid;
317 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -6.15, 6.15, 1000, -6.15, 6.15);
318 tmp2D->GetXaxis()->SetTitle(
"intercept V coor (cm)");
319 tmp2D->GetYaxis()->SetTitle(
"digi V coor (cm)");
328 for (
auto& it : SVDShaperDigits) {
329 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && (!it.isUStrip())) {
343 name =
"hClusterResidU_" + sensorid;
344 title =
"U residuals = intercept - cluster, for sensor " + sensorid;
345 tmp1D =
new TH1F(name.c_str(), title.c_str(), 1000, -2.9, 2.9);
354 for (
auto& it : SVDClusters)
355 if ((
int)it.getSensorID() == (
int)inter->
getSensorID()) {
356 if (it.isUCluster()) {
357 hPtr->Fill(inter->
getCoorU() - it.getPosition());
367 name =
"hClusterResidV_" + sensorid;
368 title =
"V residuals = intercept - cluster, for sensor " + sensorid;
369 tmp1D =
new TH1F(name.c_str(), title.c_str(), 1000, -6.15, 6.15);
378 for (
auto& it : SVDClusters)
379 if ((
int)it.getSensorID() == (
int)inter->
getSensorID()) {
380 if (!it.isUCluster()) {
381 hPtr->Fill(inter->
getCoorV() - it.getPosition());
391 name =
"hClusterResidU_vs_ClusterU_" + sensorid;
392 title =
"U residual (cm) vs cluster U (cm) " + sensorid;
393 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -2.9, 2.9, 1000, -2.9, 2.9);
394 tmp2D->GetYaxis()->SetTitle(
"U resid (cm)");
395 tmp2D->GetXaxis()->SetTitle(
"U cluster (cm)");
404 for (
auto& it : SVDClusters)
405 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && it.isUCluster()) {
406 double resid = inter->
getCoorU() - it.getPosition();
407 hPtr->Fill(it.getPosition(), resid);
415 name =
"hClusterResidV_vs_ClusterV_" + sensorid;
416 title =
"V residual (cm) vs cluster V (cm) " + sensorid;
417 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -6.15, 6.15, 1000, -6.15, 6.15);
418 tmp2D->GetYaxis()->SetTitle(
"V resid (cm)");
419 tmp2D->GetXaxis()->SetTitle(
"V cluster (cm)");
428 for (
auto& it : SVDClusters)
429 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && (!it.isUCluster())) {
430 double resid = inter->
getCoorV() - it.getPosition();
431 hPtr->Fill(it.getPosition(), resid);
441 name =
"hCoorU_vs_ClusterU_" + sensorid;
442 title =
"U intercept (cm) vs U cluster (cm) " + sensorid;
443 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -2.9, 2.9, 1000, -2.9, 2.9);
444 tmp2D->GetXaxis()->SetTitle(
"intercept U coor (cm)");
445 tmp2D->GetYaxis()->SetTitle(
"cluster U coor (cm)");
454 for (
auto& it : SVDClusters)
455 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && (it.isUCluster())) {
456 hPtr->Fill(inter->
getCoorU(), it.getPosition());
464 name =
"hCoorV_vs_ClusterV_" + sensorid;
465 title =
"V intercept (cm) vs V cluster (ID) " + sensorid;
466 tmp2D =
new TH2F(name.c_str(), title.c_str(), 1000, -6.15, 6.15, 1000, -6.15, 6.15);
467 tmp2D->GetXaxis()->SetTitle(
"intercept V coor (cm)");
468 tmp2D->GetYaxis()->SetTitle(
"cluster V coor (cm)");
477 for (
auto& it : SVDClusters) {
478 if (((
int)it.getSensorID() == (
int)inter->
getSensorID()) && (!it.isUCluster())) {
479 hPtr->Fill(inter->
getCoorV(), it.getPosition());
502 for (
auto it = its.first; it != its.second; ++it) {
504 aInterHistoAndFill.second(aInterHistoAndFill.first, inter);
516 TDirectory* oldDir = gDirectory;
519 TDirectory* dir_digits = oldDir->mkdir(
"digits");
522 while ((obj = nextH_digits()))
525 TDirectory* dir_clusters = oldDir->mkdir(
"clusters");
528 while ((obj = nextH_clusters()))
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...
std::string m_rootFileName
root file name
std::unordered_multimap< Belle2::VxdID, InterHistoAndFill, std::function< size_t(const Belle2::VxdID &)> > hInterDictionary
map of histograms to be filled once per intercept
std::pair< TH1 *, std::function< void(TH1 *, const SVDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
std::string m_InterceptsName
Name of the SVDIntercept StoreArray.
VXD::GeoCache & m_aGeometry
the geometry
int n_events
number of events
void initialize() override
initialize
void fillSensorInterHistos(const SVDIntercept *inter)
fill histograms per sensor, filled once per intercept
void createHistosDictionaries()
create the dictionary
std::string m_SVDClustersName
reco digit list name
StoreArray< SVDShaperDigit > m_shapers
SVDSHaperDigits StoreArray.
void event() override
event
TList * m_histoList_clusters
list of histograms for the clusters
void terminate() override
temrinate
StoreArray< SVDCluster > m_clusters
SVDClusters StoreArray.
SVDChannelMappingModule()
Constructor defining the parameters.
TList * m_histoList_digits
list of histograms for the strips
StoreArray< SVDIntercept > m_Intercepts
SVDintercept StoreArray.
TFile * m_rootFilePtr
pointer at root file used for storing histograms
std::string m_SVDShaperDigitsName
shaper digit list name
SVDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an SVD ...
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
double getSigmaV() const
return the statistical error on the V coordinate of the intercept
double getCoorV() const
return the V coordinate of the intercept
double getSigmaU() const
return the statistical error on the U coordinate of the intercept
VxdID::baseType getSensorID() const
return the sensor ID
double getCoorU() const
return the U coordinate of the intercept
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Base class to provide Sensor Information for PXD and SVD.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
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.