CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

CaloSD Class Reference

#include <CaloSD.h>

Inheritance diagram for CaloSD:
SensitiveCaloDetector Observer< const BeginOfRun * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const EndOfTrack * > Observer< const EndOfEvent * > SensitiveDetector CastorSD DreamSD ECalSD EcalTBH4BeamSD HCalSD HcalTB02SD HcalTB06BeamSD ZdcSD

List of all members.

Public Member Functions

 CaloSD (G4String aSDname, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *, int tSlice=1, bool ignoreTkID=false)
virtual void clear ()
virtual void DrawAll ()
virtual void EndOfEvent (G4HCofThisEvent *eventHC)
void fillHits (edm::PCaloHitContainer &, std::string n)
virtual double getEnergyDeposit (G4Step *step)
virtual void Initialize (G4HCofThisEvent *HCE)
virtual void PrintAll ()
virtual bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *)
virtual bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory)
virtual uint32_t setDetUnitId (G4Step *step)=0
virtual ~CaloSD ()

Protected Member Functions

G4bool checkHit ()
virtual void clearHits ()
CaloG4HitcreateNewHit ()
virtual bool filterHit (CaloG4Hit *, double)
double getAttenuation (G4Step *aStep, double birk1, double birk2, double birk3)
virtual uint16_t getDepth (G4Step *)
double getResponseWt (G4Track *)
virtual G4bool getStepInfo (G4Step *aStep)
virtual int getTrackID (G4Track *)
G4bool hitExists ()
virtual void initRun ()
void resetForNewPrimary (G4ThreeVector, double)
G4ThreeVector setToLocal (G4ThreeVector, const G4VTouchable *)
virtual void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives.
virtual void update (const EndOfTrack *trk)
 This routine will be called when the appropriate signal arrives.
virtual void update (const BeginOfEvent *)
 This routine will be called when the appropriate signal arrives.
virtual void update (const ::EndOfEvent *)
virtual void update (const BeginOfRun *)
 This routine will be called when the appropriate signal arrives.
void updateHit (CaloG4Hit *)

Protected Attributes

int checkHits
double correctT
bool corrTOFBeam
CaloG4HitcurrentHit
CaloHitID currentID
float edepositEM
float edepositHAD
double eminHit
double eminHitD
G4int emPDG
double energyCut
G4ThreeVector entranceLocal
G4ThreeVector entrancePoint
G4int epPDG
bool forceSave
G4int gammaPDG
float incidentEnergy
double kmaxIon
double kmaxNeutron
double kmaxProton
const SimTrackManagerm_trackManager
G4ThreeVector posGlobal
G4StepPoint * preStepPoint
CaloHitID previousID
int primIDSaved
bool runInit
bool suppressHeavy
G4Track * theTrack
double tmaxHit
bool useMap

Private Member Functions

void cleanHitCollection ()
bool saveHit (CaloG4Hit *)
void storeHit (CaloG4Hit *)
void summarize ()

Private Attributes

int cleanIndex
int hcID
std::map< CaloHitID, CaloG4Hit * > hitMap
std::vector< CaloG4Hit * > hitvec
bool ignoreTrackID
CaloMeanResponsemeanResponse
int primAncestor
std::vector< CaloG4Hit * > reusehit
std::vector< unsigned int > selIndex
CaloSlaveSDslave
CaloG4HitCollectiontheHC
int timeSlice
std::map< int, TrackWithHistory * > tkMap
int totalHits

Detailed Description

Definition at line 42 of file CaloSD.h.


Constructor & Destructor Documentation

CaloSD::CaloSD ( G4String  aSDname,
const DDCompactView cpv,
SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager,
int  tSlice = 1,
bool  ignoreTkID = false 
)

Definition at line 21 of file CaloSD.cc.

