Skip to content

Commit

Permalink
Validation succeeded for EE and HEF.
Browse files Browse the repository at this point in the history
  • Loading branch information
bfonta committed Sep 15, 2020
1 parent 933e5f5 commit 1006fa5
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 23 deletions.
15 changes: 15 additions & 0 deletions RecoLocalCalo/HGCalESProducers/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<use name="cuda"/>
<use name="HeterogeneousCore/CUDACore"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
<use name="Geometry/CaloGeometry"/>
<use name="FWCore/Framework"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/ParameterSet"/>
<use name="RecoLocalCalo/HGCalRecAlgos"/>
<use name="RecoLocalCalo/HGCalRecProducers"/>
<use name="Geometry/HGCalGeometry"/>
<use name="Geometry/HGCalCommonData"/>
<use name="CondFormats/DataRecord"/>
<library file="*.cc *.cu" name="RecoLocalCaloHGCalESProducersPlugins">
<flags EDM_PLUGIN="1"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ void hef_to_rechit(HGCRecHitSoA dst_soa, HGCUncalibratedRecHitSoA src_soa, const
CUDADataFormats/HGCal/interface/HGCUncalibratedRecHitsToRecHitsConstants.h maxsizes_constanats will perhaps have to be changed (change some 3's to 6's)
*/
HeterogeneousHGCSiliconDetId detid(src_soa.id_[i]);
//printf( "Layer offset: %d\n", cdata.layerOffset_ );
uint32_t layer = detid.layer() + cdata.layerOffset_;
float weight = get_weight_from_layer(layer, cdata.weights_);
float rcorr = 1.f;//get_thickness_correction(detid.type(), cdata.rcorr_);
Expand Down Expand Up @@ -193,9 +192,6 @@ void fill_positions_from_detids(const hgcal_conditions::HeterogeneousHEFCellPosi

conds->posmap.x[i] = xpos; //* side; multiply by -1 if one wants to obtain the position from the opposite endcap. CAREFUL WITH LATER DETECTOR ALIGNMENT!!!
conds->posmap.y[i] = ypos;

//printf( "%d - %lf - %lf\n", cV - ncells, 1.5f*(static_cast<float>(cV) - static_cast<float>(ncells)), 1.5f*(static_cast<float>(cV - ncells)) );
//printf("waferU: %d\t waferV: %d\t cellU: %d\t cellV: %d\t nCells: %d\t R1: %lf\t Layer: %d\t PosX: %lf\t PosY: %lf\t PosZ: %lf\n", wU, wV, cU, cV, ncells, R1, layer, conds->posmap.x[i], conds->posmap.y[i], conds->posmap.z[i]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ bool HGCalRecHitWorkerSimple::run(const edm::Event& evt,
break;
}
}

switch (idtype) {
case hgcee:
rechitMaker_->setADCToGeVConstant(float(hgceeUncalib2GeV_));
cce_correction = hgcEE_cce_[thickness - 1];
sigmaNoiseGeV =
1e-3 * weights_[layer] * rcorr_[thickness] * hgcEE_noise_fC_[thickness - 1] / hgcEE_fCPerMIP_[thickness - 1];
sigmaNoiseGeV = 1e-3 * weights_[layer] * rcorr_[thickness] * hgcEE_noise_fC_[thickness - 1] / hgcEE_fCPerMIP_[thickness - 1];
break;
case hgcfh:
rechitMaker_->setADCToGeVConstant(float(hgchefUncalib2GeV_));
Expand Down
2 changes: 1 addition & 1 deletion RecoLocalCalo/HGCalRecProducers/python/HGCalRecHit_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
#With the new regional em factors there are 7 different factors used.
#Six of them are for silicon and one for scint. For silicon it is in the following order
# CE_E_120um, CE_E_200um, CE_E_300um, CE_H_120um, CE_H_200um, CE_H_300um
thicknessCorrection = cms.vdouble(1.132,1.092,1.084,1.132,1.092,1.084), # 100, 200, 300 um #the last three numbers were added by B. Alves on 31/08/2020
thicknessCorrection = cms.vdouble(1.132,1.092,1.084,1.,1.,1.), # 100, 200, 300 um #the last three numbers were added by B. Alves on 31/08/2020
deltasi_index_regemfac = cms.int32(3),
#One factor for scint
sciThicknessCorrection = cms.double(1.0),
Expand Down
5 changes: 3 additions & 2 deletions UserCode/CodeGPU/python/HeterogeneousHGCalRecHit_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@
HGCHEB_keV2DIGI = HGCalRecHit.__dict__['HGCHEB_keV2DIGI'],
HGCHEB_noise_MIP = HGCalRecHit.__dict__['HGCHEB_noise_MIP'],
weights = HGCalRecHit.__dict__['layerWeights'] )
process.HGCalRecHits = HGCalRecHit.clone()

fNameOut = 'out'
#process.task = cms.Task( process.HeterogeneousHGCalEERecHits, process.HeterogeneousHGCalHEFRecHits )
process.task = cms.Task( process.HeterogeneousHGCalHEFCellPositionsFiller, process.HeterogeneousHGCalHEFRecHits )
#process.task = cms.Task( process.HeterogeneousHGCalHEFCellPositionsFiller, process.HeterogeneousHGCalHEFRecHits )
process.task = cms.Task( process.HGCalRecHits, process.HeterogeneousHGCalHEFRecHits )
process.path = cms.Path( process.task )

