CMS 3D CMS Logo

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

#include <HFNoseSD.h>

Inheritance diagram for HFNoseSD:
CaloSD Observer< const BeginOfJob * > SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

 HFNoseSD (const std::string &, const HGCalDDDConstants *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
uint32_t setDetUnitId (const G4Step *step) override
 
 ~HFNoseSD () override=default
 
- Public Member Functions inherited from CaloSD
 CaloSD (const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
 
void clear () override
 
void clearHits () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PCaloHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
bool isItFineCalo (const G4VTouchable *touch)
 
void PrintAll () override
 
bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *) override
 
G4bool ProcessHits (G4Step *step, G4TouchableHistory *) override
 
void reset () override
 
 ~CaloSD () override
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (const std::string &iname, const SensitiveDetectorCatalog &clg)
 
- 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 SensitiveDetectorCatalog &, bool calo)
 
 ~SensitiveDetector () override
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun * 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 BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob * iT)
 
virtual ~Observer ()
 

Protected Member Functions

bool filterHit (CaloG4Hit *, double) override
 
double getEnergyDeposit (const G4Step *) override
 
void initRun () override
 
void update (const ::EndOfEvent *) override
 
void update (const BeginOfEvent *) override
 
void update (const BeginOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *) override
 
void update (const BeginOfTrack *trk) override
 
void update (const EndOfTrack *trk) override
 
- Protected Member Functions inherited from CaloSD
bool checkHit ()
 
CaloG4HitcreateNewHit (const G4Step *, const G4Track *)
 
virtual void endEvent ()
 
virtual double EnergyCorrected (const G4Step &step, const G4Track *)
 
double getAttenuation (const G4Step *aStep, double birk1, double birk2, double birk3) const
 
virtual uint16_t getDepth (const G4Step *)
 
virtual bool getFromLibrary (const G4Step *step)
 
int getNumberOfHits ()
 
double getResponseWt (const G4Track *)
 
virtual int getTrackID (const G4Track *)
 
void hitBookkeepingFineCalo (const G4Step *step, const G4Track *currentTrack, CaloG4Hit *hit)
 
bool hitExists (const G4Step *)
 
void ignoreRejection ()
 
virtual void initEvent (const BeginOfEvent *)
 
void printDetectorLevels (const G4VTouchable *) const
 
void processHit (const G4Step *step)
 
void resetForNewPrimary (const G4Step *)
 
void setNumberCheckedHits (int val)
 
void setParameterized (bool val)
 
G4ThreeVector setToGlobal (const G4ThreeVector &, const G4VTouchable *) const
 
G4ThreeVector setToLocal (const G4ThreeVector &, const G4VTouchable *) const
 
virtual int setTrackID (const G4Step *)
 
void setUseMap (bool val)
 
void update (const ::EndOfEvent *) override
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void updateHit (CaloG4Hit *)
 
- 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 > &)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 

Private Member Functions

bool isItinFidVolume (const G4ThreeVector &)
 
uint32_t setDetUnitId (int, int, int, int, G4ThreeVector &)
 

Private Attributes

std::vector< double > angles_
 
int cornerMinMask_
 
double distanceFromEdge_
 
double eminHit_
 
bool fiducialCut_
 
HGCalGeometryMode::GeometryMode geom_mode_
 
const HGCalDDDConstantshgcons_
 
int levelT1_
 
int levelT2_
 
std::unique_ptr< HGCMouseBitemouseBite_
 
double mouseBiteCut_
 
std::string nameX_
 
std::unique_ptr< HFNoseNumberingSchemenumberingScheme_
 
bool rejectMB_
 
double slopeMin_
 
bool storeAllG4Hits_
 
const double tan30deg_
 
bool waferRot_
 
double weight_
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Static Protected Member Functions inherited from CaloSD
static std::string printableDecayChain (const std::vector< unsigned int > &decayChain)
 
- Protected Attributes inherited from CaloSD
CaloG4HitcurrentHit
 
CaloHitID currentID
 
float edepositEM
 
float edepositHAD
 
