CMS 3D CMS Logo

GflashHadronShowerModel Class Reference

#include <SimG4Core/GFlash/interface/GflashHadronShowerModel.h>

List of all members.

Public Member Functions

void DoIt (const G4FastTrack &, G4FastStep &)
 GflashHadronShowerModel (G4String modelName, G4Region *envelope)
G4bool IsApplicable (const G4ParticleDefinition &)
G4bool ModelTrigger (const G4FastTrack &)
 ~GflashHadronShowerModel ()

Private Member Functions

G4bool excludeDetectorRegion (const G4FastTrack &fastTrack)
G4bool isFirstInelasticInteraction (const G4FastTrack &fastTrack)

Private Attributes

G4Navigator * theGflashNavigator
G4Step * theGflashStep
G4TouchableHandle theGflashTouchableHandle
GflashHistogramtheHisto
GflashHadronShowerProfiletheProfile


Detailed Description

Definition at line 12 of file GflashHadronShowerModel.h.


Constructor & Destructor Documentation

GflashHadronShowerModel::GflashHadronShowerModel ( G4String  modelName,
G4Region *  envelope 
)

Definition at line 22 of file GflashHadronShowerModel.cc.

References GflashHistogram::instance(), theGflashNavigator, theGflashStep, theGflashTouchableHandle, theHisto, and theProfile.

00023   : G4VFastSimulationModel(modelName, envelope)
00024 {
00025   theProfile = new GflashHadronShowerProfile(envelope);
00026   theHisto = GflashHistogram::instance();
00027 
00028   theGflashStep = new G4Step();
00029   theGflashNavigator = new G4Navigator();
00030   theGflashTouchableHandle = new G4TouchableHistory();
00031 
00032   theGflashNavigator->SetWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume());
00033 
00034 }

GflashHadronShowerModel::~GflashHadronShowerModel (  ) 

Definition at line 36 of file GflashHadronShowerModel.cc.

References theGflashStep, and theProfile.

00037 {
00038   if(theProfile) delete theProfile;
00039   if(theGflashStep) delete theGflashStep;
00040 }


Member Function Documentation

void GflashHadronShowerModel::DoIt ( const G4FastTrack &  fastTrack,
G4FastStep &  fastStep 
)

Definition at line 80 of file GflashHadronShowerModel.cc.

References GflashHadronShowerProfile::clearSpotList(), GflashHadronShowerProfile::getEnergySpotList(), GflashHadronShowerProfile::hadronicParameterization(), theGflashNavigator, theGflashStep, theGflashTouchableHandle, and theProfile.

00081 {
00082   // Kill the parameterised particle:
00083 
00084   fastStep.ProposeTotalEnergyDeposited(fastTrack.GetPrimaryTrack()->GetKineticEnergy());
00085 
00086   // Parameterize shower shape and get resultant energy spots
00087   theProfile->clearSpotList();
00088   theProfile->hadronicParameterization(fastTrack);
00089 
00090   std::vector<GflashEnergySpot>& energySpotList = theProfile->getEnergySpotList();
00091 
00092   // Make hits
00093   G4double timeGlobal = fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint()->GetGlobalTime();
00094   
00095   std::vector<GflashEnergySpot>::const_iterator spotIter    = energySpotList.begin();
00096   std::vector<GflashEnergySpot>::const_iterator spotIterEnd = energySpotList.end();
00097   
00098    for( ; spotIter != spotIterEnd; spotIter++){
00099 
00100     // to make a different time for each fake step. (+1.0 is arbitrary)
00101     timeGlobal += 0.0001*nanosecond;
00102 
00103     // fill equivalent changes to a (fake) step associated with a spot 
00104 
00105     theGflashStep->SetTrack(const_cast<G4Track*>(fastTrack.GetPrimaryTrack()));
00106     theGflashStep->GetPostStepPoint()->SetGlobalTime(timeGlobal);
00107     theGflashStep->GetPreStepPoint()->SetPosition(spotIter->getPosition());
00108     theGflashStep->GetPostStepPoint()->SetPosition(spotIter->getPosition());
00109     theGflashStep->GetPostStepPoint()->SetProcessDefinedStep(const_cast<G4VProcess*> (fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()));
00110 
00111     //put touchable for each energy spot
00112     theGflashNavigator->LocateGlobalPointAndUpdateTouchable(spotIter->getPosition(),theGflashTouchableHandle(), false);
00113     theGflashStep->GetPreStepPoint()->SetTouchableHandle(theGflashTouchableHandle);
00114     theGflashStep->SetTotalEnergyDeposit(spotIter->getEnergy());
00115     
00116     // Send G4Step information to Hit/Dig if the volume is sensitive
00117     // Copied from G4SteppingManager.cc
00118 
00119     G4VPhysicalVolume* aCurrentVolume = theGflashStep->GetPreStepPoint()->GetPhysicalVolume();
00120 
00121     if( aCurrentVolume != 0 ) {
00122       theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector());
00123       G4VSensitiveDetector* aSensitive = theGflashStep->GetPreStepPoint()->GetSensitiveDetector();
00124       
00125       if( aSensitive != 0 ) {
00126         aSensitive->Hit(theGflashStep);
00127       }
00128     }
00129   }
00130 
00131   fastStep.KillPrimaryTrack();
00132   fastStep.ProposePrimaryTrackPathLength(0.0);
00133 
00134 }

