ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ALFA_MDMultiple Class Reference

#include <ALFA_MDMultiple.h>

Inheritance diagram for ALFA_MDMultiple:
Collaboration diagram for ALFA_MDMultiple:

Public Member Functions

 ALFA_MDMultiple ()
 
 ALFA_MDMultiple (const ALFA_MDMultiple &obj)
 
ALFA_MDMultipleoperator= (const ALFA_MDMultiple &obj)
 
 ~ALFA_MDMultiple ()
 
StatusCode Initialize (Int_t iRPot, Float_t faMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT], Float_t fbMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT], Int_t iMultiplicityCut, Int_t iNumLayerCut, Int_t iUVCut, Float_t fOverlapCut)
 
StatusCode Execute (const std::list< MDHIT > &ListMDHits)
 
StatusCode Finalize (Float_t(&fRecXPos)[MAXTRACKNUM], Float_t(&fRecYPos)[MAXTRACKNUM])
 
void GetData (Int_t(&iNumU)[MAXTRACKNUM], Int_t(&iNumV)[MAXTRACKNUM], Float_t(&fOvU)[MAXTRACKNUM], Float_t(&fOvV)[MAXTRACKNUM], Int_t(&iFibSel)[MAXTRACKNUM][ALFALAYERSCNT *ALFAPLATESCNT])
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

void Proj_Store (Int_t iFiberSide, Int_t(&iOver)[72000], Float_t fbRef, Int_t iSideFlag)
 
void Proj_Store (const std::vector< Int_t >(&FiberHit)[ALFAPLATESCNT], Int_t(&iOver)[72000], Float_t fbRef, Int_t iSideFlag)
 
void Find_Proj (const Int_t iOver[72000], Float_t fbRef, Float_t &fb, Float_t &fOv, Int_t &fNum)
 
void Finding_Fib (Int_t iFiberSide, Float_t fbRef, Float_t fbRec, Int_t(&iFSel)[ALFAPLATESCNT], Int_t iSideFlag)
 
void Reco_Track (std::vector< double > &b_p, std::vector< double > &b_n, std::vector< double > &Ov_p, std::vector< double > &Ov_n, std::vector< int > &Num_p, std::vector< int > &Num_n, std::vector< int >(&FSel_n)[ALFAPLATESCNT], std::vector< int >(&FSel_p)[ALFAPLATESCNT], std::vector< int >(&Track_match)[2])
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

Int_t m_iRPot
 
Int_t m_iUVCut
 
Int_t m_iMultiplicityCut
 
Int_t m_iNumLayerCut
 
Float_t m_fOverlapCut
 