double eminHit
 
double energyCut
 
G4ThreeVector entranceLocal
 
G4ThreeVector entrancePoint
 
bool forceSave
 
float incidentEnergy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
G4ThreeVector posGlobal
 
CaloHitID previousID
 
bool suppressHeavy
 
double tmaxHit
 

Detailed Description

Definition at line 20 of file HFNoseSD.h.

Constructor & Destructor Documentation

◆ HFNoseSD()

HFNoseSD::HFNoseSD ( const std::string &  name,
const HGCalDDDConstants hgc,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 27 of file HFNoseSD.cc.

32  : CaloSD(name,
33  clg,
34  p,
35  manager,
36  (float)(p.getParameter<edm::ParameterSet>("HFNoseSD").getParameter<double>("TimeSliceUnit")),
37  p.getParameter<edm::ParameterSet>("HFNoseSD").getParameter<bool>("IgnoreTrackID")),
38  hgcons_(hgc),
39  slopeMin_(0),
40  levelT1_(99),
41  levelT2_(99),
42  tan30deg_(std::tan(30.0 * CLHEP::deg)) {
43  numberingScheme_.reset(nullptr);
44  mouseBite_.reset(nullptr);
45 
46  edm::ParameterSet m_HFN = p.getParameter<edm::ParameterSet>("HFNoseSD");
47  eminHit_ = m_HFN.getParameter<double>("EminHit") * CLHEP::MeV;
48  fiducialCut_ = m_HFN.getParameter<bool>("FiducialCut");
49  distanceFromEdge_ = m_HFN.getParameter<double>("DistanceFromEdge");
50  storeAllG4Hits_ = m_HFN.getParameter<bool>("StoreAllG4Hits");
51  rejectMB_ = m_HFN.getParameter<bool>("RejectMouseBite");
52  waferRot_ = m_HFN.getParameter<bool>("RotatedWafer");
53  cornerMinMask_ = m_HFN.getParameter<int>("CornerMinMask");
54  angles_ = m_HFN.getUntrackedParameter<std::vector<double>>("WaferAngles");
55 
56  nameX_ = ((name.find("HFNoseHits") != std::string::npos) ? "HGCalHFNoseSensitive" : "HFNoseSensitive");
57 
58  if (storeAllG4Hits_) {
59  setUseMap(false);
61  }
62 
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HFNSim") << "**************************************************"
65  << "\n"
66  << "* *"
67  << "\n"
68  << "* Constructing a HFNoseSD with name " << name << "\n"
69  << "* *"
70  << "\n"
71  << "**************************************************";
72 #endif
73  edm::LogVerbatim("HFNSim") << "HFNoseSD:: Threshold for storing hits: " << eminHit_ << " for " << name;
74  edm::LogVerbatim("HFNSim") << "Flag for storing individual Geant4 Hits " << storeAllG4Hits_;
75  edm::LogVerbatim("HFNSim") << "Fiducial volume cut with cut from eta/phi "
76  << "boundary " << fiducialCut_ << " at " << distanceFromEdge_;
77  edm::LogVerbatim("HFNSim") << "Reject MosueBite Flag: " << rejectMB_ << " cuts along " << angles_.size()
78  << " axes: " << angles_[0] << ", " << angles_[1];
79 }

References angles_, cornerMinMask_, distanceFromEdge_, eminHit_, fiducialCut_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), MeV, mouseBite_, Skims_PA_cff::name, nameX_, numberingScheme_, AlCaHLTBitMon_ParallelJobs::p, rejectMB_, CaloSD::setNumberCheckedHits(), CaloSD::setUseMap(), storeAllG4Hits_, and waferRot_.

◆ ~HFNoseSD()

HFNoseSD::~HFNoseSD ( )
overridedefault

Member Function Documentation

◆ filterHit()

bool HFNoseSD::filterHit ( CaloG4Hit aHit,
double  time 
)
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 197 of file HFNoseSD.cc.

197  {
198  return ((time <= tmaxHit) && (aHit->getEnergyDeposit() > eminHit_));
199 }

