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 80 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.

80  {
81  edm::ParameterSet config = iPSet.getParameter<edm::ParameterSet>("TrackingMaterialProducer");
82  m_selectedNames = config.getParameter<std::vector<std::string> >("SelectedVolumes");
83  m_primaryTracks = config.getParameter<bool>("PrimaryTracksOnly");
84  m_txtOutFile = config.getUntrackedParameter<std::string>("txtOutFile");
85  m_hgcalzfront = config.getParameter<double>("hgcalzfront");
86  m_tracks = nullptr;
87  m_track_volume = nullptr;
88 
89  produces<std::vector<MaterialAccountingTrack> >();
90  output_file_ = new TFile("radLen_vs_eta_fromProducer.root", "RECREATE");
91  output_file_->cd();
92  radLen_vs_eta_ = new TProfile("radLen", "radLen", 250., -5., 5., 0, 10.);
93 
94  //Check if HGCal volumes are selected
95  isHGCal = false;
96  //if (std::find(m_selectedNames.begin(), m_selectedNames.end(), "CALOECTSRear") != m_selectedNames.end()) {
97  if (std::find(m_selectedNames.begin(), m_selectedNames.end(), "HGCal") != m_selectedNames.end()) {
98  isHGCal = true;
99  }
100  //Check if HFNose volumes are selected
101  isHFNose = false;
102  if (std::find(m_selectedNames.begin(), m_selectedNames.end(), "HFNose") != m_selectedNames.end()) {
103  isHFNose = true;
104  }
105  if (isHGCal or isHFNose) {
107  }
108 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 111 of file TrackingMaterialProducer.cc.

111 {}

Member Function Documentation

◆ isSelected()

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

Definition at line 360 of file TrackingMaterialProducer.cc.

References mps_fire::i, and or.

360  {
361  for (size_t i = 0; i < m_selectedVolumes.size(); ++i)
362  if (m_selectedVolumes[i]->IsAncestor(touchable->GetVolume()) or
363  m_selectedVolumes[i] == touchable->GetVolume()->GetLogicalVolume())
364  return true;
365 
366  return false;
367 }
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 190 of file TrackingMaterialProducer.cc.

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

190  {
191  for (int d = touchable->GetHistoryDepth() - 1; d >= 0; --d) {
192  if (std::find(m_selectedNames.begin(), m_selectedNames.end(), touchable->GetVolume(d)->GetName()) !=
193  m_selectedNames.end())
194  return true;
195  }
196  return false;
197 }
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 352 of file TrackingMaterialProducer.cc.

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

352  {
353  // transfer ownership to the Event
354  std::unique_ptr<std::vector<MaterialAccountingTrack> > tracks(m_tracks);
355  iEvent.put(std::move(tracks));
356  m_tracks = nullptr;
357 }
std::vector< MaterialAccountingTrack > * m_tracks
int iEvent
Definition: GenABIO.cc:224
auto const & tracks
cannot be loose
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 119 of file TrackingMaterialProducer.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, and GetVolume().

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

119  {
120  // INFO
121  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: List of the selected volumes: " << std::endl;
122  for (std::vector<std::string>::const_iterator volume_name = m_selectedNames.begin();
123  volume_name != m_selectedNames.end();
124  ++volume_name) {
125  const G4LogicalVolume* volume = GetVolume(*volume_name);
126  if (volume) {
127  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: " << *volume_name << std::endl;
128  m_selectedVolumes.push_back(volume);
129  } else {
130  // FIXME: throw an exception ?
131  std::cerr << "TrackingMaterialProducer::update(const BeginOfJob*): WARNING: selected volume \"" << *volume_name
132  << "\" not found in geometry " << std::endl;
133  }
134  }
135 }
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 138 of file TrackingMaterialProducer.cc.

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

138  {
139  m_tracks = new std::vector<MaterialAccountingTrack>();
140 }
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 143 of file TrackingMaterialProducer.cc.

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

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

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

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

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

References HLT_2022v12_cff::track.

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

331  {
332  const G4Track* track = (*event)();
333  if (m_primaryTracks and track->GetParentID() != 0)
334  return;
335 
336  radLen_vs_eta_->Fill(track->GetMomentum().eta(), m_track.summary().radiationLengths());
337  m_tracks->push_back(m_track);
338 
339  // LogInfo
340  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: this track took " << m_track.steps().size()
341  << " steps, and passed through " << m_track.detectors().size()
342  << " sensitive detectors" << std::endl;
343  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: track length: " << m_track.summary().length()
344  << " cm" << std::endl;
345  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: radiation lengths: "
346  << m_track.summary().radiationLengths() << std::endl;
347  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: energy loss: "
348  << m_track.summary().energyLoss() << " MeV" << std::endl;
349 }
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 114 of file TrackingMaterialProducer.cc.

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

114  {
115  radLen_vs_eta_->Write();
116  output_file_->Close();
117 }

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.