CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
FastTimerSD Class Reference

#include <FastTimerSD.h>

Inheritance diagram for FastTimerSD:
TimingSD Observer< const BeginOfJob * > SensitiveTkDetector Observer< const BeginOfEvent * > SensitiveDetector

Public Member Functions

 FastTimerSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *) override
 
 ~FastTimerSD () override
 
- Public Member Functions inherited from TimingSD
void clearHits () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
 TimingSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
 
 ~TimingSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
const std::vector< std::string > & getNames () const
 
void Initialize (G4HCofThisEvent *eventHC) override
 
bool isCaloSD () const
 
 SensitiveDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, bool calo)
 
 ~SensitiveDetector () override
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob * iT)
 
virtual ~Observer ()
 

Protected Member Functions

void update (const BeginOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 
- Protected Member Functions inherited from TimingSD
virtual bool checkHit (const G4Step *, BscG4Hit *)
 
const G4ThreeVector & getGlobalEntryPoint () const
 
const G4ThreeVector & getLocalEntryPoint () const
 
void setCuts (double eCut, double historyCut)
 
void setTimeFactor (double)
 
void setToLocal (const G4StepPoint *stepPoint, const G4ThreeVector &globalPoint, G4ThreeVector &localPoint)
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
- Protected Member Functions inherited from SensitiveDetector
TrackInformationcmsTrackInformation (const G4Track *aTrack)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point) const
 
Local3DPoint FinalStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint InitialStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint LocalPostStepPosition (const G4Step *step) const
 
Local3DPoint LocalPreStepPosition (const G4Step *step) const
 
void NaNTrap (const G4Step *step) const
 
void setNames (const std::vector< std::string > &)
 

Private Member Functions

std::vector< double > getDDDArray (const std::string &, const DDsvalues_type &)
 

Private Attributes

const FastTimeDDDConstantsftcons
 
int type_
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 

Detailed Description

Definition at line 19 of file FastTimerSD.h.

Constructor & Destructor Documentation

FastTimerSD::FastTimerSD ( const std::string &  name,
const edm::EventSetup es,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 30 of file FastTimerSD.cc.

References dbl_to_int(), ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), edm::EventSetup::get(), getDDDArray(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), DDFilteredView::mergedSpecifics(), TimingSD::setTimeFactor(), AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, groupFilesInBlocks::temp, and type_.

35  : TimingSD(name, es, clg, p, manager), ftcons(nullptr) {
36  //Parameters
37  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("FastTimerSD");
38  int verbn = m_p.getUntrackedParameter<int>("Verbosity");
39 
40  SetVerboseLevel(verbn);
41 
43  es.get<IdealGeometryRecord>().get(cpv);
44 
45  std::string attribute = "ReadOutName";
47  DDFilteredView fv(*cpv, filter);
48  fv.firstChild();
49  DDsvalues_type sv(fv.mergedSpecifics());
50  std::vector<int> temp = dbl_to_int(getDDDArray("Type", sv));
51  type_ = temp[0];
52 
53  setTimeFactor(100.);
54 
55  edm::LogInfo("FastTimerSim") << "FastTimerSD: Instantiation completed for " << name << " of type " << type_;
56 }
T getUntrackedParameter(std::string const &, T const &) const
void setTimeFactor(double)
Definition: TimingSD.cc:86
const FastTimeDDDConstants * ftcons
Definition: FastTimerSD.h:39
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: FastTimerSD.cc:92
TimingSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
Definition: TimingSD.cc:40
T get() const
Definition: EventSetup.h:73
FastTimerSD::~FastTimerSD ( )
override

Definition at line 58 of file FastTimerSD.cc.

58 {}

Member Function Documentation

std::vector< double > FastTimerSD::getDDDArray ( const std::string &  str,
const DDsvalues_type sv 
)
private

Definition at line 92 of file FastTimerSD.cc.

References DDfetch(), DDValue::doubles(), Exception, str, and relativeConstraints::value.

