Skip to content

Commit

Permalink
add _ to many class member names
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Aug 27, 2018
1 parent a70e353 commit e18171c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
12 changes: 6 additions & 6 deletions SimG4CMS/Calo/interface/HcalTestAnalysis.h
Expand Up @@ -78,20 +78,20 @@ class HcalTestAnalysis : public SimWatcher,
HcalTestNumberingScheme* org_;

// Hits for qie analysis
std::vector<CaloHit> caloHitCache;
std::vector<CaloHit> caloHitCache_;
std::vector<int> group_, tower_;
int nGroup, nTower;
int nGroup_, nTower_;

// to read from ParameterSet
std::vector<std::string> names_;
double eta0_, phi0_;
int centralTower_;

// some private members for ananlysis
unsigned int count;
double edepEB, edepEE, edepHB, edepHE;
double edepHO, edepl[20];
double mudist[20]; // Distance of muon from central part
unsigned int count_;
double edepEB_, edepEE_, edepHB_, edepHE_;
double edepHO_, edepl_[20];
double mudist_[20]; // Distance of muon from central part
};

#endif
78 changes: 39 additions & 39 deletions SimG4CMS/Calo/src/HcalTestAnalysis.cc
Expand Up @@ -45,16 +45,16 @@ HcalTestAnalysis::HcalTestAnalysis(const edm::ParameterSet &p):
edm::LogInfo("HcalSim") << "HcalTestAnalysis:: Initialised as observer of "
<< "begin/end events and of G4step";

count = 0;
count_ = 0;
group_ = layerGrouping(laygroup);
nGroup = 0;
nGroup_= 0;
for (unsigned int i=0; i<group_.size(); i++)
if (group_[i]>nGroup) nGroup = group_[i];
if (group_[i]>nGroup_) nGroup_ = group_[i];
tower_ = towersToAdd(centralTower_, addTower_);
nTower = tower_.size()/2;
nTower_= tower_.size()/2;

edm::LogInfo("HcalSim") << "HcalTestAnalysis:: initialised for " << nGroup
<< " Longitudinal groups and " << nTower
edm::LogInfo("HcalSim") << "HcalTestAnalysis:: initialised for " << nGroup_
<< " Longitudinal groups and " << nTower_
<< " towers";

// qie
Expand All @@ -63,7 +63,7 @@ HcalTestAnalysis::HcalTestAnalysis(const edm::ParameterSet &p):