References SensitiveDetector::AssignSD(), checkHits, cleanIndex, correctT, corrTOFBeam, currentID, eminHit, eminHitD, energyCut, forceSave, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ignoreTrackID, gen::k, kmaxIon, kmaxNeutron, kmaxProton, LogDebug, SensitiveDetectorCatalog::logicalNames(), meanResponse, previousID, primAncestor, SensitiveDetector::Register(), slave, suppressHeavy, timeSlice, tmaxHit, totalHits, and useMap.

                                            : 
  SensitiveCaloDetector(name, cpv, clg, p),
  G4VGFlashSensitiveDetector(), theTrack(0), preStepPoint(0), eminHit(0), 
  eminHitD(0), m_trackManager(manager), currentHit(0), runInit(false),
  timeSlice(tSlice), ignoreTrackID(ignoreTkID), hcID(-1), theHC(0), 
  meanResponse(0) {

  //Add Hcal Sentitive Detector Names

  collectionName.insert(name);

  //Parameters
  edm::ParameterSet m_CaloSD = p.getParameter<edm::ParameterSet>("CaloSD");
  energyCut    = m_CaloSD.getParameter<double>("EminTrack")*GeV;
  tmaxHit      = m_CaloSD.getParameter<double>("TmaxHit")*ns;
  std::vector<double> eminHits = m_CaloSD.getParameter<std::vector<double> >("EminHits");
  std::vector<double> tmaxHits = m_CaloSD.getParameter<std::vector<double> >("TmaxHits");
  std::vector<std::string> hcn = m_CaloSD.getParameter<std::vector<std::string> >("HCNames");
  std::vector<int>   useResMap = m_CaloSD.getParameter<std::vector<int> >("UseResponseTables");
  std::vector<double> eminHitX = m_CaloSD.getParameter<std::vector<double> >("EminHitsDepth");
  suppressHeavy= m_CaloSD.getParameter<bool>("SuppressHeavy");
  kmaxIon      = m_CaloSD.getParameter<double>("IonThreshold")*MeV;
  kmaxProton   = m_CaloSD.getParameter<double>("ProtonThreshold")*MeV;
  kmaxNeutron  = m_CaloSD.getParameter<double>("NeutronThreshold")*MeV;
  checkHits    = m_CaloSD.getUntrackedParameter<int>("CheckHits", 25);
  useMap       = m_CaloSD.getUntrackedParameter<bool>("UseMap", true);
  int verbn    = m_CaloSD.getUntrackedParameter<int>("Verbosity", 0);
  bool on      = m_CaloSD.getUntrackedParameter<bool>("DetailedTiming",false);
  corrTOFBeam  = m_CaloSD.getParameter<bool>("CorrectTOFBeam");
  double beamZ = m_CaloSD.getParameter<double>("BeamPosition")*cm;
  correctT     = beamZ/c_light/nanosecond;

  SetVerboseLevel(verbn);
  for (unsigned int k=0; k<hcn.size(); k++) {
    if (name == (G4String)(hcn[k])) {
      if (k < eminHits.size()) eminHit = eminHits[k]*MeV;
      if (k < eminHitX.size()) eminHitD= eminHitX[k]*MeV;
      if (k < tmaxHits.size()) tmaxHit = tmaxHits[k]*ns;
      if (k < useResMap.size() && useResMap[k] > 0) 
        meanResponse = new CaloMeanResponse(p);
      break;
    }
  }
#ifdef DebugLog
  LogDebug("CaloSim") << "***************************************************" 
                      << "\n"
                      << "*                                                 *" 
                      << "\n"
                      << "* Constructing a CaloSD  with name " << GetName()
                      << "\n"
                      << "*                                                 *" 
                      << "\n"
                      << "***************************************************";
#endif
  slave      = new CaloSlaveSD(name);
  currentID  = CaloHitID(timeSlice, ignoreTrackID);
  previousID = CaloHitID(timeSlice, ignoreTrackID);
  
  primAncestor = 0;
  cleanIndex = 0;
  totalHits = 0;
  forceSave = false;

  //
  // Now attach the right detectors (LogicalVolumes) to me
  //
  std::vector<std::string> lvNames = clg.logicalNames(name);
  this->Register();
  for (std::vector<std::string>::iterator it=lvNames.begin();
       it !=lvNames.end(); it++){
    this->AssignSD(*it);
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD : Assigns SD to LV " << (*it);
#endif
  }

  // timer initialization
  if (on) {
  //     string trname("CaloSD:");
  //     theHitTimer.init( trname + name + ":hits", true);
  //   }
  //   else {
  //     theHitTimer.init( "CaloSensitiveDetector:hits", true);
  }

  edm::LogInfo("CaloSim") << "CaloSD: Minimum energy of track for saving it " 
                          << energyCut/GeV  << " GeV" << "\n"
                          << "        Use of HitID Map " << useMap << "\n"
                          << "        Check last " << checkHits 
                          << " before saving the hit\n" 
                          << "        Correct TOF globally by " << correctT
                          << " ns (Flag =" << corrTOFBeam << ")\n"
                          << "        Save hits recorded before " << tmaxHit
                          << " ns and if energy is above " << eminHit/MeV
                          << " MeV (for depth 0) or " << eminHitD/MeV
                          << " MeV (for nonzero depths); Time Slice Unit " 
                          << timeSlice << " Ignore TrackID Flag " 
                          << ignoreTrackID;
}
CaloSD::~CaloSD ( ) [virtual]

Definition at line 124 of file CaloSD.cc.

References meanResponse, slave, and theHC.

                { 
  if (slave)           delete slave; 
  if (theHC)           delete theHC;
  if (meanResponse)    delete meanResponse;
}

Member Function Documentation

G4bool CaloSD::checkHit ( ) [protected]

Definition at line 343 of file CaloSD.cc.

References checkHits, currentHit, currentID, newFWLiteAna::found, hitMap, j, theHC, updateHit(), and useMap.

Referenced by HCalSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), HCalSD::hitForFibre(), and ProcessHits().

                        {
  
  //look in the HitContainer whether a hit with the same ID already exists:
  bool       found = false;
  if (useMap) {
    std::map<CaloHitID,CaloG4Hit*>::const_iterator it = hitMap.find(currentID);
    if (it != hitMap.end()) {
      currentHit = it->second;
      found      = true;
    }
  } else {
    if (checkHits <= 0) return false;
    int  minhit= (theHC->entries()>checkHits ? theHC->entries()-checkHits : 0);
    int  maxhit= theHC->entries()-1;
    
    for (int j=maxhit; j>minhit&&!found; j--) {
      if ((*theHC)[j]->getID() == currentID) {
        currentHit = (*theHC)[j];
        found      = true;
      }
    }          
  }
  
  if (found) {
    updateHit(currentHit);
    return true;
  } else {
    return false;
  }    
  
}
void CaloSD::cleanHitCollection ( ) [private]

Definition at line 718 of file CaloSD.cc.

References cleanIndex, correctT, corrTOFBeam, filterHit(), CaloG4Hit::getTimeSlice(), hitMap, hitvec, i, j, LogDebug, evf::evtn::offset(), reusehit, selIndex, python::multivaluedict::sort(), swap(), theHC, cond::rpcobgas::time, totalHits, and useMap.

