Skip to content

Commit 49e6c85

Browse files
author
Sunanda
committed
Code check
1 parent eb92ec5 commit 49e6c85

File tree

2 files changed

+75
-67
lines changed

2 files changed

+75
-67
lines changed

Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalMixRotatedFineCassette.cc

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,20 @@ struct HGCalMixRotatedFineCassette {
373373
edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R "
374374
<< cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]);
375375
#endif
376-
if (layerSense_[ly] < 0) {
377-
int absType = -layerSense_[ly];
378-
unsigned int num = (absType <= waferTypes_) ? passiveFull_.size() : passivePart_.size();
379-
#ifdef EDM_ML_DEBUG
380-
edm::LogVerbatim("HGCalGeom") << "Abstype " << absType << " num " << num;
381-
#endif
382-
if (num > 1)
383-
positionMix(ctxt, e, glog, name, copy, thick_[ii], matter, absType, fine);
384-
}
385-
} else {
386-
double rins = (sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
387-
double routs = (sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
376+
if (layerSense_[ly] < 0) {
377+
int absType = -layerSense_[ly];
378+
unsigned int num = (absType <= waferTypes_) ? passiveFull_.size() : passivePart_.size();
379+
#ifdef EDM_ML_DEBUG
380+
edm::LogVerbatim("HGCalGeom") << "Abstype " << absType << " num " << num;
381+
#endif
382+
if (num > 1)
383+
positionMix(ctxt, e, glog, name, copy, thick_[ii], matter, absType, fine);
384+
}
385+
} else {
386+
double rins =
387+
(sensitiveMode_ < 1) ? rinB : HGCalGeomTools::radius(zz + hthick, zFrontB_, rMinFront_, slopeB_);
388+
double routs =
389+
(sensitiveMode_ < 1) ? routF : HGCalGeomTools::radius(zz - hthick, zFrontT_, rMaxFront_, slopeT_);
388390
dd4hep::Solid solid = dd4hep::Tube(rins, routs, hthick, 0.0, 2._pi);
389391
ns.addSolidNS(ns.prepend(name), solid);
390392
glog = dd4hep::Volume(solid.name(), solid, matter);

Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconRotatedCassette.cc

Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ struct HGCalSiliconRotatedCassette {
231231
double zz = zi;
232232
double thickTot(0);
233233
#ifdef EDM_ML_DEBUG
234-
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: Section " << i << " Layers " << laymin << ":" << laymax << " zi " << cms::convert2mm(zi);
234+
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: Section " << i << " Layers " << laymin << ":"
235+
<< laymax << " zi " << cms::convert2mm(zi);
235236
#endif
236237
for (int ly = laymin; ly < laymax; ++ly) {
237238
int ii = layerType_[ly];
@@ -304,10 +305,10 @@ struct HGCalSiliconRotatedCassette {
304305
if (layerSense_[ly] > 0) {
305306
positionSensitive(ctxt, e, glog, (copy - firstLayer_));
306307
} else if (passiveMode_ > 0) {
307-
unsigned int num = (-layerSense_[ly] <= waferTypes_) ? passiveAbsorb_.size() : passiveCool_.size();
308-
if (num > 0)
309-
positionPassiveNew(ctxt, e, glog, i, -layerSense_[ly]);
310-
// positionPassiveNew(ctxt, e, glog, (copy - firstLayer_), -layerSense_[ly]);
308+
unsigned int num = (-layerSense_[ly] <= waferTypes_) ? passiveAbsorb_.size() : passiveCool_.size();
309+
if (num > 0)
310+
positionPassiveNew(ctxt, e, glog, i, -layerSense_[ly]);
311+
// positionPassiveNew(ctxt, e, glog, (copy - firstLayer_), -layerSense_[ly]);
311312
} else {
312313
positionPassive(ctxt, e, glog, (copy - firstLayer_), -layerSense_[ly]);
313314
}
@@ -578,27 +579,32 @@ struct HGCalSiliconRotatedCassette {
578579
#endif
579580
bool type = (absType <= waferTypes_);
580581
int num = type ? (passiveAbsorb_.size() / (cassettes_ * layers_.size()))
581-
: (passiveCool_.size() / (cassettes_ * layers_.size()));
582+
: (passiveCool_.size() / (cassettes_ * layers_.size()));
582583
#ifdef EDM_ML_DEBUG
583584
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette: Type " << type << " number per cassette " << num;
584585
#endif
585586
for (int k = 0; k < cassettes_; ++k) {
586587
double xpos(0), ypos(0);
587588
for (int n = 0; n < num; ++n) {
588-
int i1 = num * k + n;
589-
int i2 = num * layer * cassettes_ + i1;
589+
int i1 = num * k + n;
590+
int i2 = num * layer * cassettes_ + i1;
590591
#ifdef EDM_ML_DEBUG
591-
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette::Passive2: layer " << layer + 1 << " cassette " << " PassiveIndex " << i1 << ":" << i2 << ":" << passiveAbsorb_.size() << ":" << passiveCool_.size();
592+
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette::Passive2: layer " << layer + 1 << " cassette "
593+
<< " PassiveIndex " << i1 << ":" << i2 << ":" << passiveAbsorb_.size() << ":"
594+
<< passiveCool_.size();
592595
#endif
593-
std::string passive = (type) ? passiveAbsorb_[i2] : passiveCool_[i2];
596+
std::string passive = (type) ? passiveAbsorb_[i2] : passiveCool_[i2];
594597
#ifdef EDM_ML_DEBUG
595-
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette::Passive2 " << passive << " number " << i2 << " pos " << cms::convert2mm(xpos) << ":" << cms::convert2mm(ypos) << ":0";
596-
kount++;
598+
edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedCassette::Passive2 " << passive << " number " << i2
599+
<< " pos " << cms::convert2mm(xpos) << ":" << cms::convert2mm(ypos) << ":0";
600+
kount++;
597601
#endif
598-
dd4hep::Position tran(xpos, ypos, 0.0);
599-
glog.placeVolume(ns.volume(passive), i2, tran);
602+
dd4hep::Position tran(xpos, ypos, 0.0);
603+
glog.placeVolume(ns.volume(passive), i2, tran);
600604
#ifdef EDM_ML_DEBUG
601-
edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedCassette: " << passive << " number " << i2 << " positioned in " << glog.name() << " at (" << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with no rotation";
605+
edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconRotatedCassette: " << passive << " number " << i2
606+
<< " positioned in " << glog.name() << " at (" << cms::convert2mm(xpos) << ","
607+
<< cms::convert2mm(ypos) << ",0) with no rotation";
602608
#endif
603609
}
604610
}
@@ -612,46 +618,46 @@ struct HGCalSiliconRotatedCassette {
612618
HGCalGeomTools geomTools_;
613619
HGCalCassette cassette_;
614620

615-
int waferTypes_; // Number of wafer types
616-
int passiveTypes_; // Number of passive types
617-
int facingTypes_; // Types of facings of modules toward IP
618-
int orientationTypes_; // Number of wafer orienations
619-
int partialTypes_; // Number of partial types
620-
int placeOffset_; // Offset for placement
621-
int firstLayer_; // Copy # of the first sensitive layer
622-
int absorbMode_; // Absorber mode
623-
int sensitiveMode_; // Sensitive mode
624-
int passiveMode_; // Mode for passive volumes
625-
double zMinBlock_; // Starting z-value of the block
626-
double waferSize_; // Width of the wafer
627-
double waferSepar_; // Sensor separation
628-
int sectors_; // Sectors
629-
int cassettes_; // Cassettes
630-
std::string rotstr_; // Rotation matrix (if needed)
631-
std::vector<std::string> waferFull_; // Names of full wafer modules
632-
std::vector<std::string> waferPart_; // Names of partial wafer modules
633-
std::vector<std::string> passiveAbsorb_;// Names of full passive modules
634-
std::vector<std::string> passiveCool_; // Names of partial passive modules
635-
std::vector<std::string> materials_; // names of materials
636-
std::vector<std::string> names_; // Names of volumes
637-
std::vector<double> thick_; // Thickness of the material
638-
std::vector<int> copyNumber_; // Initial copy numbers
639-
std::vector<int> layers_; // Number of layers in a section
640-
std::vector<double> layerThick_; // Thickness of each section
641-
std::vector<int> layerType_; // Type of the layer
642-
std::vector<int> layerSense_; // Content of a layer (sensitive?)
643-
std::vector<double> slopeB_; // Slope at the lower R
644-
std::vector<double> zFrontB_; // Starting Z values for the slopes
645-
std::vector<double> rMinFront_; // Corresponding rMin's
646-
std::vector<double> slopeT_; // Slopes at the larger R
647-
std::vector<double> zFrontT_; // Starting Z values for the slopes
648-
std::vector<double> rMaxFront_; // Corresponding rMax's
649-
std::vector<int> layerOrient_; // Layer orientation (Centering, rotations..)
650-
std::vector<int> waferIndex_; // Wafer index for the types
651-
std::vector<int> waferProperty_; // Wafer property
652-
std::vector<int> waferLayerStart_; // Index of wafers in each layer
653-
std::vector<double> cassetteShift_; // Shifts of the cassetes
654-
std::unordered_set<int> copies_; // List of copy #'s
621+
int waferTypes_; // Number of wafer types
622+
int passiveTypes_; // Number of passive types
623+
int facingTypes_; // Types of facings of modules toward IP
624+
int orientationTypes_; // Number of wafer orienations
625+
int partialTypes_; // Number of partial types
626+
int placeOffset_; // Offset for placement
627+
int firstLayer_; // Copy # of the first sensitive layer
628+
int absorbMode_; // Absorber mode
629+
int sensitiveMode_; // Sensitive mode
630+
int passiveMode_; // Mode for passive volumes
631+
double zMinBlock_; // Starting z-value of the block
632+
double waferSize_; // Width of the wafer
633+
double waferSepar_; // Sensor separation
634+
int sectors_; // Sectors
635+
int cassettes_; // Cassettes
636+
std::string rotstr_; // Rotation matrix (if needed)
637+
std::vector<std::string> waferFull_; // Names of full wafer modules
638+
std::vector<std::string> waferPart_; // Names of partial wafer modules
639+
std::vector<std::string> passiveAbsorb_; // Names of full passive modules
640+
std::vector<std::string> passiveCool_; // Names of partial passive modules
641+
std::vector<std::string> materials_; // names of materials
642+
std::vector<std::string> names_; // Names of volumes
643+
std::vector<double> thick_; // Thickness of the material
644+
std::vector<int> copyNumber_; // Initial copy numbers
645+
std::vector<int> layers_; // Number of layers in a section
646+
std::vector<double> layerThick_; // Thickness of each section
647+
std::vector<int> layerType_; // Type of the layer
648+
std::vector<int> layerSense_; // Content of a layer (sensitive?)
649+
std::vector<double> slopeB_; // Slope at the lower R
650+
std::vector<double> zFrontB_; // Starting Z values for the slopes
651+
std::vector<double> rMinFront_; // Corresponding rMin's
652+
std::vector<double> slopeT_; // Slopes at the larger R
653+
std::vector<double> zFrontT_; // Starting Z values for the slopes
654+
std::vector<double> rMaxFront_; // Corresponding rMax's
655+
std::vector<int> layerOrient_; // Layer orientation (Centering, rotations..)
656+
std::vector<int> waferIndex_; // Wafer index for the types
657+
std::vector<int> waferProperty_; // Wafer property
658+
std::vector<int> waferLayerStart_; // Index of wafers in each layer
659+
std::vector<double> cassetteShift_; // Shifts of the cassetes
660+
std::unordered_set<int> copies_; // List of copy #'s
655661
double alpha_, cosAlpha_;
656662
};
657663

0 commit comments

Comments
 (0)