CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
CaloSD Class Referenceabstract

#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

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 (G4Step *step, G4TouchableHistory *tHistory)
 
virtual bool ProcessHits (G4GFlashSpot *aSpot, G4TouchableHistory *)
 
virtual uint32_t setDetUnitId (G4Step *step)=0
 
virtual ~CaloSD ()
 
- Public Member Functions inherited from SensitiveCaloDetector
 SensitiveCaloDetector (std::string &iname, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (std::string &vname)
 
Local3DPoint ConvertToLocal3DPoint (G4ThreeVector point)
 
Local3DPoint FinalStepPosition (G4Step *s, coordinates)
 
virtual std::vector< std::string > getNames ()
 
Local3DPoint InitialStepPosition (G4Step *s, coordinates)
 
std::string nameOfSD ()
 
void NaNTrap (G4Step *step)
 
void Register ()
 
 SensitiveDetector (std::string &iname, const DDCompactView &cpv, SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
virtual ~SensitiveDetector ()
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun *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 EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack *iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent *iT)
 
virtual ~Observer ()
 

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 *)
 
int getNumberOfHits ()
 
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 BeginOfRun *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const BeginOfEvent *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const EndOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void update (const ::EndOfEvent *)
 
void updateHit (CaloG4Hit *)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 

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
 

Additional Inherited Members

- Public Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 

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, ecaldqm::collectionName, 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.