Referenced by EndOfEvent(), and update().

                                {

  std::vector<CaloG4Hit*>* theCollection = theHC->GetVector();

#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: collection before merging, size = " << theHC->entries();
#endif
  
  selIndex.reserve(theHC->entries()-cleanIndex);
  if ( reusehit.size() == 0 ) { 
    reusehit.reserve(theHC->entries()-cleanIndex); 
  }

  // if no map used, merge before hits to have the save situation as a map
  if ( !useMap ) {
    hitvec.swap(*theCollection);
    sort((hitvec.begin()+cleanIndex), hitvec.end(), CaloG4HitLess());
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD: cleanHitCollection sort the hits in buffer starting from element = " << cleanIndex;
    for ( unsigned int i = 0; i<hitvec.size(); i++) {
      LogDebug("CaloSim") << i << " " << *hitvec[i];
    }
#endif
    unsigned int i, j;
    CaloG4HitEqual equal;
    for (i=cleanIndex; i<hitvec.size(); i++) {
      selIndex.push_back(i-cleanIndex);
      int jump = 0;
      for (j = i+1; j <hitvec.size() && equal(hitvec[i], hitvec[j]); j++) {
        jump++;
        // merge j to i
        (*hitvec[i]).addEnergyDeposit(*hitvec[j]);
        (*hitvec[j]).setEM(0.);
        (*hitvec[j]).setHadr(0.);
        reusehit.push_back(hitvec[j]);
      }
      i+=jump;
    }
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD: cleanHitCollection merge the hits in buffer ";
    for ( unsigned int i = 0; i<hitvec.size(); i++) {
      LogDebug("CaloSim") << i << " " << *hitvec[i];
    }
#endif
    for ( unsigned int i = cleanIndex; i < cleanIndex+selIndex.size(); i++ ) {
      hitvec[i] = hitvec[selIndex[i-cleanIndex]+cleanIndex];
    }
    hitvec.resize(cleanIndex+selIndex.size());
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD: cleanHitCollection remove the merged hits in buffer, new size = " << hitvec.size();
    for ( unsigned int i = 0; i<hitvec.size(); i++) {
      LogDebug("CaloSim") << i << " " << *hitvec[i];
    }
#endif
    hitvec.swap(*theCollection);
    std::vector<CaloG4Hit*>().swap(hitvec);
    selIndex.clear();
    totalHits = theHC->entries();
  }

#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: collection after merging, size = " << theHC->entries();
#endif

  
  int addhit = 0;

#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Size of reusehit after merge = " << reusehit.size();
  LogDebug("CaloSim") << "CaloSD: Starting hit selection from index = " << cleanIndex;
#endif
  
  selIndex.reserve(theCollection->size()-cleanIndex);
  for (unsigned int i = cleanIndex; i<theCollection->size(); i++) {
    
    CaloG4Hit* aHit((*theCollection)[i]);
    
    // selection
    
    double time = aHit->getTimeSlice();
    if (corrTOFBeam) time += correctT;
    if (!filterHit(aHit,time)) {
#ifdef DebugLog
      LogDebug("CaloSim") << "CaloSD: dropped CaloG4Hit " << " " << *aHit; 
#endif
      
      // create the list of hits to be reused
      
      reusehit.push_back((*theCollection)[i]);
      addhit++;
    } else { selIndex.push_back(i-cleanIndex); }
  }

#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Size of reusehit after selection = " << reusehit.size()  
                      << " Number of added hit = " << addhit;
#endif
  if (useMap) {
    if ( addhit>0 ) {
      int offset = reusehit.size()-addhit;
      for (int ii = addhit-1; ii>=0; ii--) {
        CaloHitID theID = reusehit[offset+ii]->getID();
        hitMap.erase(theID);
      }
    }
  }
  for ( unsigned int j = 0; j<selIndex.size(); j++ ) {
    (*theCollection)[cleanIndex+j] = (*theCollection)[cleanIndex+selIndex[j]];
  }
  theCollection->resize(cleanIndex+selIndex.size());
  std::vector<unsigned int>().swap(selIndex);

#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: hit collection after selection, size = " << theHC->entries();
  theHC->PrintAllHits();
#endif
    
  cleanIndex = theHC->entries();
  
}
void CaloSD::clear ( void  ) [virtual]

Definition at line 251 of file CaloSD.cc.

{} 
void CaloSD::clearHits ( ) [protected, virtual]

Implements SensitiveDetector.

Definition at line 576 of file CaloSD.cc.

References cleanIndex, hitMap, i, CaloSlaveSD::Initialize(), LogDebug, previousID, primIDSaved, CaloHitID::reset(), reusehit, slave, swap(), and useMap.

Referenced by update().

                       {
  
  if (useMap) hitMap.erase (hitMap.begin(), hitMap.end());
  for (unsigned int i = 0; i<reusehit.size(); i++) { delete reusehit[i]; }
  std::vector<CaloG4Hit*>().swap(reusehit);
  cleanIndex = 0;
  previousID.reset();
  primIDSaved    = -99;
#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Clears hit vector for " << GetName() << " " 
                      << slave;
#endif
  slave->Initialize();
#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Initialises slave SD for " << GetName();
#endif
}
CaloG4Hit * CaloSD::createNewHit ( ) [protected]

Definition at line 375 of file CaloSD.cc.

References currentID, CaloHitID::depth(), edepositEM, edepositHAD, energyCut, entranceLocal, entrancePoint, forceSave, incidentEnergy, LogDebug, TrackWithHistory::momentum(), NULL, posGlobal, primIDSaved, TrackInformation::putInHistory(), reusehit, TrackWithHistory::save(), CaloG4Hit::setEM(), CaloG4Hit::setEntry(), CaloG4Hit::setEntryLocal(), CaloG4Hit::setHadr(), CaloG4Hit::setID(), CaloG4Hit::setIncidentEnergy(), CaloG4Hit::setPosition(), mathSSE::sqrt(), storeHit(), TrackInformation::storeTrack(), theTrack, CaloHitID::timeSliceID(), tkMap, totalHits, CaloHitID::trackID(), CaloHitID::unitID(), updateHit(), and useMap.

