70 cout <<
"\nBmnCSCDigitizer::Init()\n ";
72 if (fVerbose && fOnlyPrimary)
73 cout <<
" Only primary particles are processed!!! " << endl;
75 if (fVerbose && fStripMatching)
76 cout <<
" Strip Matching is activated!!! " << endl;
78 cout <<
" Strip Matching is deactivated!!! " << endl;
80 FairRootManager* ioman = FairRootManager::Instance();
82 fBmnCSCPointsArray = (TClonesArray*)ioman->GetObject(fInputBranchName);
83 if (!fBmnCSCPointsArray) {
84 cout <<
"BmnCSCDigitizer::Init(): branch " << fInputBranchName <<
" not found! Task will be deactivated"
90 fMCTracksArray = (TClonesArray*)ioman->GetObject(
"MCTrack");
92 fBmnCSCDigitsArray =
new TClonesArray(fOutputDigitsBranchName);
93 ioman->Register(fOutputDigitsBranchName,
"CSC_DIGIT", fBmnCSCDigitsArray, kTRUE);
96 fBmnCSCDigitMatchesArray =
new TClonesArray(
"BmnMatch");
97 ioman->Register(fOutputDigitMatchesBranchName,
"CSC_DIGIT", fBmnCSCDigitMatchesArray, kTRUE);
100 TString gPathCSCConfig = gSystem->Getenv(
"VMCWORKDIR");
101 gPathCSCConfig +=
"/parameters/csc/XMLConfigs/";
104 switch (fCurrentConfig) {
106 XMLConfigFile = gPathCSCConfig +
"CSCRunSpring2018.xml";
108 cout <<
" Current CSC Configuration : RunSpring2018"
113 XMLConfigFile = gPathCSCConfig +
"CSCRunSRCSpring2018.xml";
115 cout <<
" Current CSC Configuration : RunSRCSpring2018"
120 XMLConfigFile = gPathCSCConfig +
"CSCRun8.xml";
122 cout <<
" Current CSC Configuration : Run8"
127 XMLConfigFile = gPathCSCConfig +
"CSCRunSRC2021.xml";
129 cout <<
" Current CSC Configuration : RunSRC2021"
134 XMLConfigFile = gPathCSCConfig +
"LargeCSCRun8.xml";
136 cout <<
" Current CSC Configuration : LargeCSCRun8"
141 XMLConfigFile = gPathCSCConfig +
"FullCSCRun8.xml";
143 cout <<
" Current CSC Configuration : FullCSCRun8 (4 small + 1 large chambers)"
148 XMLConfigFile = gPathCSCConfig +
"CSCRun9.xml";
150 cout <<
" Current CSC Configuration : Run9"
155 if (!gSystem->AccessPathName(XMLConfigFile)) {
157 cout <<
" XMLConfigFile : " << XMLConfigFile <<
"\n";
162 Fatal(
"BmnCSCDigitizer::Init()",
" !!! Current configuration is not set !!! ");
167 cout <<
"BmnCSCDigitizer::Init() finished\n\n";
205 FairMCPoint* CSCPoint;
206 Int_t NNotPrimaries = 0;
208 for (Int_t ipoint = 0; ipoint < fBmnCSCPointsArray->GetEntriesFast(); ipoint++) {
209 CSCPoint = (FairMCPoint*)fBmnCSCPointsArray->At(ipoint);
221 Double_t x = -CSCPoint->GetX();
222 Double_t y = CSCPoint->GetY();
223 Double_t z = CSCPoint->GetZ();
225 Double_t px = -CSCPoint->GetPx();
226 Double_t py = CSCPoint->GetPy();
227 Double_t pz = CSCPoint->GetPz();
229 Double_t dEloss = CSCPoint->GetEnergyLoss() * 1e6;
230 Int_t refId = ipoint;
233 Int_t mc_station_num = ((
BmnCSCPoint*)CSCPoint)->GetStation();
234 Int_t mc_module_num = ((
BmnCSCPoint*)CSCPoint)->GetModule();
241 if (TransfSet && mc_station_num < StationSet->GetNStations()) {
242 if (mc_module_num < StationSet->GetStation(mc_station_num)->GetNModules()) {
243 Plane3D::Point loc_point =
246 Plane3D::Point(-(px + x), (py + y), (pz + z)), mc_station_num, mc_module_num);
251 px = -(loc_direct.X() - loc_point.X());
252 py = loc_direct.Y() - loc_point.Y();
253 pz = loc_direct.Z() - loc_point.Z();
264 for (Int_t iStation = 0; iStation < StationSet->
GetNStations(); ++iStation) {
267 for (Int_t iModule = 0; iModule < station->
GetNModules(); ++iModule) {
270 for (Int_t iLayer = 0; iLayer <
module->GetNStripLayers(); ++iLayer) {
273 for (Int_t iStrip = 0; iStrip < layer.
GetNStrips(); ++iStrip) {
276 new ((*fBmnCSCDigitsArray)[fBmnCSCDigitsArray->GetEntriesFast()])
277 BmnCSCDigit(iStation, iModule, iLayer, iStrip, signal);
279 if (fStripMatching) {
280 new ((*fBmnCSCDigitMatchesArray)[fBmnCSCDigitMatchesArray->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)