Skip to content

Commit 6402a35

Browse files
sgorbunodavidrohr
authored andcommitted
example macros added, headers added to compilation, c++11 features hidden with CommonDef macros
1 parent 075d0b0 commit 6402a35

11 files changed

Lines changed: 381 additions & 17 deletions

GPU/Common/FlatObject.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <memory>
2424
#include <cstring>
2525
#include <cassert>
26+
#include "AliTPCCommonDef.h"
2627

2728
namespace ali_tpc_common {
2829
namespace tpc_fast_transformation {
@@ -118,13 +119,13 @@ class FlatObject
118119
FlatObject();
119120

120121
/// Copy constructor: disabled to avoid ambiguity. Use cloneFromObject instead
121-
FlatObject(const FlatObject& ) = delete;
122+
FlatObject(const FlatObject& ) CON_DELETE;
122123

123124
/// Assignment operator: disabled to avoid ambiguity. Use cloneFromObject instead
124-
FlatObject &operator=(const FlatObject &) = delete;
125+
FlatObject &operator=(const FlatObject &) CON_DELETE;
125126

126127
/// Destructor
127-
~FlatObject() = default;
128+
~FlatObject() CON_DEFAULT;
128129

129130

130131
/// _____________ Memory alignment __________________________

GPU/TPCCAGPUTracking/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ set(HDRS2
131131
TRDTracking/AliHLTTRDGeometry.h
132132
TRDTracking/AliHLTTRDTrackerDebug.h
133133
TRDTracking/AliHLTTRDInterfaces.h
134+
../Common/AliTPCCommonDef.h
134135
)
135136

136137
#Extra cpp files, whose headers we don't pass to CINT

GPU/TPCFastTransformation/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ set(SRCS
1616
TPCFastTransform.cxx
1717
)
1818

19+
set (HDRS
20+
../Common/AliTPCCommonDef.h
21+
)
22+
1923
#Some extra files / includes / settings needed for the build for AliRoot
2024
if(${ALITPCCOMMON_BUILD_TYPE} STREQUAL "ALIROOT")
2125
set (SRCS ${SRCS}
@@ -25,6 +29,7 @@ if(${ALITPCCOMMON_BUILD_TYPE} STREQUAL "ALIROOT")
2529
${AliRoot_SOURCE_DIR}/HLT/TPCLib/AliHLTTPCLog.cxx
2630
)
2731
set (HDRS
32+
${HDRS}
2833
TPCFastTransformManager.h
2934
TPCFastTransformQA.h
3035
)
@@ -41,6 +46,16 @@ if(${ALITPCCOMMON_BUILD_TYPE} STREQUAL "ALIROOT")
4146

4247
endif()
4348

49+
if (NOT ROOT_VERSION_MAJOR EQUAL 5)
50+
set (HDRS ${HDRS}
51+
../Common/FlatObject.h
52+
IrregularSpline1D.h
53+
IrregularSpline2D3D.h
54+
TPCFastTransform.h
55+
TPCDistortionIRS.h
56+
)
57+
endif()
58+
4459
#Default cmake build script for AliRoot
4560
if(${ALITPCCOMMON_BUILD_TYPE} STREQUAL "ALIROOT")
4661
# Generate the dictionary

GPU/TPCFastTransformation/IrregularSpline1D.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef ALICE_ALITPCOMMON_TPCFASTTRANSFORMATION_IRREGULARSPLINE1D_H
1818
#define ALICE_ALITPCOMMON_TPCFASTTRANSFORMATION_IRREGULARSPLINE1D_H
1919

20+
#include "AliTPCCommonDef.h"
2021
#include "FlatObject.h"
2122

2223
#include <stddef.h>
@@ -129,13 +130,13 @@ class IrregularSpline1D :public FlatObject
129130
IrregularSpline1D();
130131

131132
/// Copy constructor: disabled to avoid ambiguity. Use cloneFromObject instead
132-
IrregularSpline1D(const IrregularSpline1D& ) = delete;
133+
IrregularSpline1D(const IrregularSpline1D& ) CON_DELETE;;
133134

134135
/// Assignment operator: disabled to avoid ambiguity. Use cloneFromObject instead
135-
IrregularSpline1D &operator=(const IrregularSpline1D &) = delete;
136+
IrregularSpline1D &operator=(const IrregularSpline1D &) CON_DELETE;;
136137

137138
/// Destructor
138-
~IrregularSpline1D() = default;
139+
~IrregularSpline1D() CON_DEFAULT;
139140

140141

141142
/// _____________ FlatObject functionality, see FlatObject class for description ____________

GPU/TPCFastTransformation/IrregularSpline2D3D.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "IrregularSpline1D.h"
2121
#include "FlatObject.h"
2222

23-
#if !defined(__CINT__)
23+
#if !defined(__CINT__) && !defined(__ROOTCINT__)
2424
//&& !defined(__CLING__)
2525

2626
#include <Vc/Vc>
@@ -70,13 +70,13 @@ class IrregularSpline2D3D :public FlatObject
7070
IrregularSpline2D3D();
7171

7272
/// Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead
73-
IrregularSpline2D3D(const IrregularSpline2D3D& ) = delete;
73+
IrregularSpline2D3D(const IrregularSpline2D3D& ) CON_DELETE;
7474

7575
/// Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead
76-
IrregularSpline2D3D &operator=(const IrregularSpline2D3D &) = delete;
76+
IrregularSpline2D3D &operator=(const IrregularSpline2D3D &) CON_DELETE;
7777

7878
/// Destructor
79-
~IrregularSpline2D3D() = default;
79+
~IrregularSpline2D3D() CON_DEFAULT;
8080

8181

8282
/// _____________ FlatObject functionality, see FlatObject class for description ____________
@@ -330,7 +330,7 @@ inline void IrregularSpline2D3D::getSpline( const T *correctedData, float u, flo
330330
}
331331

332332

333-
#if !defined(__CINT__)
333+
#if !defined(__CINT__) && !defined(__ROOTCINT__)
334334
//&& !defined(__CLING__)
335335

336336
inline void IrregularSpline2D3D::getSplineVec( const float *correctedData, float u, float v, float &x, float &y, float &z ) const

GPU/TPCFastTransformation/TPCDistortionIRS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class TPCDistortionIRS :public FlatObject
5555
TPCDistortionIRS();
5656

5757
/// Copy constructor: disabled to avoid ambiguity. Use cloneTo[In/Ex]ternalBuffer() instead
58-
TPCDistortionIRS(const TPCDistortionIRS& ) = delete;
58+
TPCDistortionIRS(const TPCDistortionIRS& ) CON_DELETE;
5959

6060
/// Assignment operator: disabled to avoid ambiguity. Use cloneTo[In/Ex]ternalBuffer() instead
61-
TPCDistortionIRS &operator=(const TPCDistortionIRS &) = delete;
61+
TPCDistortionIRS &operator=(const TPCDistortionIRS &) CON_DELETE;
6262

6363
/// Destructor
64-
~TPCDistortionIRS() = default;
64+
~TPCDistortionIRS() CON_DEFAULT;
6565

6666
/// _____________ FlatObject functionality, see FlatObject class for description ____________
6767

GPU/TPCFastTransformation/TPCFastTransform.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ class TPCFastTransform :public FlatObject
7878
TPCFastTransform();
7979

8080
/// Copy constructor: disabled to avoid ambiguity. Use cloneFromObject() instead
81-
TPCFastTransform(const TPCFastTransform& ) = delete;
81+
TPCFastTransform(const TPCFastTransform& ) CON_DELETE;
8282

8383
/// Assignment operator: disabled to avoid ambiguity. Use cloneFromObject() instead
84-
TPCFastTransform &operator=(const TPCFastTransform &) = delete;
84+
TPCFastTransform &operator=(const TPCFastTransform &) CON_DELETE;
8585

8686
/// Destructor
87-
~TPCFastTransform() = default;
87+
~TPCFastTransform() CON_DEFAULT;
8888

8989

9090
/// _____________ FlatObject functionality, see FlatObject class for description ____________

GPU/TPCFastTransformation/TPCFastTransformQA.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ int TPCFastTransformQA::doQA( Long_t TimeStamp )
117117
}
118118
}
119119
timer2.Stop();
120+
cout<<"nCalls1 = "<<nCalls1<<endl;
121+
cout<<"nCalls2 = "<<nCalls2<<endl;
120122
cout<<"Orig transformation : "<< timer1.RealTime()*1.e9/nCalls1<<" ns / call"<<endl;
121123
cout<<"Fast transformation : "<< timer2.RealTime()*1.e9/nCalls2<<" ns / call"<<endl;
122124

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// $Id$
2+
/**
3+
* @file makeTPCFastTransform.C
4+
* @brief A macro to create TPCFastTransform object
5+
*
6+
* <pre>
7+
* Usage:
8+
*
9+
* aliroot
10+
* .x initTPCcalibration.C("alien://Folder=/alice/data/2015/OCDB",246984,1)
11+
* gSystem->Load("libAliTPCFastTransformation")
12+
* .L createTPCFastTransform.C++
13+
* ali_tpc_common::tpc_fast_transformation::TPCFastTransform fastTransform;
14+
* createTPCFastTransform(fastTransform);
15+
*
16+
* </pre>
17+
*
18+
* @author sergey gorbunov
19+
*
20+
*/
21+
22+
23+
#include "AliTPCcalibDB.h"
24+
#include "Riostream.h"
25+
#include "TStopwatch.h"
26+
27+
#include "TPCFastTransform.h"
28+
#include "TPCFastTransformManager.h"
29+
#include "TPCFastTransformQA.h"
30+
31+
using namespace std;
32+
using namespace ali_tpc_common::tpc_fast_transformation;
33+
34+
int createTPCFastTransform( TPCFastTransform &fastTransform ) {
35+
36+
AliTPCcalibDB* tpcCalib=AliTPCcalibDB::Instance();
37+
if(!tpcCalib){
38+
cerr << "AliTPCcalibDB does not exist"<<endl;
39+
return -1;
40+
}
41+
AliTPCTransform *origTransform = tpcCalib->GetTransform();
42+
UInt_t timeStamp = origTransform->GetCurrentTimeStamp();
43+
44+
TPCFastTransformManager manager;
45+
46+
TStopwatch timer;
47+
timer.Start();
48+
49+
int err = manager.create( fastTransform, origTransform, timeStamp );
50+
51+
timer.Stop();
52+
53+
cout<<"\n\n Initialisation: "<<timer.CpuTime()<<" / "<<timer.RealTime()<<" sec.\n\n"<<endl;
54+
55+
if( err!=0 ){
56+
cerr << "Cannot create fast transformation object from AliTPCcalibDB, TPCFastTransformManager returns "<<err<<endl;
57+
return -1;
58+
}
59+
60+
// qa
61+
62+
//ali_tpc_common::tpc_fast_transformation::TPCFastTransformQA qa;
63+
//qa.doQA( timeStamp );
64+
65+
return 0;
66+
}
67+

0 commit comments

Comments
 (0)