Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Geant] Additional changes for Geant 10.6 #28629

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/src/CaloSD.cc
Expand Up @@ -321,7 +321,7 @@ bool CaloSD::checkHit() {
found = true;
}
} else if (nCheckedHits > 0) {
int minhit = (theHC->entries() > nCheckedHits ? theHC->entries() - nCheckedHits : 0);
size_t minhit = (theHC->entries() > nCheckedHits ? theHC->entries() - nCheckedHits : 0);
mrodozov marked this conversation as resolved.
Show resolved Hide resolved
int maxhit = theHC->entries() - 1;

for (int j = maxhit; j > minhit; --j) {
Expand Down Expand Up @@ -504,7 +504,7 @@ void CaloSD::update(const ::EndOfEvent*) {
double zglob(0.0);
double ee(0.0);

for (int i = 0; i < theHC->entries(); ++i) {
for (size_t i = 0; i < theHC->entries(); ++i) {
if (!saveHit((*theHC)[i])) {
++wrong;
}
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/HcalTestAnalysis.cc
Expand Up @@ -317,7 +317,7 @@ void HcalTestAnalysis::fill(const EndOfEvent* evt) {
// access to the G4 hit collections
G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();

int nhc = 0, neb = 0, nef = 0, j = 0;
int nhc = 0, neb = 0, nef = 0; size_t j = 0;
caloHitCache_.erase(caloHitCache_.begin(), caloHitCache_.end());

// Hcal
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/FP420/plugins/FP420SD.cc
Expand Up @@ -196,7 +196,7 @@ G4bool FP420SD::HitExists() {

// LogDebug("FP420Sim") << "FP420SD: HCollection= " << theHC->entries() <<std::endl;

for (int j = 0; j < theHC->entries() && !found; j++) {
for (size_t j = 0; j < theHC->entries() && !found; j++) {
mrodozov marked this conversation as resolved.
Show resolved Hide resolved
FP420G4Hit* aPreviousHit = (*theHC)[j];
if (aPreviousHit->getTrackID() == primaryID && aPreviousHit->getTimeSliceID() == tSliceID &&
aPreviousHit->getUnitID() == unitID) {
Expand Down Expand Up @@ -333,7 +333,7 @@ void FP420SD::EndOfEvent(G4HCofThisEvent*) {
// for (int j=0; j<theHC->entries() && j<100; j++) {
int nhitsHPS240 = 0;
int nhitsFP420 = 0;
for (int j = 0; j < theHC->entries(); j++) {
for (size_t j = 0; j < theHC->entries(); j++) {
FP420G4Hit* aHit = (*theHC)[j];
if ((fabs(aHit->getTof()) > 780. && fabs(aHit->getTof()) < 840.))
++nhitsHPS240;
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/FP420/plugins/FP420Test.cc
Expand Up @@ -954,7 +954,7 @@ void FP420Test::update(const EndOfEvent* evt) {
varia = 2;
} // no MI end:

for (int j = 0; j < theCAFI->entries(); j++) {
for (size_t j = 0; j < theCAFI->entries(); j++) {
mrodozov marked this conversation as resolved.
Show resolved Hide resolved
FP420G4Hit* aHit = (*theCAFI)[j];
G4ThreeVector hitPoint = aHit->getEntry();
double zz = hitPoint.z();
Expand All @@ -973,7 +973,7 @@ void FP420Test::update(const EndOfEvent* evt) {
// .............
int nhit11 = 0, nhit12 = 0, nhit13 = 0;
double totallosenergy = 0.;
for (int j = 0; j < theCAFI->entries(); j++) {
for (size_t j = 0; j < theCAFI->entries(); j++) {
FP420G4Hit* aHit = (*theCAFI)[j];

G4ThreeVector hitEntryLocalPoint = aHit->getEntryLocalP();
Expand Down Expand Up @@ -1297,7 +1297,7 @@ void FP420Test::update(const EndOfEvent* evt) {
//======================================================================================================CHECK
if (totallosenergy == 0.0) {
std::cout << "FP420Test: number of hits = " << theCAFI->entries() << std::endl;
for (int j = 0; j < theCAFI->entries(); j++) {
for (size_t j = 0; j < theCAFI->entries(); j++) {
FP420G4Hit* aHit = (*theCAFI)[j];
double losenergy = aHit->getEnergyLoss();
std::cout << " j hits = " << j << "losenergy = " << losenergy << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Forward/src/BscTest.cc
Expand Up @@ -627,7 +627,7 @@ void BscTest::update(const EndOfEvent* evt) {
} else {
varia = 2;
} // no MI end:
for (int j = 0; j < theCAFI->entries(); j++) {
for (size_t j = 0; j < theCAFI->entries(); j++) {
mrodozov marked this conversation as resolved.
Show resolved Hide resolved
BscG4Hit* aHit = (*theCAFI)[j];
const CLHEP::Hep3Vector& hitPoint = aHit->getEntry();
double zz = hitPoint.z();
Expand All @@ -639,7 +639,7 @@ void BscTest::update(const EndOfEvent* evt) {
if (varia == 2) {
int nhit11 = 0, nhit12 = 0, nhit13 = 0;
double totallosenergy = 0.;
for (int j = 0; j < theCAFI->entries(); j++) {
for (size_t j = 0; j < theCAFI->entries(); j++) {
BscG4Hit* aHit = (*theCAFI)[j];

const CLHEP::Hep3Vector& hitEntryLocalPoint = aHit->getEntryLocalP();
Expand Down Expand Up @@ -782,7 +782,7 @@ void BscTest::update(const EndOfEvent* evt) {
} // MIonly or noMIonly ENDED
if (totallosenergy == 0.0) {
std::cout << "BscTest: number of hits = " << theCAFI->entries() << std::endl;
for (int j = 0; j < theCAFI->entries(); j++) {
for (size_t j = 0; j < theCAFI->entries(); j++) {
BscG4Hit* aHit = (*theCAFI)[j];
double losenergy = aHit->getEnergyLoss();
std::cout << " j hits = " << j << "losenergy = " << losenergy << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Forward/src/TimingSD.cc
Expand Up @@ -201,7 +201,7 @@ bool TimingSD::hitExists(const G4Step* aStep) {
//tSliceID already exists:

bool found = false;
for (int j = 0; j < theHC->entries(); ++j) {
for (size_t j = 0; j < theHC->entries(); ++j) {
mrodozov marked this conversation as resolved.
Show resolved Hide resolved
BscG4Hit* aHit = (*theHC)[j];
if (aHit->getTimeSliceID() == tSliceID && aHit->getUnitID() == unitID) {
if (checkHit(aStep, aHit)) {
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Forward/src/TotemSD.cc
Expand Up @@ -117,7 +117,7 @@ void TotemSD::Initialize(G4HCofThisEvent* HCE) {

void TotemSD::EndOfEvent(G4HCofThisEvent*) {
// here we loop over transient hits and make them persistent
for (int j = 0; j < theHC->entries() && j < 15000; j++) {
for (size_t j = 0; j < theHC->entries() && j < 15000; j++) {
TotemG4Hit* aHit = (*theHC)[j];
#ifdef ddebug
LogDebug("ForwardSim") << "HIT NUMERO " << j << "unit ID = " << aHit->getUnitID() << "\n"
Expand Down Expand Up @@ -224,7 +224,7 @@ bool TotemSD::hitExists() {

bool found = false;

for (int j = 0; j < theHC->entries() && !found; j++) {
for (size_t j = 0; j < theHC->entries() && !found; j++) {
TotemG4Hit* aPreviousHit = (*theHC)[j];
if (aPreviousHit->getTrackID() == primaryID && aPreviousHit->getTimeSliceID() == tSliceID &&
aPreviousHit->getUnitID() == unitID) {
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/HcalTestBeam/plugins/HcalTB04Analysis.cc
Expand Up @@ -459,7 +459,7 @@ void HcalTB04Analysis::update(const EndOfEvent* evt) {

void HcalTB04Analysis::fillBuffer(const EndOfEvent* evt) {
std::vector<CaloHit> hhits, hhitl;
int idHC, j;
int idHC;size_t j;
CaloG4HitCollection* theHC;
std::map<int, float, std::less<int> > primaries;
double etot1 = 0, etot2 = 0;
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/PPS/src/PPSPixelSD.cc
Expand Up @@ -228,7 +228,7 @@ bool PPSPixelSD::hitExists() {
//tSliceID_ already exists:
bool found = false;

for (int j = 0; j < theHC_->entries() && !found; j++) {
for (size_t j = 0; j < theHC_->entries() && !found; j++) {
PPSPixelG4Hit* aPreviousHit = (*theHC_)[j];
if (aPreviousHit->trackID() == primaryID_ && aPreviousHit->timeSliceID() == tSliceID_ &&
aPreviousHit->unitID() == unitID_) {
Expand Down
Expand Up @@ -320,7 +320,7 @@ void CastorShowerLibraryMaker::update(const G4Step* aStep) {
if (DeActivatePhysicsProcess) {
G4ProcessManager* p_mgr = trk->GetDefinition()->GetProcessManager();
G4ProcessVector* pvec = p_mgr->GetProcessList();
for (int i = 0; i < pvec->size(); i++) {
for (size_t i = 0; i < pvec->size(); i++) {
G4VProcess* proc = (*pvec)(i);
if (proc->GetProcessName() != "Transportation" && proc->GetProcessName() != "Decay") {
std::cout << "DeActivating process: " << proc->GetProcessName() << std::endl;
Expand Down Expand Up @@ -358,7 +358,7 @@ void CastorShowerLibraryMaker::update(const G4Step* aStep) {
if (trk->GetParentID() == 0 && DeActivatePhysicsProcess) {
G4ProcessManager* p_mgr = trk->GetDefinition()->GetProcessManager();
G4ProcessVector* pvec = p_mgr->GetProcessList();
for (int i = 0; i < pvec->size(); i++) {
for (size_t i = 0; i < pvec->size(); i++) {
G4VProcess* proc = (*pvec)(i);
if (proc->GetProcessName() != "Transportation" && proc->GetProcessName() != "Decay") {
std::cout << " Activating process: " << proc->GetProcessName() << std::endl;
Expand Down Expand Up @@ -442,7 +442,7 @@ void CastorShowerLibraryMaker::update(const EndOfEvent* evt) {

// Loop over primaries
int NEvtAccepted = 0;
int NHitInEvent = 0;
size_t NHitInEvent = 0;
for (unsigned int i = 0; i < thePrims.size(); i++) {
G4PrimaryParticle* thePrim = thePrims.at(i);
if (!thePrim) {
Expand Down Expand Up @@ -1025,7 +1025,7 @@ void CastorShowerLibraryMaker::GetMissingEnergy(CaloG4HitCollection* theCAFI, do
// Get the total deposited energy and the one from hit not associated to a primary
miss_energy = 0;
tot_energy = 0;
for (int ihit = 0; ihit < theCAFI->entries(); ihit++) {
for (size_t ihit = 0; ihit < theCAFI->entries(); ihit++) {
int id = (*theCAFI)[ihit]->getTrackID();
tot_energy += (*theCAFI)[ihit]->getEnergyDeposit();
int hit_prim = 0;
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/ShowerLibraryProducer/src/HcalForwardAnalysis.cc
Expand Up @@ -116,7 +116,7 @@ void HcalForwardAnalysis::update(const EndOfEvent* evt) {
}

void HcalForwardAnalysis::setPhotons(const EndOfEvent* evt) {
int idHC, j;
int idHC; size_t j;
FiberG4HitsCollection* theHC;
// Look for the Hit Collection of HCal
G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
Expand Down
2 changes: 1 addition & 1 deletion SimG4Core/GFlash/src/GflashHadronWrapperProcess.cc
Expand Up @@ -97,7 +97,7 @@ G4VParticleChange *GflashHadronWrapperProcess::PostStepDoIt(const G4Track &track

(const_cast<G4Track *>(&track))->SetTrackStatus(fPostponeToNextEvent);

for (G4int ipm = 0; ipm < fProcessVector->entries(); ipm++) {
for (size_t ipm = 0; ipm < fProcessVector->entries(); ipm++) {
fProcess = (*fProcessVector)(ipm);

if (fProcess->GetProcessType() == fParameterisation) {
Expand Down
6 changes: 3 additions & 3 deletions Validation/EcalHits/src/EcalSimHitsValidProducer.cc
Expand Up @@ -283,7 +283,7 @@ void EcalSimHitsValidProducer::update(const EndOfEvent *evt) {

// EB Hit collection start
MapType ebmap;
for (int j = 0; j < theEBHC->entries(); j++) {
for (size_t j = 0; j < theEBHC->entries(); j++) {
CaloG4Hit *aHit = (*theEBHC)[j];
totalEInEB += aHit->getEnergyDeposit();
float he = aHit->getEnergyDeposit();
Expand All @@ -307,7 +307,7 @@ void EcalSimHitsValidProducer::update(const EndOfEvent *evt) {
// EE Hit collection start
MapType eemap, eezpmap, eezmmap;

for (int j = 0; j < theEEHC->entries(); j++) {
for (size_t j = 0; j < theEEHC->entries(); j++) {
CaloG4Hit *aHit = (*theEEHC)[j];
totalEInEE += aHit->getEnergyDeposit();
float he = aHit->getEnergyDeposit();
Expand Down Expand Up @@ -342,7 +342,7 @@ void EcalSimHitsValidProducer::update(const EndOfEvent *evt) {
nCrystalInEEzp = eezpmap.size();

// Hits from ES
for (int j = 0; j < theSEHC->entries(); j++) {
for (size_t j = 0; j < theSEHC->entries(); j++) {
CaloG4Hit *aHit = (*theSEHC)[j];
totalEInES += aHit->getEnergyDeposit();
ESDetId esid = ESDetId(aHit->getUnitID());
Expand Down
2 changes: 1 addition & 1 deletion Validation/HcalHits/src/SimG4HcalValidation.cc
Expand Up @@ -268,7 +268,7 @@ void SimG4HcalValidation::fill(const EndOfEvent *evt) {
// access to the G4 hit collections
G4HCofThisEvent *allHC = (*evt)()->GetHCofThisEvent();

int nhc = 0, j = 0;
int nhc = 0; size_t j = 0;

// Hcal
int HCHCid = G4SDManager::GetSDMpointer()->GetCollectionID(names[0]);
Expand Down