Skip to content

Commit

Permalink
Merge pull request #20555 from dkotlins/fix_pix_clusterizer_for_negat…
Browse files Browse the repository at this point in the history
…ive_charge

fix clusterizer to handle negative charge
  • Loading branch information
cmsbuild committed Sep 25, 2017
2 parents e4fd1ba + a6f8e8b commit 239fbbd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
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

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,6 +19,7 @@
# **** 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),
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),
ChannelThreshold = cms.int32(10),
SeedThreshold = cms.int32(1000),
ClusterThreshold = cms.int32(4000),
ClusterThreshold_L1 = cms.int32(2000)

)

# Need these until phase2 pixel templates are used
Expand Down

0 comments on commit 239fbbd

Please sign in to comment.