ATLAS Offline Software
Loading...
Searching...
No Matches
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)=delete
ALFA_MDMultipleoperator= (const ALFA_MDMultiple &obj)=delete
 ~ALFA_MDMultiple ()=default
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.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Private Member Functions

void Proj_Store (Int_t iFiberSide, std::span< Int_t > iOver, Float_t fbRef, Int_t iSideFlag)
void Proj_Store (const std::vector< Int_t >(&FiberHit)[ALFAPLATESCNT], std::span< Int_t > iOver, Float_t fbRef, Int_t iSideFlag)
void Find_Proj (const std::span< const Int_t > &iOver, 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.

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.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

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;
16 m_iRPot = 0;
17 m_iUVCut = 0;
18}
Int_t m_iNumHitsLayer[ALFALAYERSCNT *ALFAPLATESCNT]
AthMessaging()
Default constructor:

◆ ALFA_MDMultiple() [2/2]

ALFA_MDMultiple::ALFA_MDMultiple ( const ALFA_MDMultiple & obj)
delete

◆ ~ALFA_MDMultiple()

ALFA_MDMultiple::~ALFA_MDMultiple ( )
default

Member Function Documentation

◆ Execute()

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

Definition at line 47 of file ALFA_MDMultiple.cxx.

48{
49 ATH_MSG_DEBUG("ALFA_MDMultiple::Execute()");
50
51 FIBERS structFibers;
52 m_MapLayers.clear();
53
54 std::list<MDHIT>::const_iterator iter;
55 for (iter=ListMDHits.begin(); iter!=ListMDHits.end(); ++iter)
56 {
57 if (m_iRPot == (*iter).iRPot)
58 {
59 if(m_MapLayers.find((*iter).iPlate)==m_MapLayers.end())
60 {
61 structFibers.ListFibers.clear();
62 m_MapLayers.insert(std::pair<int, FIBERS>((*iter).iPlate, structFibers));
63 m_MapLayers[(*iter).iPlate].ListFibers.push_back((*iter).iFiber);
64 }
65 else m_MapLayers[(*iter).iPlate].ListFibers.push_back((*iter).iFiber);
66 }
67 }
68
69 // RECONSTRUCTION
70 std::vector<double> b_p, b_n;
71 std::vector<double> Ov_p, Ov_n;
72 std::vector<int> Num_p, Num_n;
73 std::vector<int> FSel_n[ALFAPLATESCNT], FSel_p[ALFAPLATESCNT];
74 std::vector<int> iTrackMatch[2];
75
76
77 //Checking that the multiplicity cut conditions are satisfied
78 //At least more than UV_cut layers have a multiplicity lower than multi_cut
79
80 {
81 Reco_Track(b_p, b_n, Ov_p, Ov_n, Num_p, Num_n, FSel_n, FSel_p, iTrackMatch);
82
83 //Now sorting the tracks using NumU+NumV criteria -------------------------------
84 Int_t iCntSort=0;
85 Int_t iMaxSum=0;
86 std::vector<Int_t> MaxTrackID;
87 Int_t iTmpMaxTrackID = -1;
88
89// std::cout << "b_p.size = " << b_p.size() << std::endl;
90 while (iCntSort<(Int_t)b_p.size())
91 {
92 iMaxSum=0;
93 for (Int_t i=0; i<(Int_t)b_p.size(); i++)
94 {
95 //Checking that the maximum was not already used
96 Bool_t MaxUsed=false;
97
98 for (int j : MaxTrackID)
99 {
100 if (i==j) {MaxUsed = true; break;}
101 }
102
103 if (((Num_p[i]+Num_n[i])>iMaxSum) && (!MaxUsed))
104 {
105 iMaxSum = Num_p[i]+Num_n[i];
106 iTmpMaxTrackID=i;
107 }
108 }
109 MaxTrackID.push_back(iTmpMaxTrackID);
110 iCntSort++;
111 }
112
113
114 for (int i : MaxTrackID)
115 {
116 m_fRecXPos.push_back((b_p[i]-b_n[i])/2.0);
117 m_fRecYPos.push_back((b_p[i]+b_n[i])/2.0);
118
119 m_fOvU.push_back(Ov_p[i]);
120 m_fOvV.push_back(Ov_n[i]);
121 m_iNU.push_back(Num_p[i]);
122 m_iNV.push_back(Num_n[i]);
123
124 m_iTrackMatch[0].push_back(iTrackMatch[0][i]);
125 m_iTrackMatch[1].push_back(iTrackMatch[1][i]);
126
127 for (Int_t iPlate=0; iPlate<ALFAPLATESCNT; iPlate++)
128 {
129 m_iFibSel[2*iPlate].push_back(FSel_p[iPlate][i]);
130 m_iFibSel[2*iPlate+1].push_back(FSel_n[iPlate][i]);
131 }
132 }
133 }
134
135
136 return StatusCode::SUCCESS;
137}
struct _FIBERS FIBERS
#define ALFAPLATESCNT
#define ATH_MSG_DEBUG(x)
std::vector< Int_t > m_iFibSel[ALFALAYERSCNT *ALFAPLATESCNT]
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])
std::vector< Float_t > m_fRecXPos
std::map< int, FIBERS > m_MapLayers
std::vector< Int_t > m_iNV
std::vector< Float_t > m_fRecYPos
std::vector< Int_t > m_iTrackMatch[2]
std::vector< Int_t > m_iNU
std::vector< Float_t > m_fOvU
std::vector< Float_t > m_fOvV
std::list< int > ListFibers

