CMS 3D CMS Logo

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

#include <CMSSQLoopProcessDiscr.h>

Inheritance diagram for CMSSQLoopProcessDiscr:

Public Member Functions

 CMSSQLoopProcessDiscr (double mass, const G4String &name="SQLooper", G4ProcessType type=fUserDefined)
 
virtual G4double GetMeanFreePath (const G4Track &, G4double, G4ForceCondition *)
 
virtual G4VParticleChange * PostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
void SetTimeLimit (G4double)
 
virtual void StartTracking (G4Track *aTrack)
 
virtual ~CMSSQLoopProcessDiscr ()
 

Protected Attributes

G4ParticleChange * fParticleChange
 
double GenMass
 

Private Member Functions

 CMSSQLoopProcessDiscr (CMSSQLoopProcessDiscr &)
 
CMSSQLoopProcessDiscroperator= (const CMSSQLoopProcessDiscr &right)
 

Private Attributes

G4double globaltimeini
 
G4ThreeVector posini
 

Detailed Description

Definition at line 15 of file CMSSQLoopProcessDiscr.h.

Constructor & Destructor Documentation

◆ CMSSQLoopProcessDiscr() [1/2]

CMSSQLoopProcessDiscr::CMSSQLoopProcessDiscr ( double  mass,
const G4String &  name = "SQLooper",
G4ProcessType  type = fUserDefined 
)

Definition at line 10 of file CMSSQLoopProcessDiscr.cc.

References fParticleChange, GenMass, and EgHLTOffHistBins_cfi::mass.

11  : G4VDiscreteProcess(name, type) {
12  fParticleChange = new G4ParticleChange();
13  fParticleChange->ClearDebugFlag();
14  GenMass = mass;
15 }
G4ParticleChange * fParticleChange

◆ ~CMSSQLoopProcessDiscr()

CMSSQLoopProcessDiscr::~CMSSQLoopProcessDiscr ( )
virtual

Definition at line 17 of file CMSSQLoopProcessDiscr.cc.

References fParticleChange.

17 { delete fParticleChange; }
G4ParticleChange * fParticleChange

◆ CMSSQLoopProcessDiscr() [2/2]

CMSSQLoopProcessDiscr::CMSSQLoopProcessDiscr ( CMSSQLoopProcessDiscr )
private

Member Function Documentation

◆ GetMeanFreePath()

G4double CMSSQLoopProcessDiscr::GetMeanFreePath ( const G4Track &  ,
G4double  ,
G4ForceCondition *   
)
virtual

Definition at line 65 of file CMSSQLoopProcessDiscr.cc.

65 { return DBL_MAX; }

◆ operator=()

CMSSQLoopProcessDiscr& CMSSQLoopProcessDiscr::operator= ( const CMSSQLoopProcessDiscr right)
private

◆ PostStepDoIt()

G4VParticleChange * CMSSQLoopProcessDiscr::PostStepDoIt ( const G4Track &  track,
const G4Step &  step 
)
virtual

Definition at line 19 of file CMSSQLoopProcessDiscr.cc.

References CMSAntiSQ::AntiSQ(), fParticleChange, GenMass, globaltimeini, posini, and HLT_2024v14_cff::track.

19  {
20  G4Track* mytr = const_cast<G4Track*>(&track);
21  mytr->SetPosition(posini);
22  if (mytr->GetGlobalTime() / ns > 4990)
23  edm::LogWarning("CMSSQLoopProcess::AlongStepDoIt")
24  << "going to loose the particle because the GlobalTime is getting close to 5000" << std::endl;
25 
26  fParticleChange->Clear();
27  fParticleChange->Initialize(track);
28 
29  //adding secondary antiS
30  fParticleChange->SetNumberOfSecondaries(1);
31  G4DynamicParticle* replacementParticle =
32  new G4DynamicParticle(CMSAntiSQ::AntiSQ(GenMass), track.GetMomentumDirection(), track.GetKineticEnergy());
33  fParticleChange->AddSecondary(replacementParticle, globaltimeini);
34 
35  //killing original AntiS
36  fParticleChange->ProposeTrackStatus(fStopAndKill);
37 
38  // note SL: this way of working makes a very long history of the track,
39  // which all get saved recursively in SimTracks. If the cross section
40  // is too low such that 10's of thousands of iterations are needed, then
41  // this becomes too heavy to swallow writing out this history.
42  // So if we ever need very small cross sections, then we really need
43  // to change this way of working such that we can throw away all original
44  // tracks and only save the one that interacted.
45 
46  return fParticleChange;
47 }
static CMSAntiSQ * AntiSQ(double mass)
Definition: CMSAntiSQ.cc:41
G4ParticleChange * fParticleChange

◆ PostStepGetPhysicalInteractionLength()

G4double CMSSQLoopProcessDiscr::PostStepGetPhysicalInteractionLength ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
virtual

Definition at line 49 of file CMSSQLoopProcessDiscr.cc.

References Gflash::intLength, funct::pow(), mathSSE::sqrt(), and HLT_2024v14_cff::track.

51  {
52  *condition = NotForced;
53  G4double intLength =
54  DBL_MAX; //by default the interaction length is super large, only when outside tracker make it 0 to be sure it will do the reset to the original position
55  G4Track* mytr = const_cast<G4Track*>(&track);
56  if (sqrt(pow(mytr->GetPosition().rho(), 2)) >
57  2.45 *
58  centimeter) { //this is an important cut for the looping: if the radius of the particle is largher than 2.45cm its interaction length becomes 0 which means it will get killed
59  // updated from 2.5 to 2.45 so that the Sbar does not start to hit the support of the new inner tracker which was added in 2018
60  intLength = 0.0; //0 interaction length means particle will directly interact.
61  }
62  return intLength;
63 }
T sqrt(T t)
Definition: SSEVec.h:23
const double intLength[kNumberCalorimeter]
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ SetTimeLimit()

void CMSSQLoopProcessDiscr::SetTimeLimit ( G4double  )

◆ StartTracking()

void CMSSQLoopProcessDiscr::StartTracking ( G4Track *  aTrack)
virtual

Definition at line 67 of file CMSSQLoopProcessDiscr.cc.

References globaltimeini, and posini.

67  {
68  posini = aTrack->GetPosition();
69  globaltimeini = aTrack->GetGlobalTime();
70 }

Member Data Documentation

◆ fParticleChange

G4ParticleChange* CMSSQLoopProcessDiscr::fParticleChange
protected

◆ GenMass

double CMSSQLoopProcessDiscr::GenMass
protected

Definition at line 35 of file CMSSQLoopProcessDiscr.h.

Referenced by CMSSQLoopProcessDiscr(), and PostStepDoIt().

◆ globaltimeini

G4double CMSSQLoopProcessDiscr::globaltimeini
private

Definition at line 39 of file CMSSQLoopProcessDiscr.h.

Referenced by PostStepDoIt(), and StartTracking().

◆ posini

G4ThreeVector CMSSQLoopProcessDiscr::posini
private

Definition at line 38 of file CMSSQLoopProcessDiscr.h.

Referenced by PostStepDoIt(), and StartTracking().