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

Definition at line 124 of file CaloSD.cc.

References meanResponse, slave, and theHC.

124  {
125  if (slave) delete slave;
126  if (theHC) delete theHC;
127  if (meanResponse) delete meanResponse;
128 }
CaloSlaveSD * slave
Definition: CaloSD.h:141
CaloMeanResponse * meanResponse
Definition: CaloSD.h:147
CaloG4HitCollection * theHC
Definition: CaloSD.h:143

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 CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), HCalSD::hitForFibre(), and ProcessHits().

343  {
344 
345  //look in the HitContainer whether a hit with the same ID already exists:
346  bool found = false;
347  if (useMap) {
348  std::map<CaloHitID,CaloG4Hit*>::const_iterator it = hitMap.find(currentID);
349  if (it != hitMap.end()) {
350  currentHit = it->second;
351  found = true;
352  }
353  } else {
354  if (checkHits <= 0) return false;
355  int minhit= (theHC->entries()>checkHits ? theHC->entries()-checkHits : 0);
356  int maxhit= theHC->entries()-1;
357 
358  for (int j=maxhit; j>minhit&&!found; j--) {
359  if ((*theHC)[j]->getID() == currentID) {
360  currentHit = (*theHC)[j];
361  found = true;
362  }
363  }
364  }
365 
366  if (found) {
368  return true;
369  } else {
370  return false;
371  }
372 
373 }
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:453
bool useMap
Definition: CaloSD.h:123
int j
Definition: DBlmapReader.cc:9
CaloG4Hit * currentHit
Definition: CaloSD.h:126
CaloHitID currentID
Definition: CaloSD.h:115
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:144
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
int checkHits
Definition: CaloSD.h:122
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().

718  {
719 
720  std::vector<CaloG4Hit*>* theCollection = theHC->GetVector();
721 
722 #ifdef DebugLog
723  LogDebug("CaloSim") << "CaloSD: collection before merging, size = " << theHC->entries();
724 #endif
725 
726  selIndex.reserve(theHC->entries()-cleanIndex);
727  if ( reusehit.size() == 0 ) {
728  reusehit.reserve(theHC->entries()-cleanIndex);
729  }
730 
731  // if no map used, merge before hits to have the save situation as a map
732  if ( !useMap ) {
733  hitvec.swap(*theCollection);
734  sort((hitvec.begin()+cleanIndex), hitvec.end(), CaloG4HitLess());
735 #ifdef DebugLog
736  LogDebug("CaloSim") << "CaloSD: cleanHitCollection sort the hits in buffer starting from element = " << cleanIndex;
737  for ( unsigned int i = 0; i<hitvec.size(); i++) {
738  LogDebug("CaloSim") << i << " " << *hitvec[i];
739  }
740 #endif
741  unsigned int i, j;
742  CaloG4HitEqual equal;
743  for (i=cleanIndex; i<hitvec.size(); i++) {
744  selIndex.push_back(i-cleanIndex);
745  int jump = 0;
746  for (j = i+1; j <hitvec.size() && equal(hitvec[i], hitvec[j]); j++) {
747  jump++;
748  // merge j to i
749  (*hitvec[i]).addEnergyDeposit(*hitvec[j]);
750  (*hitvec[j]).setEM(0.);
751  (*hitvec[j]).setHadr(0.);
752  reusehit.push_back(hitvec[j]);
753  }
754  i+=jump;
755  }
756 #ifdef DebugLog
757  LogDebug("CaloSim") << "CaloSD: cleanHitCollection merge the hits in buffer ";
758  for ( unsigned int i = 0; i<hitvec.size(); i++) {
759  LogDebug("CaloSim") << i << " " << *hitvec[i];
760  }
761 #endif
762  for ( unsigned int i = cleanIndex; i < cleanIndex+selIndex.size(); i++ ) {
764  }
765  hitvec.resize(cleanIndex+selIndex.size());
766 #ifdef DebugLog
767  LogDebug("CaloSim") << "CaloSD: cleanHitCollection remove the merged hits in buffer, new size = " << hitvec.size();
768  for ( unsigned int i = 0; i<hitvec.size(); i++) {
769  LogDebug("CaloSim") << i << " " << *hitvec[i];
770  }
771 #endif
772  hitvec.swap(*theCollection);
773  std::vector<CaloG4Hit*>().swap(hitvec);
774  selIndex.clear();
775  totalHits = theHC->entries();
776  }
777 
778 #ifdef DebugLog
779  LogDebug("CaloSim") << "CaloSD: collection after merging, size = " << theHC->entries();
780 #endif
781 
782 
783  int addhit = 0;
784 
785 #ifdef DebugLog
786  LogDebug("CaloSim") << "CaloSD: Size of reusehit after merge = " << reusehit.size();
787  LogDebug("CaloSim") << "CaloSD: Starting hit selection from index = " << cleanIndex;
788 #endif
789 
790  selIndex.reserve(theCollection->size()-cleanIndex);
791  for (unsigned int i = cleanIndex; i<theCollection->size(); i++) {
792 
793  CaloG4Hit* aHit((*theCollection)[i]);
794 
795  // selection
796 
797  double time = aHit->getTimeSlice();
798  if (corrTOFBeam) time += correctT;
799  if (!filterHit(aHit,time)) {
800 #ifdef DebugLog
801  LogDebug("CaloSim") << "CaloSD: dropped CaloG4Hit " << " " << *aHit;
802 #endif
803 
804  // create the list of hits to be reused
805 
806  reusehit.push_back((*theCollection)[i]);
807  addhit++;
808  } else { selIndex.push_back(i-cleanIndex); }
809  }
810 
811 #ifdef DebugLog
812  LogDebug("CaloSim") << "CaloSD: Size of reusehit after selection = " << reusehit.size()
813  << " Number of added hit = " << addhit;
814 #endif
815  if (useMap) {
816  if ( addhit>0 ) {
817  int offset = reusehit.size()-addhit;
818  for (int ii = addhit-1; ii>=0; ii--) {
819  CaloHitID theID = reusehit[offset+ii]->getID();
820  hitMap.erase(theID);
821  }
822  }
823  }
824  for ( unsigned int j = 0; j<selIndex.size(); j++ ) {
825  (*theCollection)[cleanIndex+j] = (*theCollection)[cleanIndex+selIndex[j]];
826  }
827  theCollection->resize(cleanIndex+selIndex.size());
828  std::vector<unsigned int>().swap(selIndex);
829 
830 #ifdef DebugLog
831  LogDebug("CaloSim") << "CaloSD: hit collection after selection, size = " << theHC->entries();
832  theHC->PrintAllHits();
833 #endif
834 
835  cleanIndex = theHC->entries();
836 
837 }
#define LogDebug(id)
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:74
int i
Definition: DBlmapReader.cc:9
bool corrTOFBeam
Definition: CaloSD.h:130
int totalHits
Definition: CaloSD.h:154
bool useMap
Definition: CaloSD.h:123
std::vector< CaloG4Hit * > reusehit
Definition: CaloSD.h:151
int j
Definition: DBlmapReader.cc:9
std::vector< CaloG4Hit * > hitvec
Definition: CaloSD.h:152
std::vector< unsigned int > selIndex
Definition: CaloSD.h:153
unsigned int offset(bool)
virtual bool filterHit(CaloG4Hit *, double)
Definition: CaloSD.cc:620
double correctT
Definition: CaloSD.h:131
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:144
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
int cleanIndex
Definition: CaloSD.h:150
void CaloSD::clear ( void  )
virtual
void CaloSD::clearHits ( )
protectedvirtual

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().