◆ Finalize()

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

Definition at line 139 of file ALFA_MDMultiple.cxx.

140{
141 ATH_MSG_DEBUG("ALFA_MDMultiple::Finalize()");
142
143 Int_t iTrackNum=0, iSize=0;
144 std::fill_n(&fRecXPos[0], sizeof(fRecXPos)/sizeof(Float_t), -9999.0);
145 std::fill_n(&fRecYPos[0], sizeof(fRecYPos)/sizeof(Float_t), -9999.0);
146
147 iSize = std::min(m_fRecXPos.size(), m_fRecYPos.size());
148 iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
149
150 for (Int_t i=0; i<iTrackNum; i++)
151 {
152 fRecXPos[i] = m_fRecXPos.at(i);
153 fRecYPos[i] = m_fRecYPos.at(i);
154 }
155
156 return StatusCode::SUCCESS;
157}
#define MAXTRACKNUM

◆ Find_Proj()

void ALFA_MDMultiple::Find_Proj ( const std::span< const Int_t > & iOver,
Float_t fbRef,
Float_t & fb,
Float_t & fOv,
Int_t & fNum )
private

Definition at line 247 of file ALFA_MDMultiple.cxx.

248{
249 ATH_MSG_DEBUG("ALFA_MDMultiple::Find_Proj()");
250
251 std::vector<int> iSizePlateau;
252 Int_t iNumFib=0;
253 Int_t p_tmp_min;
254// Int_t p_tmp_max;
255 Float_t p_min;
256 Float_t p_max;
257
258 //Determine the maximum number of overlapping fibers in both directions
259 for (Int_t i=0;i<72000;i++)
260 {
261 if (iOver[i]>iNumFib) iNumFib=iOver[i];
262 }
263
264 // Filling array for all values equal to the maximum
265 if (iNumFib>=m_iUVCut)
266 {
267 for (Int_t i=0;i<72000;i++)
268 {
269 if (iOver[i]==iNumFib)
270 {
271 iSizePlateau.push_back(i);
272 }
273 }
274
275// Finding first and last position where the maximum is found
276 p_min = -36.0 + double(iSizePlateau.front())*1e-3;
277 p_tmp_min = iSizePlateau.front();
278
279 p_max = -36.0 + double(iSizePlateau.back())*1e-3;
280// p_tmp_max = iSizePlateau.back();
281
282// Making sure that the plateau belongs to the same track
283 Int_t full_width = iSizePlateau.size();
284
285 for (Int_t i=0; i<full_width; i++)
286 {
287 if (iSizePlateau[full_width-i-1]-p_tmp_min < 500)
288 {
289// p_tmp_max = iSizePlateau[full_width-i-1];
290 p_max = -36.0 + double(iSizePlateau[full_width-i-1])*1e-3;
291
292 break;
293 }
294 }
295
296 if ((p_max-p_min)<m_fOverlapCut)
297 {
298// Storing the coordinate of the maximum
299 fb = fbRef+(p_min+p_max)/sqrt(2.0);
300 fOv = p_max-p_min;
301 }
302 }
303
304 iNum = iNumFib;
305}

