CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SimG4HGCalValidation Class Reference
Inheritance diagram for SimG4HGCalValidation:
SimProducer Observer< const BeginOfJob * > Observer< const BeginOfEvent * > Observer< const G4Step * > SimWatcher

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
 SimG4HGCalValidation (const edm::ParameterSet &p)
 
 ~SimG4HGCalValidation () override
 
- Public Member Functions inherited from SimProducer
void registerProducts (edm::ProducerBase &iProd)
 
 SimProducer ()
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const G4Step * >
 Observer ()
 
void slotForUpdate (const G4Step * iT)
 
virtual ~Observer ()
 

Private Member Functions

void clear ()
 
void init ()
 
void layerAnalysis (PHGCalValidInfo &)
 
const SimG4HGCalValidationoperator= (const SimG4HGCalValidation &)
 
 SimG4HGCalValidation (const SimG4HGCalValidation &)
 
void update (const BeginOfJob *job) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfEvent *evt) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *step) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

unsigned int count_
 
std::vector< unsigned int > dets_
 
std::vector< int > detTypes_
 
double edepEE_
 
double edepHEB_
 
double edepHEF_
 
std::vector< HGCalNumberingScheme * > hgcalNumbering_
 
std::vector< double > hgcEEedep_
 
std::vector< double > hgcHEBedep_
 
std::vector< double > hgcHEFedep_
 
std::vector< unsigned int > hgchitDets_
 
std::vector< unsigned int > hgchitIndex_
 
std::vector< double > hgchitX_
 
std::vector< double > hgchitY_
 
std::vector< double > hgchitZ_
 
std::vector< HGCNumberingScheme * > hgcNumbering_
 
std::string labelLayer_
 
int levelT1_
 
int levelT2_
 
std::vector< std::string > names_
 
HcalNumberingFromDDDnumberingFromDDD_
 
std::vector< int > subdet_
 
std::vector< int > types_
 
int verbosity_
 

Additional Inherited Members

- Protected Member Functions inherited from SimProducer
template<class T >
void produces ()
 
template<class T >
void produces (const std::string &instanceName)
 

Detailed Description

Definition at line 56 of file SimG4HGCalValidation.cc.

Constructor & Destructor Documentation

SimG4HGCalValidation::SimG4HGCalValidation ( const edm::ParameterSet p)

Definition at line 107 of file SimG4HGCalValidation.cc.

References detTypes_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gen::k, labelLayer_, names_, AlCaHLTBitMon_QueryRunRegistry::string, types_, and verbosity_.

