9 #include "GaudiKernel/MsgStream.h"
11 #include "TObjArray.h"
12 #include "TObjString.h"
31 m_LocRecCorr (nullptr)
66 throw std::runtime_error(
"AlfaLocalHit::AssignZ() m_pot not assigned");
78 throw std::runtime_error(
"AlfaLocalHit::AssignZ: z coordinate was not assigned for the hit");
83 cout <<
"pot = " <<
m_pot
92 if(
n.Contains(
"B7L1U"))
return 0;
93 if(
n.Contains(
"B7L1L"))
return 1;
94 if(
n.Contains(
"A7L1U"))
return 2;
95 if(
n.Contains(
"A7L1L"))
return 3;
96 if(
n.Contains(
"A7R1U"))
return 4;
97 if(
n.Contains(
"A7R1L"))
return 5;
98 if(
n.Contains(
"B7R1U"))
return 6;
99 if(
n.Contains(
"B7R1L"))
return 7;
100 throw std::runtime_error(
"AlfaLocalHit::GetMDindex ... Not recognised detector name: " +
n);
103 if(
i == 0)
return {
"B7L1U"};
104 if(
i == 1)
return {
"B7L1L"};
105 if(
i == 2)
return {
"A7L1U"};
106 if(
i == 3)
return {
"A7L1L"};
107 if(
i == 4)
return {
"A7R1U"};
108 if(
i == 5)
return {
"A7R1L"};
109 if(
i == 6)
return {
"B7R1U"};
110 if(
i == 7)
return {
"B7R1L"};
111 throw std::runtime_error(
"AlfaLocalHit::GetMDname ... Not recognised detector number: " +
std::to_string(
i));
154 throw std::runtime_error(
"Class AlfaLocalHits: m_nhits != m_hits.size() !!! ");
161 cout <<
"Cannot dump the AlfaLocalHits object, it has zero size." << endl;
163 cout <<
"Dumping object of AlfaLocalHits class:" << endl;
165 cout <<
"at " <<
i <<
" ";
172 cout <<
"Dumping paths for " <<
m_pathpattern.Data() <<
" pattern" << endl;
187 TObjArray toa_tokenized_pattern(4,0);
188 toa_tokenized_pattern = * ts_pattern.Tokenize(
"_");
189 if(toa_tokenized_pattern.GetEntries() != 4){
190 std::runtime_error(
"AlfaLocalHits: Pattern of wrong length!!! " + ts_pattern);
192 TString patternitem(
"");
194 for(
int i1 = 0; i1 <
m_nhits; i1++){
195 int i1last = (i1 ==
m_nhits-1);
197 TString patternitem0 = TString(((TObjString*) toa_tokenized_pattern.At(0))->GetString());
198 if((
h1.GetPotName().Contains(patternitem0))
199 || (i1last && patternitem0.Contains(
"X"))
201 for(
int i2 = 0; i2 <
m_nhits; i2++){
202 int i2last = (i2 ==
m_nhits-1);
203 if(i2 == i1 && !i2last)
continue;
205 TString patternitem1 = TString(((TObjString*) toa_tokenized_pattern.At(1))->GetString());
207 ||(i2last && patternitem1.Contains(
"X"))
209 for(
int i3 = 0; i3 <
m_nhits; i3++){
210 int i3last = (i3 ==
m_nhits-1);
211 if(i3 == i1 && !i3last)
continue;
212 if(i3 == i2 && !i3last)
continue;
214 TString patternitem2 = TString(((TObjString*) toa_tokenized_pattern.At(2))->GetString());
216 ||(i3last && patternitem2.Contains(
"X"))
218 for(
int i4 = 0; i4 <
m_nhits; i4++){
219 int i4last = (i4 ==
m_nhits-1);
220 if(i4 == i1 && !i4last)
continue;
221 if(i4 == i2 && !i4last)
continue;
222 if(i4 == i3 && !i4last)
continue;
224 TString patternitem3 = TString(((TObjString*) toa_tokenized_pattern.At(3))->GetString());
226 ||(i4last && patternitem3.Contains(
"X"))
228 if(patternitem0!=
'X') {alh_tmp.
AddHit(
h1);}
229 if(patternitem1!=
'X') {alh_tmp.
AddHit(h2);}
230 if(patternitem2!=
'X') {alh_tmp.
AddHit(h3);}
231 if(patternitem3!=
'X') {alh_tmp.
AddHit(h4);}
241 m_paths.push_back(std::move(alh_tmp));
251 throw std::runtime_error(
"Requesting path with overflow index");
259 throw std::runtime_error(
"Requesting hit with overflow index");
261 return &(
m_hits.at(ihit));
291 cout <<
"Left and right side ALFA tracks at one time not supported in AlfaTrackCand class" << endl;
292 cout <<
"Consider using another class for them or change path pattern." << endl;
394 throw std::runtime_error(
"AlfaTrackCand::CalcTrack() ... track is in left but unknown upper/lower arm");
413 std::runtime_error(
"AlfaTrackCand::CalcTrack() ... track is in right but unknown upper/lower arm");
416 std::runtime_error(
"AlfaTrackCand::CalcTrack() ... track must be left or right");
420 m_x = (xM + xm) / 2.;
421 m_y = (yM + ym) / 2.;
422 m_z = (zM + zm) / 2.;
435 double scalefactortonearpot = z_nearpot -
m_z;
436 double ximpact_nearpot =
m_x +
m_xslope * scalefactortonearpot;
437 double yimpact_nearpot =
m_y +
m_yslope * scalefactortonearpot;
438 double zimpact_nearpot = z_nearpot;
444 double scalefactortofarpot = z_farpot -
m_z;
445 double ximpact_farpot =
m_x +
m_xslope * scalefactortofarpot;
446 double yimpact_farpot =
m_y +
m_yslope * scalefactortofarpot;
447 double zimpact_farpot = z_farpot;
456 std::ios oldState(
nullptr);
457 oldState.copyfmt(std::cout);
458 cout <<
"Dumping AlfaTrackCand:" << endl;
459 cout <<
" arm = " << std::setprecision(8) <<
m_arm
460 <<
" x = " << std::setprecision(8) <<
m_x
461 <<
" y = " << std::setprecision(8) <<
m_y
462 <<
" z = " << std::setprecision(8) <<
m_z
463 <<
" x'= " << std::setprecision(8) <<
m_xslope
464 <<
" y' = " << std::setprecision(8) <<
m_yslope
466 std::cout.copyfmt(oldState);