Skip to content

Commit 92fcd4a

Browse files
jbsauvanwaredjeb
authored andcommitted
fix TPG for v19 managing additional Si type (#169)
1 parent 039e4b1 commit 92fcd4a

File tree

14 files changed

+80
-22
lines changed

14 files changed

+80
-22
lines changed

DataFormats/ForwardDetId/interface/HGCalTriggerDetId.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
class HGCalTriggerDetId : public DetId {
2828
public:
29+
enum waferType { HGCalHD120 = 0, HGCalLD200 = 1, HGCalLD300 = 2, HGCalHD200 = 3 };
2930
static const int HGCalTriggerCell = 4;
3031

3132
/** Create a null cellid*/
@@ -46,6 +47,8 @@ class HGCalTriggerDetId : public DetId {
4647

4748
/// get the type
4849
int type() const { return (id_ >> kHGCalTypeOffset) & kHGCalTypeMask; }
50+
bool lowDensity() const { return ((type() == HGCalLD200) || (type() == HGCalLD300)); }
51+
bool highDensity() const { return ((type() == HGCalHD120) || (type() == HGCalHD200)); }
4952

5053
/// get the z-side of the cell (1/-1)
5154
int zside() const { return (((id_ >> kHGCalZsideOffset) & kHGCalZsideMask) ? -1 : 1); }

DataFormats/ForwardDetId/interface/HGCalTriggerModuleDetId.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
[19:20] Type (0 fine divisions of wafer with 120 mum thick silicon
1919
1 coarse divisions of wafer with 200 mum thick silicon
2020
2 coarse divisions of wafer with 300 mum thick silicon
21+
3 fine divisions of wafer with 200 mum thick silicon
2122
0 fine divisions of scintillators
2223
1 coarse divisions of scintillators)
2324
@@ -30,6 +31,8 @@
3031

3132
class HGCalTriggerModuleDetId : public DetId {
3233
public:
34+
enum siliconType { HGCalHD120 = 0, HGCalLD200 = 1, HGCalLD300 = 2, HGCalHD200 = 3 };
35+
enum tileGranularity { HGCalTileNormal = 0, HGCalTileFine = 1 };
3336
/** Create a null module id*/
3437
HGCalTriggerModuleDetId();
3538
/** Create module id from raw id (0=invalid id) */
@@ -72,6 +75,15 @@ class HGCalTriggerModuleDetId : public DetId {
7275
/// get the scintillator panel phi
7376
int phi() const { return moduleV(); }
7477

78+
bool isSiliconLowDensity() const {
79+
return (!isHScintillator() && ((type() == HGCalLD200) || (type() == HGCalLD300)));
80+
}
81+
bool isSiliconHighDensity() const {
82+
return (!isHScintillator() && ((type() == HGCalHD120) || (type() == HGCalHD200)));
83+
}
84+
bool isScintillatorFine() const { return (isHScintillator() && (type() == HGCalTileFine)); }
85+
bool isScintillatorCoarse() const { return (isHScintillator() && (type() == HGCalTileNormal)); }
86+
7587
/// consistency check : no bits left => no overhead
7688
bool isHFNose() const { return (triggerSubdetId() == HFNoseTrigger); }
7789
bool isEE() const { return (triggerSubdetId() == HGCalEETrigger); }

L1Trigger/L1THGCal/interface/HGCalCoarseTriggerCellMapping.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class HGCalCoarseTriggerCellMapping {
2626
static const std::map<int, int> kSplit_;
2727
static const std::map<int, int> kSplit_Scin_;
2828
static constexpr int kSTCidMaskInv_ = ~0xf;
29-
static constexpr int kNThicknesses_ = 4;
29+
static constexpr int kNThicknesses_ = 5; // 4 silicon types + 1 for scintillator
3030
static constexpr int kNHGCalLayersMax_ = 52;
3131

3232
static constexpr int kSplit_Coarse_ = 0;

L1Trigger/L1THGCal/interface/HGCalTriggerTools.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ class HGCalTriggerTools {
4949
bool isSilicon(const DetId&) const;
5050
bool isScintillator(const DetId& id) const { return !isSilicon(id); }
5151
bool isNose(const DetId&) const;
52+
bool isSiliconHighDensity(const DetId&) const;
53+
bool isSiliconLowDensity(const DetId&) const;
5254
int zside(const DetId&) const;
5355
int thicknessIndex(const DetId&) const;
5456

@@ -84,7 +86,7 @@ class HGCalTriggerTools {
8486
DetId simToReco(const DetId&, const HGCalTopology&) const;
8587
unsigned triggerLayer(const unsigned id) const { return geom_->triggerLayer(id); }
8688

87-
static constexpr unsigned kScintillatorPseudoThicknessIndex_ = 3;
89+
static constexpr unsigned kScintillatorPseudoThicknessIndex_ = 4;
8890

8991
enum SubDetectorType {
9092
hgcal_silicon_CEE,

L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorCoarsenerImpl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class HGCalConcentratorCoarsenerImpl {
2323
HGCalTriggerTools triggerTools_;
2424
bool fixedDataSizePerHGCROC_;
2525
HGCalCoarseTriggerCellMapping coarseTCmapping_;
26-
static constexpr int kHighDensityThickness_ = 0;
2726

2827
HGCalTriggerCellCalibration calibration_;
2928
HGCalVFECompressionImpl vfeCompression_;

L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorProcessorSelection.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class HGCalConcentratorProcessorSelection : public HGCalConcentratorProcessorBas
3333
bool fixedDataSizePerHGCROC_;
3434
bool allTrigCellsInTrigSums_;
3535
std::vector<unsigned> coarsenTriggerCells_;
36-
static constexpr int kHighDensityThickness_ = 0;
3736
static constexpr int kNSubDetectors_ = 3;
3837

3938
std::vector<SelectionType> selectionType_;

L1Trigger/L1THGCal/interface/concentrator/HGCalConcentratorSuperTriggerCellImpl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class HGCalConcentratorSuperTriggerCellImpl {
3434
};
3535

3636
EnergyDivisionType energyDivisionType_;
37-
static constexpr int kHighDensityThickness_ = 0;
3837
static constexpr int kOddNumberMask_ = 1;
3938

4039
HGCalTriggerTools triggerTools_;

L1Trigger/L1THGCal/plugins/concentrator/HGCalConcentratorProcessorSelection.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ void HGCalConcentratorProcessorSelection::run(const edm::Handle<l1t::HGCalTrigge
8989
std::vector<l1t::HGCalTriggerSums> trigSumsVecOutput;
9090
std::vector<l1t::HGCalConcentratorData> ae_EncodedLayerOutput;
9191

92-
int thickness = triggerTools_.thicknessIndex(module_trigcell.second.at(0).detId());
92+
bool isHighDensity = triggerTools_.isSiliconHighDensity(module_trigcell.second.at(0).detId());
9393

9494
HGCalTriggerTools::SubDetectorType subdet = triggerTools_.getSubDetectorType(module_trigcell.second.at(0).detId());
9595

96-
if (coarsenTriggerCells_[subdet] || (fixedDataSizePerHGCROC_ && thickness > kHighDensityThickness_)) {
96+
if (coarsenTriggerCells_[subdet] || (fixedDataSizePerHGCROC_ && !isHighDensity)) {
9797
coarsenerImpl_->coarsen(module_trigcell.second, trigCellVecCoarsened);
9898

9999
switch (selectionType_[subdet]) {

L1Trigger/L1THGCal/plugins/veryfrontend/HGCalVFEProcessorSums.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ void HGCalVFEProcessorSums::run(const HGCalDigiCollection& digiColl,
5959
if (dataframes.empty())
6060
return;
6161

62-
constexpr int kHighDensityThickness = 0;
6362
bool isSilicon = triggerTools_.isSilicon(dataframes[0].id());
6463
bool isEM = triggerTools_.isEm(dataframes[0].id());
6564
bool isNose = triggerTools_.isNose(dataframes[0].id());
66-
int thickness = triggerTools_.thicknessIndex(dataframes[0].id());
65+
bool isHighDensity = triggerTools_.isSiliconHighDensity(dataframes[0].id());
6766
// Linearization of ADC and TOT values to the same LSB
6867
if (isSilicon) {
6968
vfeLinearizationSiImpl_->linearize(dataframes, linearized_dataframes);
@@ -73,7 +72,7 @@ void HGCalVFEProcessorSums::run(const HGCalDigiCollection& digiColl,
7372
// Sum of sensor cells into trigger cells
7473
vfeSummationImpl_->triggerCellSums(linearized_dataframes, tc_payload);
7574
// Compression of trigger cell charges to a floating point format
76-
if (thickness == kHighDensityThickness) {
75+
if (isHighDensity) {
7776
vfeCompressionHDMImpl_->compress(tc_payload, tc_compressed_payload);
7877
} else {
7978
vfeCompressionLDMImpl_->compress(tc_payload, tc_compressed_payload);

L1Trigger/L1THGCal/python/l1tHGCalConcentratorProducer_cfi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
# MAX_LAYERS should be equal to kNHGCalLayersMax_ defined in interface/HGCalCoarseTriggerCellMapping.h
99
# MAX_LAYERS can be larger than the actual number of layers
10-
# CTC / STC sizes vectors should have a length of 4*MAX_LAYERS, 4 = 3 different silicon thicknesses + scintillator portion
10+
# CTC / STC sizes vectors should have a length of 5*MAX_LAYERS, 5 = 4 different silicon thicknesses/types (HD120, LD200, LD300, HD200) + scintillator portion
1111
MAX_LAYERS = 52
12-
CTC_2_SIZES = cms.vuint32( [2]*(MAX_LAYERS+1)*4 )
13-
STC_4_AND_16_SIZES = cms.vuint32( [4]*(MAX_LAYERS+1)+ [16]*(MAX_LAYERS+1)*3 )
14-
STC_4_AND_8_SIZES = cms.vuint32( [4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*3 )
12+
CTC_2_SIZES = cms.vuint32( [2]*(MAX_LAYERS+1)*5 )
13+
STC_4_AND_16_SIZES = cms.vuint32( [4]*(MAX_LAYERS+1)+ [16]*(MAX_LAYERS+1)*4 )
14+
STC_4_AND_8_SIZES = cms.vuint32( [4]*(MAX_LAYERS+1)+ [8]*(MAX_LAYERS+1)*4 )
1515

1616
threshold_conc_proc = cms.PSet(ProcessorName = cms.string('HGCalConcentratorProcessorSelection'),
1717
Method = cms.vstring(['thresholdSelect']*3),

0 commit comments

Comments
 (0)