New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Phase 1 pixel gains in digitizer/clusterizer #19181
Changes from 7 commits
c090e99
a657fdb
6916fec
edc12d0
7384324
294178b
b77e50d
973ad66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,6 +173,22 @@ def customiseFor19098(process): | |
if hasattr(producer, "infinitesimalPt"): del producer.infinitesimalPt | ||
return process | ||
|
||
def customiseFor19181_pixel_phase0(process): | ||
for producer in producers_by_type(process, "SiPixelClusterProducer"): | ||
producer.VCaltoElectronGain_L1 = cms.int32(65) | ||
producer.VCaltoElectronOffset_L1 = cms.int32(-414) | ||
producer.ClusterThreshold = cms.int32(4000) | ||
producer.ClusterThreshold_L1 = cms.int32(4000) | ||
|
||
def customiseFor19181_pixel_phase1(process): | ||
for producer in producers_by_type(process, "SiPixelClusterProducer"): | ||
producer.VCaltoElectronGain = cms.int32(47) | ||
producer.VCaltoElectronGain_L1 = cms.int32(50) | ||
producer.VCaltoElectronOffset = cms.int32(-60) | ||
producer.VCaltoElectronOffset_L1 = cms.int32(-670) | ||
producer.ClusterThreshold = cms.int32(4000) | ||
producer.ClusterThreshold_L1 = cms.int32(2000) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forgot |
||
# CMSSW version specific customizations | ||
def customizeHLTforCMSSW(process, menuType="GRun"): | ||
|
||
|
@@ -189,4 +205,9 @@ def customizeHLTforCMSSW(process, menuType="GRun"): | |
process = customiseFor18559(process) | ||
process = customiseFor19098(process) | ||
|
||
if (menuType == "GRun2016"): | ||
process = customiseFor19181_pixel_phase0(process) | ||
else: | ||
process = customiseFor19181_pixel_phase1(process) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what will happen to run1 workflows? Do they also have GRun2016? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I only found phase0 configurations in GRun2016 configs. An HLT expert should comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Run1 workflows use a stripped HLT menu with nearly no physics. |
||
|
||
return process |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,9 +47,12 @@ PixelThresholdClusterizer::PixelThresholdClusterizer | |
// Get thresholds in electrons | ||
thePixelThreshold( conf.getParameter<int>("ChannelThreshold") ), | ||
theSeedThreshold( conf.getParameter<int>("SeedThreshold") ), | ||
theClusterThreshold( conf.getParameter<double>("ClusterThreshold") ), | ||
theClusterThreshold( conf.getParameter<int>("ClusterThreshold") ), | ||
theClusterThreshold_L1( conf.getParameter<int>("ClusterThreshold_L1") ), | ||
theConversionFactor( conf.getParameter<int>("VCaltoElectronGain") ), | ||
theConversionFactor_L1( conf.getParameter<int>("VCaltoElectronGain_L1") ), | ||
theOffset( conf.getParameter<int>("VCaltoElectronOffset") ), | ||
theOffset_L1( conf.getParameter<int>("VCaltoElectronOffset_L1") ), | ||
theStackADC_( conf.exists("AdcFullScaleStack") ? conf.getParameter<int>("AdcFullScaleStack") : 255 ), | ||
theFirstStack_( conf.exists("FirstStackLayer") ? conf.getParameter<int>("FirstStackLayer") : 5 ), | ||
theElectronPerADCGain_( conf.exists("ElectronPerADCGain") ? conf.getParameter<double>("ElectronPerADCGain") : 135. ), | ||
|
@@ -63,6 +66,28 @@ PixelThresholdClusterizer::PixelThresholdClusterizer | |
///////////////////////////////////////////////////////////////////////////// | ||
PixelThresholdClusterizer::~PixelThresholdClusterizer() {} | ||
|
||
|
||
// Configuration descriptions | ||
void | ||
PixelThresholdClusterizer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
// siPixelClusters | ||
edm::ParameterSetDescription desc; | ||
desc.add<edm::InputTag>("src", edm::InputTag("siPixelDigis")); | ||
desc.add<int>("ChannelThreshold", 1000); | ||
desc.addUntracked<bool>("MissCalibrate", true); | ||
desc.add<bool>("SplitClusters", false); | ||
desc.add<int>("VCaltoElectronGain", 65); | ||
desc.add<int>("VCaltoElectronGain_L1", 65); | ||
desc.add<int>("VCaltoElectronOffset", -414); | ||
desc.add<int>("VCaltoElectronOffset_L1", -414); | ||
desc.add<std::string>("payloadType", "Offline"); | ||
desc.add<int>("SeedThreshold", 1000); | ||
desc.add<int>("ClusterThreshold_L1", 4000); | ||
desc.add<int>("ClusterThreshold", 4000); | ||
descriptions.add("siPixelClusters", desc); | ||
desc.add<int>("maxNumberOfClusters", -1); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. descriptions.add must be last... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I'm not mistaken, currently this method is a dead code. |
||
|
||
//---------------------------------------------------------------------------- | ||
//! Prepare the Clusterizer to work on a particular DetUnit. Re-init the | ||
//! size of the panel/plaquette (so update nrows and ncols), | ||
|
@@ -119,6 +144,11 @@ void PixelThresholdClusterizer::clusterizeDetUnitT( const T & input, | |
|
||
detid_ = input.detId(); | ||
|
||
// Set separate cluster threshold for L1 (needed for phase1) | ||
auto clusterThreshold = theClusterThreshold; | ||
int layer = (DetId(detid_).subdetId()==1) ? PXBDetId(detid_).layer() : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jkarancs are you sure you can use the PXBDetId class for the phase 1 detector? Between phase 0 and phase 1 the detid definition has changed and you should use TrackerTopology. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @venturia There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is strange. According to this page: https://github.com/cms-sw/cmssw/tree/master/Geometry/TrackerNumberingBuilder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh, you are absolutely right, the bit coding is only same for phase 0. We must use TrackerTopology indeed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you see any difference in the results after the fix of the DetId decoding? Is the problem also in the code used for the present data reconstruction? Do you know or can you check if these outdated class is used in another parts of the pixel reco code? |
||
if (layer==1) clusterThreshold = theClusterThreshold_L1; | ||
|
||
// Copy PixelDigis to the buffer array; select the seed pixels | ||
// on the way, and store them in theSeeds. | ||
copy_to_buffer(begin, end); | ||
|
@@ -138,7 +168,7 @@ void PixelThresholdClusterizer::clusterizeDetUnitT( const T & input, | |
|
||
// Check if the cluster is above threshold | ||
// (TO DO: one is signed, other unsigned, gcc warns...) | ||
if ( cluster.charge() >= theClusterThreshold) | ||
if ( cluster.charge() >= clusterThreshold) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually given that cluster.charge() is a int please use a int for clusterThreshold! |
||
{ | ||
// std::cout << "putting in this cluster " << i << " " << cluster.charge() << " " << cluster.pixelADC().size() << endl; | ||
// sort by row (x) | ||
|
@@ -202,10 +232,14 @@ void PixelThresholdClusterizer::copy_to_buffer( DigiIterator begin, DigiIterator | |
#endif | ||
int electron[end-begin]; | ||
memset(electron, 0, sizeof(electron)); | ||
int layer = (DetId(detid_).subdetId()==1) ? PXBDetId(detid_).layer() : 0; | ||
if ( doMissCalibrate ) { | ||
(*theSiPixelGainCalibrationService_).calibrate(detid_,begin,end,theConversionFactor, theOffset,electron); | ||
if (layer==1) { | ||
(*theSiPixelGainCalibrationService_).calibrate(detid_,begin,end,theConversionFactor_L1, theOffset_L1,electron); | ||
} else { | ||
(*theSiPixelGainCalibrationService_).calibrate(detid_,begin,end,theConversionFactor, theOffset, electron); | ||
} | ||
} else { | ||
int layer = (DetId(detid_).subdetId()==1) ? PXBDetId(detid_).layer() : 0; | ||
int i=0; | ||
for(DigiIterator di = begin; di != end; ++di) { | ||
auto adc = di->adc(); | ||
|
@@ -315,7 +349,11 @@ int PixelThresholdClusterizer::calibrate(int adc, int col, int row) | |
//const float p3 = 113.0; | ||
//float vcal = ( atanh( (adc-p3)/p2) + p1)/p0; | ||
|
||
electrons = int( vcal * theConversionFactor + theOffset); | ||
if (layer==1) { | ||
electrons = int( vcal * theConversionFactor_L1 + theOffset_L1); | ||
} else { | ||
electrons = int( vcal * theConversionFactor + theOffset); | ||
} | ||
} | ||
} | ||
else | ||
|
@@ -427,6 +465,11 @@ PixelThresholdClusterizer::make_cluster( const SiPixelCluster::PixelPos& pix, | |
|
||
if (dead_flag && doSplitClusters) | ||
{ | ||
// Set separate cluster threshold for L1 (needed for phase1) | ||
auto clusterThreshold = theClusterThreshold; | ||
int layer = (DetId(detid_).subdetId()==1) ? PXBDetId(detid_).layer() : 0; | ||
if (layer==1) clusterThreshold = theClusterThreshold_L1; | ||
|
||
//Set the first cluster equal to the existing cluster. | ||
SiPixelCluster first_cluster = cluster; | ||
bool have_second_cluster = false; | ||
|
@@ -440,8 +483,8 @@ PixelThresholdClusterizer::make_cluster( const SiPixelCluster::PixelPos& pix, | |
SiPixelCluster second_cluster = make_cluster(deadpix, output); | ||
|
||
//If both clusters would normally have been found by the clusterizer, put them into output | ||
if ( second_cluster.charge() >= theClusterThreshold && | ||
first_cluster.charge() >= theClusterThreshold ) | ||
if ( second_cluster.charge() >= clusterThreshold && | ||
first_cluster.charge() >= clusterThreshold ) | ||
{ | ||
output.push_back( second_cluster ); | ||
have_second_cluster = true; | ||
|
@@ -460,7 +503,7 @@ PixelThresholdClusterizer::make_cluster( const SiPixelCluster::PixelPos& pix, | |
} | ||
|
||
//Remember to also add the first cluster if we added the second one. | ||
if ( first_cluster.charge() >= theClusterThreshold && have_second_cluster) | ||
if ( first_cluster.charge() >= clusterThreshold && have_second_cluster) | ||
{ | ||
output.push_back( first_cluster ); | ||
std::push_heap(output.begin(),output.end(),[](SiPixelCluster const & cl1,SiPixelCluster const & cl2) { return cl1.minPixelRow() < cl2.minPixelRow();}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot
return process