From d77fbbb9f3215c43b51897da0134cf4786962676 Mon Sep 17 00:00:00 2001 From: scott snyder Date: Mon, 3 Feb 2020 00:27:48 -0500 Subject: [PATCH] Fix compilation warnings. Unused arguments / variables + shadowed variables. --- src/DSTViewer.cc | 48 +++++++++++++++++++------------------- src/DrawCLIC.cc | 6 ++--- src/GenericViewer.cc | 4 ++-- src/HEP_RecordProcessor.cc | 22 ++++++++--------- src/VertexViewer.cc | 29 +++++++++++------------ 5 files changed, 53 insertions(+), 56 deletions(-) diff --git a/src/DSTViewer.cc b/src/DSTViewer.cc index 3d1f6e2..5e6d593 100644 --- a/src/DSTViewer.cc +++ b/src/DSTViewer.cc @@ -153,7 +153,7 @@ void DSTViewer::init() { /** * Process run header (?) */ -void DSTViewer::processRunHeader( LCRunHeader* run) { +void DSTViewer::processRunHeader( LCRunHeader* /*run*/) { _nRun++ ; _nEvt = 0; } @@ -333,29 +333,29 @@ void DSTViewer::processEvent( LCEvent * evt ) { char scale = 'a'; // 'b': linear, 'a': log int colorMap = 3; //jet: 3 int colorSteps = 256; - int color = returnRGBClusterColor(eneCluster, ene_min, ene_max, colorSteps, scale, colorMap); + int color2 = returnRGBClusterColor(eneCluster, ene_min, ene_max, colorSteps, scale, colorMap); // int hit_type = 1 | HIT_LAYER; int cylinder_sides = 30; //problem with fisheye view - ced_geocylinder_r(sizes[0]/2, sizes[2], center, rotate, cylinder_sides, color, CLUSTER_LAYER); + ced_geocylinder_r(sizes[0]/2, sizes[2], center, rotate, cylinder_sides, color2, CLUSTER_LAYER); - //ced_hit(center[0],center[1],center[2], hit_type, (int)(sqrt(2)*sizes[0]/4), color); - ced_hit_ID(center[0],center[1],center[2], 1, HIT_LAYER, (int)(sqrt(2)*sizes[0]/4), color, cluster->id()); //hauke + //ced_hit(center[0],center[1],center[2], hit_type, (int)(sqrt(2)*sizes[0]/4), color2); + ced_hit_ID(center[0],center[1],center[2], 1, HIT_LAYER, (int)(sqrt(2)*sizes[0]/4), color2, cluster->id()); //hauke int transparency = 0x66; - int rgba = addAlphaChannelToColor(color, transparency); + int rgba = addAlphaChannelToColor(color2, transparency); //ced_cluellipse_r((float)sizes[0], (float)sizes[2], center_r, rotate, BACKUP_LAYER, rgba); ced_cluellipse_r_ID((float)sizes[0], (float)sizes[2], center_r, rotate, BACKUP_LAYER, rgba, cluster->id()); //hauke transparency = 0xCC; - rgba = addAlphaChannelToColor(color, transparency); + rgba = addAlphaChannelToColor(color2, transparency); //ced_ellipsoid_r(sizes, center, rotate, BACKUP_LAYER2, rgba); ced_ellipsoid_r_ID(sizes, center, rotate, BACKUP_LAYER2, rgba, cluster->id()); //hauke @@ -368,7 +368,7 @@ void DSTViewer::processEvent( LCEvent * evt ) { //int ml_line = 9; float radius = (float)0.5*sizes[2]; float arrow = 0.2*radius; - int color_arrow = color + 0x009900; //colour of the needle + int color_arrow = color2 + 0x009900; //colour of the needle float xEnd = center[0] + (radius - arrow) * std::sin(theta)*std::cos(phi); float yEnd = center[1] + (radius - arrow) * std::sin(theta)*std::sin(phi); @@ -379,8 +379,8 @@ void DSTViewer::processEvent( LCEvent * evt ) { float zArrowEnd = center[2] + (radius) * std::cos(theta); // this is the direction arrow - //ced_line(center[0],center[1],center[2], xEnd, yEnd, zEnd, CLUSTER_LAYER, sizeLine, color); - ced_line_ID(center[0],center[1],center[2], xEnd, yEnd, zEnd, CLUSTER_LAYER, sizeLine, color,cluster->id()); //hauke + //ced_line(center[0],center[1],center[2], xEnd, yEnd, zEnd, CLUSTER_LAYER, sizeLine, color2); + ced_line_ID(center[0],center[1],center[2], xEnd, yEnd, zEnd, CLUSTER_LAYER, sizeLine, color2,cluster->id()); //hauke //ced_line(xEnd, yEnd, zEnd, xArrowEnd, yArrowEnd, zArrowEnd, CLUSTER_LAYER, sizeLine, color_arrow); ced_line_ID(xEnd, yEnd, zEnd, xArrowEnd, yArrowEnd, zArrowEnd, CLUSTER_LAYER, sizeLine, color_arrow, cluster->id());//hauke @@ -394,15 +394,15 @@ void DSTViewer::processEvent( LCEvent * evt ) { streamlog_out( DEBUG ) << " drawing jets from collection " << _jetCollections[i] << std::endl ; - LCCollection * col = evt->getCollection( _jetCollections[i] ); + LCCollection * col2 = evt->getCollection( _jetCollections[i] ); - int nelem = col->getNumberOfElements(); + int nelem2 = col2->getNumberOfElements(); //int color = 0x000000; - for (int j=0; j < nelem; ++j) { //number of elements in a jet - ReconstructedParticle * jet = dynamic_cast( col->getElementAt(j) ); + for (int j=0; j < nelem2; ++j) { //number of elements in a jet + ReconstructedParticle * jet = dynamic_cast( col2->getElementAt(j) ); streamlog_out( DEBUG ) << " - jet energy " << jet->getEnergy() << std::endl ; const double * mom = jet->getMomentum() ; @@ -462,17 +462,17 @@ void DSTViewer::processEvent( LCEvent * evt ) { const double *pm=jet->getMomentum(); - int color = int(RGBAcolor[2]*(15*16+15)) + int(RGBAcolor[1]*(15*16+15))*16*16+ int(RGBAcolor[0]*(15*16+15))*16*16*16*16; + int color2 = int(RGBAcolor[2]*(15*16+15)) + int(RGBAcolor[1]*(15*16+15))*16*16+ int(RGBAcolor[0]*(15*16+15))*16*16*16*16; - //printf("RGBAcolor: %f %f %f color: %x\n", RGBAcolor[0], RGBAcolor[1], RGBAcolor[2], color); - //ced_line_ID(0.0, 0.0, 0.0, 33*pm[0], 33*pm[1], 33*pm[2], layer, 1, color, jet->id()); //hauke - int i; - for(i=1;i<104;i++){ - ced_line_ID((i-1)/4*pm[0], (i-1)/4*pm[1], (i-1)/4*pm[2], i/4*pm[0], i/4*pm[1], i/4*pm[2], layer, 1, color, jet->id()); //hauke - //ced_hit_ID(i/4*pm[0], i/4*pm[1], i/4*pm[2], layer, 2, color, jet->id()); //hauke + //printf("RGBAcolor: %f %f %f color: %x\n", RGBAcolor[0], RGBAcolor[1], RGBAcolor[2], color2); + //ced_line_ID(0.0, 0.0, 0.0, 33*pm[0], 33*pm[1], 33*pm[2], layer, 1, color2, jet->id()); //hauke + int i2; + for(i2=1;i2<104;i2++){ + ced_line_ID((i2-1)/4*pm[0], (i2-1)/4*pm[1], (i2-1)/4*pm[2], i2/4*pm[0], i2/4*pm[1], i2/4*pm[2], layer, 1, color2, jet->id()); //hauke + //ced_hit_ID(i2/4*pm[0], i2/4*pm[1], i2/4*pm[2], layer, 2, color, jet->id()); //hauke } - ced_hit_ID((i-1)/4*pm[0], (i-1)/4*pm[1], (i-1)/4*pm[2], 0, layer, 2, color, jet->id()); //hauke + ced_hit_ID((i2-1)/4*pm[0], (i2-1)/4*pm[1], (i2-1)/4*pm[2], 0, layer, 2, color2, jet->id()); //hauke @@ -515,7 +515,7 @@ void DSTViewer::processEvent( LCEvent * evt ) { _nEvt++; } -void DSTViewer::check( LCEvent * evt ) { } +void DSTViewer::check( LCEvent * /*evt*/ ) { } void DSTViewer::end(){ } @@ -841,7 +841,7 @@ int DSTViewer::addAlphaChannelToColor(int color, int alphaChannel){ } -int DSTViewer::returnJetColor(std::string jetColName, int colNumber){ +int DSTViewer::returnJetColor(std::string /*jetColName*/, int colNumber){ int color = 0x00000000; int white = 0x55555555; diff --git a/src/DrawCLIC.cc b/src/DrawCLIC.cc index 902a1a8..a4eab64 100644 --- a/src/DrawCLIC.cc +++ b/src/DrawCLIC.cc @@ -66,14 +66,14 @@ void DrawCLIC::init() { } -void DrawCLIC::processRunHeader( LCRunHeader* run) { +void DrawCLIC::processRunHeader( LCRunHeader* /*run*/) { _nRun++ ; } -void DrawCLIC::processEvent( LCEvent * evt ) { +void DrawCLIC::processEvent( LCEvent * /*evt*/ ) { MarlinCED::newEvent(this , -1 ); drawGEARDetector(); @@ -83,7 +83,7 @@ void DrawCLIC::processEvent( LCEvent * evt ) { -void DrawCLIC::check( LCEvent * evt ) { +void DrawCLIC::check( LCEvent * /*evt*/ ) { // nothing to check here - could be used to fill checkplots in reconstruction processor } diff --git a/src/GenericViewer.cc b/src/GenericViewer.cc index 216f616..e78720c 100644 --- a/src/GenericViewer.cc +++ b/src/GenericViewer.cc @@ -183,7 +183,7 @@ void GenericViewer::init() { } -void GenericViewer::processRunHeader( LCRunHeader* run) { +void GenericViewer::processRunHeader( LCRunHeader* /*run*/) { _nRun++ ; _nEvt = 0; } @@ -813,7 +813,7 @@ MarlinCED::add_layer_description("Reconstructed", _layerReco); } -void GenericViewer::check( LCEvent * evt ) { } +void GenericViewer::check( LCEvent * /*evt*/ ) { } void GenericViewer::end(){ } diff --git a/src/HEP_RecordProcessor.cc b/src/HEP_RecordProcessor.cc index b48a39c..f247221 100644 --- a/src/HEP_RecordProcessor.cc +++ b/src/HEP_RecordProcessor.cc @@ -446,8 +446,8 @@ void draw_MC_Charged_Hadrons(LCEvent * evt, float ecut){ x1 = 0.0; y1 = 0.0; z1 = 0.0; - for (int i = 0; i < npt+1; i++) { - step = st*i; // helix length + for (int i2 = 0; i2 < npt+1; i2++) { + step = st*i2; // helix length tet = charge*BFIELD*EC*step/pr; sint = sin(tet); sintt = (sint/tet); @@ -490,7 +490,7 @@ void MC_Particles_Balance(LCEvent * evt){ int idpdg; const double* mom; float enr; - double mass; + //double mass; LCCollection* mcpCol = evt->getCollection("MCParticle" ) ; //----------------------------------------------------------------------- // Calculate balance at IP taking into account everything @@ -556,7 +556,7 @@ void MC_Particles_Balance(LCEvent * evt){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); // float cch = imc-> getCharge (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only px = mom[0]; @@ -684,7 +684,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ int idpdg; const double* mom; float enr; - float mass; + //float mass; LCCollection* mcpCol = evt->getCollection("MCParticle" ) ; //----------------------------------------------------------------------- // Print Pi zeros @@ -713,7 +713,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only if((My_iabs(idpdg)==12)||(My_iabs(idpdg)==14)||(My_iabs(idpdg)==16)) { // neutrinos n_nu ++; @@ -733,7 +733,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only if(My_iabs(idpdg)==13) { // mu+ mu- n_mu ++; @@ -753,7 +753,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only if(My_iabs(idpdg)==11) { // e+ e- n_elect ++; @@ -773,7 +773,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only if(idpdg == 22) { // photon if (enr > ecut) {// All gammas with E > 20 MeV @@ -795,7 +795,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only if((My_iabs(idpdg)==2112)||(My_iabs(idpdg)== 311)|| (My_iabs(idpdg)== 130)||(My_iabs(idpdg)== 310)|| @@ -819,7 +819,7 @@ void print_MC_Particles(LCEvent * evt, float ecut){ idpdg = imc-> getPDG (); mom = imc-> getMomentum (); enr = imc-> getEnergy (); - mass = imc-> getMass (); + //mass = imc-> getMass (); if( imc-> getGeneratorStatus() == 1 ) { // stable particles only if(!(My_iabs(idpdg)==12) && !(My_iabs(idpdg)==14) && !(My_iabs(idpdg)==16) && // neutrinos !(My_iabs(idpdg)==13) && // mu+ mu- diff --git a/src/VertexViewer.cc b/src/VertexViewer.cc index f5f7222..785775a 100644 --- a/src/VertexViewer.cc +++ b/src/VertexViewer.cc @@ -150,7 +150,7 @@ void VertexViewer::init() { } -void VertexViewer::processRunHeader( LCRunHeader* run) { +void VertexViewer::processRunHeader( LCRunHeader* /*run*/) { _nRun++ ; _nEvt = 0; } @@ -194,7 +194,7 @@ void VertexViewer::processEvent( LCEvent * evt ) { int nLayersVTX = vxdLayerLayout.getNLayers(); int nLadders = 0; float ladder_phi0, ladder_distance, ladder_thickness, ladder_width, ladder_length, ladder_offset; - float sensitive_distance, sensitive_thickness, sensitive_width, sensitive_length, sensitive_offset; + float sensitive_distance, sensitive_thickness; float x0,y0,x1,y1; for (int i=0; i