Skip to content

Commit cad01e6

Browse files
author
Sunanda
committed
Make some correction to remove certain bugfor description of scintilator tiles in HGCal V19
1 parent 6ffd83e commit cad01e6

File tree

10 files changed

+373
-257
lines changed

10 files changed

+373
-257
lines changed

Geometry/HGCalCommonData/data/hgcalHEmix/v19/hgcalHEmix.xml

Lines changed: 233 additions & 233 deletions
Large diffs are not rendered by default.

Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedFineCassette.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class DDHGCalMixRotatedFineCassette : public DDAlgorithm {
6060
HGCalGeomTools geomTools_;
6161
HGCalCassette cassette_;
6262

63+
static constexpr double tol0_ = 0.0001;
6364
static constexpr double tol1_ = 0.01;
6465
static constexpr double tol2_ = 0.00001;
6566

@@ -391,7 +392,7 @@ void DDHGCalMixRotatedFineCassette::initialize(const DDNumericArguments& nArgs,
391392
unsigned int j2 = std::min((j1 + 6), j2max);
392393
for (unsigned int j = j1; j < j2; ++j)
393394
st1 << " [" << j << "] " << std::setw(9) << cassetteShiftScnt_[j];
394-
edm::LogVerbatim("HGCalGeom") << st1.str();
395+
edm::LogVerbatim("HGCalGeom") << "Scintillator Cassette shiftt " << convertRadToDeg(dphi) << " " << st1.str();
395396
}
396397
#endif
397398
nameSpace_ = DDCurrentNamespace::ns();
@@ -607,7 +608,7 @@ void DDHGCalMixRotatedFineCassette::positionMix(const DDLogicalPart& glog,
607608
<< fimin << ":" << fimax;
608609
#endif
609610
double phi1 = dphi * (fimin - 1);
610-
double phi2 = dphi * (fimax - fimin + 1);
611+
double phi2 = dphi * (fimax - fimin + 1) - tol0_;
611612
auto cshift = cassette_.getShift(layer + 1, 1, cassette, true);
612613
#ifdef EDM_ML_DEBUG
613614
int cassette0 = HGCalCassette::cassetteType(2, 1, cassette); //
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import FWCore.ParameterSet.Config as cms
2+
3+
# This config came from a copy of 2 files from Configuration/Geometry/python
4+
5+
from Geometry.HGCalCommonData.testHGCalV19XML_cfi import *
6+
from Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff import *
7+
from SLHCUpgradeSimulations.Geometry.fakePhase2OuterTrackerConditions_cff import *
8+
from Geometry.EcalCommonData.ecalSimulationParameters_cff import *
9+
from Geometry.HcalCommonData.hcalDDDSimConstants_cff import *
10+
from Geometry.HGCalCommonData.hgcalParametersInitialization_cfi import *
11+
from Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi import *
12+
from Geometry.MuonNumbering.muonGeometryConstants_cff import *
13+
from Geometry.MuonNumbering.muonOffsetESProducer_cff import *
14+
from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import *
15+
16+
# tracker
17+
from Geometry.CommonTopologies.globalTrackingGeometry_cfi import *
18+
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
19+
from Geometry.TrackerGeometryBuilder.trackerParameters_cff import *
20+
from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *
21+
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff import *
22+
trackerGeometry.applyAlignment = False
23+
24+
# calo
25+
from Geometry.CaloEventSetup.HGCalTopology_cfi import *
26+
from Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi import *
27+
from Geometry.CaloEventSetup.CaloTopology_cfi import *
28+
from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import *
29+
CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
30+
SelectedCalos = cms.vstring("HCAL",
31+
"ZDC",
32+
"EcalBarrel",
33+
"TOWER",
34+
"HGCalEESensitive",
35+
"HGCalHESiliconSensitive",
36+
"HGCalHEScintillatorSensitive"
37+
)
38+
)
39+
from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import *
40+
from Geometry.HcalEventSetup.HcalGeometry_cfi import *
41+
from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import *
42+
from Geometry.HcalEventSetup.CaloTowerTopology_cfi import *
43+
from Geometry.HcalCommonData.hcalDDDRecConstants_cfi import *
44+
from Geometry.HcalEventSetup.hcalTopologyIdeal_cfi import *
45+
from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
46+
from Geometry.EcalMapping.EcalMapping_cfi import *
47+
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
48+
49+
# muon
50+
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
51+
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *
52+
from Geometry.GEMGeometryBuilder.gemGeometry_cff import *
53+
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
54+
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *
55+
56+
# forward
57+
from Geometry.ForwardGeometry.ForwardGeometry_cfi import *
58+
59+
# timing
60+
from RecoMTD.DetLayers.mtdDetLayerGeometry_cfi import *
61+
from Geometry.MTDGeometryBuilder.mtdParameters_cff import *
62+
from Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff import *
63+
from Geometry.MTDNumberingBuilder.mtdTopology_cfi import *
64+
from Geometry.MTDGeometryBuilder.mtdGeometry_cfi import *
65+
from Geometry.MTDGeometryBuilder.idealForDigiMTDGeometry_cff import *
66+
mtdGeometry.applyAlignment = False

Geometry/HGCalCommonData/src/HGCalCassette.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#include "FWCore/MessageLogger/interface/MessageLogger.h"
32
#include "Geometry/HGCalCommonData/interface/HGCalCassette.h"
43
#include <algorithm>
@@ -40,7 +39,7 @@ void HGCalCassette::setParameter(int cassette, const std::vector<double>& shifts
4039
}
4140

4241
void HGCalCassette::setParameterScint(const std::vector<double>& shifts) {
43-
shifts_.insert(shifts_.end(), shifts.begin(), shifts.end());
42+
// shifts_.insert(shifts_.end(), shifts.begin(), shifts.end());
4443
shiftsScnt_.insert(shiftsScnt_.end(), shifts.begin(), shifts.end());
4544
#ifdef EDM_ML_DEBUG
4645
for (uint32_t j1 = 0; j1 < shifts.size(); j1 += 12) {
@@ -66,8 +65,8 @@ std::pair<double, double> HGCalCassette::getShift(int layer, int zside, int cass
6665
<< cassette << ":" << scnt << " loc " << locc << ":" << loc << " size "
6766
<< shiftsScnt_.size() << ":" << shifts_.size();
6867
#endif
69-
std::pair<double, double> xy = (typeHE_ && scnt) ? (std::make_pair(-zside * shiftsScnt_[loc], shiftsScnt_[loc + 1]))
70-
: (std::make_pair(-zside * shifts_[loc], shifts_[loc + 1]));
68+
std::pair<double, double> xy = (typeHE_ && scnt) ? (std::make_pair(shiftsScnt_[loc], shiftsScnt_[loc + 1]))
69+
: (std::make_pair(shifts_[loc], shifts_[loc + 1]));
7170
#ifdef EDM_ML_DEBUG
7271
edm::LogVerbatim("HGCalGeom") << "HGCalCassette::getShift: Layer " << layer << " zside " << zside << " type "
7372
<< typeHE_ << " cassette " << cassette << " Loc " << locc << ":" << loc << " shift "

Geometry/HGCalCommonData/src/HGCalDDDConstants.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ std::array<int, 5> HGCalDDDConstants::assignCellHex(
199199
std::array<int, 3> HGCalDDDConstants::assignCellTrap(float x, float y, float z, int layer, bool reco) const {
200200
int irad(-1), iphi(-1), type(-1);
201201
const auto& indx = getIndex(layer, reco);
202+
#ifdef EDM_ML_DEBUG
203+
edm::LogVerbatim("HGCalGeom") << "assignCellTrap: Layer " << layer << ":" << reco << " indx " << indx.first << ":" << indx.second;
204+
#endif
202205
if (indx.first < 0)
203206
return std::array<int, 3>{{irad, iphi, type}};
204207
int zside = (z > 0) ? 1 : -1;
@@ -1008,8 +1011,10 @@ std::pair<float, float> HGCalDDDConstants::locateCellTrap(
10081011
int zside, int lay, int irad, int iphi, bool reco, bool debug) const {
10091012
float x(0), y(0);
10101013
const auto& indx = getIndex(lay, reco);
1014+
#ifdef EDM_ML_DEBUG
10111015
edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << zside << ":"
10121016
<< reco << ":" << indx.first;
1017+
#endif
10131018
debug = true;
10141019
if (indx.first >= 0) {
10151020
int ir = std::abs(irad);
@@ -1499,6 +1504,9 @@ std::pair<int, int> HGCalDDDConstants::tileType(int layer, int ring, int phi) co
14991504
type = 1 + (itr->second).type;
15001505
sipm = ((itr->second).sipm == HGCalTypes::SiPMLarge) ? 0 : 1;
15011506
}
1507+
#ifdef EDM_ML_DEBUG
1508+
edm::LogVerbatim("HGCalGeom") << "tileType::Input layet:ring:phi " << layer << ":" << ring << ":" << phi << " Output Type:SiPM " << type << ":" << sipm;
1509+
#endif
15021510
return std::make_pair(type, sipm);
15031511
}
15041512

Geometry/HGCalCommonData/test/HGCalConvert.cpp

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
17741774
}
17751775
}
17761776
if (((debug / 100) % 10) > 0)
1777-
std::cout << "Layer|Phi|Ring " << layer << ":" << phi << ":" << irmin << ":" << irmax << std::endl;
1777+
std::cout << "Layer Phi Ring " << layer << ":" << phi << ":" << irmin << ":" << irmax << " nphi " << nphis << std::endl;
17781778
if (phi == 1) {
17791779
tile0.layer = layer;
17801780
tile0.rmin = irmin;
@@ -1788,13 +1788,17 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
17881788
do {
17891789
int phimax = tile0.phimax;
17901790
tile0.phimax = tile0.cassette * tilePhisWord;
1791+
if (((debug / 1000) % 10) > 0)
1792+
std::cout << "1Layer " << tile0.layer << " R " << tile0.rmin << ":" << tile0.rmax << " Cassett " << tile0.cassette << " Phi " << tile0.phimin << ":" << tile0.phimax << " Word " << tilePhisWord << ":" << tile0.phimax << std::endl;
17911793
zones.push_back(tile0);
17921794
tile0.phimin = tile0.phimax + 1;
17931795
tile0.phimax = phimax;
17941796
++tile0.cassette;
1795-
} while (tile0.cassette * tilePhisWord < tile0.phimax);
1797+
} while (tile0.cassette * tilePhisWord <= tile0.phimax);
17961798
}
17971799
}
1800+
if (((debug / 1000) % 10) > 0)
1801+
std::cout << "2Layer " << tile0.layer << " R " << tile0.rmin << ":" << tile0.rmax << " Cassett " << tile0.cassette << " Phi " << tile0.phimin << ":" << tile0.phimax << " Word " << tilePhisWord << ":" << tile0.phimax << std::endl;
17981802
zones.push_back(tile0);
17991803
int cassette = (cassette_ == 0) ? 0 : (1 + ((phi - 1) / tilePhisWord));
18001804
tile0.layer = layer;
@@ -1803,12 +1807,18 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
18031807
tile0.phimin = phi;
18041808
tile0.phimax = phi;
18051809
tile0.cassette = cassette;
1806-
if (phi == HGCalProperty::kHGCalTilePhis)
1810+
if (phi == nphis) {
1811+
if (((debug / 1000) % 10) > 0)
1812+
std::cout << "3Layer " << tile0.layer << " R " << tile0.rmin << ":" << tile0.rmax << " Cassett " << tile0.cassette << " Phi " << tile0.phimin << ":" << tile0.phimax << " Word " << tilePhisWord << ":" << tile0.phimax << std::endl;
18071813
zones.push_back(tile0);
1814+
}
18081815
} else {
18091816
tile0.phimax = phi;
1810-
if (phi == HGCalProperty::kHGCalTilePhis)
1817+
if (phi == nphis) {
1818+
if (((debug / 1000) % 10) > 0)
1819+
std::cout << "4Layer " << tile0.layer << " R " << tile0.rmin << ":" << tile0.rmax << " Cassett " << tile0.cassette << " Phi " << tile0.phimin << ":" << tile0.phimax << " Word " << tilePhisWord << ":" << tile0.phimax << std::endl;
18111820
zones.push_back(tile0);
1821+
}
18121822
}
18131823
}
18141824
}
@@ -1827,31 +1837,51 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
18271837
std::map<int, std::pair<double, double> >::const_iterator it1;
18281838
fout << " <Vector name=" << apost << head << "RMin" << apost << " type=" << apost << "numeric" << apost
18291839
<< " nEntries=" << apost << ringR.size() << apost << ">";
1840+
if ((debug % 10) > 0)
1841+
std::cout << " <Vector name=" << apost << head << "RMin" << apost << " type=" << apost << "numeric" << apost
1842+
<< " nEntries=" << apost << ringR.size() << apost << ">";
18301843
for (it1 = ringR.begin(); it1 != ringR.end(); ++it1) {
18311844
std::string last = ((l1 + 1) == ringR.size()) ? " " : ",";
1832-
if (l1 % 6 == 0)
1845+
if (l1 % 6 == 0) {
18331846
fout << "\n " << std::setw(8) << std::setprecision(6) << (it1->second).first << "*mm" << last;
1834-
else
1847+
if ((debug % 10) > 0)
1848+
std::cout << "\n " << std::setw(8) << std::setprecision(6) << (it1->second).first << "*mm" << last;
1849+
} else {
18351850
fout << std::setw(8) << std::setprecision(6) << (it1->second).first << "*mm" << last;
1851+
if ((debug % 10) > 0)
1852+
std::cout << std::setw(8) << std::setprecision(6) << (it1->second).first << "*mm" << last;
1853+
}
18361854
++l1;
18371855
}
18381856
fout << "\n </Vector>\n";
18391857
fout << " <Vector name=" << apost << head << "RMax" << apost << " type=" << apost << "numeric" << apost
18401858
<< " nEntries=" << apost << ringR.size() << apost << ">";
1859+
if ((debug % 10) > 0) {
1860+
std::cout << "\n </Vector>\n";
1861+
std::cout << " <Vector name=" << apost << head << "RMax" << apost << " type=" << apost << "numeric" << apost
1862+
<< " nEntries=" << apost << ringR.size() << apost << ">";
1863+
}
18411864
for (it1 = ringR.begin(); it1 != ringR.end(); ++it1) {
18421865
std::string last = ((l2 + 1) == ringR.size()) ? " " : ",";
1843-
if (l2 % 6 == 0)
1866+
if (l2 % 6 == 0) {
18441867
fout << "\n " << std::setw(8) << std::setprecision(6) << (it1->second).second << "*mm" << last;
1845-
else
1868+
if ((debug % 10) > 0)
1869+
std::cout << "\n " << std::setw(8) << std::setprecision(6) << (it1->second).second << "*mm" << last;
1870+
} else {
18461871
fout << std::setw(8) << std::setprecision(6) << (it1->second).second << "*mm" << last;
1872+
if ((debug % 10) > 0)
1873+
std::cout << std::setw(8) << std::setprecision(6) << (it1->second).second << "*mm" << last;
1874+
}
18471875
++l2;
18481876
}
18491877
fout << "\n </Vector>\n";
18501878
fout << " <Vector name=" << apost << head << "LayerRings" << apost << " type=" << apost << "numeric" << apost
18511879
<< " nEntries=" << apost << nmax << apost << ">";
1852-
if ((debug % 10) > 0)
1880+
if ((debug % 10) > 0) {
1881+
std::cout << "\n </Vector>\n";
18531882
std::cout << " <Vector name=" << apost << head << "LayerRings" << apost << " type=" << apost << "numeric"
18541883
<< apost << " nEntries=" << apost << nmax << apost << ">";
1884+
}
18551885
for (int k = 0; k < nmax; ++k) {
18561886
std::string last = ((k + 1) == nmax) ? " " : ",";
18571887
int lyr1r2 = HGCalTileIndex::tilePack(zones[k].layer, zones[k].rmin, zones[k].rmax);
@@ -1916,6 +1946,9 @@ void ConvertScintillatorV1::makeTitle(std::ofstream& fout,
19161946
if ((debug & 10) > 0)
19171947
std::cout << "\n </Vector>\n";
19181948
}
1949+
if ((debug & 10) > 0)
1950+
std::cout << "\n\n";
1951+
19191952
}
19201953

