62 #include "StPxlSimMaker.h"
63 #include "StPxlFastSim.h"
64 #include "StPxlDigmapsSim.h"
65 #include "StPxlISim.h"
66 #include "StMcEvent/StMcPxlHitCollection.hh"
67 #include "StEvent/StPxlHitCollection.h"
68 #include "StPxlRawHitMaker/StPxlRawHit.h"
69 #include "StPxlRawHitMaker/StPxlRawHitCollection.h"
73 #include "StEventTypes.h"
75 #include "StMcEvent.hh"
76 #include "StMcEventTypes.hh"
78 #include "TGeoManager.h"
79 #include "TGeoMatrix.h"
81 #include "TObjectSet.h"
98 LOG_INFO <<
"StPxlSimMaker::Init()" << endm;
100 mUseDIGMAPSSim = IAttr(
"useDIGMAPSSim");
105 LOG_INFO <<
"StPxlSimMaker: using StPxlDigmapsSim " << endm;
110 mPxlSimulator =
new StPxlFastSim(
"pxlFastSim",mUseRandomSeed);
111 LOG_INFO <<
"StPxlSimMaker: using StPxlFastSim " << endm;
120 LOG_INFO <<
"StPxlSimMaker::InitRun" << endm;
122 TDataSet *hitErrSet = GetDataBase(
"Calibrations/tracker/PixelHitError");
125 LOG_ERROR <<
"StPxlSimMaker - E - could not Get Calibrations/tracker." << endm;
132 pxlDbDataSet = (
TObjectSet*)GetDataSet(
"pxl_db");
135 LOG_ERROR <<
"StPxlSimMaker - E - pxlDb is not available" << endm;
140 return mPxlSimulator->initRun(*hitErrSet, pxlDbDataSet, RunNo);
146 LOG_INFO <<
"StPxlSimMaker::Make()" << endm;
152 LOG_INFO <<
"No StEvent on input" << endm;
159 LOG_INFO <<
"No StMcEvent on input" << endm;
167 LOG_INFO <<
"StPxlSimMaker no PXL hits in this StMcEvent!" << endm;
171 if (!mUseDbGeom && !gGeoManager) GetDataBase(
"VmcGeometry");
172 if (!mUseDbGeom && !gGeoManager)
174 LOG_ERROR <<
" StPxlSimMaker - E - gGeoManager is not available." << endm;
183 bool newCollection =
false;
186 LOG_INFO <<
"No existing StPxlHiCollection. Creating a new one..." <<endm;
188 newCollection =
true;
191 mPxlSimulator->
addPxlHits(*mcPxlHitCol, *pxlHitCol);
193 if(newCollection) rcEvent->setPxlHitCollection(pxlHitCol);
194 LOG_DEBUG <<
" size of hit collection : " << pxlHitCol->numberOfHits() << endm;
202 if (!pxlRawHitDataSet)
204 LOG_INFO <<
" pxlRawHit does NOT exist! Create a new one! " << endm;
208 ToWhiteBoard(
"pxlRawHit", pxlRawHitCol);
213 LOG_INFO <<
" pxlRawHit exists! Append raw hits to this collection! " << endm;
219 LOG_ERROR <<
"Make() - no pxlRawHitCollection."<<endm;
224 LOG_INFO <<
" Finishing DIGMAPS simulator. Number of PxlRawHits = " << pxlRawHitCol->
numberOfRawHits() << endm;
virtual Int_t addPxlHits(const StMcPxlHitCollection &in, StPxlHitCollection &out)
this function is to be implemented by algorithms which create PXL hits points.
virtual Int_t Make()
calls the StPxlISim methods.
virtual ~StPxlSimMaker()
StEvent will own any hits created by this maker, and is responsible for cleanup.
maker for all PXL simulators
virtual Int_t addPxlRawHits(const StMcPxlHitCollection &in, StPxlRawHitCollection &out)
this function is to be implemented by algorithms which create raw PXL hits
virtual Int_t InitRun(Int_t)
gets the DB and initializes StPxlISim for this run.
STAR wrapper for DIGMAPS package.
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
virtual Int_t Init()
checks if other simulators have been requested and initializes StPxlISim accordingly.
Int_t numberOfRawHits(Int_t sector, Int_t ladder, Int_t sensor)
number of raw hits in a sensor
Class to simulate PXL hits from Monte Carlo.