Referenced by ZdcSD::getFromLibrary(), HCalSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), HCalSD::hitForFibre(), ProcessHits(), ZdcSD::ProcessHits(), DreamSD::ProcessHits(), and HCalSD::ProcessHits().

                                {
  
#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD::CreateNewHit for"
                      << " Unit " << currentID.unitID() 
                      << " " << currentID.depth()
                      << " Edeposit = " << edepositEM << " " << edepositHAD;
  LogDebug("CaloSim") << " primary "    << currentID.trackID()
                      << " time slice " << currentID.timeSliceID()
                      << " For Track  " << theTrack->GetTrackID()
                      << " which is a " <<theTrack->GetDefinition()->GetParticleName()
                      << " of energy "  << theTrack->GetKineticEnergy()/GeV
                      << " " << theTrack->GetMomentum().mag()/GeV
                      << " daughter of part. " << theTrack->GetParentID()
                      << " and created by " ;
  
  if (theTrack->GetCreatorProcess()!=NULL)
    LogDebug("CaloSim") << theTrack->GetCreatorProcess()->GetProcessName() ;
  else 
    LogDebug("CaloSim") << "NO process";
#endif  
  
  CaloG4Hit* aHit;
  if (reusehit.size() > 0) {
    aHit = reusehit[0];
    aHit->setEM(0.);
    aHit->setHadr(0.);
    reusehit.erase(reusehit.begin());
  }  else { 
    aHit = new CaloG4Hit;
  }
  
  aHit->setID(currentID);
  aHit->setEntry(entrancePoint.x(),entrancePoint.y(),entrancePoint.z());
  aHit->setEntryLocal(entranceLocal.x(),entranceLocal.y(),entranceLocal.z());
  aHit->setPosition(posGlobal.x(),posGlobal.y(),posGlobal.z());
  aHit->setIncidentEnergy(incidentEnergy);
  updateHit(aHit);
  
  storeHit(aHit);
  double etrack = 0;
  if (currentID.trackID() == primIDSaved) { // The track is saved; nothing to be done
  } else if (currentID.trackID() == theTrack->GetTrackID()) {
    etrack= theTrack->GetKineticEnergy();
    //    edm::LogInfo("CaloSim") << "CaloSD: set save the track " << currentID.trackID() << " etrack " << etrack << " eCut " << energyCut << " flag " << forceSave;
    if (etrack >= energyCut || forceSave) {
      TrackInformation * trkInfo = 
        (TrackInformation *)(theTrack->GetUserInformation());
      trkInfo->storeTrack(true);
      trkInfo->putInHistory();
      //      trkInfo->setAncestor();
#ifdef DebugLog
      LogDebug("CaloSim") << "CaloSD: set save the track " 
                          << currentID.trackID() << " with Hit";
#endif
    }
  } else {
    TrackWithHistory * trkh = tkMap[currentID.trackID()];
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD : TrackwithHistory pointer for " 
                        << currentID.trackID() << " is " << trkh;
#endif
    if (trkh != NULL) {
      etrack = sqrt(trkh->momentum().Mag2());
      if (etrack >= energyCut) {
        trkh->save();
#ifdef DebugLog
        LogDebug("CaloSim") << "CaloSD: set save the track " 
                            << currentID.trackID() << " with Hit";
#endif
      }
    }
  }
  primIDSaved = currentID.trackID();
  if (useMap) totalHits++;
  return aHit;
}        
void CaloSD::DrawAll ( ) [virtual]

Definition at line 253 of file CaloSD.cc.

{} 
void CaloSD::EndOfEvent ( G4HCofThisEvent *  eventHC) [virtual]

Reimplemented from SensitiveDetector.

Definition at line 238 of file CaloSD.cc.

References cleanHitCollection(), and theHC.

                                         {

  // clean the hits for the last tracks
  
  cleanHitCollection();
  
#ifdef DebugLog
  edm::LogInfo("CaloSim") << "CaloSD: EndofEvent entered with " << theHC->entries()
                      << " entries";
#endif
  //  TimeMe("CaloSD:sortAndMergeHits",false);
}
void CaloSD::fillHits ( edm::PCaloHitContainer c,
std::string  n 
) [virtual]

Implements SensitiveCaloDetector.

Definition at line 262 of file CaloSD.cc.

References CaloSlaveSD::Clean(), CaloSlaveSD::hits(), n, CaloSlaveSD::name(), and slave.

                                                         {
  if (slave->name() == n) c=slave->hits();
  slave->Clean();
}
bool CaloSD::filterHit ( CaloG4Hit hit,
double  time 
) [protected, virtual]

Reimplemented in HCalSD.

Definition at line 620 of file CaloSD.cc.

References eminHit, eminHitD, CaloG4Hit::getDepth(), CaloG4Hit::getEnergyDeposit(), LogDebug, and tmaxHit.

Referenced by cleanHitCollection().

                                                  {
  double emin(eminHit);
  if (hit->getDepth() > 0) emin = eminHitD;
#ifdef DebugLog
  LogDebug("CaloSim") << "Depth " << hit->getDepth() << " Emin = " << emin << " (" << eminHit << ", " << eminHitD << ")";
#endif   
  return ((time <= tmaxHit) && (hit->getEnergyDeposit() > emin));
}
double CaloSD::getAttenuation ( G4Step *  aStep,
double  birk1,
double  birk2,
double  birk3 
) [protected]

Definition at line 480 of file CaloSD.cc.

References abs, trackerHits::c, DeDxDiscriminatorTools::charge(), LogDebug, and CommonMethods::weight().

Referenced by HCalSD::getEnergyDeposit(), ECalSD::getEnergyDeposit(), EcalTBH4BeamSD::getEnergyDeposit(), HcalTB02SD::getEnergyDeposit(), HcalTB06BeamSD::getEnergyDeposit(), and DreamSD::getStepInfo().

                                            {

  double weight = 1.;
  double charge = aStep->GetPreStepPoint()->GetCharge();

  if (charge != 0. && aStep->GetStepLength() > 0) {
    G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
    double density = mat->GetDensity();
    double dedx    = aStep->GetTotalEnergyDeposit()/aStep->GetStepLength();
    double rkb     = birk1/density;
    double c       = birk2*rkb*rkb;
    if (std::abs(charge) >= 2.) rkb /= birk3; // based on alpha particle data
    weight = 1./(1.+rkb*dedx+c*dedx*dedx);
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD::getAttenuation in " << mat->GetName() 
                        << " Charge " << charge << " dE/dx " << dedx 
                        << " Birk Const " << rkb << ", " << c << " Weight = " 
                        << weight << " dE " << aStep->GetTotalEnergyDeposit();
#endif
  }
  return weight;
}
uint16_t CaloSD::getDepth ( G4Step *  ) [protected, virtual]

Reimplemented in ECalSD.

Definition at line 618 of file CaloSD.cc.

Referenced by getStepInfo(), and ProcessHits().

{ return 0; }
double CaloSD::getEnergyDeposit ( G4Step *  step) [virtual]

Reimplemented in ECalSD, HCalSD, EcalTBH4BeamSD, CastorSD, HcalTB02SD, and HcalTB06BeamSD.

Definition at line 217 of file CaloSD.cc.

Referenced by getStepInfo().

                                             {
  return aStep->GetTotalEnergyDeposit();
}
double CaloSD::getResponseWt ( G4Track *  aTrack) [protected]

Definition at line 629 of file CaloSD.cc.

References TrackInformation::genParticleP(), TrackInformation::genParticlePID(), CaloMeanResponse::getWeight(), and meanResponse.

