CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
CaloTrkProcessing Class Reference

#include <CaloTrkProcessing.h>

Inheritance diagram for CaloTrkProcessing:
SensitiveCaloDetector Observer< const BeginOfEvent * > Observer< const G4Step * > SensitiveDetector

Classes

struct  Detector
 

Public Member Functions

 CaloTrkProcessing (const std::string &aSDname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *)
 
void clearHits () override
 
void EndOfEvent (G4HCofThisEvent *) override
 
void fillHits (edm::PCaloHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *) override
 
bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
uint32_t setDetUnitId (const G4Step *step) override
 
 ~CaloTrkProcessing () override
 
- Public Member Functions inherited from SensitiveCaloDetector
virtual void reset ()
 
 SensitiveCaloDetector (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 G4Step * >
 Observer ()
 
void slotForUpdate (const G4Step * iT)
 
virtual ~Observer ()
 

Private Member Functions

void detectorLevel (const G4VTouchable *, int &, int *, G4String *) const
 
int detLevels (const G4VTouchable *) const
 
G4LogicalVolume * detLV (const G4VTouchable *, int) const
 
int isItCalo (const G4VTouchable *, const std::vector< Detector > &)
 
int isItInside (const G4VTouchable *, int, int)
 
void update (const BeginOfEvent *evt) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

std::vector< Detectordetectors_
 
bool doFineCalo_
 
double eMin_
 
double eMinFine_
 
double eMinFinePhoton_
 
std::vector< DetectorfineDetectors_
 
int lastTrackID_
 
bool putHistory_
 
bool testBeam_
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- 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 > &)
 

Detailed Description

Definition at line 22 of file CaloTrkProcessing.h.

Constructor & Destructor Documentation

◆ CaloTrkProcessing()

CaloTrkProcessing::CaloTrkProcessing ( const std::string &  aSDname,
const edm::EventSetup es,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager  
)

Definition at line 25 of file CaloTrkProcessing.cc.