Float_t m_faMD [RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
 
Float_t m_fbMD [RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
 
Int_t m_iNumHitsLayer [ALFALAYERSCNT *ALFAPLATESCNT]
 
std::vector< Float_t > * m_fRecXPos
 
std::vector< Float_t > * m_fRecYPos
 
std::vector< Float_t > * m_fOvU
 
std::vector< Float_t > * m_fOvV
 
std::vector< Int_t > * m_iNU
 
std::vector< Int_t > * m_iNV
 
std::vector< Int_t > * m_iFibSel [ALFALAYERSCNT *ALFAPLATESCNT]
 
std::vector< Int_t > * m_iTrackMatch [2]
 
std::map< int, FIBERSm_MapLayers
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 27 of file ALFA_MDMultiple.h.

Constructor & Destructor Documentation

◆ ALFA_MDMultiple() [1/2]

ALFA_MDMultiple::ALFA_MDMultiple ( )

Definition at line 8 of file ALFA_MDMultiple.cxx.

8  :
9  AthMessaging("ALFA_MDMultiple")
10 {
11  memset(&m_iNumHitsLayer, 0.0, sizeof(m_iNumHitsLayer));
12 
13  m_fOverlapCut = 0.0;
15  m_iNumLayerCut = 0;
16  m_iRPot = 0;
17  m_iUVCut = 0;
18 
19 
20  m_fRecXPos = nullptr;
21  m_fRecYPos = nullptr;
22  m_fOvU = nullptr;
23  m_fOvV = nullptr;
24  m_iNU = nullptr;
25  m_iNV = nullptr;
26  m_fRecXPos = new std::vector<Float_t>();
27  m_fRecYPos = new std::vector<Float_t>();
28  m_fOvU = new std::vector<Float_t>();
29  m_fOvV = new std::vector<Float_t>();
30  m_iNU = new std::vector<Int_t>();
31  m_iNV = new std::vector<Int_t>();
32 
33  for (auto & iLayer : m_iFibSel)
34  {
35  iLayer = nullptr;
36  iLayer = new std::vector<Int_t>();
37  }
38 
39  m_iTrackMatch[0] = nullptr;
40  m_iTrackMatch[1] = nullptr;
41  m_iTrackMatch[0] = new std::vector<Int_t>();
42  m_iTrackMatch[1] = new std::vector<Int_t>();
43 }

◆ ALFA_MDMultiple() [2/2]

ALFA_MDMultiple::ALFA_MDMultiple ( const ALFA_MDMultiple obj)

Definition at line 45 of file ALFA_MDMultiple.cxx.

45  :
46  AthMessaging("ALFA_MDMultiple")
47 {
48 // std::copy(obj.m_iNumHitsLayer, obj.m_iNumHitsLayer + sizeof(obj.m_iNumHitsLayer)/sizeof(Int_t), m_iNumHitsLayer);
49  std::copy(obj.m_iNumHitsLayer, obj.m_iNumHitsLayer + ALFALAYERSCNT*ALFAPLATESCNT, m_iNumHitsLayer);
50 
51  m_fOverlapCut = obj.m_fOverlapCut;
52  m_iMultiplicityCut = obj.m_iMultiplicityCut;
53  m_iNumLayerCut = obj.m_iNumLayerCut;
54  m_iRPot = obj.m_iRPot;
55  m_iUVCut = obj.m_iUVCut;
56 
57  m_fRecXPos = new std::vector<Float_t>(*obj.m_fRecXPos);
58  m_fRecYPos = new std::vector<Float_t>(*obj.m_fRecYPos);
59  m_fOvU = new std::vector<Float_t>(*obj.m_fOvU);
60  m_fOvV = new std::vector<Float_t>(*obj.m_fOvV);
61  m_iNU = new std::vector<Int_t>(*obj.m_iNU);
62  m_iNV = new std::vector<Int_t>(*obj.m_iNV);
63 
64  for (int iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
65  {
66  m_iFibSel[iLayer] = new std::vector<Int_t>(*obj.m_iFibSel[iLayer]);
67  }
68 
69  m_iTrackMatch[0] = new std::vector<Int_t>(*obj.m_iTrackMatch[0]);
70  m_iTrackMatch[1] = new std::vector<Int_t>(*obj.m_iTrackMatch[1]);
71 }

◆ ~ALFA_MDMultiple()

ALFA_MDMultiple::~ALFA_MDMultiple ( )

Definition at line 123 of file ALFA_MDMultiple.cxx.

124 {
125  if (m_fRecXPos!=nullptr) {delete m_fRecXPos; m_fRecXPos=nullptr;}
126  if (m_fRecYPos!=nullptr) {delete m_fRecYPos; m_fRecYPos=nullptr;}
127  if (m_fOvU!=nullptr) {delete m_fOvU; m_fOvU=nullptr;}
128  if (m_fOvV!=nullptr) {delete m_fOvV; m_fOvV=nullptr;}
129  if (m_iNU!=nullptr) {delete m_iNU; m_iNU=nullptr;}
130  if (m_iNV!=nullptr) {delete m_iNV; m_iNV=nullptr;}
131 
132  for (auto & iLayer : m_iFibSel)
133  {
134  if (iLayer!=nullptr) {delete iLayer; iLayer=nullptr;}
135  }
136  if (m_iTrackMatch[0]!=nullptr) {delete m_iTrackMatch[0]; m_iTrackMatch[0]=nullptr;}
137  if (m_iTrackMatch[1]!=nullptr) {delete m_iTrackMatch[1]; m_iTrackMatch[1]=nullptr;}
138 }

Member Function Documentation

◆ Execute()

StatusCode ALFA_MDMultiple::Execute ( const std::list< MDHIT > &  ListMDHits)

Definition at line 167 of file ALFA_MDMultiple.cxx.

168 {
169  ATH_MSG_DEBUG("ALFA_MDMultiple::Execute()");
170 
171  FIBERS structFibers;
172  m_MapLayers.clear();
173 
174  std::list<MDHIT>::const_iterator iter;
175  for (iter=ListMDHits.begin(); iter!=ListMDHits.end(); ++iter)
176  {
177  if (m_iRPot == (*iter).iRPot)
178  {
179  if(m_MapLayers.find((*iter).iPlate)==m_MapLayers.end())
180  {
181  structFibers.ListFibers.clear();
182  m_MapLayers.insert(std::pair<int, FIBERS>((*iter).iPlate, structFibers));
183  m_MapLayers[(*iter).iPlate].ListFibers.push_back((*iter).iFiber);
184  }
185  else m_MapLayers[(*iter).iPlate].ListFibers.push_back((*iter).iFiber);
186  }
187  }
188 
189  // RECONSTRUCTION
190  std::vector<double> b_p, b_n;
191  std::vector<double> Ov_p, Ov_n;
192  std::vector<int> Num_p, Num_n;
193  std::vector<int> FSel_n[ALFAPLATESCNT], FSel_p[ALFAPLATESCNT];
194  std::vector<int> iTrackMatch[2];
195 
196 
197  //Checking that the multiplicity cut conditions are satisfied
198  //At least more than UV_cut layers have a multiplicity lower than multi_cut
199 // Int_t iNumUFiberHits=0, iNumVFiberHits=0;
200 // for (Int_t iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
201 // {
202 // if ((Int_t)m_MapLayers[iLayer].ListFibers.size()<=m_iMultiplicityCut && (Int_t)m_MapLayers[iLayer].ListFibers.size()>0)
203 // {
204 // // prohozen U/V?
205 // // if (fmod(double(iLayer),double(2)) == 1) iNumUFiberHits++;
206 // // else iNumVFiberHits++;
207 //
208 // if (fmod(double(iLayer),double(2)) == 0) iNumUFiberHits++;
209 // else iNumVFiberHits++;
210 // }
211 // }
212 
213 // if (iNumUFiberHits>=m_iMultiplicityCut && iNumVFiberHits>=m_iMultiplicityCut)
214  {
215  Reco_Track(b_p, b_n, Ov_p, Ov_n, Num_p, Num_n, FSel_n, FSel_p, iTrackMatch);
216 
217  //Now sorting the tracks using NumU+NumV criteria -------------------------------
218  Int_t iCntSort=0;
219  Int_t iMaxSum=0;
220  std::vector<Int_t> MaxTrackID;
221  Int_t iTmpMaxTrackID = -1;
222 
223 // std::cout << "b_p.size = " << b_p.size() << std::endl;
224  while (iCntSort<(Int_t)b_p.size())
225  {
226  iMaxSum=0;
227  for (Int_t i=0; i<(Int_t)b_p.size(); i++)
228  {
229  //Checking that the maximum was not already used
230  Bool_t MaxUsed=false;
231 
232  for (int j : MaxTrackID)
233  {
234  if (i==j) {MaxUsed = true; break;}
235  }
236 
237  if (((Num_p[i]+Num_n[i])>iMaxSum) && (!MaxUsed))
238  {
239  iMaxSum = Num_p[i]+Num_n[i];
240  iTmpMaxTrackID=i;
241  }
242  }
243  MaxTrackID.push_back(iTmpMaxTrackID);
244  iCntSort++;
245  }
246 
247 // std::cout << "MaxTrackID size = " << MaxTrackID.size() << std::endl;
248 
249 // for (Int_t i=0; i<(Int_t)b_p.size();i++)
250  for (int i : MaxTrackID)
251  {
252 // std::cout << " [" << i << "] = " << MaxTrackID[i] << std::endl;
253 // if (fabs((b_p[i]+b_n[i])/2.0) < 135.5)
254  {
255  m_fRecXPos->push_back((b_p[i]-b_n[i])/2.0);
256  m_fRecYPos->push_back((b_p[i]+b_n[i])/2.0);
257 
258  m_fOvU->push_back(Ov_p[i]);
259  m_fOvV->push_back(Ov_n[i]);
260  m_iNU->push_back(Num_p[i]);
261  m_iNV->push_back(Num_n[i]);
262 
263  //the U and V are somehow interchanged, therefore they are here interchanged back.
264 // m_fOvU->push_back(Ov_n[MaxTrackID[i]]); //just for test
265 // m_fOvV->push_back(Ov_p[MaxTrackID[i]]); //just for test
266 // m_iNU->push_back(Num_n[MaxTrackID[i]]); //just for test
267 // m_iNV->push_back(Num_p[MaxTrackID[i]]); //just for test
268 
269  m_iTrackMatch[0]->push_back(iTrackMatch[0][i]);
270  m_iTrackMatch[1]->push_back(iTrackMatch[1][i]);
271 
272 // std::cout << "iTrackMatch[0][" << MaxTrackID[i] << "] = " << iTrackMatch[0][MaxTrackID[i]] << std::endl;
273 // std::cout << "iTrackMatch[1][" << MaxTrackID[i] << "] = " << iTrackMatch[1][MaxTrackID[i]] << std::endl;
274 // std::cout << "x, y = " << (b_p[MaxTrackID[i]]-b_n[MaxTrackID[i]])/2.0 << ", " << (b_p[MaxTrackID[i]]+b_n[MaxTrackID[i]])/2.0 << std::endl;
275 
276  for (Int_t iPlate=0; iPlate<ALFAPLATESCNT; iPlate++)
277  {
278  m_iFibSel[2*iPlate]->push_back(FSel_p[iPlate][i]);
279  m_iFibSel[2*iPlate+1]->push_back(FSel_n[iPlate][i]);
280 // m_iFibSel[2*iPlate+1]->push_back(FSel_p[iPlate][MaxTrackID[i]]); //just for test
281 // m_iFibSel[2*iPlate]->push_back(FSel_n[iPlate][MaxTrackID[i]]); //just for test
282  }
283  }
284  }
285 // {
287 // {
288 // m_fRecXPos->push_back((b_p[i]-b_n[i])/2.0);
289 // m_fRecYPos->push_back((b_p[i]+b_n[i])/2.0);
290 
295 
296 // //the U and V are somehow interchanged, therefore they are here interchanged back.
297 // m_fOvU->push_back(Ov_n[i]);
298 // m_fOvV->push_back(Ov_p[i]);
299 // m_iNU->push_back(Num_n[i]);
300 // m_iNV->push_back(Num_p[i]);
301 
302 // m_iTrackMatch[0]->push_back(iTrackMatch[0][i]);
303 // m_iTrackMatch[1]->push_back(iTrackMatch[1][i]);
304 
305 // std::cout << "iTrackMatch[0][" << i << "] = " << iTrackMatch[0][i] << std::endl;
306 // std::cout << "iTrackMatch[1][" << i << "] = " << iTrackMatch[1][i] << std::endl;
307 // std::cout << "x, y = " << (b_p[i]-b_n[i])/2.0 << ", " << (b_p[i]+b_n[i])/2.0 << std::endl;
308 
309 // for (Int_t iPlate=0; iPlate<ALFAPLATESCNT; iPlate++)
310 // {
313 // m_iFibSel[2*iPlate+1]->push_back(FSel_p[iPlate][i]);
314 // m_iFibSel[2*iPlate]->push_back(FSel_n[iPlate][i]);
315 // }
316 // }
317 
318 // }
319 
320 // std::cout << "------------------------------------------------------------------" << std::endl;
321  }
322 
323 
324  return StatusCode::SUCCESS;
325 }

◆ Finalize()

StatusCode ALFA_MDMultiple::Finalize ( Float_t(&)  fRecXPos[MAXTRACKNUM],
Float_t(&)  fRecYPos[MAXTRACKNUM] 
)

Definition at line 327 of file ALFA_MDMultiple.cxx.

328 {
329  ATH_MSG_DEBUG("ALFA_MDMultiple::Finalize()");
330 
331  Int_t iTrackNum=0, iSize=0;
332  std::fill_n(&fRecXPos[0], sizeof(fRecXPos)/sizeof(Float_t), -9999.0);
333  std::fill_n(&fRecYPos[0], sizeof(fRecYPos)/sizeof(Float_t), -9999.0);
334 
335  iSize = (m_fRecXPos->size() <= m_fRecYPos->size())? m_fRecXPos->size() : m_fRecYPos->size();
336  iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
337 
338  for (Int_t i=0; i<iTrackNum; i++)
339  {
340  fRecXPos[i] = m_fRecXPos->at(i);
341  fRecYPos[i] = m_fRecYPos->at(i);
342  }
343 
344  return StatusCode::SUCCESS;
345 }

◆ Find_Proj()

void ALFA_MDMultiple::Find_Proj ( const Int_t  iOver[72000],
Float_t  fbRef,
Float_t &  fb,
Float_t &  fOv,
Int_t &  fNum 
)
private

Definition at line 457 of file ALFA_MDMultiple.cxx.

458 {
459  ATH_MSG_DEBUG("ALFA_MDMultiple::Find_Proj()");
460 
461  std::vector<int> iSizePlateau;
462  Int_t iNumFib=0;
463  Int_t p_tmp_min;
464 // Int_t p_tmp_max;
465  Float_t p_min;
466  Float_t p_max;
467 
468  //Determine the maximum number of overlapping fibers in both directions
469  for (Int_t i=0;i<72000;i++)
470  {
471  if (iOver[i]>iNumFib) iNumFib=iOver[i];
472  }
473 
474  // Filling array for all values equal to the maximum
475  if (iNumFib>=m_iUVCut)
476  {
477  for (Int_t i=0;i<72000;i++)
478  {
479  if (iOver[i]==iNumFib)
480  {
481  iSizePlateau.push_back(i);
482  }
483  }
484 
485 // Finding first and last position where the maximum is found
486  p_min = -36.0 + double(iSizePlateau.front())*1e-3;
487  p_tmp_min = iSizePlateau.front();
488 
489  p_max = -36.0 + double(iSizePlateau.back())*1e-3;
490 // p_tmp_max = iSizePlateau.back();
491 
492 // Making sure that the plateau belongs to the same track
493  Int_t full_width = iSizePlateau.size();
494 
495  for (Int_t i=0; i<full_width; i++)
496  {
497  if (iSizePlateau[full_width-i-1]-p_tmp_min < 500)
498  {
499 // p_tmp_max = iSizePlateau[full_width-i-1];
500  p_max = -36.0 + double(iSizePlateau[full_width-i-1])*1e-3;
501 
502  break;
503  }
504  }
505 
506  if ((p_max-p_min)<m_fOverlapCut)
507  {
508 // Storing the coordinate of the maximum
509  fb = fbRef+(p_min+p_max)/sqrt(2.0);
510  fOv = p_max-p_min;
511  }
512  }
513 
514  iNum = iNumFib;
515 }

◆ Finding_Fib()

void ALFA_MDMultiple::Finding_Fib ( Int_t  iFiberSide,
Float_t  fbRef,
Float_t  fbRec,
Int_t(&)  iFSel[ALFAPLATESCNT],
Int_t  iSideFlag 
)
private

Definition at line 523 of file ALFA_MDMultiple.cxx.

524 {
525  ATH_MSG_DEBUG("ALFA_MDMultiple::Finding_Fib()");
526 
527  Float_t b_pos, b_neg;
528  Float_t x, y, x_tmp, y_tmp;
529  Float_t min_dist;
530  Float_t dist_x, dist_y;
531  Float_t dist_full;
532  Float_t fib_dist;
533 // Int_t gFib;
534 
535  if (iSideFlag==0)
536  {
537  b_neg= fbRef;
538  b_pos= fbRec;
539  }
540  else
541  {
542  b_neg= fbRec;
543  b_pos= fbRef;
544  }
545 
546  x= (b_pos-b_neg)/2.0;
547  y= (b_neg+b_pos)/2.0;
548 
549  for (int & iLayer : iFSel) iLayer = 9999;
550 
551  //For each layer, we determine the hit fiber which is closest to the track
552  std::list<int>::iterator intIter;
553  for (Int_t iLayer = 0; iLayer<ALFAPLATESCNT; iLayer++)
554  {
555  min_dist=0.24;
556 // gFib = 9999;
557 
558  // coverity bug 13956 fixed
559 // for (intIter=m_MapLayers[2*iLayer+iFiberSide].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer+iFiberSide].ListFibers.end(); intIter++)
560 // {
561 // if (*intIter!=9999)
562 // {
563 // x_tmp = (y-m_fbMD[m_iRPot][iLayer*2+iSideFlag][*intIter])/m_faMD[m_iRPot][iLayer*2+iSideFlag][*intIter];
564 // y_tmp = m_faMD[m_iRPot][iLayer*2+iSideFlag][*intIter]*x+m_fbMD[m_iRPot][iLayer*2+iSideFlag][*intIter];
565 
566 // dist_x = TMath::Abs(x-x_tmp);
567 // dist_y = TMath::Abs(y-y_tmp);
568 
569 // dist_full = sqrt(dist_x*dist_x+dist_y*dist_y);
570 // fib_dist = sqrt(TMath::Power((dist_x+dist_y)/2.0,2)-TMath::Power(dist_full/2.0,2));
571 
572 // if (fib_dist <= min_dist)
573 // {
574 // min_dist = fib_dist;
575 // gFib = *intIter;
576 // iFSel[iLayer] = gFib;
577 // }
578 // }
579 // }
580 
581  const unsigned int thisSideLayer = iLayer*2+iSideFlag;
582  const unsigned int thisLayer = 2*iLayer+iFiberSide;
583  const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
584  for (const auto & thisFiber:thisFiberContainer)
585  {
586  if (thisFiber != 9999)
587  {
588  x_tmp = (y-m_fbMD[m_iRPot][thisSideLayer][thisFiber])/m_faMD[m_iRPot][thisSideLayer][thisFiber];
589  y_tmp = m_faMD[m_iRPot][thisSideLayer][thisFiber]*x+m_fbMD[m_iRPot][thisSideLayer][thisFiber];
590 
591  dist_x = TMath::Abs(x-x_tmp);
592  dist_y = TMath::Abs(y-y_tmp);
593 
594  dist_full = sqrt(dist_x*dist_x+dist_y*dist_y);
595  fib_dist = sqrt(TMath::Power((dist_x+dist_y)/2.0,2)-TMath::Power(dist_full/2.0,2));
596 
597  if (fib_dist <= min_dist)
598  {
599  min_dist = fib_dist;
600  iFSel[iLayer] = thisFiber;
601  }
602  }
603  }
604 
605 
606 /*
607  std::list<int> listFibersTmp = m_MapLayers[2*iLayer+iFiberSide].ListFibers;
608  std::list<int>::const_iterator itBeg = listFibersTmp.begin();
609  std::list<int>::const_iterator itEnd = listFibersTmp.end();
610  for (; itBeg!=itEnd; ++itBeg)
611  {
612  if (*itBeg!=9999)
613  {
614  x_tmp = (y-m_fbMD[m_iRPot][iLayer*2+iSideFlag][*itBeg])/m_faMD[m_iRPot][iLayer*2+iSideFlag][*itBeg];
615  y_tmp = m_faMD[m_iRPot][iLayer*2+iSideFlag][*itBeg]*x+m_fbMD[m_iRPot][iLayer*2+iSideFlag][*itBeg];
616 
617  dist_x = TMath::Abs(x-x_tmp);
618  dist_y = TMath::Abs(y-y_tmp);
619 
620  dist_full = sqrt(dist_x*dist_x+dist_y*dist_y);
621  fib_dist = sqrt(TMath::Power((dist_x+dist_y)/2.0,2)-TMath::Power(dist_full/2.0,2));
622 
623  if (fib_dist <= min_dist)
624  {
625  min_dist = fib_dist;
626  gFib = *itBeg;
627 
628  iFSel[iLayer] = gFib;
629  }
630  }
631  }
632 */
633 
634  }
635 }

◆ GetData()

void ALFA_MDMultiple::GetData ( Int_t(&)  iNumU[MAXTRACKNUM],
Int_t(&)  iNumV[MAXTRACKNUM],
Float_t(&)  fOvU[MAXTRACKNUM],
Float_t(&)  fOvV[MAXTRACKNUM],
Int_t(&)  iFibSel[MAXTRACKNUM][ALFALAYERSCNT *ALFAPLATESCNT] 
)

Definition at line 992 of file ALFA_MDMultiple.cxx.

993 {
994  ATH_MSG_DEBUG("ALFA_MDMultiple::GetData()");
995 
996  Int_t iTrackNum;
997  Int_t iSize;
998  std::fill_n(&fOvU[0], sizeof(fOvU)/sizeof(Float_t), -9999.0);
999  std::fill_n(&fOvV[0], sizeof(fOvV)/sizeof(Float_t), -9999.0);
1000  std::fill_n(&iNumU[0], sizeof(iNumU)/sizeof(Int_t), -9999);
1001  std::fill_n(&iNumV[0], sizeof(iNumV)/sizeof(Int_t), -9999);
1002  std::fill_n(&iFibSel[0][0], sizeof(iFibSel)/sizeof(Int_t), -9999);
1003 
1004  iTrackNum=0;
1005  iSize=0;
1006  for (auto & iLayer : m_iFibSel)
1007  {
1008  iSize = ((Int_t)iLayer->size() > iSize)? iLayer->size() : iSize;
1009  }
1010  iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
1011  for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
1012  {
1013  for (Int_t iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
1014  {
1015  iFibSel[iTrack][iLayer] = m_iFibSel[iLayer]->at(iTrack);
1016  }
1017  }
1018 
1019  iTrackNum=0;
1020  iSize=0;
1021  iSize = (m_fOvU->size() <= m_fOvV->size())? m_fOvU->size() : m_fOvV->size();
1022  iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
1023  for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
1024  {
1025  fOvU[iTrack] = m_fOvU->at(iTrack);
1026  fOvV[iTrack] = m_fOvV->at(iTrack);
1027  }
1028 
1029  iTrackNum=0;
1030  iSize=0;
1031  iSize = (m_iNU->size() <= m_iNV->size())? m_iNU->size() : m_iNV->size();
1032  iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
1033  for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
1034  {
1035  iNumU[iTrack] = m_iNU->at(iTrack);
1036  iNumV[iTrack] = m_iNV->at(iTrack);
1037  }
1038 }

◆ Initialize()

StatusCode ALFA_MDMultiple::Initialize ( Int_t  iRPot,
Float_t  faMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT],
Float_t  fbMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT],
Int_t  iMultiplicityCut,
Int_t  iNumLayerCut,
Int_t  iUVCut,
Float_t  fOverlapCut 
)

Definition at line 140 of file ALFA_MDMultiple.cxx.

141 {
142  ATH_MSG_DEBUG("ALFA_MDMultiple::Initialize()");
143 
144  m_iRPot = iRPot;
145  m_iUVCut = iUVCut;
146  m_iNumLayerCut = iNumLayerCut;
147  m_iMultiplicityCut = iMultiplicityCut;
148  m_fOverlapCut = fOverlapCut;
149 
150  for (Int_t iPot=0; iPot<RPOTSCNT; iPot++)
151  {
152  for (Int_t iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
153  {
154  for (Int_t iFiber=0; iFiber<ALFAFIBERSCNT; iFiber++)
155  {
156  m_faMD[iPot][iLayer][iFiber] = faMD[iPot][iLayer][iFiber];
157  m_fbMD[iPot][iLayer][iFiber] = fbMD[iPot][iLayer][iFiber];
158  }
159  }
160  }
161 
162 // std::cout << "m_iMultiplicityCut, m_iUVCut = " << m_iMultiplicityCut << ", " << m_iUVCut << std::endl;
163 
164  return StatusCode::SUCCESS;
165 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ operator=()

ALFA_MDMultiple & ALFA_MDMultiple::operator= ( const ALFA_MDMultiple obj)

Definition at line 73 of file ALFA_MDMultiple.cxx.

74 {
75  if (this != &obj)
76  {
77 // std::swap(m_iNumHitsLayer, obj.m_iNumHitsLayer);
78  Int_t nLayers = ALFALAYERSCNT*ALFAPLATESCNT;
79 
80  for (int i = 0; i < nLayers; i++)
81  m_iNumHitsLayer[i] = obj.m_iNumHitsLayer[i];
82 
83  m_fOverlapCut = obj.m_fOverlapCut;
84  m_iMultiplicityCut = obj.m_iMultiplicityCut;
85  m_iNumLayerCut = obj.m_iNumLayerCut;
86  m_iRPot = obj.m_iRPot;
87  m_iUVCut = obj.m_iUVCut;
88 
89 // std::swap(m_fRecXPos, obj.m_fRecXPos);
90 // std::swap(m_fRecYPos, obj.m_fRecYPos);
91 // std::swap(m_fOvU , obj.m_fOvU);
92 // std::swap(m_fOvV , obj.m_fOvV);
93 // std::swap(m_iNU , obj.m_iNU);
94 // std::swap(m_iNV , obj.m_iNV);
95 // std::swap(m_iFibSel, obj.m_iFibSel);
96 // std::swap(m_iTrackMatch, obj.m_iTrackMatch);
97 
98  std::copy(m_fRecXPos->begin(), m_fRecXPos->end(), obj.m_fRecXPos->begin());
99  std::copy(m_fRecYPos->begin(), m_fRecYPos->end(), obj.m_fRecYPos->begin());
100  std::copy(m_fOvU->begin(), m_fOvU->end(), obj.m_fOvU->begin());
101  std::copy(m_fOvV->begin(), m_fOvV->end(), obj.m_fOvV->begin());
102  std::copy(m_iNU->begin(), m_iNU->end(), obj.m_iNU->begin());
103  std::copy(m_iNV->begin(), m_iNV->end(), obj.m_iNV->begin());
104 
105  for (int iLayer = 0; iLayer < nLayers; iLayer++)
106  {
107  m_iFibSel[iLayer] = nullptr;
108  m_iFibSel[iLayer] = new std::vector<Int_t>();
109  std::copy(m_iFibSel[iLayer]->begin(), m_iFibSel[iLayer]->end(), obj.m_iFibSel[iLayer]->begin());
110  }
111 
112  m_iTrackMatch[0] = nullptr;
113  m_iTrackMatch[1] = nullptr;
114  m_iTrackMatch[0] = new std::vector<Int_t>();
115  m_iTrackMatch[1] = new std::vector<Int_t>();
116  std::copy(m_iTrackMatch[0]->begin(), m_iTrackMatch[0]->end(), obj.m_iTrackMatch[0]->begin());
117  std::copy(m_iTrackMatch[1]->begin(), m_iTrackMatch[1]->end(), obj.m_iTrackMatch[1]->begin());
118  }
119 
120  return *this;
121 }

◆ Proj_Store() [1/2]

void ALFA_MDMultiple::Proj_Store ( const std::vector< Int_t >(&)  FiberHit[ALFAPLATESCNT],
Int_t(&)  iOver[72000],
Float_t  fbRef,
Int_t  iSideFlag 
)
private

Definition at line 415 of file ALFA_MDMultiple.cxx.

416 {
417  ATH_MSG_DEBUG("ALFA_MDMultiple::Pro_Store()");
418 
419  Float_t fSign;
420  Float_t fXInter, fYInter;
421  Float_t FibCen;
422 
423  if (m_faMD[m_iRPot][iSideFlag][0]>0) fSign=1.0;
424  else fSign=-1.0;
425 
426  for (int & iBin : iOver)
427  {
428  iBin=0;
429  }
430 
431  int iHit = 9999;
432  for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
433  {
434  for (UInt_t j=0; j<FiberHit[iLayer].size(); j++)
435  {
436  iHit = FiberHit[iLayer][j];
437  if (iHit!=9999)
438  {
439  //Depending on layer orientation, computing the projection of the hit fiber
440  fXInter= fSign*(fbRef-m_fbMD[m_iRPot][iLayer*2+iSideFlag][iHit])/(1+fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][iHit]);
441  fYInter= (fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][iHit]*fbRef+m_fbMD[m_iRPot][iLayer*2+iSideFlag][iHit])/(1+fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][iHit])-fbRef;
442  FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
443 
444  //Filling the table with the hit fiber
445  for (Int_t iBin=0; iBin<480; iBin++)
446  {
447  iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
448  }
449  }
450  }
451  }
452 }

◆ Proj_Store() [2/2]

void ALFA_MDMultiple::Proj_Store ( Int_t  iFiberSide,
Int_t(&)  iOver[72000],
Float_t  fbRef,
Int_t  iSideFlag 
)
private

Definition at line 350 of file ALFA_MDMultiple.cxx.

351 {
352  ATH_MSG_DEBUG("ALFA_MDMultiple::Pro_Store()");
353 
354  Float_t fSign;
355  Float_t fXInter, fYInter;
356  Float_t FibCen;
357 
358  if (m_faMD[m_iRPot][iSideFlag][0]>0) fSign=1.0;
359  else fSign=-1.0;
360 
361  for (int & iBin : iOver)
362  {
363  iBin=0;
364  }
365 
366  // coverity bug 13955 fixed bellow
367 // std::list<int>::iterator intIter;
368 // for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
369 // {
370 // for (intIter=m_MapLayers[2*iLayer+iFiberSide].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer+iFiberSide].ListFibers.end(); intIter++)
371 // {
372 // if (*intIter!=9999)
373 // {
374 // //Depending on layer orientation, computing the projection of the hit fiber
375 // fXInter= fSign*(fbRef-m_fbMD[m_iRPot][iLayer*2+iSideFlag][*intIter])/(1+fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][*intIter]);
376 // fYInter= (fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][*intIter]*fbRef+m_fbMD[m_iRPot][iLayer*2+iSideFlag][*intIter])/(1+fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][*intIter])-fbRef;
377 // FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
378 
379 // //Filling the table with the hit fiber
380 // for (Int_t iBin=0; iBin<480; iBin++)
381 // {
382 // iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
383 // }
384 // }
385 // }
386 // }
387 
388  for (UInt_t iLayer=0; iLayer!=ALFAPLATESCNT; ++iLayer)
389  {
390  const unsigned int thisSideLayer = iLayer*2+iSideFlag;
391  const unsigned int thisLayer = 2*iLayer+iFiberSide;
392  const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
393  for (const auto & thisFiber:thisFiberContainer)
394  {
395  if (thisFiber!=9999)
396  {
397  //Depending on layer orientation, computing the projection of the hit fiber
398  fXInter= fSign*(fbRef-m_fbMD[m_iRPot][thisSideLayer][thisFiber])/(1+fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber]);
399  fYInter= (fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber]*fbRef+m_fbMD[m_iRPot][thisSideLayer][thisFiber])/(1+fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber])-fbRef;
400  FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
401 
402  //Filling the table with the hit fiber
403  for (Int_t iBin=0; iBin<480; iBin++)
404  {
405  iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
406  }
407  }
408  }
409  }
410 }