Referenced by HCalSD::getEnergyDeposit(), and ECalSD::getEnergyDeposit().

                                            {

  if (meanResponse) {
    TrackInformation * trkInfo = (TrackInformation *)(aTrack->GetUserInformation());
    return meanResponse->getWeight(trkInfo->genParticlePID(), 
                                   trkInfo->genParticleP());
  } else {
    return 1;
  }
}
bool CaloSD::getStepInfo ( G4Step *  aStep) [protected, virtual]

Reimplemented in DreamSD.

Definition at line 267 of file CaloSD.cc.

References currentID, edepositEM, edepositHAD, emPDG, epPDG, gammaPDG, getDepth(), getEnergyDeposit(), getTrackID(), LogDebug, preStepPoint, setDetUnitId(), CaloHitID::setID(), theTrack, cond::rpcobgas::time, and CaloHitID::unitID().

Referenced by ProcessHits(), ZdcSD::ProcessHits(), and HCalSD::ProcessHits().

                                      {
  
  preStepPoint = aStep->GetPreStepPoint(); 
  theTrack     = aStep->GetTrack();   
  
  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
  if (particleCode == emPDG ||
      particleCode == epPDG ||
      particleCode == gammaPDG ) {
    edepositEM  = getEnergyDeposit(aStep); edepositHAD = 0.;
  } else {
    edepositEM  = 0.; edepositHAD = getEnergyDeposit(aStep);
  }
  
  double       time  = (aStep->GetPostStepPoint()->GetGlobalTime())/nanosecond;
  unsigned int unitID= setDetUnitId(aStep);
  uint16_t     depth = getDepth(aStep);
  int          primaryID = getTrackID(theTrack);
  
  bool flag = (unitID > 0);
  if (flag) {
    currentID.setID(unitID, time, primaryID, depth);
#ifdef DebugLog
    G4TouchableHistory* touch =(G4TouchableHistory*)(theTrack->GetTouchable());
    LogDebug("CaloSim") << "CaloSD:: GetStepInfo for"
                        << " PV "     << touch->GetVolume(0)->GetName()
                        << " PVid = " << touch->GetReplicaNumber(0)
                        << " MVid = " << touch->GetReplicaNumber(1)
                        << " Unit   " << currentID.unitID() 
                        << " Edeposit = " << edepositEM << " " << edepositHAD;
  } else {
    G4TouchableHistory* touch =(G4TouchableHistory*)(theTrack->GetTouchable());
    LogDebug("CaloSim") << "CaloSD:: GetStepInfo for"
                        << " PV "     << touch->GetVolume(0)->GetName()
                        << " PVid = " << touch->GetReplicaNumber(0)
                        << " MVid = " << touch->GetReplicaNumber(1)
                        << " Unit   " << std::hex << unitID << std::dec 
                        << " Edeposit = " << edepositEM << " " << edepositHAD;
#endif
  }
  return flag;
}
int CaloSD::getTrackID ( G4Track *  aTrack) [protected, virtual]

Reimplemented in ECalSD.

Definition at line 596 of file CaloSD.cc.

References forceSave, TrackInformation::getIDonCaloSurface(), LogDebug, and preStepPoint.

Referenced by getStepInfo(), and ProcessHits().

                                      {

  int primaryID = 0;
  forceSave = false;
  TrackInformation* trkInfo=(TrackInformation *)(aTrack->GetUserInformation());
  if (trkInfo) {
    primaryID = trkInfo->getIDonCaloSurface();  
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD: hit update from track Id on Calo Surface " 
                        << trkInfo->getIDonCaloSurface();
#endif   
  } else {
    primaryID = aTrack->GetTrackID();
#ifdef DebugLog
    edm::LogWarning("CaloSim") << "CaloSD: Problem with primaryID **** set by "
                               << "force to TkID **** " << primaryID << " in "
                               << preStepPoint->GetTouchable()->GetVolume(0)->GetName();
#endif
  }
  return primaryID;
}
G4bool CaloSD::hitExists ( ) [protected]

Definition at line 319 of file CaloSD.cc.

References checkHit(), currentHit, currentID, posGlobal, preStepPoint, previousID, resetForNewPrimary(), CaloHitID::trackID(), and updateHit().

Referenced by ProcessHits(), ZdcSD::ProcessHits(), DreamSD::ProcessHits(), and HCalSD::ProcessHits().

                         {
   
#ifdef DebugLog
  if (currentID.trackID()<1) {
    edm::LogWarning("CaloSim") << "***** CaloSD error: primaryID = " 
                               << currentID.trackID()
                               << " maybe detector name changed";
  }
#endif  
  // Update if in the same detector, time-slice and for same track   
  if (currentID == previousID) {
    updateHit(currentHit);
    return true;
  }
  
  // Reset entry point for new primary
  posGlobal = preStepPoint->GetPosition();
  if (currentID.trackID() != previousID.trackID()) 
    resetForNewPrimary(preStepPoint->GetPosition(),
                       preStepPoint->GetKineticEnergy());
  
  return checkHit();
}
void CaloSD::Initialize ( G4HCofThisEvent *  HCE) [virtual]

Reimplemented from SensitiveDetector.

Definition at line 221 of file CaloSD.cc.

References hcID, theHC, and totalHits.

                                             { 
  
  totalHits = 0;
  
#ifdef DebugLog
  edm::LogInfo("CaloSim") << "CaloSD : Initialize called for " << GetName(); 
#endif
  
  //This initialization is performed at the beginning of an event
  //------------------------------------------------------------
  theHC = new CaloG4HitCollection(GetName(), collectionName[0]);
  
  if (hcID<0) 
    hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
  HCE->AddHitsCollection(hcID, theHC);
}
void CaloSD::initRun ( ) [protected, virtual]

Reimplemented in HCalSD, DreamSD, CastorSD, and ZdcSD.

Definition at line 594 of file CaloSD.cc.

Referenced by update().

{}
void CaloSD::PrintAll ( ) [virtual]

Definition at line 255 of file CaloSD.cc.

References theHC.

                      {
#ifdef DebugLog
  edm::LogInfo("CaloSim") << "CaloSD: Collection " << theHC->GetName();
#endif
  theHC->PrintAllHits();
} 
bool CaloSD::ProcessHits ( G4GFlashSpot *  aSpot,
G4TouchableHistory *   
) [virtual]