107  :
108  numberingFromDDD_(nullptr), levelT1_(999), levelT2_(999), count_(0) {
109 
110  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("SimG4HGCalValidation");
111  names_ = m_Anal.getParameter<std::vector<std::string> >("Names");
112  types_ = m_Anal.getParameter<std::vector<int> >("Types");
113  detTypes_ = m_Anal.getParameter<std::vector<int> >("DetTypes");
114  labelLayer_ = m_Anal.getParameter<std::string>("LabelLayerInfo");
115  verbosity_ = m_Anal.getUntrackedParameter<int>("Verbosity",0);
116 
117  produces<PHGCalValidInfo>(labelLayer_);
118 
119  if (verbosity_ > 0) {
120  edm::LogVerbatim("ValidHGCal") << "HGCalTestAnalysis:: Initialised as "
121  << "observer of begin events and of G4step "
122  << "with Parameter values: \n\tLabel : "
123  << labelLayer_ << " and with "
124  << names_.size() << " detectors";
125  for (unsigned int k=0; k<names_.size(); ++k)
126  edm::LogVerbatim("ValidHGCal") << " [" << k << "] " << names_[k]
127  << " Type " << types_[k] << " DetType "
128  << detTypes_[k];
129  }
130 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > detTypes_
HcalNumberingFromDDD * numberingFromDDD_
int k[5][pyjets_maxn]
std::vector< std::string > names_
std::vector< int > types_
SimG4HGCalValidation::~SimG4HGCalValidation ( )
override

Definition at line 132 of file SimG4HGCalValidation.cc.

References hgcalNumbering_, hgcNumbering_, and numberingFromDDD_.

132  {
133  delete numberingFromDDD_;
134  for (auto number : hgcNumbering_) delete number;
135  for (auto number : hgcalNumbering_) delete number;
136 }
std::vector< HGCalNumberingScheme * > hgcalNumbering_
HcalNumberingFromDDD * numberingFromDDD_
std::vector< HGCNumberingScheme * > hgcNumbering_
SimG4HGCalValidation::SimG4HGCalValidation ( const SimG4HGCalValidation )
private

Member Function Documentation

void SimG4HGCalValidation::clear ( void  )
private

Definition at line 382 of file SimG4HGCalValidation.cc.

References DEFINE_SIMWATCHER, hgchitDets_, hgchitIndex_, hgchitX_, hgchitY_, and hgchitZ_.

Referenced by update().

382  {
383 
384  hgchitDets_.erase(hgchitDets_.begin(),hgchitDets_.end());
385  hgchitIndex_.erase(hgchitIndex_.begin(),hgchitIndex_.end());
386  hgchitX_.erase(hgchitX_.begin(),hgchitX_.end());
387  hgchitY_.erase(hgchitY_.begin(),hgchitY_.end());
388  hgchitZ_.erase(hgchitZ_.begin(),hgchitZ_.end());
389 }
std::vector< unsigned int > hgchitIndex_
std::vector< double > hgchitY_
std::vector< double > hgchitZ_
std::vector< unsigned int > hgchitDets_
std::vector< double > hgchitX_
void SimG4HGCalValidation::init ( )
private
void SimG4HGCalValidation::layerAnalysis ( PHGCalValidInfo product)
private

Definition at line 366 of file SimG4HGCalValidation.cc.

References edepEE_, edepHEB_, edepHEF_, PHGCalValidInfo::fillhgcHits(), PHGCalValidInfo::fillhgcLayers(), hgcEEedep_, hgcHEBedep_, hgcHEFedep_, hgchitDets_, hgchitIndex_, hgchitX_, hgchitY_, hgchitZ_, MeV, and verbosity_.

Referenced by produce().

366  {
367 
368  if (verbosity_ > 0)
369  edm::LogVerbatim("ValidHGCal") << "\n ===>>> SimG4HGCalValidation: Energy "
370  << "deposit\n at EE : " << std::setw(6)
371  << edepEE_/CLHEP::MeV << "\n at HEF: "
372  << std::setw(6) << edepHEF_/CLHEP::MeV
373  << "\n at HEB: " << std::setw(6)
374  << edepHEB_/CLHEP::MeV;
375 
376  //Fill HGC Variables
379 }
std::vector< unsigned int > hgchitIndex_
std::vector< double > hgchitY_
std::vector< double > hgchitZ_
const double MeV
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)
std::vector< unsigned int > hgchitDets_
std::vector< double > hgcHEFedep_
std::vector< double > hgcHEBedep_
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)
std::vector< double > hgchitX_
const SimG4HGCalValidation& SimG4HGCalValidation::operator= ( const SimG4HGCalValidation )
private
void SimG4HGCalValidation::produce ( edm::Event e,
const edm::EventSetup  
)
overridevirtual

Implements SimProducer.

Definition at line 138 of file SimG4HGCalValidation.cc.

References labelLayer_, layerAnalysis(), eostools::move(), and edm::Event::put().