process.out = cms.OutputModule("PoolOutputModule",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ HeterogeneousHGCalRecHitsValidator::HeterogeneousHGCalRecHitsValidator( const ed
for(unsigned int i=0; i<nsubdetectors; ++i)
{
trees_[i] = fs->make<TTree>(treenames_[i].c_str(), treenames_[i].c_str());
trees_[i]->Branch( "cpu", "validHitCollection", &cpuValidRecHits );
trees_[i]->Branch( "gpu", "validHitCollection", &gpuValidRecHits );
trees_[i]->Branch( "diffs", "validHitCollection", &diffsValidRecHits );
trees_[i]->Branch( "cpu", "validHitCollection", &cpuValidRecHits[i] );
trees_[i]->Branch( "gpu", "validHitCollection", &gpuValidRecHits[i] );
trees_[i]->Branch( "diffs", "validHitCollection", &diffsValidRecHits[i] );
}
}

Expand Down Expand Up @@ -91,9 +91,10 @@ void HeterogeneousHGCalRecHitsValidator::analyze(const edm::Event &event, const
validHit vGPU(gpuEn, gpuTime, gpuTimeErr, gpuDetId, gpuFB, gpuSoN);
validHit vDiffs(cpuEn-gpuEn, cpuTime-gpuTime, cpuTimeErr-gpuTimeErr, cpuDetId-gpuDetId, cpuFB-gpuFB, cpuSoN-gpuSoN);

cpuValidRecHits.push_back( vCPU );
gpuValidRecHits.push_back( vGPU );
diffsValidRecHits.push_back( vDiffs );
std::cout << cpuEn << ", " << gpuEn << std::endl;
cpuValidRecHits[idet].push_back( vCPU );
gpuValidRecHits[idet].push_back( vGPU );
diffsValidRecHits[idet].push_back( vDiffs );
}
trees_[idet]->Fill();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class HeterogeneousHGCalRecHitsValidator : public edm::EDAnalyzer

std::array< TTree*, nsubdetectors > trees_;
std::array< std::string, nsubdetectors > treenames_;
validHitCollection cpuValidRecHits, gpuValidRecHits, diffsValidRecHits;
std::array< validHitCollection, nsubdetectors > cpuValidRecHits, gpuValidRecHits, diffsValidRecHits;
//std::vector< TH1F* > zhist;

void set_geometry_(const edm::EventSetup&, const unsigned int&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
rcorr = cms.vdouble( HGCalRecHit.__dict__['thicknessCorrection'][0:3] ),
weights = HGCalRecHit.__dict__['layerWeights']
)

process.HeterogeneousHGCalHEFRecHits = cms.EDProducer( 'HeterogeneousHGCalHEFRecHitProducer',
HGCHEFUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEFUncalibRecHits'),
HGCHEF_keV2DIGI = HGCalRecHit.__dict__['HGCHEF_keV2DIGI'],
Expand All @@ -68,22 +69,24 @@
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = cms.vdouble( HGCalRecHit.__dict__['thicknessCorrection'][3:6] ),
weights = HGCalRecHit.__dict__['layerWeights'] )
weights = HGCalRecHit.__dict__['layerWeights']
)
process.HeterogeneousHGCalHEBRecHits = cms.EDProducer('HeterogeneousHGCalHEBRecHitProducer',
HGCHEBUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEBUncalibRecHits'),
HGCHEB_keV2DIGI = HGCalRecHit.__dict__['HGCHEB_keV2DIGI'],
HGCHEB_noise_MIP = HGCalRecHit.__dict__['HGCHEB_noise_MIP'],
weights = HGCalRecHit.__dict__['layerWeights'] )

weights = HGCalRecHit.__dict__['layerWeights']
)
process.HGCalRecHits = HGCalRecHit.clone()
process.valid = cms.EDAnalyzer( "HeterogeneousHGCalRecHitsValidator",
cpuRecHitsEEToken = cms.InputTag('HGCalRecHit', 'HGCEERecHits'),
cpuRecHitsEEToken = cms.InputTag('HGCalRecHits', 'HGCEERecHits'),
gpuRecHitsEEToken = cms.InputTag('HeterogeneousHGCalEERecHits','HeterogeneousHGCalEERecHits'),
cpuRecHitsHSiToken = cms.InputTag('HGCalRecHit', 'HGCHEFRecHits'),
cpuRecHitsHSiToken = cms.InputTag('HGCalRecHits', 'HGCHEFRecHits'),
gpuRecHitsHSiToken = cms.InputTag('HeterogeneousHGCalHEFRecHits','HeterogeneousHGCalHEFRecHits'),
cpuRecHitsHSciToken = cms.InputTag('HGCalRecHit', 'HGCHEBRecHits'),
cpuRecHitsHSciToken = cms.InputTag('HGCalRecHits', 'HGCHEBRecHits'),
gpuRecHitsHSciToken = cms.InputTag('HeterogeneousHGCalHEBRecHits','HeterogeneousHGCalHEBRecHits') )

process.recHitsTask = cms.Task( process.HeterogeneousHGCalEERecHits, process.HeterogeneousHGCalHEFRecHits, process.HeterogeneousHGCalHEBRecHits )
process.recHitsTask = cms.Task( process.HGCalRecHits, process.HeterogeneousHGCalEERecHits, process.HeterogeneousHGCalHEFRecHits, process.HeterogeneousHGCalHEBRecHits )
process.path = cms.Path( process.valid, process.recHitsTask )

process.out = cms.OutputModule( "PoolOutputModule",
Expand Down

0 comments on commit 1006fa5

Please sign in to comment.