◆ Reco_Track()

void ALFA_MDMultiple::Reco_Track ( std::vector< double > &  b_p,
std::vector< double > &  b_n,
std::vector< double > &  Ov_p,
std::vector< double > &  Ov_n,
std::vector< int > &  Num_p,
std::vector< int > &  Num_n,
std::vector< int >(&)  FSel_n[ALFAPLATESCNT],
std::vector< int >(&)  FSel_p[ALFAPLATESCNT],
std::vector< int >(&)  Track_match[2] 
)
private

Definition at line 641 of file ALFA_MDMultiple.cxx.

646 {
647  ATH_MSG_DEBUG("ALFA_MDMultiple::Reco_Track()");
648 
649 // Int_t FSel_pos[ALFAPLATESCNT];
650  Int_t FSel_neg[ALFAPLATESCNT];
651  Int_t FSel_pos_tmp[ALFAPLATESCNT];
652  Int_t Over_p[72000];
653  Int_t Over_n[72000];
654  Int_t cnt_step_U=0;
655  Int_t cnt_step_V=0;
656  Int_t NumU=0;
657  Int_t NumV=0;
658  Float_t b_ref_p;
659  Float_t b_ref_n;
660  Float_t OvU;
661  Float_t OvV;
662  Float_t b_pos;
663  Float_t b_neg;
664 
665  std::list<int>::iterator intIter;
666 
667 
668  //clear
669  for (Int_t i=0; i<ALFAPLATESCNT; i++)
670  {
671  FSel_n[i].clear();
672  FSel_p[i].clear();
673  }
674  b_n.clear();
675  b_p.clear();
676  Ov_n.clear();
677  Ov_p.clear();
678  Num_n.clear();
679  Num_p.clear();
680 
681  int iNumUFiberHits = 0;
682  int iNumVFiberHits = 0;
683 
684  std::vector<Int_t> Fiber_MB_tmp[ALFAPLATESCNT];
685  std::vector<Int_t> Fiber_MB_n[ALFAPLATESCNT];
686 
687  //fix coverity 13959 - following code replaced by next for loop
688 // std::list<int>::iterator it;
689 // for (UInt_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
690 // {
691 // Fiber_MB_n[iLayer].clear();
692 // for (it=m_MapLayers[2*iLayer+1].ListFibers.begin(); it!=m_MapLayers[2*iLayer+1].ListFibers.end(); it++)
694 // {
695 // Fiber_MB_n[iLayer].push_back(*it);
696 // }
697 // }
698 
699  for (UInt_t iLayer=0; iLayer!=ALFAPLATESCNT; ++iLayer)
700  {
701  Fiber_MB_n[iLayer].clear();
702  const unsigned int thisLayer=2*iLayer+1;
703  const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
704  for (const auto & thisFiber:thisFiberContainer)
705  {
706 // std::cout << "thisFiber: " << thisFiber << std::endl;
707  Fiber_MB_n[iLayer].push_back(thisFiber);
708  }
709  }
710  do
711  {
712  b_ref_n=-127.0;
713  b_ref_p=-127.0;
714 
715 // First projection step on U side
716 // -------------------------------
717 // filling the array for U side with reference value
718  Proj_Store(0, Over_p, b_ref_n, 0);
719 // Proj_Store(1, Over_p, b_ref_n, 0); //just for test
720 // Proj_Store(1, Over_p, b_ref_n, 1); //just for test
721 
722 // Find first maxium
723  Find_Proj(Over_p, b_ref_n, b_pos, OvU, NumU);
724 
725  Finding_Fib(0, b_ref_n, b_pos, FSel_pos_tmp, 0);
726 // Finding_Fib(1, b_ref_n, b_pos, FSel_pos_tmp, 0); //just for test
727 // Finding_Fib(1, b_ref_n, b_pos, FSel_pos_tmp, 1); //just for test
728  for (int i=0; i<ALFAPLATESCNT; i++)
729  {
730  Fiber_MB_tmp[i].clear();
731  Fiber_MB_tmp[i].push_back(FSel_pos_tmp[i]);
732  }
733 
734 // // added ----------
735 // std::cout << "FSel_pos after 1st U proj: ";
736 // for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
737 // {
738 // std::cout << " " << FSel_pos[iLayer];
739 // }
740 // std::cout << std::endl;
741 
742  //Then reconstruction all tracks possible using the second side
743  for (UInt_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
744  {
745  m_MapLayers[2*iLayer+1].ListFibers.clear();
746 // m_MapLayers[2*iLayer].ListFibers.clear(); //just for test
747  for (unsigned int i=0; i<Fiber_MB_n[iLayer].size(); i++)
748  {
749  m_MapLayers[2*iLayer+1].ListFibers.push_back(Fiber_MB_n[iLayer][i]);
750 // m_MapLayers[2*iLayer].ListFibers.push_back(Fiber_MB_n[iLayer][i]); //just for test
751  }
752  }
753 
754 // std::cout << "NumU " << NumU << std::endl;
755 
756 // Then reconstruct all tracks possible using the second side
757  if (NumU>=m_iUVCut)
758  {
759  cnt_step_V=0;
760  do
761  {
762  // New Part to apply the multiplicity cut at each iteration
763  iNumUFiberHits=0;
764  iNumVFiberHits=0;
765  for (UInt_t iLayer=0;iLayer<ALFAPLATESCNT;iLayer++)
766  {
767  if ((Int_t)m_MapLayers[2*iLayer].ListFibers.size()<=m_iMultiplicityCut && !m_MapLayers[2*iLayer].ListFibers.empty()) iNumUFiberHits++;
768  if ((Int_t)m_MapLayers[2*iLayer+1].ListFibers.size()<=m_iMultiplicityCut && !m_MapLayers[2*iLayer+1].ListFibers.empty()) iNumVFiberHits++;
769 // if ((Int_t)m_MapLayers[2*iLayer+1].ListFibers.size()<=m_iMultiplicityCut && m_MapLayers[2*iLayer+1].ListFibers.size()>0) iNumUFiberHits++; //just for test
770 // if ((Int_t)m_MapLayers[2*iLayer].ListFibers.size()<=m_iMultiplicityCut && m_MapLayers[2*iLayer].ListFibers.size()>0) iNumVFiberHits++; //just for test
771  }
772 
773 // std::cout << "2nd multiplicity cut " << iNumUFiberHits << " " << iNumVFiberHits << std::endl;
774 
775  if (iNumUFiberHits>=m_iNumLayerCut && iNumVFiberHits>=m_iNumLayerCut)
776  {
777  //First projection on V side
778  //-------------------------------
779  //filling the array for V side with reference value
780  Proj_Store(1, Over_n, b_ref_p, 1);
781 // Proj_Store(0, Over_n, b_ref_p, 1); //just for test
782 // Proj_Store(0, Over_n, b_ref_p, 0); //just for test
783  Find_Proj(Over_n, b_ref_p, b_neg, OvV, NumV);
784 
785 // std::cout << "NumV " << NumV << std::endl;
786 
787  if (NumV>=m_iUVCut)
788  {
789  //Now make the second projection step
790  //-----------------------------------
791  //U side
792 // Proj_Store(0, Over_p, b_neg, 0);
793  // Proj_Store(1, Over_p, b_neg, 0); //just for test
794  Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 0);
795 // Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 1); //just for test
796  Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
797 
798  //V side
799  Proj_Store(1, Over_n, b_pos, 1);
800 // Proj_Store(0, Over_n, b_pos, 1); //just for test
801 // Proj_Store(0, Over_n, b_pos, 0); //just for test
802  Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
803 
804  //Third projection steps
805  //----------------------
806  //U side
807 // Proj_Store(0, Over_p, b_neg, 0);
808  // Proj_Store(1, Over_p, b_neg, 0); //just for test
809  Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 0);
810 // Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 1); //just for test
811  Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
812 
813  //V side
814  Proj_Store(1, Over_n, b_pos, 1);
815 // Proj_Store(0, Over_n, b_pos, 1); //just for test
816 // Proj_Store(0, Over_n, b_pos, 0); //just for test
817  Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
818 
819  // //We store the information in the vector
820  b_p.push_back(b_pos);
821  Ov_p.push_back(OvU);
822  Num_p.push_back(NumU);
823 
824  b_n.push_back(b_neg);
825  Ov_n.push_back(OvV);
826  Num_n.push_back(NumV);
827 
828  iTrackMatch[0].push_back(cnt_step_U);
829  iTrackMatch[1].push_back(cnt_step_V);
830 
831  //Once done we want to remove the hit belonging to the first track on side V
832  //We first find the corresponding fibers
833 // Finding_Fib(0,b_neg, b_pos, FSel_pos, 0);
834  Finding_Fib(1,b_pos, b_neg, FSel_neg, 1);
835 // Finding_Fib(1,b_neg, b_pos, FSel_pos, 0); //just for test
836 // Finding_Fib(0,b_pos, b_neg, FSel_neg, 1); //just for test
837 // Finding_Fib(1,b_neg, b_pos, FSel_pos, 1); //just for test
838 // Finding_Fib(0,b_pos, b_neg, FSel_neg, 0); //just for test
839 
840  for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
841  {
842  FSel_n[iLayer].push_back(FSel_neg[iLayer]);
843 // FSel_p[iLayer].push_back(FSel_pos[iLayer]);
844  FSel_p[iLayer].push_back(FSel_pos_tmp[iLayer]);
845  }
846 
847  //added -----------------------------------------------------
848 // std::cout << "FSel_n ";
849 // for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
850 // {
851 // std::cout << " " << FSel_neg[iLayer];
852 // }
853 // std::cout << std::endl;
854 // std::cout << "FSel_p ";
855 // for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
856 // {
857 // std::cout << " " << FSel_pos[iLayer];
858 // }
859 // std::cout << std::endl;
860 
861  //Removing fibers used for the first track for V Side
862  for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; ++iLayer)
863  {
864  // coverity bug 30038 fixed bellow
865 // std::list<int>::iterator itBeg = m_MapLayers[2*iLayer+1].ListFibers.begin();
866 // std::list<int>::iterator itEnd = m_MapLayers[2*iLayer+1].ListFibers.end();
867 // for (; itBeg != itEnd; itBeg++)
868 // {
869 // if (*itBeg == (int)FSel_neg[iLayer])
870 // {
871 // m_MapLayers[2*iLayer+1].ListFibers.erase(itBeg);
872 // break;
873 // }
874 // }
875 
876  const unsigned int thisLayer=2*iLayer+1;
877  const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
878  for (const auto & thisFiber:thisFiberContainer)
879  {
880  if (thisFiber == (int)FSel_neg[iLayer])
881  {
882  auto it = std::find(begin(thisFiberContainer), end(thisFiberContainer), thisFiber);
883  m_MapLayers[2*iLayer+1].ListFibers.erase(it);
884  break;
885  }
886  }
887 
888 
889 // for (intIter=m_MapLayers[2*iLayer+1].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer+1].ListFibers.end(); intIter++)
891 // {
893 // if (*intIter==(int)FSel_neg[iLayer])
894 // {
896 // m_MapLayers[2*iLayer+1].ListFibers.erase(intIter);
898 // break;
899 // }
900 // }
901  }
902  cnt_step_V++;
903  }
904  }
905  else NumV = 0;
906  }
907  while (NumV>=m_iUVCut);
908 
909 // When we cannot find tracks anymore for the V side, and that all combinations with the U side has been done, we start again with the U side
910 // But first we remove the fibers belonging to this track
911 
912 // std::cout << "cnt_step_V " << cnt_step_V << std::endl;
913 
914 // Int_t iNumErasedFibs=0;
915  if (cnt_step_V>0)
916  {
917  for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
918  {
919  std::list<int>::iterator itBeg = m_MapLayers[2*iLayer].ListFibers.begin();
920  std::list<int>::iterator itEnd = m_MapLayers[2*iLayer].ListFibers.end();
921  for (; itBeg != itEnd; ++itBeg)
922  {
923  if (*itBeg == (int)FSel_pos_tmp[iLayer])
924  {
925  m_MapLayers[2*iLayer].ListFibers.erase(itBeg);
926  break;
927  }
928  }
929 
930 
931 // for (intIter=m_MapLayers[2*iLayer].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer].ListFibers.end(); intIter++)
933 // {
935 // if (*intIter==(int)FSel_pos_tmp[iLayer])
936 // {
938 // m_MapLayers[2*iLayer].ListFibers.erase(intIter);
941 // break;
942 // }
943 
944 // }
945  }
946  }
947  else
948  {
949  if (NumV>0)
950  {
951 // Finding_Fib(0, b_ref_n, b_pos, FSel_pos, 0);
952 // Finding_Fib(1, b_ref_n, b_pos, FSel_pos, 0); //just for test
953 
954  for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
955  {
956  std::list<int>::iterator itBeg = m_MapLayers[2*iLayer].ListFibers.begin();
957  std::list<int>::iterator itEnd = m_MapLayers[2*iLayer].ListFibers.end();
958  for (; itBeg != itEnd; ++itBeg)
959  {
960  if (*itBeg == (int)FSel_pos_tmp[iLayer])
961  {
962  m_MapLayers[2*iLayer].ListFibers.erase(itBeg);
963  break;
964  }
965  }
966 
967 
968 // for (intIter=m_MapLayers[2*iLayer].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer].ListFibers.end(); intIter++)
970 // {
972 // if (*intIter==(int)FSel_pos_tmp[iLayer])
973 // {
974 // // *intIter = 9999;
975 // m_MapLayers[2*iLayer].ListFibers.erase(intIter);
978 // break;
979 // }
980 // }
981  }
982  }
983  else break;
984  }
985  cnt_step_U++;
986 // if (iNumErasedFibs==0) NumU=0;
987  }
988  }
989  while (NumU>=m_iUVCut);
990 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_faMD