576  {
577 
578  if (useMap) hitMap.erase (hitMap.begin(), hitMap.end());
579  for (unsigned int i = 0; i<reusehit.size(); i++) { delete reusehit[i]; }
580  std::vector<CaloG4Hit*>().swap(reusehit);
581  cleanIndex = 0;
582  previousID.reset();
583  primIDSaved = -99;
584 #ifdef DebugLog
585  LogDebug("CaloSim") << "CaloSD: Clears hit vector for " << GetName() << " "
586  << slave;
587 #endif
588  slave->Initialize();
589 #ifdef DebugLog
590  LogDebug("CaloSim") << "CaloSD: Initialises slave SD for " << GetName();
591 #endif
592 }
#define LogDebug(id)
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:74
virtual void Initialize()
Definition: CaloSlaveSD.cc:21
int i
Definition: DBlmapReader.cc:9
bool useMap
Definition: CaloSD.h:123
int primIDSaved
Definition: CaloSD.h:113
std::vector< CaloG4Hit * > reusehit
Definition: CaloSD.h:151
void reset()
Definition: CaloHitID.cc:53
CaloSlaveSD * slave
Definition: CaloSD.h:141
CaloHitID previousID
Definition: CaloSD.h:115
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:144
int cleanIndex
Definition: CaloSD.h:150
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(), CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), HCalSD::hitForFibre(), ZdcSD::ProcessHits(), DreamSD::ProcessHits(), HCalSD::ProcessHits(), and ProcessHits().