24  :
25  SensitiveCaloDetector(name, cpv, clg, p),
26  G4VGFlashSensitiveDetector(), theTrack(0), preStepPoint(0), eminHit(0),
27  eminHitD(0), m_trackManager(manager), currentHit(0), runInit(false),
28  timeSlice(tSlice), ignoreTrackID(ignoreTkID), hcID(-1), theHC(0),
29  meanResponse(0) {
30  //Add Hcal Sentitive Detector Names
31 
32  collectionName.insert(name);
33 
34  //Parameters
35  edm::ParameterSet m_CaloSD = p.getParameter<edm::ParameterSet>("CaloSD");
36  energyCut = m_CaloSD.getParameter<double>("EminTrack")*GeV;
37  tmaxHit = m_CaloSD.getParameter<double>("TmaxHit")*ns;
38  std::vector<double> eminHits = m_CaloSD.getParameter<std::vector<double> >("EminHits");
39  std::vector<double> tmaxHits = m_CaloSD.getParameter<std::vector<double> >("TmaxHits");
40  std::vector<std::string> hcn = m_CaloSD.getParameter<std::vector<std::string> >("HCNames");
41  std::vector<int> useResMap = m_CaloSD.getParameter<std::vector<int> >("UseResponseTables");
42  std::vector<double> eminHitX = m_CaloSD.getParameter<std::vector<double> >("EminHitsDepth");
43  suppressHeavy= m_CaloSD.getParameter<bool>("SuppressHeavy");
44  kmaxIon = m_CaloSD.getParameter<double>("IonThreshold")*MeV;
45  kmaxProton = m_CaloSD.getParameter<double>("ProtonThreshold")*MeV;
46  kmaxNeutron = m_CaloSD.getParameter<double>("NeutronThreshold")*MeV;
47  checkHits = m_CaloSD.getUntrackedParameter<int>("CheckHits", 25);
48  useMap = m_CaloSD.getUntrackedParameter<bool>("UseMap", true);
49  int verbn = m_CaloSD.getUntrackedParameter<int>("Verbosity", 0);
50  corrTOFBeam = m_CaloSD.getParameter<bool>("CorrectTOFBeam");
51  double beamZ = m_CaloSD.getParameter<double>("BeamPosition")*cm;
52  correctT = beamZ/c_light/nanosecond;
53 
54  SetVerboseLevel(verbn);
55  for (unsigned int k=0; k<hcn.size(); ++k) {
56  if (name == (G4String)(hcn[k])) {
57  if (k < eminHits.size()) eminHit = eminHits[k]*MeV;
58  if (k < eminHitX.size()) eminHitD= eminHitX[k]*MeV;
59  if (k < tmaxHits.size()) tmaxHit = tmaxHits[k]*ns;
60  if (k < useResMap.size() && useResMap[k] > 0) meanResponse = new CaloMeanResponse(p);
61  break;
62  }
63  }
64 #ifdef DebugLog
65  LogDebug("CaloSim") << "***************************************************"
66  << "\n"
67  << "* *"
68  << "\n"
69  << "* Constructing a CaloSD with name " << GetName()
70  << "\n"
71  << "* *"
72  << "\n"
73  << "***************************************************";
74 #endif
75  slave = new CaloSlaveSD(name);
78 
79  primAncestor = 0;
80  cleanIndex = 0;
81  totalHits = 0;
82  forceSave = false;
83 
84  //
85  // Now attach the right detectors (LogicalVolumes) to me
86  //
87  std::vector<std::string> lvNames = clg.logicalNames(name);
88  this->Register();
89  for (std::vector<std::string>::iterator it=lvNames.begin(); it !=lvNames.end(); ++it) {
90  this->AssignSD(*it);
91 #ifdef DebugLog
92  LogDebug("CaloSim") << "CaloSD : Assigns SD to LV " << (*it);
93 #endif
94  }
95 
96  edm::LogInfo("CaloSim") << "CaloSD: Minimum energy of track for saving it "
97  << energyCut/GeV << " GeV" << "\n"
98  << " Use of HitID Map " << useMap << "\n"
99  << " Check last " << checkHits
100  << " before saving the hit\n"
101  << " Correct TOF globally by " << correctT
102  << " ns (Flag =" << corrTOFBeam << ")\n"
103  << " Save hits recorded before " << tmaxHit
104  << " ns and if energy is above " << eminHit/MeV
105  << " MeV (for depth 0) or " << eminHitD/MeV
106  << " MeV (for nonzero depths); Time Slice Unit "
107  << timeSlice << " Ignore TrackID Flag " << ignoreTrackID;
108 }
#define LogDebug(id)
double energyCut
Definition: CaloSD.h:122
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int timeSlice
Definition: CaloSD.h:140
std::vector< std::string > logicalNames(std::string &readoutName)
double kmaxNeutron
Definition: CaloSD.h:133
bool corrTOFBeam
Definition: CaloSD.h:131
int totalHits
Definition: CaloSD.h:155
bool useMap
Definition: CaloSD.h:124
int hcID
Definition: CaloSD.h:143
double eminHitD
Definition: CaloSD.h:122
int primAncestor
Definition: CaloSD.h:150
double kmaxProton
Definition: CaloSD.h:133
double eminHit
Definition: CaloSD.h:122
bool forceSave
Definition: CaloSD.h:136
std::string const collectionName[nCollections]
Definition: Collections.h:39
double kmaxIon
Definition: CaloSD.h:133
bool suppressHeavy
Definition: CaloSD.h:131
CaloSlaveSD * slave
Definition: CaloSD.h:142
CaloHitID previousID
Definition: CaloSD.h:116
CaloG4Hit * currentHit
Definition: CaloSD.h:127
CaloMeanResponse * meanResponse
Definition: CaloSD.h:148
G4Track * theTrack
Definition: CaloSD.h:117
double tmaxHit
Definition: CaloSD.h:122
int k[5][pyjets_maxn]
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
CaloHitID currentID
Definition: CaloSD.h:116
double correctT
Definition: CaloSD.h:132
bool runInit
Definition: CaloSD.h:129
virtual void AssignSD(std::string &vname)
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
SensitiveCaloDetector(std::string &iname, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
int checkHits
Definition: CaloSD.h:123
const SimTrackManager * m_trackManager
Definition: CaloSD.h:126
int cleanIndex
Definition: CaloSD.h:151
bool ignoreTrackID
Definition: CaloSD.h:141
CaloSD::~CaloSD ( )
virtual

Definition at line 110 of file CaloSD.cc.

References meanResponse, slave, and theHC.

110  {
111  if (slave) delete slave;
112  if (theHC) delete theHC;
113  if (meanResponse) delete meanResponse;
114 }
CaloSlaveSD * slave
Definition: CaloSD.h:142
CaloMeanResponse * meanResponse
Definition: CaloSD.h:148
CaloG4HitCollection * theHC
Definition: CaloSD.h:144

Member Function Documentation

G4bool CaloSD::checkHit ( )
protected

Definition at line 320 of file CaloSD.cc.

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

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

320  {
321  //look in the HitContainer whether a hit with the same ID already exists:
322  bool found = false;
323  if (useMap) {
324  std::map<CaloHitID,CaloG4Hit*>::const_iterator it = hitMap.find(currentID);
325  if (it != hitMap.end()) {
326  currentHit = it->second;
327  found = true;
328  }
329  } else {
330  if (checkHits <= 0) return false;
331  int minhit= (theHC->entries()>checkHits ? theHC->entries()-checkHits : 0);
332  int maxhit= theHC->entries()-1;
333 
334  for (int j=maxhit; j>minhit&&!found; --j) {
335  if ((*theHC)[j]->getID() == currentID) {
336  currentHit = (*theHC)[j];
337  found = true;
338  }
339  }
340  }
341 
342  if (found) {
344  return true;
345  } else {
346  return false;
347  }
348 }
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:429
bool useMap
Definition: CaloSD.h:124
int j
Definition: DBlmapReader.cc:9
CaloG4Hit * currentHit
Definition: CaloSD.h:127
CaloHitID currentID
Definition: CaloSD.h:116
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:145
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
int checkHits
Definition: CaloSD.h:123
void CaloSD::cleanHitCollection ( )
private

Definition at line 677 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().

677  {
678  std::vector<CaloG4Hit*>* theCollection = theHC->GetVector();
679 
680 #ifdef DebugLog
681  LogDebug("CaloSim") << "CaloSD: collection before merging, size = " << theHC->entries();
682 #endif
683 
684  selIndex.reserve(theHC->entries()-cleanIndex);
685  if ( reusehit.size() == 0 ) reusehit.reserve(theHC->entries()-cleanIndex);
686 
687  // if no map used, merge before hits to have the save situation as a map
688  if ( !useMap ) {
689  hitvec.swap(*theCollection);
690  sort((hitvec.begin()+cleanIndex), hitvec.end(), CaloG4HitLess());
691 #ifdef DebugLog
692  LogDebug("CaloSim") << "CaloSD::cleanHitCollection: sort hits in buffer "
693  << "starting from element = " << cleanIndex;
694  for (unsigned int i = 0; i<hitvec.size(); ++i)
695  LogDebug("CaloSim")<<i<<" "<<*hitvec[i];
696 #endif
697  unsigned int i, j;
698  CaloG4HitEqual equal;
699  for (i=cleanIndex; i<hitvec.size(); ++i) {
700  selIndex.push_back(i-cleanIndex);
701  int jump = 0;
702  for (j = i+1; j <hitvec.size() && equal(hitvec[i], hitvec[j]); ++j) {
703  ++jump;
704  // merge j to i
705  (*hitvec[i]).addEnergyDeposit(*hitvec[j]);
706  (*hitvec[j]).setEM(0.);
707  (*hitvec[j]).setHadr(0.);
708  reusehit.push_back(hitvec[j]);
709  }
710  i+=jump;
711  }
712 #ifdef DebugLog
713  LogDebug("CaloSim") << "CaloSD: cleanHitCollection merge the hits in buffer ";
714  for (unsigned int i = 0; i<hitvec.size(); ++i)
715  LogDebug("CaloSim")<<i<<" "<<*hitvec[i];
716 #endif
717  for ( unsigned int i = cleanIndex; i < cleanIndex+selIndex.size(); ++i ) {
718  hitvec[i] = hitvec[selIndex[i-cleanIndex]+cleanIndex];
719  }
720  hitvec.resize(cleanIndex+selIndex.size());
721 #ifdef DebugLog
722  LogDebug("CaloSim") << "CaloSD::cleanHitCollection: remove the merged hits in buffer,"
723  << " new size = " << hitvec.size();
724  for (unsigned int i = 0; i<hitvec.size(); ++i)
725  LogDebug("CaloSim")<<i<<" "<<*hitvec[i];
726 #endif
727  hitvec.swap(*theCollection);
728  std::vector<CaloG4Hit*>().swap(hitvec);
729  selIndex.clear();
730  totalHits = theHC->entries();
731  }
732 
733 #ifdef DebugLog
734  LogDebug("CaloSim") << "CaloSD: collection after merging, size = " << theHC->entries();
735 #endif
736 
737  int addhit = 0;
738 
739 #ifdef DebugLog
740  LogDebug("CaloSim") << "CaloSD: Size of reusehit after merge = " << reusehit.size();
741  LogDebug("CaloSim") << "CaloSD: Starting hit selection from index = " << cleanIndex;
742 #endif
743 
744  selIndex.reserve(theCollection->size()-cleanIndex);
745  for (unsigned int i = cleanIndex; i<theCollection->size(); ++i) {
746  CaloG4Hit* aHit((*theCollection)[i]);
747 
748  // selection
749 
750  double time = aHit->getTimeSlice();
751  if (corrTOFBeam) time += correctT;
752  if (!filterHit(aHit,time)) {
753 #ifdef DebugLog
754  LogDebug("CaloSim") << "CaloSD: dropped CaloG4Hit " << " " << *aHit;
755 #endif
756 
757  // create the list of hits to be reused
758 
759  reusehit.push_back((*theCollection)[i]);
760  ++addhit;
761  } else {
762  selIndex.push_back(i-cleanIndex);
763  }
764  }
765 
766 #ifdef DebugLog
767  LogDebug("CaloSim") << "CaloSD: Size of reusehit after selection = " << reusehit.size()
768  << " Number of added hit = " << addhit;
769 #endif
770  if (useMap) {
771  if ( addhit>0 ) {
772  int offset = reusehit.size()-addhit;
773  for (int ii = addhit-1; ii>=0; --ii) {
774  CaloHitID theID = reusehit[offset+ii]->getID();
775  hitMap.erase(theID);
776  }
777  }
778  }
779  for (unsigned int j = 0; j<selIndex.size(); ++j) {
780  (*theCollection)[cleanIndex+j] = (*theCollection)[cleanIndex+selIndex[j]];
781  }
782 
783  theCollection->resize(cleanIndex+selIndex.size());
784  std::vector<unsigned int>().swap(selIndex);
785 
786 #ifdef DebugLog
787  LogDebug("CaloSim") << "CaloSD: hit collection after selection, size = "
788  << theHC->entries();
789  theHC->PrintAllHits();
790 #endif
791 
792  cleanIndex = theHC->entries();
793 }
#define LogDebug(id)
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
int i
Definition: DBlmapReader.cc:9
bool corrTOFBeam
Definition: CaloSD.h:131
int totalHits
Definition: CaloSD.h:155
bool useMap
Definition: CaloSD.h:124
std::vector< CaloG4Hit * > reusehit
Definition: CaloSD.h:152
int j
Definition: DBlmapReader.cc:9
std::vector< CaloG4Hit * > hitvec
Definition: CaloSD.h:153
std::vector< unsigned int > selIndex
Definition: CaloSD.h:154
unsigned int offset(bool)
virtual bool filterHit(CaloG4Hit *, double)
Definition: CaloSD.cc:586
double correctT
Definition: CaloSD.h:132
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:145
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
int cleanIndex
Definition: CaloSD.h:151
void CaloSD::clear ( void  )
virtual

Definition at line 231 of file CaloSD.cc.

231 {}
void CaloSD::clearHits ( )
protectedvirtual

Implements SensitiveDetector.

Definition at line 545 of file CaloSD.cc.

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

Referenced by update().

545  {
546  if (useMap) hitMap.erase (hitMap.begin(), hitMap.end());
547  for (unsigned int i = 0; i<reusehit.size(); ++i) delete reusehit[i];
548  std::vector<CaloG4Hit*>().swap(reusehit);
549  cleanIndex = 0;
550  previousID.reset();
551  primIDSaved = -99;
552 #ifdef DebugLog
553  LogDebug("CaloSim") << "CaloSD: Clears hit vector for " << GetName() << " " << slave;
554 #endif
555  slave->Initialize();
556 #ifdef DebugLog
557  LogDebug("CaloSim") << "CaloSD: Initialises slave SD for " << GetName();
558 #endif
559 }
#define LogDebug(id)
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
virtual void Initialize()
Definition: CaloSlaveSD.cc:21
int i
Definition: DBlmapReader.cc:9
bool useMap
Definition: CaloSD.h:124
int primIDSaved
Definition: CaloSD.h:114
std::vector< CaloG4Hit * > reusehit
Definition: CaloSD.h:152
void reset()
Definition: CaloHitID.cc:53
CaloSlaveSD * slave
Definition: CaloSD.h:142
CaloHitID previousID
Definition: CaloSD.h:116
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:145
int cleanIndex
Definition: CaloSD.h:151
CaloG4Hit * CaloSD::createNewHit ( )
protected

Definition at line 352 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(), CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), HCalSD::hitForFibre(), ZdcSD::ProcessHits(), DreamSD::ProcessHits(), HCalSD::ProcessHits(), and ProcessHits().