HcalTestAnalysis::~HcalTestAnalysis() {
edm::LogInfo("HcalSim") << "HcalTestAnalysis: --------> Total number of "
<< "selected entries : " << count;
<< "selected entries : " << count_;
edm::LogInfo("HcalSim") << "HcalTestAnalysis: Pointers:: HistoClass "
<< tuples_ << ", Numbering Scheme " << org_;
}
Expand Down Expand Up @@ -231,9 +231,9 @@ void HcalTestAnalysis::update(const BeginOfEvent * evt) {
tuples_->setCounters();

int i = 0;
edepEB = edepEE = edepHB = edepHE = edepHO = 0.;
for (i = 0; i < 20; i++) edepl[i] = 0.;
for (i = 0; i < 20; i++) mudist[i] = -1.;
edepEB_ = edepEE_ = edepHB_ = edepHE_ = edepHO_ = 0.;
for (i = 0; i < 20; i++) edepl_[i] = 0.;
for (i = 0; i < 20; i++) mudist_[i] = -1.;

edm::LogVerbatim("HcalSim") <<"HcalTestAnalysis: Begin of event = "
<< (*evt)()->GetEventID();
Expand All @@ -249,13 +249,13 @@ void HcalTestAnalysis::update(const G4Step * aStep) {
double edeposit = aStep->GetTotalEnergyDeposit();
int layer=-1;
if (name == "EBR") {
edepEB += edeposit;
edepEB_ += edeposit;
} else if (name == "EFR") {
edepEE += edeposit;
edepEE_ += edeposit;
} else if (name == "HBS") {
layer = (curPV->GetCopyNo()/10)%100;
if (layer >= 0 && layer < 17) {
edepHB += edeposit;
edepHB_ += edeposit;
} else {
edm::LogWarning("HcalSim") << "HcalTestAnalysis::Error in HB "
<< curPV->GetName() << curPV->GetCopyNo();
Expand All @@ -264,7 +264,7 @@ void HcalTestAnalysis::update(const G4Step * aStep) {
} else if (name == "HES") {
layer = (curPV->GetCopyNo()/10)%100;
if (layer >= 0 && layer < 19) {
edepHE += edeposit;
edepHE_ += edeposit;
} else {
edm::LogWarning("HcalSim") << "HcalTestAnalysis::Error in HE "
<< curPV->GetName() << curPV->GetCopyNo();
Expand All @@ -273,19 +273,19 @@ void HcalTestAnalysis::update(const G4Step * aStep) {
} else if (name == "HTS") {
layer = (curPV->GetCopyNo()/10)%100;
if (layer >= 17 && layer < 20) {
edepHO += edeposit;
edepHO_ += edeposit;
} else {
edm::LogWarning("HcalSim") << "HcalTestAnalysis::Error in HO "
<< curPV->GetName() << curPV->GetCopyNo();
layer = -1;
}
}
if (layer >= 0 && layer < 20) {
edepl[layer] += edeposit;
edepl_[layer] += edeposit;

// Calculate the distance if it is a muon
G4String part = aStep->GetTrack()->GetDefinition()->GetParticleName();
if ((part == "mu-" || part == "mu+") && mudist[layer] < 0) {
if ((part == "mu-" || part == "mu+") && mudist_[layer] < 0) {
math::XYZPoint pos(aStep->GetPreStepPoint()->GetPosition().x(),
aStep->GetPreStepPoint()->GetPosition().y(),
aStep->GetPreStepPoint()->GetPosition().z());
Expand All @@ -294,7 +294,7 @@ void HcalTestAnalysis::update(const G4Step * aStep) {
double phi = pos.phi();
double dist = sqrt ((eta-eta0_)*(eta-eta0_) +
(phi-phi0_)*(phi-phi0_));
mudist[layer] = dist*std::sqrt(pos.perp2());
mudist_[layer] = dist*std::sqrt(pos.perp2());
}
}

Expand All @@ -312,7 +312,7 @@ void HcalTestAnalysis::update(const G4Step * aStep) {
//================================================================ End of EVENT
void HcalTestAnalysis::update(const EndOfEvent * evt) {

count++;
++count_;
// Fill event input
fill(evt);
edm::LogVerbatim("HcalSim") << "HcalTestAnalysis:: --- after Fill";
Expand Down Expand Up @@ -343,7 +343,7 @@ void HcalTestAnalysis::fill(const EndOfEvent * evt) {
G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();

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

// Hcal
int HCHCid = G4SDManager::GetSDMpointer()->GetCollectionID(names_[0]);
Expand All @@ -370,7 +370,7 @@ void HcalTestAnalysis::fill(const EndOfEvent * evt) {
double jitter = time-timeOfFlight(subdet,lay,eta);
if (jitter<0) jitter = 0;
CaloHit hit(subdet,lay,e,eta,phi,jitter,unitID);
caloHitCache.push_back(hit);
caloHitCache_.push_back(hit);
nhc++;

std::string det = "HB";
Expand Down Expand Up @@ -423,7 +423,7 @@ void HcalTestAnalysis::fill(const EndOfEvent * evt) {
layer = 0;
unitID = org_->packHcalIndex(subdet,zside,layer,ieta,iphi,lay);
CaloHit hit(subdet,lay,e,eta,phi,time,unitID);
caloHitCache.push_back(hit);
caloHitCache_.push_back(hit);
neb++;
edm::LogVerbatim("HcalSim") << "HcalTest: " << det << " layer "
<< std::setw(2) << layer << " time "
Expand Down Expand Up @@ -464,7 +464,7 @@ void HcalTestAnalysis::fill(const EndOfEvent * evt) {
layer = 0;
unitID = org_->packHcalIndex(subdet,zside,layer,ieta,iphi,lay);
CaloHit hit(subdet,lay,e,eta,phi,time,unitID);
caloHitCache.push_back(hit);
caloHitCache_.push_back(hit);
nef++;
edm::LogVerbatim("HcalSim") << "HcalTest: " << det << " layer "
<< std::setw(2) << layer << " time "
Expand All @@ -482,8 +482,8 @@ void HcalTestAnalysis::fill(const EndOfEvent * evt) {
void HcalTestAnalysis::qieAnalysis(CLHEP::HepRandomEngine* engine) {

//Fill tuple with hit information
int hittot = caloHitCache.size();
tuples_->fillHits(caloHitCache);
int hittot = caloHitCache_.size();
tuples_->fillHits(caloHitCache_);

//Get the index of the central tower
HcalNumberingFromDDD::HcalID id = numberingFromDDD_->unitID(eta0_,phi0_,1,1);
Expand All @@ -508,7 +508,7 @@ void HcalTestAnalysis::qieAnalysis(CLHEP::HepRandomEngine* engine) {
int etac = (centralTower_/100)%100;
int phic = (centralTower_%100);

for (int layr=0; layr<nGroup; layr++) {
for (int layr=0; layr<nGroup_; layr++) {
/*
int layx, layy=20;
for (int i=0; i<20; i++)
Expand All @@ -523,11 +523,11 @@ void HcalTestAnalysis::qieAnalysis(CLHEP::HepRandomEngine* engine) {
else layx = 1;
}
*/
for (int it=0; it<nTower; it++) {
for (int it=0; it<nTower_; it++) {
int nhit = 0;
double esim = 0;
for (int k1 = 0; k1 < hittot; k1++) {
CaloHit hit = caloHitCache[k1];
CaloHit hit = caloHitCache_[k1];
int subdetc = hit.det();
int layer = hit.layer();
int group = 0;
Expand Down Expand Up @@ -562,7 +562,7 @@ void HcalTestAnalysis::qieAnalysis(CLHEP::HepRandomEngine* engine) {
<< layr << " Sim " << esim << " After QIE "
<< eqie;
for (int i=0; i<4; i++) {
if (tower_[nTower+it] <= i) {
if (tower_[nTower_+it] <= i) {
esimtot[i] += esim;
eqietot[i] += eqie;
esimlay[20*i+layr] += esim;
Expand All @@ -586,16 +586,16 @@ void HcalTestAnalysis::qieAnalysis(CLHEP::HepRandomEngine* engine) {
std::vector<double> latfs(10,0.), latfq(10,0.), longs(20), longq(20);
if (esimtot[i]>0) scals = 1./esimtot[i];
if (eqietot[i]>0) scalq = 1./eqietot[i];
for (int it=0; it<nTower; it++) {
for (int it=0; it<nTower_; it++) {
int phib = it%nt;
latfs[phib] += scals*esimtow[50*i+it];
latfq[phib] += scalq*eqietow[50*i+it];
}
for (int layr=0; layr<=nGroup; layr++) {
for (int layr=0; layr<=nGroup_; layr++) {
longs[layr] = scals*esimlay[20*i+layr];
longq[layr] = scalq*eqielay[20*i+layr];
}
tuples_->fillQie(i,esimtot[i],eqietot[i],nGroup,longs,longq,
tuples_->fillQie(i,esimtot[i],eqietot[i],nGroup_,longs,longq,
nt,latphi,latfs,latfq);
}
}
Expand All @@ -606,18 +606,18 @@ void HcalTestAnalysis::layerAnalysis(){

int i = 0;
edm::LogVerbatim("HcalSim") << "\n ===>>> HcalTestAnalysis: Energy deposit "
<< "\n at EB : " << std::setw(6) << edepEB/MeV
<< "\n at EE : " << std::setw(6) << edepEE/MeV
<< "\n at HB : " << std::setw(6) << edepHB/MeV
<< "\n at HE : " << std::setw(6) << edepHE/MeV
<< "\n at HO : " << std::setw(6) << edepHO/MeV
<< "\n at EB : " << std::setw(6) << edepEB_/MeV
<< "\n at EE : " << std::setw(6) << edepEE_/MeV
<< "\n at HB : " << std::setw(6) << edepHB_/MeV
<< "\n at HE : " << std::setw(6) << edepHE_/MeV
<< "\n at HO : " << std::setw(6) << edepHO_/MeV
<< "\n ---- HcalTestAnalysis: Energy deposit "
<< "in Layers";
for (i = 0; i < 20; i++)
edm::LogVerbatim("HcalSim") << " Layer " << std::setw(2) << i << " E "
<< std::setw(8) << edepl[i]/MeV << " MeV";
<< std::setw(8) << edepl_[i]/MeV << " MeV";

tuples_->fillLayers(edepl, edepHO, edepHB+edepHE, mudist);
tuples_->fillLayers(edepl_, edepHO_, edepHB_+edepHE_, mudist_);
}


Expand Down

0 comments on commit e18171c

Please sign in to comment.