References eminHit_, CaloG4Hit::getEnergyDeposit(), protons_cff::time, and CaloSD::tmaxHit.

◆ getEnergyDeposit()

double HFNoseSD::getEnergyDeposit ( const G4Step *  aStep)
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 81 of file HFNoseSD.cc.

81  {
82  double r = aStep->GetPreStepPoint()->GetPosition().perp();
83  double z = std::abs(aStep->GetPreStepPoint()->GetPosition().z());
84 #ifdef EDM_ML_DEBUG
85  G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
86  G4String parName = aStep->GetTrack()->GetDefinition()->GetParticleName();
87  G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
88  edm::LogVerbatim("HFNSim") << "HFNoseSD: Hit from standard path from " << lv->GetName() << " for Track "
89  << aStep->GetTrack()->GetTrackID() << " (" << parCode << ":" << parName << ") R = " << r
90  << " Z = " << z << " slope = " << r / z << ":" << slopeMin_;
91 #endif
92  // Apply fiducial cut
93  if (r < z * slopeMin_) {
94 #ifdef EDM_ML_DEBUG
95  edm::LogVerbatim("HFNSim") << "HFNoseSD: Fiducial Volume cut";
96 #endif
97  return 0.0;
98  }
99 
100  double wt1 = getResponseWt(aStep->GetTrack());
101  double wt2 = aStep->GetTrack()->GetWeight();
102  double destep = weight_ * wt1 * (aStep->GetTotalEnergyDeposit());
103  if (wt2 > 0)
104  destep *= wt2;
105 #ifdef EDM_ML_DEBUG
106  edm::LogVerbatim("HFNSim") << "HFNoseSD: weights= " << weight_ << ":" << wt1 << ":" << wt2 << " Total weight "
107  << weight_ * wt1 * wt2 << " deStep: " << aStep->GetTotalEnergyDeposit() << ":" << destep;
108 #endif
109  return destep;
110 }

References funct::abs(), CaloSD::getResponseWt(), alignCSCRings::r, slopeMin_, weight_, and z.

◆ initRun()

void HFNoseSD::initRun ( )
overrideprotectedvirtual

Reimplemented from CaloSD.

Definition at line 195 of file HFNoseSD.cc.

195 {}

◆ isItinFidVolume()

bool HFNoseSD::isItinFidVolume ( const G4ThreeVector &  pos)
private

Definition at line 210 of file HFNoseSD.cc.

210  {
211  if (fiducialCut_) {
212  return (hgcons_->distFromEdgeHex(pos.x(), pos.y(), pos.z()) > distanceFromEdge_);
213  } else {
214  return true;
215  }
216 }

References distanceFromEdge_, HGCalDDDConstants::distFromEdgeHex(), fiducialCut_, and hgcons_.

◆ setDetUnitId() [1/2]

uint32_t HFNoseSD::setDetUnitId ( const G4Step *  step)
overridevirtual

Implements CaloSD.

Definition at line 112 of file HFNoseSD.cc.

