Skip to content

Commit 446c78a

Browse files
committed
code format
1 parent 9e629c2 commit 446c78a

File tree

2 files changed

+108
-112
lines changed

2 files changed

+108
-112
lines changed

Fireworks/Core/src/FW3DViewGeometry.cc

Lines changed: 76 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -146,91 +146,89 @@ void FW3DViewGeometry::showMuonEndcap(bool showMuonEndcap) {
146146

147147
for (Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap) // 1=forward (+Z), 2=backward(-Z)
148148
{
149-
TEveElementList* cEndcap = nullptr;
150-
if (iEndcap == 1)
151-
cEndcap = new TEveElementList("CSC Forward");
152-
else
153-
cEndcap = new TEveElementList("CSC Backward");
154-
m_muonEndcapElements->AddElement(cEndcap);
155-
// Actual CSC geometry:
156-
// Station 1 has 4 rings with 36 chambers in each
157-
// Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
158-
// Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
159-
// Station 4: ring 1 has 18 chambers
160-
Int_t maxChambers = 36;
161-
for (Int_t iStation = 1; iStation <= 4; ++iStation) {
149+
TEveElementList* cEndcap = nullptr;
150+
if (iEndcap == 1)
151+
cEndcap = new TEveElementList("CSC Forward");
152+
else
153+
cEndcap = new TEveElementList("CSC Backward");
154+
m_muonEndcapElements->AddElement(cEndcap);
155+
// Actual CSC geometry:
156+
// Station 1 has 4 rings with 36 chambers in each
157+
// Station 2: ring 1 has 18 chambers, ring 2 has 36 chambers
158+
// Station 3: ring 1 has 18 chambers, ring 2 has 36 chambers
159+
// Station 4: ring 1 has 18 chambers
160+
Int_t maxChambers = 36;
161+
for (Int_t iStation = 1; iStation <= 4; ++iStation) {
162+
std::ostringstream s;
163+
s << "Station" << iStation;
164+
TEveElementList* cStation = new TEveElementList(s.str().c_str());
165+
cEndcap->AddElement(cStation);
166+
for (Int_t iRing = 1; iRing <= 4; ++iRing) {
167+
if (iStation > 1 && iRing > 2)
168+
continue;
169+
// if( iStation > 3 && iRing > 1 ) continue;
162170
std::ostringstream s;
163-
s << "Station" << iStation;
164-
TEveElementList* cStation = new TEveElementList(s.str().c_str());
165-
cEndcap->AddElement(cStation);
166-
for (Int_t iRing = 1; iRing <= 4; ++iRing) {
167-
if (iStation > 1 && iRing > 2)
168-
continue;
169-
// if( iStation > 3 && iRing > 1 ) continue;
170-
std::ostringstream s;
171-
s << "Ring" << iRing;
172-
TEveElementList* cRing = new TEveElementList(s.str().c_str());
173-
cStation->AddElement(cRing);
174-
(iRing == 1 && iStation > 1) ? (maxChambers = 18) : (maxChambers = 36);
175-
for (Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber) {
176-
Int_t iLayer = 0; // chamber
177-
CSCDetId id(iEndcap, iStation, iRing, iChamber, iLayer);
178-
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
179-
shape->SetTitle(TString::Format(
180-
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u", cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
171+
s << "Ring" << iRing;
172+
TEveElementList* cRing = new TEveElementList(s.str().c_str());
173+
cStation->AddElement(cRing);
174+
(iRing == 1 && iStation > 1) ? (maxChambers = 18) : (maxChambers = 36);
175+
for (Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber) {
176+
Int_t iLayer = 0; // chamber
177+
CSCDetId id(iEndcap, iStation, iRing, iChamber, iLayer);
178+
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
179+
shape->SetTitle(TString::Format(
180+
"CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u", cEndcap->GetName(), iStation, iRing, iChamber, id.rawId()));
181181

182-
addToCompound(shape, kFWMuonEndcapLineColorIndex);
183-
cRing->AddElement(shape);
184-
}
182+
addToCompound(shape, kFWMuonEndcapLineColorIndex);
183+
cRing->AddElement(shape);
185184
}
186-
}
185+
}
186+
}
187187
}
188188

189189
// hardcoded gem and me0; need to find better way for different gem geometries
190-
for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion+=2) {
191-
TEveElementList* teEndcap = nullptr;
192-
teEndcap = new TEveElementList(Form("GEM Reg=%d", iRegion));
193-
m_muonEndcapElements->AddElement(teEndcap);
194-
int iStation = 1;
195-
{
196-
std::ostringstream s;
197-
s << "Station" << iStation;
198-
TEveElementList* cStation = new TEveElementList(s.str().c_str());
199-
teEndcap->AddElement(cStation);
200-
201-
202-
for (Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId; ++iLayer) {
203-
int maxChamber = GEMDetId::maxChamberId;
204-
std::ostringstream sl;
205-
sl << "Layer" << iLayer;
206-
TEveElementList* elayer = new TEveElementList(sl.str().c_str());
207-
cStation->AddElement(elayer);
208-
209-
for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) {
210-
std::ostringstream cl;
211-
cl << "Chamber" << iChamber;
212-
TEveElementList* cha = new TEveElementList(cl.str().c_str());
213-
elayer->AddElement(cha);
214-
215-
Int_t iRing = 1;
216-
Int_t iRoll = 0;
217-
try {
218-
GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
219-
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
220-
if (shape) {
221-
shape->SetTitle(TString::Format(
222-
"GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u", iRing, iStation, iChamber, iRoll, id.rawId()));
223-
224-
cha->AddElement(shape);
225-
addToCompound(shape, kFWMuonEndcapLineColorIndex);
226-
}
227-
}
228-
catch (cms::Exception& e){
229-
fwLog(fwlog::kError) << "FW3DViewGeomtery " << e << std::endl;
230-
}
231-
}
190+
for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion += 2) {
191+
TEveElementList* teEndcap = nullptr;
192+
teEndcap = new TEveElementList(Form("GEM Reg=%d", iRegion));
193+
m_muonEndcapElements->AddElement(teEndcap);
194+
int iStation = 1;
195+
{
196+
std::ostringstream s;
197+
s << "Station" << iStation;
198+
TEveElementList* cStation = new TEveElementList(s.str().c_str());
199+
teEndcap->AddElement(cStation);
200+
201+
for (Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId; ++iLayer) {
202+
int maxChamber = GEMDetId::maxChamberId;
203+
std::ostringstream sl;
204+
sl << "Layer" << iLayer;
205+
TEveElementList* elayer = new TEveElementList(sl.str().c_str());
206+
cStation->AddElement(elayer);
207+
208+
for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) {
209+
std::ostringstream cl;
210+
cl << "Chamber" << iChamber;
211+
TEveElementList* cha = new TEveElementList(cl.str().c_str());
212+
elayer->AddElement(cha);
213+
214+
Int_t iRing = 1;
215+
Int_t iRoll = 0;
216+
try {
217+
GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
218+
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
219+
if (shape) {
220+
shape->SetTitle(TString::Format(
221+
"GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u", iRing, iStation, iChamber, iRoll, id.rawId()));
222+
223+
cha->AddElement(shape);
224+
addToCompound(shape, kFWMuonEndcapLineColorIndex);
225+
}
226+
} catch (cms::Exception& e) {
227+
fwLog(fwlog::kError) << "FW3DViewGeomtery " << e << std::endl;
228+
}
232229
}
233-
}
230+
}
231+
}
234232
}
235233

236234
// adding me0

Fireworks/Core/src/FWRPZViewGeometry.cc

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -532,43 +532,41 @@ void FWRPZViewGeometry::showRpcEndcap(bool show) {
532532
//______________________________________________________________________________
533533

534534
void FWRPZViewGeometry::showGEM(bool show) {
535-
// hardcoded gem and me0; need to find better way for different gem geometries
536-
if (!m_GEMElements && show) {
537-
m_GEMElements = new TEveElementList("GEM");
538-
539-
for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion = iRegion + 2) {
540-
int iStation = 1;
541-
int iRing = 1;
542-
int iLayer = 1;
543-
544-
int carr[4] = {10, 11, 29, 30};
545-
for (int i = 0; i < 4; ++i)
546-
{
547-
int iChamber = carr[i];
548-
int iRoll = 0;
549-
try {
550-
GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
551-
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
552-
if (shape) {
553-
addToCompound(shape, kFWMuonEndcapLineColorIndex);
554-
m_GEMElements->AddElement(shape);
555-
gEve->AddToListTree(shape, true);
556-
}
557-
}
558-
catch (cms::Exception& e) {
559-
fwLog(fwlog::kError) << "FWRPZViewGeomtery " << e << std::endl;
560-
}
561-
}
535+
// hardcoded gem and me0; need to find better way for different gem geometries
536+
if (!m_GEMElements && show) {
537+
m_GEMElements = new TEveElementList("GEM");
538+
539+
for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion = iRegion + 2) {
540+
int iStation = 1;
541+
int iRing = 1;
542+
int iLayer = 1;
543+
544+
int carr[4] = {10, 11, 29, 30};
545+
for (int i = 0; i < 4; ++i) {
546+
int iChamber = carr[i];
547+
int iRoll = 0;
548+
try {
549+
GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
550+
TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
551+
if (shape) {
552+
addToCompound(shape, kFWMuonEndcapLineColorIndex);
553+
m_GEMElements->AddElement(shape);
554+
gEve->AddToListTree(shape, true);
555+
}
556+
} catch (cms::Exception& e) {
557+
fwLog(fwlog::kError) << "FWRPZViewGeomtery " << e << std::endl;
558+
}
562559
}
560+
}
563561

564-
AddElement(m_GEMElements);
565-
importNew(m_GEMElements);
566-
}
562+
AddElement(m_GEMElements);
563+
importNew(m_GEMElements);
564+
}
567565

568-
if (m_GEMElements) {
569-
m_GEMElements->SetRnrState(show);
570-
gEve->Redraw3D();
571-
}
566+
if (m_GEMElements) {
567+
m_GEMElements->SetRnrState(show);
568+
gEve->Redraw3D();
569+
}
572570
}
573571

574572
void FWRPZViewGeometry::showME0(bool show) {

0 commit comments

Comments
 (0)