38 #include "G4NavigationHistory.hh" 39 #include "G4TouchableHistory.hh" 41 #include "CLHEP/Units/GlobalSystemOfUnits.h" 42 #include "CLHEP/Units/GlobalPhysicalConstants.h" 76 std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> >
ddconsToken_;
110 <<
"observer of begin events and of G4step " 111 <<
"with Parameter values: \n\tLabel : " <<
labelLayer_ <<
" and with " 112 <<
names_.size() <<
" detectors";
113 for (
unsigned int k = 0;
k <
names_.size(); ++
k)
129 G4String
nameX =
"HGCal";
135 else if (detType == 1)
143 else if (detType == 1)
149 nameX =
"HGCalEESensitive";
150 else if (detType == 1)
151 nameX =
"HGCalHESiliconSensitive";
153 nameX =
"HGCalHEScintillatorSensitive";
198 }
else if (detType == 1) {
213 int iev = (*evt)()->GetEventID();
216 <<
"event = " <<
iev;
235 if (aStep !=
nullptr) {
236 G4VPhysicalVolume* curPV = aStep->GetPreStepPoint()->GetPhysicalVolume();
237 const G4String&
name = curPV->GetName();
238 G4VSensitiveDetector* curSD = aStep->GetPreStepPoint()->GetSensitiveDetector();
241 << aStep->GetPreStepPoint()->GetPosition();
244 if (curSD !=
nullptr) {
246 for (
unsigned int k = 0;
k <
names_.size(); ++
k) {
247 if (
name.find(
names_[
k].c_str()) != std::string::npos) {
259 const G4TouchableHistory* touchable =
260 static_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
261 unsigned int index(0);
263 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
265 G4ThreeVector localpos = touchable->GetHistory()->GetTopTransform().TransformPoint(hitPoint);
266 float globalZ = touchable->GetTranslation(0).z();
267 int iz(globalZ > 0 ? 1 : -1);
270 if (touchable->GetHistoryDepth() ==
levelT1_) {
271 layer = touchable->GetReplicaNumber(0);
273 layer = touchable->GetReplicaNumber(2);
274 module = touchable->GetReplicaNumber(1);
275 cell = touchable->GetReplicaNumber(0);
280 if ((touchable->GetHistoryDepth() ==
levelT1_) || (touchable->GetHistoryDepth() ==
levelT2_)) {
281 layer = touchable->GetReplicaNumber(0);
283 layer = touchable->GetReplicaNumber(3);
284 module = touchable->GetReplicaNumber(2);
285 cell = touchable->GetReplicaNumber(1);
294 double edeposit = aStep->GetTotalEnergyDeposit();
297 << edeposit <<
" hit at " << hitPoint;
302 }
else if (detType == 1) {
311 G4String nextVolume(
"XXX");
312 if (aStep->GetTrack()->GetNextVolume() !=
nullptr)
313 nextVolume = aStep->GetTrack()->GetNextVolume()->GetName();
315 if (nextVolume.c_str() !=
name.c_str()) {
319 hgchitX_.emplace_back(hitPoint.x());
320 hgchitY_.emplace_back(hitPoint.y());
321 hgchitZ_.emplace_back(hitPoint.z());
334 <<
"deposit\n at EE : " << std::setw(6) <<
edepEE_ / CLHEP::MeV
335 <<
"\n at HEF: " << std::setw(6) <<
edepHEF_ / CLHEP::MeV
336 <<
"\n at HEB: " << std::setw(6) <<
edepHEB_ / CLHEP::MeV;
std::vector< unsigned int > hgchitIndex_
Log< level::Info, true > LogVerbatim
std::vector< double > hgchitY_
std::vector< int > subdet_
#define DEFINE_SIMWATCHER(type)
T getParameter(std::string const &) const
std::vector< HGCalNumberingScheme * > hgcalNumbering_
void produce(edm::Event &, const edm::EventSetup &) override
SimG4HGCalValidation(const edm::ParameterSet &p)
std::vector< std::string > nameXs_
std::vector< double > hgchitZ_
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool waferHexagon6() const
std::vector< int > detTypes_
constexpr std::array< uint8_t, layerIndexSize > layer
void beginRun(edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
void update(const BeginOfEvent *evt) override
This routine will be called when the appropriate signal arrives.
void fillhgcLayers(const double edepEE, const double edepHEF, const double edepHEB, const std::vector< double > &eedep, const std::vector< double > &hefdep, const std::vector< double > &hebdep)
void registerConsumes(edm::ConsumesCollector) override
const SimG4HGCalValidation & operator=(const SimG4HGCalValidation &)
std::vector< unsigned int > dets_
void layerAnalysis(PHGCalValidInfo &)
unsigned int layers(bool reco) const
bool tileTrapezoid() const
std::vector< unsigned int > hgchitDets_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::vector< double > hgcHEFedep_
std::vector< HGCNumberingScheme * > hgcNumbering_
std::vector< std::string > names_
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > ddconsToken_
std::vector< double > hgcHEBedep_
HitContainer const *__restrict__ TkSoA const *__restrict__ Quality const *__restrict__ CAHitNtupletGeneratorKernelsGPU::HitToTuple const *__restrict__ int32_t int32_t int iev
std::vector< int > types_
std::vector< double > hgcEEedep_
void fillhgcHits(const std::vector< unsigned int > &hitdets, const std::vector< unsigned int > &hitindex, const std::vector< double > &hitvtxX, const std::vector< double > &hitvtxY, const std::vector< double > &hitvtxZ)
~SimG4HGCalValidation() override
int levelTop(int ind=0) const
std::vector< double > hgchitX_