61 cout <<
"\nBmnVSPDigitizer::Init()\n ";
63 if (fVerbose && fOnlyPrimary)
64 cout <<
" Only primary particles are processed!!! " << endl;
66 if (fVerbose && fStripMatching)
67 cout <<
" Strip Matching is activated!!! " << endl;
69 cout <<
" Strip matching is deactivated!!! " << endl;
71 FairRootManager* ioman = FairRootManager::Instance();
73 fBmnVSPPointsArray = (TClonesArray*)ioman->GetObject(fInputBranchName);
74 if (!fBmnVSPPointsArray) {
75 cout <<
"BmnVSPDigitizer::Init(): branch VSPPoint not found! Task "
82 fMCTracksArray = (TClonesArray*)ioman->GetObject(
"MCTrack");
84 fBmnVSPDigitsArray =
new TClonesArray(fOutputDigitsBranchName);
85 ioman->Register(fOutputDigitsBranchName,
"VSP", fBmnVSPDigitsArray, kTRUE);
88 fBmnVSPDigitMatchesArray =
new TClonesArray(
"BmnMatch");
89 ioman->Register(fOutputDigitMatchesBranchName,
"VSP", fBmnVSPDigitMatchesArray, kTRUE);
92 TString gPathVSPConfig = gSystem->Getenv(
"VMCWORKDIR");
93 gPathVSPConfig +=
"/parameters/vsp/XMLConfigs/";
96 switch (fCurrentConfig) {
98 XMLConfigFile = gPathVSPConfig +
"VSP_Run9.xml";
100 cout <<
" Current SILICON Configuration : Run9"
107 if (!gSystem->AccessPathName(XMLConfigFile)) {
109 cout <<
" XMLConfigFile : " << XMLConfigFile <<
"\n";
114 Fatal(
"BmnVSPDigitizer::Init()",
" !!! Current configuration is not set !!! ");
119 cout <<
"BmnVSPDigitizer::Init() finished\n\n";
153 FairMCPoint* VSPPoint;
154 Int_t NNotPrimaries = 0;
156 for (Int_t ipoint = 0; ipoint < fBmnVSPPointsArray->GetEntriesFast(); ipoint++) {
157 VSPPoint = (FairMCPoint*)fBmnVSPPointsArray->At(ipoint);
169 Double_t x = -VSPPoint->GetX();
170 Double_t y = VSPPoint->GetY();
171 Double_t z = VSPPoint->GetZ();
173 Double_t px = -VSPPoint->GetPx();
174 Double_t py = VSPPoint->GetPy();
175 Double_t pz = VSPPoint->GetPz();
177 Double_t dEloss = VSPPoint->GetEnergyLoss() * 1e6;
178 Int_t refId = ipoint;
181 Int_t mc_station_num = ((
BmnVSPPoint*)VSPPoint)->GetStation();
182 Int_t mc_module_num = ((
BmnVSPPoint*)VSPPoint)->GetModule();
189 if (TransfSet && mc_station_num < StationSet->GetNStations()) {
190 if (mc_module_num < StationSet->GetStation(mc_station_num)->GetNModules()) {
191 Plane3D::Point loc_point =
194 Plane3D::Point(-(px + x), (py + y), (pz + z)), mc_station_num, mc_module_num);
199 px = -(loc_direct.X() - loc_point.X());
200 py = loc_direct.Y() - loc_point.Y();
201 pz = loc_direct.Z() - loc_point.Z();
216 if (fVerbose && fOnlyPrimary)
217 cout <<
" Number of not primaries points : " << NNotPrimaries <<
"\n";
219 cout <<
" Processed MC points : " << NAddedPoints <<
"\n";
221 for (Int_t iStation = 0; iStation < StationSet->
GetNStations(); ++iStation) {
224 for (Int_t iModule = 0; iModule < station->
GetNModules(); ++iModule) {
226 vector<Int_t> processed_zones;
228 for (Int_t iLayer = 0; iLayer <
module->GetNStripLayers(); ++iLayer) {
233 Bool_t is_processed_zone =
false;
234 for (
size_t iz = 0; iz < processed_zones.size(); ++iz) {
235 if (zone_id == processed_zones[iz])
236 is_processed_zone =
true;
239 if (!is_processed_zone) {
240 Int_t first_strip_in_zone =
module->GetFirstStripInZone(zone_id);
241 Int_t last_strip_in_zone =
module->GetLastStripInZone(zone_id);
242 map<int, int> noiseMap;
244 for (Int_t iStrip = first_strip_in_zone; iStrip < last_strip_in_zone + 1; ++iStrip) {
245 Double_t signal =
module->GetStripSignalInZone(zone_id, iStrip);
248 signal = signal / (120. / 500.0);
261 signal += gRandom->Gaus(0, fSigma);
271 noiseMap[iStrip] = 1;
272 if (signal <= fThresh)
278 new ((*fBmnVSPDigitsArray)[fBmnVSPDigitsArray->GetEntriesFast()])
BmnVSPDigit(
279 iStation, iModule, zone_id, iStrip, signal);
281 if (fStripMatching) {
282 new ((*fBmnVSPDigitMatchesArray)[fBmnVSPDigitMatchesArray->GetEntriesFast()])
283 BmnMatch(module->GetStripMatchInZone(zone_id, iStrip));
285 }
else if (fSigma > 0) {
286 signal += gRandom->Gaus(0, fSigma);
295 if (signal <= fThresh)
299 new ((*fBmnVSPDigitsArray)[fBmnVSPDigitsArray->GetEntriesFast()])
BmnVSPDigit(
300 iStation, iModule, zone_id, iStrip, signal);
302 if (fStripMatching) {
303 new ((*fBmnVSPDigitMatchesArray)[fBmnVSPDigitMatchesArray->GetEntriesFast()])
304 BmnMatch(module->GetStripMatchInZone(zone_id, iStrip));
308 processed_zones.push_back(zone_id);