Definition at line 146 of file CaloSD.cc.

References checkHit(), createNewHit(), currentHit, currentID, edepositEM, edepositHAD, emPDG, entranceLocal, entrancePoint, epPDG, gammaPDG, getDepth(), getTrackID(), incidentEnergy, LogDebug, NULL, posGlobal, preStepPoint, previousID, setDetUnitId(), CaloHitID::setID(), theTrack, cond::rpcobgas::time, CaloHitID::trackID(), CaloHitID::unitID(), and updateHit().

                                                                 {
        
  if (aSpot != NULL) {
    
    theTrack = const_cast<G4Track *>(aSpot->GetOriginatorTrack()->GetPrimaryTrack());
    G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
    
    if (particleCode == emPDG ||
        particleCode == epPDG ||
        particleCode == gammaPDG ) {
      edepositEM  = aSpot->GetEnergySpot()->GetEnergy(); edepositHAD = 0.;
    } else {
      edepositEM  = 0.;  edepositHAD = 0.;
    }
        
    if (edepositEM>0.)  {
      G4Step *      fFakeStep          = new G4Step();
      preStepPoint                     = fFakeStep->GetPreStepPoint();
      G4StepPoint * fFakePostStepPoint = fFakeStep->GetPostStepPoint();
      preStepPoint->SetPosition(aSpot->GetPosition());
      fFakePostStepPoint->SetPosition(aSpot->GetPosition());
      
      G4TouchableHandle fTouchableHandle   = aSpot->GetTouchableHandle();
      preStepPoint->SetTouchableHandle(fTouchableHandle);
      fFakeStep->SetTotalEnergyDeposit(aSpot->GetEnergySpot()->GetEnergy());
      
      double       time   = 0;
      unsigned int unitID = setDetUnitId(fFakeStep);
      int          primaryID = getTrackID(theTrack);
      uint16_t     depth = getDepth(fFakeStep);

      if (unitID > 0) {
        currentID.setID(unitID, time, primaryID, depth);
#ifdef DebugLog
        LogDebug("CaloSim") << "CaloSD:: GetSpotInfo for"
                            << " Unit 0x" << std::hex << currentID.unitID() 
                            << std::dec << " Edeposit = " << edepositEM << " " 
                            << edepositHAD;
#endif
        // Update if in the same detector, time-slice and for same track   
        if (currentID == previousID) {
          updateHit(currentHit);
        } else {
          
          posGlobal = aSpot->GetEnergySpot()->GetPosition();
          // Reset entry point for new primary
          if (currentID.trackID() != previousID.trackID()) {
            entrancePoint  = aSpot->GetPosition();
            entranceLocal  = aSpot->GetTouchableHandle()->GetHistory()->
              GetTopTransform().TransformPoint(entrancePoint);
            incidentEnergy = theTrack->GetKineticEnergy();
#ifdef DebugLog
            LogDebug("CaloSim") << "CaloSD: Incident energy " 
                                << incidentEnergy/GeV << " GeV and" 
                                << " entrance point " << entrancePoint 
                                << " (Global) " << entranceLocal << " (Local)";
#endif
          }
          
          if (checkHit() == false) currentHit = createNewHit();
        }
      }
      
      delete    fFakeStep;
    }
    return true;
    
  } 
  return false;
}                                   
bool CaloSD::ProcessHits ( G4Step *  step,
G4TouchableHistory *  tHistory 
) [virtual]

Implements SensitiveDetector.

Reimplemented in HCalSD, DreamSD, and ZdcSD.

Definition at line 130 of file CaloSD.cc.

References createNewHit(), currentHit, edepositEM, edepositHAD, getStepInfo(), hitExists(), SensitiveDetector::NaNTrap(), and NULL.

                                                              {
  //  TimeMe t1( theHitTimer, false);
  
  NaNTrap( aStep ) ;
  
  if (aStep == NULL) {
    return true;
  } else {
    if (getStepInfo(aStep)) {
      if (hitExists() == false && edepositEM+edepositHAD>0.) 
        currentHit = createNewHit();
    }
  }
  return true;
} 
void CaloSD::resetForNewPrimary ( G4ThreeVector  point,
double  energy 
) [protected]

Definition at line 468 of file CaloSD.cc.

References relval_parameters_module::energy, entranceLocal, entrancePoint, incidentEnergy, LogDebug, point, preStepPoint, and setToLocal().

Referenced by ZdcSD::getFromLibrary(), HCalSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), ZdcSD::setTrackID(), HCalSD::setTrackID(), and CastorSD::setTrackID().

                                                                  {
  
  entrancePoint  = point;
  entranceLocal  = setToLocal(entrancePoint, preStepPoint->GetTouchable());
  incidentEnergy = energy;
#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Incident energy " << incidentEnergy/GeV 
                      << " GeV and" << " entrance point " << entrancePoint 
                      << " (Global) " << entranceLocal << " (Local)";
#endif
}
bool CaloSD::saveHit ( CaloG4Hit aHit) [private]

Definition at line 653 of file CaloSD.cc.

References correctT, corrTOFBeam, CaloG4Hit::getDepth(), CaloG4Hit::getEM(), CaloG4Hit::getHadr(), CaloG4Hit::getTimeSlice(), CaloG4Hit::getTrackID(), CaloG4Hit::getUnitID(), SimTrackManager::giveMotherNeeded(), LogDebug, m_trackManager, convertSQLiteXML::ok, CaloSlaveSD::processHits(), slave, cond::rpcobgas::time, and SimTrackManager::trackExists().

