Skip to content

Commit 0642ad1

Browse files
aphecetchedavidrohr
authored andcommitted
[CMake] Few source modifications related to Modern CMake Migration
1 parent 9f8f9cf commit 0642ad1

37 files changed

Lines changed: 363 additions & 121 deletions

File tree

CCDB/src/request.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
syntax = "proto2";
2+
13
package messaging;
24

35
option java_package = "com.cern.messaging";

DataFormats/Detectors/FIT/T0/src/RecPoints.cxx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@
99
// or submit itself to any jurisdiction.
1010

1111
#include "DataFormatsFITT0/RecPoints.h"
12-
#include "T0Base/Geometry.h"
12+
#include <cmath>
1313
#include <cassert>
1414
#include <iostream>
1515
#include <CommonDataFormat/InteractionRecord.h>
1616

1717
using namespace o2::t0;
1818

19+
namespace
20+
{
21+
constexpr int NCellsA = 24; // number of radiatiors on A side
22+
constexpr int NCellsC = 28; // number of radiatiors on C side
23+
} // namespace
24+
1925
void RecPoints::fillFromDigits(const o2::t0::Digit& digit)
2026
{
2127
mCollisionTime = {};
2228

2329
Int_t ndigitsC = 0, ndigitsA = 0;
24-
constexpr Int_t nMCPsA = 4 * o2::t0::Geometry::NCellsA;
25-
constexpr Int_t nMCPsC = 4 * o2::t0::Geometry::NCellsC;
30+
constexpr Int_t nMCPsA = 4 * NCellsA;
31+
constexpr Int_t nMCPsC = 4 * NCellsC;
2632
constexpr Int_t nMCPs = nMCPsA + nMCPsC;
2733
Float_t sideAtime = 0, sideCtime = 0;
2834

@@ -34,7 +40,7 @@ void RecPoints::fillFromDigits(const o2::t0::Digit& digit)
3440
mTimeAmp = digit.getChDgData();
3541
for (auto& d : mTimeAmp) {
3642
d.CFDTime -= mEventTime /*- BCEventTime*/;
37-
if (abs(d.CFDTime - BCEventTime) < 2) {
43+
if (std::fabs(d.CFDTime - BCEventTime) < 2) {
3844
if (d.ChId < nMCPsA) {
3945
sideAtime += d.CFDTime;
4046
ndigitsA++;

Detectors/Base/test/buildMatBudLUT.C

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ bool buildMatBudLUT(int nTst, int maxLr, std::string outName, std::string outFil
4646
{
4747

4848
if (gSystem->AccessPathName(geomName.c_str())) { // if needed, create geometry
49+
std::cout << geomName << " does not exist. Will create it\n";
4950
gSystem->Exec("$O2_ROOT/bin/o2-sim -n 0");
5051
geomName = "./O2geometry.root";
5152
}

Detectors/ITSMFT/ITS/macros/test/CheckClusterShape.C

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "ITSBase/GeometryTGeo.h"
1414
#include "ITSMFTBase/SegmentationAlpide.h"
1515
#include "ITSMFTBase/Digit.h"
16-
#include "TPCSimulation/Point.h"
1716
#include "ITSMFTSimulation/ClusterShape.h"
1817
#include "SimulationDataFormat/MCTruthContainer.h"
1918
#include "SimulationDataFormat/MCCompLabel.h"

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Definitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#endif
3333
#endif
3434

35-
#if defined(ENABLE_CUDA)
35+
#if defined(CUDA_ENABLED)
3636
#define TRACKINGITSU_GPU_MODE true
3737
#else
3838
#define TRACKINGITSU_GPU_MODE false

Detectors/MUON/check_nof_exported_symbols.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
library=$1
55
expected=$2
66

7-
nlibs=$(/usr/bin/nm -m -extern-only -defined-only $library -s __TEXT __text | wc -l)
7+
nlibs=$(/usr/bin/nm -m -extern-only -defined-only $library -s __TEXT __text | grep mch | wc -l)
88

99
if [ $nlibs -ne $expected ]; then
1010
echo "bad: check number of exported symbols in $library"
1111
/usr/bin/nm -m -extern-only -defined-only $library -s __TEXT __text
1212
else
1313
echo "good: $library contains the expected $expected exported symbols"
14-
fi
14+
fi

Detectors/TPC/base/src/Mapper.cxx

Lines changed: 90 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
// using boost::format;
2222

2323
#include "TPCBase/Mapper.h"
24-
namespace o2 {
25-
namespace tpc {
26-
constexpr std::array<double, SECTORSPERSIDE> Mapper::SinsPerSector/*{{
24+
namespace o2
25+
{
26+
namespace tpc
27+
{
28+
constexpr std::array<double, SECTORSPERSIDE> Mapper::SinsPerSector /*{{
2729
0,
2830
0.3420201433256687129080830800376133993268,
2931
0.6427876096865392518964199553010985255241,
@@ -42,11 +44,12 @@ namespace tpc {
4244
-0.8660254037844385965883020617184229195118,
4345
-0.6427876096865395849633273428480606526136,
4446
-0.3420201433256686018857806175219593569636
45-
}}*/;
47+
}}*/
48+
;
4649

47-
// static constexpr std::array<int, 2> test{1,2};
50+
// static constexpr std::array<int, 2> test{1,2};
4851

49-
constexpr std::array<double, SECTORSPERSIDE> Mapper::CosinsPerSector/*{{
52+
constexpr std::array<double, SECTORSPERSIDE> Mapper::CosinsPerSector /*{{
5053
1,
5154
0.9396926207859084279050421173451468348503,
5255
0.7660444431189780134516809084743726998568,
@@ -65,13 +68,14 @@ namespace tpc {
6568
0.5000000000000001110223024625156540423632,
6669
0.7660444431189777914070759834430646151304,
6770
0.9396926207859084279050421173451468348503
68-
}}*/;
71+
}}*/
72+
;
6973

7074
Mapper::Mapper(const std::string& mappingDir)
7175
: mMapGlobalPadToPadPos(mPadsInSector),
7276
mMapGlobalPadCentre(mPadsInSector),
7377
mMapPadPosGlobalPad(),
74-
mMapFECIDGlobalPad(FECInfo::globalSAMPAId(91,0,0)),
78+
mMapFECIDGlobalPad(FECInfo::globalSAMPAId(91, 0, 0)),
7579
mMapGlobalPadFECInfo(mPadsInSector),
7680
mMapPadRegionInfo(),
7781
mMapPartitionInfo()
@@ -101,8 +105,8 @@ bool Mapper::readMappingFile(std::string file)
101105
GlobalPadNumber padIndex;
102106
unsigned int padRow;
103107
unsigned int pad;
104-
float xPos;
105-
float yPos;
108+
float xPos;
109+
float yPos;
106110

107111
// pad plane info
108112
unsigned int connector;
@@ -117,74 +121,67 @@ bool Mapper::readMappingFile(std::string file)
117121
unsigned int sampaChip;
118122
unsigned int sampaChannel;
119123

120-
std::string line;
124+
std::string line;
121125
std::ifstream infile(file, std::ifstream::in);
126+
if (!infile.is_open()) {
127+
std::cout << "could not open file " << file << "\n";
128+
exit(1);
129+
}
122130
while (std::getline(infile, line)) {
123131
std::stringstream streamLine(line);
124132
streamLine
125133
// pad info
126-
>> padIndex
127-
>> padRow
128-
>> pad
129-
>> xPos
130-
>> yPos
134+
>> padIndex >> padRow >> pad >> xPos >> yPos
131135

132136
// pad plane info
133-
>> connector
134-
>> pin
135-
>> partion
136-
>> region
137+
>> connector >> pin >> partion >> region
137138

138139
// FEC info
139-
>> fecIndex
140-
>> fecConnector
141-
>> fecChannel
142-
>> sampaChip
143-
>> sampaChannel;
144-
145-
// the x and y positions are in mm
146-
// in the mapping files, the values are given for sector C04 in the global ALICE coordinate system
147-
// however, we need it in the local tracking system. Therefore:
148-
const float localX=yPos/10.f;
149-
const float localY=-xPos/10.f;
150-
// with the pad counting (looking to C-Side pad 0,0 is bottom left -- pad-side front view)
151-
// these values are for the C-Side
152-
// For the A-Side the localY position must be mirrored
153-
154-
mMapGlobalPadToPadPos[padIndex] = PadPos(padRow,pad);
155-
mMapPadPosGlobalPad[PadPos(padRow,pad)] = padIndex;
156-
mMapGlobalPadFECInfo[padIndex] = FECInfo(fecIndex, /*fecConnector, fecChannel,*/ sampaChip, sampaChannel);
157-
mMapFECIDGlobalPad[FECInfo::globalSAMPAId(fecIndex, sampaChip, sampaChannel)] = padIndex;
158-
mMapGlobalPadCentre[padIndex] = PadCentre(localX, localY);
159-
160-
//std::cout
161-
//<< padIndex<< " "
162-
//<< padRow<< " "
163-
//<< pad<< " "
164-
//<< xPos<< " "
165-
//<< yPos<< " "
166-
//<< " "
167-
//// pad plane info<< " "
168-
//<< connector<< " "
169-
//<< pin<< " "
170-
//<< partion<< " "
171-
//<< region<< " "
172-
//<< " "
173-
//// FEC info<< " "
174-
//<< fecIndex<< " "
175-
//<< fecConnector<< " "
176-
//<< fecChannel<< " "
177-
//<< sampaChip<< " "
178-
//<< sampaChannel << std::endl;
140+
>> fecIndex >> fecConnector >> fecChannel >> sampaChip >> sampaChannel;
141+
142+
// the x and y positions are in mm
143+
// in the mapping files, the values are given for sector C04 in the global ALICE coordinate system
144+
// however, we need it in the local tracking system. Therefore:
145+
const float localX = yPos / 10.f;
146+
const float localY = -xPos / 10.f;
147+
// with the pad counting (looking to C-Side pad 0,0 is bottom left -- pad-side front view)
148+
// these values are for the C-Side
149+
// For the A-Side the localY position must be mirrored
150+
151+
mMapGlobalPadToPadPos[padIndex] = PadPos(padRow, pad);
152+
mMapPadPosGlobalPad[PadPos(padRow, pad)] = padIndex;
153+
mMapGlobalPadFECInfo[padIndex] = FECInfo(fecIndex, /*fecConnector, fecChannel,*/ sampaChip, sampaChannel);
154+
mMapFECIDGlobalPad[FECInfo::globalSAMPAId(fecIndex, sampaChip, sampaChannel)] = padIndex;
155+
mMapGlobalPadCentre[padIndex] = PadCentre(localX, localY);
156+
157+
//std::cout
158+
//<< padIndex<< " "
159+
//<< padRow<< " "
160+
//<< pad<< " "
161+
//<< xPos<< " "
162+
//<< yPos<< " "
163+
//<< " "
164+
//// pad plane info<< " "
165+
//<< connector<< " "
166+
//<< pin<< " "
167+
//<< partion<< " "
168+
//<< region<< " "
169+
//<< " "
170+
//// FEC info<< " "
171+
//<< fecIndex<< " "
172+
//<< fecConnector<< " "
173+
//<< fecChannel<< " "
174+
//<< sampaChip<< " "
175+
//<< sampaChannel << std::endl;
179176
}
180177
return true;
181178
}
182179

183180
void Mapper::load(const std::string& mappingDir)
184181
{
185182

186-
// std::string inputDir(std::getenv("ALICEO2"));
187-
std::string inputDir=mappingDir;
183+
// std::string inputDir(std::getenv("ALICEO2"));
184+
std::string inputDir = mappingDir;
188185
if (!inputDir.size()) {
189186
//const char* aliceO2env=std::getenv("ALICEO2");
190187
//if (aliceO2env) inputDir=aliceO2env;
@@ -193,14 +190,15 @@ void Mapper::load(const std::string& mappingDir)
193190
//readMappingFile(inputDir+"/Detectors/TPC/base/files/TABLE-OROC2.txt");
194191
//readMappingFile(inputDir+"/Detectors/TPC/base/files/TABLE-OROC3.txt");
195192

196-
const char* aliceO2env=std::getenv("O2_ROOT");
197-
if (aliceO2env) inputDir=aliceO2env;
198-
inputDir+="/share/Detectors/TPC/files";
193+
const char* aliceO2env = std::getenv("O2_ROOT");
194+
if (aliceO2env)
195+
inputDir = aliceO2env;
196+
inputDir += "/share/Detectors/TPC/files";
199197
}
200-
readMappingFile(inputDir+"/TABLE-IROC.txt");
201-
readMappingFile(inputDir+"/TABLE-OROC1.txt");
202-
readMappingFile(inputDir+"/TABLE-OROC2.txt");
203-
readMappingFile(inputDir+"/TABLE-OROC3.txt");
198+
readMappingFile(inputDir + "/TABLE-IROC.txt");
199+
readMappingFile(inputDir + "/TABLE-OROC1.txt");
200+
readMappingFile(inputDir + "/TABLE-OROC2.txt");
201+
readMappingFile(inputDir + "/TABLE-OROC3.txt");
204202

205203
initPadRegionsAndPartitions();
206204
}
@@ -209,28 +207,28 @@ void Mapper::initPadRegionsAndPartitions()
209207
{
210208
// original values for pad widht and height and pad row position are in mm
211209
// the ALICE coordinate system is in cm
212-
mMapPadRegionInfo[0]=PadRegionInfo(0, 0, 17, 7.5/10., 4.16/10., 848.5/10., 0, 33.20, 0);
213-
mMapPadRegionInfo[1]=PadRegionInfo(0, 1, 15, 7.5/10., 4.20/10., 976.0/10., 17, 33.00, 17);
214-
mMapPadRegionInfo[2]=PadRegionInfo(1, 2, 16, 7.5/10., 4.20/10., 1088.5/10., 32, 33.08, 32);
215-
mMapPadRegionInfo[3]=PadRegionInfo(1, 3, 15, 7.5/10., 4.36/10., 1208.5/10., 48, 31.83, 48);
216-
mMapPadRegionInfo[4]=PadRegionInfo(2, 4, 18, 10/10. , 6.00/10., 1347.0/10., 0, 38.00, 63);
217-
mMapPadRegionInfo[5]=PadRegionInfo(2, 5, 16, 10/10. , 6.00/10., 1527.0/10., 18, 38.00, 81);
218-
mMapPadRegionInfo[6]=PadRegionInfo(3, 6, 16, 12/10. , 6.08/10., 1708.0/10., 0, 47.90, 97);
219-
mMapPadRegionInfo[7]=PadRegionInfo(3, 7, 14, 12/10. , 5.88/10., 1900.0/10., 16, 49.55, 113);
220-
mMapPadRegionInfo[8]=PadRegionInfo(4, 8, 13, 15/10. , 6.04/10., 2089.0/10., 0, 59.39, 127);
221-
mMapPadRegionInfo[9]=PadRegionInfo(4, 9, 12, 15/10. , 6.07/10., 2284.0/10., 0, 64.70, 140);
222-
223-
mMapPartitionInfo[0]=PartitionInfo(15, 0 , 32, 0 , 2400 );
224-
mMapPartitionInfo[1]=PartitionInfo(18, 15 , 31, 32 , 2880 );
225-
mMapPartitionInfo[2]=PartitionInfo(18, 15+18 , 34, 32+31 , 2880 );
226-
mMapPartitionInfo[3]=PartitionInfo(20, 15+18+18 , 30, 32+31+34 , 3200 );
227-
mMapPartitionInfo[4]=PartitionInfo(20, 15+18+18+20, 25, 32+31+34+30, 3200 );
228-
229-
int globalRow=0;
230-
int padsInRow=0;
231-
int padOffset=0;
210+
mMapPadRegionInfo[0] = PadRegionInfo(0, 0, 17, 7.5 / 10., 4.16 / 10., 848.5 / 10., 0, 33.20, 0);
211+
mMapPadRegionInfo[1] = PadRegionInfo(0, 1, 15, 7.5 / 10., 4.20 / 10., 976.0 / 10., 17, 33.00, 17);
212+
mMapPadRegionInfo[2] = PadRegionInfo(1, 2, 16, 7.5 / 10., 4.20 / 10., 1088.5 / 10., 32, 33.08, 32);
213+
mMapPadRegionInfo[3] = PadRegionInfo(1, 3, 15, 7.5 / 10., 4.36 / 10., 1208.5 / 10., 48, 31.83, 48);
214+
mMapPadRegionInfo[4] = PadRegionInfo(2, 4, 18, 10 / 10., 6.00 / 10., 1347.0 / 10., 0, 38.00, 63);
215+
mMapPadRegionInfo[5] = PadRegionInfo(2, 5, 16, 10 / 10., 6.00 / 10., 1527.0 / 10., 18, 38.00, 81);
216+
mMapPadRegionInfo[6] = PadRegionInfo(3, 6, 16, 12 / 10., 6.08 / 10., 1708.0 / 10., 0, 47.90, 97);
217+
mMapPadRegionInfo[7] = PadRegionInfo(3, 7, 14, 12 / 10., 5.88 / 10., 1900.0 / 10., 16, 49.55, 113);
218+
mMapPadRegionInfo[8] = PadRegionInfo(4, 8, 13, 15 / 10., 6.04 / 10., 2089.0 / 10., 0, 59.39, 127);
219+
mMapPadRegionInfo[9] = PadRegionInfo(4, 9, 12, 15 / 10., 6.07 / 10., 2284.0 / 10., 0, 64.70, 140);
220+
221+
mMapPartitionInfo[0] = PartitionInfo(15, 0, 32, 0, 2400);
222+
mMapPartitionInfo[1] = PartitionInfo(18, 15, 31, 32, 2880);
223+
mMapPartitionInfo[2] = PartitionInfo(18, 15 + 18, 34, 32 + 31, 2880);
224+
mMapPartitionInfo[3] = PartitionInfo(20, 15 + 18 + 18, 30, 32 + 31 + 34, 3200);
225+
mMapPartitionInfo[4] = PartitionInfo(20, 15 + 18 + 18 + 20, 25, 32 + 31 + 34 + 30, 3200);
226+
227+
int globalRow = 0;
228+
int padsInRow = 0;
229+
int padOffset = 0;
232230
for (const auto& reg : mMapPadRegionInfo) {
233-
for (int row=0; row<reg.getNumberOfPadRows(); ++row) {
231+
for (int row = 0; row < reg.getNumberOfPadRows(); ++row) {
234232
mMapPadOffsetPerRow[globalRow] = padOffset;
235233
padsInRow = reg.getPadsInRowRegion(row);
236234
mMapNumberOfPadsPerRow[globalRow] = padsInRow;
@@ -240,5 +238,5 @@ void Mapper::initPadRegionsAndPartitions()
240238
}
241239
}
242240

243-
}
244-
}
241+
} // namespace tpc
242+
} // namespace o2

Detectors/TPC/simulation/include/TPCSimulation/Digitizer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "TPCSimulation/SpaceCharge.h"
2222

2323
#include "TPCBase/Mapper.h"
24-
#include "Steer/HitProcessingManager.h"
2524

2625
#include <cmath>
2726

@@ -116,8 +115,8 @@ class Digitizer
116115
Sector mSector = -1; ///< ID of the currently processed sector
117116
float mEventTime = 0.f; ///< Time of the currently processed event
118117
// FIXME: whats the reason for hving this static?
119-
static bool mIsContinuous; ///< Switch for continuous readout
120-
bool mUseSCDistortions = false; ///< Flag to switch on the use of space-charge distortions
118+
static bool mIsContinuous; ///< Switch for continuous readout
119+
bool mUseSCDistortions = false; ///< Flag to switch on the use of space-charge distortions
121120

122121
ClassDefNV(Digitizer, 1);
123122
};

Examples/Ex1/include/Ex1/A.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
111
#ifndef _A_H_
212
#define _A_H_
313

Examples/Ex1/src/A.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
111
#include "Ex1/A.h"
212
#include <iostream>
313

0 commit comments

Comments
 (0)