112  {
113  const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
114  const G4VTouchable* touch = preStepPoint->GetTouchable();
115 
116  //determine the exact position in global coordinates in the mass geometry
117  G4ThreeVector hitPoint = preStepPoint->GetPosition();
118  float globalZ = touch->GetTranslation(0).z();
119  int iz(globalZ > 0 ? 1 : -1);
120 
121  int layer, module, cell;
122  if ((touch->GetHistoryDepth() == levelT1_) || (touch->GetHistoryDepth() == levelT2_)) {
123  layer = touch->GetReplicaNumber(0);
124  module = -1;
125  cell = -1;
126 #ifdef EDM_ML_DEBUG
127  edm::LogVerbatim("HFNSim") << "DepthsTop: " << touch->GetHistoryDepth() << ":" << levelT1_ << ":" << levelT2_
128  << " name " << touch->GetVolume(0)->GetName() << " layer:module:cell " << layer << ":"
129  << module << ":" << cell;
130 #endif
131  } else {
132  layer = touch->GetReplicaNumber(3);
133  module = touch->GetReplicaNumber(2);
134  cell = touch->GetReplicaNumber(1);
135 #ifdef EDM_ML_DEBUG
136  edm::LogVerbatim("HFNSim") << "DepthsInside: " << touch->GetHistoryDepth() << " name "
137  << touch->GetVolume(0)->GetName() << " layer:module:cell " << layer << ":" << module
138  << ":" << cell;
139 #endif
140  }
141 #ifdef EDM_ML_DEBUG
142  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
143  edm::LogVerbatim("HFNSim") << "Depths: " << touch->GetHistoryDepth() << " name " << touch->GetVolume(0)->GetName()
144  << ":" << touch->GetReplicaNumber(0) << " " << touch->GetVolume(1)->GetName() << ":"
145  << touch->GetReplicaNumber(1) << " " << touch->GetVolume(2)->GetName() << ":"
146  << touch->GetReplicaNumber(2) << " " << touch->GetVolume(3)->GetName() << ":"
147  << touch->GetReplicaNumber(3) << " " << touch->GetVolume(4)->GetName() << ":"
148  << touch->GetReplicaNumber(4) << " "
149  << " layer:module:cell " << layer << ":" << module << ":" << cell << " Material "
150  << mat->GetName() << ":" << mat->GetRadlen();
151 #endif
152  // The following statement should be examined later before elimination
153  if (aStep->GetPreStepPoint()->GetMaterial()->GetRadlen() > 100000.)
154  return 0;
155 
156  uint32_t id = setDetUnitId(layer, module, cell, iz, hitPoint);
157  if (rejectMB_ && id != 0) {
158  auto uv = HFNoseDetId(id).waferUV();
159 #ifdef EDM_ML_DEBUG
160  edm::LogVerbatim("HFNSim") << "ID " << std::hex << id << std::dec << " " << HFNoseDetId(id);
161 #endif
162  if (mouseBite_->exclude(hitPoint, iz, uv.first, uv.second)) {
163  id = 0;
164 #ifdef EDM_ML_DEBUG
165  edm::LogVerbatim("HFNSim") << "Rejected by mousebite cutoff *****";
166 #endif
167  }
168  }
169  return id;
170 }

References TauDecayModes::dec, triggerObjects_cff::id, phase1PixelTopology::layer, levelT1_, levelT2_, callgraph::module, mouseBite_, rejectMB_, and HFNoseDetId::waferUV().

◆ setDetUnitId() [2/2]

uint32_t HFNoseSD::setDetUnitId ( int  layer,
int  module,
int  cell,
int  iz,
G4ThreeVector &  pos 
)
private

Definition at line 201 of file HFNoseSD.cc.

201  {
202  uint32_t id = numberingScheme_ ? numberingScheme_->getUnitID(layer, module, cell, iz, pos, weight_) : 0;
203  if (cornerMinMask_ > 2) {
205  id = 0;
206  }
207  return id;
208 }

References cornerMinMask_, hgcons_, triggerObjects_cff::id, phase1PixelTopology::layer, HGCalDDDConstants::maskCell(), callgraph::module, numberingScheme_, and weight_.

◆ update() [1/6]

void CaloSD::update
overrideprotected

Definition at line 741 of file CaloSD.cc.

