80 cout <<
"\nBmnSiliconDigitizer::Init()\n ";
82 if (fVerbose && fOnlyPrimary)
83 cout <<
" Only primary particles are processed!!! " << endl;
85 if (fVerbose && fStripMatching)
86 cout <<
" Strip Matching is activated!!! " << endl;
88 cout <<
" Strip matching is deactivated!!! " << endl;
90 FairRootManager* ioman = FairRootManager::Instance();
92 fBmnSiliconPointsArray = (TClonesArray*)ioman->GetObject(fInputBranchName);
93 if (!fBmnSiliconPointsArray) {
94 cout <<
"BmnSiliconDigitizer::Init(): branch SiliconPoint not found! Task "
101 fMCTracksArray = (TClonesArray*)ioman->GetObject(
"MCTrack");
103 fBmnSiliconDigitsArray =
new TClonesArray(fOutputDigitsBranchName);
104 ioman->Register(fOutputDigitsBranchName,
"SILICON", fBmnSiliconDigitsArray, kTRUE);
106 if (fStripMatching) {
107 fBmnSiliconDigitMatchesArray =
new TClonesArray(
"BmnMatch");
108 ioman->Register(fOutputDigitMatchesBranchName,
"SILICON", fBmnSiliconDigitMatchesArray, kTRUE);
111 TString gPathSiliconConfig = gSystem->Getenv(
"VMCWORKDIR");
112 gPathSiliconConfig +=
"/parameters/silicon/XMLConfigs/";
115 switch (fCurrentConfig) {
117 XMLConfigFile = gPathSiliconConfig +
"SiliconRunSpring2017.xml";
119 cout <<
" Current SILICON Configuration : RunSpring2017"
124 XMLConfigFile = gPathSiliconConfig +
"SiliconRunSpring2018.xml";
126 cout <<
" Current SILICON Configuration : RunSpring2018"
131 XMLConfigFile = gPathSiliconConfig +
"SiliconRunSRCSpring2018.xml";
133 cout <<
" Current SILICON Configuration : RunSRCSpring2018"
138 XMLConfigFile = gPathSiliconConfig +
"SiliconRun8_3stations.xml";
140 cout <<
" Current SILICON Configuration : SiliconRun8_3stations"
145 XMLConfigFile = gPathSiliconConfig +
"SiliconRun8_4stations.xml";
147 cout <<
" Current SILICON Configuration : SiliconRun8_4stations"
152 XMLConfigFile = gPathSiliconConfig +
"SiliconRun8_5stations.xml";
154 cout <<
" Current SILICON Configuration : SiliconRun8_5stations"
159 XMLConfigFile = gPathSiliconConfig +
"SiliconRun8_mods_6_10_14_18.xml";
161 cout <<
" Current SILICON Configuration : SiliconRun8_mods_6_10_14_18"
166 XMLConfigFile = gPathSiliconConfig +
"SiliconRun8_mods_10_14rot_18.xml";
168 cout <<
" Current SILICON Configuration : SiliconRun8_mods_10_14rot_18"
173 XMLConfigFile = gPathSiliconConfig +
"SiliconRun8.xml";
175 cout <<
" Current SILICON Configuration : Run8"
180 XMLConfigFile = gPathSiliconConfig +
"SiliconRun9.xml";
182 cout <<
" Current SILICON Configuration : Run9"
187 XMLConfigFile = gPathSiliconConfig +
"Silicon_5stations_2026.xml";
189 cout <<
" Current SILICON Configuration : 5stations_2026"
196 if (!gSystem->AccessPathName(XMLConfigFile)) {
198 cout <<
" XMLConfigFile : " << XMLConfigFile <<
"\n";
203 Fatal(
"BmnSiliconDigitizer::Init()",
" !!! Current configuration is not set !!! ");
208 cout <<
"BmnSiliconDigitizer::Init() finished\n\n";
242 FairMCPoint* SiliconPoint;
243 Int_t NNotPrimaries = 0;
245 for (Int_t ipoint = 0; ipoint < fBmnSiliconPointsArray->GetEntriesFast(); ipoint++) {
246 SiliconPoint = (FairMCPoint*)fBmnSiliconPointsArray->At(ipoint);
258 Double_t x = -SiliconPoint->GetX();
259 Double_t y = SiliconPoint->GetY();
260 Double_t z = SiliconPoint->GetZ();
262 Double_t px = -SiliconPoint->GetPx();
263 Double_t py = SiliconPoint->GetPy();
264 Double_t pz = SiliconPoint->GetPz();
266 Double_t dEloss = SiliconPoint->GetEnergyLoss() * 1e6;
267 Int_t refId = ipoint;
278 if (TransfSet && mc_station_num < StationSet->GetNStations()) {
279 if (mc_module_num < StationSet->GetStation(mc_station_num)->GetNModules()) {
280 Plane3D::Point loc_point =
283 Plane3D::Point(-(px + x), (py + y), (pz + z)), mc_station_num, mc_module_num);
288 px = -(loc_direct.X() - loc_point.X());
289 py = loc_direct.Y() - loc_point.Y();
290 pz = loc_direct.Z() - loc_point.Z();
308 for (Int_t iStation = 0; iStation < StationSet->
GetNStations(); ++iStation) {
311 for (Int_t iModule = 0; iModule < station->
GetNModules(); ++iModule) {
313 vector<Int_t> processed_zones;
315 for (Int_t iLayer = 0; iLayer <
module->GetNStripLayers(); ++iLayer) {
320 Bool_t is_processed_zone =
false;
321 for (
size_t iz = 0; iz < processed_zones.size(); ++iz)
322 if (zone_id == processed_zones[iz])
323 is_processed_zone =
true;
325 if (!is_processed_zone) {
326 Int_t first_strip_in_zone =
module->GetFirstStripInZone(zone_id);
327 Int_t last_strip_in_zone =
module->GetLastStripInZone(zone_id);
328 map<int, int> noiseMap;
330 for (Int_t iStrip = first_strip_in_zone; iStrip < last_strip_in_zone + 1; ++iStrip) {
331 Double_t signal =
module->GetStripSignalInZone(zone_id, iStrip);
334 signal = signal / (120. / 500.0);
347 signal += gRandom->Gaus(0, fSigma);
357 noiseMap[iStrip] = 1;
358 if (signal <= fThresh)
363 new ((*fBmnSiliconDigitsArray)[fBmnSiliconDigitsArray->GetEntriesFast()])
BmnSiliconDigit(
364 iStation, iModule, zone_id, iStrip, signal);
366 if (fStripMatching) {
367 new ((*fBmnSiliconDigitMatchesArray)[fBmnSiliconDigitMatchesArray->GetEntriesFast()])
368 BmnMatch(module->GetStripMatchInZone(zone_id, iStrip));
373 noiseMap[iStrip - 1] = 1;
374 signal = gRandom->Gaus(0, fSigma);
375 if (signal <= fThresh)
380 new ((*fBmnSiliconDigitsArray)[fBmnSiliconDigitsArray->GetEntriesFast()])
384 if (fStripMatching) {
386 (*fBmnSiliconDigitMatchesArray)[fBmnSiliconDigitMatchesArray->GetEntriesFast()])
387 BmnMatch(module->GetStripMatchInZone(zone_id, iStrip - 1));
391 }
else if (fSigma > 0) {
396 signal += gRandom->Gaus(0, fSigma);
405 if (signal <= fThresh)
409 new ((*fBmnSiliconDigitsArray)[fBmnSiliconDigitsArray->GetEntriesFast()])
413 if (fStripMatching) {
415 (*fBmnSiliconDigitMatchesArray)[fBmnSiliconDigitMatchesArray->GetEntriesFast()])
416 BmnMatch(module->GetStripMatchInZone(zone_id, iStrip));
422 processed_zones.push_back(zone_id);