138  {
139 
140  std::unique_ptr<PHGCalValidInfo> productLayer(new PHGCalValidInfo);
141  layerAnalysis(*productLayer);
142  e.put(std::move(productLayer),labelLayer_);
143 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
void layerAnalysis(PHGCalValidInfo &)
def move(src, dest)
Definition: eostools.py:511
void SimG4HGCalValidation::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 145 of file SimG4HGCalValidation.cc.

References dets_, detTypes_, Exception, DetId::Forward, ForwardEmpty, HGCalDDDConstants::geomMode(), edm::EventSetup::get(), DetId::Hcal, HcalEndcap, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, hgcalNumbering_, HGCEE, hgcEEedep_, HGCHEB, hgcHEBedep_, HGCHEF, hgcHEFedep_, hgcNumbering_, mps_fire::i, edm::ESHandleBase::isValid(), LayerTriplets::layers(), HGCalDDDConstants::layers(), levelT1_, levelT2_, HGCalDDDConstants::levelTop(), numberingFromDDD_, edm::ESHandle< T >::product(), subdet_, HGCalGeometryMode::Trapezoid, types_, and verbosity_.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

145  {
146 
147  const edm::EventSetup* es = (*job)();
148  for (unsigned int type=0; type<types_.size(); ++type) {
149  int layers(0);
150  int detType = detTypes_[type];
151  G4String nameX = "HGCal";
152  if (types_[type] <= 1) {
153  if (types_[type] == 0) {
155  if (detType == 0) dets_.emplace_back((int)(DetId::HGCalEE));
156  else if (detType == 1) dets_.emplace_back((int)(DetId::HGCalHSi));
157  else dets_.emplace_back((int)(DetId::HGCalHSc));
158  } else {
159  dets_.push_back((unsigned int)(DetId::Forward));
160  if (detType == 0) subdet_.emplace_back((int)(ForwardSubdetector::HGCEE));
161  else if (detType == 1) subdet_.emplace_back((int)(ForwardSubdetector::HGCHEF));
162  else subdet_.emplace_back((int)(ForwardSubdetector::HGCHEB));
163  }
164  if (detType == 0) nameX = "HGCalEESensitive";
165  else if (detType == 1) nameX = "HGCalHESiliconSensitive";
166  else nameX = "HGCalHEScintillatorSensitive";
168  es->get<IdealGeometryRecord>().get(nameX,hdc);
169  if (hdc.isValid()) {
171  levelT1_ = hdc->levelTop(0);
172  levelT2_ = hdc->levelTop(1);
173  if (m_mode == HGCalGeometryMode::Trapezoid) {
174  types_[type] =-1;
175  hgcalNumbering_.emplace_back(new HGCalNumberingScheme(*hdc,(DetId::Detector)(dets_[type]),nameX));
176  } else if ((m_mode == HGCalGeometryMode::Hexagon) ||
177  (m_mode == HGCalGeometryMode::HexagonFull)) {
178  types_[type] = 1;
179  hgcNumbering_.push_back(new HGCNumberingScheme(*hdc,nameX));
180  } else {
181  types_[type] = 0;
182  hgcalNumbering_.emplace_back(new HGCalNumberingScheme(*hdc,(DetId::Detector)(dets_[type]),nameX));
183  }
184  layers = hdc->layers(false);
185  } else {
186  edm::LogError("ValidHGCal") << "Cannot find HGCalDDDConstants for "
187  << nameX;
188  throw cms::Exception("Unknown", "ValidHGCal")
189  << "Cannot find HGCalDDDConstants for " << nameX << "\n";
190  }
191  } else {
192  nameX = "HcalEndcap";
193  dets_.push_back((unsigned int)(DetId::Hcal));
194  subdet_.push_back((int)(HcalSubdetector::HcalEndcap));
196  es->get<HcalSimNumberingRecord>().get(hdc);
197  if (hdc.isValid()) {
199  layers = 18;
200  } else {
201  edm::LogError("ValidHGCal") << "Cannot find HcalDDDSimConstant";
202  throw cms::Exception("Unknown", "ValidHGCal")
203  << "Cannot find HcalDDDSimConstant\n";
204  }
205  }
206  if (detType == 0) {
207  for (int i=0; i<layers; ++i) hgcEEedep_.push_back(0);
208  } else if (detType == 1) {
209  for (int i=0; i<layers; ++i) hgcHEFedep_.push_back(0);
210  } else {
211  for (int i=0; i<layers; ++i) hgcHEBedep_.push_back(0);
212  }
213  if (verbosity_ > 0)
214  edm::LogVerbatim("ValidHGCal") << "[" << type << "]: " << nameX
215  << " det " << dets_[type] << " subdet "
216  << subdet_[type] << " with " << layers
217  << " layers";
218  }
219 }
type
Definition: HCALResponse.h:21
std::vector< int > subdet_
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::vector< HGCalNumberingScheme * > hgcalNumbering_
std::vector< int > detTypes_
unsigned int layers(bool reco) const
std::vector< unsigned int > dets_
HcalNumberingFromDDD * numberingFromDDD_
HGCalGeometryMode::GeometryMode geomMode() const
std::vector< double > hgcHEFedep_
std::vector< HGCNumberingScheme * > hgcNumbering_
std::vector< double > hgcHEBedep_
Detector
Definition: DetId.h:26
std::vector< int > types_
std::vector< double > hgcEEedep_
T get() const
Definition: EventSetup.h:71
int levelTop(int ind=0) const
bool isValid() const
Definition: ESHandle.h:44
T const * product() const
Definition: ESHandle.h:86
void SimG4HGCalValidation::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 222 of file SimG4HGCalValidation.cc.

References clear(), count_, edepEE_, edepHEB_, edepHEF_, hgcEEedep_, hgcHEBedep_, hgcHEFedep_, mps_fire::i, and verbosity_.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

222  {
223 
224  int iev = (*evt)()->GetEventID();
225  if (verbosity_ > 0)
226  edm::LogVerbatim("ValidHGCal") << "SimG4HGCalValidation: =====> Begin "
227  << "event = " << iev;
228 
229  ++count_;
230  edepEE_ = edepHEF_ = edepHEB_ = 0.;
231 
232  //HGCal variables
233  for (unsigned int i = 0; i<hgcEEedep_.size(); i++) hgcEEedep_[i] = 0.;
234  for (unsigned int i = 0; i<hgcHEFedep_.size(); i++) hgcHEFedep_[i] = 0.;
235  for (unsigned int i = 0; i<hgcHEBedep_.size(); i++) hgcHEBedep_[i] = 0.;
236 
237  //Cache reset
238  clear();
239 }
std::vector< double > hgcHEFedep_
std::vector< double > hgcHEBedep_
std::vector< double > hgcEEedep_
void SimG4HGCalValidation::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 242 of file SimG4HGCalValidation.cc.

References TauDecayModes::dec, HcalNumberingFromDDD::HcalID::depth, egammaForCoreTracking_cff::depth, dets_, detTypes_, edepEE_, edepHEB_, edepHEF_, HcalNumberingFromDDD::HcalID::etaR, spr::find(), hgcalNumbering_, hgcEEedep_, hgcHEBedep_, hgcHEFedep_, hgchitDets_, hgchitIndex_, hgchitX_, hgchitY_, hgchitZ_, hgcNumbering_, gen::k, HcalNumberingFromDDD::HcalID::lay, levelT1_, levelT2_, dataset::name, names_, numberingFromDDD_, HcalTestNumbering::packHcalIndex(), HcalNumberingFromDDD::HcalID::phis, HcalNumberingFromDDD::HcalID::subdet, subdet_, tmp, types_, HcalNumberingFromDDD::unitID(), verbosity_, mps_merge::weight, and HcalNumberingFromDDD::HcalID::zside.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

242  {
243 
244  if (aStep != nullptr) {
245  G4VPhysicalVolume* curPV = aStep->GetPreStepPoint()->GetPhysicalVolume();
246  const G4String& name = curPV->GetName();
247  G4VSensitiveDetector* curSD = aStep->GetPreStepPoint()->GetSensitiveDetector();
248  if (verbosity_ > 1)
249  edm::LogVerbatim("ValidHGCal") << "ValidHGCal::Step in " << name <<" at "
250  << aStep->GetPreStepPoint()->GetPosition();
251 
252  // Only for Sensitive detector
253  if (curSD != nullptr) {
254  int type(-1);
255  for (unsigned int k=0; k<names_.size(); ++k) {
256  if (name.find(names_[k].c_str()) != std::string::npos) {
257  type = k; break;
258  }
259  }
260  int detType = (type >= 0) ? detTypes_[type] : -1;
261  if (verbosity_ > 0)
262  edm::LogVerbatim("ValidHGCal") << "ValidHGCal::In SD " << name
263  << " type " << type << ":" << detType;
264 
265  // Right type of SD
266  if (type >= 0) {
267  //Get the 32-bit index of the hit cell
268  const G4TouchableHistory* touchable = static_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
269  unsigned int index(0);
270  int layer(0);
271  G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
272  if (types_[type] <= 1) {
273  // HGCal
274  G4ThreeVector localpos = touchable->GetHistory()->GetTopTransform().TransformPoint(hitPoint);
275  float globalZ = touchable->GetTranslation(0).z();
276  int iz(globalZ>0 ? 1 : -1);
277  int module(-1), cell(-1);
278  if (types_[type] == 1) {
279  if (touchable->GetHistoryDepth() == levelT1_) {
280  layer = touchable->GetReplicaNumber(0);
281  } else {
282  layer = touchable->GetReplicaNumber(2);
283  module = touchable->GetReplicaNumber(1);
284  cell = touchable->GetReplicaNumber(0);
285  }
286  index = hgcNumbering_[type]->getUnitID((ForwardSubdetector)(subdet_[type]), layer, module, cell, iz, localpos);
287  } else {
288  if ((touchable->GetHistoryDepth() == levelT1_) ||
289  (touchable->GetHistoryDepth() == levelT2_)) {
290  layer = touchable->GetReplicaNumber(0);
291  } else {
292  layer = touchable->GetReplicaNumber(3);
293  module = touchable->GetReplicaNumber(2);
294  cell = touchable->GetReplicaNumber(1);
295  }
296  double weight(0);
297  index = hgcalNumbering_[type]->getUnitID(layer, module, cell, iz,
298  hitPoint, weight);
299  }
300  if (verbosity_ > 1)
301  edm::LogVerbatim("ValidHGCal") << "HGCal: " << name << " Layer "
302  << layer << " Module " << module
303  << " Cell " << cell;
304  } else {
305  // Hcal
306  int depth = (touchable->GetReplicaNumber(0))%10 + 1;
307  int lay = (touchable->GetReplicaNumber(0)/10)%100 + 1;
308  int det = (touchable->GetReplicaNumber(1))/1000;
311  math::XYZVectorD(hitPoint.x(),hitPoint.y(),
312  hitPoint.z()), depth, lay);
314  layer = tmp.lay;
315  if (verbosity_ > 1)
316  edm::LogVerbatim("ValidHGCal") << "HCAL: " << det << ":" << depth
317  << ":" << lay << " o/p "
318  << tmp.subdet << ":" << tmp.zside
319  << ":" << tmp.depth << ":"
320  << tmp.etaR << ":" << tmp.phis
321  << ":" << tmp.lay << " point "
322  << hitPoint << " " << hitPoint.rho()
323  << ":" << hitPoint.eta() << ":"
324  << hitPoint.phi();
325  }
326 
327  double edeposit = aStep->GetTotalEnergyDeposit();
328  if (verbosity_ > 0)
329  edm::LogVerbatim("ValidHGCal") << "Layer " << layer << " Index "
330  << std::hex << index << std::dec
331  << " Edep " << edeposit << " hit at "
332  << hitPoint;
333  if (detType == 0) {
334  edepEE_ += edeposit;
335  if (layer < (int)(hgcEEedep_.size()))
336  hgcEEedep_[layer] += edeposit;
337  } else if (detType == 1) {
338  edepHEF_ += edeposit;
339  if (layer < (int)(hgcHEFedep_.size()))
340  hgcHEFedep_[layer] += edeposit;
341  } else {
342  edepHEB_ += edeposit;
343  if (layer < (int)(hgcHEBedep_.size()))
344  hgcHEBedep_[layer] += edeposit;
345  }
346  G4String nextVolume("XXX");
347  if (aStep->GetTrack()->GetNextVolume()!=nullptr)
348  nextVolume = aStep->GetTrack()->GetNextVolume()->GetName();
349 
350  if (nextVolume.c_str()!=name.c_str()) { //save hit when it exits cell
351  if (std::find(hgchitIndex_.begin(),hgchitIndex_.end(),index) == hgchitIndex_.end()) {
352  hgchitDets_.push_back(dets_[type]);
353  hgchitIndex_.push_back(index);
354  hgchitX_.push_back(hitPoint.x());
355  hgchitY_.push_back(hitPoint.y());
356  hgchitZ_.push_back(hitPoint.z());
357  }
358  }
359  } // it is right type of SD
360  } // it is in a SD
361  }//if aStep!=NULL
362 }//end update aStep
std::vector< unsigned int > hgchitIndex_
type
Definition: HCALResponse.h:21
std::vector< double > hgchitY_
std::vector< int > subdet_
std::vector< HGCalNumberingScheme * > hgcalNumbering_
std::vector< double > hgchitZ_
Definition: weight.py:1
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
ForwardSubdetector
std::vector< int > detTypes_
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > XYZVectorD
spatial vector with cartesian internal representation
Definition: Vector3D.h:8
std::vector< unsigned int > dets_
HcalNumberingFromDDD * numberingFromDDD_
std::vector< unsigned int > hgchitDets_
std::vector< double > hgcHEFedep_
int k[5][pyjets_maxn]
HcalID unitID(int det, const math::XYZVectorD &pos, int depth, int lay=-1) const
std::vector< HGCNumberingScheme * > hgcNumbering_
std::vector< std::string > names_
std::vector< double > hgcHEBedep_
std::vector< int > types_
std::vector< double > hgcEEedep_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< double > hgchitX_
Definition: vlib.h:208

