12#include <framework/core/Module.h>
13#include <framework/database/DBObjPtr.h>
14#include <framework/datastore/StoreArray.h>
17#include <vxd/dataobjects/VxdID.h>
18#include <svd/dbobjects/SVDRecoConfiguration.h>
19#include <svd/dbobjects/SVDTimeGroupingConfiguration.h>
20#include <svd/dataobjects/SVDCluster.h>
39 typedef std::tuple<double, double, double>
GroupInfo;
70 virtual void event()
override;
164 inline double myGaus(
const double* x,
const double* par)
166 return par[0] * TMath::Gaus(x[0], par[1], par[2],
true);
175 const double& integral,
const double& center,
const double& sigma,
176 const double& sigmaN,
const bool& isAddition =
true)
178 int startBin = hist.FindBin(center - sigmaN * sigma);
179 int endBin = hist.FindBin(center + sigmaN * sigma);
180 if (startBin < 1) startBin = 1;
181 if (endBin > (hist.GetNbinsX())) endBin = hist.GetNbinsX();
183 for (
int ijx = startBin; ijx <= endBin; ijx++) {
184 double tbinc = hist.GetBinCenter(ijx);
185 double tbincontent = hist.GetBinContent(ijx);
187 if (isAddition) tbincontent += integral * TMath::Gaus(tbinc, center, sigma,
true);
188 else tbincontent -= integral * TMath::Gaus(tbinc, center, sigma,
true);
190 hist.SetBinContent(ijx, tbincontent);
200 const double& integral,
const double& center,
const double& sigma,
201 const double& sigmaN)
Class for accessing objects in the database.
Imports Clusters of the SVD detector and converts them to spacePoints.
bool m_useParamFromDB
if true use the configuration from SVDTimeGroupingConfiguration DB.
std::string m_svdClustersName
SVDCluster collection name.
SVDTimeGroupingParameters m_usedParsIn3Samples
module parameter values for 3-sample DAQ taken from SVDTimeGroupingConfiguration dbobject.
SVDTimeGroupingParameters m_usedPars
module parameter values used.
virtual void initialize() override
Init the module.
StoreArray< SVDCluster > m_svdClusters
the storeArray for svdClusters as member, is faster than recreating link for each event
virtual void event() override
EventWise jobs.
SVDTimeGroupingParameters m_usedParsIn6Samples
module parameter values for 6-sample DAQ taken from SVDTimeGroupingConfiguration dbobject.
void resizeToMaxSize(std::vector< GroupInfo > &groupInfoVector)
increase the size of vector to max, this helps in sorting
void sortBackgroundGroups(std::vector< GroupInfo > &groupInfoVector)
Sort Background Groups.
bool m_forceGroupingFromDB
if true use configuration from the SVDRecConfiguration DB.
void beginRun() override
configure
void assignGroupIdsToClusters(TH1D &hist, std::vector< GroupInfo > &groupInfoVector)
Assign groupId to the clusters.
std::string m_svdEventInfoName
Name of the collection to use for the SVDEventInfo.
void createAndFillHistorgram(TH1D &hist)
Create Histogram and Fill cluster time in it.
void sortSignalGroups(std::vector< GroupInfo > &groupInfoVector)
Sort Signals.
SVDTimeGroupingModule()
Constructor.
void searchGausPeaksInHistogram(TH1D &hist, std::vector< GroupInfo > &groupInfoVector)
Find Gaussian components in a Histogram.
DBObjPtr< SVDRecoConfiguration > m_recoConfig
SVD Reconstruction Configuration payload.
bool m_isEnabledIn6Samples
Enables the module if true for 6-sample DAQ mode.
DBObjPtr< SVDTimeGroupingConfiguration > m_groupingConfig
SVDTimeGrouping Configuration payload.
bool m_isEnabledIn3Samples
Enables the module if true for 3-sample DAQ mode.
Accessor to arrays stored in the data store.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getSensorNumber() const
Get the sensor id.
baseType getLayerNumber() const
Get the layer id.
std::tuple< double, double, double > GroupInfo
typedef to be used to store Gauss parameters (integral, center, sigma)
int getSensorType(const VxdID &sensorID)
Get Sensor Type of SVD sensors.
double myGaus(const double *x, const double *par)
Gaus function to be used in the fit.
void subtractGausFromHistogram(TH1D &hist, const double &integral, const double ¢er, const double &sigma, const double &sigmaN)
Subtract a Gaussian from a histogram.
void addGausToHistogram(TH1D &hist, const double &integral, const double ¢er, const double &sigma, const double &sigmaN, const bool &isAddition=true)
Add (or Subtract) a Gaussian to (or from) a histogram.
Abstract base class for different kinds of events.
structure containing the relevant informations of SVDTimeGrouping module
Int_t maxGroups
maximum number of groups to be accepted.