G4bool GflashHadronShowerModel::excludeDetectorRegion ( const G4FastTrack &  fastTrack  )  [private]

Definition at line 175 of file GflashHadronShowerModel.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and eta.

Referenced by ModelTrigger().

00176 {
00177   G4bool isExcluded=false;
00178   
00179   //exclude regions where geometry are complicated 
00180   G4double eta =   fastTrack.GetPrimaryTrack()->GetMomentum().pseudoRapidity() ;
00181   if(fabs(eta) > 1.30 && fabs(eta) < 1.57) {
00182     std::cout << "excluding region of eta = " << eta << std::endl;
00183     return true;  
00184   }
00185   //exclude the region where the shower starting point is too close to the end of 
00186   //the hadronic envelopes (may need to be optimized further!)
00187 
00188   /*
00189   Gflash::CalorimeterNumber kColor = theProfile->getCalorimeterNumber(fastTrack);
00190 
00191   //@@@ need a proper scale
00192   const G4double minDistantToOut = 10.;
00193   
00194 
00195   if(kColor == kHB || kColor == kHE) {
00196     G4double distOut = fastTrack.GetEnvelopeSolid()->
00197       DistanceToOut(fastTrack.GetPrimaryTrackLocalPosition(),
00198                     fastTrack.GetPrimaryTrackLocalDirection());
00199 
00200     if (distOut < minDistantToOut ) {
00201       std::cout << "excluding region for dsitOut = " << distOut << std::endl;
00202       isExcluded = true;
00203     }
00204   }
00205   */
00206 
00207   return isExcluded;
00208 }

G4bool GflashHadronShowerModel::IsApplicable ( const G4ParticleDefinition &  particleType  ) 

Definition at line 42 of file GflashHadronShowerModel.cc.

00043 {
00044   return 
00045     &particleType == G4PionMinus::PionMinusDefinition() ||
00046     &particleType == G4PionPlus::PionPlusDefinition();
00047 }

G4bool GflashHadronShowerModel::isFirstInelasticInteraction ( const G4FastTrack &  fastTrack  )  [private]

Definition at line 136 of file GflashHadronShowerModel.cc.

References GflashHistogram::deltaStep, relval_parameters_module::energy, GflashHistogram::energyLoss, GflashHistogram::getStoreFlag(), cmsDriverOptions::isFirst, GflashHistogram::kineticEnergy, GflashHistogram::postStepPosition, GflashHistogram::preStepPosition, and theHisto.

Referenced by ModelTrigger().

