5 #define AlfaLocalHits_cxx
32 m_LocRecCorr (nullptr)
67 throw std::runtime_error(
"AlfaLocalHit::AssignZ() m_pot not assigned");
79 throw std::runtime_error(
"AlfaLocalHit::AssignZ: z coordinate was not assigned for the hit");
84 cout <<
"pot = " <<
m_pot
93 if(
n.Contains(
"B7L1U"))
return 0;
94 if(
n.Contains(
"B7L1L"))
return 1;
95 if(
n.Contains(
"A7L1U"))
return 2;
96 if(
n.Contains(
"A7L1L"))
return 3;
97 if(
n.Contains(
"A7R1U"))
return 4;
98 if(
n.Contains(
"A7R1L"))
return 5;
99 if(
n.Contains(
"B7R1U"))
return 6;
100 if(
n.Contains(
"B7R1L"))
return 7;
101 throw std::runtime_error(
"AlfaLocalHit::GetMDindex ... Not recognised detector name: " +
n);
104 if(
i == 0)
return {
"B7L1U"};
105 if(
i == 1)
return {
"B7L1L"};
106 if(
i == 2)
return {
"A7L1U"};
107 if(
i == 3)
return {
"A7L1L"};
108 if(
i == 4)
return {
"A7R1U"};
109 if(
i == 5)
return {
"A7R1L"};
110 if(
i == 6)
return {
"B7R1U"};
111 if(
i == 7)
return {
"B7R1L"};
112 throw std::runtime_error(
"AlfaLocalHit::GetMDname ... Not recognised detector number: " +
std::to_string(
i));
155 throw std::runtime_error(
"Class AlfaLocalHits: m_nhits != m_hits.size() !!! ");
162 cout <<
"Cannot dump the AlfaLocalHits object, it has zero size." << endl;
164 cout <<
"Dumping object of AlfaLocalHits class:" << endl;
166 cout <<
"at " <<
i <<
" ";
173 cout <<
"Dumping paths for " <<
m_pathpattern.Data() <<
" pattern" << endl;
188 TObjArray toa_tokenized_pattern(4,0);
189 toa_tokenized_pattern = * ts_pattern.Tokenize(
"_");
190 if(toa_tokenized_pattern.GetEntries() != 4){
191 std::runtime_error(
"AlfaLocalHits: Pattern of wrong length!!! " + ts_pattern);
193 TString patternitem(
"");
195 for(
int i1 = 0; i1 <
m_nhits; i1++){
196 int i1last = (i1 ==
m_nhits-1);
198 TString patternitem0 = TString(((TObjString*) toa_tokenized_pattern.At(0))->GetString());
199 if((
h1.GetPotName().Contains(patternitem0))
200 || (i1last && patternitem0.Contains(
"X"))
202 for(
int i2 = 0; i2 <
m_nhits; i2++){
203 int i2last = (i2 ==
m_nhits-1);
204 if(i2 == i1 && !i2last)
continue;
206 TString patternitem1 = TString(((TObjString*) toa_tokenized_pattern.At(1))->GetString());
208 ||(i2last && patternitem1.Contains(
"X"))
210 for(
int i3 = 0; i3 <
m_nhits; i3++){
211 int i3last = (i3 ==
m_nhits-1);
212 if(i3 == i1 && !i3last)
continue;
213 if(i3 == i2 && !i3last)
continue;
215 TString patternitem2 = TString(((TObjString*) toa_tokenized_pattern.At(2))->GetString());
217 ||(i3last && patternitem2.Contains(
"X"))
219 for(
int i4 = 0; i4 <
m_nhits; i4++){
220 int i4last = (i4 ==
m_nhits-1);
221 if(i4 == i1 && !i4last)
continue;
222 if(i4 == i2 && !i4last)
continue;
223 if(i4 == i3 && !i4last)
continue;
225 TString patternitem3 = TString(((TObjString*) toa_tokenized_pattern.At(3))->GetString());
227 ||(i4last && patternitem3.Contains(
"X"))
229 if(patternitem0!=
'X') {alh_tmp.
AddHit(
h1);}
230 if(patternitem1!=
'X') {alh_tmp.
AddHit(h2);}
231 if(patternitem2!=
'X') {alh_tmp.
AddHit(h3);}
232 if(patternitem3!=
'X') {alh_tmp.
AddHit(h4);}
252 throw std::runtime_error(
"Requesting path with overflow index");
260 throw std::runtime_error(
"Requesting hit with overflow index");
262 return &(
m_hits.at(ihit));
292 cout <<
"Left and right side ALFA tracks at one time not supported in AlfaTrackCand class" << endl;
293 cout <<
"Consider using another class for them or change path pattern." << endl;
395 throw std::runtime_error(
"AlfaTrackCand::CalcTrack() ... track is in left but unknown upper/lower arm");
414 std::runtime_error(
"AlfaTrackCand::CalcTrack() ... track is in right but unknown upper/lower arm");
417 std::runtime_error(
"AlfaTrackCand::CalcTrack() ... track must be left or right");
421 m_x = (xM + xm) / 2.;
422 m_y = (yM + ym) / 2.;
423 m_z = (zM + zm) / 2.;
436 double scalefactortonearpot = z_nearpot -
m_z;
437 double ximpact_nearpot =
m_x +
m_xslope * scalefactortonearpot;
438 double yimpact_nearpot =
m_y +
m_yslope * scalefactortonearpot;
439 double zimpact_nearpot = z_nearpot;
445 double scalefactortofarpot = z_farpot -
m_z;
446 double ximpact_farpot =
m_x +
m_xslope * scalefactortofarpot;
447 double yimpact_farpot =
m_y +
m_yslope * scalefactortofarpot;
448 double zimpact_farpot = z_farpot;
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