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 Types

using LayerMap_t = std::map<int, FIBERS>

Private Member Functions

void Proj_Store (LayerMap_t &mapLayers, 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 (LayerMap_t &mapLayers, Int_t iFiberSide, Float_t fbRef, Float_t fbRec, Int_t(&iFSel)[ALFAPLATESCNT], Int_t iSideFlag)
void Reco_Track (LayerMap_t &mapLayers, 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::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)

Static Private Attributes

static constexpr size_t MAXTRACKNUM = 10

Detailed Description

Definition at line 25 of file ALFA_MDMultiple.h.

Member Typedef Documentation

◆ LayerMap_t

using ALFA_MDMultiple::LayerMap_t = std::map<int, FIBERS>
private

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

◆ Finalize()

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

Definition at line 132 of file ALFA_MDMultiple.cxx.

133{
134 ATH_MSG_DEBUG("ALFA_MDMultiple::Finalize()");
135
136 Int_t iTrackNum = std::min ({m_fRecXPos.size(), m_fRecYPos.size(), MAXTRACKNUM});
137 std::copy_n (m_fRecXPos.begin(), iTrackNum, fRecXPos);
138 std::copy_n (m_fRecYPos.begin(), iTrackNum, fRecYPos);
139 std::fill_n (fRecXPos+iTrackNum, MAXTRACKNUM-iTrackNum, -9999.0);
140 std::fill_n (fRecYPos+iTrackNum, MAXTRACKNUM-iTrackNum, -9999.0);
141
142 return StatusCode::SUCCESS;
143}
static constexpr size_t 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 234 of file ALFA_MDMultiple.cxx.

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

◆ Finding_Fib()

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

Definition at line 300 of file ALFA_MDMultiple.cxx.

302{
303 ATH_MSG_DEBUG("ALFA_MDMultiple::Finding_Fib()");
304
305 Float_t b_pos, b_neg;
306 Float_t x, y, x_tmp, y_tmp;
307 Float_t min_dist;
308 Float_t dist_x, dist_y;
309 Float_t dist_full;
310 Float_t fib_dist;
311
312 if (iSideFlag==0)
313 {
314 b_neg= fbRef;
315 b_pos= fbRec;
316 }
317 else
318 {
319 b_neg= fbRec;
320 b_pos= fbRef;
321 }
322
323 x= (b_pos-b_neg)/2.0;
324 y= (b_neg+b_pos)/2.0;
325
326 for (int & iLayer : iFSel) iLayer = 9999;
327
328 //For each layer, we determine the hit fiber which is closest to the track
329 std::list<int>::iterator intIter;
330 for (Int_t iLayer = 0; iLayer<ALFAPLATESCNT; iLayer++)
331 {
332 min_dist=0.24;
333
334 const unsigned int thisSideLayer = iLayer*2+iSideFlag;
335 const unsigned int thisLayer = 2*iLayer+iFiberSide;
336 const std::list<int> & thisFiberContainer = mapLayers[thisLayer].ListFibers;
337 for (const auto & thisFiber:thisFiberContainer)
338 {
339 if (thisFiber != 9999)
340 {
341 x_tmp = (y-m_fbMD[m_iRPot][thisSideLayer][thisFiber])/m_faMD[m_iRPot][thisSideLayer][thisFiber];
342 y_tmp = m_faMD[m_iRPot][thisSideLayer][thisFiber]*x+m_fbMD[m_iRPot][thisSideLayer][thisFiber];
343
344 dist_x = TMath::Abs(x-x_tmp);
345 dist_y = TMath::Abs(y-y_tmp);
346
347 dist_full = sqrt(dist_x*dist_x+dist_y*dist_y);
348 fib_dist = sqrt(TMath::Power((dist_x+dist_y)/2.0,2)-TMath::Power(dist_full/2.0,2));
349
350 if (fib_dist <= min_dist)
351 {
352 min_dist = fib_dist;
353 iFSel[iLayer] = thisFiber;
354 }
355 }
356 }
357
358 }
359}
#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 599 of file ALFA_MDMultiple.cxx.

600{
601 ATH_MSG_DEBUG("ALFA_MDMultiple::GetData()");
602
603 for (Int_t iLayer=0; iLayer<ALFALAYERSCNT*ALFAPLATESCNT; iLayer++)
604 {
605 size_t iTrackNum = std::min ({m_iFibSel[iLayer].size(), MAXTRACKNUM});
606 for (size_t iTrack=0; iTrack<iTrackNum; iTrack++)
607 iFibSel[iTrack][iLayer] = m_iFibSel[iLayer].at(iTrack);
608 for (size_t iTrack=iTrackNum; iTrack<MAXTRACKNUM; iTrack++)
609 iFibSel[iTrack][iLayer] = -9999;
610 }
611
612 {
613 size_t iTrackNum = std::min ({m_fOvU.size(), m_fOvV.size(), MAXTRACKNUM});
614 std::copy_n (m_fOvU.begin(), iTrackNum, fOvU);
615 std::copy_n (m_fOvV.begin(), iTrackNum, fOvV);
616 std::fill_n (fOvU+iTrackNum, MAXTRACKNUM-iTrackNum, -9999.0);
617 std::fill_n (fOvV+iTrackNum, MAXTRACKNUM-iTrackNum, -9999.0);
618 }
619
620 {
621 size_t iTrackNum = std::min ({m_iNU.size(), m_iNV.size(), MAXTRACKNUM});
622 std::copy_n (m_iNU.begin(), iTrackNum, iNumU);
623 std::copy_n (m_iNV.begin(), iTrackNum, iNumV);
624 std::fill_n (iNumU+iTrackNum, MAXTRACKNUM-iTrackNum, -9999);
625 std::fill_n (iNumV+iTrackNum, MAXTRACKNUM-iTrackNum, -9999);
626 }
627}
#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 192 of file ALFA_MDMultiple.cxx.

193{
194 ATH_MSG_DEBUG("ALFA_MDMultiple::Pro_Store()");
195
196 Float_t fSign;
197 Float_t fXInter, fYInter;
198 Float_t FibCen;
199
200 if (m_faMD[m_iRPot][iSideFlag][0]>0) fSign=1.0;
201 else fSign=-1.0;
202
203 for (int & iBin : iOver)
204 {
205 iBin=0;
206 }
207
208 int iHit = 9999;
209 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
210 {
211 for (UInt_t j=0; j<FiberHit[iLayer].size(); j++)
212 {
213 iHit = FiberHit[iLayer][j];
214 if (iHit!=9999)
215 {
216 //Depending on layer orientation, computing the projection of the hit fiber
217 fXInter= fSign*(fbRef-m_fbMD[m_iRPot][iLayer*2+iSideFlag][iHit])/(1+fSign*m_faMD[m_iRPot][iLayer*2+iSideFlag][iHit]);
218 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;
219 FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
220
221 //Filling the table with the hit fiber
222 for (Int_t iBin=0; iBin<480; iBin++)
223 {
224 iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
225 }
226 }
227 }
228 }
229}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ Proj_Store() [2/2]

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

Definition at line 148 of file ALFA_MDMultiple.cxx.

150{
151 ATH_MSG_DEBUG("ALFA_MDMultiple::Pro_Store()");
152
153 Float_t fSign;
154 Float_t fXInter, fYInter;
155 Float_t FibCen;
156
157 if (m_faMD[m_iRPot][iSideFlag][0]>0) fSign=1.0;
158 else fSign=-1.0;
159
160 for (int & iBin : iOver)
161 {
162 iBin=0;
163 }
164
165 for (UInt_t iLayer=0; iLayer!=ALFAPLATESCNT; ++iLayer)
166 {
167 const unsigned int thisSideLayer = iLayer*2+iSideFlag;
168 const unsigned int thisLayer = 2*iLayer+iFiberSide;
169 const std::list<int> & thisFiberContainer = mapLayers[thisLayer].ListFibers;
170 for (const auto & thisFiber:thisFiberContainer)
171 {
172 if (thisFiber!=9999)
173 {
174 //Depending on layer orientation, computing the projection of the hit fiber
175 fXInter= fSign*(fbRef-m_fbMD[m_iRPot][thisSideLayer][thisFiber])/(1+fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber]);
176 fYInter= (fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber]*fbRef+m_fbMD[m_iRPot][thisSideLayer][thisFiber])/(1+fSign*m_faMD[m_iRPot][thisSideLayer][thisFiber])-fbRef;
177 FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
178
179 //Filling the table with the hit fiber
180 for (Int_t iBin=0; iBin<480; iBin++)
181 {
182 iOver[(int)((FibCen-0.24)*1000)+iBin+36000]++;
183 }
184 }
185 }
186 }
187}

