13 #include "StPxlHitMaker.h"
14 #include "StMessMgr.h"
15 #include "StEventTypes.h"
16 #include "TGeoMatrix.h"
17 #include "StPxlUtil/StThinPlateSpline.h"
18 #include "StPxlClusterMaker/StPxlCluster.h"
19 #include "StPxlClusterMaker/StPxlClusterCollection.h"
20 #include "StPxlUtil/StPxlConstants.h"
21 #include "StPxlUtil/StPxlDigiHit.h"
22 #include "tables/St_pxlControl_Table.h"
23 #include "StPxlDbMaker/StPxlDb.h"
34 Int_t StPxlHitMaker::InitRun(Int_t runnumber)
43 LOG_ERROR <<
"InitRun : not pxlDb" << endm;
61 Bool_t embeddingShortCut = IAttr(
"EmbeddingShortCut");
66 LOG_WARN <<
"StPxlHitMaker::Make(): There is no StEvent " << endm;
71 LOG_WARN <<
"StPxlHitMaker::Make(): StPxlDb mPxlDb is not initialized" << endm;
79 if (pxlClusterDataSet)
86 if (!pxlClusterCollection && !pxlHitCollection) {
87 LOG_WARN <<
"StPxlHitMaker::Make() no pxlClusterCollection or pxlHitCollection to work on" << endm;
92 if (!pxlHitCollection) {
94 pEvent->setPxlHitCollection(pxlHitCollection);
98 for (
int i = 0; i < kNumberOfPxlSectors; i++)
99 for (
int j = 0; j < kNumberOfPxlLaddersPerSector; j++)
100 for (
int k = 0; k < kNumberOfPxlSensorsPerLadder; k++) {
102 if (pxlClusterCollection) {
104 for (
int l = 0; l < vecSize; l++) {
107 pxlHitCollection->addHit(
new StPxlDigiHit(*cluster, i+1, j+1, k+1));
114 const TGeoHMatrix *geoMSensorOnGlobal = mPxlDb->geoHMatrixSensorOnGlobal(i + 1, j + 1, k + 1);
115 int nHitsInSensor = pxlHitCollection->sector(i)->ladder(j)->sensor(k)->hits().size();
116 for (
int l = 0; l < nHitsInSensor; l++) {
117 StPxlHit *pxlHit = pxlHitCollection->sector(i)->ladder(j)->sensor(k)->hits()[l];
119 double local[3] = {pxlHit->localPosition()[0], pxlHit->localPosition()[1], pxlHit->localPosition()[2]};
122 if (!embeddingShortCut || !pxlHit->idTruth()) {
123 local[1] = mPxlDb->
thinPlateSpline(i + 1, j + 1, k + 1)->
z(local[2], local[0]);
124 pxlHit->setLocalY(local[1]);
128 geoMSensorOnGlobal->LocalToMaster(local, global);
Int_t numberOfClusters(Int_t sector, Int_t ladder, Int_t sensor) const
number of clusters in a sensor
const StPxlCluster * cluster(Int_t sector, Int_t ladder, Int_t sensor, Int_t clusterIndex) const
pointer to a cluster in the collection
Double_t z(Double_t x, Double_t y) const
calculate z on the profile at (x,y)
const StThinPlateSpline * thinPlateSpline(Int_t sector, Int_t ladder, Int_t sensor) const
< thin plate spline function to describe the sensor surface
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)