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 DDCompactView &, 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 DDCompactView &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
 
 ~TimingSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (const std::string &iname, const DDCompactView &cpv, 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
 
 SensitiveDetector (const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
 ~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 DDCompactView cpv,
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(), getDDDArray(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), DDFilteredView::mergedSpecifics(), TimingSD::setTimeFactor(), AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, groupFilesInBlocks::temp, and type_.

33  :
34  TimingSD(name, cpv, clg, p, manager), ftcons(nullptr) {
35 
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 
42  std::string attribute = "ReadOutName";
44  DDFilteredView fv(cpv,filter);
45  fv.firstChild();
46  DDsvalues_type sv(fv.mergedSpecifics());
47  std::vector<int> temp = dbl_to_int(getDDDArray("Type",sv));
48  type_ = temp[0];
49 
50  setTimeFactor(100.);
51 
52  edm::LogInfo("FastTimerSim") << "FastTimerSD: Instantiation completed for "
53  << name << " of type " << type_;
54 }
T getUntrackedParameter(std::string const &, T const &) const
void setTimeFactor(double)
Definition: TimingSD.cc:77
const FastTimeDDDConstants * ftcons
Definition: FastTimerSD.h:42
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
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: FastTimerSD.cc:97
TimingSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, const edm::ParameterSet &, const SimTrackManager *)
Definition: TimingSD.cc:40
FastTimerSD::~FastTimerSD ( )
override

Definition at line 56 of file FastTimerSD.cc.

56  {
57 }

Member Function Documentation

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

Definition at line 97 of file FastTimerSD.cc.

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

Referenced by FastTimerSD().

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

Implements SensitiveDetector.

Definition at line 59 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_.

59  {
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) ?
66  (ftcons->getZPhi(std::abs(local.z()),local.phi())) :
67  (ftcons->getEtaPhi(local.perp(),local.phi()))) :
68  (std::pair<int,int>(0,0)));
69  uint32_t id = FastTimeDetId(type_,izphi.first,izphi.second,iz).rawId();
70 #ifdef EDM_ML_DEBUG
71  edm::LogVerbatim("FastTimerSD")
72  << "Volume " << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()
73  << ": " << global.z()
74  << " Iz(eta)phi " << izphi.first << ":" << izphi.second << ":"
75  << iz << " id " << std::hex << id << std::dec;
76 #endif
77  return id;
78 }
std::pair< int, int > getEtaPhi(double r, double phi) const
const G4ThreeVector & getLocalEntryPoint() const
Definition: TimingSD.h:69
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
const FastTimeDDDConstants * ftcons
Definition: FastTimerSD.h:42
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:70
void FastTimerSD::update ( const BeginOfJob )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 80 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().

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

Member Data Documentation

const FastTimeDDDConstants* FastTimerSD::ftcons
private

Definition at line 42 of file FastTimerSD.h.

Referenced by setDetUnitId(), and update().

int FastTimerSD::type_
private