Skip to content

Commit f43f688

Browse files
author
Sunanda
committed
Code check
1 parent d52c70f commit f43f688

File tree

3 files changed

+83
-72
lines changed

3 files changed

+83
-72
lines changed

Fireworks/Geometry/plugins/TGeoMgrFromDdd.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ TGeoMgrFromDdd::ReturnType TGeoMgrFromDdd::produce(const DisplayGeomRecord& iRec
174174
auto info = walker.current();
175175

176176
if (m_verbose) {
177-
edm::LogVerbatim("TGeoMgrFromDdd") << "parentStack of size " << parentStack.size() << " info " << &info << " first " << &(info.first) << " second " << info.second << " Name " << info.first.name();
177+
edm::LogVerbatim("TGeoMgrFromDdd") << "parentStack of size " << parentStack.size() << " info " << &info
178+
<< " first " << &(info.first) << " second " << info.second << " Name "
179+
<< info.first.name();
178180
auto num = (info.second != nullptr) ? info.second->copyno() : 0;
179181
edm::LogVerbatim("TGeoMgrFromDdd") << info.first.name() << " " << num << " "
180182
<< DDSolidShapesName::name(info.first.solid().shape());
@@ -240,7 +242,7 @@ TGeoMgrFromDdd::ReturnType TGeoMgrFromDdd::produce(const DisplayGeomRecord& iRec
240242
TGeoShape* TGeoMgrFromDdd::createShape(const std::string& iName, const DDSolid& iSolid) {
241243
if (m_verbose)
242244
edm::LogVerbatim("TGeoMgrFromDdd") << "createShape with name: " << iName
243-
<< " and solid: " << iSolid.name().fullname();
245+
<< " and solid: " << iSolid.name().fullname();
244246

245247
DDBase<DDName, DDI::Solid*>::def_type defined(iSolid.isDefined());
246248
if (!defined.first)
@@ -254,7 +256,7 @@ TGeoShape* TGeoMgrFromDdd::createShape(const std::string& iName, const DDSolid&
254256
if (m_verbose) {
255257
std::ostringstream st1;
256258
for (const double& par : params)
257-
st1 << " : " << par;
259+
st1 << " : " << par;
258260
edm::LogVerbatim("TGeoMgrFromDdd") << params.size() << " Parameters" << st1.str();
259261
}
260262
switch (iSolid.shape()) {
@@ -604,8 +606,8 @@ TGeoShape* TGeoMgrFromDdd::createShape(const std::string& iName, const DDSolid&
604606
TGeoVolume* TGeoMgrFromDdd::createVolume(const std::string& iName, const DDSolid& iSolid, const DDMaterial& iMaterial) {
605607
if (m_verbose)
606608
edm::LogVerbatim("TGeoMgrFromDdd") << "createVolume with name: " << iName
607-
<< " and solid: " << iSolid.name().fullname() << " and material "
608-
<< iMaterial.name().fullname();
609+
<< " and solid: " << iSolid.name().fullname() << " and material "
610+
<< iMaterial.name().fullname();
609611
TGeoVolume* v = nameToVolume_[iName];
610612
if (v == nullptr) {
611613
TGeoShape* solid =

Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedFineCassette.cc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -484,20 +484,21 @@ void DDHGCalMixRotatedFineCassette::constructLayers(const DDLogicalPart& module,
484484
<< convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections";
485485
for (unsigned int k = 0; k < pgonZ.size(); ++k)
486486
edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << pgonZ[k] << " R " << pgonRin[k] << ":" << pgonRout[k];
487-
edm::LogVerbatim("HGCalGeom") << "LayeerSense " << layerSense_[ly];
487+
edm::LogVerbatim("HGCalGeom") << "LayeerSense " << layerSense_[ly];
488488
#endif
489-
if (layerSense_[ly] < 0) {
490-
int absType = -layerSense_[ly];
491-
unsigned int num = (absType <= waferTypes_) ? passiveFull_.size() : passivePart_.size();
489+
if (layerSense_[ly] < 0) {
490+
int absType = -layerSense_[ly];
491+
unsigned int num = (absType <= waferTypes_) ? passiveFull_.size() : passivePart_.size();
492492
#ifdef EDM_ML_DEBUG
493-
edm::LogVerbatim("HGCalGeom") << "Abstype " << absType << " num " << num;
493+
edm::LogVerbatim("HGCalGeom") << "Abstype " << absType << " num " << num;
494494
#endif
495-
if (num > 1)
496-
positionMix(glog, name, copy, thick_[ii], matter, absType, fine, cpv);
497-
}
495+
if (num > 1)
496+
positionMix(glog, name, copy, thick_[ii], matter, absType, fine, cpv);
497+
}
498498
} else {
499499
double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
500-
double routs = (sensitiveMode_< 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
500+
double routs =
501+
(sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
501502
DDSolid solid = DDSolidFactory::tubs(DDName(name, nameSpace_), hthick, rins, routs, 0.0, 2._pi);
502503
glog = DDLogicalPart(solid.ddname(), matter, solid);
503504
#ifdef EDM_ML_DEBUG

Geometry/HGCalCommonData/plugins/DDHGCalSiliconRotatedCassette.cc

Lines changed: 66 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -59,47 +59,47 @@ class DDHGCalSiliconRotatedCassette : public DDAlgorithm {
5959
static constexpr double tol1_ = 0.01;
6060
static constexpr double tol2_ = 0.00001;
6161

62-
int waferTypes_; // Number of wafer types
63-
int passiveTypes_; // Number of passive types
64-
int facingTypes_; // Types of facings of modules toward IP
65-
int orientationTypes_; // Number of wafer orienations
66-
int partialTypes_; // Number of partial types
67-
int placeOffset_; // Offset for placement
68-
int firstLayer_; // Copy # of the first sensitive layer
69-
int absorbMode_; // Absorber mode
70-
int sensitiveMode_; // Sensitive mode
71-
int passiveMode_; // Mode for passive volumes
72-
double zMinBlock_; // Starting z-value of the block
73-
double waferSize_; // Width of the wafer
74-
double waferSepar_; // Sensor separation
75-
int sectors_; // Sectors
76-
int cassettes_; // Cassettes
77-
std::string rotstr_; // Rotation matrix (if needed)
78-
std::vector<std::string> waferFull_; // Names of full wafer modules
79-
std::vector<std::string> waferPart_; // Names of partial wafer modules
80-
std::vector<std::string> passiveAbsorb_;// Names of passive absorber modules
81-
std::vector<std::string> passiveCool_; // Names of passive cooling modules
82-
std::vector<std::string> materials_; // names of materials
83-
std::vector<std::string> names_; // Names of volumes
84-
std::vector<double> thick_; // Thickness of the material
85-
std::vector<int> copyNumber_; // Initial copy numbers
86-
std::vector<int> layers_; // Number of layers in a section
87-
std::vector<double> layerThick_; // Thickness of each section
88-
std::vector<int> layerType_; // Type of the layer
89-
std::vector<int> layerSense_; // Content of a layer (sensitive?)
90-
std::vector<double> slopeB_; // Slope at the lower R
91-
std::vector<double> zFrontB_; // Starting Z values for the slopes
92-
std::vector<double> rMinFront_; // Corresponding rMin's
93-
std::vector<double> slopeT_; // Slopes at the larger R
94-
std::vector<double> zFrontT_; // Starting Z values for the slopes
95-
std::vector<double> rMaxFront_; // Corresponding rMax's
96-
std::vector<int> layerOrient_; // Layer orientation (Centering, rotations..)
97-
std::vector<int> waferIndex_; // Wafer index for the types
98-
std::vector<int> waferProperty_; // Wafer property
99-
std::vector<int> waferLayerStart_; // Index of wafers in each layer
100-
std::vector<double> cassetteShift_; // Shifts of the cassetes
101-
std::string nameSpace_; // Namespace of this and ALL sub-parts
102-
std::unordered_set<int> copies_; // List of copy #'s
62+
int waferTypes_; // Number of wafer types
63+
int passiveTypes_; // Number of passive types
64+
int facingTypes_; // Types of facings of modules toward IP
65+
int orientationTypes_; // Number of wafer orienations
66+
int partialTypes_; // Number of partial types
67+
int placeOffset_; // Offset for placement
68+
int firstLayer_; // Copy # of the first sensitive layer
69+
int absorbMode_; // Absorber mode
70+
int sensitiveMode_; // Sensitive mode
71+
int passiveMode_; // Mode for passive volumes
72+
double zMinBlock_; // Starting z-value of the block
73+
double waferSize_; // Width of the wafer
74+
double waferSepar_; // Sensor separation
75+
int sectors_; // Sectors
76+
int cassettes_; // Cassettes
77+
std::string rotstr_; // Rotation matrix (if needed)
78+
std::vector<std::string> waferFull_; // Names of full wafer modules
79+
std::vector<std::string> waferPart_; // Names of partial wafer modules
80+
std::vector<std::string> passiveAbsorb_; // Names of passive absorber modules
81+
std::vector<std::string> passiveCool_; // Names of passive cooling modules
82+
std::vector<std::string> materials_; // names of materials
83+
std::vector<std::string> names_; // Names of volumes
84+
std::vector<double> thick_; // Thickness of the material
85+
std::vector<int> copyNumber_; // Initial copy numbers
86+
std::vector<int> layers_; // Number of layers in a section
87+
std::vector<double> layerThick_; // Thickness of each section
88+
std::vector<int> layerType_; // Type of the layer
89+
std::vector<int> layerSense_; // Content of a layer (sensitive?)
90+
std::vector<double> slopeB_; // Slope at the lower R
91+
std::vector<double> zFrontB_; // Starting Z values for the slopes
92+
std::vector<double> rMinFront_; // Corresponding rMin's
93+
std::vector<double> slopeT_; // Slopes at the larger R
94+
std::vector<double> zFrontT_; // Starting Z values for the slopes
95+
std::vector<double> rMaxFront_; // Corresponding rMax's
96+
std::vector<int> layerOrient_; // Layer orientation (Centering, rotations..)
97+
std::vector<int> waferIndex_; // Wafer index for the types
98+
std::vector<int> waferProperty_; // Wafer property
99+
std::vector<int> waferLayerStart_; // Index of wafers in each layer
100+
std::vector<double> cassetteShift_; // Shifts of the cassetes
101+
std::string nameSpace_; // Namespace of this and ALL sub-parts
102+
std::unordered_set<int> copies_; // List of copy #'s
103103
double alpha_, cosAlpha_;
104104
};
105105

@@ -390,12 +390,12 @@ void DDHGCalSiliconRotatedCassette::constructLayers(const DDLogicalPart& module,
390390
if (layerSense_[ly] > 0) {
391391
positionSensitive(glog, (copy - firstLayer_), cpv);
392392
} else if (passiveMode_ > 0) {
393-
unsigned int num = (-layerSense_[ly] <= waferTypes_) ? passiveAbsorb_.size() : passiveCool_.size();
394-
if (num > 0)
395-
positionPassiveNew(glog, (copy - firstLayer_), -layerSense_[ly], cpv);
396-
} else {
397-
positionPassive(glog, (copy - firstLayer_), -layerSense_[ly], cpv);
398-
}
393+
unsigned int num = (-layerSense_[ly] <= waferTypes_) ? passiveAbsorb_.size() : passiveCool_.size();
394+
if (num > 0)
395+
positionPassiveNew(glog, (copy - firstLayer_), -layerSense_[ly], cpv);
396+
} else {
397+
positionPassive(glog, (copy - firstLayer_), -layerSense_[ly], cpv);
398+
}
399399
}
400400
DDTranslation r1(0, 0, zz);
401401
DDRotation rot;
@@ -544,9 +544,9 @@ void DDHGCalSiliconRotatedCassette::positionSensitive(const DDLogicalPart& glog,
544544

545545
// Position the passive modules (mode == 0)
546546
void DDHGCalSiliconRotatedCassette::positionPassive(const DDLogicalPart& glog,
547-
int layer,
548-
int absType,
549-
DDCompactView& cpv) {
547+
int layer,
548+
int absType,
549+
DDCompactView& cpv) {
550550
#ifdef EDM_ML_DEBUG
551551
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: positionPassiveAbsorber is called";
552552
#endif
@@ -561,7 +561,10 @@ void DDHGCalSiliconRotatedCassette::positionPassive(const DDLogicalPart& glog,
561561
double dy = 0.75 * dely;
562562
const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_));
563563
#ifdef EDM_ML_DEBUG
564-
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: PositionPassive Layer " << layer << " LayerCenter " << layercenter << ":" << layertype << " r " << delx << " R " << dely << " dy " << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize " << (waferSize_ + waferSepar_) << " index " << firstWafer << ":" << (lastWafer - 1);
564+
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: PositionPassive Layer " << layer << " LayerCenter "
565+
<< layercenter << ":" << layertype << " r " << delx << " R " << dely << " dy " << dy
566+
<< " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize "
567+
<< (waferSize_ + waferSepar_) << " index " << firstWafer << ":" << (lastWafer - 1);
565568
int ium(0), ivm(0), kount(0);
566569
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: " << glog.ddname() << " r " << delx << " R " << dely
567570
<< " dy " << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize "
@@ -651,15 +654,16 @@ void DDHGCalSiliconRotatedCassette::positionPassive(const DDLogicalPart& glog,
651654

652655
// Position the passive modules (mode > 0)
653656
void DDHGCalSiliconRotatedCassette::positionPassiveNew(const DDLogicalPart& glog,
654-
int layer,
655-
int absType,
656-
DDCompactView& cpv) {
657+
int layer,
658+
int absType,
659+
DDCompactView& cpv) {
657660
#ifdef EDM_ML_DEBUG
658661
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: positionPassiveNew is called";
659662
int kount(0);
660663
#endif
661664
bool type = (absType <= waferTypes_);
662-
int num = type ? (passiveAbsorb_.size() / (cassettes_ * layers_.size())) : (passiveCool_.size() / (cassettes_ * layers_.size()));
665+
int num = type ? (passiveAbsorb_.size() / (cassettes_ * layers_.size()))
666+
: (passiveCool_.size() / (cassettes_ * layers_.size()));
663667
#ifdef EDM_ML_DEBUG
664668
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: Type " << type << " number per cassette " << num;
665669
#endif
@@ -669,19 +673,23 @@ void DDHGCalSiliconRotatedCassette::positionPassiveNew(const DDLogicalPart& glog
669673
int i1 = num * k + n;
670674
int i2 = num * layer * cassettes_ + i1;
671675
#ifdef EDM_ML_DEBUG
672-
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette::Passive2: layer " << layer + 1 << " cassette " << " PassiveIndex " << i1 << ":" << i2 << ":" << passiveAbsorb_.size() << ":" << passiveCool_.size();
676+
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette::Passive2: layer " << layer + 1 << " cassette "
677+
<< " PassiveIndex " << i1 << ":" << i2 << ":" << passiveAbsorb_.size() << ":"
678+
<< passiveCool_.size();
673679
#endif
674680
std::string passive = (type) ? passiveAbsorb_[i2] : passiveCool_[i2];
675681
#ifdef EDM_ML_DEBUG
676-
edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedCassette: Passive2 " << passive << " number " << i2 << " pos " << xpos << ":" << ypos << ":" << zpos;
682+
edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedCassette: Passive2 " << passive << " number " << i2
683+
<< " pos " << xpos << ":" << ypos << ":" << zpos;
677684
kount++;
678685
#endif
679686
DDTranslation tran(xpos, ypos, zpos);
680687
DDRotation rotation;
681688
DDName name = DDName(DDSplit(passive).first, DDSplit(passive).second);
682689
cpv.position(name, glog.ddname(), i2, tran, rotation);
683690
#ifdef EDM_ML_DEBUG
684-
edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedCassette: " << name << " number " << i2 << " positioned in " << glog.ddname() << " at " << tran << " with no rotation";
691+
edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedCassette: " << name << " number " << i2
692+
<< " positioned in " << glog.ddname() << " at " << tran << " with no rotation";
685693
#endif
686694
}
687695
}

0 commit comments

Comments
 (0)