66 cout <<
"\nBmnSiBTDigitizer::Init()\n ";
68 if (fVerbose && fOnlyPrimary)
69 cout <<
" Only primary particles are processed!!! " << endl;
71 if (fVerbose && fStripMatching)
72 cout <<
" Strip Matching is activated!!! " << endl;
74 cout <<
" Strip Matching is deactivated!!! " << endl;
76 FairRootManager* ioman = FairRootManager::Instance();
78 fBmnSiBTPointsArray = (TClonesArray*)ioman->GetObject(fInputBranchName);
79 if (!fBmnSiBTPointsArray) {
80 cout <<
"BmnSiBTDigitizer::Init(): branch " << fInputBranchName <<
" not found! Task will be deactivated"
86 fMCTracksArray = (TClonesArray*)ioman->GetObject(
"MCTrack");
88 fBmnSiBTDigitsArray =
new TClonesArray(fOutputDigitsBranchName);
89 ioman->Register(fOutputDigitsBranchName,
"SiBT_DIGIT", fBmnSiBTDigitsArray, kTRUE);
92 fBmnSiBTDigitMatchesArray =
new TClonesArray(
"BmnMatch");
93 ioman->Register(fOutputDigitMatchesBranchName,
"SiBT_DIGIT", fBmnSiBTDigitMatchesArray, kTRUE);
96 TString gPathSiBTConfig = gSystem->Getenv(
"VMCWORKDIR");
97 gPathSiBTConfig +=
"/parameters/SiBT/XMLConfigs/";
100 switch (fCurrentConfig) {
102 XMLConfigFile = gPathSiBTConfig +
"SiBTRun8.xml";
104 cout <<
" Current SiBT Configuration : Run8"
109 XMLConfigFile = gPathSiBTConfig +
"SiBTRun9.xml";
111 cout <<
" Current SiBT Configuration : Run9"
118 if (!gSystem->AccessPathName(XMLConfigFile)) {
120 cout <<
" XMLConfigFile : " << XMLConfigFile <<
"\n";
125 Fatal(
"BmnSiBTDigitizer::Init()",
" !!! Current configuration is not set !!! ");
130 cout <<
"BmnSiBTDigitizer::Init() finished\n\n";
140 clock_t tStart = clock();
141 fBmnSiBTDigitsArray->Delete();
143 if (fStripMatching) {
144 fBmnSiBTDigitMatchesArray->Delete();
147 if (!fBmnSiBTPointsArray) {
148 Error(
"BmnSiBTDigitizer::Exec()",
" !!! Unknown branch name !!! ");
161 clock_t tFinish = clock();
162 workTime += ((Float_t)(tFinish - tStart)) / CLOCKS_PER_SEC;
168 FairMCPoint* SiBTPoint;
169 Int_t NNotPrimaries = 0;
171 for (Int_t ipoint = 0; ipoint < fBmnSiBTPointsArray->GetEntriesFast(); ipoint++) {
172 SiBTPoint = (FairMCPoint*)fBmnSiBTPointsArray->At(ipoint);
184 Double_t x = -SiBTPoint->GetX();
185 Double_t y = SiBTPoint->GetY();
186 Double_t z = SiBTPoint->GetZ();
188 Double_t px = -SiBTPoint->GetPx();
189 Double_t py = SiBTPoint->GetPy();
190 Double_t pz = SiBTPoint->GetPz();
192 Double_t dEloss = SiBTPoint->GetEnergyLoss() * 1e6;
193 Int_t refId = ipoint;
196 Int_t mc_station_num = ((
BmnSiBTPoint*)SiBTPoint)->GetStation();
197 Int_t mc_module_num = ((
BmnSiBTPoint*)SiBTPoint)->GetModule();
204 if (TransfSet && mc_station_num < StationSet->GetNStations()) {
205 if (mc_module_num < StationSet->GetStation(mc_station_num)->GetNModules()) {
206 Plane3D::Point loc_point =
209 Plane3D::Point(-(px + x), (py + y), (pz + z)), mc_station_num, mc_module_num);
214 px = -(loc_direct.X() - loc_point.X());
215 py = loc_direct.Y() - loc_point.Y();
216 pz = loc_direct.Z() - loc_point.Z();
227 for (Int_t iStation = 0; iStation < StationSet->
GetNStations(); ++iStation) {
230 for (Int_t iModule = 0; iModule < station->
GetNModules(); ++iModule) {
233 for (Int_t iLayer = 0; iLayer <
module->GetNStripLayers(); ++iLayer) {
236 for (Int_t iStrip = 0; iStrip < layer.
GetNStrips(); ++iStrip) {
239 new ((*fBmnSiBTDigitsArray)[fBmnSiBTDigitsArray->GetEntriesFast()])
240 BmnSiBTDigit(iStation, iModule, iLayer, iStrip, signal);
242 if (fStripMatching) {
243 new ((*fBmnSiBTDigitMatchesArray)[fBmnSiBTDigitMatchesArray->GetEntriesFast()])
Bool_t AddPointToDetector(Double_t xcoord, Double_t ycoord, Double_t zcoord, Double_t px, Double_t py, Double_t pz, Double_t dEloss, Int_t refID)