30  : SensitiveCaloDetector(name, es, clg, p), lastTrackID_(-1) {
31  //Initialise the parameter set
32  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("CaloTrkProcessing");
33  testBeam_ = m_p.getParameter<bool>("TestBeam");
34  eMin_ = m_p.getParameter<double>("EminTrack") * CLHEP::MeV;
35  putHistory_ = m_p.getParameter<bool>("PutHistory");
36  doFineCalo_ = m_p.getParameter<bool>("DoFineCalo");
37  eMinFine_ = m_p.getParameter<double>("EminFineTrack") * CLHEP::MeV;
38  eMinFinePhoton_ = m_p.getParameter<double>("EminFinePhoton") * CLHEP::MeV;
39 
40  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: Initailised with TestBeam = " << testBeam_ << " Emin = " << eMin_
41  << ":" << eMinFine_ << ":" << eMinFinePhoton_ << " MeV and Flags " << putHistory_
42  << " (History), " << doFineCalo_ << " (Special Calorimeter)";
43 
44  // Get pointers to HcalDDDConstant and HcalSimulationParameters
46  es.get<HcalParametersRcd>().get(csps);
47  if (csps.isValid()) {
48  const CaloSimulationParameters* csp = csps.product();
49 #ifdef EDM_ML_DEBUG
50  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->caloNames_.size() << " entries for caloNames:";
51  for (unsigned int i = 0; i < csp->caloNames_.size(); i++)
52  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->caloNames_[i];
53  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->levels_.size() << " entries for levels:";
54  for (unsigned int i = 0; i < csp->levels_.size(); i++)
55  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->levels_[i];
56  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->neighbours_.size() << " entries for neighbours:";
57  for (unsigned int i = 0; i < csp->neighbours_.size(); i++)
58  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->neighbours_[i];
59  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->insideNames_.size() << " entries for insideNames:";
60  for (unsigned int i = 0; i < csp->insideNames_.size(); i++)
61  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->insideNames_[i];
62  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->insideLevel_.size() << " entries for insideLevel:";
63  for (unsigned int i = 0; i < csp->insideLevel_.size(); i++)
64  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->insideLevel_[i];
65  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->fCaloNames_.size()
66  << " entries for fineCalorimeterNames:";
67  for (unsigned int i = 0; i < csp->fCaloNames_.size(); i++)
68  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->fCaloNames_[i];
69  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: " << csp->fLevels_.size()
70  << " entries for fineCalorimeterLevels:";
71  for (unsigned int i = 0; i < csp->fLevels_.size(); i++)
72  edm::LogVerbatim("CaloSim") << " (" << i << ") " << csp->fLevels_[i];
73 #endif
74 
75  if (csp->caloNames_.size() < csp->neighbours_.size()) {
76  edm::LogError("CaloSim") << "CaloTrkProcessing: # of Calorimeter bins " << csp->caloNames_.size()
77  << " does not match with " << csp->neighbours_.size() << " ==> illegal ";
78  throw cms::Exception("Unknown", "CaloTrkProcessing")
79  << "Calorimeter array size does not match with size of neighbours\n";
80  }
81 
82  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
83  std::vector<G4LogicalVolume*>::const_iterator lvcite;
84  int istart = 0;
85  for (unsigned int i = 0; i < csp->caloNames_.size(); i++) {
86  G4LogicalVolume* lv = nullptr;
87  G4String name = static_cast<G4String>(csp->caloNames_[i]);
88  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
89  if ((*lvcite)->GetName() == name) {
90  lv = (*lvcite);
91  break;
92  }
93  }
94  if (lv != nullptr) {
96  detector.name = name;
97  detector.lv = lv;
98  detector.level = csp->levels_[i];
99  if (istart + csp->neighbours_[i] > static_cast<int>(csp->insideNames_.size())) {
100  edm::LogError("CaloSim") << "CaloTrkProcessing: # of InsideNames bins " << csp->insideNames_.size()
101  << " too few compaerd to " << istart + csp->neighbours_[i]
102  << " requested ==> illegal ";
103  throw cms::Exception("Unknown", "CaloTrkProcessing")
104  << "InsideNames array size does not match with list of neighbours\n";
105  }
106  std::vector<std::string> inside;
107  std::vector<G4LogicalVolume*> insideLV;
108  std::vector<int> insideLevels;
109  for (int k = 0; k < csp->neighbours_[i]; k++) {
110  lv = nullptr;
111  name = static_cast<G4String>(csp->insideNames_[istart + k]);
112  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
113  if ((*lvcite)->GetName() == name) {
114  lv = (*lvcite);
115  break;
116  }
117  }
118  inside.push_back(name);
119  insideLV.push_back(lv);
120  insideLevels.push_back(csp->insideLevel_[istart + k]);
121  }
122  detector.fromDets = inside;
123  detector.fromDetL = insideLV;
124  detector.fromLevels = insideLevels;
125  detectors_.emplace_back(detector);
126  }
127  istart += csp->neighbours_[i];
128  }
129 
130  for (unsigned int i = 0; i < csp->fCaloNames_.size(); i++) {
131  G4LogicalVolume* lv = nullptr;
132  G4String name = static_cast<G4String>(csp->fCaloNames_[i]);
133  for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
134  if ((*lvcite)->GetName() == name) {
135  lv = (*lvcite);
136  break;
137  }
138  }
139  if (lv != nullptr) {
141  detector.name = name;
142  detector.lv = lv;
143  detector.level = csp->fLevels_[i];
144  detector.fromDets.clear();
145  detector.fromDetL.clear();
146  detector.fromLevels.clear();
147  fineDetectors_.emplace_back(detector);
148  }
149  }
150  } else {
151  edm::LogError("HcalSim") << "CaloTrkProcessing: Cannot find CaloSimulationParameters";
152  throw cms::Exception("Unknown", "CaloSD") << "Cannot find CaloSimulationParameters\n";
153  }
154 
155  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: with " << detectors_.size() << " calorimetric volumes";
156  for (unsigned int i = 0; i < detectors_.size(); i++) {
157  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: Calorimeter volume " << i << " " << detectors_[i].name << " LV "
158  << detectors_[i].lv << " at level " << detectors_[i].level << " with "
159  << detectors_[i].fromDets.size() << " neighbours";
160  for (unsigned int k = 0; k < detectors_[i].fromDets.size(); k++)
161  edm::LogVerbatim("CaloSim") << " Element " << k << " " << detectors_[i].fromDets[k] << " LV "
162  << detectors_[i].fromDetL[k] << " at level " << detectors_[i].fromLevels[k];
163  }
164 
165  doFineCalo_ = !(fineDetectors_.empty());
166  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: with " << fineDetectors_.size() << " special calorimetric volumes";
167  for (unsigned int i = 0; i < detectors_.size(); i++)
168  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: Calorimeter volume " << i << " " << detectors_[i].name << " LV "
169  << detectors_[i].lv << " at level " << detectors_[i].level;
170 }