Member Data Documentation

unsigned int SimG4HGCalValidation::count_
private

Definition at line 99 of file SimG4HGCalValidation.cc.

Referenced by update().

std::vector<unsigned int> SimG4HGCalValidation::dets_
private

Definition at line 103 of file SimG4HGCalValidation.cc.

Referenced by update().

std::vector<int> SimG4HGCalValidation::detTypes_
private

Definition at line 92 of file SimG4HGCalValidation.cc.

Referenced by SimG4HGCalValidation(), and update().

double SimG4HGCalValidation::edepEE_
private

Definition at line 101 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), and update().

double SimG4HGCalValidation::edepHEB_
private

Definition at line 101 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), and update().

double SimG4HGCalValidation::edepHEF_
private

Definition at line 101 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), and update().

std::vector<HGCalNumberingScheme*> SimG4HGCalValidation::hgcalNumbering_
private

Definition at line 88 of file SimG4HGCalValidation.cc.

Referenced by update(), and ~SimG4HGCalValidation().

std::vector<double> SimG4HGCalValidation::hgcEEedep_
private

Definition at line 102 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), and update().

std::vector<double> SimG4HGCalValidation::hgcHEBedep_
private

Definition at line 102 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), and update().

std::vector<double> SimG4HGCalValidation::hgcHEFedep_
private

