Skip to content
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

fix clusterizer to handle negative charge #20555

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -230,7 +230,7 @@ void PixelThresholdClusterizer::copy_to_buffer( DigiIterator begin, DigiIterator
// std::cout << (doMissCalibrate ? "VI from db" : "VI linear") << std::endl;
}
#endif
int electron[end-begin];
int electron[end-begin]; // pixel charge in electrons
memset(electron, 0, sizeof(electron));
if ( doMissCalibrate ) {
if (layer_==1) {
Expand Down Expand Up @@ -266,12 +266,16 @@ void PixelThresholdClusterizer::copy_to_buffer( DigiIterator begin, DigiIterator
for(DigiIterator di = begin; di != end; ++di) {
int row = di->row();
int col = di->column();
int adc = electron[i++];
int adc = electron[i++]; // this is in electrons

#ifdef PIXELREGRESSION
int adcOld = calibrate(di->adc(),col,row);
//assert(adc==adcOld);
if (adc!=adcOld) std::cout << "VI " << eqD <<' '<< ic <<' '<< end-begin <<' '<< i <<' '<< di->adc() <<' ' << adc <<' '<< adcOld << std::endl; else ++eqD;
#endif

if(adc<100) adc=100; // put all negative pixel charges into the 100 elec bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the comment is about "negative pixel charges", why if(adc<100) rather than if(adc<0) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it make more sense to have the cut value (adc<100) and target value (adc=100) independent and configurable ?


if ( adc >= thePixelThreshold) {
theBuffer.set_adc( row, col, adc);
if ( adc >= theSeedThreshold) theSeeds.push_back( SiPixelCluster::PixelPos(row,col) );
Expand Down Expand Up @@ -324,8 +328,8 @@ int PixelThresholdClusterizer::calibrate(int adc, int col, int row)
//const float pedestal = -28.2 * gain; // -79.

float DBgain = theSiPixelGainCalibrationService_->getGain(detid_, col, row);
float DBpedestal = theSiPixelGainCalibrationService_->getPedestal(detid_, col, row) * DBgain;

float pedestal = theSiPixelGainCalibrationService_->getPedestal(detid_, col, row);
float DBpedestal = pedestal * DBgain;

// Roc-6 average
//const float gain = 1./0.313; // 1 ADC = 3.19 VCALs
Expand All @@ -351,6 +355,7 @@ int PixelThresholdClusterizer::calibrate(int adc, int col, int row)
} else {
electrons = int( vcal * theConversionFactor + theOffset);
}

}
}
else
Expand Down
Expand Up @@ -19,9 +19,10 @@
# **** Offline - gain:col/ped:pix ****
# **************************************
payloadType = cms.string('Offline'),
#payloadType = cms.string('Full'),
SeedThreshold = cms.int32(1000),
ClusterThreshold = cms.int32(4000),
ClusterThreshold_L1 = cms.int32(4000),
ClusterThreshold = cms.int32(1000),
ClusterThreshold_L1 = cms.int32(1000),
# **************************************
maxNumberOfClusters = cms.int32(-1), # -1 means no limit.
)
Expand All @@ -33,8 +34,11 @@
VCaltoElectronGain_L1 = cms.int32(50), # L1: 49.6 +- 2.6
VCaltoElectronOffset = cms.int32(-60), # L2-4: -60 +- 130
VCaltoElectronOffset_L1 = cms.int32(-670), # L1: -670 +- 220
ChannelThreshold = cms.int32(250),
ClusterThreshold_L1 = cms.int32(2000)
ChannelThreshold = cms.int32(10),
SeedThreshold = cms.int32(1000),
ClusterThreshold = cms.int32(1000),
ClusterThreshold_L1 = cms.int32(1000)

)

# Need these until phase2 pixel templates are used
Expand Down