741  {
742  endEvent();
743  slave.get()->ReserveMemory(theHC->entries());
744 
745  int count(0);
746  int wrong(0);
747  double eEM(0.0);
748  double eHAD(0.0);
749  double eEM2(0.0);
750  double eHAD2(0.0);
751  double tt(0.0);
752  double zloc(0.0);
753  double zglob(0.0);
754  double ee(0.0);
755  int hc_entries = theHC->entries();
756  for (int i = 0; i < hc_entries; ++i) {
757  if (!saveHit((*theHC)[i])) {
758  ++wrong;
759  }
760  ++count;
761  double x = (*theHC)[i]->getEM();
762  eEM += x;
763  eEM2 += x * x;
764  x = (*theHC)[i]->getHadr();
765  eHAD += x;
766  eHAD2 += x * x;
767  tt += (*theHC)[i]->getTimeSlice();
768  ee += (*theHC)[i]->getIncidentEnergy();
769  zglob += std::abs((*theHC)[i]->getEntry().z());
770  zloc += std::abs((*theHC)[i]->getEntryLocal().z());
771  }
772 
773  double norm = (count > 0) ? 1.0 / count : 0.0;
774  eEM *= norm;
775  eEM2 *= norm;
776  eHAD *= norm;
777  eHAD2 *= norm;
778  eEM2 = std::sqrt(eEM2 - eEM * eEM);
779  eHAD2 = std::sqrt(eHAD2 - eHAD * eHAD);
780  tt *= norm;
781  ee *= norm;
782  zglob *= norm;
783  zloc *= norm;
784 
785 #ifdef EDM_ML_DEBUG
786  edm::LogVerbatim("CaloSim") << "CaloSD: " << GetName() << " store " << count << " hits; " << wrong
787  << " track IDs not given properly and " << totalHits - count
788  << " hits not passing cuts\n EmeanEM= " << eEM << " ErmsEM= " << eEM2
789  << "\n EmeanHAD= " << eHAD << " ErmsHAD= " << eHAD2 << " TimeMean= " << tt
790  << " E0mean= " << ee << " Zglob= " << zglob << " Zloc= " << zloc << " ";
791 #endif
792  tkMap.erase(tkMap.begin(), tkMap.end());
793  std::vector<std::unique_ptr<CaloG4Hit>>().swap(reusehit);
794  if (useMap)
795  hitMap.erase(hitMap.begin(), hitMap.end());
796 }

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

◆ update() [2/6]

void CaloSD::update
overrideprotected

Definition at line 707 of file CaloSD.cc.

707  {
708 #ifdef EDM_ML_DEBUG
709  edm::LogVerbatim("CaloSim") << "CaloSD: Dispatched BeginOfEvent for " << GetName() << " !";
710 #endif
711  clearHits();
712  initEvent(g4Event);
713 }

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

◆ update() [3/6]

void HFNoseSD::update ( const BeginOfJob )
overrideprotectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 172 of file HFNoseSD.cc.

172  {
173  if (hgcons_ != nullptr) {
176  levelT1_ = hgcons_->levelTop(0);
177  levelT2_ = hgcons_->levelTop(1);
178  double waferSize = hgcons_->waferSize(false);
179  double mouseBite = hgcons_->mouseBite(false);
180  mouseBiteCut_ = waferSize * tan30deg_ - mouseBite;
181 #ifdef EDM_ML_DEBUG
182  edm::LogVerbatim("HFNSim") << "HFNoseSD::Initialized with mode " << geom_mode_ << " Slope cut " << slopeMin_
183  << " top Level " << levelT1_ << ":" << levelT2_ << " wafer " << waferSize << ":"
184  << mouseBite;
185 #endif
186 
187  numberingScheme_ = std::make_unique<HFNoseNumberingScheme>(*hgcons_);
188  if (rejectMB_)
189  mouseBite_ = std::make_unique<HGCMouseBite>(*hgcons_, angles_, mouseBiteCut_, waferRot_);
190  } else {
191  throw cms::Exception("Unknown", "HFNoseSD") << "Cannot find HGCalDDDConstants for " << nameX_ << "\n";
192  }
193 }

References angles_, Exception, geom_mode_, HGCalDDDConstants::geomMode(), hgcons_, levelT1_, levelT2_, HGCalDDDConstants::levelTop(), HGCalDDDConstants::minSlope(), HGCalDDDConstants::mouseBite(), mouseBite_, mouseBiteCut_, nameX_, numberingScheme_, rejectMB_, slopeMin_, tan30deg_, waferRot_, and HGCalDDDConstants::waferSize().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

◆ update() [4/6]

void CaloSD::update
overrideprotected

◆ update() [5/6]

void CaloSD::update
overrideprotected

Definition at line 963 of file CaloSD.cc.