Definition at line 102 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), and update().

std::vector<unsigned int> SimG4HGCalValidation::hgchitDets_
private

Definition at line 103 of file SimG4HGCalValidation.cc.

Referenced by clear(), layerAnalysis(), and update().

std::vector<unsigned int> SimG4HGCalValidation::hgchitIndex_
private

Definition at line 103 of file SimG4HGCalValidation.cc.

Referenced by clear(), layerAnalysis(), and update().

std::vector<double> SimG4HGCalValidation::hgchitX_
private

Definition at line 104 of file SimG4HGCalValidation.cc.

Referenced by clear(), layerAnalysis(), and update().

std::vector<double> SimG4HGCalValidation::hgchitY_
private

Definition at line 104 of file SimG4HGCalValidation.cc.

Referenced by clear(), layerAnalysis(), and update().

std::vector<double> SimG4HGCalValidation::hgchitZ_
private

Definition at line 104 of file SimG4HGCalValidation.cc.

Referenced by clear(), layerAnalysis(), and update().

std::vector<HGCNumberingScheme*> SimG4HGCalValidation::hgcNumbering_
private

Definition at line 87 of file SimG4HGCalValidation.cc.

Referenced by update(), and ~SimG4HGCalValidation().

std::string SimG4HGCalValidation::labelLayer_
private