Referenced by FastTimerSD().

92  {
93  DDValue value(str);
94  if (DDfetch(&sv, value)) {
95  const std::vector<double>& fvec = value.doubles();
96  int nval = fvec.size();
97  if (nval < 1) {
98  edm::LogError("FastTimerSim") << "FastTimerSD : # of " << str << " bins " << nval << " < 1 ==> illegal";
99  throw cms::Exception("DDException") << "FastTimerSD: cannot get array " << str;
100  }
101  return fvec;
102  } else {
103  edm::LogError("FastTimerSim") << "FastTimerSD: cannot get array " << str;
104  throw cms::Exception("DDException") << "FastTimerSD: cannot get array " << str;
105  }
106 }
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
Definition: value.py:1
#define str(s)
uint32_t FastTimerSD::setDetUnitId ( const G4Step *  aStep)
overridevirtual

Implements SensitiveDetector.

Definition at line 60 of file FastTimerSD.cc.

References funct::abs(), TauDecayModes::dec, ftcons, FastTimeDDDConstants::getEtaPhi(), TimingSD::getGlobalEntryPoint(), TimingSD::getLocalEntryPoint(), FastTimeDDDConstants::getZPhi(), triggerObjects_cff::id, DTRecHitClients_cfi::local, DetId::rawId(), and type_.

60  {
61  //Find the depth segment
62  const G4ThreeVector& global = getGlobalEntryPoint();
63  const G4ThreeVector& local = getLocalEntryPoint();
64  int iz = (global.z() > 0) ? 1 : -1;
65  std::pair<int, int> izphi = ((ftcons) ? ((type_ == 1) ? (ftcons->getZPhi(std::abs(local.z()), local.phi()))
66  : (ftcons->getEtaPhi(local.perp(), local.phi())))
67  : (std::pair<int, int>(0, 0)));
68  uint32_t id = FastTimeDetId(type_, izphi.first, izphi.second, iz).rawId();
69 #ifdef EDM_ML_DEBUG
70  edm::LogVerbatim("FastTimerSD") << "Volume " << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() << ": "
71  << global.z() << " Iz(eta)phi " << izphi.first << ":" << izphi.second << ":" << iz
72  << " id " << std::hex << id << std::dec;
73 #endif
74  return id;
75 }
std::pair< int, int > getEtaPhi(double r, double phi) const
const G4ThreeVector & getLocalEntryPoint() const
Definition: TimingSD.h:66
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const FastTimeDDDConstants * ftcons
Definition: FastTimerSD.h:39
std::pair< int, int > getZPhi(double z, double phi) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const G4ThreeVector & getGlobalEntryPoint() const
Definition: TimingSD.h:67
void FastTimerSD::update ( const BeginOfJob )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 77 of file FastTimerSD.cc.

References Exception, ftcons, and edm::EventSetup::get().

Referenced by progressbar.ProgressBar::__next__(), 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(), progressbar.ProgressBar::finish(), 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().

77  {
78  const edm::EventSetup* es = (*job)();
80  es->get<IdealGeometryRecord>().get(fdc);
81  if (fdc.isValid()) {
82  ftcons = &(*fdc);
83  } else {
84  edm::LogError("FastTimerSim") << "FastTimerSD : Cannot find FastTimeDDDConstants";
85  throw cms::Exception("Unknown", "FastTimerSD") << "Cannot find FastTimeDDDConstants\n";
86  }
87 #ifdef EDM_ML_DEBUG
88  edm::LogVerbatim("FastTimerSD") << "FastTimerSD::Initialized with FastTimeDDDConstants\n";
89 #endif
90 }
const FastTimeDDDConstants * ftcons
Definition: FastTimerSD.h:39
T get() const
Definition: EventSetup.h:73

Member Data Documentation

const FastTimeDDDConstants* FastTimerSD::ftcons
private

Definition at line 39 of file FastTimerSD.h.

Referenced by setDetUnitId(), and update().

int FastTimerSD::type_
private