CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
TrackingMaterialProducer Class Reference

#include <TrackingMaterialProducer.h>

Inheritance diagram for TrackingMaterialProducer:
SimProducer Observer< const BeginOfJob *> Observer< const EndOfJob *> Observer< const BeginOfEvent *> Observer< const BeginOfTrack *> Observer< const G4Step *> Observer< const EndOfTrack *> SimWatcher

Public Member Functions

 TrackingMaterialProducer (const edm::ParameterSet &)
 
 ~TrackingMaterialProducer () override
 
- Public Member Functions inherited from SimProducer
const SimProduceroperator= (const SimProducer &)=delete
 
void registerProducts (edm::ProducesCollector producesCollector)
 
 SimProducer ()
 
 SimProducer (const SimProducer &)=delete
 
- Public Member Functions inherited from SimWatcher
virtual void beginRun (edm::EventSetup const &)
 
bool isMT () const
 
const SimWatcheroperator= (const SimWatcher &)=delete
 
virtual void registerConsumes (edm::ConsumesCollector)
 
 SimWatcher ()
 
 SimWatcher (const SimWatcher &)=delete
 
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 EndOfJob *>
 Observer ()
 
void slotForUpdate (const EndOfJob * 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 G4Step *>
 Observer ()
 
void slotForUpdate (const G4Step * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack *>
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 

Private Member Functions

bool isSelected (const G4VTouchable *touch)
 
bool isSelectedFast (const G4TouchableHistory *touch)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void update (const BeginOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *) 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...
 
void update (const EndOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

bool isHFNose
 
bool isHGCal
 
double m_hgcalzfront
 
bool m_primaryTracks
 
std::vector< std::string > m_selectedNames
 
std::vector< const G4LogicalVolume * > m_selectedVolumes
 
MaterialAccountingTrack m_track
 
const G4VPhysicalVolume * m_track_volume
 
std::vector< MaterialAccountingTrack > * m_tracks
 
std::string m_txtOutFile
 
TFile * output_file_
 
std::ofstream outVolumeZpositionTxt
 
TProfile * radLen_vs_eta_
 

Static Private Attributes

static constexpr float innerHFnoseEta = 4.
 
static constexpr float innerHGCalEta = 2.4
 
static constexpr float outerHFnoseEta = 3.3
 
static constexpr float outerHGCalEta = 2.0
 

Additional Inherited Members

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

Detailed Description

Definition at line 33 of file TrackingMaterialProducer.h.

Constructor & Destructor Documentation

◆ TrackingMaterialProducer()

TrackingMaterialProducer::TrackingMaterialProducer ( const edm::ParameterSet iPSet)

Definition at line 82 of file TrackingMaterialProducer.cc.

References spr::find(), edm::ParameterSet::getParameter(), trackingMaterialAnalyser_ForHFNosePhaseII_cfi::isHFNose, trackingMaterialAnalyser_cfi::isHGCal, or, MillePedeFileConverter_cfg::out, and AlCaHLTBitMon_QueryRunRegistry::string.

82  {
83  edm::ParameterSet config = iPSet.getParameter<edm::ParameterSet>("TrackingMaterialProducer");
84  m_selectedNames = config.getParameter<std::vector<std::string> >("SelectedVolumes");
85  m_primaryTracks = config.getParameter<bool>("PrimaryTracksOnly");
86  m_txtOutFile = config.getUntrackedParameter<std::string>("txtOutFile");
87  m_hgcalzfront = config.getParameter<double>("hgcalzfront");
88  m_tracks = nullptr;
89  m_track_volume = nullptr;
90 
91  produces<std::vector<MaterialAccountingTrack> >();
92  output_file_ = new TFile("radLen_vs_eta_fromProducer.root", "RECREATE");
93  output_file_->cd();
94  radLen_vs_eta_ = new TProfile("radLen", "radLen", 250., -5., 5., 0, 10.);
95 
96  //Check if HGCal volumes are selected
97  isHGCal = false;
98  //if (std::find(m_selectedNames.begin(), m_selectedNames.end(), "CALOECTSRear") != m_selectedNames.end()) {
99  if (std::find(m_selectedNames.begin(), m_selectedNames.end(), "HGCal") != m_selectedNames.end()) {
100  isHGCal = true;
101  }
102  //Check if HFNose volumes are selected
103  isHFNose = false;
104  if (std::find(m_selectedNames.begin(), m_selectedNames.end(), "HFNose") != m_selectedNames.end()) {
105  isHFNose = true;
106  }
107  if (isHGCal or isHFNose) {
109  }
110 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
Definition: config.py:1
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const G4VPhysicalVolume * m_track_volume
std::vector< MaterialAccountingTrack > * m_tracks
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< std::string > m_selectedNames

◆ ~TrackingMaterialProducer()

TrackingMaterialProducer::~TrackingMaterialProducer ( void  )
override

Definition at line 113 of file TrackingMaterialProducer.cc.

113 {}

Member Function Documentation

◆ isSelected()

bool TrackingMaterialProducer::isSelected ( const G4VTouchable *  touch)
private

Definition at line 363 of file TrackingMaterialProducer.cc.

References mps_fire::i, and or.

363  {
364  for (size_t i = 0; i < m_selectedVolumes.size(); ++i)
365  if (m_selectedVolumes[i]->IsAncestor(touchable->GetVolume()) or
366  m_selectedVolumes[i] == touchable->GetVolume()->GetLogicalVolume())
367  return true;
368 
369  return false;
370 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::vector< const G4LogicalVolume * > m_selectedVolumes

◆ isSelectedFast()

bool TrackingMaterialProducer::isSelectedFast ( const G4TouchableHistory *  touch)
private

Definition at line 192 of file TrackingMaterialProducer.cc.

References ztail::d, spr::find(), and AlCaHLTBitMon_QueryRunRegistry::string.

192  {
193  for (int d = touchable->GetHistoryDepth() - 1; d >= 0; --d) {
194  if (std::find(m_selectedNames.begin(),
195  m_selectedNames.end(),
196  (std::string)(dd4hep::dd::noNamespace(touchable->GetVolume(d)->GetName()))) != m_selectedNames.end())
197  return true;
198  }
199  return false;
200 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
d
Definition: ztail.py:151
std::vector< std::string > m_selectedNames

◆ produce()

void TrackingMaterialProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements SimProducer.

Definition at line 355 of file TrackingMaterialProducer.cc.

References iEvent, eostools::move(), and DiMuonV_cfg::tracks.

355  {
356  // transfer ownership to the Event
357  std::unique_ptr<std::vector<MaterialAccountingTrack> > tracks(m_tracks);
358  iEvent.put(std::move(tracks));
359  m_tracks = nullptr;
360 }
std::vector< MaterialAccountingTrack > * m_tracks
int iEvent
Definition: GenABIO.cc:224
def move(src, dest)
Definition: eostools.py:511

◆ update() [1/6]

void TrackingMaterialProducer::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob *>.

Definition at line 121 of file TrackingMaterialProducer.cc.

References DMR_cfg::cerr, and GetVolume().

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

121  {
122  // INFO
123  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: List of the selected volumes: " << std::endl;
124  for (std::vector<std::string>::const_iterator volume_name = m_selectedNames.begin();
125  volume_name != m_selectedNames.end();
126  ++volume_name) {
127  const G4LogicalVolume* volume = GetVolume(*volume_name);
128  if (volume) {
129  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: " << *volume_name << std::endl;
130  m_selectedVolumes.push_back(volume);
131  } else {
132  // FIXME: throw an exception ?
133  std::cerr << "TrackingMaterialProducer::update(const BeginOfJob*): WARNING: selected volume \"" << *volume_name
134  << "\" not found in geometry " << std::endl;
135  }
136  }
137 }
Log< level::Info, false > LogInfo
static const G4LogicalVolume * GetVolume(const std::string &name)
std::vector< std::string > m_selectedNames
std::vector< const G4LogicalVolume * > m_selectedVolumes

◆ update() [2/6]

void TrackingMaterialProducer::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent *>.

Definition at line 140 of file TrackingMaterialProducer.cc.

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

140  {
141  m_tracks = new std::vector<MaterialAccountingTrack>();
142 }
std::vector< MaterialAccountingTrack > * m_tracks

◆ update() [3/6]

void TrackingMaterialProducer::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack *>.

Definition at line 145 of file TrackingMaterialProducer.cc.

References trackingMaterialAnalyser_ForHFNosePhaseII_cfi::isHFNose, trackingMaterialAnalyser_cfi::isHGCal, and HLT_2023v12_cff::track.

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

145  {
146  m_track.reset();
147  m_track_volume = nullptr;
148 
149  // prevent secondary tracks from propagating
150  G4Track* track = const_cast<G4Track*>((*event)());
151  if (m_primaryTracks and track->GetParentID() != 0) {
152  track->SetTrackStatus(fStopAndKill);
153  }
154 
155  //For the HGCal case:
156  //In the beginning of each track, the track will first hit an HGCAL volume and it will
157  //save the upper z volume boundary. So, the low boundary of the first
158  //volume is never saved. Here we give the low boundary of the first volume.
159  //This can be found by asking first to run not on 'HGCal' volume below but
160  //on 'CALOECTSRear', which at the moment of this writing it contains
161  //HGCalService, HGCal and thermal screen. You should run Fireworks to
162  //check if these naming conventions and volumes are valid in the future.
163  //Then, check the VolumesZPosition.txt file to see where CEService ends and
164  //put that number in hgcalzfront. Keep in mind to run on the desired volume above here:
165  //https://github.com/cms-sw/cmssw/blob/master/SimTracker/TrackerMaterialAnalysis/plugins/TrackingMaterialProducer.cc#L95
166  //and to replace the volume name of the material first hit at the file creation line below
167  if (isHGCal && track->GetTrackStatus() != fStopAndKill && fabs(track->GetMomentum().eta()) > outerHGCalEta &&
168  fabs(track->GetMomentum().eta()) < innerHGCalEta) {
169  if (track->GetMomentum().eta() > 0.) {
170  outVolumeZpositionTxt << "Air " << m_hgcalzfront << " " << 0 << " " << 0 << " " << 0 << " " << 0 << std::endl;
171  } else if (track->GetMomentum().eta() <= 0.) {
172  outVolumeZpositionTxt << "Air " << -m_hgcalzfront << " " << 0 << " " << 0 << " " << 0 << " " << 0 << std::endl;
173  }
174  }
175 
176  //For the HFnose case:
177  //restrict the outher radius to eta 3.3 since there is HGCAL shadowing
178  //restrict the innner radius to eta 4 since it's non projective
179 
180  if (isHFNose && track->GetTrackStatus() != fStopAndKill && fabs(track->GetMomentum().eta()) > outerHFnoseEta &&
181  fabs(track->GetMomentum().eta()) < innerHFnoseEta) {
182  if (track->GetMomentum().eta() > 0.) {
183  outVolumeZpositionTxt << "Polyethylene " << m_hgcalzfront << " " << 0 << " " << 0 << " " << 0 << " " << 0
184  << std::endl;
185  } else if (track->GetMomentum().eta() <= 0.) {
186  outVolumeZpositionTxt << "Polyethylene " << -m_hgcalzfront << " " << 0 << " " << 0 << " " << 0 << " " << 0
187  << std::endl;
188  }
189  }
190 }
static constexpr float innerHGCalEta
MaterialAccountingTrack m_track
static constexpr float outerHFnoseEta
static constexpr float outerHGCalEta
const G4VPhysicalVolume * m_track_volume
static constexpr float innerHFnoseEta

◆ update() [4/6]

void TrackingMaterialProducer::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step *>.

Definition at line 203 of file TrackingMaterialProducer.cc.

References fastSimProducer_cff::energyLoss, GetSensitiveVolume(), GetTransform(), trackingMaterialAnalyser_ForHFNosePhaseII_cfi::isHFNose, trackingMaterialAnalyser_cfi::isHGCal, personalPlayback::level, or, position, mathSSE::sqrt(), HcalDetIdTransform::transform(), ecalPiZeroTask_cfi::X0, and PV3DBase< T, PVType, FrameType >::z().

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

203  {
204  const G4TouchableHistory* touchable = static_cast<const G4TouchableHistory*>(step->GetTrack()->GetTouchable());
205  if (not isSelectedFast(touchable)) {
206  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer:\t[...] skipping "
207  << touchable->GetVolume()->GetName() << std::endl;
208  return;
209  }
210 
211  // material and step proterties
212  const G4Material* material = touchable->GetVolume()->GetLogicalVolume()->GetMaterial();
213  double length = step->GetStepLength() / cm; // mm -> cm
214  double X0 = material->GetRadlen() / cm; // mm -> cm
215  double Ne = material->GetElectronDensity() * cm3; // 1/mm3 -> 1/cm3
216  double Xi = Ne / 6.0221415e23 * 0.307075 / 2; // MeV / cm
217  double radiationLengths = length / X0; //
218  double energyLoss = length * Xi / 1000.; // GeV
219  //double energyLoss = step->GetDeltaEnergy()/MeV; should we use this??
220 
221  G4ThreeVector globalPosPre = step->GetPreStepPoint()->GetPosition();
222  G4ThreeVector globalPosPost = step->GetPostStepPoint()->GetPosition();
223  GlobalPoint globalPositionIn(globalPosPre.x() / cm, globalPosPre.y() / cm, globalPosPre.z() / cm); // mm -> cm
224  GlobalPoint globalPositionOut(globalPosPost.x() / cm, globalPosPost.y() / cm, globalPosPost.z() / cm); // mm -> cm
225 
226  G4StepPoint* prePoint = step->GetPreStepPoint();
227  G4StepPoint* postPoint = step->GetPostStepPoint();
228  const CLHEP::Hep3Vector& postPos = postPoint->GetPosition();
229  //Go below only in HGCal case
230  if (isHGCal or isHFNose) {
231  //A step never spans across boundaries: geometry or physics define the end points
232  //If the step is limited by a boundary, the post-step point stands on the
233  //boundary and it logically belongs to the next volume.
234  if (postPoint->GetStepStatus() == fGeomBoundary && fabs(postPoint->GetMomentum().eta()) > outerHGCalEta &&
235  fabs(postPoint->GetMomentum().eta()) < innerHGCalEta) {
236  //Post point position is the low z edge of the new volume, or the upper for the prepoint volume.
237  //So, premat - postz - posteta - postR - premattotalenergylossEtable - premattotalenergylossEfull
238  //Observe the two zeros at the end which in the past where set to emCalculator.GetDEDX and
239  //emCalculator.ComputeTotalDEDX but decided not to be used. Will save the structure though for the script.
240  outVolumeZpositionTxt << prePoint->GetMaterial()->GetName() << " " << postPos.z() << " "
241  << postPoint->GetMomentum().eta() << " "
242  << sqrt(postPos.x() * postPos.x() + postPos.y() * postPos.y()) << " " << 0 << " " << 0
243  << std::endl;
244  }
245 
246  if (postPoint->GetStepStatus() == fGeomBoundary && fabs(postPoint->GetMomentum().eta()) > outerHFnoseEta &&
247  fabs(postPoint->GetMomentum().eta()) < innerHFnoseEta) {
248  outVolumeZpositionTxt << prePoint->GetMaterial()->GetName() << " " << postPos.z() << " "
249  << postPoint->GetMomentum().eta() << " "
250  << sqrt(postPos.x() * postPos.x() + postPos.y() * postPos.y()) << " " << 0 << " " << 0
251  << std::endl;
252  }
253 
254  } //end of isHGCal or HFnose if
255 
256  // check for a sensitive detector
257  bool enter_sensitive = false;
258  bool leave_sensitive = false;
259  double cosThetaPre = 0.0;
260  double cosThetaPost = 0.0;
261  int level = 0;
262  const G4VPhysicalVolume* sensitive = nullptr;
264  std::tie(sensitive, level) = GetSensitiveVolume(touchable);
265  if (sensitive) {
266  const G4VSolid& solid = *touchable->GetSolid(level);
267  const G4AffineTransform& transform = GetTransform(touchable, level);
268  G4ThreeVector pos = transform.Inverse().TransformPoint(G4ThreeVector(0., 0., 0.));
269  position = GlobalPoint(pos.x() / cm, pos.y() / cm, pos.z() / cm); // mm -> cm
270 
271  G4ThreeVector localPosPre = transform.TransformPoint(globalPosPre);
272  EInside statusPre = solid.Inside(localPosPre);
273  if (statusPre == kSurface) {
274  enter_sensitive = true;
275  G4ThreeVector globalDirPre = step->GetPreStepPoint()->GetMomentumDirection();
276  G4ThreeVector localDirPre = transform.TransformAxis(globalDirPre);
277  G4ThreeVector normalPre = solid.SurfaceNormal(localPosPre);
278  cosThetaPre = normalPre.cosTheta(-localDirPre);
279  }
280 
281  G4ThreeVector localPosPost = transform.TransformPoint(globalPosPost);
282  EInside statusPost = solid.Inside(localPosPost);
283  if (statusPost == kSurface) {
284  leave_sensitive = true;
285  G4ThreeVector globalDirPost = step->GetPostStepPoint()->GetMomentumDirection();
286  G4ThreeVector localDirPost = transform.TransformAxis(globalDirPost);
287  G4ThreeVector normalPost = solid.SurfaceNormal(localPosPost);
288  cosThetaPost = normalPost.cosTheta(localDirPost);
289  }
290  }
291 
292  // update track accounting
293  if (enter_sensitive) {
294  if (m_track_volume != nullptr) {
295  edm::LogWarning("TrackingMaterialProducer") << "Entering volume " << sensitive << " while inside volume "
296  << m_track_volume << ". Something is inconsistent";
297  m_track.reset();
298  }
299  m_track_volume = sensitive;
300  m_track.enterDetector(position, cosThetaPre);
301  }
302  m_track.step(MaterialAccountingStep(length, radiationLengths, energyLoss, globalPositionIn, globalPositionOut));
303  if (leave_sensitive) {
304  if (m_track_volume != sensitive) {
305  edm::LogWarning("TrackingMaterialProducer") << "Leaving volume " << sensitive << " while inside volume "
306  << m_track_volume << ". Something is inconsistent";
307  m_track.reset();
308  } else
309  m_track.leaveDetector(cosThetaPost);
310  m_track_volume = nullptr;
311  }
312  if (sensitive)
313  LogInfo("TrackingMaterialProducer") << "Track was near sensitive volume " << sensitive->GetName() << std::endl;
314  else
315  LogInfo("TrackingMaterialProducer") << "Track was near non-sensitive volume " << touchable->GetVolume()->GetName()
316  << std::endl;
317  LogInfo("TrackingMaterialProducer") << "Step length: " << length << " cm\n"
318  << "globalPreStep(r,z): (" << globalPositionIn.perp() << ", "
319  << globalPositionIn.z() << ") cm\n"
320  << "globalPostStep(r,z): (" << globalPositionOut.perp() << ", "
321  << globalPositionOut.z() << ") cm\n"
322  << "position(r,z): (" << position.perp() << ", " << position.z() << ") cm\n"
323  << "Radiation lengths: " << radiationLengths << " \t\t(X0: " << X0
324  << " cm)\n"
325  << "Energy loss: " << energyLoss << " MeV \t(Xi: " << Xi
326  << " MeV/cm)\n"
327  << "Track was " << (enter_sensitive ? "entering " : "in none ")
328  << "sensitive volume\n"
329  << "Track was " << (leave_sensitive ? "leaving " : "in none ")
330  << "sensitive volume\n";
331 }
void leaveDetector(double cosTheta)
static constexpr float innerHGCalEta
void enterDetector(const GlobalPoint &position, double cosTheta)
MaterialAccountingTrack m_track
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static constexpr float outerHFnoseEta
static constexpr float outerHGCalEta
void step(const MaterialAccountingStep &step)
const G4VPhysicalVolume * m_track_volume
static const G4AffineTransform & GetTransform(const G4TouchableHistory *touchable, int depth)
T sqrt(T t)
Definition: SSEVec.h:19
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
static constexpr float innerHFnoseEta
Log< level::Info, false > LogInfo
static int position[264][3]
Definition: ReadPGInfo.cc:289
step
Definition: StallMonitor.cc:83
Log< level::Warning, false > LogWarning
bool isSelectedFast(const G4TouchableHistory *touch)
std::tuple< const G4VPhysicalVolume *, int > GetSensitiveVolume(const G4VTouchable *touchable)
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ update() [5/6]

void TrackingMaterialProducer::update ( const EndOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack *>.

Definition at line 334 of file TrackingMaterialProducer.cc.

References HLT_2023v12_cff::track.

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

334  {
335  const G4Track* track = (*event)();
336  if (m_primaryTracks and track->GetParentID() != 0)
337  return;
338 
339  radLen_vs_eta_->Fill(track->GetMomentum().eta(), m_track.summary().radiationLengths());
340  m_tracks->push_back(m_track);
341 
342  // LogInfo
343  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: this track took " << m_track.steps().size()
344  << " steps, and passed through " << m_track.detectors().size()
345  << " sensitive detectors" << std::endl;
346  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: track length: " << m_track.summary().length()
347  << " cm" << std::endl;
348  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: radiation lengths: "
349  << m_track.summary().radiationLengths() << std::endl;
350  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: energy loss: "
351  << m_track.summary().energyLoss() << " MeV" << std::endl;
352 }
MaterialAccountingTrack m_track
std::vector< MaterialAccountingTrack > * m_tracks
const std::vector< MaterialAccountingDetector > & detectors() const
Log< level::Info, false > LogInfo
const MaterialAccountingStep & summary() const
double radiationLengths(void) const
const std::vector< MaterialAccountingStep > & steps() const
double energyLoss(void) const

◆ update() [6/6]

void TrackingMaterialProducer::update ( const EndOfJob *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfJob *>.

Definition at line 116 of file TrackingMaterialProducer.cc.

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

116  {
117  radLen_vs_eta_->Write();
118  output_file_->Close();
119 }

Member Data Documentation

◆ innerHFnoseEta

constexpr float TrackingMaterialProducer::innerHFnoseEta = 4.
staticprivate

Definition at line 71 of file TrackingMaterialProducer.h.

◆ innerHGCalEta

constexpr float TrackingMaterialProducer::innerHGCalEta = 2.4
staticprivate

Definition at line 69 of file TrackingMaterialProducer.h.

◆ isHFNose

bool TrackingMaterialProducer::isHFNose
private

Definition at line 68 of file TrackingMaterialProducer.h.

◆ isHGCal

bool TrackingMaterialProducer::isHGCal
private

Definition at line 67 of file TrackingMaterialProducer.h.

◆ m_hgcalzfront

double TrackingMaterialProducer::m_hgcalzfront
private

Definition at line 61 of file TrackingMaterialProducer.h.

◆ m_primaryTracks

bool TrackingMaterialProducer::m_primaryTracks
private

Definition at line 57 of file TrackingMaterialProducer.h.

◆ m_selectedNames

std::vector<std::string> TrackingMaterialProducer::m_selectedNames
private

Definition at line 58 of file TrackingMaterialProducer.h.

◆ m_selectedVolumes

std::vector<const G4LogicalVolume*> TrackingMaterialProducer::m_selectedVolumes
private

Definition at line 59 of file TrackingMaterialProducer.h.

◆ m_track

MaterialAccountingTrack TrackingMaterialProducer::m_track
private

Definition at line 62 of file TrackingMaterialProducer.h.

◆ m_track_volume

const G4VPhysicalVolume* TrackingMaterialProducer::m_track_volume
private

Definition at line 63 of file TrackingMaterialProducer.h.

◆ m_tracks

std::vector<MaterialAccountingTrack>* TrackingMaterialProducer::m_tracks
private

Definition at line 64 of file TrackingMaterialProducer.h.

◆ m_txtOutFile

std::string TrackingMaterialProducer::m_txtOutFile
private

Definition at line 60 of file TrackingMaterialProducer.h.

◆ outerHFnoseEta

constexpr float TrackingMaterialProducer::outerHFnoseEta = 3.3
staticprivate

Definition at line 72 of file TrackingMaterialProducer.h.

◆ outerHGCalEta

constexpr float TrackingMaterialProducer::outerHGCalEta = 2.0
staticprivate

Definition at line 70 of file TrackingMaterialProducer.h.

◆ output_file_

TFile* TrackingMaterialProducer::output_file_
private

Definition at line 65 of file TrackingMaterialProducer.h.

◆ outVolumeZpositionTxt

std::ofstream TrackingMaterialProducer::outVolumeZpositionTxt
private

Definition at line 73 of file TrackingMaterialProducer.h.

◆ radLen_vs_eta_

TProfile* TrackingMaterialProducer::radLen_vs_eta_
private

Definition at line 66 of file TrackingMaterialProducer.h.