963  {
964  int primary = -1;
965  TrackInformation* trkInfo = cmsTrackInformation((*trk)());
966  if (trkInfo->isPrimary())
967  primary = (*trk)()->GetTrackID();
968 
969 #ifdef EDM_ML_DEBUG
970  edm::LogVerbatim("CaloSim") << "New track: isPrimary " << trkInfo->isPrimary() << " primary ID = " << primary
971  << " primary ancestor ID " << primAncestor;
972 #endif
973 
974  // update the information if a different primary track ID
975 
976  if (primary > 0 && primary != primAncestor) {
977  primAncestor = primary;
978 
979  // clean the hits information
980 
981  if (theHC->entries() > 0)
983  }
984 }

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

◆ update() [6/6]

void CaloSD::update
overrideprotected

Definition at line 715 of file CaloSD.cc.

715  {
716  int id = (*trk)()->GetTrackID();
717  TrackInformation* trkI = cmsTrackInformation((*trk)());
718  int lastTrackID = -1;
719  if (trkI)
720  lastTrackID = trkI->getIDonCaloSurface();
721  if (id == lastTrackID) {
722  const TrackContainer* trksForThisEvent = m_trackManager->trackContainer();
723  if (trksForThisEvent != nullptr) {
724  int it = (int)(trksForThisEvent->size()) - 1;
725  if (it >= 0) {
726  TrackWithHistory* trkH = (*trksForThisEvent)[it];
727  if (trkH->trackID() == (unsigned int)(id))
728  tkMap[id] = trkH;
729 #ifdef EDM_ML_DEBUG
730  edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
731  << trksForThisEvent->size() << " with ID " << trkH->trackID();
732  } else {
733  edm::LogVerbatim("CaloSim") << "CaloSD: get track " << it << " from Container of size "
734  << trksForThisEvent->size() << " with no ID";
735 #endif
736  }
737  }
738  }
739 }

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ angles_

std::vector<double> HFNoseSD::angles_
private

Definition at line 53 of file HFNoseSD.h.

Referenced by HFNoseSD(), and update().

◆ cornerMinMask_

int HFNoseSD::cornerMinMask_
private

Definition at line 49 of file HFNoseSD.h.

Referenced by HFNoseSD(), and setDetUnitId().

◆ distanceFromEdge_

double HFNoseSD::distanceFromEdge_
private

Definition at line 48 of file HFNoseSD.h.

Referenced by HFNoseSD(), and isItinFidVolume().

◆ eminHit_

double HFNoseSD::eminHit_
private

Definition at line 47 of file HFNoseSD.h.

Referenced by filterHit(), and HFNoseSD().

◆ fiducialCut_

bool HFNoseSD::fiducialCut_
private

Definition at line 51 of file HFNoseSD.h.

Referenced by HFNoseSD(), and isItinFidVolume().

◆ geom_mode_

HGCalGeometryMode::GeometryMode HFNoseSD::geom_mode_
private

Definition at line 46 of file HFNoseSD.h.

Referenced by update().

◆ hgcons_

const HGCalDDDConstants* HFNoseSD::hgcons_
private

Definition at line 42 of file HFNoseSD.h.

Referenced by isItinFidVolume(), setDetUnitId(), and update().

◆ levelT1_

int HFNoseSD::levelT1_
private

Definition at line 49 of file HFNoseSD.h.

Referenced by setDetUnitId(), and update().

◆ levelT2_

int HFNoseSD::levelT2_
private

Definition at line 49 of file HFNoseSD.h.

Referenced by setDetUnitId(), and update().

◆ mouseBite_

std::unique_ptr<HGCMouseBite> HFNoseSD::mouseBite_
private

Definition at line 44 of file HFNoseSD.h.

Referenced by HFNoseSD(), setDetUnitId(), and update().

◆ mouseBiteCut_

double HFNoseSD::mouseBiteCut_
private

Definition at line 48 of file HFNoseSD.h.

Referenced by update().

◆ nameX_

std::string HFNoseSD::nameX_
private

Definition at line 45 of file HFNoseSD.h.

Referenced by HFNoseSD(), and update().