References CaloSimulationParameters::caloNames_, hgcalTestNeighbor_cfi::detector, detectors_, doFineCalo_, eMin_, eMinFine_, eMinFinePhoton_, Exception, CaloSimulationParameters::fCaloNames_, fineDetectors_, CaloSimulationParameters::fLevels_, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), mps_fire::i, CaloSimulationParameters::insideLevel_, CaloSimulationParameters::insideNames_, edm::ESHandleBase::isValid(), dqmdumpme::k, CaloSimulationParameters::levels_, MeV, Skims_PA_cff::name, CaloSimulationParameters::neighbours_, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), putHistory_, and testBeam_.

◆ ~CaloTrkProcessing()

CaloTrkProcessing::~CaloTrkProcessing ( )
override

Definition at line 172 of file CaloTrkProcessing.cc.

172 {}

Member Function Documentation

◆ clearHits()

void CaloTrkProcessing::clearHits ( )
inlineoverridevirtual

Implements SensitiveDetector.

Definition at line 33 of file CaloTrkProcessing.h.

33 {}

◆ detectorLevel()

void CaloTrkProcessing::detectorLevel ( const G4VTouchable *  touch,
int &  level,
int *  copyno,
G4String *  name 
) const
private

Definition at line 375 of file CaloTrkProcessing.cc.

375  {
376  static const std::string unknown("Unknown");
377  //Get name and copy numbers
378  if (level > 0) {
379  for (int ii = 0; ii < level; ii++) {
380  int i = level - ii - 1;
381  G4VPhysicalVolume* pv = touch->GetVolume(i);
382  if (pv != nullptr)
383  name[ii] = pv->GetName();
384  else
385  name[ii] = unknown;
386  copyno[ii] = touch->GetReplicaNumber(i);
387  }
388  }
389 }

References mps_fire::i, cuy::ii, personalPlayback::level, Skims_PA_cff::name, MetAnalyzer::pv(), AlCaHLTBitMon_QueryRunRegistry::string, and susybsm::HSCParticleType::unknown.

Referenced by isItCalo(), and isItInside().

◆ detLevels()

int CaloTrkProcessing::detLevels ( const G4VTouchable *  touch) const
private

Definition at line 354 of file CaloTrkProcessing.cc.

354  {
355  //Return number of levels
356  if (touch)
357  return ((touch->GetHistoryDepth()) + 1);
358  else
359  return 0;
360 }

Referenced by isItCalo(), and isItInside().

◆ detLV()

G4LogicalVolume * CaloTrkProcessing::detLV ( const G4VTouchable *  touch,
int  currentlevel 
) const
private

Definition at line 362 of file CaloTrkProcessing.cc.

362  {
363  G4LogicalVolume* lv = nullptr;
364  if (touch) {
365  int level = ((touch->GetHistoryDepth()) + 1);
366  if (level > 0 && level >= currentlevel) {
367  int ii = level - currentlevel;
368  lv = touch->GetVolume(ii)->GetLogicalVolume();
369  return lv;
370  }
371  }
372  return lv;
373 }

References cuy::ii, and personalPlayback::level.

Referenced by isItCalo(), and isItInside().

◆ EndOfEvent()

void CaloTrkProcessing::EndOfEvent ( G4HCofThisEvent *  )
inlineoverride

Definition at line 36 of file CaloTrkProcessing.h.

36 {}

◆ fillHits()

void CaloTrkProcessing::fillHits ( edm::PCaloHitContainer ,
const std::string &   
)
inlineoverridevirtual

Implements SensitiveCaloDetector.

Definition at line 37 of file CaloTrkProcessing.h.

37 {}

◆ Initialize()

