Skip to content

Commit

Permalink
Fix GCC warning: unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Nov 17, 2022
1 parent f0d560d commit 713d534
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 141 deletions.
6 changes: 1 addition & 5 deletions StRoot/StBTofPool/alignment/analysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using namespace std;
int main(int argc, char **argv)
{
if(argc !=2) exit(1);
if(!gSystem) TUnixSystem *gSystem = new TUnixSystem();
//if(!gSystem) TUnixSystem *gSystem = new TUnixSystem();

//----------------------------------
// Open files and add to the chain
Expand Down Expand Up @@ -75,10 +75,6 @@ int main(int argc, char **argv)
//----------------------
// Book the histograms
//----------------------
Float_t mrpcA[32] = { 0., 0., 0., 0., 0., 0., 16., 16.,
20., 22., 22., 22., 22., 22., 26., 26.,
26., 26., 30., 30., 32., 32., 32., 32.,
32., 32., 32., 32., 32., 32., 32., 32.};
Int_t MIdStart[8] = {1, 7, 9, 10, 15, 19, 21, 33};
TH2D *mYLocal[7];
TH2D *mZLocal[7];
Expand Down
7 changes: 0 additions & 7 deletions StRoot/StBTofSimMaker/StBTofSimMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -820,12 +820,6 @@ int StBTofSimMaker::FastCellResponse(g2t_ctf_hit_st* tofHitsFromGeant, StBTofCol
double pathL = tofHitsFromGeant->s_track;
double q = 0.;

double Rawtof = tofHitsFromGeant->tof*1000./nanosecond;
float Rawbeta=pathL/Rawtof/3e-2;
double momentum=partnerTrk->momentum().mag();
double mass=partnerTrk->fourMomentum().m();
double calcTof=pathL/(3e-2)/sqrt(1 - mass*mass/(momentum*momentum + mass*mass));

double time_blur = ranGauss.shoot()*mSimResDb->timeres_tof(itray, imodule, icell)*1e-9/nanosecond;
double tof = tofHitsFromGeant->tof*1000./nanosecond + time_blur; //! 85ps per channel

Expand Down Expand Up @@ -853,7 +847,6 @@ int StBTofSimMaker::FastCellResponse(g2t_ctf_hit_st* tofHitsFromGeant, StBTofCol

// tof = tof - mSimDb->toffset(); // Apply offset correction.
double t0 = tofHitsFromGeant->tof*1000./nanosecond;
float beta=pathL/tof/3e-2;

StMcBTofHit *mcBTofHit = new StMcBTofHit(itray,imodule,icell,de,pathL,t0,tof,q);
mcBTofHit->setPosition(local);
Expand Down
3 changes: 0 additions & 3 deletions StRoot/StDaqLib/GENERIC/EventReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,6 @@ void EventReader::InitEventReader(int fdes, long offset, int MMap)
{//InitER
#define MX_MAP_SIZE 0x20000000

off_t FileLength;

if (verbose) {
LOG_INFO<< "Initializing EventReader with a MAPPED file" << endm;
}
Expand All @@ -406,7 +404,6 @@ void EventReader::InitEventReader(int fdes, long offset, int MMap)
LOG_ERROR << "DaqOpenTag"<< strerror(errno) <<endm;
ERROR(ERR_FILE);
}
FileLength = buf.st_size;

next_event_offset = 0;
Logical_Record lr;
Expand Down
3 changes: 1 addition & 2 deletions StRoot/StDaqLib/SSD/SSD_Reader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int SSD_Reader::ssdData(int ladder,
int &ped,
int &noise) {

int cnt=0,strip,pad,i,det,pos,mtime,time,daqLadder;
int cnt=0,pad,i,pos,mtime,time,daqLadder;
static unsigned int cache1[12288];
static unsigned int cache2[12288];
static int daqLadderInit=-1;
Expand All @@ -75,7 +75,6 @@ int SSD_Reader::ssdData(int ladder,
for(mtime=0;mtime<ssd.counts[daqLadder][pad];mtime++) {
if (time==ssd.strip[daqLadder][pad][mtime])
{
det=pos/768; strip=pos%768;
assert(pos>=0&&pos<12288);
cache1[pos]=log8to10_table[ssd.adc[daqLadder][pad][mtime]];
cnt++;
Expand Down
9 changes: 1 addition & 8 deletions StRoot/StDaqLib/TOF/TOF_Reader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ unsigned int TOF_Reader::GetTrailingTdc(int ihit) {

int TOF_Reader::UnpackYear2to4Data(const Bank_TOFP * TofPTR) {

unsigned short numberOfDataWords, slot, channel;
unsigned short numberOfDataWords;
int dataDWord, value;
//TofPTR->print();
unsigned short Token = TofPTR->header.Token;
Expand Down Expand Up @@ -484,8 +484,6 @@ int TOF_Reader::UnpackYear2to4Data(const Bank_TOFP * TofPTR) {
//slot = (int)TofAdcD->data[dataDWord].adc.slot;
//channel = (int)TofAdcD->data[dataDWord].adc.channel;
//value = (int)TofAdcD->data[dataDWord].adc.data;
slot = int( TofAdcD->data[dataDWord].data & 0x000000FF);
channel = int((TofAdcD->data[dataDWord].data & 0x0000FF00) >> 8);
value = int((TofAdcD->data[dataDWord].data & 0xFFFF0000) >> 16);
mTheTofArray.AdcData[dataDWord]=value;
}
Expand All @@ -512,8 +510,6 @@ int TOF_Reader::UnpackYear2to4Data(const Bank_TOFP * TofPTR) {
//slot = (int)TofTdcD->data[dataDWord].tdc.slot;
//channel = (int)TofTdcD->data[dataDWord].tdc.channel;
//value = (int)TofTdcD->data[dataDWord].tdc.data;
slot = int( TofTdcD->data[dataDWord].data & 0x000000FF);
channel = int((TofTdcD->data[dataDWord].data & 0x0000FF00) >> 8);
value = int((TofTdcD->data[dataDWord].data & 0xFFFF0000) >> 16);
mTheTofArray.TdcData[dataDWord]=value;
}
Expand All @@ -540,8 +536,6 @@ int TOF_Reader::UnpackYear2to4Data(const Bank_TOFP * TofPTR) {
//slot = (int)TofA2dD->data[dataDWord].a2d.slot;
//channel = (int)TofA2dD->data[dataDWord].a2d.channel;
//value = (int)TofA2dD->data[dataDWord].a2d.data;
slot = int( TofA2dD->data[dataDWord].data & 0x000000FF);
channel = int((TofA2dD->data[dataDWord].data & 0x0000FF00) >> 8);
value = int(int(TofA2dD->data[dataDWord].data) >> 16);// A2D values might be negative
mTheTofArray.A2dData[dataDWord]=value;
}
Expand All @@ -567,7 +561,6 @@ int TOF_Reader::UnpackYear2to4Data(const Bank_TOFP * TofPTR) {
for (dataDWord=0; dataDWord < numberOfDataWords; dataDWord++) {
//channel = (int)TofScaD->data[dataDWord].sca.channel;
//value = (int)TofScaD->data[dataDWord].sca.data;
channel = int( TofScaD->data[dataDWord].data & 0x000000FF);
value = int((TofScaD->data[dataDWord].data & 0xFFFFFF00) >> 8);
mTheTofArray.ScaData[dataDWord]=value;
}
Expand Down
4 changes: 1 addition & 3 deletions StRoot/StDaqLib/TRG/code2007.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using namespace OLDEVP;

int TRG_Reader::UnpackTrg2007(Bank_TRGP *pTRGP){
int returnValue,npre,npost,swap,res;
int npre,npost,swap,res;

if ( ! pTRGP){
printf("TRG_Reader::UnpackTrg2007 - not pTRGP\n");
Expand All @@ -18,10 +18,8 @@ int TRG_Reader::UnpackTrg2007(Bank_TRGP *pTRGP){
pTRGP->header.ByteOrder==0x04030201);
if(pTRGP->header.ByteOrder==0x04030201) {
swap=1;
returnValue=0;
}else{
swap=1;
returnValue=pTRGP->header.swap();
}
if(pTRGP->header.ByteOrder!=0x04030201){
printf("TRG_Reader::UnpackTrg2007: Swap Header error %s %d.\n",__FILE__,__LINE__);
Expand Down
4 changes: 1 addition & 3 deletions StRoot/StDaqLib/TRG/code2008.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using namespace OLDEVP;

int TRG_Reader::UnpackTrg2008(Bank_TRGP *pTRGP){
int returnValue,npre,npost,swap,res;
int npre,npost,swap,res;

if ( ! pTRGP){
printf("TRG_Reader::UnpackTrg2008 - not pTRGP\n");
Expand All @@ -18,10 +18,8 @@ int TRG_Reader::UnpackTrg2008(Bank_TRGP *pTRGP){
pTRGP->header.ByteOrder==0x04030201);
if(pTRGP->header.ByteOrder==0x04030201) {
swap=1;
returnValue=0;
}else{
swap=1;
returnValue=pTRGP->header.swap();
}
if(pTRGP->header.ByteOrder!=0x04030201){
printf("TRG_Reader::UnpackTrg2008: Swap Header error %s %d.\n", __FILE__ , __LINE__ );
Expand Down
3 changes: 0 additions & 3 deletions StRoot/StDbLib/StDbBuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,19 +468,16 @@ return true;
#define Rarray(tpe,tpelist) \
bool StDbBuffer::ReadArray(tpe* &s, int &len,const char *aName)\
{ bool tRetVal=false; \
bool newCheck=false;\
if (Find_Col(aName)) \
{int i;\
if (mCol[mCur].type==_char ) {\
len=mCol[mCur].length/sizeof(tpe);\
s=new tpe[len];\
newCheck=true;\
MemSwapCpy((char*)s,(char*)mCol[mCur].val,len*sizeof(tpe),mycswapl[tpelist],Auto);\
tRetVal=true;\
} else {\
len=mCol[mCur].length;\
s=new tpe[len];\
newCheck=true;\
for (i=0;i<len;i++)\
{ if (!(WriteMem(&s[i],(void*)(((char*)mCol[mCur].val)+i*mycsize[mCol[mCur].type]),mCol[mCur].type))) break;}\
if (i==(int)mCol[mCur].length) tRetVal=true;}}\
Expand Down
6 changes: 3 additions & 3 deletions StRoot/StEEmcUtil/EEfeeRaw/RootWrapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ eemcfeerootfill_(unsigned short& evtype, unsigned short& evtoken, unsigned short

for(unsigned short *p = e; (p-e)<size; ) {
b->clear();
*p++; // skip marker
p++; // skip marker
unsigned int wordcnt = *p++;
*p++; // 0 resword1
*p++; // 1 resword2
p++; // 0 resword1
p++; // 1 resword2
unsigned short token = *p++; // 2
unsigned short cratrig = *p++; // 3
if(token!=evtoken) {
Expand Down
8 changes: 4 additions & 4 deletions StRoot/StEEmcUtil/StEEmcSmd/EEmcSmdGeom.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ void EEmcSmdGeom::buildSmdGeom(){
float y1[kEEmcNumStrips];
float y2[kEEmcNumStrips];
float length[kEEmcNumStrips];
float x0Edge[kEEmcNumEdgeStrips];
//float x0Edge[kEEmcNumEdgeStrips];
float y1Edge[kEEmcNumEdgeStrips];
float y2Edge[kEEmcNumEdgeStrips];
//float y2Edge[kEEmcNumEdgeStrips];
float lengthEdge[kEEmcNumEdgeStrips];

// fill variable arrays with data in EmcStripGeom.h
Expand All @@ -112,9 +112,9 @@ void EEmcSmdGeom::buildSmdGeom(){
length[i] = EEmcStripGeomData[i].length;
}
for (int i = 0; i < kEEmcNumEdgeStrips; i++) {
x0Edge[i] = EEmcEdgeStripGeomData[i].x0;
//x0Edge[i] = EEmcEdgeStripGeomData[i].x0;
y1Edge[i] = EEmcEdgeStripGeomData[i].y1;
y2Edge[i] = EEmcEdgeStripGeomData[i].y2;
//y2Edge[i] = EEmcEdgeStripGeomData[i].y2;
lengthEdge[i] = EEmcEdgeStripGeomData[i].length;
}
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ void StEStruct2ptCorrelations::makePairs(StEStructEvent* e1, StEStructEvent* e2,
StEStructTrackIterator Iter2;

int iyt1,iyt2,idyt,isyt;
int ipt1,ipt2;
int ieta1,ieta2,ideta,iseta;
int iphi1,iphi2,idphi;
int isavgt, isavgz, isentt, isentz;
Expand Down Expand Up @@ -1152,11 +1151,11 @@ void StEStruct2ptCorrelations::makePairs(StEStructEvent* e1, StEStructEvent* e2,
pt2 = mPair.Track2()->Pt();

iyt1 = b->iyt(mPair.Track1()->Yt(mass1));
ipt1 = b->ipt(pt1);
b->ipt(pt1);
ieta1 = b->ieta(mPair.Track1()->Eta(mass1));
iphi1 = b->iphi(mPair.Track1()->Phi());
iyt2 = b->iyt(mPair.Track2()->Yt(mass2));
ipt2 = b->ipt(pt2);
b->ipt(pt2);
ieta2 = b->ieta(mPair.Track2()->Eta(mass2));
iphi2 = b->iphi(mPair.Track2()->Phi());

Expand Down
8 changes: 1 addition & 7 deletions StRoot/StEStructPool/Correlations/StEStructPairCuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,23 +688,17 @@ inline int StEStructPairCuts::cutMass() {
}
int iBin = mode[it1][it2];

double e, e1, e2, p1, p2, p[3], m, m1, m2;
double e, e1, e2, p1, p2, p[3], m;
p1 = Track1()->Ptot();
p2 = Track2()->Ptot();
p[0] = Track1()->Px() + Track2()->Px();
p[1] = Track1()->Py() + Track2()->Py();
p[2] = Track1()->Pz() + Track2()->Pz();
float Mass[] = {0.1396, 0.1396, 0.497, 0.9383};
float Mass2[] = {0.01949, 0.01949, 0.247, 0.880};
if (9 == iBin) {
// For o-o try using m1 = m2 = 0.
m1 = 0;
m2 = 0;
e1 = p1;
e2 = p2;
} else {
m1 = Mass[it1];
m2 = Mass[it2];
e1 = sqrt(p1*p1 + Mass2[it1]);
e2 = sqrt(p2*p2 + Mass2[it2]);
}
Expand Down
8 changes: 2 additions & 6 deletions StRoot/StEStructPool/EventGenerators/StEStructFlat.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,14 @@ void StEStructFlat::fillTracks(StEStructEvent* estructEvent) {

mnumTracks = 0;
StEStructTrack* eTrack = new StEStructTrack();
int pid, sign;
int pid;

// int numCharge = int( -5*log(drand48()) );
int numCharge, numInEta = 850;
double v2 = 0.05, pi = 3.1415926;
double eta, quadEta = 0.2, etaMax = 2;
double phi, phiOff, sectorWidth;
int numSector = 12;
double phi, phiOff;

sectorWidth = 360 / numSector;
phiOff = 360*drand48();

float p[3], pt, pz, v[3];
Expand All @@ -119,10 +117,8 @@ void StEStructFlat::fillTracks(StEStructEvent* estructEvent) {

eTrack->SetInComplete();
if (i < numCharge/2) {
sign = +1;
pid = 211;
} else {
sign = -1;
pid = -211;
}
double etaAmp = 0, randAmp = 1;
Expand Down
Loading

0 comments on commit 713d534

Please sign in to comment.