Referenced by update().

                                    {
  
  int tkID;
  bool ok   = true;
  if (m_trackManager) {
    tkID = m_trackManager->giveMotherNeeded(aHit->getTrackID());
    if (tkID == 0) {
      if (m_trackManager->trackExists(aHit->getTrackID())) 
        tkID = (aHit->getTrackID());
      else
        ok = false;
    }
  } else {
    tkID = aHit->getTrackID();
    ok = false;
  }
  //  edm::LogInfo("CaloSim") << "CalosD: Track ID " << aHit->getTrackID() << " changed to " << tkID << " by SimTrackManager" << " Status " << ok;
#ifdef DebugLog
  LogDebug("CaloSim") << "CalosD: Track ID " << aHit->getTrackID() 
                      << " changed to " << tkID << " by SimTrackManager"
                      << " Status " << ok;
#endif
  double time = aHit->getTimeSlice();
  if (corrTOFBeam) time += correctT;
  slave->processHits(aHit->getUnitID(), aHit->getEM()/GeV, 
                     aHit->getHadr()/GeV, time, tkID, aHit->getDepth());
#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Store Hit at " << std::hex 
                      << aHit->getUnitID() << std::dec << " " 
                      << aHit->getDepth() << " due to " << tkID 
                      << " in time " << time << " of energy " 
                      << aHit->getEM()/GeV << " GeV (EM) and " 
                      << aHit->getHadr()/GeV << " GeV (Hadr)";
#endif
  return ok;
}
virtual uint32_t CaloSD::setDetUnitId ( G4Step *  step) [pure virtual]
G4ThreeVector CaloSD::setToLocal ( G4ThreeVector  global,
const G4VTouchable *  touch 
) [protected]

Definition at line 310 of file CaloSD.cc.

Referenced by HcalTB02SD::curve_LY(), ECalSD::curve_LY(), DreamSD::curve_LY(), ECalSD::getRadiationLength(), resetForNewPrimary(), and HcalTB06BeamSD::setDetUnitId().

                                                            {
  
  G4ThreeVector localPoint = 
    touch->GetHistory()->GetTopTransform().TransformPoint(global);
  
  return localPoint;  
}
void CaloSD::storeHit ( CaloG4Hit hit) [private]

Definition at line 640 of file CaloSD.cc.

References hitMap, previousID, theHC, CaloHitID::trackID(), and useMap.

Referenced by createNewHit().

                                    {
  
  if (previousID.trackID()<0) return;
  if (hit == 0) {
    edm::LogWarning("CaloSim") << "CaloSD: hit to be stored is NULL !!";
    return;
  }
  
  theHC->insert(hit);
  if (useMap) hitMap.insert(std::pair<CaloHitID,CaloG4Hit*>(previousID,hit));
  
}
void CaloSD::summarize ( ) [private]

Definition at line 690 of file CaloSD.cc.

Referenced by update().

{}
void CaloSD::update ( const ::EndOfEvent ) [protected, virtual]

Definition at line 554 of file CaloSD.cc.

References prof2calltree::count, i, convertSQLiteXML::ok, CaloSlaveSD::ReserveMemory(), saveHit(), slave, summarize(), theHC, tkMap, and totalHits.

                                       {

  int count = 0, wrong = 0;
  bool ok;
  
  slave->ReserveMemory(theHC->entries());

  for (int i=0; i<theHC->entries(); i++) {
    ok = saveHit((*theHC)[i]);
    count++;
    if (!ok)  wrong++;
  }
  
  edm::LogInfo("CaloSim") << "CaloSD: " << GetName() << " store " << count
                          << " hits recorded with " << wrong 
                          << " track IDs not given properly and "
                          << totalHits-count << " hits not passing cuts";
  summarize();

  tkMap.erase (tkMap.begin(), tkMap.end());
}
void CaloSD::update ( const BeginOfRun ) [protected, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 504 of file CaloSD.cc.

References emPDG, epPDG, gammaPDG, initRun(), LogDebug, and runInit.

                                      {

  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
  G4String particleName;
  emPDG = theParticleTable->FindParticle(particleName="e-")->GetPDGEncoding();
  epPDG = theParticleTable->FindParticle(particleName="e+")->GetPDGEncoding();
  gammaPDG = theParticleTable->FindParticle(particleName="gamma")->GetPDGEncoding();
#ifdef DebugLog
  LogDebug("CaloSim") << "CaloSD: Particle code for e- = " << emPDG
                      << " for e+ = " << epPDG << " for gamma = " << gammaPDG;
#endif
  initRun();
  runInit = true;
} 
void CaloSD::update ( const BeginOfEvent ) [protected, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 519 of file CaloSD.cc.

References clearHits(), and LogDebug.

                                        {
#ifdef DebugLog
  LogDebug("CaloSim")  << "CaloSD: Dispatched BeginOfEvent for " << GetName() 
                       << " !" ;
#endif
  clearHits();
}
void CaloSD::update ( const EndOfTrack ) [protected, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 527 of file CaloSD.cc.

References TrackInformation::getIDonCaloSurface(), LogDebug, m_trackManager, NULL, tkMap, SimTrackManager::trackContainer(), and TrackWithHistory::trackID().

                                          {

  int id = (*trk)()->GetTrackID();
  TrackInformation *trkI =(TrackInformation *)((*trk)()->GetUserInformation());
  int lastTrackID = -1;
  if (trkI) lastTrackID = trkI->getIDonCaloSurface();
  if (id == lastTrackID) {
    const TrackContainer * trksForThisEvent = m_trackManager->trackContainer();
    if (trksForThisEvent != NULL) {
      int it = (int)(trksForThisEvent->size()) - 1;
      if (it >= 0) {
        TrackWithHistory * trkH = (*trksForThisEvent)[it];
        if (trkH->trackID() == (unsigned int)(id)) tkMap[id] = trkH;
#ifdef DebugLog
        LogDebug("CaloSim") << "CaloSD: get track " << it << " from "
                            << "Container of size " << trksForThisEvent->size()
                            << " with ID " << trkH->trackID();
      } else {
        LogDebug("CaloSim") << "CaloSD: get track " << it << " from "
                            << "Container of size " << trksForThisEvent->size()
                            << " with no ID";
#endif
      }
    }
  }
}
void CaloSD::update ( const BeginOfTrack ) [protected, virtual]

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 692 of file CaloSD.cc.

References cleanHitCollection(), TrackInformation::isPrimary(), LogDebug, primAncestor, and theHC.

                                            {
  
  int primary = -1;
  TrackInformation * trkInfo = (TrackInformation *)((*trk)()->GetUserInformation());
  if ( trkInfo->isPrimary() ) { primary = (*trk)()->GetTrackID(); }
  
#ifdef DebugLog
  LogDebug("CaloSim") << "New track: isPrimary " << trkInfo->isPrimary() 
                      << " primary ID = " << primary 
                      << " primary ancestor ID " << primAncestor;
#endif
  
  // update the information if a different primary track ID 
  
  if (primary > 0 && primary != primAncestor) {
    primAncestor = primary;
    
    // clean the hits information
    
    if (theHC->entries()>0) {
      cleanHitCollection();
    }
    
  }
}
void CaloSD::updateHit ( CaloG4Hit aHit) [protected]

Definition at line 453 of file CaloSD.cc.

References CaloG4Hit::addEnergyDeposit(), currentID, edepositEM, edepositHAD, LogDebug, and previousID.

Referenced by checkHit(), createNewHit(), ZdcSD::getFromLibrary(), HCalSD::getFromLibrary(), CastorSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), HCalSD::hitForFibre(), and ProcessHits().

                                      {

  if (edepositEM+edepositHAD != 0) {
    aHit->addEnergyDeposit(edepositEM,edepositHAD);
#ifdef DebugLog
    LogDebug("CaloSim") << "CaloSD: Add energy deposit in " << currentID 
                        << " em " << edepositEM/MeV << " hadronic " 
                        << edepositHAD/MeV << " MeV"; 
#endif
  }

  // buffer for next steps:
  previousID = currentID;
}

Member Data Documentation

int CaloSD::checkHits [protected]

Definition at line 122 of file CaloSD.h.

Referenced by CaloSD(), and checkHit().

int CaloSD::cleanIndex [private]

Definition at line 150 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), and clearHits().

double CaloSD::correctT [protected]

Definition at line 131 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), and saveHit().