void CaloTrkProcessing::Initialize ( G4HCofThisEvent *  )
inlineoverride

Definition at line 32 of file CaloTrkProcessing.h.

32 {}

◆ isItCalo()

int CaloTrkProcessing::isItCalo ( const G4VTouchable *  touch,
const std::vector< Detector > &  detectors 
)
private

Definition at line 264 of file CaloTrkProcessing.cc.

264  {
265  int lastLevel = -1;
266  G4LogicalVolume* lv = nullptr;
267  for (unsigned int it = 0; it < detectors.size(); it++) {
268  if (lastLevel != detectors[it].level) {
269  lastLevel = detectors[it].level;
270  lv = detLV(touch, lastLevel);
271 #ifdef EDM_ML_DEBUG
272  std::string name1 = "Unknown";
273  if (lv != 0)
274  name1 = lv->GetName();
275  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: volume " << name1 << " at Level " << lastLevel;
276  int levels = detLevels(touch);
277  if (levels > 0) {
278  G4String name2[20];
279  int copyno2[20];
280  detectorLevel(touch, levels, copyno2, name2);
281  for (int i2 = 0; i2 < levels; i2++)
282  edm::LogVerbatim("CaloSim") << " " << i2 << " " << name2[i2] << " " << copyno2[i2];
283  }
284 #endif
285  }
286  bool ok = (lv == detectors[it].lv);
287  if (ok)
288  return it;
289  }
290  return -1;
291 }

References detectorLevel(), MuonGeometrySanityCheck_cfi::detectors(), detLevels(), detLV(), testProducerWithPsetDescEmpty_cfi::i2, personalPlayback::level, jets_cff::levels, hfnoseParametersInitialization_cfi::name2, convertSQLiteXML::ok, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by update().

◆ isItInside()

int CaloTrkProcessing::isItInside ( const G4VTouchable *  touch,
int  idcal,
int  idin 
)
private

Definition at line 293 of file CaloTrkProcessing.cc.

293  {
294  int lastLevel = -1;
295  G4LogicalVolume* lv = nullptr;
296  int id1, id2;
297  if (idcal < 0) {
298  id1 = 0;
299  id2 = static_cast<int>(detectors_.size());
300  } else {
301  id1 = idcal;
302  id2 = id1 + 1;
303  }
304  for (int it1 = id1; it1 < id2; it1++) {
305  if (idin < 0) {
306  for (unsigned int it2 = 0; it2 < detectors_[it1].fromDets.size(); it2++) {
307  if (lastLevel != detectors_[it1].fromLevels[it2]) {
308  lastLevel = detectors_[it1].fromLevels[it2];
309  lv = detLV(touch, lastLevel);
310 #ifdef EDM_ML_DEBUG
311  std::string name1 = "Unknown";
312  if (lv != 0)
313  name1 = lv->GetName();
314  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: volume " << name1 << " at Level " << lastLevel;
315  int levels = detLevels(touch);
316  if (levels > 0) {
317  G4String name2[20];
318  int copyno2[20];
319  detectorLevel(touch, levels, copyno2, name2);
320  for (int i2 = 0; i2 < levels; i2++)
321  edm::LogVerbatim("CaloSim") << " " << i2 << " " << name2[i2] << " " << copyno2[i2];
322  }
323 #endif
324  }
325  bool ok = (lv == detectors_[it1].fromDetL[it2]);
326  if (ok)
327  return it2;
328  }
329  } else {
330  lastLevel = detectors_[it1].fromLevels[idin];
331  lv = detLV(touch, lastLevel);
332 #ifdef EDM_ML_DEBUG
333  std::string name1 = "Unknown";
334  if (lv != 0)
335  name1 = lv->GetName();
336  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: volume " << name1 << " at Level " << lastLevel;
337  int levels = detLevels(touch);
338  if (levels > 0) {
339  G4String name2[20];
340  int copyno2[20];
341  detectorLevel(touch, levels, copyno2, name2);
342  for (int i2 = 0; i2 < levels; i2++)
343  edm::LogVerbatim("CaloSim") << " " << i2 << " " << name2[i2] << " " << copyno2[i2];
344  }
345 #endif
346  bool ok = (lv == detectors_[it1].fromDetL[idin]);
347  if (ok)
348  return idin;
349  }
350  }
351  return -1;
352 }

