Commit in projects/lcdd/branches/v04-00-00-pre on MAIN | |||
include/lcdd/detectors/CalorimeterSD.hh | +12 | -44 | 3107 -> 3108 |
/SensitiveDetector.hh | +3 | -38 | 3107 -> 3108 |
/SensitiveDetectorMessenger.hh | -3 | 3107 -> 3108 | |
/TrackerSD.hh | +1 | -24 | 3107 -> 3108 |
src/lcdd/detectors/CalorimeterSD.cc | +16 | -67 | 3107 -> 3108 |
/ScoringTrackerHitProcessor.cc | +13 | -13 | 3107 -> 3108 |
/SensitiveDetector.cc | +8 | -58 | 3107 -> 3108 |
/SensitiveDetectorMessenger.cc | +2 | -20 | 3107 -> 3108 |
/TrackerSD.cc | -58 | 3107 -> 3108 | |
+55 | -325 |
Add hit maps with cleanup. Other minor cosmetic changes and cleanup.
--- projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/CalorimeterSD.hh 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/CalorimeterSD.hh 2014-05-07 18:54:53 UTC (rev 3108) @@ -12,7 +12,6 @@
/** * @brief The implementation of a calorimeter that accumulates energy depositions by event.
- * @todo Rewrite print functions using new data structures. Old hit vector was removed.
*/ class CalorimeterSD: public SensitiveDetector {
@@ -44,14 +43,6 @@
CalorimeterSD(G4String sdName, const std::vector<G4String>& hcNames, Segmentation* sdSeg); /**
- * Class constructor. - * @param[in] sdName The name of the sensitive detector. - * @param[in] hcName The name of the output hit collection. - * @param[in] sdSeg The detector's segmentation object for dividing into artificial cells. - * @param[in] compare The hit comparator to be used by this detector. - */ - //CalorimeterSD(G4String sdName, Segmentation* sdSeg); - /**
* Class destructor. */ virtual ~CalorimeterSD();
@@ -60,19 +51,19 @@
* Check whether a given logical volume is valid for this detector. * @return True if lv is valid; false if not. */
- virtual bool isValidVolume(G4LogicalVolume* lv);
+ bool isValidVolume(G4LogicalVolume* lv);
/** * Implementation of Geant4's G4VSensitiveDetector::Initialize method. * @param[in] hc The hit collection of the event. */
- virtual void Initialize(G4HCofThisEvent* hc);
+ void Initialize(G4HCofThisEvent* hc);
/** * Implementation of Geant4's G4VSensitiveDetector::EndOfEvent method. * @param[in] hc The hit collection of the event. */
- virtual void EndOfEvent(G4HCofThisEvent* hc);
+ void EndOfEvent(G4HCofThisEvent* hc);
/** * Get the segmentation of this detector or 0 if unset.
@@ -85,53 +76,30 @@
* @param[in] os The output stream. * @return The same output stream. */
- std::ostream& printHits(std::ostream& os);
+ //std::ostream& printHits(std::ostream& os);
/**
- * Clear the current list of hits. - */ - void clearHits(); - - /**
* Print the calorimeter's basic information. * @param[in] os The output stream. * @return The same output stream. */
- virtual std::ostream& printBasicInfo(std::ostream& os);
+ std::ostream& printBasicInfo(std::ostream& os);
/**
- * Get the total energy deposition in this detector. - * @return The total energy deposition. - */ - virtual double getEdep() const; - - /** - * Get the total energy deposition in this detector by hits collection index. - * @param[in] nhC The index of the hits collection. - * @return The total energy deposition in the given hits collection. - */ - virtual double getEdep(G4int nHC) const; - - /** - * Add a hit to this Calorimeter. - * @param[in] hit The hit to add. - */ - void addHit(CalorimeterHit* hit); - - /**
* Add a hit to one of this Calorimeter's hit collections. * @param[in] hit The hit to add. * @param[in] collectionIndex The index of the hit collection. * @todo Deprecated => remove. */
- void addHit(CalorimeterHit* hit, int collectionIndex);
+ void addHit(CalorimeterHit* hit, int collectionIndex = 0);
/** * Find a CalorimeterHit by ID.
- * @param id The Id64bit to lookup.
+ * @param[in] id The Id64bit to lookup.
+ * @param[in] collectionIndex The index of the hits collection.
* @return A hit with matching ID or null if does not exist. */
- CalorimeterHit* findHit(const Id64bit& id);
+ CalorimeterHit* findHit(const Id64bit& id, int collectionIndex = 0);
protected:
@@ -147,11 +115,11 @@
// The calorimeter's virtual segmentation. Segmentation* _segmentation;
- // Pointers to hits collections.
+ // Pointers to current hits collections.
std::vector<CalorimeterHitsCollection*> _hitsCollections;
- // Hit lookup map. - CalorimeterHitMap _hitMap;
+ // A list of hit maps, one per hits collection. + std::vector<CalorimeterHitMap*> _hitMaps;
}; #endif
--- projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/SensitiveDetector.hh 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/SensitiveDetector.hh 2014-05-07 18:54:53 UTC (rev 3108) @@ -31,9 +31,9 @@
eNone = 0, eTracker = 1, eCalorimeter = 2 };
- static const std::string& trackerStr; - static const std::string& calorimeterStr; - static const std::string& noneStr;
+ static const std::string& TRACKER; + static const std::string& CALORIMETER; + static const std::string& UNKNOWN;
typedef std::vector<HitProcessor*> HitProcessors;
@@ -178,20 +178,6 @@
virtual std::ostream& printBasicInfo(std::ostream& os); /**
- * Print the number of hits to the output stream. - * @param[in] os The output stream. - * @return The same output stream. - */ - virtual std::ostream& printNumberOfHits(std::ostream& os); - - /** - * Print the number of hits to the output stream. - * @param[in] os The output stream. - * @return The same output stream. - */ - virtual std::ostream& printEdep(std::ostream& os); - - /**
* Print the names of volumes associated to this detector. * @param[in] os The output stream. * @return The same output stream.
@@ -199,39 +185,18 @@
virtual std::ostream& printVolumes(std::ostream& os); /**
- * Print the list of hits. Subclasses must implement this. - * @param[in] os The output stream. - * @return The same output stream. - */ - virtual std::ostream& printHits(std::ostream& os); - - /**
* Get the number of hits collections associated to this detector. * @return The number of hit collections. */ int getNumberOfHitsCollections() const; /**
- * Get the total energy deposition from the hits of this detector. - * @note This method would requires access to concrete hit types, - * so this function must be implemented by subclasses. - * @return The total energy deposition of all the hits. - */ - virtual double getEdep() const; - - /**
* Get a list of G4LogicalVolume objects that have been assigned to this detector. * @return The list of G4LogicalVolume objects assigned to this detector. */ std::vector<G4LogicalVolume*> getLogicalVolumes() const; /**
- * Clear the list of hits after event processing. - * @note Sub-classes must implement this method. - */ - virtual void clearHits(); - - /**
* Add a hit processor. * @param[in] processor The hit processor. */
--- projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/SensitiveDetectorMessenger.hh 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/SensitiveDetectorMessenger.hh 2014-05-07 18:54:53 UTC (rev 3108) @@ -63,10 +63,7 @@
static G4UIdirectory* _detectorsDir; G4UIdirectory* _detectorDir; G4UIcommand* _printInfoCmd;
- G4UIcommand* _printHitsCmd;
G4UIcommand* _printVolumesCmd;
- G4UIcommand* _printTotalEdepCmd; - G4UIcommand* _printNHitsCmd;
G4UIcmdWithAnInteger* _verboseCmd; G4UIcmdWithABool* _activateCmd; G4UIcmdWithADoubleAndUnit* _ecutCmd;
--- projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/TrackerSD.hh 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/include/lcdd/detectors/TrackerSD.hh 2014-05-07 18:54:53 UTC (rev 3108) @@ -11,10 +11,7 @@
* @brief The basic binding for a tracker type subdetector that records individual step information. */ class TrackerSD: public SensitiveDetector {
-public:
- //typedef std::vector<TrackerHit*> TrackerHitList; -
public: /**
@@ -41,32 +38,14 @@
* Perform end of event processing. * @param[in] hce The hit collection of this event. */
- virtual void EndOfEvent(G4HCofThisEvent* hce);
+ //virtual void EndOfEvent(G4HCofThisEvent* hce);
/**
- * Print out hit data. - * @param[in] os The output stream. - * @return The same output stream. - */ - std::ostream& printHits(std::ostream& os); - - /** - * Get the total energy deposition in the event. - * @return The total energy deposition. - */ - double getEdep() const; - - /**
* Clear the current hit list. */ void clearHits(); /**
- * Get the list of tracker hits. - * @return The list of tracker hits. - */ - //G4TrackerHitList getTrackerHitList(); - /**
* Add a TrackerHit. * @param[in] hit The Tracker hit to add. */
@@ -82,8 +61,6 @@
virtual G4bool ProcessHits(G4Step* step, G4TouchableHistory* touchable); protected:
- //G4TrackerHitsCollection* _HC; - //G4TrackerHitList _hits;
std::vector<TrackerHitsCollection*> _hitsCollections; };
--- projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/CalorimeterSD.cc 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/CalorimeterSD.cc 2014-05-07 18:54:53 UTC (rev 3108) @@ -15,14 +15,14 @@
CalorimeterSD::CalorimeterSD(G4String sdName, G4String hcName, Segmentation* sdSeg) : SensitiveDetector(sdName, hcName, SensitiveDetector::eCalorimeter), _segmentation(sdSeg) { // Setup a dummy hits collection that will be overridden later.
- _hitsCollections.push_back(0);
+ _hitsCollections.push_back(NULL);
} CalorimeterSD::CalorimeterSD(G4String sdName, const vector<G4String>& hcNames, Segmentation* sdSeg) : SensitiveDetector(sdName, hcNames, SensitiveDetector::eCalorimeter), _segmentation(sdSeg) { // Setup entries for each hits collection. These null pointers will be overridden later. for (int i = 0; i < (int) hcNames.size(); i++) {
- _hitsCollections.push_back(0);
+ _hitsCollections.push_back(NULL);
} }
@@ -40,7 +40,6 @@
} void CalorimeterSD::Initialize(G4HCofThisEvent *HCE) {
- clearHits();
// Loop over number of hits collections defined by this detector. for (int i = 0; i < getNumberOfHitsCollections(); i++) {
@@ -52,13 +51,15 @@
// Set the HCID of the collection if it has not been set already. if (getHCID(i) < 0) {
- //std::cout << "set HCID: " << GetCollectionID(i) << std::endl;
// This will set the HC ID in the list that is contained in SensitiveDetector parent class. setHCID(GetCollectionID(i), i); } // Add the hits collection to the hits collections of the event. HCE->AddHitsCollection(getHCID(i), _hitsCollections[i]);
+ + // Add a hit map for this collection. + _hitMaps.push_back(new CalorimeterHitMap());
} }
@@ -70,19 +71,8 @@
return SensitiveDetector::ProcessHits(aStep, 0); }
-//CalorimeterHit* CalorimeterSD::findHit(CalorimeterHit* aHit) -//{ -// return _hitMap.get(aHit->getId64bit()); -//} - -//CalorimeterHit* CalorimeterSD::findHit(CalorimeterHit* aHit, G4int nHC) -//{ -// return _hitMap.get(aHit->getId64bit()); -//} -
+/*
std::ostream& CalorimeterSD::printHits(std::ostream& os) {
- // FIXME: reimplement - /*
for (int i = 0; i < getNumberOfHitsCollections(); i++) { os << getHitsCollection(i)->GetName() << std::endl; for (CalorimeterHitList::const_iterator iter = _hitsVector[i].begin(); iter != _hitsVector[i].end(); iter++) {
@@ -90,18 +80,19 @@
} } os << std::endl;
- */
return os; }
+*/
void CalorimeterSD::EndOfEvent(G4HCofThisEvent *) {
-#ifdef G4VERBOSE - if ( getVerbose() > 1 ) { - printHits( std::cout );
+ + // Delete hit maps. + for (unsigned int i=0; i<_hitMaps.size(); i++) { + delete _hitMaps[i];
}
-#endif
- _hitMap.clear();
+ // Clear list of hit maps. + _hitMaps.clear();
} std::ostream& CalorimeterSD::printBasicInfo(std::ostream& os) {
@@ -115,53 +106,11 @@
return os; }
-double CalorimeterSD::getEdep() const { - // FIXME: reimplement - /* - double edep = 0.0; - for (CalorimeterHitList::const_iterator it = _hitsVector[0].begin(); it != _hitsVector[0].end(); it++) { - edep += (*it)->getEdep(); - } - return edep; - */ - return 0.; -} - -double CalorimeterSD::getEdep(G4int nHC) const { - // FIXME: reimplement - /* - double edep = 0.0; - for (CalorimeterHitList::const_iterator it = _hitsVector[nHC].begin(); it != _hitsVector[nHC].end(); it++) { - edep += (*it)->getEdep(); - } - return edep; - */ - return 0.; -} - -void CalorimeterSD::clearHits() { - //for (int i = 0; i < getNumberOfHitsCollections(); i++) { - // _hitsVector[i].clear(); - //} -} - -void CalorimeterSD::addHit(CalorimeterHit* hit) { - _hitsCollections[0]->insert(hit); - _hitMap.add(hit); -} -
void CalorimeterSD::addHit(CalorimeterHit* hit, int collectionIndex) {
- //std::cout << "adding hit" << hit << " to collection " << collectionIndex << std::endl;
_hitsCollections[collectionIndex]->insert(hit);
- //std::cout << "adding hit to map" << std::endl; - _hitMap.add(hit); - //std::cout << "done adding hit" << std::endl;
+ _hitMaps[collectionIndex]->add(hit);
}
-//CalorimeterHit* CalorimeterSD::findHit(const Id64bit& id) { -// return _hitMap.get(id); -//} - -CalorimeterHit* CalorimeterSD::findHit(const Id64bit& id) { - return _hitMap.get(id);
+CalorimeterHit* CalorimeterSD::findHit(const Id64bit& id, int collectionIndex) { + return _hitMaps[collectionIndex]->get(id);
}
--- projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/ScoringTrackerHitProcessor.cc 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/ScoringTrackerHitProcessor.cc 2014-05-07 18:54:53 UTC (rev 3108) @@ -28,7 +28,7 @@
if (!sameTrack) { // edep
- G4double e = step->GetTotalEnergyDeposit();
+ G4double edep = step->GetTotalEnergyDeposit();
// get track information //TrackInformation* trkInfo = TrackInformation::getTrackInformation(step);
@@ -36,12 +36,12 @@
// set hit flag in trk info //trkInfo->setHasTrackerHit(true);
- // hit data - G4int trkID = trackId; - G4double tdep = step->GetTrack()->GetGlobalTime(); - G4ThreeVector prePosition = step->GetPreStepPoint()->GetPosition(); - G4ThreeVector meanMomentum = 0.5 * (step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition());
+ // Get track ID. + G4int trackID = step->GetTrack()->GetTrackID();
+ // Get time from pre-step point. + G4double tdep = step->GetPreStepPoint()->GetGlobalTime(); +
// create hit TrackerHit* newHit = new TrackerHit();
@@ -49,19 +49,19 @@
Id64bit id64 = _tracker->makeIdentifier(step); // Get the start position from the pre-step point.
- G4ThreeVector start = step->GetPreStepPoint()->GetPosition();
+ G4ThreeVector startPosition = step->GetPreStepPoint()->GetPosition();
// Get the end position from the post-step point.
- G4ThreeVector end = step->GetPostStepPoint()->GetPosition();
+ G4ThreeVector endPosition = step->GetPostStepPoint()->GetPosition();
// Compute the step's path length.
- G4double length = sqrt(pow(start.x() - end.x(), 2) + pow(start.y() - end.y(), 2) + pow(start.z() - end.z(), 2));
+ G4double length = sqrt(pow(startPosition.x() - endPosition.x(), 2) + pow(startPosition.y() - endPosition.y(), 2) + pow(startPosition.z() - endPosition.z(), 2));
// Set the hit information.
- newHit->setTrackID(trkID); - newHit->setEdep(e); - newHit->setPosition(prePosition); - newHit->setMomentum(meanMomentum);
+ newHit->setTrackID(trackID); + newHit->setEdep(edep); + newHit->setPosition(startPosition); + newHit->setMomentum(step->GetPreStepPoint()->GetMomentum());
newHit->setTdep(tdep); newHit->setId(id64.getId0()); newHit->setLength(length);
--- projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/SensitiveDetector.cc 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/SensitiveDetector.cc 2014-05-07 18:54:53 UTC (rev 3108) @@ -22,9 +22,9 @@
using std::vector;
-const std::string& SensitiveDetector::trackerStr = "tracker"; -const std::string& SensitiveDetector::calorimeterStr = "calorimeter"; -const std::string& SensitiveDetector::noneStr = "none";
+const std::string& SensitiveDetector::TRACKER = "tracker"; +const std::string& SensitiveDetector::CALORIMETER = "calorimeter"; +const std::string& SensitiveDetector::UNKNOWN = "unknown";
SensitiveDetector::SensitiveDetector(G4String sdName, G4String hcName, EType sdType) : G4VSensitiveDetector(sdName), _idspec(0), _type(sdType) {
@@ -59,16 +59,6 @@
_messenger = new SensitiveDetectorMessenger(this); }
-//SensitiveDetector::SensitiveDetector(G4String name, EType type) -// : G4VSensitiveDetector(name), _idspec(0), _type(type) -//{ -// register detector with G4SDManager -// G4SDManager::GetSDMpointer()->AddNewDetector(this); - -// Create the command messenger. -// _messenger = new SensitiveDetectorMessenger(this); -//} -
SensitiveDetector::~SensitiveDetector() { // Delete registered HitProcessors. for (HitProcessors::iterator it = _hitProcessors.begin(); it != _hitProcessors.end(); it++) {
@@ -77,11 +67,9 @@
} void SensitiveDetector::Initialize(G4HCofThisEvent*) {
- // no-op
} void SensitiveDetector::EndOfEvent(G4HCofThisEvent*) {
- // no-op
} G4bool SensitiveDetector::ProcessHits(G4Step* aStep, G4TouchableHistory*) {
@@ -103,11 +91,12 @@
const std::string& SensitiveDetector::getTypeString() const { if (_type == eTracker) {
- return trackerStr;
+ return TRACKER;
} else if (_type == eCalorimeter) {
- return calorimeterStr;
+ return CALORIMETER; + } else { + return UNKNOWN;
}
- return noneStr;
} std::ostream& SensitiveDetector::printBasicInfo(std::ostream& os) {
@@ -127,28 +116,12 @@
} os << std::endl; } else {
- os << "idspec points to null!" << std::endl;
+ os << "No idspec for this detector." << std::endl;
} return os; }
-/* - Id64bit SensitiveDetector::makeId() const - { - Id64bit id64; - if (hasIdSpec()) { - - // get idvec ordered by this idspec - const IdVec ids = IdFactory::createOrderedIdVec(step(), this); - - // pack into 64 bit cell id - Id64bit id64 = IdFactory::createId64bit(ids, getIdSpec()); - } - return id64; - } - */ -
Id64bit SensitiveDetector::makeIdentifier(G4Step* step) const { Id64bit id64; if (hasIdSpec()) {
@@ -179,18 +152,6 @@
return hc; }
-std::ostream& SensitiveDetector::printNumberOfHits(std::ostream& os) { - for (int i = 0; i < getNumberOfHitsCollections(); i++) { - os << getHitsCollection(i)->GetName() << " " << getHitsCollection(i)->GetSize() << std::endl; - } - return os; -} - -std::ostream& SensitiveDetector::printEdep(std::ostream& os) { - os << "total edep: " << G4BestUnit(this->getEdep(), "Energy") << std::endl; - return os; -} -
std::vector<G4LogicalVolume*> SensitiveDetector::getLogicalVolumes() const { std::vector<G4LogicalVolume*> volumes; for (G4LogicalVolumeStore::const_iterator it = G4LogicalVolumeStore::GetInstance()->begin(); it != G4LogicalVolumeStore::GetInstance()->end();
@@ -275,21 +236,10 @@
return _endcap; }
-std::ostream& SensitiveDetector::printHits(std::ostream& os) { - return os; -} - -void SensitiveDetector::clearHits() { -} -
int SensitiveDetector::getNumberOfHitsCollections() const { return _hcids.size(); }
-double SensitiveDetector::getEdep() const { - return 0.0; -} -
void SensitiveDetector::setHCID(G4int hcid) { _hcids[0] = hcid; }
--- projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/SensitiveDetectorMessenger.cc 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/SensitiveDetectorMessenger.cc 2014-05-07 18:54:53 UTC (rev 3108) @@ -23,20 +23,14 @@
} SensitiveDetectorMessenger::~SensitiveDetectorMessenger() {
- // TODO: put command deletes here
+ // TODO: Delete command objects here.
} void SensitiveDetectorMessenger::SetNewValue(G4UIcommand* cmd, G4String newVals) { if (cmd == _printInfoCmd) { _detector->printBasicInfo(std::cout);
- } else if (cmd == _printNHitsCmd) { - _detector->printNumberOfHits(std::cout); - } else if (cmd == _printTotalEdepCmd) { - _detector->printEdep(std::cout);
} else if (cmd == _printVolumesCmd) { _detector->printVolumes(std::cout);
- } else if (cmd == _printHitsCmd) { - _detector->printHits(std::cout);
} else if (cmd == _verboseCmd) { _detector->setVerbose(_verboseCmd->GetNewIntValue(newVals)); } else if (cmd == _activateCmd) {
@@ -57,7 +51,7 @@
const G4String& name = sd->GetName(); // Name of the sensitive detector's command directory.
- const G4String& dirName = G4String("/detectors/" + name + "/");
+ const G4String& dirName = G4String("/lcdd/detectors/" + name + "/");
// Create the sensitive detector's Geant4 macro command directory. _detectorDir = new G4UIdirectory(dirName.c_str());
@@ -67,22 +61,10 @@
_printInfoCmd = new G4UIcommand(G4String(dirName + "print").c_str(), this); _printInfoCmd->SetGuidance(G4String("Print basic information about the sensitive detector " + name).c_str());
- // Print number of hits command. - _printNHitsCmd = new G4UIcommand(G4String(dirName + "printNumberOfHits").c_str(), this); - _printInfoCmd->SetGuidance(G4String("Print the number of hits from the detector " + name).c_str()); -
// Print energy deposition.
- _printTotalEdepCmd = new G4UIcommand(G4String(dirName + "printEdep").c_str(), this); - _printTotalEdepCmd->SetGuidance(G4String("Print the total energy deposition from the detector " + name).c_str()); - - // Print energy deposition.
_printVolumesCmd = new G4UIcommand(G4String(dirName + "printVolumes").c_str(), this); _printVolumesCmd->SetGuidance(G4String("Print a list of logical volume names associated with the detector " + name).c_str());
- // Print energy deposition. - _printHitsCmd = new G4UIcommand(G4String(dirName + "printHits").c_str(), this); - _printHitsCmd->SetGuidance(G4String("Print a list of hits from the detector " + name).c_str()); -
// Set the verbosity. _verboseCmd = new G4UIcmdWithAnInteger(G4String(dirName + "setVerbose").c_str(), this); _verboseCmd->SetGuidance(G4String("Set the verbosity of the detector " + name).c_str());
--- projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/TrackerSD.cc 2014-05-06 19:27:19 UTC (rev 3107) +++ projects/lcdd/branches/v04-00-00-pre/src/lcdd/detectors/TrackerSD.cc 2014-05-07 18:54:53 UTC (rev 3108) @@ -23,24 +23,6 @@
TrackerSD::~TrackerSD() { }
-/* - void TrackerSD::Initialize(G4HCofThisEvent *HCE) - { - clearHits(); - - // create tracker hits coll - _HC = new G4TrackerHitsCollection(GetName(), collectionName[0]); - - // set HCID - if (getHCID() < 0) { - setHCID(GetCollectionID(0)); - } - - // add collection to HC of event - HCE->AddHitsCollection(getHCID(), _HC); - } - */ -
void TrackerSD::Initialize(G4HCofThisEvent *HCE) { // Loop over number of hits collections defined by this detector. for (int i = 0; i < getNumberOfHitsCollections(); i++) {
@@ -65,46 +47,6 @@
return SensitiveDetector::ProcessHits(aStep, 0); }
-std::ostream& TrackerSD::printHits(std::ostream& os) { - /* - for (G4TrackerHitList::const_iterator iter = _hits.begin(); iter != _hits.end(); iter++) { - os << (*(const_cast<const TrackerHit*>(*iter))); - } - os << std::endl; - */ - return os; -} - -void TrackerSD::EndOfEvent(G4HCofThisEvent *) { - /* - #ifdef G4VERBOSE - if ( getVerbose() > 0 ) { - std::cout << GetName() << " has " << _HC->GetSize() << " hits." << std::endl; - } - - if ( getVerbose() > 1 ) { - printHits ( std::cout ); - } - #endif - */ - - clearHits(); -} - -double TrackerSD::getEdep() const { - double edep = 0.0; - /* - for (G4TrackerHitList::const_iterator it = _hits.begin(); it != _hits.end(); it++) { - edep += (*it)->getEdep(); - } - */ - return edep; -} - -void TrackerSD::clearHits() { - //_hits.clear(); -} -
void TrackerSD::addHit(TrackerHit* hit, int hcid) { _hitsCollections[hcid]->insert(hit); }
Use REPLY-ALL to reply to list
To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1