117 cout <<
"=================== BmnSiBTHitMaker::Init() started ====================" << endl;
119 FairRootManager* ioman = FairRootManager::Instance();
121 fBmnSiBTDigitsArray = (TClonesArray*)ioman->GetObject(fInputDigitsBranchName);
122 if (!fBmnSiBTDigitsArray) {
123 cout <<
"BmnSiBTHitMaker::Init(): branch " << fInputDigitsBranchName <<
" not found! Task will be deactivated"
129 fBmnSiBTDigitMatchesArray = (TClonesArray*)ioman->GetObject(fInputDigitMatchesBranchName);
132 if (fBmnSiBTDigitMatchesArray)
133 cout <<
" Strip matching information exists!\n";
135 cout <<
" Strip matching information doesn`t exist!\n";
138 fBmnSiBTHitsArray =
new TClonesArray(fOutputHitsBranchName);
139 ioman->Register(fOutputHitsBranchName,
"SiBT", fBmnSiBTHitsArray, kTRUE);
141 if (fHitMatching && fBmnSiBTDigitMatchesArray) {
142 fBmnSiBTHitMatchesArray =
new TClonesArray(
"BmnMatch");
143 ioman->Register(fOutputHitMatchesBranchName,
"SiBT", fBmnSiBTHitMatchesArray, kTRUE);
145 fBmnSiBTHitMatchesArray = 0;
149 LoadDetectorConfiguration();
151 fField = FairRunAna::Instance()->GetField();
153 Fatal(
"Init",
"No Magnetic Field found");
157 fBmnEvQuality = (TClonesArray*)ioman->GetObject(fBmnEvQualityBranchName);
160 cout <<
"=================== BmnSiBTHitMaker::Init() finished ===================" << endl;
175 if (fIsExp && fBmnEvQuality) {
180 fBmnSiBTHitsArray->Delete();
182 if (fHitMatching && fBmnSiBTHitMatchesArray) {
183 fBmnSiBTHitMatchesArray->Delete();
187 cout <<
"=================== BmnSiBTHitMaker::Exec() started ====================" << endl;
189 fField = FairRunAna::Instance()->GetField();
192 cout <<
" BmnSiBTHitMaker::Exec(), Number of BmnSiBTDigits = " << fBmnSiBTDigitsArray->GetEntriesFast() <<
"\n";
197 cout <<
"=================== BmnSiBTHitMaker::Exec() finished ===================" << endl;
200 workTime += sw.RealTime();
214 Int_t AddedDigits = 0;
215 Int_t AddedStripDigitMatches = 0;
217 for (Int_t idigit = 0; idigit < fBmnSiBTDigitsArray->GetEntriesFast(); idigit++) {
222 module = station->GetModule(digit->GetModule());
227 if (fBmnSiBTDigitMatchesArray) {
228 strip_match = (
BmnMatch*)fBmnSiBTDigitMatchesArray->At(idigit);
230 AddedStripDigitMatches++;
235 cout <<
" Processed strip digits : " << AddedDigits <<
"\n";
236 if (fVerbose > 1 && fBmnSiBTDigitMatchesArray)
237 cout <<
" Added strip digit matches : " << AddedStripDigitMatches <<
"\n";
245 cout <<
" Calculated points : " << NCalculatedPoints <<
"\n";
247 cout <<
"BmnSiBTHitMaker: " << NCalculatedPoints <<
" hits\n";
249 Int_t clear_matched_points_cnt = 0;
251 for (Int_t iStation = 0; iStation < StationSet->
GetNStations(); ++iStation) {
254 for (Int_t iModule = 0; iModule < station->
GetNModules(); ++iModule) {
255 module = station->GetModule(iModule);
257 Int_t NIntersectionPointsInModule =
module->GetNIntersectionPoints();
259 for (Int_t iPoint = 0; iPoint < NIntersectionPointsInModule; ++iPoint) {
261 Double_t sigL =
module->GetIntersectionPoint_LowerLayerSripTotalSignal(iPoint);
262 Double_t sigU =
module->GetIntersectionPoint_UpperLayerSripTotalSignal(iPoint);
264 Double_t x =
module->GetIntersectionPointX(iPoint);
265 Double_t y =
module->GetIntersectionPointY(iPoint);
266 Double_t z =
module->GetZPositionRegistered();
268 Double_t x_err =
module->GetIntersectionPointXError(iPoint);
269 Double_t y_err =
module->GetIntersectionPointYError(iPoint);
270 Double_t z_err = 0.0;
274 Plane3D::Point glob_point = TransfSet->
ApplyTransforms(Plane3D::Point(-x, y, z), iStation, iModule);
280 Int_t RefMCIndex = 0;
285 Int_t most_probably_index = -1;
286 Double_t max_weight = 0;
288 Int_t n_links =
match.GetNofLinks();
290 clear_matched_points_cnt++;
291 for (Int_t ilink = 0; ilink < n_links; ilink++) {
292 Int_t index =
match.GetLink(ilink).GetIndex();
293 Double_t weight =
match.GetLink(ilink).GetWeight();
294 if (weight > max_weight) {
296 most_probably_index = index;
300 RefMCIndex = most_probably_index;
316 double k = 2.01370805;
330 new ((*fBmnSiBTHitsArray)[fBmnSiBTHitsArray->GetEntriesFast()])
331 BmnSiBTHit(0, TVector3(x, y, z), TVector3(x_err, y_err, z_err), RefMCIndex);
336 hit->
SetIndex(fBmnSiBTHitsArray->GetEntriesFast() - 1);
338 module->GetIntersectionPoint_LowerLayerClusterSize(iPoint));
342 module->GetIntersectionPoint_LowerLayerSripPosition(iPoint));
349 cout <<
" glob(x:y:z) = ( " << x <<
" : " << y <<
" : " << z <<
"\n";
350 cout <<
" hit(x:y:z) = ( " << hit->GetX() <<
" : " << hit->GetY() <<
" : " << hit->GetZ() <<
"\n";
356 if (fHitMatching && fBmnSiBTHitMatchesArray) {
357 new ((*fBmnSiBTHitMatchesArray)[fBmnSiBTHitMatchesArray->GetEntriesFast()])
358 BmnMatch(module->GetIntersectionPointMatch(iPoint));
365 cout <<
" N clear matches with MC-points = " << clear_matched_points_cnt <<
"\n";