References detectorLevel(), detectors_, detLevels(), detLV(), testProducerWithPsetDescEmpty_cfi::i2, globals_cff::id1, globals_cff::id2, jets_cff::levels, hfnoseParametersInitialization_cfi::name2, convertSQLiteXML::ok, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by update().

◆ ProcessHits()

bool CaloTrkProcessing::ProcessHits ( G4Step *  ,
G4TouchableHistory *   
)
inlineoverridevirtual

Implements SensitiveDetector.

Definition at line 34 of file CaloTrkProcessing.h.

34 { return true; }

◆ setDetUnitId()

uint32_t CaloTrkProcessing::setDetUnitId ( const G4Step *  step)
inlineoverridevirtual

Implements SensitiveDetector.

Definition at line 35 of file CaloTrkProcessing.h.

35 { return 0; }

◆ update() [1/2]

void CaloTrkProcessing::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 174 of file CaloTrkProcessing.cc.

174 { lastTrackID_ = -1; }

References lastTrackID_.

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

◆ update() [2/2]

void CaloTrkProcessing::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 176 of file CaloTrkProcessing.cc.

176  {
177  // define if you are at the surface of CALO
178 
179  G4Track* theTrack = aStep->GetTrack();
180  int id = theTrack->GetTrackID();
181 
182  TrackInformation* trkInfo = dynamic_cast<TrackInformation*>(theTrack->GetUserInformation());
183 
184  if (trkInfo == nullptr) {
185  edm::LogError("CaloSim") << "CaloTrkProcessing: No trk info !!!! abort ";
186  throw cms::Exception("Unknown", "CaloTrkProcessing") << "cannot get trkInfo for Track " << id << "\n";
187  }
188 
189  if (testBeam_) {
190  if (trkInfo->getIDonCaloSurface() == 0) {
191 #ifdef EDM_ML_DEBUG
192  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing set IDonCaloSurface to " << id << " at step Number "
193  << theTrack->GetCurrentStepNumber();
194 #endif
195  trkInfo->setIDonCaloSurface(id, 0, 0, theTrack->GetDefinition()->GetPDGEncoding(), theTrack->GetMomentum().mag());
196  lastTrackID_ = id;
197  if (theTrack->GetKineticEnergy() / CLHEP::MeV > eMin_)
198  trkInfo->putInHistory();
199  }
200  } else {
201  if (putHistory_) {
202  trkInfo->putInHistory();
203  // trkInfo->setAncestor();
204  }
205 #ifdef EDM_ML_DEBUG
206  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing Entered for " << id << " at stepNumber "
207  << theTrack->GetCurrentStepNumber() << " IDonCaloSur.. "
208  << trkInfo->getIDonCaloSurface() << " CaloCheck " << trkInfo->caloIDChecked();
209 #endif
210  if (trkInfo->getIDonCaloSurface() != 0) {
211  if (trkInfo->caloIDChecked() == false) {
212  G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
213  const G4VTouchable* post_touch = postStepPoint->GetTouchable();
214 
215  if (isItInside(post_touch, trkInfo->getIDCaloVolume(), trkInfo->getIDLastVolume()) > 0) {
216  trkInfo->setIDonCaloSurface(0, -1, -1, 0, 0);
217  } else {
218  trkInfo->setCaloIDChecked(true);
219  }
220  }
221  } else {
222  G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
223  const G4VTouchable* post_touch = postStepPoint->GetTouchable();
224  int ical = isItCalo(post_touch, detectors_);
225  if (ical >= 0) {
226  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
227  const G4VTouchable* pre_touch = preStepPoint->GetTouchable();
228  int inside = isItInside(pre_touch, ical, -1);
229  if (inside >= 0 || (theTrack->GetCurrentStepNumber() == 1)) {
230  trkInfo->setIDonCaloSurface(
231  id, ical, inside, theTrack->GetDefinition()->GetPDGEncoding(), theTrack->GetMomentum().mag());
232  trkInfo->setCaloIDChecked(true);
233  lastTrackID_ = id;
234  if (theTrack->GetKineticEnergy() / CLHEP::MeV > eMin_)
235  trkInfo->putInHistory();
236 #ifdef EDM_ML_DEBUG
237  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: set ID on Calo " << ical << " surface (Inside " << inside
238  << ") to " << id << " of a Track with Kinetic Energy "
239  << theTrack->GetKineticEnergy() / CLHEP::MeV << " MeV";
240 #endif
241  }
242  }
243  }
244  }
245  if (doFineCalo_ && (!trkInfo->isInHistory())) {
246  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
247  if (isItCalo(touch, fineDetectors_) >= 0) {
248  int pdg = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
249  double cut = (pdg == 22) ? eMinFinePhoton_ : eMinFine_;
250  if (aStep->GetTrack()->GetKineticEnergy() / CLHEP::MeV > cut) {
251  trkInfo->putInHistory();
252  trkInfo->setIDfineCalo(id);
253  }
254 #ifdef EDM_ML_DEBUG
255  edm::LogVerbatim("CaloSim") << "CaloTrkProcessing: the track " << aStep->GetTrack()->GetTrackID()
256  << " with PDGID " << pdg << " and kinetic energy "
257  << aStep->GetTrack()->GetKineticEnergy() / CLHEP::MeV << " is tested against " << cut
258  << " to be put in history";
259 #endif
260  }
261  }
262 }

References TrackInformation::caloIDChecked(), TkAlMuonSelectors_cfi::cut, detectors_, doFineCalo_, eMin_, eMinFine_, eMinFinePhoton_, Exception, fineDetectors_, TrackInformation::getIDCaloVolume(), TrackInformation::getIDLastVolume(), TrackInformation::getIDonCaloSurface(), triggerObjects_cff::id, TrackInformation::isInHistory(), isItCalo(), isItInside(), lastTrackID_, MeV, putHistory_, TrackInformation::putInHistory(), TrackInformation::setCaloIDChecked(), TrackInformation::setIDfineCalo(), TrackInformation::setIDonCaloSurface(), and testBeam_.

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

Member Data Documentation

◆ detectors_

std::vector<Detector> CaloTrkProcessing::detectors_
private

Definition at line 63 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), isItInside(), and update().

