Skip to content

Commit

Permalink
Merge pull request #39481 from bsunanda/Phase2-hgx325G
Browse files Browse the repository at this point in the history
Phase2-hgx325G Make bug correction in HGCHitValidation and remove all references to 6-inch silicon version
  • Loading branch information
cmsbuild committed Sep 30, 2022
2 parents 424cd62 + 6a1014c commit 6068566
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 61 deletions.
13 changes: 5 additions & 8 deletions Validation/HGCalValidation/test/HGCGeometryCheck.cc
Expand Up @@ -3,8 +3,6 @@

#include "CommonTools/UtilAlgos/interface/TFileService.h"

#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"

Expand All @@ -19,7 +17,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Utilities/interface/transform.h"

Expand Down Expand Up @@ -124,11 +121,11 @@ void HGCGeometryCheck::analyze(const edm::Event &iEvent, const edm::EventSetup &

if (infoLayer.isValid()) {
//step vertex information
std::vector<float> hitVtxX = infoLayer->hitvtxX();
std::vector<float> hitVtxY = infoLayer->hitvtxY();
std::vector<float> hitVtxZ = infoLayer->hitvtxZ();
std::vector<unsigned int> hitDet = infoLayer->hitDets();
std::vector<unsigned int> hitIdx = infoLayer->hitIndex();
const std::vector<float> &hitVtxX = infoLayer->hitvtxX();
const std::vector<float> &hitVtxY = infoLayer->hitvtxY();
const std::vector<float> &hitVtxZ = infoLayer->hitvtxZ();
const std::vector<unsigned int> &hitDet = infoLayer->hitDets();
const std::vector<unsigned int> &hitIdx = infoLayer->hitIndex();

//loop over all hits
for (unsigned int i = 0; i < hitVtxZ.size(); i++) {
Expand Down
14 changes: 0 additions & 14 deletions Validation/HGCalValidation/test/HGCalCellHitSum.cc
Expand Up @@ -24,14 +24,11 @@

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/FileInPath.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
Expand All @@ -46,25 +43,14 @@
#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCalTriggerDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetIdToModule.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetIdToROC.h"
#include "DataFormats/Math/interface/angle_units.h"

#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
#include "Geometry/HGCalGeometry/interface/HGCalGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

#include "CLHEP/Geometry/Point3D.h"
#include "CLHEP/Geometry/Transform3D.h"
#include "CLHEP/Geometry/Vector3D.h"
#include "CLHEP/Units/GlobalSystemOfUnits.h"
#include "CLHEP/Units/GlobalPhysicalConstants.h"

Expand Down
48 changes: 22 additions & 26 deletions Validation/HGCalValidation/test/HGCalDigiStudy.cc
Expand Up @@ -10,9 +10,7 @@
#include "TH1D.h"

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
#include "DataFormats/ForwardDetId/interface/HFNoseDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/HGCDigi/interface/HGCDigiCollections.h"
Expand All @@ -34,8 +32,6 @@
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "Geometry/HGCalGeometry/interface/HGCalGeometry.h"

#include "CLHEP/Units/GlobalSystemOfUnits.h"

class HGCalDigiStudy : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
public:
explicit HGCalDigiStudy(const edm::ParameterSet&);
Expand Down Expand Up @@ -219,10 +215,8 @@ void HGCalDigiStudy::beginRun(const edm::Run&, const edm::EventSetup& iSetup) {
layers_ = hgcGeom_->topology().dddConstants().layers(true);
if (hgcGeom_->topology().waferHexagon8())
geomType_ = 1;
else if (hgcGeom_->topology().tileTrapezoid())
geomType_ = 2;
else
geomType_ = 0;
geomType_ = 2;
if (nameDetector_ == "HGCalHFNoseSensitive")
geomType_ = 3;
edm::LogVerbatim("HGCalValidation") << "HGCalDigiStudy: gets Geometry for " << nameDetector_ << " of type "
Expand All @@ -243,27 +237,27 @@ void HGCalDigiStudy::analyze(const edm::Event& iEvent, const edm::EventSetup& iS
ntot++;
nused++;
DetId detId = it.id();
int layer = ((geomType_ == 0) ? (HGCalDetId(detId).layer())
: (geomType_ == 1) ? HGCSiliconDetId(detId).layer()
: HFNoseDetId(detId).layer());
int layer =
((geomType_ == 1) ? HGCSiliconDetId(detId).layer()
: ((geomType_ == 2) ? HGCScintillatorDetId(detId).layer() : HFNoseDetId(detId).layer()));
const HGCSample& hgcSample = it.sample(SampleIndx_);
uint16_t adc = hgcSample.data();
double charge = adc;
// uint16_t gain = hgcSample.toa();
// double charge = adc*gain;
digiValidation(detId, hgcGeom_, layer, adc, charge);
if (geomType_ == 0) {
HGCalDetId id = HGCalDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.wafer());
h_C1_->Fill(id.cell());
} else if (geomType_ == 1) {
if (geomType_ == 1) {
HGCSiliconDetId id = HGCSiliconDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.waferU());
h_W2_->Fill(id.waferV());
h_C1_->Fill(id.cellU());
h_C2_->Fill(id.cellV());
} else if (geomType_ == 2) {
HGCScintillatorDetId id = HGCScintillatorDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.ieta());
h_C1_->Fill(id.iphi());
} else {
HFNoseDetId id = HFNoseDetId(detId);
h_Ly_->Fill(id.layer());
Expand All @@ -288,32 +282,34 @@ void HGCalDigiStudy::analyze(const edm::Event& iEvent, const edm::EventSetup& iS
ntot++;
nused++;
DetId detId = it.id();
int layer = ((geomType_ == 0)
? HGCalDetId(detId).layer()
: ((geomType_ == 1) ? HGCSiliconDetId(detId).layer() : HGCScintillatorDetId(detId).layer()));
int layer =
((geomType_ == 1) ? HGCSiliconDetId(detId).layer()
: ((geomType_ == 2) ? HGCScintillatorDetId(detId).layer() : HFNoseDetId(detId).layer()));
const HGCSample& hgcSample = it.sample(SampleIndx_);
uint16_t adc = hgcSample.data();
double charge = adc;
// uint16_t gain = hgcSample.toa();
// double charge = adc*gain;
digiValidation(detId, hgcGeom_, layer, adc, charge);
if (geomType_ == 0) {
HGCalDetId id = HGCalDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.wafer());
h_C1_->Fill(id.cell());
} else if (geomType_ == 1) {
if (geomType_ == 1) {
HGCSiliconDetId id = HGCSiliconDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.waferU());
h_W2_->Fill(id.waferV());
h_C1_->Fill(id.cellU());
h_C2_->Fill(id.cellV());
} else {
} else if (geomType_ == 2) {
HGCScintillatorDetId id = HGCScintillatorDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.ieta());
h_C1_->Fill(id.iphi());
} else {
HFNoseDetId id = HFNoseDetId(detId);
h_Ly_->Fill(id.layer());
h_W1_->Fill(id.waferU());
h_W2_->Fill(id.waferV());
h_C1_->Fill(id.cellU());
h_C2_->Fill(id.cellV());
}
}
} else {
Expand Down
8 changes: 2 additions & 6 deletions Validation/HGCalValidation/test/HGCalRecHitStudy.cc
Expand Up @@ -20,8 +20,6 @@
#include "CommonTools/UtilAlgos/interface/TFileService.h"

#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
#include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h"
Expand Down Expand Up @@ -153,10 +151,8 @@ void HGCalRecHitStudy::analyze(const edm::Event& iEvent, const edm::EventSetup&
nused++;
DetId detId = it.id();
int layer = (ifNose_ ? HFNoseDetId(detId).layer()
: ((detId.det() == DetId::Forward)
? HGCalDetId(detId).layer()
: ((detId.det() == DetId::HGCalHSc) ? HGCScintillatorDetId(detId).layer()
: HGCSiliconDetId(detId).layer())));
: ((detId.det() == DetId::HGCalHSc) ? HGCScintillatorDetId(detId).layer()
: HGCSiliconDetId(detId).layer()));
recHitValidation(detId, layer, geom0, &it);
}
} else {
Expand Down
7 changes: 2 additions & 5 deletions Validation/HGCalValidation/test/HGCalSiliconValidation.cc
Expand Up @@ -27,9 +27,6 @@
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"

// Root objects
#include "TROOT.h"
#include "TSystem.h"
#include "TFile.h"
#include "TH1.h"
#include "TH2.h"

Expand Down Expand Up @@ -138,7 +135,7 @@ void HGCalSiliconValidation::analyze(const edm::Event& e, const edm::EventSetup&
ensum += energy;
map_try[id] = ensum;
++i;
edm::LogVerbatim("HGCalValidation") << "HGCalBHHit[" << i << "] ID " << std::hex << " " << id << std::dec << " "
edm::LogVerbatim("HGCalValidation") << "HGCalHit[" << i << "] ID " << std::hex << " " << id << std::dec << " "
<< HGCSiliconDetId(id) << " E " << energy << " time " << time;
}
for (std::map<unsigned int, double>::iterator itr = map_try.begin(); itr != map_try.end(); ++itr) {
Expand Down Expand Up @@ -166,7 +163,7 @@ void HGCalSiliconValidation::analyze(const edm::Event& e, const edm::EventSetup&
hdigOc_->Fill(r, depth);
hdi2Oc_->Fill(z, r);
++kount;
edm::LogVerbatim("HGCalValidation") << "HGCalBHDigit[" << kount << "] ID " << cell << " E " << energy;
edm::LogVerbatim("HGCalValidation") << "HGCalDigit[" << kount << "] ID " << cell << " E " << energy;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions Validation/HGCalValidation/test/HGCalWaferHitCheck.cc
Expand Up @@ -7,9 +7,7 @@
#include <string>
#include <vector>

#include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h"
#include "DataFormats/ForwardDetId/interface/HFNoseDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCalDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCSiliconDetId.h"
#include "DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h"
#include "DataFormats/HGCDigi/interface/HGCDigiCollections.h"
Expand Down

0 comments on commit 6068566

Please sign in to comment.