◆ 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 313 of file ALFA_MDMultiple.cxx.

314{
315 ATH_MSG_DEBUG("ALFA_MDMultiple::Finding_Fib()");
316
317 Float_t b_pos, b_neg;
318 Float_t x, y, x_tmp, y_tmp;
319 Float_t min_dist;
320 Float_t dist_x, dist_y;
321 Float_t dist_full;
322 Float_t fib_dist;
323
324 if (iSideFlag==0)
325 {
326 b_neg= fbRef;
327 b_pos= fbRec;
328 }
329 else
330 {
331 b_neg= fbRec;
332 b_pos= fbRef;
333 }
334
335 x= (b_pos-b_neg)/2.0;
336 y= (b_neg+b_pos)/2.0;
337
338 for (int & iLayer : iFSel) iLayer = 9999;
339
340 //For each layer, we determine the hit fiber which is closest to the track
341 std::list<int>::iterator intIter;
342 for (Int_t iLayer = 0; iLayer<ALFAPLATESCNT; iLayer++)
343 {
344 min_dist=0.24;
345
346 const unsigned int thisSideLayer = iLayer*2+iSideFlag;
347 const unsigned int thisLayer = 2*iLayer+iFiberSide;
348 const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
349 for (const auto & thisFiber:thisFiberContainer)
350 {
351 if (thisFiber != 9999)
352 {
353 x_tmp = (y-m_fbMD[m_iRPot][thisSideLayer][thisFiber])/m_faMD[m_iRPot][thisSideLayer][thisFiber];
354 y_tmp = m_faMD[m_iRPot][thisSideLayer][thisFiber]*x+m_fbMD[m_iRPot][thisSideLayer][thisFiber];
355
356 dist_x = TMath::Abs(x-x_tmp);
357 dist_y = TMath::Abs(y-y_tmp);
358
359 dist_full = sqrt(dist_x*dist_x+dist_y*dist_y);
360 fib_dist = sqrt(TMath::Power((dist_x+dist_y)/2.0,2)-TMath::Power(dist_full/2.0,2));
361
362 if (fib_dist <= min_dist)
363 {
364 min_dist = fib_dist;
365 iFSel[iLayer] = thisFiber;
366 }
367 }
368 }
369
370 }
371}
#define y
#define x
Float_t m_fbMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]
Float_t m_faMD[RPOTSCNT][ALFALAYERSCNT *ALFAPLATESCNT][ALFAFIBERSCNT]

◆ 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 716 of file ALFA_MDMultiple.cxx.

