CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MaterialBudgetHcal Class Reference

#include <MaterialBudgetHcal.h>

Inheritance diagram for MaterialBudgetHcal:
SimWatcher Observer< const BeginOfJob * > Observer< const BeginOfTrack * > Observer< const G4Step * > Observer< const EndOfTrack * >

List of all members.

Public Member Functions

 MaterialBudgetHcal (const edm::ParameterSet &)
virtual ~MaterialBudgetHcal ()

Private Member Functions

 MaterialBudgetHcal (const MaterialBudgetHcal &)
const MaterialBudgetHcaloperator= (const MaterialBudgetHcal &)
bool stopAfter (const G4Step *)
void update (const G4Step *)
 This routine will be called when the appropriate signal arrives.
void update (const BeginOfTrack *)
 This routine will be called when the appropriate signal arrives.
void update (const EndOfTrack *)
 This routine will be called when the appropriate signal arrives.
void update (const BeginOfJob *)
 This routine will be called when the appropriate signal arrives.

Private Attributes

double rMax
MaterialBudgetCastorHistostheHistoCastor
MaterialBudgetHcalHistostheHistoHcal
double zMax

Detailed Description

Definition at line 18 of file MaterialBudgetHcal.h.


Constructor & Destructor Documentation

MaterialBudgetHcal::MaterialBudgetHcal ( const edm::ParameterSet p)

Definition at line 20 of file MaterialBudgetHcal.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m, rMax, theHistoCastor, theHistoHcal, and zMax.

                                                              : 
  theHistoHcal(0), theHistoCastor(0) {
  
  edm::ParameterSet m_p = p.getParameter<edm::ParameterSet>("MaterialBudgetHcal");
  rMax        = m_p.getUntrackedParameter<double>("RMax", 4.5)*m;
  zMax        = m_p.getUntrackedParameter<double>("ZMax", 13.0)*m;
  bool doHcal = m_p.getUntrackedParameter<bool>("DoHCAL", true);
  edm::LogInfo("MaterialBudget") << "MaterialBudgetHcal initialized with rMax "
                                 << rMax << " mm and zMax " << zMax << " mm"
                                 << " doHcal is set to " << doHcal;
  if (doHcal)   theHistoHcal   = new MaterialBudgetHcalHistos(m_p);
  else          theHistoCastor = new MaterialBudgetCastorHistos(m_p);
}
MaterialBudgetHcal::~MaterialBudgetHcal ( ) [virtual]

Definition at line 34 of file MaterialBudgetHcal.cc.

References theHistoCastor, and theHistoHcal.

                                        {
  if (theHistoHcal)   delete theHistoHcal;
  if (theHistoCastor) delete theHistoCastor;
}
MaterialBudgetHcal::MaterialBudgetHcal ( const MaterialBudgetHcal ) [private]

Member Function Documentation

const MaterialBudgetHcal& MaterialBudgetHcal::operator= ( const MaterialBudgetHcal ) [private]
bool MaterialBudgetHcal::stopAfter ( const G4Step *  aStep) [private]

Definition at line 75 of file MaterialBudgetHcal.cc.

References abs, LogDebug, rMax, findQualityFiles::rr, and zMax.

Referenced by update().

                                                      {

  G4ThreeVector hitPoint    = aStep->GetPreStepPoint()->GetPosition();
  double        rr = hitPoint.perp();
  double        zz = std::abs(hitPoint.z());

  if (rr > rMax || zz > zMax) {
    LogDebug("MaterialBudget") << " MaterialBudgetHcal::StopAfter R = " << rr
                               << " and Z = " << zz;
    return true;
  } else {
    return false;
  }
}
void MaterialBudgetHcal::update ( const EndOfTrack ) [private, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 69 of file MaterialBudgetHcal.cc.

References MaterialBudgetCastorHistos::fillEndTrack(), MaterialBudgetHcalHistos::fillEndTrack(), theHistoCastor, and theHistoHcal.

void MaterialBudgetHcal::update ( const G4Step *  ) [private, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 55 of file MaterialBudgetHcal.cc.

References MaterialBudgetCastorHistos::fillPerStep(), MaterialBudgetHcalHistos::fillPerStep(), stopAfter(), theHistoCastor, and theHistoHcal.

                                                   {

  //---------- each step
  if (theHistoHcal)   theHistoHcal->fillPerStep(aStep);
  if (theHistoCastor) theHistoCastor->fillPerStep(aStep);

  //----- Stop tracking after selected position
  if (stopAfter(aStep)) {
    G4Track* track = aStep->GetTrack();
    track->SetTrackStatus( fStopAndKill );
  }
}
void MaterialBudgetHcal::update ( const BeginOfTrack ) [private, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 48 of file MaterialBudgetHcal.cc.

References MaterialBudgetHcalHistos::fillStartTrack(), MaterialBudgetCastorHistos::fillStartTrack(), theHistoCastor, and theHistoHcal.

                                                       {

  const G4Track * aTrack = (*trk)(); // recover G4 pointer if wanted
  if (theHistoHcal)   theHistoHcal->fillStartTrack(aTrack);
  if (theHistoCastor) theHistoCastor->fillStartTrack(aTrack);
}
void MaterialBudgetHcal::update ( const BeginOfJob ) [private, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 39 of file MaterialBudgetHcal.cc.

References MaterialBudgetHcalHistos::fillBeginJob(), and theHistoHcal.

                                                     {
  //----- Check that selected volumes are indeed part of the geometry
  // Numbering From DDD
  edm::ESTransientHandle<DDCompactView> pDD;
  (*job)()->get<IdealGeometryRecord>().get(pDD);
  if (theHistoHcal)   theHistoHcal->fillBeginJob((*pDD));

}

Member Data Documentation

double MaterialBudgetHcal::rMax [private]

Definition at line 43 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), and stopAfter().

Definition at line 42 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), update(), and ~MaterialBudgetHcal().

Definition at line 41 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), update(), and ~MaterialBudgetHcal().

double MaterialBudgetHcal::zMax [private]

Definition at line 43 of file MaterialBudgetHcal.h.

Referenced by MaterialBudgetHcal(), and stopAfter().