375  {
376 
377 #ifdef DebugLog
378  LogDebug("CaloSim") << "CaloSD::CreateNewHit for"
379  << " Unit " << currentID.unitID()
380  << " " << currentID.depth()
381  << " Edeposit = " << edepositEM << " " << edepositHAD;
382  LogDebug("CaloSim") << " primary " << currentID.trackID()
383  << " time slice " << currentID.timeSliceID()
384  << " For Track " << theTrack->GetTrackID()
385  << " which is a " <<theTrack->GetDefinition()->GetParticleName()
386  << " of energy " << theTrack->GetKineticEnergy()/GeV
387  << " " << theTrack->GetMomentum().mag()/GeV
388  << " daughter of part. " << theTrack->GetParentID()
389  << " and created by " ;
390 
391  if (theTrack->GetCreatorProcess()!=NULL)
392  LogDebug("CaloSim") << theTrack->GetCreatorProcess()->GetProcessName() ;
393  else
394  LogDebug("CaloSim") << "NO process";
395 #endif
396 
397  CaloG4Hit* aHit;
398  if (reusehit.size() > 0) {
399  aHit = reusehit[0];
400  aHit->setEM(0.);
401  aHit->setHadr(0.);
402  reusehit.erase(reusehit.begin());
403  } else {
404  aHit = new CaloG4Hit;
405  }
406 
407  aHit->setID(currentID);
410  aHit->setPosition(posGlobal.x(),posGlobal.y(),posGlobal.z());
412  updateHit(aHit);
413 
414  storeHit(aHit);
415  double etrack = 0;
416  if (currentID.trackID() == primIDSaved) { // The track is saved; nothing to be done
417  } else if (currentID.trackID() == theTrack->GetTrackID()) {
418  etrack= theTrack->GetKineticEnergy();
419  // edm::LogInfo("CaloSim") << "CaloSD: set save the track " << currentID.trackID() << " etrack " << etrack << " eCut " << energyCut << " flag " << forceSave;
420  if (etrack >= energyCut || forceSave) {
421  TrackInformation * trkInfo =
422  (TrackInformation *)(theTrack->GetUserInformation());
423  trkInfo->storeTrack(true);
424  trkInfo->putInHistory();
425  // trkInfo->setAncestor();
426 #ifdef DebugLog
427  LogDebug("CaloSim") << "CaloSD: set save the track "
428  << currentID.trackID() << " with Hit";
429 #endif
430  }
431  } else {
433 #ifdef DebugLog
434  LogDebug("CaloSim") << "CaloSD : TrackwithHistory pointer for "
435  << currentID.trackID() << " is " << trkh;
436 #endif
437  if (trkh != NULL) {
438  etrack = sqrt(trkh->momentum().Mag2());
439  if (etrack >= energyCut) {
440  trkh->save();
441 #ifdef DebugLog
442  LogDebug("CaloSim") << "CaloSD: set save the track "
443  << currentID.trackID() << " with Hit";
444 #endif
445  }
446  }
447  }
449  if (useMap) totalHits++;
450  return aHit;
451 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:119
double energyCut
Definition: CaloSD.h:121
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:453
bool storeTrack() const
int totalHits
Definition: CaloSD.h:154
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:123
#define NULL
Definition: scimark2.h:8
G4ThreeVector posGlobal
Definition: CaloSD.h:111
int primIDSaved
Definition: CaloSD.h:113
uint16_t depth() const
Definition: CaloHitID.h:26
std::vector< CaloG4Hit * > reusehit
Definition: CaloSD.h:151
bool forceSave
Definition: CaloSD.h:135
int timeSliceID() const
Definition: CaloHitID.h:23
float edepositHAD
Definition: CaloSD.h:119
T sqrt(T t)
Definition: SSEVec.h:28
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:640
G4Track * theTrack
Definition: CaloSD.h:116
CaloHitID currentID
Definition: CaloSD.h:115
const math::XYZVectorD & momentum() const
float incidentEnergy
Definition: CaloSD.h:112
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:146
uint32_t unitID() const
Definition: CaloHitID.h:22
G4ThreeVector entrancePoint
Definition: CaloSD.h:109
G4ThreeVector entranceLocal
Definition: CaloSD.h:110
void CaloSD::DrawAll ( )
virtual

Definition at line 253 of file CaloSD.cc.

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

Reimplemented from SensitiveDetector.

Definition at line 238 of file CaloSD.cc.

References cleanHitCollection(), and theHC.

238  {
239 
240  // clean the hits for the last tracks
241 
243 
244 #ifdef DebugLog
245  edm::LogInfo("CaloSim") << "CaloSD: EndofEvent entered with " << theHC->entries()
246  << " entries";
247 #endif
248  // TimeMe("CaloSD:sortAndMergeHits",false);
249 }
void cleanHitCollection()
Definition: CaloSD.cc:718
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
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.

262  {
263  if (slave->name() == n) c=slave->hits();
264  slave->Clean();
265 }
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:141
bool CaloSD::filterHit ( CaloG4Hit hit,
double  time 
)
protectedvirtual

Reimplemented in HCalSD.

Definition at line 620 of file CaloSD.cc.

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

Referenced by cleanHitCollection().

620  {
621  double emin(eminHit);
622  if (hit->getDepth() > 0) emin = eminHitD;
623 #ifdef DebugLog
624  LogDebug("CaloSim") << "Depth " << hit->getDepth() << " Emin = " << emin << " (" << eminHit << ", " << eminHitD << ")";
625 #endif
626  return ((time <= tmaxHit) && (hit->getEnergyDeposit() > emin));
627 }
#define LogDebug(id)
uint16_t getDepth() const
Definition: CaloG4Hit.h:72
double eminHitD
Definition: CaloSD.h:121
double eminHit
Definition: CaloSD.h:121
double tmaxHit
Definition: CaloSD.h:121
double getEnergyDeposit() const
Definition: CaloG4Hit.h:81
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 HcalTB06BeamSD::getEnergyDeposit(), EcalTBH4BeamSD::getEnergyDeposit(), ECalSD::getEnergyDeposit(), HcalTB02SD::getEnergyDeposit(), HCalSD::getEnergyDeposit(), and DreamSD::getStepInfo().

481  {
482 
483  double weight = 1.;
484  double charge = aStep->GetPreStepPoint()->GetCharge();
485 
486  if (charge != 0. && aStep->GetStepLength() > 0) {
487  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
488  double density = mat->GetDensity();
489  double dedx = aStep->GetTotalEnergyDeposit()/aStep->GetStepLength();
490  double rkb = birk1/density;
491  double c = birk2*rkb*rkb;
492  if (std::abs(charge) >= 2.) rkb /= birk3; // based on alpha particle data
493  weight = 1./(1.+rkb*dedx+c*dedx*dedx);
494 #ifdef DebugLog
495  LogDebug("CaloSim") << "CaloSD::getAttenuation in " << mat->GetName()
496  << " Charge " << charge << " dE/dx " << dedx
497  << " Birk Const " << rkb << ", " << c << " Weight = "
498  << weight << " dE " << aStep->GetTotalEnergyDeposit();
499 #endif
500  }
501  return weight;
502 }
#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 618 of file CaloSD.cc.

Referenced by getStepInfo(), and ProcessHits().

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

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

Definition at line 217 of file CaloSD.cc.

Referenced by getStepInfo().

217  {
218  return aStep->GetTotalEnergyDeposit();
219 }
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 ECalSD::getEnergyDeposit(), and HCalSD::getEnergyDeposit().

629  {
630 
631  if (meanResponse) {
632  TrackInformation * trkInfo = (TrackInformation *)(aTrack->GetUserInformation());
633  return meanResponse->getWeight(trkInfo->genParticlePID(),
634  trkInfo->genParticleP());
635  } else {
636  return 1;
637  }
638 }
double genParticleP() const
double getWeight(int genPID, double genP)
int genParticlePID() const
CaloMeanResponse * meanResponse
Definition: CaloSD.h:147
bool CaloSD::getStepInfo ( G4Step *  aStep)
protectedvirtual

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

267  {
268 
269  preStepPoint = aStep->GetPreStepPoint();
270  theTrack = aStep->GetTrack();
271 
272  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
273  if (particleCode == emPDG ||
274  particleCode == epPDG ||
275  particleCode == gammaPDG ) {
276  edepositEM = getEnergyDeposit(aStep); edepositHAD = 0.;
277  } else {
278  edepositEM = 0.; edepositHAD = getEnergyDeposit(aStep);
279  }
280 
281  double time = (aStep->GetPostStepPoint()->GetGlobalTime())/nanosecond;
282  unsigned int unitID= setDetUnitId(aStep);
283  uint16_t depth = getDepth(aStep);
284  int primaryID = getTrackID(theTrack);
285 
286  bool flag = (unitID > 0);
287  if (flag) {
288  currentID.setID(unitID, time, primaryID, depth);
289 #ifdef DebugLog
290  G4TouchableHistory* touch =(G4TouchableHistory*)(theTrack->GetTouchable());
291  LogDebug("CaloSim") << "CaloSD:: GetStepInfo for"
292  << " PV " << touch->GetVolume(0)->GetName()
293  << " PVid = " << touch->GetReplicaNumber(0)
294  << " MVid = " << touch->GetReplicaNumber(1)
295  << " Unit " << currentID.unitID()
296  << " Edeposit = " << edepositEM << " " << edepositHAD;
297  } else {
298  G4TouchableHistory* touch =(G4TouchableHistory*)(theTrack->GetTouchable());
299  LogDebug("CaloSim") << "CaloSD:: GetStepInfo for"
300  << " PV " << touch->GetVolume(0)->GetName()
301  << " PVid = " << touch->GetReplicaNumber(0)
302  << " MVid = " << touch->GetReplicaNumber(1)
303  << " Unit " << std::hex << unitID << std::dec
304  << " Edeposit = " << edepositEM << " " << edepositHAD;
305 #endif
306  }
307  return flag;
308 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:119
virtual uint32_t setDetUnitId(G4Step *step)=0
G4int emPDG
Definition: CaloSD.h:134
long int flag
Definition: mlp_lapack.h:47
virtual int getTrackID(G4Track *)
Definition: CaloSD.cc:596
float edepositHAD
Definition: CaloSD.h:119
G4int epPDG
Definition: CaloSD.h:134
G4int gammaPDG
Definition: CaloSD.h:134
G4Track * theTrack
Definition: CaloSD.h:116
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:118
CaloHitID currentID
Definition: CaloSD.h:115
uint32_t unitID() const
Definition: CaloHitID.h:22
virtual uint16_t getDepth(G4Step *)
Definition: CaloSD.cc:618
virtual double getEnergyDeposit(G4Step *step)
Definition: CaloSD.cc:217
int CaloSD::getTrackID ( G4Track *  aTrack)
protectedvirtual

Reimplemented in ECalSD.

Definition at line 596 of file CaloSD.cc.

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

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

596  {
597 
598  int primaryID = 0;
599  forceSave = false;
600  TrackInformation* trkInfo=(TrackInformation *)(aTrack->GetUserInformation());
601  if (trkInfo) {
602  primaryID = trkInfo->getIDonCaloSurface();
603 #ifdef DebugLog
604  LogDebug("CaloSim") << "CaloSD: hit update from track Id on Calo Surface "
605  << trkInfo->getIDonCaloSurface();
606 #endif
607  } else {
608  primaryID = aTrack->GetTrackID();
609 #ifdef DebugLog
610  edm::LogWarning("CaloSim") << "CaloSD: Problem with primaryID **** set by "
611  << "force to TkID **** " << primaryID << " in "
612  << preStepPoint->GetTouchable()->GetVolume(0)->GetName();
613 #endif
614  }
615  return primaryID;
616 }
#define LogDebug(id)
int getIDonCaloSurface() const
bool forceSave
Definition: CaloSD.h:135
G4StepPoint * preStepPoint
Definition: CaloSD.h:118
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 ZdcSD::ProcessHits(), DreamSD::ProcessHits(), HCalSD::ProcessHits(), and ProcessHits().

319  {
320 
321 #ifdef DebugLog
322  if (currentID.trackID()<1) {
323  edm::LogWarning("CaloSim") << "***** CaloSD error: primaryID = "
324  << currentID.trackID()
325  << " maybe detector name changed";
326  }
327 #endif
328  // Update if in the same detector, time-slice and for same track
329  if (currentID == previousID) {
331  return true;
332  }
333 
334  // Reset entry point for new primary
335  posGlobal = preStepPoint->GetPosition();
336  if (currentID.trackID() != previousID.trackID())
337  resetForNewPrimary(preStepPoint->GetPosition(),
338  preStepPoint->GetKineticEnergy());
339 
340  return checkHit();
341 }
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:453
G4ThreeVector posGlobal
Definition: CaloSD.h:111
G4bool checkHit()
Definition: CaloSD.cc:343
int trackID() const
Definition: CaloHitID.h:25
CaloHitID previousID
Definition: CaloSD.h:115
CaloG4Hit * currentHit
Definition: CaloSD.h:126
G4StepPoint * preStepPoint
Definition: CaloSD.h:118
CaloHitID currentID
Definition: CaloSD.h:115
void resetForNewPrimary(G4ThreeVector, double)
Definition: CaloSD.cc:468
void CaloSD::Initialize ( G4HCofThisEvent *  HCE)
virtual

Reimplemented from SensitiveDetector.

Definition at line 221 of file CaloSD.cc.

References hcID, theHC, and totalHits.

221  {
222 
223  totalHits = 0;
224 
225 #ifdef DebugLog
226  edm::LogInfo("CaloSim") << "CaloSD : Initialize called for " << GetName();
227 #endif
228 
229  //This initialization is performed at the beginning of an event
230  //------------------------------------------------------------
231  theHC = new CaloG4HitCollection(GetName(), collectionName[0]);
232 
233  if (hcID<0)
234  hcID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
235  HCE->AddHitsCollection(hcID, theHC);
236 }
int totalHits
Definition: CaloSD.h:154
int hcID
Definition: CaloSD.h:142
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
void CaloSD::initRun ( )
protectedvirtual

Reimplemented in CastorSD, HCalSD, DreamSD, and ZdcSD.

Definition at line 594 of file CaloSD.cc.

Referenced by update().

594 {}
void CaloSD::PrintAll ( )
virtual

Definition at line 255 of file CaloSD.cc.

References theHC.

255  {
256 #ifdef DebugLog
257  edm::LogInfo("CaloSim") << "CaloSD: Collection " << theHC->GetName();
258 #endif
259  theHC->PrintAllHits();
260 }
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
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.

130  {
131  // TimeMe t1( theHitTimer, false);
132 
133  NaNTrap( aStep ) ;
134 
135  if (aStep == NULL) {
136  return true;
137  } else {
138  if (getStepInfo(aStep)) {
139  if (hitExists() == false && edepositEM+edepositHAD>0.)
141  }
142  }
143  return true;
144 }
float edepositEM
Definition: CaloSD.h:119
#define NULL
Definition: scimark2.h:8
float edepositHAD
Definition: CaloSD.h:119
CaloG4Hit * currentHit
Definition: CaloSD.h:126
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
Definition: CaloSD.cc:267
G4bool hitExists()
Definition: CaloSD.cc:319
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:375
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().

146  {
147 
148  if (aSpot != NULL) {
149 
150  theTrack = const_cast<G4Track *>(aSpot->GetOriginatorTrack()->GetPrimaryTrack());
151  G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
152 
153  if (particleCode == emPDG ||
154  particleCode == epPDG ||
155  particleCode == gammaPDG ) {
156  edepositEM = aSpot->GetEnergySpot()->GetEnergy(); edepositHAD = 0.;
157  } else {
158  edepositEM = 0.; edepositHAD = 0.;
159  }
160 
161  if (edepositEM>0.) {
162  G4Step * fFakeStep = new G4Step();
163  preStepPoint = fFakeStep->GetPreStepPoint();
164  G4StepPoint * fFakePostStepPoint = fFakeStep->GetPostStepPoint();
165  preStepPoint->SetPosition(aSpot->GetPosition());
166  fFakePostStepPoint->SetPosition(aSpot->GetPosition());
167 
168  G4TouchableHandle fTouchableHandle = aSpot->GetTouchableHandle();
169  preStepPoint->SetTouchableHandle(fTouchableHandle);
170  fFakeStep->SetTotalEnergyDeposit(aSpot->GetEnergySpot()->GetEnergy());
171 
172  double time = 0;
173  unsigned int unitID = setDetUnitId(fFakeStep);
174  int primaryID = getTrackID(theTrack);
175  uint16_t depth = getDepth(fFakeStep);
176 
177  if (unitID > 0) {
178  currentID.setID(unitID, time, primaryID, depth);
179 #ifdef DebugLog
180  LogDebug("CaloSim") << "CaloSD:: GetSpotInfo for"
181  << " Unit 0x" << std::hex << currentID.unitID()
182  << std::dec << " Edeposit = " << edepositEM << " "
183  << edepositHAD;
184 #endif
185  // Update if in the same detector, time-slice and for same track
186  if (currentID == previousID) {
188  } else {
189 
190  posGlobal = aSpot->GetEnergySpot()->GetPosition();
191  // Reset entry point for new primary
192  if (currentID.trackID() != previousID.trackID()) {
193  entrancePoint = aSpot->GetPosition();
194  entranceLocal = aSpot->GetTouchableHandle()->GetHistory()->
195  GetTopTransform().TransformPoint(entrancePoint);
196  incidentEnergy = theTrack->GetKineticEnergy();
197 #ifdef DebugLog
198  LogDebug("CaloSim") << "CaloSD: Incident energy "
199  << incidentEnergy/GeV << " GeV and"
200  << " entrance point " << entrancePoint
201  << " (Global) " << entranceLocal << " (Local)";
202 #endif
203  }
204 
205  if (checkHit() == false) currentHit = createNewHit();
206  }
207  }
208 
209  delete fFakeStep;
210  }
211  return true;
212 
213  }
214  return false;
215 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:119
virtual uint32_t setDetUnitId(G4Step *step)=0
G4int emPDG
Definition: CaloSD.h:134
void updateHit(CaloG4Hit *)
Definition: CaloSD.cc:453
virtual int getTrackID(G4Track *)
Definition: CaloSD.cc:596
#define NULL
Definition: scimark2.h:8
G4ThreeVector posGlobal
Definition: CaloSD.h:111
G4bool checkHit()
Definition: CaloSD.cc:343
float edepositHAD
Definition: CaloSD.h:119
int trackID() const
Definition: CaloHitID.h:25
G4int epPDG
Definition: CaloSD.h:134
G4int gammaPDG
Definition: CaloSD.h:134
CaloHitID previousID
Definition: CaloSD.h:115
CaloG4Hit * currentHit
Definition: CaloSD.h:126
G4Track * theTrack
Definition: CaloSD.h:116
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
Definition: CaloHitID.cc:44
G4StepPoint * preStepPoint
Definition: CaloSD.h:118
CaloHitID currentID
Definition: CaloSD.h:115
float incidentEnergy
Definition: CaloSD.h:112
uint32_t unitID() const
Definition: CaloHitID.h:22
CaloG4Hit * createNewHit()
Definition: CaloSD.cc:375
virtual uint16_t getDepth(G4Step *)
Definition: CaloSD.cc:618
G4ThreeVector entrancePoint
Definition: CaloSD.h:109
G4ThreeVector entranceLocal
Definition: CaloSD.h:110
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(), CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), ZdcSD::setTrackID(), CastorSD::setTrackID(), and HCalSD::setTrackID().

468  {
469 
473 #ifdef DebugLog
474  LogDebug("CaloSim") << "CaloSD: Incident energy " << incidentEnergy/GeV
475  << " GeV and" << " entrance point " << entrancePoint
476  << " (Global) " << entranceLocal << " (Local)";
477 #endif
478 }
G4ThreeVector setToLocal(G4ThreeVector, const G4VTouchable *)
Definition: CaloSD.cc:310
#define LogDebug(id)
G4StepPoint * preStepPoint
Definition: CaloSD.h:118
float incidentEnergy
Definition: CaloSD.h:112
*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:109
G4ThreeVector entranceLocal
Definition: CaloSD.h:110
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().

653  {
654 
655  int tkID;
656  bool ok = true;
657  if (m_trackManager) {
658  tkID = m_trackManager->giveMotherNeeded(aHit->getTrackID());
659  if (tkID == 0) {
660  if (m_trackManager->trackExists(aHit->getTrackID()))
661  tkID = (aHit->getTrackID());
662  else
663  ok = false;
664  }
665  } else {
666  tkID = aHit->getTrackID();
667  ok = false;
668  }
669  // edm::LogInfo("CaloSim") << "CalosD: Track ID " << aHit->getTrackID() << " changed to " << tkID << " by SimTrackManager" << " Status " << ok;
670 #ifdef DebugLog
671  LogDebug("CaloSim") << "CalosD: Track ID " << aHit->getTrackID()
672  << " changed to " << tkID << " by SimTrackManager"
673  << " Status " << ok;
674 #endif
675  double time = aHit->getTimeSlice();
676  if (corrTOFBeam) time += correctT;
677  slave->processHits(aHit->getUnitID(), aHit->getEM()/GeV,
678  aHit->getHadr()/GeV, time, tkID, aHit->getDepth());
679 #ifdef DebugLog
680  LogDebug("CaloSim") << "CaloSD: Store Hit at " << std::hex
681  << aHit->getUnitID() << std::dec << " "
682  << aHit->getDepth() << " due to " << tkID
683  << " in time " << time << " of energy "
684  << aHit->getEM()/GeV << " GeV (EM) and "
685  << aHit->getHadr()/GeV << " GeV (Hadr)";
686 #endif
687  return ok;
688 }
#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:130
uint16_t getDepth() const
Definition: CaloG4Hit.h:72
bool trackExists(unsigned int i) const
CaloSlaveSD * slave
Definition: CaloSD.h:141
int giveMotherNeeded(int i) const
int getTrackID() const
Definition: CaloG4Hit.h:68
double correctT
Definition: CaloSD.h:131
double getEM() const
Definition: CaloG4Hit.h:59
double getTimeSlice() const
Definition: CaloG4Hit.h:70
const SimTrackManager * m_trackManager
Definition: CaloSD.h:125
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 310 of file CaloSD.cc.

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

311  {
312 
313  G4ThreeVector localPoint =
314  touch->GetHistory()->GetTopTransform().TransformPoint(global);
315 
316  return localPoint;
317 }
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().

640  {
641 
642  if (previousID.trackID()<0) return;
643  if (hit == 0) {
644  edm::LogWarning("CaloSim") << "CaloSD: hit to be stored is NULL !!";
645  return;
646  }
647 
648  theHC->insert(hit);
649  if (useMap) hitMap.insert(std::pair<CaloHitID,CaloG4Hit*>(previousID,hit));
650 
651 }
bool useMap
Definition: CaloSD.h:123
int trackID() const
Definition: CaloHitID.h:25
CaloHitID previousID
Definition: CaloSD.h:115
std::map< CaloHitID, CaloG4Hit * > hitMap
Definition: CaloSD.h:144
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
void CaloSD::summarize ( )
private

Definition at line 690 of file CaloSD.cc.

Referenced by update().

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

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.

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

504  {
505 
506  G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
507  G4String particleName;
508  emPDG = theParticleTable->FindParticle(particleName="e-")->GetPDGEncoding();
509  epPDG = theParticleTable->FindParticle(particleName="e+")->GetPDGEncoding();
510  gammaPDG = theParticleTable->FindParticle(particleName="gamma")->GetPDGEncoding();
511 #ifdef DebugLog
512  LogDebug("CaloSim") << "CaloSD: Particle code for e- = " << emPDG
513  << " for e+ = " << epPDG << " for gamma = " << gammaPDG;
514 #endif
515  initRun();
516  runInit = true;
517 }
#define LogDebug(id)
G4int emPDG
Definition: CaloSD.h:134
G4int epPDG
Definition: CaloSD.h:134
G4int gammaPDG
Definition: CaloSD.h:134
virtual void initRun()
Definition: CaloSD.cc:594
bool runInit
Definition: CaloSD.h:128
void CaloSD::update ( const BeginOfEvent )
protectedvirtual

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.

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

519  {
520 #ifdef DebugLog
521  LogDebug("CaloSim") << "CaloSD: Dispatched BeginOfEvent for " << GetName()
522  << " !" ;
523 #endif
524  clearHits();
525 }
#define LogDebug(id)
virtual void clearHits()
Definition: CaloSD.cc:576
void CaloSD::update ( const BeginOfTrack )
protectedvirtual

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.

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

692  {
693 
694  int primary = -1;
695  TrackInformation * trkInfo = (TrackInformation *)((*trk)()->GetUserInformation());
696  if ( trkInfo->isPrimary() ) { primary = (*trk)()->GetTrackID(); }
697 
698 #ifdef DebugLog
699  LogDebug("CaloSim") << "New track: isPrimary " << trkInfo->isPrimary()
700  << " primary ID = " << primary
701  << " primary ancestor ID " << primAncestor;
702 #endif
703 
704  // update the information if a different primary track ID
705 
706  if (primary > 0 && primary != primAncestor) {
707  primAncestor = primary;
708 
709  // clean the hits information
710 
711  if (theHC->entries()>0) {
713  }
714 
715  }
716 }
#define LogDebug(id)
int primAncestor
Definition: CaloSD.h:149
void cleanHitCollection()
Definition: CaloSD.cc:718
bool isPrimary() const
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
void CaloSD::update ( const EndOfTrack )
protectedvirtual

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().

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

527  {
528 
529  int id = (*trk)()->GetTrackID();
530  TrackInformation *trkI =(TrackInformation *)((*trk)()->GetUserInformation());
531  int lastTrackID = -1;
532  if (trkI) lastTrackID = trkI->getIDonCaloSurface();
533  if (id == lastTrackID) {
534  const TrackContainer * trksForThisEvent = m_trackManager->trackContainer();
535  if (trksForThisEvent != NULL) {
536  int it = (int)(trksForThisEvent->size()) - 1;
537  if (it >= 0) {
538  TrackWithHistory * trkH = (*trksForThisEvent)[it];
539  if (trkH->trackID() == (unsigned int)(id)) tkMap[id] = trkH;
540 #ifdef DebugLog
541  LogDebug("CaloSim") << "CaloSD: get track " << it << " from "
542  << "Container of size " << trksForThisEvent->size()
543  << " with ID " << trkH->trackID();
544  } else {
545  LogDebug("CaloSim") << "CaloSD: get track " << it << " from "
546  << "Container of size " << trksForThisEvent->size()
547  << " with no ID";
548 #endif
549  }
550  }
551  }
552 }
#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:146
const SimTrackManager * m_trackManager
Definition: CaloSD.h:125
void CaloSD::update ( const ::EndOfEvent )
protectedvirtual

Definition at line 554 of file CaloSD.cc.

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

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

554  {
555 
556  int count = 0, wrong = 0;
557  bool ok;
558 
559  slave->ReserveMemory(theHC->entries());
560 
561  for (int i=0; i<theHC->entries(); i++) {
562  ok = saveHit((*theHC)[i]);
563  count++;
564  if (!ok) wrong++;
565  }
566 
567  edm::LogInfo("CaloSim") << "CaloSD: " << GetName() << " store " << count
568  << " hits recorded with " << wrong
569  << " track IDs not given properly and "
570  << totalHits-count << " hits not passing cuts";
571  summarize();
572 
573  tkMap.erase (tkMap.begin(), tkMap.end());
574 }
int i
Definition: DBlmapReader.cc:9
int totalHits
Definition: CaloSD.h:154
virtual void ReserveMemory(unsigned int size)
Definition: CaloSlaveSD.cc:50
CaloSlaveSD * slave
Definition: CaloSD.h:141
void summarize()
Definition: CaloSD.cc:690
CaloG4HitCollection * theHC
Definition: CaloSD.h:143
std::map< int, TrackWithHistory * > tkMap
Definition: CaloSD.h:146
bool saveHit(CaloG4Hit *)
Definition: CaloSD.cc:653
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(), CastorSD::getFromLibrary(), HCalSD::getFromLibrary(), HCalSD::getFromParam(), HCalSD::getHitFibreBundle(), HCalSD::getHitPMT(), hitExists(), HCalSD::hitForFibre(), and ProcessHits().

453  {
454 
455  if (edepositEM+edepositHAD != 0) {
457 #ifdef DebugLog
458  LogDebug("CaloSim") << "CaloSD: Add energy deposit in " << currentID
459  << " em " << edepositEM/MeV << " hadronic "
460  << edepositHAD/MeV << " MeV";
461 #endif
462  }
463 
464  // buffer for next steps:
466 }
#define LogDebug(id)
float edepositEM
Definition: CaloSD.h:119
void addEnergyDeposit(double em, double hd)
Definition: CaloG4Hit.cc:45
float edepositHAD
Definition: CaloSD.h:119
CaloHitID previousID
Definition: CaloSD.h:115
CaloHitID currentID
Definition: CaloSD.h:115

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().

CaloG4Hit* CaloSD::currentHit
protected
CaloHitID CaloSD::currentID
protected
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(), ECalSD::getTrackID(), and 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
const SimTrackManager* CaloSD::m_trackManager
protected

Definition at line 125 of file CaloSD.h.

Referenced by saveHit(), and update().

CaloMeanResponse* CaloSD::meanResponse
private

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

CaloSlaveSD* CaloSD::slave
private

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