bool CaloSD::corrTOFBeam [protected]

Definition at line 130 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), and saveHit().

float CaloSD::edepositEM [protected]
float CaloSD::edepositHAD [protected]
double CaloSD::eminHit [protected]

Definition at line 121 of file CaloSD.h.

Referenced by CaloSD(), and filterHit().

double CaloSD::eminHitD [protected]

Definition at line 121 of file CaloSD.h.

Referenced by CaloSD(), and filterHit().

G4int CaloSD::emPDG [protected]
double CaloSD::energyCut [protected]

Definition at line 121 of file CaloSD.h.

Referenced by CaloSD(), createNewHit(), HCalSD::getHitFibreBundle(), and HCalSD::getHitPMT().

G4ThreeVector CaloSD::entranceLocal [protected]

Definition at line 110 of file CaloSD.h.

Referenced by createNewHit(), ZdcSD::getFromLibrary(), ProcessHits(), and resetForNewPrimary().

G4ThreeVector CaloSD::entrancePoint [protected]

Definition at line 109 of file CaloSD.h.

Referenced by createNewHit(), ZdcSD::getFromLibrary(), ProcessHits(), and resetForNewPrimary().

G4int CaloSD::epPDG [protected]
bool CaloSD::forceSave [protected]

Definition at line 135 of file CaloSD.h.

Referenced by CaloSD(), createNewHit(), getTrackID(), and ECalSD::getTrackID().

G4int CaloSD::gammaPDG [protected]
int CaloSD::hcID [private]

Definition at line 142 of file CaloSD.h.

Referenced by Initialize().

std::map<CaloHitID,CaloG4Hit*> CaloSD::hitMap [private]

Definition at line 144 of file CaloSD.h.

Referenced by checkHit(), cleanHitCollection(), clearHits(), and storeHit().

std::vector<CaloG4Hit*> CaloSD::hitvec [private]

Definition at line 152 of file CaloSD.h.

Referenced by cleanHitCollection().

bool CaloSD::ignoreTrackID [private]

Definition at line 140 of file CaloSD.h.

Referenced by CaloSD().

float CaloSD::incidentEnergy [protected]

Definition at line 112 of file CaloSD.h.

Referenced by createNewHit(), ProcessHits(), and resetForNewPrimary().

double CaloSD::kmaxIon [protected]
double CaloSD::kmaxNeutron [protected]
double CaloSD::kmaxProton [protected]

Definition at line 125 of file CaloSD.h.

Referenced by saveHit(), and update().

Definition at line 147 of file CaloSD.h.

Referenced by CaloSD(), getResponseWt(), and ~CaloSD().

G4ThreeVector CaloSD::posGlobal [protected]
G4StepPoint* CaloSD::preStepPoint [protected]
int CaloSD::primAncestor [private]

Definition at line 149 of file CaloSD.h.

Referenced by CaloSD(), and update().

int CaloSD::primIDSaved [protected]

Definition at line 113 of file CaloSD.h.

Referenced by clearHits(), and createNewHit().

std::vector<CaloG4Hit*> CaloSD::reusehit [private]

Definition at line 151 of file CaloSD.h.

Referenced by cleanHitCollection(), clearHits(), and createNewHit().

bool CaloSD::runInit [protected]

Definition at line 128 of file CaloSD.h.

Referenced by update().

std::vector<unsigned int> CaloSD::selIndex [private]

Definition at line 153 of file CaloSD.h.

Referenced by cleanHitCollection().

Definition at line 141 of file CaloSD.h.

Referenced by CaloSD(), clearHits(), fillHits(), saveHit(), update(), and ~CaloSD().

bool CaloSD::suppressHeavy [protected]
G4Track* CaloSD::theTrack [protected]
int CaloSD::timeSlice [private]

Definition at line 139 of file CaloSD.h.

Referenced by CaloSD().

std::map<int,TrackWithHistory*> CaloSD::tkMap [private]

Definition at line 146 of file CaloSD.h.

Referenced by createNewHit(), and update().

double CaloSD::tmaxHit [protected]

Definition at line 121 of file CaloSD.h.

Referenced by CaloSD(), HCalSD::filterHit(), and filterHit().

int CaloSD::totalHits [private]

Definition at line 154 of file CaloSD.h.

Referenced by CaloSD(), cleanHitCollection(), createNewHit(), Initialize(), and update().

bool CaloSD::useMap [protected]

Definition at line 123 of file CaloSD.h.

Referenced by CaloSD(), checkHit(), cleanHitCollection(), clearHits(), createNewHit(), and storeHit().