Definition at line 93 of file SimG4HGCalValidation.cc.

Referenced by produce(), and SimG4HGCalValidation().

int SimG4HGCalValidation::levelT1_
private

Definition at line 96 of file SimG4HGCalValidation.cc.

Referenced by update().

int SimG4HGCalValidation::levelT2_
private

Definition at line 96 of file SimG4HGCalValidation.cc.

Referenced by update().

std::vector<std::string> SimG4HGCalValidation::names_
private

Definition at line 91 of file SimG4HGCalValidation.cc.

Referenced by SimG4HGCalValidation(), and update().

HcalNumberingFromDDD* SimG4HGCalValidation::numberingFromDDD_
private

Definition at line 84 of file SimG4HGCalValidation.cc.

Referenced by update(), and ~SimG4HGCalValidation().

std::vector<int> SimG4HGCalValidation::subdet_
private

Definition at line 92 of file SimG4HGCalValidation.cc.

Referenced by update().

std::vector<int> SimG4HGCalValidation::types_
private

Definition at line 92 of file SimG4HGCalValidation.cc.

Referenced by SimG4HGCalValidation(), and update().

int SimG4HGCalValidation::verbosity_
private

Definition at line 100 of file SimG4HGCalValidation.cc.

Referenced by layerAnalysis(), SimG4HGCalValidation(), and update().