717{
718 ATH_MSG_DEBUG("ALFA_MDMultiple::GetData()");
719
720 Int_t iTrackNum;
721 Int_t iSize;
722 std::fill_n(&fOvU[0], sizeof(fOvU)/sizeof(Float_t), -9999.0);
723 std::fill_n(&fOvV[0], sizeof(fOvV)/sizeof(Float_t), -9999.0);
724 std::fill_n(&iNumU[0], sizeof(iNumU)/sizeof(Int_t), -9999);
725 std::fill_n(&iNumV[0], sizeof(iNumV)/sizeof(Int_t), -9999);
726 std::fill_n(&iFibSel[0][0], sizeof(iFibSel)/sizeof(Int_t), -9999);
727
728 iTrackNum=0;
729 iSize=0;
730 for (auto & iLayer : m_iFibSel)
731 {
732 iSize = std::max(static_cast<Int_t>(iLayer.size()), iSize);
733 }
734 iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
735 for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
736 {
737 for (Int_t iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
738 {
739 iFibSel[iTrack][iLayer] = m_iFibSel[iLayer].at(iTrack);
740 }
741 }
742
743 iTrackNum=0;
744 iSize=0;
745 iSize = std::min(m_fOvU.size(), m_fOvV.size());
746 iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
747 for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
748 {
749 fOvU[iTrack] = m_fOvU.at(iTrack);
750 fOvV[iTrack] = m_fOvV.at(iTrack);
751 }
752
753 iTrackNum=0;
754 iSize=0;
755 iSize = std::min(m_iNU.size(), m_iNV.size());
756 iTrackNum = (iSize < MAXTRACKNUM)? iSize : MAXTRACKNUM;
757 for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
758 {
759 iNumU[iTrack] = m_iNU.at(iTrack);
760 iNumV[iTrack] = m_iNV.at(iTrack);
761 }
762}
#define ALFALAYERSCNT

◆ 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 20 of file ALFA_MDMultiple.cxx.

21{
22 ATH_MSG_DEBUG("ALFA_MDMultiple::Initialize()");
23
24 m_iRPot = iRPot;
25 m_iUVCut = iUVCut;
26 m_iNumLayerCut = iNumLayerCut;
27 m_iMultiplicityCut = iMultiplicityCut;
28 m_fOverlapCut = fOverlapCut;
29
30 for (Int_t iPot=0; iPot<RPOTSCNT; iPot++)
31 {
32 for (Int_t iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
33 {
34 for (Int_t iFiber=0; iFiber<ALFAFIBERSCNT; iFiber++)
35 {
36 m_faMD[iPot][iLayer][iFiber] = faMD[iPot][iLayer][iFiber];
37 m_fbMD[iPot][iLayer][iFiber] = fbMD[iPot][iLayer][iFiber];
38 }
39 }
40 }
41
42// std::cout << "m_iMultiplicityCut, m_iUVCut = " << m_iMultiplicityCut << ", " << m_iUVCut << std::endl;
43
44 return StatusCode::SUCCESS;
45}
#define RPOTSCNT
#define ALFAFIBERSCNT

◆ 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 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ 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 167 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void initMessaging() const
Initialize our message level and MessageSvc.

◆ 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 182 of file AthMessaging.h.

183{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ 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 user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ operator=()

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

◆ Proj_Store() [1/2]

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

Definition at line 205 of file ALFA_MDMultiple.cxx.

206{
207 ATH_MSG_DEBUG("ALFA_MDMultiple::Pro_Store()");
208
209 Float_t fSign;
210 Float_t fXInter, fYInter;
211 Float_t FibCen;
212
213 if (m_faMD[m_iRPot][iSideFlag][0]>0) fSign=1.0;
214 else fSign=-1.0;
215
216 for (int & iBin : iOver)
217 {
218 iBin=0;
219 }
220
221 int iHit = 9999;
222 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
223 {
224 for (UInt_t j=0; j<FiberHit[iLayer].size(); j++)
225 {
226 iHit = FiberHit[iLayer][j];
227 if (iHit!=9999)
228 {
229 //Depending on layer orientation, computing the projection of the hit fiber
230 fXInter= fSign*(fbRef-m_fbMD[m_iRPot][iLayer*2+iSideFlag][iHit])/(1+fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][iHit]);
231 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;
232 FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
233
234 //Filling the table with the hit fiber
235 for (Int_t iBin=0; iBin<480; iBin++)
236 {
237 iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
238 }
239 }
240 }
241 }
242}

◆ Proj_Store() [2/2]

void ALFA_MDMultiple::Proj_Store ( Int_t iFiberSide,
std::span< Int_t > iOver,
Float_t fbRef,
Int_t iSideFlag )
private

Definition at line 162 of file ALFA_MDMultiple.cxx.

163{
164 ATH_MSG_DEBUG("ALFA_MDMultiple::Pro_Store()");
165
166 Float_t fSign;
167 Float_t fXInter, fYInter;
168 Float_t FibCen;
169
170 if (m_faMD[m_iRPot][iSideFlag][0]>0) fSign=1.0;
171 else fSign=-1.0;
172
173 for (int & iBin : iOver)
174 {
175 iBin=0;
176 }
177
178 for (UInt_t iLayer=0; iLayer!=ALFAPLATESCNT; ++iLayer)
179 {
180 const unsigned int thisSideLayer = iLayer*2+iSideFlag;
181 const unsigned int thisLayer = 2*iLayer+iFiberSide;
182 const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
183 for (const auto & thisFiber:thisFiberContainer)
184 {
185 if (thisFiber!=9999)
186 {
187 //Depending on layer orientation, computing the projection of the hit fiber
188 fXInter= fSign*(fbRef-m_fbMD[m_iRPot][thisSideLayer][thisFiber])/(1+fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber]);
189 fYInter= (fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber]*fbRef+m_fbMD[m_iRPot][thisSideLayer][thisFiber])/(1+fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber])-fbRef;
190 FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
191
192 //Filling the table with the hit fiber
193 for (Int_t iBin=0; iBin<480; iBin++)
194 {
195 iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
196 }
197 }
198 }
199 }
200}