00137 {
00138   G4bool isFirst=false;
00139 
00140   G4StepPoint* preStep = fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint();
00141   G4StepPoint* postStep = fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint();
00142 
00143   G4String procName = postStep->GetProcessDefinedStep()->GetProcessName();  
00144   G4ParticleDefinition* particleType = fastTrack.GetPrimaryTrack()->GetDefinition();
00145 
00146   //@@@ this part is still temporary and the cut for the variable ratio should be optimized later
00147 
00148   if((particleType == G4PionPlus::PionPlusDefinition() && procName == "WrappedPionPlusInelastic") || 
00149      (particleType == G4PionMinus::PionMinusDefinition() && procName == "WrappedPionMinusInelastic")) {
00150 
00151     G4double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy();
00152 
00153     G4double ratio = 0.0;
00154     if (energy > 0) {
00155       ratio = fabs(fastTrack.GetPrimaryTrack()->GetStep()->GetDeltaEnergy()/energy);
00156     }
00157 
00158     if(ratio > 0.1) isFirst=true;
00159 
00160     //Fill debugging histograms and check information on secondaries -
00161     //remove after final implimentation
00162 
00163     if(theHisto->getStoreFlag()) {
00164       theHisto->preStepPosition->Fill(preStep->GetPosition().getRho()/cm);
00165       theHisto->postStepPosition->Fill(postStep->GetPosition().getRho()/cm);
00166       theHisto->deltaStep->Fill((postStep->GetPosition() - preStep->GetPosition()).getRho()/cm);
00167       theHisto->kineticEnergy->Fill(energy);
00168       theHisto->energyLoss->Fill(fabs(fastTrack.GetPrimaryTrack()->GetStep()->GetDeltaEnergy()/GeV));
00169     }
00170 
00171  }
00172   return isFirst;
00173 } 

G4bool GflashHadronShowerModel::ModelTrigger ( const G4FastTrack &  fastTrack  ) 

Definition at line 49 of file GflashHadronShowerModel.cc.

References excludeDetectorRegion(), and isFirstInelasticInteraction().

00050 {
00051   // ModelTrigger returns false for Gflash Hadronic Shower Model if it is not
00052   // tested from the corresponding wrapper process, GflashHadronWrapperProcess. 
00053   // Temporarily the track status is set to fPostponeToNextEvent at the wrapper
00054   // process before ModelTrigger is really tested for the second time through 
00055   // PostStepGPIL of enviaged parameterization processes.  The better 
00056   // implmentation may be using via G4VUserTrackInformation of each track, which
00057   // requires to modify a geant source code of stepping (G4SteppingManager2)
00058 
00059   G4bool trigger = false;
00060 
00061   // mininum energy cutoff to parameterize
00062   if (fastTrack.GetPrimaryTrack()->GetKineticEnergy() < 1.0*GeV) return trigger;
00063 
00064   // check whether this is called from the normal GPIL or the wrapper process GPIL
00065   if(fastTrack.GetPrimaryTrack()->GetTrackStatus() == fPostponeToNextEvent ) {
00066 
00067     // Shower pameterization start at the first inelastic interaction point
00068     G4bool isInelastic  = isFirstInelasticInteraction(fastTrack);
00069     
00070     // Other conditions
00071     if(isInelastic) {
00072       trigger = (!excludeDetectorRegion(fastTrack));
00073     }
00074   }
00075 
00076   return trigger;
00077 
00078 }


Member Data Documentation

G4Navigator* GflashHadronShowerModel::theGflashNavigator [private]

Definition at line 37 of file GflashHadronShowerModel.h.

Referenced by DoIt(), and GflashHadronShowerModel().

G4Step* GflashHadronShowerModel::theGflashStep [private]

Definition at line 36 of file GflashHadronShowerModel.h.

Referenced by DoIt(), GflashHadronShowerModel(), and ~GflashHadronShowerModel().

G4TouchableHandle GflashHadronShowerModel::theGflashTouchableHandle [private]

Definition at line 38 of file GflashHadronShowerModel.h.

Referenced by DoIt(), and GflashHadronShowerModel().

GflashHistogram* GflashHadronShowerModel::theHisto [private]

Definition at line 41 of file GflashHadronShowerModel.h.

Referenced by GflashHadronShowerModel(), and isFirstInelasticInteraction().

GflashHadronShowerProfile* GflashHadronShowerModel::theProfile [private]

Definition at line 35 of file GflashHadronShowerModel.h.

Referenced by DoIt(), GflashHadronShowerModel(), and ~GflashHadronShowerModel().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:21:24 2009 for CMSSW by  doxygen 1.5.4