◆ doFineCalo_

bool CaloTrkProcessing::doFineCalo_
private

Definition at line 60 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

◆ eMin_

double CaloTrkProcessing::eMin_
private

Definition at line 61 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

◆ eMinFine_

double CaloTrkProcessing::eMinFine_
private

Definition at line 61 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

◆ eMinFinePhoton_

double CaloTrkProcessing::eMinFinePhoton_
private

Definition at line 61 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

◆ fineDetectors_

std::vector<Detector> CaloTrkProcessing::fineDetectors_
private

Definition at line 63 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

◆ lastTrackID_

int CaloTrkProcessing::lastTrackID_
private

Definition at line 62 of file CaloTrkProcessing.h.

Referenced by update().

◆ putHistory_

bool CaloTrkProcessing::putHistory_
private

Definition at line 60 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

◆ testBeam_

bool CaloTrkProcessing::testBeam_
private

Definition at line 60 of file CaloTrkProcessing.h.

Referenced by CaloTrkProcessing(), and update().

CaloTrkProcessing::eMin_
double eMin_
Definition: CaloTrkProcessing.h:61
personalPlayback.level
level
Definition: personalPlayback.py:22
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
MuonGeometrySanityCheck_cfi.detectors
def detectors(dt=True, csc=True, me42=False, chambers=True, superlayers=False, layers=False)
Definition: MuonGeometrySanityCheck_cfi.py:13
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
mps_fire.i
i
Definition: mps_fire.py:355
CaloSimulationParameters
Definition: CaloSimulationParameters.h:6
TrackInformation::getIDonCaloSurface
int getIDonCaloSurface() const
Definition: TrackInformation.h:39
TrackInformation::getIDLastVolume
int getIDLastVolume() const
Definition: TrackInformation.h:48
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
CaloSimulationParameters::neighbours_
std::vector< int > neighbours_
Definition: CaloSimulationParameters.h:13
CaloSimulationParameters::insideLevel_
std::vector< int > insideLevel_
Definition: CaloSimulationParameters.h:15
CaloTrkProcessing::detectorLevel
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
Definition: CaloTrkProcessing.cc:375
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
globals_cff.id1
id1
Definition: globals_cff.py:32
TrackInformation::setIDonCaloSurface
void setIDonCaloSurface(int id, int ical, int last, int pdgID, double p)
Definition: TrackInformation.h:40
CaloSimulationParameters::levels_
std::vector< int > levels_
Definition: CaloSimulationParameters.h:12
MeV
const double MeV
HcalParametersRcd
Definition: HcalParametersRcd.h:8
TrackInformation::putInHistory
void putInHistory()
Definition: TrackInformation.h:33
TrackInformation::setCaloIDChecked
void setCaloIDChecked(bool f)
Definition: TrackInformation.h:50
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
CaloTrkProcessing::putHistory_
bool putHistory_
Definition: CaloTrkProcessing.h:60
CaloTrkProcessing::eMinFinePhoton_
double eMinFinePhoton_
Definition: CaloTrkProcessing.h:61
CaloTrkProcessing::lastTrackID_
int lastTrackID_
Definition: CaloTrkProcessing.h:62
CaloTrkProcessing::doFineCalo_
bool doFineCalo_
Definition: CaloTrkProcessing.h:60
CaloTrkProcessing::isItInside
int isItInside(const G4VTouchable *, int, int)
Definition: CaloTrkProcessing.cc:293
TrackInformation::setIDfineCalo
void setIDfineCalo(int id)
Definition: TrackInformation.h:56
SensitiveCaloDetector::SensitiveCaloDetector
SensitiveCaloDetector(const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
Definition: SensitiveCaloDetector.h:12
CaloSimulationParameters::caloNames_
std::vector< std::string > caloNames_
Definition: CaloSimulationParameters.h:11
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CaloSimulationParameters::fLevels_
std::vector< int > fLevels_
Definition: CaloSimulationParameters.h:18
CaloTrkProcessing::detLevels
int detLevels(const G4VTouchable *) const
Definition: CaloTrkProcessing.cc:354
CaloTrkProcessing::detLV
G4LogicalVolume * detLV(const G4VTouchable *, int) const
Definition: CaloTrkProcessing.cc:362
edm::ESHandle
Definition: DTSurvey.h:22
dqmdumpme.k
k
Definition: dqmdumpme.py:60
CaloTrkProcessing::fineDetectors_
std::vector< Detector > fineDetectors_
Definition: CaloTrkProcessing.h:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackInformation::getIDCaloVolume
int getIDCaloVolume() const
Definition: TrackInformation.h:47
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
TrackInformation
Definition: TrackInformation.h:8
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
edm::LogVerbatim
Definition: MessageLogger.h:297
CaloTrkProcessing::eMinFine_
double eMinFine_
Definition: CaloTrkProcessing.h:61
CaloSimulationParameters::insideNames_
std::vector< std::string > insideNames_
Definition: CaloSimulationParameters.h:14
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
CaloTrkProcessing::Detector
Definition: CaloTrkProcessing.h:40
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
Exception
Definition: hltDiff.cc:246
CaloSimulationParameters::fCaloNames_
std::vector< std::string > fCaloNames_
Definition: CaloSimulationParameters.h:17
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
pdg
Definition: pdg_functions.h:28
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
CaloTrkProcessing::isItCalo
int isItCalo(const G4VTouchable *, const std::vector< Detector > &)
Definition: CaloTrkProcessing.cc:264
TrackInformation::caloIDChecked
bool caloIDChecked() const
Definition: TrackInformation.h:49
CaloTrkProcessing::detectors_
std::vector< Detector > detectors_
Definition: CaloTrkProcessing.h:63
TrackInformation::isInHistory
bool isInHistory() const
Definition: TrackInformation.h:32
globals_cff.id2
id2
Definition: globals_cff.py:33
hfnoseParametersInitialization_cfi.name2
name2
Definition: hfnoseParametersInitialization_cfi.py:8
cuy.ii
ii
Definition: cuy.py:590
jets_cff.levels
levels
Definition: jets_cff.py:23
CaloTrkProcessing::testBeam_
bool testBeam_
Definition: CaloTrkProcessing.h:60
susybsm::HSCParticleType::unknown
Definition: HSCParticle.h:20