◆ 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 377 of file ALFA_MDMultiple.cxx.

382{
383 ATH_MSG_DEBUG("ALFA_MDMultiple::Reco_Track()");
384
385// Int_t FSel_pos[ALFAPLATESCNT];
386 Int_t FSel_neg[ALFAPLATESCNT];
387 Int_t FSel_pos_tmp[ALFAPLATESCNT];
388 std::vector<Int_t> Over_p(72000);
389 std::vector<Int_t> Over_n(72000);
390 Int_t cnt_step_U=0;
391 Int_t cnt_step_V=0;
392 Int_t NumU=0;
393 Int_t NumV=0;
394 Float_t b_ref_p;
395 Float_t b_ref_n;
396 Float_t OvU;
397 Float_t OvV;
398 Float_t b_pos;
399 Float_t b_neg;
400
401 std::list<int>::iterator intIter;
402
403
404 //clear
405 for (Int_t i=0; i<ALFAPLATESCNT; i++)
406 {
407 FSel_n[i].clear();
408 FSel_p[i].clear();
409 }
410 b_n.clear();
411 b_p.clear();
412 Ov_n.clear();
413 Ov_p.clear();
414 Num_n.clear();
415 Num_p.clear();
416
417 int iNumUFiberHits = 0;
418 int iNumVFiberHits = 0;
419
420 std::vector<Int_t> Fiber_MB_tmp[ALFAPLATESCNT];
421 std::vector<Int_t> Fiber_MB_n[ALFAPLATESCNT];
422
423 for (UInt_t iLayer=0; iLayer!=ALFAPLATESCNT; ++iLayer)
424 {
425 Fiber_MB_n[iLayer].clear();
426 const unsigned int thisLayer=2*iLayer+1;
427 const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
428 for (const auto & thisFiber:thisFiberContainer)
429 {
430// std::cout << "thisFiber: " << thisFiber << std::endl;
431 Fiber_MB_n[iLayer].push_back(thisFiber);
432 }
433 }
434 do
435 {
436 b_ref_n=-127.0;
437 b_ref_p=-127.0;
438
439// First projection step on U side
440// -------------------------------
441// filling the array for U side with reference value
442 Proj_Store(0, Over_p, b_ref_n, 0);
443// Proj_Store(1, Over_p, b_ref_n, 0); //just for test
444// Proj_Store(1, Over_p, b_ref_n, 1); //just for test
445
446// Find first maxium
447 Find_Proj(Over_p, b_ref_n, b_pos, OvU, NumU);
448
449 Finding_Fib(0, b_ref_n, b_pos, FSel_pos_tmp, 0);
450// Finding_Fib(1, b_ref_n, b_pos, FSel_pos_tmp, 0); //just for test
451// Finding_Fib(1, b_ref_n, b_pos, FSel_pos_tmp, 1); //just for test
452 for (int i=0; i<ALFAPLATESCNT; i++)
453 {
454 Fiber_MB_tmp[i].clear();
455 Fiber_MB_tmp[i].push_back(FSel_pos_tmp[i]);
456 }
457
458// // added ----------
459// std::cout << "FSel_pos after 1st U proj: ";
460// for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
461// {
462// std::cout << " " << FSel_pos[iLayer];
463// }
464// std::cout << std::endl;
465
466 //Then reconstruction all tracks possible using the second side
467 for (UInt_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
468 {
469 m_MapLayers[2*iLayer+1].ListFibers.clear();
470// m_MapLayers[2*iLayer].ListFibers.clear(); //just for test
471 for (unsigned int i=0; i<Fiber_MB_n[iLayer].size(); i++)
472 {
473 m_MapLayers[2*iLayer+1].ListFibers.push_back(Fiber_MB_n[iLayer][i]);
474// m_MapLayers[2*iLayer].ListFibers.push_back(Fiber_MB_n[iLayer][i]); //just for test
475 }
476 }
477
478// std::cout << "NumU " << NumU << std::endl;
479
480// Then reconstruct all tracks possible using the second side
481 if (NumU>=m_iUVCut)
482 {
483 cnt_step_V=0;
484 do
485 {
486 // New Part to apply the multiplicity cut at each iteration
487 iNumUFiberHits=0;
488 iNumVFiberHits=0;
489 for (UInt_t iLayer=0;iLayer<ALFAPLATESCNT;iLayer++)
490 {
491 if ((Int_t)m_MapLayers[2*iLayer].ListFibers.size()<=m_iMultiplicityCut && !m_MapLayers[2*iLayer].ListFibers.empty()) iNumUFiberHits++;
492 if ((Int_t)m_MapLayers[2*iLayer+1].ListFibers.size()<=m_iMultiplicityCut && !m_MapLayers[2*iLayer+1].ListFibers.empty()) iNumVFiberHits++;
493// if ((Int_t)m_MapLayers[2*iLayer+1].ListFibers.size()<=m_iMultiplicityCut && m_MapLayers[2*iLayer+1].ListFibers.size()>0) iNumUFiberHits++; //just for test
494// if ((Int_t)m_MapLayers[2*iLayer].ListFibers.size()<=m_iMultiplicityCut && m_MapLayers[2*iLayer].ListFibers.size()>0) iNumVFiberHits++; //just for test
495 }
496
497// std::cout << "2nd multiplicity cut " << iNumUFiberHits << " " << iNumVFiberHits << std::endl;
498
499 if (iNumUFiberHits>=m_iNumLayerCut && iNumVFiberHits>=m_iNumLayerCut)
500 {
501 //First projection on V side
502 //-------------------------------
503 //filling the array for V side with reference value
504 Proj_Store(1, Over_n, b_ref_p, 1);
505// Proj_Store(0, Over_n, b_ref_p, 1); //just for test
506// Proj_Store(0, Over_n, b_ref_p, 0); //just for test
507 Find_Proj(Over_n, b_ref_p, b_neg, OvV, NumV);
508
509// std::cout << "NumV " << NumV << std::endl;
510
511 if (NumV>=m_iUVCut)
512 {
513 //Now make the second projection step
514 //-----------------------------------
515 //U side
516// Proj_Store(0, Over_p, b_neg, 0);
517 // Proj_Store(1, Over_p, b_neg, 0); //just for test
518 Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 0);
519// Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 1); //just for test
520 Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
521
522 //V side
523 Proj_Store(1, Over_n, b_pos, 1);
524// Proj_Store(0, Over_n, b_pos, 1); //just for test
525// Proj_Store(0, Over_n, b_pos, 0); //just for test
526 Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
527
528 //Third projection steps
529 //----------------------
530 //U side
531// Proj_Store(0, Over_p, b_neg, 0);
532 // Proj_Store(1, Over_p, b_neg, 0); //just for test
533 Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 0);
534// Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 1); //just for test
535 Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
536
537 //V side
538 Proj_Store(1, Over_n, b_pos, 1);
539// Proj_Store(0, Over_n, b_pos, 1); //just for test
540// Proj_Store(0, Over_n, b_pos, 0); //just for test
541 Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
542
543 // //We store the information in the vector
544 b_p.push_back(b_pos);
545 Ov_p.push_back(OvU);
546 Num_p.push_back(NumU);
547
548 b_n.push_back(b_neg);
549 Ov_n.push_back(OvV);
550 Num_n.push_back(NumV);
551
552 iTrackMatch[0].push_back(cnt_step_U);
553 iTrackMatch[1].push_back(cnt_step_V);
554
555 //Once done we want to remove the hit belonging to the first track on side V
556 //We first find the corresponding fibers
557// Finding_Fib(0,b_neg, b_pos, FSel_pos, 0);
558 Finding_Fib(1,b_pos, b_neg, FSel_neg, 1);
559// Finding_Fib(1,b_neg, b_pos, FSel_pos, 0); //just for test
560// Finding_Fib(0,b_pos, b_neg, FSel_neg, 1); //just for test
561// Finding_Fib(1,b_neg, b_pos, FSel_pos, 1); //just for test
562// Finding_Fib(0,b_pos, b_neg, FSel_neg, 0); //just for test
563
564 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
565 {
566 FSel_n[iLayer].push_back(FSel_neg[iLayer]);
567// FSel_p[iLayer].push_back(FSel_pos[iLayer]);
568 FSel_p[iLayer].push_back(FSel_pos_tmp[iLayer]);
569 }
570
571 //added -----------------------------------------------------
572// std::cout << "FSel_n ";
573// for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
574// {
575// std::cout << " " << FSel_neg[iLayer];
576// }
577// std::cout << std::endl;
578// std::cout << "FSel_p ";
579// for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
580// {
581// std::cout << " " << FSel_pos[iLayer];
582// }
583// std::cout << std::endl;
584
585 //Removing fibers used for the first track for V Side
586 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; ++iLayer)
587 {
588 // coverity bug 30038 fixed bellow
589// std::list<int>::iterator itBeg = m_MapLayers[2*iLayer+1].ListFibers.begin();
590// std::list<int>::iterator itEnd = m_MapLayers[2*iLayer+1].ListFibers.end();
591// for (; itBeg != itEnd; itBeg++)
592// {
593// if (*itBeg == (int)FSel_neg[iLayer])
594// {
595// m_MapLayers[2*iLayer+1].ListFibers.erase(itBeg);
596// break;
597// }
598// }
599
600 const unsigned int thisLayer=2*iLayer+1;
601 const std::list<int> & thisFiberContainer = m_MapLayers[thisLayer].ListFibers;
602 for (const auto & thisFiber:thisFiberContainer)
603 {
604 if (thisFiber == (int)FSel_neg[iLayer])
605 {
606 auto it = std::find(begin(thisFiberContainer), end(thisFiberContainer), thisFiber);
607 m_MapLayers[2*iLayer+1].ListFibers.erase(it);
608 break;
609 }
610 }
611
612
613// for (intIter=m_MapLayers[2*iLayer+1].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer+1].ListFibers.end(); intIter++)
615// {
617// if (*intIter==(int)FSel_neg[iLayer])
618// {
620// m_MapLayers[2*iLayer+1].ListFibers.erase(intIter);
622// break;
623// }
624// }
625 }
626 cnt_step_V++;
627 }
628 }
629 else NumV = 0;
630 }
631 while (NumV>=m_iUVCut);
632
633// 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
634// But first we remove the fibers belonging to this track
635
636// std::cout << "cnt_step_V " << cnt_step_V << std::endl;
637
638// Int_t iNumErasedFibs=0;
639 if (cnt_step_V>0)
640 {
641 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
642 {
643 std::list<int>::iterator itBeg = m_MapLayers[2*iLayer].ListFibers.begin();
644 std::list<int>::iterator itEnd = m_MapLayers[2*iLayer].ListFibers.end();
645 for (; itBeg != itEnd; ++itBeg)
646 {
647 if (*itBeg == (int)FSel_pos_tmp[iLayer])
648 {
649 m_MapLayers[2*iLayer].ListFibers.erase(itBeg);
650 break;
651 }
652 }
653
654
655// for (intIter=m_MapLayers[2*iLayer].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer].ListFibers.end(); intIter++)
657// {
659// if (*intIter==(int)FSel_pos_tmp[iLayer])
660// {
662// m_MapLayers[2*iLayer].ListFibers.erase(intIter);
665// break;
666// }
667
668// }
669 }
670 }
671 else
672 {
673 if (NumV>0)
674 {
675// Finding_Fib(0, b_ref_n, b_pos, FSel_pos, 0);
676// Finding_Fib(1, b_ref_n, b_pos, FSel_pos, 0); //just for test
677
678 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
679 {
680 std::list<int>::iterator itBeg = m_MapLayers[2*iLayer].ListFibers.begin();
681 std::list<int>::iterator itEnd = m_MapLayers[2*iLayer].ListFibers.end();
682 for (; itBeg != itEnd; ++itBeg)
683 {
684 if (*itBeg == (int)FSel_pos_tmp[iLayer])
685 {
686 m_MapLayers[2*iLayer].ListFibers.erase(itBeg);
687 break;
688 }
689 }
690
691
692// for (intIter=m_MapLayers[2*iLayer].ListFibers.begin(); intIter!=m_MapLayers[2*iLayer].ListFibers.end(); intIter++)
694// {
696// if (*intIter==(int)FSel_pos_tmp[iLayer])
697// {
698// // *intIter = 9999;
699// m_MapLayers[2*iLayer].ListFibers.erase(intIter);
702// break;
703// }
704// }
705 }
706 }
707 else break;
708 }
709 cnt_step_U++;
710// if (iNumErasedFibs==0) NumU=0;
711 }
712 }
713 while (NumU>=m_iUVCut);
714}
void Proj_Store(Int_t iFiberSide, std::span< Int_t > iOver, Float_t fbRef, Int_t iSideFlag)
void Finding_Fib(Int_t iFiberSide, Float_t fbRef, Float_t fbRec, Int_t(&iFSel)[ALFAPLATESCNT], Int_t iSideFlag)
void Find_Proj(const std::span< const Int_t > &iOver, Float_t fbRef, Float_t &fb, Float_t &fOv, Int_t &fNum)

◆ 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 50 of file ALFA_MDMultiple.h.

◆ m_fOvV

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

Definition at line 50 of file ALFA_MDMultiple.h.

◆ m_fRecXPos

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

Definition at line 49 of file ALFA_MDMultiple.h.

◆ m_fRecYPos

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

Definition at line 49 of file ALFA_MDMultiple.h.

◆ m_iFibSel

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

Definition at line 52 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.

135{ nullptr };

◆ 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 51 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 51 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 53 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.

138{ MSG::NIL };

◆ m_MapLayers

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

Definition at line 56 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: