Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Alves committed Aug 28, 2020
1 parent bc1fc76 commit 92aab44
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void hef_to_rechit(HGCRecHitSoA dst_soa, HGCUncalibratedRecHitSoA src_soa, const
for (unsigned int i = tid; i < length; i += blockDim.x * gridDim.x)
{
HeterogeneousHGCSiliconDetId detid(src_soa.id_[i]);
printf("cellCoarseY: %lf - cellX: %d - numberCellsHexagon: %d - DetId: %d - Var: %d\n", conds->params.cellCoarseY_[12], detid.cellX(), conds->posmap.numberCellsHexagon[0], conds->posmap.detid[9], conds->posmap.waferMax);
//printf("cellCoarseY: %lf - cellX: %d - numberCellsHexagon: %d - DetId: %d - Var: %d\n", conds->params.cellCoarseY_[12], detid.cellX(), conds->posmap.numberCellsHexagon[0], conds->posmap.detid[9], conds->posmap.waferMax);

double weight = get_weight_from_layer(detid.layer(), cdata.weights_);
double rcorr = get_thickness_correction(detid.type(), cdata.rcorr_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HeterogeneousHGCalEERecHitProducer: public edm::stream::EDProducer<edm::Ex
unsigned int nhitsmax_ = 0;
unsigned int stride_ = 0;
edm::EDGetTokenT<HGCeeUncalibratedRecHitCollection> token_;
const std::string collection_name_ = "HeterogeneousHGCeeUncalibratedRecHits";
const std::string collection_name_ = "HeterogeneousHGCalEERecHits";
edm::Handle<HGCeeUncalibratedRecHitCollection> handle_ee_;
size_t handle_size_;
std::unique_ptr< HGCeeRecHitCollection > rechits_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class HeterogeneousHGCalHEBRecHitProducer: public edm::stream::EDProducer<edm::E
unsigned int nhitsmax_ = 0;
unsigned int stride_ = 0;
edm::EDGetTokenT<HGChebUncalibratedRecHitCollection> token_;
const std::string collection_name_ = "HeterogeneousHGChebUncalibratedRecHits";
const std::string collection_name_ = "HeterogeneousHGCalHEBRecHits";
edm::Handle<HGChebUncalibratedRecHitCollection> handle_heb_;
size_t handle_size_;
std::unique_ptr< HGChebRecHitCollection > rechits_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class HeterogeneousHGCalHEFRecHitProducer: public edm::stream::EDProducer<edm::E
unsigned int nhitsmax_ = 0;
unsigned int stride_ = 0;
edm::EDGetTokenT<HGChefUncalibratedRecHitCollection> token_;
const std::string collection_name_ = "HeterogeneousHGChefUncalibratedRecHits";
const std::string collection_name_ = "HeterogeneousHGCalHEFRecHits";
edm::Handle<HGChefUncalibratedRecHitCollection> handle_hef_;
size_t handle_size_;
std::unique_ptr< HGChefRecHitCollection > rechits_;
Expand Down
91 changes: 45 additions & 46 deletions UserCode/CodeGPU/python/HeterogeneousHGCalRecHit_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,55 +36,54 @@

process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool( False )) #add option for edmStreams
process.HeterogeneousHGCalEERecHitProducer = cms.EDProducer('HeterogeneousHGCalEERecHitProducer',
HGCEEUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCEEUncalibRecHits'),
HGCEE_keV2DIGI = HGCalRecHit.__dict__['HGCEE_keV2DIGI'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCEE_fCPerMIP = HGCalRecHit.__dict__['HGCEE_fCPerMIP'],
HGCEE_isSiFE = HGCalRecHit.__dict__['HGCEE_isSiFE'],
HGCEE_noise_fC = HGCalRecHit.__dict__['HGCEE_noise_fC'],
HGCEE_cce = HGCalRecHit.__dict__['HGCEE_cce'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = HGCalRecHit.__dict__['thicknessCorrection'],
weights = HGCalRecHit.__dict__['layerWeights']
process.HeterogeneousHGCalEERecHits = cms.EDProducer('HeterogeneousHGCalEERecHitProducer',
HGCEEUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCEEUncalibRecHits'),
HGCEE_keV2DIGI = HGCalRecHit.__dict__['HGCEE_keV2DIGI'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCEE_fCPerMIP = HGCalRecHit.__dict__['HGCEE_fCPerMIP'],
HGCEE_isSiFE = HGCalRecHit.__dict__['HGCEE_isSiFE'],
HGCEE_noise_fC = HGCalRecHit.__dict__['HGCEE_noise_fC'],
HGCEE_cce = HGCalRecHit.__dict__['HGCEE_cce'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = HGCalRecHit.__dict__['thicknessCorrection'],
weights = HGCalRecHit.__dict__['layerWeights']
)
process.HeterogeneousHGCalHEFRecHitProducer = cms.EDProducer('HeterogeneousHGCalHEFRecHitProducer',
HGCHEFUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEFUncalibRecHits'),
HGCHEF_keV2DIGI = HGCalRecHit.__dict__['HGCHEF_keV2DIGI'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCHEF_fCPerMIP = HGCalRecHit.__dict__['HGCHEF_fCPerMIP'],
HGCHEF_isSiFE = HGCalRecHit.__dict__['HGCHEF_isSiFE'],
HGCHEF_noise_fC = HGCalRecHit.__dict__['HGCHEF_noise_fC'],
HGCHEF_cce = HGCalRecHit.__dict__['HGCHEF_cce'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = HGCalRecHit.__dict__['thicknessCorrection'],
weights = HGCalRecHit.__dict__['layerWeights']
)
process.HeterogeneousHGCalHEBRecHitProducer = cms.EDProducer('HeterogeneousHGCalHEBRecHitProducer',
HGCHEBUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEBUncalibRecHits'),
HGCHEB_keV2DIGI = HGCalRecHit.__dict__['HGCHEB_keV2DIGI'],
HGCHEB_noise_MIP = HGCalRecHit.__dict__['HGCHEB_noise_MIP'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCHEB_isSiFE = HGCalRecHit.__dict__['HGCHEB_isSiFE'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
weights = HGCalRecHit.__dict__['layerWeights']
)
process.HeterogeneousHGCalHEFRecHits = cms.EDProducer('HeterogeneousHGCalHEFRecHitProducer',
HGCHEFUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEFUncalibRecHits'),
HGCHEF_keV2DIGI = HGCalRecHit.__dict__['HGCHEF_keV2DIGI'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCHEF_fCPerMIP = HGCalRecHit.__dict__['HGCHEF_fCPerMIP'],
HGCHEF_isSiFE = HGCalRecHit.__dict__['HGCHEF_isSiFE'],
HGCHEF_noise_fC = HGCalRecHit.__dict__['HGCHEF_noise_fC'],
HGCHEF_cce = HGCalRecHit.__dict__['HGCHEF_cce'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = HGCalRecHit.__dict__['thicknessCorrection'],
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'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCHEB_isSiFE = HGCalRecHit.__dict__['HGCHEB_isSiFE'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
weights = HGCalRecHit.__dict__['layerWeights'] )

fNameOut = 'out'
#process.task = cms.Task( process.HeterogeneousHGCalEERecHitProducer, process.HeterogeneousHGCalHEFRecHitProducer )
process.task = cms.Task( process.HeterogeneousHGCalHEFRecHitProducer )
#process.task = cms.Task( process.HeterogeneousHGCalEERecHits, process.HeterogeneousHGCalHEFRecHits )
process.task = cms.Task( 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 @@ -18,12 +18,12 @@
#include "CommonTools/UtilAlgos/interface/TFileService.h"

HeterogeneousHGCalRecHitsValidator::HeterogeneousHGCalRecHitsValidator( const edm::ParameterSet &ps ) :
tokens_( {{ {{consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("cpuRecHitsCEEToken")),
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsCEEToken"))}},
{{consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("cpuRecHitsCEEToken")),
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsCEEToken"))}},
{{consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("cpuRecHitsCEEToken")),
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsCEEToken"))}} }} ),
tokens_( {{ {{consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("cpuRecHitsHSiToken")),
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsHSiToken"))}},
{{consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("cpuRecHitsHSiToken")),
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsHSiToken"))}},
{{consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("cpuRecHitsHSiToken")),
consumes<HGCRecHitCollection>(ps.getParameter<edm::InputTag>("gpuRecHitsHSiToken"))}} }} ),
treename_("tree")
{
edm::Service<TFileService> fs;
Expand Down Expand Up @@ -69,12 +69,17 @@ void HeterogeneousHGCalRecHitsValidator::analyze(const edm::Event &event, const
const HGCRecHit &cpuHit = cpuhits[i];
const HGCRecHit &gpuHit = gpuhits[i];

/*
const HGCalDetId cpuDetid = cpuHit.detid();
const HGCalDetId gpuDetid = gpuHit.detid();
*/
const float cpuSoN = cpuHit.signalOverSigmaNoise();
const float gpuSoN = gpuHit.signalOverSigmaNoise();
/*
cpuValidRecHits.detid.push_back( cpuDetid );
gpuValidRecHits.detid.push_back( gpuDetid );

std::cout << cpuDetid << ", " << gpuDetid << std::endl;
*/
std::cout << gpuSoN << ", " << cpuSoN << std::endl;
}
}
tree_->Fill();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
from Configuration.ProcessModifiers.gpu_cff import gpu
from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')
from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import HGCalRecHit

#package loading
process = cms.Process("gpuValidation", gpu)
Expand All @@ -18,6 +17,9 @@
process.load('RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi')
process.load('SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi')

from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase2_realistic', '')

from RecoLocalCalo.HGCalRecProducers.HGCalRecHit_cfi import dEdX_weights_v10
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )

Expand All @@ -39,31 +41,29 @@

process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool( False )) #add option for edmStreams
process.HeterogeneousHGCalHEFRecHits = cms.EDProducer('HeterogeneousHGCalHEFRecHitProducer',
HGCHEFUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEFUncalibRecHits'),
HGCHEF_keV2DIGI = HGCalRecHit.__dict__['HGCHEF_keV2DIGI'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCHEF_fCPerMIP = HGCalRecHit.__dict__['HGCHEF_fCPerMIP'],
HGCHEF_isSiFE = HGCalRecHit.__dict__['HGCHEF_isSiFE'],
HGCHEF_noise_fC = HGCalRecHit.__dict__['HGCHEF_noise_fC'],
HGCHEF_cce = HGCalRecHit.__dict__['HGCHEF_cce'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = HGCalRecHit.__dict__['thicknessCorrection'],
weights = HGCalRecHit.__dict__['layerWeights'] )
process.HeterogeneousHGCalHEFRecHits = cms.EDProducer( 'HeterogeneousHGCalHEFRecHitProducer',
HGCHEFUncalibRecHitsTok = cms.InputTag('HGCalUncalibRecHit', 'HGCHEFUncalibRecHits'),
HGCHEF_keV2DIGI = HGCalRecHit.__dict__['HGCHEF_keV2DIGI'],
minValSiPar = HGCalRecHit.__dict__['minValSiPar'],
maxValSiPar = HGCalRecHit.__dict__['maxValSiPar'],
constSiPar = HGCalRecHit.__dict__['constSiPar'],
noiseSiPar = HGCalRecHit.__dict__['noiseSiPar'],
HGCHEF_fCPerMIP = HGCalRecHit.__dict__['HGCHEF_fCPerMIP'],
HGCHEF_isSiFE = HGCalRecHit.__dict__['HGCHEF_isSiFE'],
HGCHEF_noise_fC = HGCalRecHit.__dict__['HGCHEF_noise_fC'],
HGCHEF_cce = HGCalRecHit.__dict__['HGCHEF_cce'],
rangeMatch = HGCalRecHit.__dict__['rangeMatch'],
rangeMask = HGCalRecHit.__dict__['rangeMask'],
rcorr = HGCalRecHit.__dict__['thicknessCorrection'],
weights = HGCalRecHit.__dict__['layerWeights'] )


process.valid = cms.EDAnalyzer( "HeterogeneousHGCalRecHitsValidator",
cpuRecHitsHSiToken = cms.InputTag('HeterogeneousHGCalHEFRecHits','HGCHEFRecHits'),
gpuRecHitsHSiToken = cms.InputTag('HeterogeneousHGCalHEFRecHits','HGCHEFRecHits') )


process.task = cms.Task( process.HeterogeneousHGCalHEFRecHitProducer * process.valid )
process.path = cms.Path( process.task )
cpuRecHitsHSiToken = cms.InputTag('HeterogeneousHGCalHEFRecHits','HeterogeneousHGCalHEFRecHits'),
gpuRecHitsHSiToken = cms.InputTag('HeterogeneousHGCalHEFRecHits','HeterogeneousHGCalHEFRecHits') )

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

process.out = cms.OutputModule( "PoolOutputModule",
fileName = cms.untracked.string('out.root') )
Expand Down

0 comments on commit 92aab44

Please sign in to comment.