352  {
353 #ifdef DebugLog
354  LogDebug("CaloSim") << "CaloSD::CreateNewHit for"
355  << " Unit " << currentID.unitID()
356  << " " << currentID.depth()
357  << " Edeposit = " << edepositEM << " " << edepositHAD;
358  LogDebug("CaloSim") << " primary " << currentID.trackID()
359  << " time slice " << currentID.timeSliceID()
360  << " For Track " << theTrack->GetTrackID()
361  << " which is a " <<theTrack->GetDefinition()->GetParticleName()
362  << " of energy " << theTrack->GetKineticEnergy()/GeV
363  << " " << theTrack->GetMomentum().mag()/GeV
364  << " daughter of part. " << theTrack->GetParentID()
365  << " and created by " ;
366 
367  if (theTrack->GetCreatorProcess()!=NULL)
368  LogDebug("CaloSim") << theTrack->GetCreatorProcess()->GetProcessName() ;
369  else
370  LogDebug("CaloSim") << "NO process";
371 #endif
372 
373  CaloG4Hit* aHit;
374  if (reusehit.size() > 0) {
375  aHit = reusehit[0];
376  aHit->setEM(0.);
377  aHit->setHadr(0.);
378  reusehit.erase(reusehit.begin());
379  } else {
380  aHit = new CaloG4Hit;
381  }
382 
383  aHit->setID(currentID);
386  aHit->setPosition(posGlobal.x(),posGlobal.y(),posGlobal.z());
388  updateHit(aHit);
389 
390  storeHit(aHit);
391  double etrack = 0;
392  if (currentID.trackID() == primIDSaved) { // The track is saved; nothing to be done
393  } else if (currentID.trackID() == theTrack->GetTrackID()) {
394  etrack= theTrack->GetKineticEnergy();
395  //edm::LogInfo("CaloSim") << "CaloSD: set save the track " << currentID.trackID()
396  // << " etrack " << etrack << " eCut " << energyCut << " flag " << forceSave;
397  if (etrack >= energyCut || forceSave) {
398  TrackInformation* trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
399  trkInfo->storeTrack(true);
400  trkInfo->putInHistory();
401  // trkInfo->setAncestor();
402 #ifdef DebugLog
403  LogDebug("CaloSim") << "CaloSD: set save the track " << currentID.trackID()
404  << " with Hit";
405 #endif
406  }
407  } else {
409 #ifdef DebugLog
410  LogDebug("CaloSim") << "CaloSD : TrackwithHistory pointer for "
411  << currentID.trackID() << " is " << trkh;
412 #endif
413  if (trkh != NULL) {
414  etrack = sqrt(trkh->momentum().Mag2());
415  if (etrack >= energyCut) {
416  trkh->save();
417 #ifdef DebugLog
418  LogDebug("CaloSim") << "CaloSD: set save the track "
419  << currentID.trackID() << " with Hit";
420 #endif
421  }
422  }
423  }
425  if (useMap) totalHits++;
426  return aHit;
427 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:120
double energyCut
Definition: CaloSD.h:122
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:429
bool storeTrack() const
int totalHits
Definition: CaloSD.h:155
void setIncidentEnergy(double e)
Definition: CaloG4Hit.h:66
void setEntryLocal(double x, double y, double z)
Definition: CaloG4Hit.h:54
bool useMap
Definition: CaloSD.h:124
#define NULL
Definition: scimark2.h:8
G4ThreeVector posGlobal
Definition: CaloSD.h:112
int primIDSaved
Definition: CaloSD.h:114
uint16_t depth() const
Definition: CaloHitID.h:26
std::vector< CaloG4Hit * > reusehit
Definition: CaloSD.h:152
bool forceSave
Definition: CaloSD.h:136
int timeSliceID() const
Definition: CaloHitID.h:23
float edepositHAD
Definition: CaloSD.h:120
T sqrt(T t)
Definition: SSEVec.h:46
int trackID() const
Definition: CaloHitID.h:25
void setEM(double e)
Definition: CaloG4Hit.h:60
void setID(uint32_t i, double d, int j, uint16_t k=0)
Definition: CaloG4Hit.h:75
void storeHit(CaloG4Hit *)
Definition: CaloSD.cc:605
G4Track * theTrack
Definition: CaloSD.h:117
CaloHitID currentID
Definition: CaloSD.h:116
const math::XYZVectorD & momentum() const
float incidentEnergy
Definition: CaloSD.h:113
void setHadr(double e)
Definition: CaloG4Hit.h:63
void setPosition(double x, double y, double z)
Definition: CaloG4Hit.h:57
void setEntry(double x, double y, double z)
Definition: CaloG4Hit.h:51
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:147
uint32_t unitID() const
Definition: CaloHitID.h:22
G4ThreeVector entrancePoint
Definition: CaloSD.h:110
G4ThreeVector entranceLocal
Definition: CaloSD.h:111
void CaloSD::DrawAll ( )
virtual

Definition at line 233 of file CaloSD.cc.

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

Reimplemented from SensitiveDetector.

Definition at line 219 of file CaloSD.cc.

References cleanHitCollection(), and theHC.

219  {
220  // clean the hits for the last tracks
221 
223 
224 #ifdef DebugLog
225  edm::LogInfo("CaloSim") << "CaloSD: EndofEvent entered with " << theHC->entries()
226  << " entries";
227 #endif
228  // TimeMe("CaloSD:sortAndMergeHits",false);
229 }
void cleanHitCollection()
Definition: CaloSD.cc:677
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
void CaloSD::fillHits ( edm::PCaloHitContainer c,
std::string  n 
)
virtual

Implements SensitiveCaloDetector.

Definition at line 242 of file CaloSD.cc.

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

242  {
243  if (slave->name() == n) c=slave->hits();
244  slave->Clean();
245 }
Collection & hits()
Definition: CaloSlaveSD.h:29
virtual void Clean()
Definition: CaloSlaveSD.cc:43
std::string name() const
Definition: CaloSlaveSD.h:26
CaloSlaveSD * slave
Definition: CaloSD.h:142
bool CaloSD::filterHit ( CaloG4Hit hit,
double  time 
)
protectedvirtual

Reimplemented in HCalSD.

Definition at line 586 of file CaloSD.cc.

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

Referenced by cleanHitCollection().

586  {
587  double emin(eminHit);
588  if (hit->getDepth() > 0) emin = eminHitD;
589 #ifdef DebugLog
590  LogDebug("CaloSim") << "Depth " << hit->getDepth() << " Emin = " << emin << " ("
591  << eminHit << ", " << eminHitD << ")";
592 #endif
593  return ((time <= tmaxHit) && (hit->getEnergyDeposit() > emin));
594 }
#define LogDebug(id)
uint16_t getDepth() const
Definition: CaloG4Hit.h:72
double eminHitD
Definition: CaloSD.h:122
double eminHit
Definition: CaloSD.h:122
double tmaxHit
Definition: CaloSD.h:122
double getEnergyDeposit() const
Definition: CaloG4Hit.h:81
double CaloSD::getAttenuation ( G4Step *  aStep,
double  birk1,
double  birk2,
double  birk3 
)
protected

Definition at line 454 of file CaloSD.cc.

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

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

454  {
455  double weight = 1.;
456  double charge = aStep->GetPreStepPoint()->GetCharge();
457 
458  if (charge != 0. && aStep->GetStepLength() > 0) {
459  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
460  double density = mat->GetDensity();
461  double dedx = aStep->GetTotalEnergyDeposit()/aStep->GetStepLength();
462  double rkb = birk1/density;
463  double c = birk2*rkb*rkb;
464  if (std::abs(charge) >= 2.) rkb /= birk3; // based on alpha particle data
465  weight = 1./(1.+rkb*dedx+c*dedx*dedx);
466 #ifdef DebugLog
467  LogDebug("CaloSim") << "CaloSD::getAttenuation in " << mat->GetName()
468  << " Charge " << charge << " dE/dx " << dedx
469  << " Birk Const " << rkb << ", " << c << " Weight = "
470  << weight << " dE " << aStep->GetTotalEnergyDeposit();
471 #endif
472  }
473  return weight;
474 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
double charge(const std::vector< uint8_t > &Ampls)
uint16_t CaloSD::getDepth ( G4Step *  )
protectedvirtual

Reimplemented in ECalSD.

Definition at line 584 of file CaloSD.cc.

Referenced by getStepInfo(), and ProcessHits().

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

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

Definition at line 200 of file CaloSD.cc.

Referenced by getStepInfo().

200  {
201  return aStep->GetTotalEnergyDeposit();
202 }
int CaloSD::getNumberOfHits ( )
protected

Definition at line 350 of file CaloSD.cc.

References theHC.

Referenced by HCalSD::ProcessHits().

350 { return theHC->entries(); }
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
double CaloSD::getResponseWt ( G4Track *  aTrack)
protected

Definition at line 596 of file CaloSD.cc.

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

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

596  {
597  if (meanResponse) {
598  TrackInformation * trkInfo = (TrackInformation *)(aTrack->GetUserInformation());
599  return meanResponse->getWeight(trkInfo->genParticlePID(), trkInfo->genParticleP());
600  } else {
601  return 1;
602  }
603 }
double genParticleP() const
double getWeight(int genPID, double genP)
int genParticlePID() const
CaloMeanResponse * meanResponse
Definition: CaloSD.h:148
bool CaloSD::getStepInfo ( G4Step *  aStep)
protectedvirtual

Reimplemented in DreamSD.

Definition at line 247 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 ZdcSD::ProcessHits(), HCalSD::ProcessHits(), and ProcessHits().

247  {
248 
249  preStepPoint = aStep->GetPreStepPoint();
250  theTrack = aStep->GetTrack();
251 
252  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
253  if (particleCode == emPDG ||
254  particleCode == epPDG ||
255  particleCode == gammaPDG ) {
256  edepositEM = getEnergyDeposit(aStep);
257  edepositHAD = 0.;
258  } else {
259  edepositEM = 0.;
260  edepositHAD = getEnergyDeposit(aStep);
261  }
262 
263  double time = (aStep->GetPostStepPoint()->GetGlobalTime())/nanosecond;
264  unsigned int unitID= setDetUnitId(aStep);
265  uint16_t depth = getDepth(aStep);
266  int primaryID = getTrackID(theTrack);
267 
268  bool flag = (unitID > 0);
269  if (flag) {
270  currentID.setID(unitID, time, primaryID, depth);
271 #ifdef DebugLog
272  G4TouchableHistory* touch =(G4TouchableHistory*)(theTrack->GetTouchable());
273  LogDebug("CaloSim") << "CaloSD:: GetStepInfo for"
274  << " PV " << touch->GetVolume(0)->GetName()
275  << " PVid = " << touch->GetReplicaNumber(0)
276  << " MVid = " << touch->GetReplicaNumber(1)
277  << " Unit " << currentID.unitID()
278  << " Edeposit = " << edepositEM << " " << edepositHAD;
279  } else {
280  G4TouchableHistory* touch =(G4TouchableHistory*)(theTrack->GetTouchable());
281  LogDebug("CaloSim") << "CaloSD:: GetStepInfo for"
282  << " PV " << touch->GetVolume(0)->GetName()
283  << " PVid = " << touch->GetReplicaNumber(0)
284  << " MVid = " << touch->GetReplicaNumber(1)
285  << " Unit " << std::hex << unitID << std::dec
286  << " Edeposit = " << edepositEM << " " << edepositHAD;
287 #endif
288  }
289  return flag;
290 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:120
virtual uint32_t setDetUnitId(G4Step *step)=0
G4int emPDG
Definition: CaloSD.h:135
long int flag
Definition: mlp_lapack.h:47
virtual int getTrackID(G4Track *)
Definition: CaloSD.cc:563
float edepositHAD
Definition: CaloSD.h:120
G4int epPDG
Definition: CaloSD.h:135
G4int gammaPDG
Definition: CaloSD.h:135
G4Track * theTrack
Definition: CaloSD.h:117
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
CaloHitID currentID
Definition: CaloSD.h:116
uint32_t unitID() const
Definition: CaloHitID.h:22
virtual uint16_t getDepth(G4Step *)
Definition: CaloSD.cc:584
virtual double getEnergyDeposit(G4Step *step)
Definition: CaloSD.cc:200
int CaloSD::getTrackID ( G4Track *  aTrack)
protectedvirtual

Reimplemented in ECalSD.

Definition at line 563 of file CaloSD.cc.

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

Referenced by getStepInfo(), ECalSD::getTrackID(), and ProcessHits().

563  {
564  int primaryID = 0;
565  forceSave = false;
566  TrackInformation* trkInfo=(TrackInformation *)(aTrack->GetUserInformation());
567  if (trkInfo) {
568  primaryID = trkInfo->getIDonCaloSurface();
569 #ifdef DebugLog
570  LogDebug("CaloSim") << "CaloSD: hit update from track Id on Calo Surface "
571  << trkInfo->getIDonCaloSurface();
572 #endif
573  } else {
574  primaryID = aTrack->GetTrackID();
575 #ifdef DebugLog
576  edm::LogWarning("CaloSim") << "CaloSD: Problem with primaryID **** set by "
577  << "force to TkID **** " << primaryID << " in "
578  << preStepPoint->GetTouchable()->GetVolume(0)->GetName();
579 #endif
580  }
581  return primaryID;
582 }
#define LogDebug(id)
int getIDonCaloSurface() const
bool forceSave
Definition: CaloSD.h:136
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
G4bool CaloSD::hitExists ( )
protected

Definition at line 299 of file CaloSD.cc.

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

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

299  {
300 #ifdef DebugLog
301  if (currentID.trackID()<1)
302  edm::LogWarning("CaloSim") << "***** CaloSD error: primaryID = "
303  << currentID.trackID()
304  << " maybe detector name changed";
305 #endif
306  // Update if in the same detector, time-slice and for same track
307  if (currentID == previousID) {
309  return true;
310  }
311 
312  // Reset entry point for new primary
313  posGlobal = preStepPoint->GetPosition();
314  if (currentID.trackID() != previousID.trackID())
315  resetForNewPrimary(preStepPoint->GetPosition(), preStepPoint->GetKineticEnergy());
316 
317  return checkHit();
318 }
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:429
G4ThreeVector posGlobal
Definition: CaloSD.h:112
G4bool checkHit()
Definition: CaloSD.cc:320
int trackID() const
Definition: CaloHitID.h:25
CaloHitID previousID
Definition: CaloSD.h:116
CaloG4Hit * currentHit
Definition: CaloSD.h:127
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
CaloHitID currentID
Definition: CaloSD.h:116
void resetForNewPrimary(G4ThreeVector, double)
Definition: CaloSD.cc:443
void CaloSD::Initialize ( G4HCofThisEvent *  HCE)
virtual

Reimplemented from SensitiveDetector.

Definition at line 204 of file CaloSD.cc.

References ecaldqm::collectionName, hcID, theHC, and totalHits.

204  {
205  totalHits = 0;
206 
207 #ifdef DebugLog
208  edm::LogInfo("CaloSim") << "CaloSD : Initialize called for " << GetName();
209 #endif
210 
211  //This initialization is performed at the beginning of an event
212  //------------------------------------------------------------
213  theHC = new CaloG4HitCollection(GetName(), collectionName[0]);
214 
215  if (hcID<0) hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
216  HCE->AddHitsCollection(hcID, theHC);
217 }
int totalHits
Definition: CaloSD.h:155
int hcID
Definition: CaloSD.h:143
std::string const collectionName[nCollections]
Definition: Collections.h:39
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
void CaloSD::initRun ( )
protectedvirtual

Reimplemented in CastorSD, HCalSD, DreamSD, and ZdcSD.

Definition at line 561 of file CaloSD.cc.

Referenced by update().

561 {}
void CaloSD::PrintAll ( )
virtual

Definition at line 235 of file CaloSD.cc.

References theHC.

235  {
236 #ifdef DebugLog
237  edm::LogInfo("CaloSim") << "CaloSD: Collection " << theHC->GetName();
238 #endif
239  theHC->PrintAllHits();
240 }
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
bool CaloSD::ProcessHits ( G4Step *  step,
G4TouchableHistory *  tHistory 
)
virtual

Implements SensitiveDetector.

Reimplemented in HCalSD, DreamSD, and ZdcSD.

Definition at line 116 of file CaloSD.cc.

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

116  {
117 
118  NaNTrap( aStep ) ;
119 
120  if (aStep == NULL) {
121  return true;
122  } else {
123  if (getStepInfo(aStep)) {
124  if (hitExists() == false && edepositEM+edepositHAD>0.)
126  }
127  }
128  return true;
129 }
float edepositEM
Definition: CaloSD.h:120
#define NULL
Definition: scimark2.h:8
float edepositHAD
Definition: CaloSD.h:120
CaloG4Hit * currentHit
Definition: CaloSD.h:127
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
Definition: CaloSD.cc:247
G4bool hitExists()
Definition: CaloSD.cc:299
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:352
bool CaloSD::ProcessHits ( G4GFlashSpot *  aSpot,
G4TouchableHistory *   
)
virtual

Definition at line 131 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().

131  {
132 
133  if (aSpot != NULL) {
134  theTrack = const_cast<G4Track *>(aSpot->GetOriginatorTrack()->GetPrimaryTrack());
135  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
136 
137  if (particleCode == emPDG ||
138  particleCode == epPDG ||
139  particleCode == gammaPDG ) {
140  edepositEM = aSpot->GetEnergySpot()->GetEnergy();
141  edepositHAD = 0.;
142  } else {
143  edepositEM = 0.;
144  edepositHAD = 0.;
145  }
146 
147  if (edepositEM>0.) {
148  G4Step * fFakeStep = new G4Step();
149  preStepPoint = fFakeStep->GetPreStepPoint();
150  G4StepPoint * fFakePostStepPoint = fFakeStep->GetPostStepPoint();
151  preStepPoint->SetPosition(aSpot->GetPosition());
152  fFakePostStepPoint->SetPosition(aSpot->GetPosition());
153 
154  G4TouchableHandle fTouchableHandle = aSpot->GetTouchableHandle();
155  preStepPoint->SetTouchableHandle(fTouchableHandle);
156  fFakeStep->SetTotalEnergyDeposit(aSpot->GetEnergySpot()->GetEnergy());
157 
158  double time = 0;
159  unsigned int unitID = setDetUnitId(fFakeStep);
160  int primaryID = getTrackID(theTrack);
161  uint16_t depth = getDepth(fFakeStep);
162 
163  if (unitID > 0) {
164  currentID.setID(unitID, time, primaryID, depth);
165 #ifdef DebugLog
166  LogDebug("CaloSim") << "CaloSD:: GetSpotInfo for"
167  << " Unit 0x" << std::hex << currentID.unitID()
168  << std::dec << " Edeposit = " << edepositEM << " "
169  << edepositHAD;
170 #endif
171  // Update if in the same detector, time-slice and for same track
172  if (currentID == previousID) {
174  } else {
175  posGlobal = aSpot->GetEnergySpot()->GetPosition();
176  // Reset entry point for new primary
177  if (currentID.trackID() != previousID.trackID()) {
178  entrancePoint = aSpot->GetPosition();
179  entranceLocal = aSpot->GetTouchableHandle()->GetHistory()->
180  GetTopTransform().TransformPoint(entrancePoint);
181  incidentEnergy = theTrack->GetKineticEnergy();
182 #ifdef DebugLog
183  LogDebug("CaloSim") << "CaloSD: Incident energy "
184  << incidentEnergy/GeV << " GeV and"
185  << " entrance point " << entrancePoint
186  << " (Global) " << entranceLocal << " (Local)";
187 #endif
188  }
189 
190  if (checkHit() == false) currentHit = createNewHit();
191  }
192  }
193  delete fFakeStep;
194  }
195  return true;
196  }
197  return false;
198 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:120
virtual uint32_t setDetUnitId(G4Step *step)=0
G4int emPDG
Definition: CaloSD.h:135
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:429
virtual int getTrackID(G4Track *)
Definition: CaloSD.cc:563
#define NULL
Definition: scimark2.h:8
G4ThreeVector posGlobal
Definition: CaloSD.h:112
G4bool checkHit()
Definition: CaloSD.cc:320
float edepositHAD
Definition: CaloSD.h:120
int trackID() const
Definition: CaloHitID.h:25
G4int epPDG
Definition: CaloSD.h:135
G4int gammaPDG
Definition: CaloSD.h:135
CaloHitID previousID
Definition: CaloSD.h:116
CaloG4Hit * currentHit
Definition: CaloSD.h:127
G4Track * theTrack
Definition: CaloSD.h:117
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
CaloHitID currentID
Definition: CaloSD.h:116
float incidentEnergy
Definition: CaloSD.h:113
uint32_t unitID() const
Definition: CaloHitID.h:22
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:352
virtual uint16_t getDepth(G4Step *)
Definition: CaloSD.cc:584
G4ThreeVector entrancePoint
Definition: CaloSD.h:110
G4ThreeVector entranceLocal
Definition: CaloSD.h:111
void CaloSD::resetForNewPrimary ( G4ThreeVector  point,
double  energy 
)
protected

Definition at line 443 of file CaloSD.cc.

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

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

443  {
447 #ifdef DebugLog
448  LogDebug("CaloSim") << "CaloSD: Incident energy " << incidentEnergy/GeV
449  << " GeV and" << " entrance point " << entrancePoint
450  << " (Global) " << entranceLocal << " (Local)";
451 #endif
452 }
G4ThreeVector setToLocal(G4ThreeVector, const G4VTouchable *)
Definition: CaloSD.cc:292
#define LogDebug(id)
G4StepPoint * preStepPoint
Definition: CaloSD.h:119
float incidentEnergy
Definition: CaloSD.h:113
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
G4ThreeVector entrancePoint
Definition: CaloSD.h:110
G4ThreeVector entranceLocal
Definition: CaloSD.h:111
bool CaloSD::saveHit ( CaloG4Hit aHit)
private

Definition at line 616 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().

616  {
617  int tkID;
618  bool ok = true;
619  if (m_trackManager) {
620  tkID = m_trackManager->giveMotherNeeded(aHit->getTrackID());
621  if (tkID == 0) {
622  if (m_trackManager->trackExists(aHit->getTrackID())) tkID = (aHit->getTrackID());
623  else {
624  ok = false;
625  }
626  }
627  } else {
628  tkID = aHit->getTrackID();
629  ok = false;
630  }
631  // edm::LogInfo("CaloSim") << "CalosD: Track ID " << aHit->getTrackID() << " changed to " << tkID << " by SimTrackManager" << " Status " << ok;
632 #ifdef DebugLog
633  LogDebug("CaloSim") << "CalosD: Track ID " << aHit->getTrackID()
634  << " changed to " << tkID << " by SimTrackManager"
635  << " Status " << ok;
636 #endif
637  double time = aHit->getTimeSlice();
638  if (corrTOFBeam) time += correctT;
639  slave->processHits(aHit->getUnitID(), aHit->getEM()/GeV,
640  aHit->getHadr()/GeV, time, tkID, aHit->getDepth());
641 #ifdef DebugLog
642  LogDebug("CaloSim") << "CaloSD: Store Hit at " << std::hex
643  << aHit->getUnitID() << std::dec << " "
644  << aHit->getDepth() << " due to " << tkID
645  << " in time " << time << " of energy "
646  << aHit->getEM()/GeV << " GeV (EM) and "
647  << aHit->getHadr()/GeV << " GeV (Hadr)";
648 #endif
649  return ok;
650 }
#define LogDebug(id)
virtual bool processHits(uint32_t, double, double, double, int, uint16_t depth=0)
Definition: CaloSlaveSD.cc:34
bool corrTOFBeam
Definition: CaloSD.h:131
uint16_t getDepth() const
Definition: CaloG4Hit.h:72
bool trackExists(unsigned int i) const
CaloSlaveSD * slave
Definition: CaloSD.h:142
int giveMotherNeeded(int i) const
int getTrackID() const
Definition: CaloG4Hit.h:68
double correctT
Definition: CaloSD.h:132
double getEM() const
Definition: CaloG4Hit.h:59
double getTimeSlice() const
Definition: CaloG4Hit.h:70
const SimTrackManager * m_trackManager
Definition: CaloSD.h:126
uint32_t getUnitID() const
Definition: CaloG4Hit.h:69
double getHadr() const
Definition: CaloG4Hit.h:62
virtual uint32_t CaloSD::setDetUnitId ( G4Step *  step)
pure virtual
G4ThreeVector CaloSD::setToLocal ( G4ThreeVector  global,
const G4VTouchable *  touch 
)
protected

Definition at line 292 of file CaloSD.cc.

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

292  {
293 
294  G4ThreeVector localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
295 
296  return localPoint;
297 }
void CaloSD::storeHit ( CaloG4Hit hit)
private

Definition at line 605 of file CaloSD.cc.

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

Referenced by createNewHit().

605  {
606  if (previousID.trackID()<0) return;
607  if (hit == 0) {
608  edm::LogWarning("CaloSim") << "CaloSD: hit to be stored is NULL !!";
609  return;
610  }
611 
612  theHC->insert(hit);
613  if (useMap) hitMap.insert(std::pair<CaloHitID,CaloG4Hit*>(previousID,hit));
614 }
bool useMap
Definition: CaloSD.h:124
int trackID() const
Definition: CaloHitID.h:25
CaloHitID previousID
Definition: CaloSD.h:116
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:145
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
void CaloSD::summarize ( )
private

Definition at line 652 of file CaloSD.cc.

Referenced by update().

652 {}
void CaloSD::update ( const BeginOfRun )
protectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 476 of file CaloSD.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

476  {
477  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
478  G4String particleName;
479  emPDG = theParticleTable->FindParticle(particleName="e-")->GetPDGEncoding();
480  epPDG = theParticleTable->FindParticle(particleName="e+")->GetPDGEncoding();
481  gammaPDG = theParticleTable->FindParticle(particleName="gamma")->GetPDGEncoding();
482 #ifdef DebugLog
483  LogDebug("CaloSim") << "CaloSD: Particle code for e- = " << emPDG
484  << " for e+ = " << epPDG << " for gamma = " << gammaPDG;
485 #endif
486  initRun();
487  runInit = true;
488 }
#define LogDebug(id)
G4int emPDG
Definition: CaloSD.h:135
G4int epPDG
Definition: CaloSD.h:135
G4int gammaPDG
Definition: CaloSD.h:135
virtual void initRun()
Definition: CaloSD.cc:561
bool runInit
Definition: CaloSD.h:129
void CaloSD::update ( const BeginOfEvent )
protectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 490 of file CaloSD.cc.

References clearHits(), and LogDebug.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

490  {
491 #ifdef DebugLog
492  LogDebug("CaloSim") << "CaloSD: Dispatched BeginOfEvent for " << GetName()
493  << " !" ;
494 #endif
495  clearHits();
496 }
#define LogDebug(id)
virtual void clearHits()
Definition: CaloSD.cc:545
void CaloSD::update ( const BeginOfTrack )
protectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 654 of file CaloSD.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

654  {
655  int primary = -1;
656  TrackInformation * trkInfo = (TrackInformation *)((*trk)()->GetUserInformation());
657  if ( trkInfo->isPrimary() ) primary = (*trk)()->GetTrackID();
658 
659 #ifdef DebugLog
660  LogDebug("CaloSim") << "New track: isPrimary " << trkInfo->isPrimary()
661  << " primary ID = " << primary
662  << " primary ancestor ID " << primAncestor;
663 #endif
664 
665  // update the information if a different primary track ID
666 
667  if (primary > 0 && primary != primAncestor) {
668  primAncestor = primary;
669 
670  // clean the hits information
671 
672  if (theHC->entries()>0) cleanHitCollection();
673 
674  }
675 }
#define LogDebug(id)
int primAncestor
Definition: CaloSD.h:150
void cleanHitCollection()
Definition: CaloSD.cc:677
bool isPrimary() const
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
void CaloSD::update ( const EndOfTrack )
protectedvirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 498 of file CaloSD.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

498  {
499  int id = (*trk)()->GetTrackID();
500  TrackInformation *trkI =(TrackInformation *)((*trk)()->GetUserInformation());
501  int lastTrackID = -1;
502  if (trkI) lastTrackID = trkI->getIDonCaloSurface();
503  if (id == lastTrackID) {
504  const TrackContainer * trksForThisEvent = m_trackManager->trackContainer();
505  if (trksForThisEvent != NULL) {
506  int it = (int)(trksForThisEvent->size()) - 1;
507  if (it >= 0) {
508  TrackWithHistory * trkH = (*trksForThisEvent)[it];
509  if (trkH->trackID() == (unsigned int)(id)) tkMap[id] = trkH;
510 #ifdef DebugLog
511  LogDebug("CaloSim") << "CaloSD: get track " << it << " from "
512  << "Container of size " << trksForThisEvent->size()
513  << " with ID " << trkH->trackID();
514  } else {
515  LogDebug("CaloSim") << "CaloSD: get track " << it << " from "
516  << "Container of size " << trksForThisEvent->size()
517  << " with no ID";
518 #endif
519  }
520  }
521  }
522 }
#define LogDebug(id)
int getIDonCaloSurface() const
#define NULL
Definition: scimark2.h:8
const TrackContainer * trackContainer() const
std::vector< TrackWithHistory * > TrackContainer
Definition: TrackContainer.h:8
unsigned int trackID() const
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:147
const SimTrackManager * m_trackManager
Definition: CaloSD.h:126
void CaloSD::update ( const ::EndOfEvent )
protectedvirtual

Definition at line 524 of file CaloSD.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

524  {
525  int count = 0, wrong = 0;
526  bool ok;
527 
528  slave->ReserveMemory(theHC->entries());
529 
530  for (int i=0; i<theHC->entries(); ++i) {
531  ok = saveHit((*theHC)[i]);
532  ++count;
533  if (!ok) ++wrong;
534  }
535 
536  edm::LogInfo("CaloSim") << "CaloSD: " << GetName() << " store " << count
537  << " hits recorded with " << wrong
538  << " track IDs not given properly and "
539  << totalHits-count << " hits not passing cuts";
540  summarize();
541 
542  tkMap.erase (tkMap.begin(), tkMap.end());
543 }
int i
Definition: DBlmapReader.cc:9
int totalHits
Definition: CaloSD.h:155
virtual void ReserveMemory(unsigned int size)
Definition: CaloSlaveSD.cc:50
CaloSlaveSD * slave
Definition: CaloSD.h:142
void summarize()
Definition: CaloSD.cc:652
CaloG4HitCollection * theHC
Definition: CaloSD.h:144
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:147
bool saveHit(CaloG4Hit *)
Definition: CaloSD.cc:616
void CaloSD::updateHit ( CaloG4Hit aHit)
protected

Definition at line 429 of file CaloSD.cc.

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

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

429  {
430  if (edepositEM+edepositHAD != 0) {
432 #ifdef DebugLog
433  LogDebug("CaloSim") << "CaloSD: Add energy deposit in " << currentID
434  << " em " << edepositEM/MeV << " hadronic "
435  << edepositHAD/MeV << " MeV";
436 #endif
437  }
438 
439  // buffer for next steps:
441 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:120
void addEnergyDeposit(double em, double hd)
Definition: CaloG4Hit.cc:45
float edepositHAD
Definition: CaloSD.h:120
CaloHitID previousID
Definition: CaloSD.h:116
CaloHitID currentID
Definition: CaloSD.h:116

Member Data Documentation

int CaloSD::checkHits
protected

Definition at line 123 of file CaloSD.h.

Referenced by CaloSD(), and checkHit().

int CaloSD::cleanIndex
private

Definition at line 151 of file CaloSD.h.

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

double CaloSD::correctT
protected

Definition at line 132 of file CaloSD.h.

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

bool CaloSD::corrTOFBeam
protected

Definition at line 131 of file CaloSD.h.

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

CaloG4Hit* CaloSD::currentHit
protected
CaloHitID CaloSD::currentID
protected
float CaloSD::edepositEM
protected
float CaloSD::edepositHAD
protected
double CaloSD::eminHit
protected

Definition at line 122 of file CaloSD.h.

Referenced by CaloSD(), and filterHit().

double CaloSD::eminHitD
protected

Definition at line 122 of file CaloSD.h.

Referenced by CaloSD(), and filterHit().

G4int CaloSD::emPDG
protected
double CaloSD::energyCut
protected

Definition at line 122 of file CaloSD.h.

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

G4ThreeVector CaloSD::entranceLocal
protected

Definition at line 111 of file CaloSD.h.

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

G4ThreeVector CaloSD::entrancePoint
protected

Definition at line 110 of file CaloSD.h.

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

G4int CaloSD::epPDG
protected
bool CaloSD::forceSave
protected

Definition at line 136 of file CaloSD.h.

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

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

Definition at line 143 of file CaloSD.h.

Referenced by Initialize().

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

Definition at line 145 of file CaloSD.h.

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

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

Definition at line 153 of file CaloSD.h.

Referenced by cleanHitCollection().

bool CaloSD::ignoreTrackID
private

Definition at line 141 of file CaloSD.h.

Referenced by CaloSD().

float CaloSD::incidentEnergy
protected

Definition at line 113 of file CaloSD.h.

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

double CaloSD::kmaxIon
protected
double CaloSD::kmaxNeutron
protected
double CaloSD::kmaxProton
protected
const SimTrackManager* CaloSD::m_trackManager
protected

Definition at line 126 of file CaloSD.h.

Referenced by saveHit(), and update().

CaloMeanResponse* CaloSD::meanResponse
private

Definition at line 148 of file CaloSD.h.

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

G4ThreeVector CaloSD::posGlobal
protected
G4StepPoint* CaloSD::preStepPoint
protected
CaloHitID CaloSD::previousID
protected
int CaloSD::primAncestor
private

Definition at line 150 of file CaloSD.h.

Referenced by CaloSD(), and update().

int CaloSD::primIDSaved
protected

Definition at line 114 of file CaloSD.h.

Referenced by clearHits(), and createNewHit().

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

Definition at line 152 of file CaloSD.h.

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

bool CaloSD::runInit
protected

Definition at line 129 of file CaloSD.h.

Referenced by update().

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

Definition at line 154 of file CaloSD.h.

Referenced by cleanHitCollection().

CaloSlaveSD* CaloSD::slave
private

Definition at line 142 of file CaloSD.h.

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

bool CaloSD::suppressHeavy
protected
CaloG4HitCollection* CaloSD::theHC
private
G4Track* CaloSD::theTrack
protected
int CaloSD::timeSlice
private

Definition at line 140 of file CaloSD.h.

Referenced by CaloSD().

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

Definition at line 147 of file CaloSD.h.

Referenced by createNewHit(), and update().

double CaloSD::tmaxHit
protected

Definition at line 122 of file CaloSD.h.

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

int CaloSD::totalHits
private

Definition at line 155 of file CaloSD.h.

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

bool CaloSD::useMap
protected

Definition at line 124 of file CaloSD.h.

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