Float_t ALFA_MDMultiple::m_faMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
private

Definition at line 43 of file ALFA_MDMultiple.h.

◆ m_fbMD

Float_t ALFA_MDMultiple::m_fbMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
private

Definition at line 44 of file ALFA_MDMultiple.h.

◆ m_fOverlapCut

Float_t ALFA_MDMultiple::m_fOverlapCut
private

Definition at line 40 of file ALFA_MDMultiple.h.

◆ m_fOvU

std::vector<Float_t>* ALFA_MDMultiple::m_fOvU
private

Definition at line 60 of file ALFA_MDMultiple.h.

◆ m_fOvV

std::vector<Float_t> * ALFA_MDMultiple::m_fOvV
private

Definition at line 60 of file ALFA_MDMultiple.h.

◆ m_fRecXPos

std::vector<Float_t>* ALFA_MDMultiple::m_fRecXPos
private

Definition at line 59 of file ALFA_MDMultiple.h.

◆ m_fRecYPos

std::vector<Float_t> * ALFA_MDMultiple::m_fRecYPos
private

Definition at line 59 of file ALFA_MDMultiple.h.

◆ m_iFibSel

std::vector<Int_t>* ALFA_MDMultiple::m_iFibSel[ALFALAYERSCNT *ALFAPLATESCNT]
private