19211954
ConvertNoseV0::ConvertNoseV0(unsigned int layMax1, unsigned int layMax2) : layMax1_(layMax1), layMax2_(layMax2) {

SimCalorimetry/HGCalSimProducers/src/HGCFEElectronics.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "vdt/vdtMath.h"
77

88
using namespace hgc_digi;
9+
#define EDM_ML_DEBUG
910

1011
//
1112
template <class DFr>

SimG4CMS/Calo/src/CaloSD.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,5 +1181,5 @@ void CaloSD::printDetectorLevels(const G4VTouchable* touch) const {
11811181
st1 << " " << name << ":" << touch->GetReplicaNumber(i);
11821182
}
11831183
}
1184-
edm::LogVerbatim("CaloSim") << st1.str();
1184+
edm::LogVerbatim("CaloSim") << "DetectorLeves: " << st1.str();
11851185
}

SimG4CMS/Calo/src/HGCalNumberingScheme.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ uint32_t HGCalNumberingScheme::getUnitID(int layer, int module, int cell, int iz
157157
}
158158
} else if (hgcons_.tileTrapezoid()) {
159159
std::array<int, 3> id = hgcons_.assignCellTrap(pos.x(), pos.y(), pos.z(), layer, false);
160+
#ifdef EDM_ML_DEBUG
161+
edm::LogVerbatim("HGCSim") << "Trapezoid Position Layer " << layer << " Position " << pos.x() << ":" << pos.y() << ":" << pos.z() << " ID " << id[0] << ":" << id[1] << ":" << id[2];
162+
#endif
160163
if (id[2] >= 0) {
161164
std::pair<int, int> typm = hgcons_.tileType(layer, id[0], 0);
162165
HGCScintillatorDetId detId(id[2], layer, iz * id[0], id[1], false, 0);
@@ -165,7 +168,11 @@ uint32_t HGCalNumberingScheme::getUnitID(int layer, int module, int cell, int iz
165168
detId.setSiPM(typm.second);
166169
}
167170
index = detId.rawId();
168-
bool debug(false);
171+
#ifdef EDM_ML_DEBUG
172+
bool debug(true);
173+
#else
174+
bool debug(fallse);
175+
#endif
169176
if (!indices_.empty()) {
170177
int indx = HGCalTileIndex::tileIndex(layer, id[0], id[1]);
171178
if (std::find(indices_.begin(), indices_.end(), indx) != indices_.end())
@@ -174,7 +181,7 @@ uint32_t HGCalNumberingScheme::getUnitID(int layer, int module, int cell, int iz
174181
if (debug)
175182
edm::LogVerbatim("HGCSim") << "Radius/Phi " << id[0] << ":" << id[1] << " Type " << id[2] << ":" << typm.first
176183
<< " SiPM " << typm.second << ":" << hgcons_.tileSiPM(typm.second) << " Layer "
177-
<< layer << " z " << iz << " " << detId << " wt " << wt << " position " << pos
184+
<< layer << " z " << iz << " ID " << detId << " wt " << wt << " position " << pos
178185
<< " R " << pos.perp();
179186
#ifdef EDM_ML_DEBUG
180187
} else {

SimG4CMS/Calo/test/python/runHGC1_cfg.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
###############################################################################
22
# Way to use this:
33
# cmsRun ttbar.py geometry=V18
4-
# Options for geometry V17Shift, V18
4+
# Options for geometry V17Shift, V18, V19
55
#
66
###############################################################################
77
import FWCore.ParameterSet.Config as cms
@@ -15,7 +15,7 @@
1515
"V18",
1616
VarParsing.VarParsing.multiplicity.singleton,
1717
VarParsing.VarParsing.varType.string,
18-
"geometry of operations: V17Shift, V18")
18+
"geometry of operations: V17Shift, V18, V19")
1919

2020
### get and parse the command line arguments
2121

@@ -24,12 +24,12 @@
2424

2525
####################################################################
2626

27-
if (options.geometry == "V18"):
28-
from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
29-
process = cms.Process("PROD",Phase2C22I13M9)
30-
else:
27+
if (options.geometry == "V17Shift"):
3128
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
3229
process = cms.Process("PROD",Phase2C17I13M9)
30+
else:
31+
from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
32+
process = cms.Process("PROD",Phase2C22I13M9)
3333

3434
geomFile = "Geometry.HGCalCommonData.testHGCal" + options.geometry + "Reco_cff"
3535
print("Geometry file: ", geomFile)
@@ -49,6 +49,7 @@
4949
if hasattr(process,'MessageLogger'):
5050
process.MessageLogger.G4cout = dict()
5151
process.MessageLogger.G4cerr = dict()
52+
process.MessageLogger.HGCalGeom = dict()
5253
process.MessageLogger.HGCSim = dict()
5354
process.MessageLogger.CaloSim = dict()
5455

0 commit comments

Comments
 (0)