Skip to content

Commit

Permalink
Fix compilation warnings.
Browse files Browse the repository at this point in the history
Unused arguments / variables + shadowed variables.
  • Loading branch information
scott snyder authored and gaede committed Jun 30, 2021
1 parent 9492dc4 commit d77fbbb
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 56 deletions.
48 changes: 24 additions & 24 deletions src/DSTViewer.cc
Expand Up @@ -153,7 +153,7 @@ void DSTViewer::init() {

/**
* Process run header (?) */
void DSTViewer::processRunHeader( LCRunHeader* run) {
void DSTViewer::processRunHeader( LCRunHeader* /*run*/) {
_nRun++ ;
_nEvt = 0;
}
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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
Expand All @@ -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<ReconstructedParticle*>( col->getElementAt(j) );
for (int j=0; j < nelem2; ++j) { //number of elements in a jet
ReconstructedParticle * jet = dynamic_cast<ReconstructedParticle*>( col2->getElementAt(j) );
streamlog_out( DEBUG ) << " - jet energy " << jet->getEnergy() << std::endl ;

const double * mom = jet->getMomentum() ;
Expand Down Expand Up @@ -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



Expand Down Expand Up @@ -515,7 +515,7 @@ void DSTViewer::processEvent( LCEvent * evt ) {
_nEvt++;
}

void DSTViewer::check( LCEvent * evt ) { }
void DSTViewer::check( LCEvent * /*evt*/ ) { }

void DSTViewer::end(){ }

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/DrawCLIC.cc
Expand Up @@ -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();
Expand All @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions src/GenericViewer.cc
Expand Up @@ -183,7 +183,7 @@ void GenericViewer::init() {
}


void GenericViewer::processRunHeader( LCRunHeader* run) {
void GenericViewer::processRunHeader( LCRunHeader* /*run*/) {
_nRun++ ;
_nEvt = 0;
}
Expand Down Expand Up @@ -813,7 +813,7 @@ MarlinCED::add_layer_description("Reconstructed", _layerReco);
}


void GenericViewer::check( LCEvent * evt ) { }
void GenericViewer::check( LCEvent * /*evt*/ ) { }

void GenericViewer::end(){ }

Expand Down
22 changes: 11 additions & 11 deletions src/HEP_RecordProcessor.cc
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ++;
Expand All @@ -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 ++;
Expand All @@ -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 ++;
Expand All @@ -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
Expand All @@ -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)||
Expand All @@ -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-
Expand Down
29 changes: 13 additions & 16 deletions src/VertexViewer.cc
Expand Up @@ -150,7 +150,7 @@ void VertexViewer::init() {
}


void VertexViewer::processRunHeader( LCRunHeader* run) {
void VertexViewer::processRunHeader( LCRunHeader* /*run*/) {
_nRun++ ;
_nEvt = 0;
}
Expand Down Expand Up @@ -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<nLayersVTX; i++) {
Expand All @@ -209,9 +209,6 @@ void VertexViewer::processEvent( LCEvent * evt ) {

sensitive_distance = float(vxdLayerLayout.getSensitiveDistance(i));
sensitive_thickness = float(vxdLayerLayout.getSensitiveThickness(i));
sensitive_width = float(vxdLayerLayout.getSensitiveWidth(i));
sensitive_length = float(vxdLayerLayout.getSensitiveLength(i));
sensitive_offset = float (vxdLayerLayout.getSensitiveOffset(i));

float ft_xplmat,ft_yplmat;

Expand Down Expand Up @@ -405,14 +402,14 @@ void VertexViewer::processEvent( LCEvent * evt ) {
zmax = z;
}
ClusterShapes * shapes = new ClusterShapes(nhits,ah,xh,yh,zh);
float zBegin, zEnd;
//float zBegin, zEnd;
if (fabs(zmin)<fabs(zmax)) {
zBegin = zmin;
zEnd = zmax;
//zBegin = zmin;
//zEnd = zmax;
}
else {
zBegin = zmax;
zEnd = zmin;
//zBegin = zmax;
//zEnd = zmin;
}
// float signPz = zEnd - zBegin;
// float dz = (zmax - zmin) / 100.;
Expand Down Expand Up @@ -607,14 +604,14 @@ void VertexViewer::processEvent( LCEvent * evt ) {
zmax = z;
}
ClusterShapes * shapes = new ClusterShapes(nhits,ah,xh,yh,zh);
float zBegin, zEnd;
//float zBegin, zEnd;
if (fabs(zmin)<fabs(zmax)) {
zBegin = zmin;
zEnd = zmax;
//zBegin = zmin;
//zEnd = zmax;
}
else {
zBegin = zmax;
zEnd = zmin;
//zBegin = zmax;
//zEnd = zmin;
}
// float signPz = zEnd - zBegin;
//float dz = (zmax - zmin) / 100.;
Expand Down Expand Up @@ -735,7 +732,7 @@ void VertexViewer::processEvent( LCEvent * evt ) {
}


void VertexViewer::check( LCEvent * evt ) { }
void VertexViewer::check( LCEvent * /*evt*/ ) { }

void VertexViewer::end(){ }

Expand Down

0 comments on commit d77fbbb

Please sign in to comment.