Definition at line 62 of file ALFA_MDMultiple.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_iMultiplicityCut

Int_t ALFA_MDMultiple::m_iMultiplicityCut
private

Definition at line 38 of file ALFA_MDMultiple.h.

◆ m_iNU

std::vector<Int_t>* ALFA_MDMultiple::m_iNU
private

Definition at line 61 of file ALFA_MDMultiple.h.

◆ m_iNumHitsLayer

Int_t ALFA_MDMultiple::m_iNumHitsLayer[ALFALAYERSCNT *ALFAPLATESCNT]
private

Definition at line 47 of file ALFA_MDMultiple.h.

◆ m_iNumLayerCut

Int_t ALFA_MDMultiple::m_iNumLayerCut
private

Definition at line 39 of file ALFA_MDMultiple.h.

◆ m_iNV

std::vector<Int_t> * ALFA_MDMultiple::m_iNV
private

Definition at line 61 of file ALFA_MDMultiple.h.

◆ m_iRPot

Int_t ALFA_MDMultiple::m_iRPot
private

Definition at line 36 of file ALFA_MDMultiple.h.

◆ m_iTrackMatch

std::vector<Int_t>* ALFA_MDMultiple::m_iTrackMatch[2]
private

Definition at line 63 of file ALFA_MDMultiple.h.