◆ Reco_Track()

void ALFA_MDMultiple::Reco_Track ( LayerMap_t & mapLayers,
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 365 of file ALFA_MDMultiple.cxx.

371{
372 ATH_MSG_DEBUG("ALFA_MDMultiple::Reco_Track()");
373
374 Int_t FSel_neg[ALFAPLATESCNT];
375 Int_t FSel_pos_tmp[ALFAPLATESCNT];
376 std::vector<Int_t> Over_p(72000);
377 std::vector<Int_t> Over_n(72000);
378 Int_t cnt_step_U=0;
379 Int_t cnt_step_V=0;
380 Int_t NumU=0;
381 Int_t NumV=0;
382 Float_t b_ref_p;
383 Float_t b_ref_n;
384 Float_t OvU;
385 Float_t OvV;
386 Float_t b_pos;
387 Float_t b_neg;
388
389 std::list<int>::iterator intIter;
390
391
392 //clear
393 for (Int_t i=0; i<ALFAPLATESCNT; i++)
394 {
395 FSel_n[i].clear();
396 FSel_p[i].clear();
397 }
398 b_n.clear();
399 b_p.clear();
400 Ov_n.clear();
401 Ov_p.clear();
402 Num_n.clear();
403 Num_p.clear();
404
405 int iNumUFiberHits = 0;
406 int iNumVFiberHits = 0;
407
408 std::vector<Int_t> Fiber_MB_tmp[ALFAPLATESCNT];
409 std::vector<Int_t> Fiber_MB_n[ALFAPLATESCNT];
410
411 for (UInt_t iLayer=0; iLayer!=ALFAPLATESCNT; ++iLayer)
412 {
413 Fiber_MB_n[iLayer].clear();
414 const unsigned int thisLayer=2*iLayer+1;
415 const std::list<int> & thisFiberContainer = mapLayers[thisLayer].ListFibers;
416 for (const auto & thisFiber:thisFiberContainer)
417 {
418// std::cout << "thisFiber: " << thisFiber << std::endl;
419 Fiber_MB_n[iLayer].push_back(thisFiber);
420 }
421 }
422 do
423 {
424 b_ref_n=-127.0;
425 b_ref_p=-127.0;
426
427// First projection step on U side
428// -------------------------------
429// filling the array for U side with reference value
430 Proj_Store(mapLayers, 0, Over_p, b_ref_n, 0);
431
432// Find first maxium
433 Find_Proj(Over_p, b_ref_n, b_pos, OvU, NumU);
434
435 Finding_Fib(mapLayers, 0, b_ref_n, b_pos, FSel_pos_tmp, 0);
436 for (int i=0; i<ALFAPLATESCNT; i++)
437 {
438 Fiber_MB_tmp[i].clear();
439 Fiber_MB_tmp[i].push_back(FSel_pos_tmp[i]);
440 }
441
442 //Then reconstruction all tracks possible using the second side
443 for (UInt_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
444 {
445 FIBERS& fibers = mapLayers[2*iLayer+1];
446 fibers.ListFibers.clear();
447 for (unsigned int i=0; i<Fiber_MB_n[iLayer].size(); i++)
448 {
449 fibers.ListFibers.push_back(Fiber_MB_n[iLayer][i]);
450 }
451 }
452
453// Then reconstruct all tracks possible using the second side
454 if (NumU>=m_iUVCut)
455 {
456 cnt_step_V=0;
457 do
458 {
459 // New Part to apply the multiplicity cut at each iteration
460 iNumUFiberHits=0;
461 iNumVFiberHits=0;
462 for (UInt_t iLayer=0;iLayer<ALFAPLATESCNT;iLayer++)
463 {
464 Int_t sz0 = mapLayers[2*iLayer].ListFibers.size();
465 if (sz0 > 0 && sz0<=m_iMultiplicityCut) iNumUFiberHits++;
466 Int_t sz1 = mapLayers[2*iLayer].ListFibers.size();
467 if (sz1 > 0 && sz1<=m_iMultiplicityCut) iNumVFiberHits++;
468 }
469
470 if (iNumUFiberHits>=m_iNumLayerCut && iNumVFiberHits>=m_iNumLayerCut)
471 {
472 //First projection on V side
473 //-------------------------------
474 //filling the array for V side with reference value
475 Proj_Store(mapLayers, 1, Over_n, b_ref_p, 1);
476 Find_Proj(Over_n, b_ref_p, b_neg, OvV, NumV);
477
478 if (NumV>=m_iUVCut)
479 {
480 //Now make the second projection step
481 //-----------------------------------
482 //U side
483 Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 0);
484 Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
485
486 //V side
487 Proj_Store(mapLayers, 1, Over_n, b_pos, 1);
488 Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
489
490 //Third projection steps
491 //----------------------
492 //U side
493 Proj_Store(Fiber_MB_tmp, Over_p, b_neg, 0);
494 Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
495
496 //V side
497 Proj_Store(mapLayers, 1, Over_n, b_pos, 1);
498 Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
499
500 // //We store the information in the vector
501 b_p.push_back(b_pos);
502 Ov_p.push_back(OvU);
503 Num_p.push_back(NumU);
504
505 b_n.push_back(b_neg);
506 Ov_n.push_back(OvV);
507 Num_n.push_back(NumV);
508
509 iTrackMatch[0].push_back(cnt_step_U);
510 iTrackMatch[1].push_back(cnt_step_V);
511
512 //Once done we want to remove the hit belonging to the first track on side V
513 //We first find the corresponding fibers
514 Finding_Fib(mapLayers, 1,b_pos, b_neg, FSel_neg, 1);
515
516 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
517 {
518 FSel_n[iLayer].push_back(FSel_neg[iLayer]);
519// FSel_p[iLayer].push_back(FSel_pos[iLayer]);
520 FSel_p[iLayer].push_back(FSel_pos_tmp[iLayer]);
521 }
522
523 //Removing fibers used for the first track for V Side
524 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; ++iLayer)
525 {
526 const unsigned int thisLayer=2*iLayer+1;
527 const std::list<int> & thisFiberContainer = mapLayers[thisLayer].ListFibers;
528 for (const auto & thisFiber:thisFiberContainer)
529 {
530 if (thisFiber == (int)FSel_neg[iLayer])
531 {
532 auto it = std::find(begin(thisFiberContainer), end(thisFiberContainer), thisFiber);
533 mapLayers[2*iLayer+1].ListFibers.erase(it);
534 break;
535 }
536 }
537
538
539 }
540 cnt_step_V++;
541 }
542 }
543 else NumV = 0;
544 }
545 while (NumV>=m_iUVCut);
546
547// 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
548// But first we remove the fibers belonging to this track
549
550 if (cnt_step_V>0)
551 {
552 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
553 {
554 FIBERS& fiber = mapLayers[2*iLayer];
555 std::list<int>::iterator itBeg = fiber.ListFibers.begin();
556 std::list<int>::iterator itEnd = fiber.ListFibers.end();
557 for (; itBeg != itEnd; ++itBeg)
558 {
559 if (*itBeg == (int)FSel_pos_tmp[iLayer])
560 {
561 fiber.ListFibers.erase(itBeg);
562 break;
563 }
564 }
565
566
567
568 }
569 }
570 else
571 {
572 if (NumV>0)
573 {
574 for (Int_t iLayer=0; iLayer<ALFAPLATESCNT; iLayer++)
575 {
576 FIBERS& fiber = mapLayers[2*iLayer];
577 std::list<int>::iterator itBeg = fiber.ListFibers.begin();
578 std::list<int>::iterator itEnd = fiber.ListFibers.end();
579 for (; itBeg != itEnd; ++itBeg)
580 {
581 if (*itBeg == (int)FSel_pos_tmp[iLayer])
582 {
583 fiber.ListFibers.erase(itBeg);
584 break;
585 }
586 }
587
588
589 }
590 }
591 else break;
592 }
593 cnt_step_U++;
594 }
595 }
596 while (NumU>=m_iUVCut);
597}
struct _FIBERS FIBERS
void Proj_Store(LayerMap_t &mapLayers, Int_t iFiberSide, std::span< Int_t > iOver, Float_t fbRef, Int_t iSideFlag)
void Finding_Fib(LayerMap_t &mapLayers, 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)
std::list< int > ListFibers

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