◆ numberingScheme_

std::unique_ptr<HFNoseNumberingScheme> HFNoseSD::numberingScheme_
private

Definition at line 43 of file HFNoseSD.h.

Referenced by HFNoseSD(), setDetUnitId(), and update().

◆ rejectMB_

bool HFNoseSD::rejectMB_
private

Definition at line 51 of file HFNoseSD.h.

Referenced by HFNoseSD(), setDetUnitId(), and update().

◆ slopeMin_

double HFNoseSD::slopeMin_
private

Definition at line 47 of file HFNoseSD.h.

Referenced by getEnergyDeposit(), and update().

◆ storeAllG4Hits_

bool HFNoseSD::storeAllG4Hits_
private

Definition at line 50 of file HFNoseSD.h.

Referenced by HFNoseSD().

◆ tan30deg_

const double HFNoseSD::tan30deg_
private

Definition at line 52 of file HFNoseSD.h.

Referenced by update().

◆ waferRot_

bool HFNoseSD::waferRot_
private

Definition at line 51 of file HFNoseSD.h.

Referenced by HFNoseSD(), and update().

◆ weight_

double HFNoseSD::weight_
private

Definition at line 47 of file HFNoseSD.h.

Referenced by getEnergyDeposit(), and setDetUnitId().

CaloSD::tkMap
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:185
HFNoseSD::angles_
std::vector< double > angles_
Definition: HFNoseSD.h:53
HFNoseSD::numberingScheme_
std::unique_ptr< HFNoseNumberingScheme > numberingScheme_
Definition: HFNoseSD.h:43
HFNoseSD::initRun
void initRun() override
Definition: HFNoseSD.cc:195
CaloSD::tmaxHit
double tmaxHit
Definition: CaloSD.h:141
mps_fire.i
i
Definition: mps_fire.py:428
TrackInformation::getIDonCaloSurface
int getIDonCaloSurface() const
Definition: TrackInformation.h:43
CaloSD::saveHit
bool saveHit(CaloG4Hit *)
Definition: CaloSD.cc:895
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
HFNoseSD::distanceFromEdge_
double distanceFromEdge_
Definition: HFNoseSD.h:48
HGCalDDDConstants::geomMode
HGCalGeometryMode::GeometryMode geomMode() const
Definition: HGCalDDDConstants.h:54
edm::swap
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
TrackWithHistory
Definition: TrackWithHistory.h:16
pos
Definition: PixelAliasList.h:18
HFNoseSD::storeAllG4Hits_
bool storeAllG4Hits_
Definition: HFNoseSD.h:50
protons_cff.time
time
Definition: protons_cff.py:35
MeV
const double MeV
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
HFNoseSD::levelT1_
int levelT1_
Definition: HFNoseSD.h:49
HFNoseDetId
Definition: HFNoseDetId.h:22
HFNoseSD::fiducialCut_
bool fiducialCut_
Definition: HFNoseSD.h:51
HFNoseSD::mouseBiteCut_
double mouseBiteCut_
Definition: HFNoseSD.h:48
hgc_digi
Definition: HGCDigitizerTypes.h:10
CaloSD::getResponseWt
double getResponseWt(const G4Track *)
Definition: CaloSD.cc:874
DetId
Definition: DetId.h:17
HFNoseSD::weight_
double weight_
Definition: HFNoseSD.h:47
HFNoseSD::rejectMB_
bool rejectMB_
Definition: HFNoseSD.h:51
HFNoseSD::cornerMinMask_
int cornerMinMask_
Definition: HFNoseSD.h:49
CaloSD::useMap
bool useMap
Definition: CaloSD.h:168
TrackInformation::isPrimary
bool isPrimary() const
Definition: TrackInformation.h:27
HFNoseSD::waferRot_
bool waferRot_
Definition: HFNoseSD.h:51
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CaloG4Hit::getEnergyDeposit
double getEnergyDeposit() const
Definition: CaloG4Hit.h:78
DDAxes::z
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
CaloSD::clearHits
void clearHits() override
Definition: CaloSD.cc:798
HFNoseSD::geom_mode_
HGCalGeometryMode::GeometryMode geom_mode_
Definition: HFNoseSD.h:46
HGCalDDDConstants::mouseBite
double mouseBite(bool reco) const
Definition: HGCalDDDConstants.cc:897
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HFNoseDetId::waferUV
std::pair< int, int > waferUV() const
Definition: HFNoseDetId.h:81
edm::ParameterSet
Definition: ParameterSet.h:47
CaloSD::hitMap
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:184
HFNoseSD::levelT2_
int levelT2_
Definition: HFNoseSD.h:49
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloSD::theHC
CaloG4HitCollection * theHC
Definition: CaloSD.h:163
CaloSD::totalHits
int totalHits
Definition: CaloSD.h:174
HFNoseSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *step) override
Definition: HFNoseSD.cc:112
CaloSD::slave
std::unique_ptr< CaloSlaveSD > slave
Definition: CaloSD.h:160
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TrackInformation
Definition: TrackInformation.h:12
createfilelist.int
int
Definition: createfilelist.py:10
HFNoseSD::tan30deg_
const double tan30deg_
Definition: HFNoseSD.h:52
CaloSD::CaloSD
CaloSD(const std::string &aSDname, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, float timeSlice=1., bool ignoreTkID=false)
Definition: CaloSD.cc:34
CaloSD::setNumberCheckedHits
void setNumberCheckedHits(int val)
Definition: CaloSD.h:119
CaloSD::reusehit
std::vector< std::unique_ptr< CaloG4Hit > > reusehit
Definition: CaloSD.h:186
HFNoseSD::mouseBite_
std::unique_ptr< HGCMouseBite > mouseBite_
Definition: HFNoseSD.h:44
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HFNoseSD::nameX_
std::string nameX_
Definition: HFNoseSD.h:45
callgraph.module
module
Definition: callgraph.py:61
CaloSD::m_trackManager
const SimTrackManager * m_trackManager
Definition: CaloSD.h:158
HGCalDDDConstants::minSlope
double minSlope() const
Definition: HGCalDDDConstants.h:97
TrackWithHistory::trackID
unsigned int trackID() const
Definition: TrackWithHistory.h:28
TrackContainer
std::vector< TrackWithHistory * > TrackContainer
Definition: TrackContainer.h:8
SensitiveDetector::cmsTrackInformation
TrackInformation * cmsTrackInformation(const G4Track *aTrack)
Definition: SensitiveDetector.cc:92
CaloSD::cleanHitCollection
void cleanHitCollection()
Definition: CaloSD.cc:986
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
CaloSD::primAncestor
int primAncestor
Definition: CaloSD.h:172
Exception
Definition: hltDiff.cc:245
HFNoseSD::hgcons_
const HGCalDDDConstants * hgcons_
Definition: HFNoseSD.h:42
HFNoseSD::eminHit_
double eminHit_
Definition: HFNoseSD.h:47
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
HGCalDDDConstants::distFromEdgeHex
double distFromEdgeHex(double x, double y, double z) const
Definition: HGCalDDDConstants.cc:280
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HFNoseSD::slopeMin_
double slopeMin_
Definition: HFNoseSD.h:47
HGCalDDDConstants::levelTop
int levelTop(int ind=0) const
Definition: HGCalDDDConstants.h:89
CaloSD::setUseMap
void setUseMap(bool val)
Definition: CaloSD.h:108
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::roottree::getEntry
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:515
CaloSD::initEvent
virtual void initEvent(const BeginOfEvent *)
Definition: CaloSD.cc:817
HGCalDDDConstants::waferSize
double waferSize(bool reco) const
Definition: HGCalDDDConstants.h:183
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
HGCalDDDConstants::maskCell
bool maskCell(const DetId &id, int corners) const
Definition: HGCalDDDConstants.cc:764
SimTrackManager::trackContainer
const TrackContainer * trackContainer() const
Definition: SimTrackManager.h:52
CaloSD::endEvent
virtual void endEvent()
Definition: CaloSD.cc:819