Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Removed unnecessary preprocessor statements
  • Loading branch information
pmiquelm committed Aug 16, 2016
commit a187c445fc9836caa0b41b1be9a3e5690a5d0805
23 changes: 8 additions & 15 deletions tutorials/cont/TListAndSTL.C
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// \file
/// \ingroup tutorial_cont
/// \notebook -nodraw
/// This is an example of using TList with STL algoritms in CINT.
///
/// #### Output produced by `.x TListAndSTL.C`
Expand Down Expand Up @@ -38,12 +39,9 @@ struct SEnumFunctor {
// A functor for the find_if algorithm
struct SFind {
// using this ugly constructor, since there is problems with std::bindX in CINT
#ifdef __CINT__
SFind(const SFind &oth) : fToFind(oth.fToFind) {}
SFind(const TString aStr): fToFind(aStr) {
#else

SFind(const TString &aStr): fToFind(aStr) {
#endif

}
bool operator()(TObject *aObj) {
TObjString *str(dynamic_cast<TObjString*>(aObj));
Expand All @@ -60,19 +58,19 @@ void TListAndSTL()
const Int_t size(10);

// Initializing TList container
TList list;
TList list1;
ostringstream ss;
for (int i = 0; i < size; ++i) {
ss << "test string #" << i;
TObjString *s(new TObjString(ss.str().c_str()));
list.Add(s);
list1.Add(s);
ss.str("");
}


//->>>>>>> Example #1 <<<<<<<-
// running the std::for_each algorithm on the list
TIter iter(&list);
TIter iter(&list1);
for_each(iter.Begin(), TIter::End(), SEnumFunctor());

//->>>>>>> Example #2 <<<<<<<-
Expand All @@ -82,16 +80,11 @@ void TListAndSTL()
SFind func(strToFind.c_str());


#ifdef __CINT__
TIter found(
find_if(iter.Begin(), TIter::End(), func)
);
#else // in compilation mode you need to use TIterCategory as an iterator for such a algorithm like find_if
TIterCategory<TList> iter_cat(&list);

TIterCategory<TList> iter_cat(&list1);
TIterCategory<TList> found(
find_if(iter_cat.Begin(), TIterCategory<TList>::End(), func)
);
#endif

// Checking the result
if (!(*found)) {
Expand Down
6 changes: 0 additions & 6 deletions tutorials/eve/SplitGLView.C
Original file line number Diff line number Diff line change
Expand Up @@ -1435,12 +1435,6 @@ void SplitGLView::UpdateSummary()
}
}

// Linkdef
#ifdef __CINT__

#pragma link C++ class SplitGLView;

#endif

#ifdef __CINT__
void SplitGLView()
Expand Down
9 changes: 0 additions & 9 deletions tutorials/eve/alice_vsd.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
///
/// \author Matevz Tadel

#if defined(__CINT__) && !defined(__MAKECINT__)
{
Info("alice_vsd.C",
"Has to be run in compiled mode ... doing this for you.");
gSystem->CompileMacro("alice_vsd.C");
alice_vsd();
}
#else


#include <TEveManager.h>
#include <TEveEventManager.h>
Expand Down
3 changes: 0 additions & 3 deletions tutorials/eve/pointset.C
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@
///
/// \author Matevz Tadel

#ifndef __CINT__

#include <TEveManager.h>
#include <TEvePointSet.h>
#include <TEveRGBAPalette.h>
#include <TColor.h>
#include <TRandom.h>
#include <TMath.h>

#endif

TEvePointSet* pointset(Int_t npoints = 512, TEveElement* parent=0)
{
Expand Down
12 changes: 0 additions & 12 deletions tutorials/eve/track.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@
///
/// \author Alja Mrak-Tadel

#if defined(__CINT__) && !defined(__MAKECINT__)
{
Info("track.C",
"Has to be run in compiled mode, esp. if you want to pass parameters.");
gSystem->CompileMacro("track.C");
track();
}
#else

#include "TEveTrackPropagator.h"
#include "TEveTrack.h"
Expand Down Expand Up @@ -172,10 +164,6 @@ TEveTrack* make_track(TEveTrackPropagator* prop, Int_t sign)

void track(Int_t mode = 1, Bool_t isRungeKutta = kTRUE)
{
#if defined (__CINT__)
Error("track.C", "Must be run in compiled mode!");
return;
#endif

gSystem->IgnoreSignal(kSigSegmentationViolation, true);
TEveManager::Create();
Expand Down
8 changes: 0 additions & 8 deletions tutorials/foam/foam_demo.C
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
///
/// \author Stascek Jadach

#if defined(__CINT__) && !defined(__MAKECINT__)
{
std::cout << "Using ACliC to run this macro since it uses custom classes" << std::endl;
TString macroFileName = gSystem->UnixPathName(__FILE__);
gSystem->CompileMacro(macroFileName, "k");
foam_demo();
}
#else

#include "Riostream.h"
#include "TFile.h"
Expand Down
Binary file added tutorials/foam/foam_demo.root
Binary file not shown.
8 changes: 1 addition & 7 deletions tutorials/foam/foam_demopers.C
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ Int_t foam_demopers()

//N.B. the integrand functions need to be reset
// because cannot be made persistent
#ifdef __CINT__
// this can be done only in CINT
TFoamIntegrand *rho= new TFDISTR();
#else
// this should be done with AClic or Cling
TFoamIntegrand * rho = (TFoamIntegrand*) gROOT->ProcessLine("return new TFDISTR();");
#endif
TFoamIntegrand * rho = (TFoamIntegrand*) gROOT->ProcessLine("return new TFDISTR();");
FoamX->SetRho(rho);

Double_t *MCvect =new Double_t[2]; // 2-dim vector generated in the MC run
Expand Down
20 changes: 0 additions & 20 deletions tutorials/gl/glvox2.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,6 @@
///
/// \author Timur Pocheptsov

#if defined(__CINT__) && !defined(__MAKECINT__)

{
//gSystem->AddIncludePath("-I$ROOTSYS/include");
TString macroName;
const char *rootSysPath = gSystem->Getenv("ROOTSYS");
if (rootSysPath) {
macroName = rootSysPath;
if (!macroName.EndsWith("/") && !macroName.EndsWith("\\"))
macroName += "/";
macroName += "tutorials/gl/";
}

macroName += "glvox2.C++";
gROOT->LoadMacro(macroName.Data());
glvox2();
}

#else

#include "TStyle.h"
#include "TList.h"
Expand Down Expand Up @@ -124,4 +105,3 @@ void glvox2()
hist->Draw("glcol");
}

#endif
7 changes: 0 additions & 7 deletions tutorials/gl/viewer3DMaster.C
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
///
/// \author Richard Maunder

#if defined(__CINT__) && !defined(__MAKECINT__)
{
gSystem->CompileMacro("viewer3DMaster.C");
viewer3DMaster();
}
#else

#include "TVirtualViewer3D.h"
#include "TBuffer3D.h"
Expand Down Expand Up @@ -338,4 +332,3 @@ void viewer3DMaster()
myGeom->Draw("ogl");
}

#endif
9 changes: 1 addition & 8 deletions tutorials/gui/QtFileDialog.C
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,13 @@
///
/// \author Valeri Fine 23/03/2006

#ifndef __CINT__
# include <QFileDialog>
# include <QString>
# include "TString.h"
# include <string>
#endif


TString QtFileDialog() {
#ifdef __CINT__
// Load the qt cint dictionary.
// One is recommended to do that at once somewhere.
// For example from one's custom rootlogon.C script
gSystem->Load("$ROOTSYS/cint/cint/include/qtcint");
#endif
QString fileName = QFileDialog::getOpenFileName ();
std::string flnm = fileName.toStdString();
return TString(flnm.c_str());
Expand Down
9 changes: 1 addition & 8 deletions tutorials/gui/QtMultiFileDialog.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
///
/// \author Valeri Fine 23/03/2006

#ifndef __CINT__
# include <QApplication>
# include <QStyle>
# include <QFileDialog>
Expand All @@ -42,15 +41,9 @@
# include "TObjString.h"
# include "TList.h"
# include <string>
#endif

TList *QtMultiFileDialog(const char *style="") {

#ifdef __CINT__
// Load the qt cint dictionary.
// One is recommended to do that at once somewhere.
// For example from one's custom rootlogon.C script
gSystem->Load("$ROOTSYS/cint/cint/include/qtcint");
#endif
QStyle *saveStyle = 0;
if (!QString(style).isEmpty()) {
saveStyle = QApplication::style();
Expand Down
10 changes: 2 additions & 8 deletions tutorials/gui/QtPrintDialog.C
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,16 @@
///
/// \author Valeri Fine 23/03/2006

#ifndef __CINT__

# include <QPrintDialog>
# include <QPrinter>
# include <QPainter>
# include <QPixmap>
# include <TCanvas.h>
# include <TGQt.h>
#endif

void QtPrintDialog(TVirtualPad *pad = 0) {

#ifdef __CINT__
// Load the qt cint dictionary.
// One is recommended to do that at once somewhere.
// For example from one's custom rootlogon.C script
gSystem->Load("$ROOTSYS/cint/cint/include/qtcint");
#endif
TVirtualPad *pd = pad;
if (!pd) pd = TPad::Pad(); // ->GetCanvas();
if (pd) {
Expand Down
8 changes: 1 addition & 7 deletions tutorials/math/Legendre.C
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
///
/// \author Lorenzo Moneta

#if defined(__CINT__) && !defined(__MAKECINT__)
{
gSystem->CompileMacro("Legendre.C", "k");
Legendre();
}
#else

#include "TMath.h"
#include "TF1.h"
Expand Down Expand Up @@ -61,4 +55,4 @@ void Legendre()

Canvas->cd();
}
#endif

8 changes: 0 additions & 8 deletions tutorials/math/LegendreAssoc.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
///
/// \author Magdalena Slawinska

#if defined(__CINT__) && !defined(__MAKECINT__)
{
gSystem->CompileMacro("LegendreAssoc.C", "k");
LegendreAssoc();
}
#else

#include "TMath.h"
#include "TF1.h"
Expand Down Expand Up @@ -117,5 +111,3 @@ void LegendreAssoc()
}
}

#endif

3 changes: 1 addition & 2 deletions tutorials/math/TSVDUnfoldExample.C
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
#include "TColor.h"
#include "TLine.h"

#if not defined(__CINT__) || defined(__MAKECINT__)
#include "TSVDUnfold.h"
#endif


Double_t Reconstruct( Double_t xt, TRandom3& R )
{
Expand Down
2 changes: 0 additions & 2 deletions tutorials/math/exampleTKDE.C
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
#include "TCanvas.h"
//#include "TStopwatch.h"
#include "TRandom.h"
#ifndef __CINT__
#include "Math/DistFunc.h"
#endif
#include "TLegend.h"

// test TKDE
Expand Down
4 changes: 0 additions & 4 deletions tutorials/math/mathcoreGenVector.C
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,6 @@ int testRotation() {

void mathcoreGenVector() {

#ifdef __CINT__
gSystem->Load("libMathCore");
using namespace ROOT::Math ;
#endif

testVector3D();
testPoint3D();
Expand Down
16 changes: 1 addition & 15 deletions tutorials/math/mathcoreVectorCollection.C
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// \file
/// \ingroup tutorial_math
/// \notebook
/// \notebook -js
/// Example showing how to write and read a std vector of ROOT::Math LorentzVector in a ROOT tree.
/// In the write() function a variable number of track Vectors is generated
/// according to a Poisson distribution with random momentum uniformly distributed
Expand Down Expand Up @@ -152,17 +152,6 @@ double read() {

int mathcoreVectorCollection() {

#if defined(__CINT__) && !defined(__MAKECINT__)

gSystem->Load("libMathCore");
gSystem->Load("libPhysics");
// in CINT need to do that after having loading the library
using namespace ROOT::Math ;

cout << "This tutorial can run only using ACliC, compiling it by doing: " << endl;
cout << "\t .x tutorials/math/mathcoreVectorCollection.C+" << endl;
return 0;
#else
int nEvents = 10000;
double s1 = write(nEvents);
double s2 = read();
Expand All @@ -172,12 +161,9 @@ int mathcoreVectorCollection() {
return -1;
}
return 0;
#endif
}

#ifndef __CINT__
int main() {
return mathcoreVectorCollection();
}
#endif

Loading