◆ m_fbMD

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

Definition at line 43 of file ALFA_MDMultiple.h.

◆ m_fOverlapCut

Float_t ALFA_MDMultiple::m_fOverlapCut
private

Definition at line 39 of file ALFA_MDMultiple.h.

◆ m_fOvU

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

Definition at line 49 of file ALFA_MDMultiple.h.

◆ m_fOvV

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

Definition at line 49 of file ALFA_MDMultiple.h.

◆ m_fRecXPos

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

Definition at line 48 of file ALFA_MDMultiple.h.

◆ m_fRecYPos

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

Definition at line 48 of file ALFA_MDMultiple.h.

◆ m_iFibSel

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

Definition at line 51 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 37 of file ALFA_MDMultiple.h.

◆ m_iNU

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

Definition at line 50 of file ALFA_MDMultiple.h.

◆ m_iNumHitsLayer

Int_t ALFA_MDMultiple::m_iNumHitsLayer[ALFALAYERSCNT *ALFAPLATESCNT]
private

Definition at line 46 of file ALFA_MDMultiple.h.

◆ m_iNumLayerCut

Int_t ALFA_MDMultiple::m_iNumLayerCut
private

Definition at line 38 of file ALFA_MDMultiple.h.

◆ m_iNV

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

Definition at line 50 of file ALFA_MDMultiple.h.

◆ m_iRPot

Int_t ALFA_MDMultiple::m_iRPot
private

Definition at line 35 of file ALFA_MDMultiple.h.

◆ m_iTrackMatch

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

Definition at line 52 of file ALFA_MDMultiple.h.

◆ m_iUVCut

Int_t ALFA_MDMultiple::m_iUVCut
private

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

◆ MAXTRACKNUM

size_t ALFA_MDMultiple::MAXTRACKNUM = 10
staticconstexprprivate

Definition at line 34 of file ALFA_MDMultiple.h.


The documentation for this class was generated from the following files: