116 cout <<
"=================== BmnSiProfHitMaker::Init() started ====================" << endl;
118 FairRootManager* ioman = FairRootManager::Instance();
120 fBmnSiProfDigitsArray = (TClonesArray*)ioman->GetObject(fInputDigitsBranchName);
121 if (!fBmnSiProfDigitsArray) {
122 cout <<
"BmnSiProfHitMaker::Init(): branch " << fInputDigitsBranchName <<
" not found! Task will be deactivated"
128 fBmnSiProfDigitMatchesArray = (TClonesArray*)ioman->GetObject(fInputDigitMatchesBranchName);
131 if (fBmnSiProfDigitMatchesArray)
132 cout <<
" Strip matching information exists!\n";
134 cout <<
" Strip matching information doesn`t exist!\n";
137 fBmnSiProfHitsArray =
new TClonesArray(fOutputHitsBranchName);
138 ioman->Register(fOutputHitsBranchName,
"SiProf", fBmnSiProfHitsArray, kTRUE);
140 if (fHitMatching && fBmnSiProfDigitMatchesArray) {
141 fBmnSiProfHitMatchesArray =
new TClonesArray(
"BmnMatch");
142 ioman->Register(fOutputHitMatchesBranchName,
"SiProf", fBmnSiProfHitMatchesArray, kTRUE);
144 fBmnSiProfHitMatchesArray = 0;
148 LoadDetectorConfiguration();
150 fField = FairRunAna::Instance()->GetField();
152 Fatal(
"Init",
"No Magnetic Field found");
156 fBmnEvQuality = (TClonesArray*)ioman->GetObject(fBmnEvQualityBranchName);
159 cout <<
"=================== BmnSiProfHitMaker::Init() finished ===================" << endl;
173 if (fIsExp && fBmnEvQuality) {
178 fBmnSiProfHitsArray->Delete();
180 if (fHitMatching && fBmnSiProfHitMatchesArray) {
181 fBmnSiProfHitMatchesArray->Delete();
185 cout <<
"=================== BmnSiProfHitMaker::Exec() started ====================" << endl;
187 fField = FairRunAna::Instance()->GetField();
190 cout <<
" BmnSiProfHitMaker::Exec(), Number of BmnSiProfDigits = " << fBmnSiProfDigitsArray->GetEntriesFast()
196 cout <<
"=================== BmnSiProfHitMaker::Exec() finished ===================" << endl;
199 workTime += sw.RealTime();
212 Int_t AddedDigits = 0;
213 Int_t AddedStripDigitMatches = 0;
215 for (Int_t idigit = 0; idigit < fBmnSiProfDigitsArray->GetEntriesFast(); idigit++) {
220 module = station->GetModule(digit->GetModule());
225 if (fBmnSiProfDigitMatchesArray) {
226 strip_match = (
BmnMatch*)fBmnSiProfDigitMatchesArray->At(idigit);
228 AddedStripDigitMatches++;
233 cout <<
" Processed strip digits : " << AddedDigits <<
"\n";
234 if (fVerbose > 1 && fBmnSiProfDigitMatchesArray)
235 cout <<
" Added strip digit matches : " << AddedStripDigitMatches <<
"\n";
243 cout <<
" Calculated points : " << NCalculatedPoints <<
"\n";
245 cout <<
"BmnSiProfHitMaker: " << NCalculatedPoints <<
" hits\n";
247 Int_t clear_matched_points_cnt = 0;
249 for (Int_t iStation = 0; iStation < StationSet->
GetNStations(); ++iStation) {
252 for (Int_t iModule = 0; iModule < station->
GetNModules(); ++iModule) {
253 module = station->GetModule(iModule);
255 Int_t NIntersectionPointsInModule =
module->GetNIntersectionPoints();
257 for (Int_t iPoint = 0; iPoint < NIntersectionPointsInModule; ++iPoint) {
259 Double_t sigL =
module->GetIntersectionPoint_LowerLayerSripTotalSignal(iPoint);
260 Double_t sigU =
module->GetIntersectionPoint_UpperLayerSripTotalSignal(iPoint);
262 Double_t x =
module->GetIntersectionPointX(iPoint);
263 Double_t y =
module->GetIntersectionPointY(iPoint);
264 Double_t z =
module->GetZPositionRegistered();
266 Double_t x_err =
module->GetIntersectionPointXError(iPoint);
267 Double_t y_err =
module->GetIntersectionPointYError(iPoint);
268 Double_t z_err = 0.0;
272 Plane3D::Point glob_point = TransfSet->
ApplyTransforms(Plane3D::Point(-x, y, z), iStation, iModule);
278 Int_t RefMCIndex = 0;
283 Int_t most_probably_index = -1;
284 Double_t max_weight = 0;
286 Int_t n_links =
match.GetNofLinks();
288 clear_matched_points_cnt++;
289 for (Int_t ilink = 0; ilink < n_links; ilink++) {
290 Int_t index =
match.GetLink(ilink).GetIndex();
291 Double_t weight =
match.GetLink(ilink).GetWeight();
292 if (weight > max_weight) {
294 most_probably_index = index;
298 RefMCIndex = most_probably_index;
304 new ((*fBmnSiProfHitsArray)[fBmnSiProfHitsArray->GetEntriesFast()])
305 BmnSiProfHit(0, TVector3(x, y, z), TVector3(x_err, y_err, z_err), RefMCIndex);
310 hit->
SetIndex(fBmnSiProfHitsArray->GetEntriesFast() - 1);
312 module->GetIntersectionPoint_LowerLayerClusterSize(iPoint));
316 module->GetIntersectionPoint_LowerLayerSripPosition(iPoint));
323 cout <<
" glob(x:y:z) = ( " << x <<
" : " << y <<
" : " << z <<
"\n";
324 cout <<
" hit(x:y:z) = ( " << hit->GetX() <<
" : " << hit->GetY() <<
" : " << hit->GetZ() <<
"\n";
330 if (fHitMatching && fBmnSiProfHitMatchesArray) {
331 new ((*fBmnSiProfHitMatchesArray)[fBmnSiProfHitMatchesArray->GetEntriesFast()])
332 BmnMatch(module->GetIntersectionPointMatch(iPoint));
339 cout <<
" N clear matches with MC-points = " << clear_matched_points_cnt <<
"\n";