◆ m_iUVCut

Int_t ALFA_MDMultiple::m_iUVCut
private

Definition at line 37 of file ALFA_MDMultiple.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_MapLayers

std::map<int, FIBERS> ALFA_MDMultiple::m_MapLayers
private

Definition at line 66 of file ALFA_MDMultiple.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MAXTRACKNUM
#define MAXTRACKNUM
Definition: ALFA_MDGap.h:25
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ALFA_MDMultiple::m_iMultiplicityCut
Int_t m_iMultiplicityCut
Definition: ALFA_MDMultiple.h:38
createLinkingScheme.iter
iter
Definition: createLinkingScheme.py:62
ALFA_MDMultiple::m_fOvV
std::vector< Float_t > * m_fOvV
Definition: ALFA_MDMultiple.h:60
ALFA_MDMultiple::m_iNumLayerCut
Int_t m_iNumLayerCut
Definition: ALFA_MDMultiple.h:39
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ALFA_MDMultiple::m_iNV
std::vector< Int_t > * m_iNV
Definition: ALFA_MDMultiple.h:61
ALFA_MDMultiple::m_iFibSel
std::vector< Int_t > * m_iFibSel[ALFALAYERSCNT *ALFAPLATESCNT]
Definition: ALFA_MDMultiple.h:62
ALFA_MDMultiple::m_fbMD
Float_t m_fbMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
Definition: ALFA_MDMultiple.h:44
ALFAFIBERSCNT
#define ALFAFIBERSCNT
Definition: ALFA_constants.h:10
_FIBERS
Definition: ALFA_LocRec/ALFA_UserObjects.h:30
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:407
RPOTSCNT
#define RPOTSCNT
Definition: ALFA_CLinkAlg.h:26
ALFA_MDMultiple::Proj_Store
void Proj_Store(Int_t iFiberSide, Int_t(&iOver)[72000], Float_t fbRef, Int_t iSideFlag)
Definition: ALFA_MDMultiple.cxx:350
ALFA_MDMultiple::m_fRecYPos
std::vector< Float_t > * m_fRecYPos
Definition: ALFA_MDMultiple.h:59
ALFA_MDMultiple::m_iUVCut
Int_t m_iUVCut
Definition: ALFA_MDMultiple.h:37
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
x
#define x
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:92
ALFA_MDMultiple::Reco_Track
void Reco_Track(std::vector< double > &b_p, std::vector< double > &b_n, std::vector< double > &Ov_p, std::vector< double > &Ov_n, std::vector< int > &Num_p, std::vector< int > &Num_n, std::vector< int >(&FSel_n)[ALFAPLATESCNT], std::vector< int >(&FSel_p)[ALFAPLATESCNT], std::vector< int >(&Track_match)[2])
Definition: ALFA_MDMultiple.cxx:641
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ALFA_MDMultiple::m_iTrackMatch
std::vector< Int_t > * m_iTrackMatch[2]
Definition: ALFA_MDMultiple.h:63
_FIBERS::ListFibers
std::list< int > ListFibers
Definition: ALFA_LocRec/ALFA_UserObjects.h:31
ALFA_MDMultiple::Finding_Fib
void Finding_Fib(Int_t iFiberSide, Float_t fbRef, Float_t fbRec, Int_t(&iFSel)[ALFAPLATESCNT], Int_t iSideFlag)
Definition: ALFA_MDMultiple.cxx:523
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
ALFALAYERSCNT
#define ALFALAYERSCNT
Definition: ALFA_constants.h:8
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
ALFA_MDMultiple::m_iNumHitsLayer
Int_t m_iNumHitsLayer[ALFALAYERSCNT *ALFAPLATESCNT]
Definition: ALFA_MDMultiple.h:47
ALFA_MDMultiple::Find_Proj
void Find_Proj(const Int_t iOver[72000], Float_t fbRef, Float_t &fb, Float_t &fOv, Int_t &fNum)
Definition: ALFA_MDMultiple.cxx:457
ALFA_MDMultiple::m_MapLayers
std::map< int, FIBERS > m_MapLayers
Definition: ALFA_MDMultiple.h:66
y
#define y
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
ALFA_MDMultiple::m_fOvU
std::vector< Float_t > * m_fOvU
Definition: ALFA_MDMultiple.h:60
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
ALFA_MDMultiple::m_fOverlapCut
Float_t m_fOverlapCut
Definition: ALFA_MDMultiple.h:40
ALFA_MDMultiple::m_iNU
std::vector< Int_t > * m_iNU
Definition: ALFA_MDMultiple.h:61
calibdata.copy
bool copy
Definition: calibdata.py:26
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
python.PyAthena.obj
obj
Definition: PyAthena.py:132
ALFA_MDMultiple::m_faMD
Float_t m_faMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
Definition: ALFA_MDMultiple.h:43
ALFA_MDMultiple::m_iRPot
Int_t m_iRPot
Definition: ALFA_MDMultiple.h:36
ALFAPLATESCNT
#define ALFAPLATESCNT
Definition: ALFA_constants.h:9
ALFA_MDMultiple::m_fRecXPos
std::vector< Float_t > * m_fRecXPos
Definition: ALFA_MDMultiple.h:59
python.SystemOfUnits.ms
float ms
Definition: SystemOfUnits.py:148